|
[HTML Imports] Make import loading in order.
This change makes script loading in order from script viewpoint.
That means, all imports and scripts inside them are now loaded and executed
bofore following script.
Similar facily has been partially implemented, where there is a guarantee that
all subimports are loaded before following script execution in the parent
import or the master document. This change extends it to support better ordering.
For example, let's think about following import dependency:
master - i0 - i1 - s0
- i2 - i3 - s1
where ix is an import and sx is a script.
In this example, master imports i0 and i2, i0 imports i1, and i1 includes s0, etc.
This change guarantees that s0 is executed before s1.
For this purpose, documents need to block the parser.
The blocking criteria is returned from HTMLImport::isBlocked().
(It was HTMLImport::haveChildrenLoaded() before.)
And this change is all about computing this "blocked" bit on each import.
There are three notable changes:
- Now the "blocked" bit is stored as HTMLImport::m_import flag. Originally it was
computed for each query. It becomes too complex and expensive to do on demand.
The flag is updated if a) new imports are requested via <link>, or b) an imported
document is completely parsed. (a) turns on flags since such new imports can
block existing import loading, then (b) is done for possibly unblocking them.
- The update phase is now done in a timer callback instead of doing it immediately
in notification from parsers and resources. This separation eliminates
hidden callback reentrancy and deep callstack, both of which are hard to debug.
See HTMLImportsController::unblockTimerFired() for more detail.
- HTMLImports got m_children list to represent dependency tree.
This list is used to traverse the dependnecy tree for updating the blocking flag.
BUG= 240592
TEST=htmlimpots/import-blocking-*.html
R=dglazkov@chromium.org
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=155228
Total comments: 4
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+223 lines, -68 lines) |
Patch |
|
A + |
LayoutTests/http/tests/htmlimports/import-blocking-child.html
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
A + |
LayoutTests/http/tests/htmlimports/import-blocking-child-blocks-child.html
|
View
|
|
1 chunk |
+2 lines, -4 lines |
0 comments
|
Download
|
|
A + |
LayoutTests/http/tests/htmlimports/import-blocking-child-blocks-child-expected.txt
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
A + |
LayoutTests/http/tests/htmlimports/import-blocking-child-expected.txt
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
A + |
LayoutTests/http/tests/htmlimports/import-blocking-nested-child.html
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
A + |
LayoutTests/http/tests/htmlimports/import-blocking-nested-child-blocks-child.html
|
View
|
|
1 chunk |
+2 lines, -4 lines |
0 comments
|
Download
|
|
A + |
LayoutTests/http/tests/htmlimports/import-blocking-nested-child-blocks-child-expected.txt
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
A + |
LayoutTests/http/tests/htmlimports/import-blocking-nested-child-blocks-nested-child.html
|
View
|
|
1 chunk |
+2 lines, -4 lines |
0 comments
|
Download
|
|
A + |
LayoutTests/http/tests/htmlimports/import-blocking-nested-child-blocks-nested-child-expected.txt
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
A + |
LayoutTests/http/tests/htmlimports/import-blocking-nested-child-expected.txt
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
A |
LayoutTests/http/tests/htmlimports/resources/blocked-script.js
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
A |
LayoutTests/http/tests/htmlimports/resources/blocking-script-js.cgi
|
View
|
|
1 chunk |
+10 lines, -0 lines |
0 comments
|
Download
|
|
A + |
LayoutTests/http/tests/htmlimports/resources/import-blocking-child-1.html
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
A + |
LayoutTests/http/tests/htmlimports/resources/import-blocking-child-2.html
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
A |
LayoutTests/http/tests/htmlimports/resources/import-blocking-nested-child-1.html
|
View
|
|
1 chunk |
+8 lines, -0 lines |
0 comments
|
Download
|
|
A |
LayoutTests/http/tests/htmlimports/resources/import-blocking-nested-child-2.html
|
View
|
|
1 chunk |
+8 lines, -0 lines |
0 comments
|
Download
|
|
M |
Source/core/dom/Document.cpp
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
Source/core/html/HTMLImport.h
|
View
|
1
|
2 chunks |
+31 lines, -3 lines |
0 comments
|
Download
|
|
M |
Source/core/html/HTMLImport.cpp
|
View
|
1
|
2 chunks |
+102 lines, -7 lines |
0 comments
|
Download
|
|
M |
Source/core/html/HTMLImportsController.h
|
View
|
|
3 chunks |
+11 lines, -6 lines |
0 comments
|
Download
|
|
M |
Source/core/html/HTMLImportsController.cpp
|
View
|
|
8 chunks |
+34 lines, -28 lines |
0 comments
|
Download
|
Total messages: 7 (0 generated)
|