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

Issue 316583002: Correctly handle accessing a replaced Attr object's attribute value. (Closed)

Created:
6 years, 6 months ago by sof
Modified:
6 years, 6 months ago
Reviewers:
Inactive, adamk, eseidel
CC:
blink-reviews, blink-reviews-html_chromium.org, sof, eae+blinkwatch, blink-reviews-dom_chromium.org, dglazkov+blink, rwlbuis
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Correctly handle accessing a replaced Attr object's attribute value. If element.setAttributeNode(attr) is performed on an "element" with an attribute that matches "attr.name", that attribute's value is updated and attr is attached to "element". Later accesses of "attr.value" must continue to resolve to "element"'s underlying attribute, matching (local) names following the case sensitivity of the element. A normalized local name was previously assumed for the attribute, leading to crashing conditions on both setting and getting "attr.value". Address by having Attr record the local name of the element attribute it is attached to and use that when looking up the attribute. R=adamk@chromium.org BUG=376718 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=175556

Patch Set 1 #

Total comments: 2

Patch Set 2 : Have Attr track local name of attached attribute, if needed. #

Total comments: 2

Patch Set 3 : Add setAttributeNode() FIXME #

Unified diffs Side-by-side diffs Delta from patch set Stats (+97 lines, -20 lines) Patch
A LayoutTests/fast/dom/Attr/update-attribute-node-no-crash.html View 1 1 chunk +26 lines, -0 lines 0 comments Download
A LayoutTests/fast/dom/Attr/update-attribute-node-no-crash-expected.txt View 1 1 chunk +18 lines, -0 lines 0 comments Download
M Source/core/dom/Attr.h View 1 3 chunks +8 lines, -4 lines 0 comments Download
M Source/core/dom/Attr.cpp View 1 8 chunks +25 lines, -11 lines 0 comments Download
M Source/core/dom/Element.cpp View 1 2 1 chunk +20 lines, -5 lines 0 comments Download

Messages

Total messages: 13 (0 generated)
sof
Please take a look.
6 years, 6 months ago (2014-06-03 14:55:29 UTC) #1
Inactive
https://codereview.chromium.org/316583002/diff/1/Source/core/html/HTMLSelectElement.cpp File Source/core/html/HTMLSelectElement.cpp (right): https://codereview.chromium.org/316583002/diff/1/Source/core/html/HTMLSelectElement.cpp#newcode326 Source/core/html/HTMLSelectElement.cpp:326: if (Attribute* sizeAttribute = ensureUniqueElementData().getAttributeItem(sizeAttr, true)) Gosh, another boolean ...
6 years, 6 months ago (2014-06-03 15:11:39 UTC) #2
sof
https://codereview.chromium.org/316583002/diff/1/Source/core/html/HTMLSelectElement.cpp File Source/core/html/HTMLSelectElement.cpp (right): https://codereview.chromium.org/316583002/diff/1/Source/core/html/HTMLSelectElement.cpp#newcode326 Source/core/html/HTMLSelectElement.cpp:326: if (Attribute* sizeAttribute = ensureUniqueElementData().getAttributeItem(sizeAttr, true)) On 2014/06/03 15:11:39, ...
6 years, 6 months ago (2014-06-03 15:21:50 UTC) #3
eseidel
I had always assumed the crashes were part of our deprcation strategy for attr nodes. ...
6 years, 6 months ago (2014-06-03 16:45:44 UTC) #4
eseidel
I'm really having trouble caring about this CL. I'm glad to see a crash fixed, ...
6 years, 6 months ago (2014-06-03 16:47:37 UTC) #5
sof
Thanks for the feedback. Taken into account by having the Attr track the local name ...
6 years, 6 months ago (2014-06-04 11:33:18 UTC) #6
sof
adamk: eseidel is taking a well-earned break, it seems - might you be interested in ...
6 years, 6 months ago (2014-06-04 21:42:04 UTC) #7
adamk
lgtm, I think you've addressed eseidel's worry, and I agree with him that the details ...
6 years, 6 months ago (2014-06-05 00:26:33 UTC) #8
sof
Thanks for the reviews everyone. https://codereview.chromium.org/316583002/diff/20001/LayoutTests/fast/dom/Attr/update-attribute-node-no-crash.html File LayoutTests/fast/dom/Attr/update-attribute-node-no-crash.html (right): https://codereview.chromium.org/316583002/diff/20001/LayoutTests/fast/dom/Attr/update-attribute-node-no-crash.html#newcode13 LayoutTests/fast/dom/Attr/update-attribute-node-no-crash.html:13: // This aligns with ...
6 years, 6 months ago (2014-06-05 06:58:26 UTC) #9
sof
The CQ bit was checked by sigbjornf@opera.com
6 years, 6 months ago (2014-06-05 06:58:36 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sigbjornf@opera.com/316583002/40001
6 years, 6 months ago (2014-06-05 06:59:06 UTC) #11
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: mac_blink_rel on tryserver.blink ...
6 years, 6 months ago (2014-06-05 08:26:55 UTC) #12
commit-bot: I haz the power
6 years, 6 months ago (2014-06-05 11:20:51 UTC) #13
Message was sent while issue was closed.
Change committed as 175556

Powered by Google App Engine
This is Rietveld 408576698