Bug 13722

Summary: Finish testing and fixing the setting of DOM attributes to JS null
Product: WebKit Reporter: Sam Weinig <sam>
Component: DOMAssignee: Sam Weinig <sam>
Status: RESOLVED FIXED    
Severity: Normal CC: alice.barraclough, ap, cdumez
Priority: P2    
Version: 523.x (Safari 3)   
Hardware: Mac   
OS: OS X 10.4   
Attachments:
Description Flags
patch to fix Core DOM attributes
darin: review+
Patch to fix CSSOM attributes
oliver: review+
Patch to fix CanvasRenderingContext2D attributes
oliver: review+
Patch to fix SVG attributes oliver: review+

Description Sam Weinig 2007-05-14 19:19:45 PDT
A number of attributes that were not tested in bug 13541 should be tested and if need be fixed.  These include:

-from the Core DOM
CharacterData.data
ProcessingInstruction.data
Attr.value

-from the CSSOM
CSSPageRule.selectorText
CSSRule.cssText
CSSStyleDeclaration.cssText
CSSStyleRule.selectorText
CSSValue.cssText
MediaList.mediaText

-from  the SVG DOM
SVGElement.id
SVGElement.xmlbase
SVGAngle.valueAsString
SVGLength.valueAsString
SVGScriptElement.type

-and from CanvasRenderingContext2D
CanvasRenderingContext2D.globalCompositeOperation
CanvasRenderingContext2D.lineCap
CanvasRenderingContext2D.lineJoin
CanvasRenderingContext2D.shadowColor

Test cases forthcoming
Comment 1 Sam Weinig 2007-05-15 10:33:08 PDT
Created attachment 14570 [details]
patch to fix Core DOM attributes

This patch fixes the remaining attributes in the Core DOM (CharacterData.data, ProcessingInstruction.data, and Attr.value).  Patched Attr.value to not throw an exception for null values as this matches the spec and Firefox.
Comment 2 Darin Adler 2007-05-15 10:46:37 PDT
Comment on attachment 14570 [details]
patch to fix Core DOM attributes

How about using dumpAsText for this test?

         [ConvertNullStringTo=Null, OldStyleObjC] DOMString substringData(in [IsIndex] unsigned long offset, 
-                                                           in [IsIndex] unsigned long length)
+                                                                         in [IsIndex] unsigned long length)

I'm not a big fan of "high-maintenance" formatting that requires changes to indentation when you rename things or add keywords. Maybe we can reconsider the way we're formatting .idl files at some point.

r=me
Comment 3 Sam Weinig 2007-05-15 11:18:49 PDT
Landed first patch in r21489 with Darin's suggestions.  Keeping bug open for remaining cases.
Comment 4 Sam Weinig 2007-05-15 15:49:07 PDT
Created attachment 14575 [details]
Patch to fix CSSOM attributes

Patch changes and tests the CSSOM attributes.  I could not test the PageRule one as we never create a PageRule as far as I can tell.
Comment 5 Sam Weinig 2007-05-15 19:34:23 PDT
Created attachment 14576 [details]
Patch to fix CanvasRenderingContext2D attributes
Comment 6 Sam Weinig 2007-05-15 20:48:12 PDT
Created attachment 14578 [details]
Patch to fix SVG attributes

Last one.
Comment 7 Oliver Hunt 2007-05-15 20:50:05 PDT
Comment on attachment 14578 [details]
Patch to fix SVG attributes

yay for idl!
Comment 8 Sam Weinig 2007-05-15 20:52:34 PDT
Second patch landed in r21502.  Third in r21504.
Comment 9 Sam Weinig 2007-05-15 20:58:17 PDT
Last patch landed in r21505!
Comment 10 Lucas Forschler 2019-02-06 09:04:01 PST
Mass moving XML DOM bugs to the "DOM" Component.