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

Issue 23009004: Process Custom Elements in post-order. (Closed)

Created:
7 years, 4 months ago by dominicc (has gone to gerrit)
Modified:
7 years, 4 months ago
Reviewers:
dglazkov
CC:
blink-reviews, webcomponents-bugzilla_chromium.org, dglazkov+blink, dominicc+watchlist_chromium.org, eae+blinkwatch, adamk+blink_chromium.org
Visibility:
Public.

Description

Process Custom Elements in post-order. Custom Element upgrade + created callback invocation used to be processed in reverse-creation order, which is an expedient way to ensure that child elements are processed before parents (assuming no tree modification) so authors can access an element's content in the created callback. This changes the order. Descendants are still processed first, so authors can access an element's content in the created callback, but siblings are processed in creation order. Because Custom Element callbacks can have side effects, this makes Custom Elements behave more like script tags: If authors build constructs like <x-definition ...></> <x-use ...></> they can rely on the side effects of "definition" at the point of "use". This is based on a proposal described here: <https://www.w3.org/Bugs/Public/show_bug.cgi?id=22899>; BUG=234509 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=156141

Patch Set 1 #

Total comments: 4

Patch Set 2 : Avoid an explicit set of elements being parsed. #

Patch Set 3 : More accurate diff. #

Patch Set 4 : Minor cleanup. #

Patch Set 5 : Less fragile. #

Total comments: 3

Patch Set 6 : Patch for landing. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+121 lines, -93 lines) Patch
M LayoutTests/fast/dom/custom/created-callback.html View 2 chunks +7 lines, -7 lines 0 comments Download
M LayoutTests/fast/dom/custom/element-upgrade.html View 1 chunk +2 lines, -2 lines 0 comments Download
M LayoutTests/fast/dom/custom/element-upgrade-expected.txt View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/dom/custom/lifecycle-created-creation-api.html View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/dom/custom/lifecycle-created-creation-api-expected.txt View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/dom/custom/lifecycle-created-innerHTML.html View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/dom/custom/lifecycle-created-innerHTML-expected.txt View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/dom/custom/lifecycle-created-paste.html View 1 chunk +2 lines, -2 lines 0 comments Download
M LayoutTests/fast/dom/custom/lifecycle-created-paste-expected.txt View 1 chunk +2 lines, -2 lines 0 comments Download
M LayoutTests/fast/dom/custom/registration-context-delete-during-callback-recursion.html View 1 chunk +2 lines, -2 lines 0 comments Download
M LayoutTests/fast/dom/custom/registration-context-sharing.html View 1 chunk +3 lines, -3 lines 0 comments Download
M Source/core/dom/CustomElement.h View 1 2 3 4 5 2 chunks +3 lines, -2 lines 0 comments Download
M Source/core/dom/CustomElement.cpp View 1 2 3 4 5 chunks +36 lines, -18 lines 0 comments Download
M Source/core/dom/CustomElementCallbackDispatcher.h View 1 chunk +0 lines, -1 line 0 comments Download
M Source/core/dom/CustomElementCallbackDispatcher.cpp View 1 chunk +0 lines, -13 lines 0 comments Download
M Source/core/dom/CustomElementCallbackScheduler.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/CustomElementObserver.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/dom/CustomElementObserver.cpp View 1 1 chunk +8 lines, -0 lines 0 comments Download
M Source/core/dom/CustomElementRegistrationContext.h View 1 2 3 4 5 1 chunk +7 lines, -5 lines 0 comments Download
M Source/core/dom/CustomElementRegistrationContext.cpp View 1 2 3 4 5 5 chunks +5 lines, -21 lines 0 comments Download
M Source/core/dom/CustomElementUpgradeCandidateMap.h View 1 2 3 4 1 chunk +3 lines, -0 lines 0 comments Download
M Source/core/dom/CustomElementUpgradeCandidateMap.cpp View 1 2 3 4 1 chunk +17 lines, -0 lines 0 comments Download
M Source/core/dom/Element.cpp View 1 2 3 4 5 2 chunks +3 lines, -1 line 0 comments Download
M Source/core/dom/Node.h View 1 2 3 4 2 chunks +4 lines, -3 lines 0 comments Download
M Source/core/dom/Node.cpp View 1 2 3 4 1 chunk +8 lines, -4 lines 0 comments Download
M Source/core/scripts/make_names.pl View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 10 (0 generated)
dominicc (has gone to gerrit)
PTAL
7 years, 4 months ago (2013-08-13 05:31:33 UTC) #1
dglazkov
https://codereview.chromium.org/23009004/diff/1/Source/core/dom/CustomElement.cpp File Source/core/dom/CustomElement.cpp (right): https://codereview.chromium.org/23009004/diff/1/Source/core/dom/CustomElement.cpp#newcode96 Source/core/dom/CustomElement.cpp:96: if (!elementsBeingParsed().contains(element)) I am trying to figure out why ...
7 years, 4 months ago (2013-08-13 16:22:06 UTC) #2
dominicc (has gone to gerrit)
Thanks for the feedback. On 2013/08/13 16:22:06, Dimitri Glazkov wrote: > https://codereview.chromium.org/23009004/diff/1/Source/core/dom/CustomElement.cpp > File Source/core/dom/CustomElement.cpp ...
7 years, 4 months ago (2013-08-13 22:54:45 UTC) #3
dglazkov
On 2013/08/13 22:54:45, dominicc wrote: https://codereview.chromium.org/23009004/diff/1/Source/core/dom/CustomElementRegistrationContext.h#newcode62 > > Source/core/dom/CustomElementRegistrationContext.h:62: CreatedByCloning, > > Sounds like this ...
7 years, 4 months ago (2013-08-13 22:56:17 UTC) #4
dominicc (has gone to gerrit)
PTAL. This assumes Issue 23130005 goes first. The big change here is avoiding the set ...
7 years, 4 months ago (2013-08-14 05:10:32 UTC) #5
dominicc (has gone to gerrit)
My fuzzer tells me this is not good enough yet. The first design had the ...
7 years, 4 months ago (2013-08-14 05:52:18 UTC) #6
dominicc (has gone to gerrit)
OK, patch set 5 is more reliable. The fuzzer identifies one corner case in window ...
7 years, 4 months ago (2013-08-14 09:33:00 UTC) #7
dglazkov
lgtm https://codereview.chromium.org/23009004/diff/20001/Source/core/dom/CustomElement.cpp File Source/core/dom/CustomElement.cpp (right): https://codereview.chromium.org/23009004/diff/20001/Source/core/dom/CustomElement.cpp#newcode116 Source/core/dom/CustomElement.cpp:116: return definition; Switching definitions().get to definitionFor is a ...
7 years, 4 months ago (2013-08-14 20:22:34 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dominicc@chromium.org/23009004/28001
7 years, 4 months ago (2013-08-15 04:41:54 UTC) #9
commit-bot: I haz the power
7 years, 4 months ago (2013-08-15 06:01:41 UTC) #10
Message was sent while issue was closed.
Change committed as 156141

Powered by Google App Engine
This is Rietveld 408576698