Reviewers: dominicc,
Message:
PTAL? This is what we discussed last week.
Description:
HTML Imports: No more BlockingDocumentCreation.
This change gets rid of HTMLImportState::BlockingDocumentCreation.
This is a perf improvement as Blink no longer delay parsing of imports
which leads earlier fetch requests.
To make it work, the change:
* Gets rid of the notion of "owning loader".
Now fewer places depends on the import tree ordering.
* HTMLImportLoader::addImport() is one of such place.
It does ensure that:
* The firstImport() is the first import of the same URL in
tree order of the import tree.
* The firstImport() has all children that is loaded by the document.
HTMLImport::recalcTreeState() and
HTMLImportLoader::shouldBlockScriptExecution()
relies on these invariants.
* The microtask queue of CustomElementMicrotaskImportSteps is got owned by
HTMLImportLoader. Also, now each HTMLImportChild can have the step
regardless of its tree order. This ensures that each imported document
blocks
microtask queue consumption of all referring documents.
* HTMLImportResolver::shouldBlockDocumentCreation() is merged into
shouldBlockScriptExecution()
The change on import-nested-dup.html is to cover the observable invariant of
script execution order more precisely.
TEST=import-dup-custom-element.html,import-nested-dup.html,import-nested-dup-2.html
R=
domi...@chromium.org
BUG=none
Please review this at
https://codereview.chromium.org/238923009/
SVN Base: svn://
svn.chromium.org/blink/trunk
Affected files (+259, -136 lines):
M LayoutTests/fast/html/imports/import-nested-dup.html
M LayoutTests/fast/html/imports/import-nested-dup-2.html
M LayoutTests/fast/html/imports/import-nested-dup-2-expected.txt
M LayoutTests/fast/html/imports/import-nested-dup-expected.txt
M LayoutTests/fast/html/imports/resources/nest-dup.html
A + LayoutTests/fast/html/imports/resources/nest-dup-child.html
A LayoutTests/http/tests/htmlimports/import-dup-custom-element.html
A
LayoutTests/http/tests/htmlimports/import-dup-custom-element-expected.txt
A LayoutTests/http/tests/htmlimports/resources/custom-element-def.html
A
LayoutTests/http/tests/htmlimports/resources/pointing-custom-element-def.html
A LayoutTests/http/tests/htmlimports/resources/using-custom-element-1.html
A LayoutTests/http/tests/htmlimports/resources/using-custom-element-2.html
M Source/core/core.gypi
M Source/core/dom/custom/CustomElementMicrotaskDispatcher.h
M Source/core/dom/custom/CustomElementMicrotaskDispatcher.cpp
M Source/core/dom/custom/CustomElementMicrotaskImportStep.h
M Source/core/dom/custom/CustomElementMicrotaskImportStep.cpp
M Source/core/dom/custom/CustomElementScheduler.cpp
A + Source/core/dom/custom/RefCountedCustomElementMicrotaskQueue.h
M Source/core/html/HTMLLinkElement.h
M Source/core/html/HTMLLinkElement.cpp
M Source/core/html/imports/HTMLImport.h
M Source/core/html/imports/HTMLImport.cpp
M Source/core/html/imports/HTMLImportChild.h
M Source/core/html/imports/HTMLImportChild.cpp
M Source/core/html/imports/HTMLImportLoader.h
M Source/core/html/imports/HTMLImportLoader.cpp
M Source/core/html/imports/HTMLImportState.h
M Source/core/html/imports/HTMLImportStateResolver.h
M Source/core/html/imports/HTMLImportStateResolver.cpp
M Source/core/html/imports/HTMLImportsController.h
M Source/core/html/imports/HTMLImportsController.cpp
M Source/core/html/imports/LinkImport.h
M Source/core/html/imports/LinkImport.cpp
M Source/wtf/TreeNode.h
M Source/wtf/TreeNodeTest.cpp