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

Issue 21182004: [HTML Imports] Make import loading in order. (Closed)

Created:
7 years, 4 months ago by Hajime Morrita
Modified:
7 years, 4 months ago
CC:
blink-reviews, dglazkov+blink, eae+blinkwatch, adamk+blink_chromium.org
Visibility:
Public.

Description

[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

Patch Set 1 #

Total comments: 4

Patch Set 2 : Addressed feedback. #

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

Messages

Total messages: 7 (0 generated)
Hajime Morrita
Dimitri, could you take a look? This is (hopefully) the last bit of imports before ...
7 years, 4 months ago (2013-07-30 11:51:27 UTC) #1
dglazkov
https://chromiumcodereview.appspot.com/21182004/diff/1/Source/core/html/HTMLImport.cpp File Source/core/html/HTMLImport.cpp (right): https://chromiumcodereview.appspot.com/21182004/diff/1/Source/core/html/HTMLImport.cpp#newcode108 Source/core/html/HTMLImport.cpp:108: import->setBlocked(false); Sounds like this gets marked as unblocked even ...
7 years, 4 months ago (2013-07-30 22:45:26 UTC) #2
Hajime Morrita
Thanks for the review Dimitri! I'll update this shortly. https://chromiumcodereview.appspot.com/21182004/diff/1/Source/core/html/HTMLImport.cpp File Source/core/html/HTMLImport.cpp (right): https://chromiumcodereview.appspot.com/21182004/diff/1/Source/core/html/HTMLImport.cpp#newcode108 Source/core/html/HTMLImport.cpp:108: ...
7 years, 4 months ago (2013-07-31 00:49:40 UTC) #3
Hajime Morrita
Updated. Could you take another look, Dimitri?
7 years, 4 months ago (2013-07-31 01:51:52 UTC) #4
dglazkov
lgtm
7 years, 4 months ago (2013-07-31 02:51:15 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/morrita@chromium.org/21182004/8001
7 years, 4 months ago (2013-07-31 04:03:34 UTC) #6
Hajime Morrita
7 years, 4 months ago (2013-07-31 08:01:00 UTC) #7
Message was sent while issue was closed.
Committed patchset #2 manually as r155228 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698