Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(194)

Issue 1146393003: Make Attr.value/nodeValue/textContent not nullable (Closed)

Created:
5 years, 7 months ago by philipj_slow
Modified:
5 years, 7 months ago
Reviewers:
vivekg, Jens Widell
CC:
blink-reviews, blink-reviews-dom_chromium.org, arv+blink, vivekg_samsung, sof, eae+blinkwatch, dglazkov+blink, Inactive, rwlbuis
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Make 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+9 lines, -45 lines) Patch
D LayoutTests/fast/dom/Attr/update-attribute-node-null-value-no-crash.html View 1 1 chunk +0 lines, -22 lines 0 comments Download
D LayoutTests/fast/dom/Attr/update-attribute-node-null-value-no-crash-expected.txt View 1 1 chunk +0 lines, -17 lines 0 comments Download
M LayoutTests/fast/dom/coreDOM-element-attribute-js-null.xhtml View 1 2 1 chunk +3 lines, -1 line 0 comments Download
M LayoutTests/fast/dom/coreDOM-element-attribute-js-null-expected.txt View 1 2 1 chunk +3 lines, -1 line 0 comments Download
M Source/core/dom/Attr.idl View 1 2 1 chunk +3 lines, -4 lines 0 comments Download

Messages

Total messages: 16 (3 generated)
philipj_slow
PTAL
5 years, 7 months ago (2015-05-22 08:05:44 UTC) #2
vivekg
LGTM. Do we have test coverage for these cases? It would be great addition if ...
5 years, 7 months ago (2015-05-22 08:14:37 UTC) #3
Jens Widell
LGTM If we add [TreatNullAs=EmptyString] to nodeValue/textContent, we'd be fully compatible with FF/IE, I guess? ...
5 years, 7 months ago (2015-05-22 08:26:39 UTC) #4
philipj_slow
On 2015/05/22 08:14:37, vivekg_ wrote: > LGTM. Do we have test coverage for these cases? ...
5 years, 7 months ago (2015-05-22 09:17:48 UTC) #5
philipj_slow
On 2015/05/22 08:26:39, Jens Widell wrote: > LGTM > > If we add [TreatNullAs=EmptyString] to ...
5 years, 7 months ago (2015-05-22 09:29:37 UTC) #6
philipj_slow
update tests
5 years, 7 months ago (2015-05-22 09:41:12 UTC) #7
vivekg
On 2015/05/22 at 09:41:12, philipj wrote: > update tests LGTM
5 years, 7 months ago (2015-05-22 09:54:58 UTC) #8
philipj_slow
Hmm, 1% usage of nodeValue makes me nervous, I'll try to change the spec: https://github.com/whatwg/dom/pull/36
5 years, 7 months ago (2015-05-22 09:56:02 UTC) #9
philipj_slow
Add [TreatNullAs=EmptyString] to Attr.nodeValue/textContent
5 years, 7 months ago (2015-05-22 11:07:34 UTC) #10
philipj_slow
Can you take another look? I went with the [TreatNullAs=EmptyString] change and think it's likely ...
5 years, 7 months ago (2015-05-22 11:30:42 UTC) #11
Jens Widell
LGTM
5 years, 7 months ago (2015-05-22 11:37:41 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1146393003/40001
5 years, 7 months ago (2015-05-22 12:03:07 UTC) #15
commit-bot: I haz the power
5 years, 7 months ago (2015-05-22 13:19:45 UTC) #16
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=195785

Powered by Google App Engine
This is Rietveld 408576698