DescriptionMake Attr.value/nodeValue/textContent not nullable
https://dom.spec.whatwg.org/#interface-attr
The [TreatNullAs=EmptyString] addition has been proposed:
https://github.com/whatwg/dom/pull/36
An ad-hoc test for the behavior of setting these to null:
http://software.hixie.ch/utilities/js/live-dom-viewer/saved/3528
Firefox Nightly:
attr.value=null => getAttribute()=="null"
attr.nodeValue=null => getAttribute()==""
attr.textContent=null => getAttribute()==""
IE11 and Edge:
attr.value=null => getAttribute()=="null"
attr.nodeValue=null => getAttribute()==""
attr.textContent=null => getAttribute()==""
Safari 8:
attr.value=null => getAttribute()==null
attr.nodeValue=null => getAttribute()==null
attr.textContent=null => getAttribute()==""
Blink before this change:
attr.value=null => getAttribute()==null
attr.nodeValue=null => getAttribute()==null
attr.textContent=null => getAttribute()==null
Blink after this change:
attr.value=null => getAttribute()=="null"
attr.nodeValue=null => getAttribute()==""
attr.textContent=null => getAttribute()==""
Note that in the getAttribute()==null cases in WebKit and Blink,
hasAttribute() will still return true, which is very strange.
This change brings Blink into alignment with Firefox and IE, so the
risk of breakage ought to be very low.
The update-attribute-node-null-value-no-crash.html test serves no
purpose when Attr.value cannot be null, so it is removed.
BUG=460722
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=195785
Patch Set 1 #Patch Set 2 : update tests #Patch Set 3 : Add [TreatNullAs=EmptyString] to Attr.nodeValue/textContent #
Messages
Total messages: 16 (3 generated)
|