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

Issue 2200613002: The HTML parser synchronously creates custom elements (Closed)

Created:
4 years, 4 months ago by dominicc (has gone to gerrit)
Modified:
4 years, 4 months ago
CC:
blink-reviews, blink-reviews-dom_chromium.org, blink-reviews-html_chromium.org, chromium-reviews, dglazkov+blink, dominicc+watchlist_chromium.org, eae+blinkwatch, kinuko+watch, rwlbuis, sof, webcomponents-bugzilla_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

The HTML parser synchronously creates custom elements This starts to make element creation match the HTML spec's "create an element for a token" steps <https://html.spec.whatwg.org/#create-an-element-for-the-token>; In particular, it starts running custom element constructors synchronously. This changes the relationship between CustomElementsRegistry and V0CustomElementRegistrationContext. These objects have references to one another to prevent competing definitions in V0 and V1. CustomElementsRegistry have affinity to a window; V0CustomElementRegistrationContexts have affinity to documents. Previously the relationship between CustomElementsRegistry and V0CustomElementsRegistrationContext was 1:1, but that is inaccurate, because a window may replace its document. Now it is 1:M. For the same reason this adds a pointer from the CustomElementsRegistry back to its owner LocalDOMWindow, instead of holding onto the window's document directly. Consequently CustomElementsRegistryTests have all become DummyPageHolder browser tests because they need windows. BUG=594918 Committed: https://crrev.com/5ec3e5c806702bd96aad3920f02b9dddc997e41e Cr-Commit-Position: refs/heads/master@{#411941}

Patch Set 1 #

Patch Set 2 : Hacky script nesting level integration. #

Patch Set 3 : An iteration. #

Patch Set 4 : Getting closer. #

Patch Set 5 : Moar tests. #

Patch Set 6 : Allow detached script runner to proceed. #

Patch Set 7 : document.write tests. #

Patch Set 8 : Add tests for innerHTML. #

Total comments: 7

Patch Set 9 : Better test. #

Patch Set 10 : Add a test for no browsing context case. #

Patch Set 11 : Bring patch to head. #

Total comments: 2

Patch Set 12 : Remove redundant code. #

Patch Set 13 : Rebase. #

Total comments: 8

Patch Set 14 : Rebase. #

Patch Set 15 : Clarifying comments; reentry permit is refcounted. #

Patch Set 16 : Eliminate redundant TODOs. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+628 lines, -98 lines) Patch
A third_party/WebKit/LayoutTests/custom-elements/spec/parsing.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +285 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/custom-elements/spec/resources/custom-elements-helpers.js View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/core.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Document.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/custom/CustomElementsRegistry.h View 1 2 3 5 chunks +14 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/core/dom/custom/CustomElementsRegistry.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 5 chunks +37 lines, -12 lines 0 comments Download
M third_party/WebKit/Source/core/dom/custom/CustomElementsRegistryTest.cpp View 1 2 3 4 5 5 chunks +15 lines, -50 lines 0 comments Download
M third_party/WebKit/Source/core/frame/LocalDOMWindow.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +6 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +7 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 5 chunks +111 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +3 lines, -2 lines 0 comments Download
A third_party/WebKit/Source/core/html/parser/HTMLParserReentryPermit.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +95 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/core/html/parser/HTMLParserReentryPermit.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +18 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/parser/HTMLScriptRunner.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 5 chunks +7 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/core/html/parser/HTMLScriptRunner.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 5 chunks +10 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/core/html/parser/HTMLTreeBuilder.cpp View 1 2 3 2 chunks +4 lines, -3 lines 0 comments Download

Messages

Total messages: 55 (43 generated)
dominicc (has gone to gerrit)
PTAL Bit concerned about perf, suggestions welcome. kojii--custom elements stuff. We need to track the ...
4 years, 4 months ago (2016-08-05 07:29:42 UTC) #15
dominicc (has gone to gerrit)
In particular, many parser perf tests use innerHTML, which doesn't go down this path.
4 years, 4 months ago (2016-08-05 08:12:36 UTC) #16
domenic
https://codereview.chromium.org/2200613002/diff/140001/third_party/WebKit/LayoutTests/custom-elements/spec/parsing.html File third_party/WebKit/LayoutTests/custom-elements/spec/parsing.html (right): https://codereview.chromium.org/2200613002/diff/140001/third_party/WebKit/LayoutTests/custom-elements/spec/parsing.html#newcode22 third_party/WebKit/LayoutTests/custom-elements/spec/parsing.html:22: Array.prototype.forEach.call(document.querySelectorAll('iframe'), (f) => { What does this function do? ...
4 years, 4 months ago (2016-08-05 08:39:51 UTC) #17
kojii
https://codereview.chromium.org/2200613002/diff/200001/third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.cpp File third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.cpp (right): https://codereview.chromium.org/2200613002/diff/200001/third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.cpp#newcode847 third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.cpp:847: if (!element) { ScriptCustomElementDefinition::createElementSync, when you call without ExceptionState, ...
4 years, 4 months ago (2016-08-08 07:47:31 UTC) #24
dominicc (has gone to gerrit)
PTAL domenic, kojii, I think all of your comments have been addressed. https://codereview.chromium.org/2200613002/diff/140001/third_party/WebKit/LayoutTests/custom-elements/spec/parsing.html File third_party/WebKit/LayoutTests/custom-elements/spec/parsing.html ...
4 years, 4 months ago (2016-08-15 01:33:15 UTC) #35
kojii
lgtm
4 years, 4 months ago (2016-08-15 02:05:11 UTC) #36
kouhei (in TOK)
https://codereview.chromium.org/2200613002/diff/240001/third_party/WebKit/LayoutTests/custom-elements/spec/parsing.html File third_party/WebKit/LayoutTests/custom-elements/spec/parsing.html (right): https://codereview.chromium.org/2200613002/diff/240001/third_party/WebKit/LayoutTests/custom-elements/spec/parsing.html#newcode56 third_party/WebKit/LayoutTests/custom-elements/spec/parsing.html:56: 'use strict'; Nit: indent https://codereview.chromium.org/2200613002/diff/240001/third_party/WebKit/LayoutTests/custom-elements/spec/parsing.html#newcode78 third_party/WebKit/LayoutTests/custom-elements/spec/parsing.html:78: return document.documentElement; add ...
4 years, 4 months ago (2016-08-15 02:10:31 UTC) #37
dominicc (has gone to gerrit)
Thanks for the feedback. All done--PTAL. A couple of comments inline. On 2016/08/15 at 02:10:31, ...
4 years, 4 months ago (2016-08-15 04:51:52 UTC) #46
kouhei (in TOK)
lgtm
4 years, 4 months ago (2016-08-15 04:55:20 UTC) #47
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2200613002/300001
4 years, 4 months ago (2016-08-15 05:54:32 UTC) #52
commit-bot: I haz the power
Committed patchset #16 (id:300001)
4 years, 4 months ago (2016-08-15 06:07:13 UTC) #53
commit-bot: I haz the power
4 years, 4 months ago (2016-08-15 06:09:19 UTC) #55
Message was sent while issue was closed.
Patchset 16 (id:??) landed as
https://crrev.com/5ec3e5c806702bd96aad3920f02b9dddc997e41e
Cr-Commit-Position: refs/heads/master@{#411941}

Powered by Google App Engine
This is Rietveld 408576698