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

Issue 15856002: First step of HTMLImports (Closed)

Created:
7 years, 7 months ago by Hajime Morrita
Modified:
7 years, 6 months ago
CC:
blink-reviews, gavinp+prerender_chromium.org, eae+blinkwatch, dglazkov+blink, apavlov+blink_chromium.org, adamk+blink_chromium.org, darktears, Nate Chapin, gavinp+loader_chromium.org, webcomponents-bugzilla_chromium.org
Visibility:
Public.

Description

Implement bare-bones of HTMLImports This CL includes following parts of HTMLImports - HTMLLinkElement.import property - Single-level imports loading - Duplication management - Imports of same URL point same DocumentFragment - Proper CORS control But it doesn't have: - Sub-import loading, - Anything more than DOM tree construction (like running script, etc.), - Reasonable performance: No progressive HTML parsing, no prefetching. This change introduces two major classes: HTMLImportsController and LinkImport: - The controller is a per-master-document registry of imports. It tracks all imports in the master document. - LinkImport is a dual of LinkStyle. It manages per-element states like imported document fragment. LinkImport is a client of CachedResource. Several parts of the core module are extended to adopt HTMLImports: - HTMLScriptRunner and StyleElement becomes aware of blocking imports. They pauses until all imports, not only stylesheets, are loaded before execution. - HTMLLinkElement adopts rel=import attribute and create a LinkImport instance instead of one of LinkStyle for the attribute. - LinkResource superclass is pulled out from LinkStyle and new LinkImport derives from it. BUG=240592 TEST=fast/html/imports/, http/tests/htmlimports/ R=dglazkov@chromium.org Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=151523

Patch Set 1 #

Total comments: 13

Patch Set 2 : Added HTTP-based tests #

Patch Set 3 : Got rid of CachedDocument usage #

Total comments: 13

Patch Set 4 : Addressed comments. #

Total comments: 1

Patch Set 5 : Added flag for HTMLLinkElement.import #

Patch Set 6 : Reabased #

Patch Set 7 : Fixed Mac build #

Unified diffs Side-by-side diffs Delta from patch set Stats (+950 lines, -129 lines) Patch
A LayoutTests/fast/html/imports/import-insert.html View 1 chunk +44 lines, -0 lines 0 comments Download
A LayoutTests/fast/html/imports/import-insert-expected.txt View 1 chunk +8 lines, -0 lines 0 comments Download
A LayoutTests/fast/html/imports/import-owner.html View 1 2 1 chunk +16 lines, -0 lines 0 comments Download
A LayoutTests/fast/html/imports/import-owner-expected.txt View 1 2 1 chunk +7 lines, -0 lines 0 comments Download
A LayoutTests/fast/html/imports/import-remove.html View 1 chunk +27 lines, -0 lines 0 comments Download
A LayoutTests/fast/html/imports/import-remove-expected.txt View 1 chunk +9 lines, -0 lines 0 comments Download
A LayoutTests/fast/html/imports/import-same-url.html View 1 chunk +15 lines, -0 lines 0 comments Download
A LayoutTests/fast/html/imports/import-same-url-expected.txt View 1 chunk +6 lines, -0 lines 0 comments Download
A LayoutTests/fast/html/imports/import-success-fail.html View 1 2 1 chunk +18 lines, -0 lines 0 comments Download
A LayoutTests/fast/html/imports/import-success-fail-expected.txt View 1 2 1 chunk +8 lines, -0 lines 0 comments Download
A LayoutTests/fast/html/imports/rel-import-to-style.html View 1 chunk +34 lines, -0 lines 0 comments Download
A LayoutTests/fast/html/imports/rel-import-to-style-expected.txt View 1 chunk +11 lines, -0 lines 0 comments Download
A LayoutTests/fast/html/imports/rel-style-to-import.html View 1 chunk +34 lines, -0 lines 0 comments Download
A LayoutTests/fast/html/imports/rel-style-to-import-expected.txt View 1 chunk +11 lines, -0 lines 0 comments Download
A LayoutTests/fast/html/imports/resources/bye.css View 1 chunk +3 lines, -0 lines 0 comments Download
A + LayoutTests/fast/html/imports/resources/bye.html View 1 chunk +2 lines, -1 line 0 comments Download
A + LayoutTests/fast/html/imports/resources/hello.css View 1 chunk +2 lines, -3 lines 0 comments Download
A + LayoutTests/fast/html/imports/resources/hello.html View 1 chunk +2 lines, -1 line 0 comments Download
A LayoutTests/fast/html/imports/resources/import-helpers.js View 1 chunk +48 lines, -0 lines 0 comments Download
A + LayoutTests/fast/html/imports/resources/placeholder.html View 1 chunk +2 lines, -2 lines 0 comments Download
A LayoutTests/http/tests/htmlimports/block-cookies.html View 1 1 chunk +14 lines, -0 lines 0 comments Download
A LayoutTests/http/tests/htmlimports/block-cookies-expected.txt View 1 1 chunk +6 lines, -0 lines 0 comments Download
A LayoutTests/http/tests/htmlimports/cors-same-origin.html View 1 1 chunk +13 lines, -0 lines 0 comments Download
A LayoutTests/http/tests/htmlimports/cors-same-origin-expected.txt View 1 1 chunk +5 lines, -0 lines 0 comments Download
A + LayoutTests/http/tests/htmlimports/cross-origin.html View 1 1 chunk +3 lines, -4 lines 0 comments Download
A + LayoutTests/http/tests/htmlimports/cross-origin-expected.txt View 1 1 chunk +5 lines, -3 lines 0 comments Download
A LayoutTests/http/tests/htmlimports/resources/cookie.cgi View 1 1 chunk +9 lines, -0 lines 0 comments Download
A + LayoutTests/http/tests/htmlimports/resources/cors-basic.cgi View 1 1 chunk +3 lines, -2 lines 0 comments Download
A LayoutTests/http/tests/htmlimports/resources/hello.html View 1 1 chunk +5 lines, -0 lines 0 comments Download
A + LayoutTests/http/tests/htmlimports/same-origin.html View 1 1 chunk +3 lines, -4 lines 0 comments Download
A LayoutTests/http/tests/htmlimports/same-origin-expected.txt View 1 1 chunk +5 lines, -0 lines 0 comments Download
M Source/core/core.gypi View 1 2 3 4 5 6 2 chunks +4 lines, -0 lines 0 comments Download
M Source/core/css/StyleSheetContents.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/Document.h View 1 2 3 5 chunks +10 lines, -0 lines 0 comments Download
M Source/core/dom/Document.cpp View 1 2 3 4 chunks +29 lines, -3 lines 0 comments Download
M Source/core/dom/ScriptElement.cpp View 1 2 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/ScriptableDocumentParser.h View 1 chunk +1 line, -1 line 0 comments Download
A Source/core/html/HTMLImportsController.h View 1 2 3 4 5 6 1 chunk +119 lines, -0 lines 0 comments Download
A Source/core/html/HTMLImportsController.cpp View 1 2 3 1 chunk +237 lines, -0 lines 0 comments Download
M Source/core/html/HTMLLinkElement.h View 1 2 3 4 5 6 6 chunks +31 lines, -13 lines 0 comments Download
M Source/core/html/HTMLLinkElement.cpp View 1 2 3 7 chunks +46 lines, -18 lines 0 comments Download
M Source/core/html/HTMLLinkElement.idl View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/html/LinkRelAttribute.h View 1 chunk +8 lines, -7 lines 0 comments Download
M Source/core/html/LinkRelAttribute.cpp View 2 chunks +10 lines, -4 lines 0 comments Download
A + Source/core/html/LinkResource.h View 1 2 3 4 5 6 1 chunk +34 lines, -26 lines 0 comments Download
A + Source/core/html/LinkResource.cpp View 1 chunk +17 lines, -18 lines 0 comments Download
M Source/core/html/parser/HTMLDocumentParser.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/parser/HTMLDocumentParser.cpp View 2 chunks +3 lines, -3 lines 0 comments Download
M Source/core/html/parser/HTMLScriptRunner.h View 2 chunks +4 lines, -4 lines 0 comments Download
M Source/core/html/parser/HTMLScriptRunner.cpp View 4 chunks +8 lines, -8 lines 0 comments Download
M Source/core/tests/LinkRelAttribute.cpp View 1 3 chunks +6 lines, -1 line 0 comments Download

Messages

Total messages: 20 (0 generated)
Hajime Morrita
This is not ready yet. I need to investigate how CORS things work and write ...
7 years, 7 months ago (2013-05-23 10:42:45 UTC) #1
dglazkov
Thanks for working on this. Some comments: https://codereview.chromium.org/15856002/diff/1/Source/core/html/HTMLImports.cpp File Source/core/html/HTMLImports.cpp (right): https://codereview.chromium.org/15856002/diff/1/Source/core/html/HTMLImports.cpp#newcode110 Source/core/html/HTMLImports.cpp:110: m_cachedDocument = ...
7 years, 7 months ago (2013-05-23 18:31:59 UTC) #2
Hajime Morrita
Thanks for the review! I'll come back soon. https://codereview.chromium.org/15856002/diff/1/Source/core/html/HTMLImports.cpp File Source/core/html/HTMLImports.cpp (right): https://codereview.chromium.org/15856002/diff/1/Source/core/html/HTMLImports.cpp#newcode110 Source/core/html/HTMLImports.cpp:110: m_cachedDocument ...
7 years, 7 months ago (2013-05-24 02:28:27 UTC) #3
dglazkov
https://codereview.chromium.org/15856002/diff/1/Source/core/html/HTMLImports.cpp File Source/core/html/HTMLImports.cpp (right): https://codereview.chromium.org/15856002/diff/1/Source/core/html/HTMLImports.cpp#newcode110 Source/core/html/HTMLImports.cpp:110: m_cachedDocument = m_owner->document()->cachedResourceLoader()->requestHTMLDocument(request); On 2013/05/24 02:28:27, morrita1 wrote: > ...
7 years, 7 months ago (2013-05-24 03:15:16 UTC) #4
Hajime Morrita
On 2013/05/24 03:15:16, Dimitri Glazkov wrote: > https://codereview.chromium.org/15856002/diff/1/Source/core/html/HTMLImports.cpp > File Source/core/html/HTMLImports.cpp (right): > > https://codereview.chromium.org/15856002/diff/1/Source/core/html/HTMLImports.cpp#newcode110 ...
7 years, 7 months ago (2013-05-24 03:31:15 UTC) #5
dglazkov
On 2013/05/24 03:31:15, morrita1 wrote: > On 2013/05/24 03:15:16, Dimitri Glazkov wrote: > > > ...
7 years, 7 months ago (2013-05-25 20:15:55 UTC) #6
Hajime Morrita
Thanks for sharing your thought, Dimitri! I think I'm getting your point. Considering that imported ...
7 years, 7 months ago (2013-05-27 08:15:10 UTC) #7
dglazkov
This is really taking a good shape. Also, this is helping me tremendously in shaping ...
7 years, 6 months ago (2013-05-28 17:12:47 UTC) #8
Hajime Morrita
https://codereview.chromium.org/15856002/diff/17001/Source/core/dom/Document.cpp File Source/core/dom/Document.cpp (right): https://codereview.chromium.org/15856002/diff/17001/Source/core/dom/Document.cpp#newcode868 Source/core/dom/Document.cpp:868: HTMLImports* Document::imports() On 2013/05/28 17:12:47, Dimitri Glazkov wrote: > ...
7 years, 6 months ago (2013-05-29 01:36:00 UTC) #9
dglazkov
LGTM, but this commit probably needs a better title before landing, like "Implement HTML Imports" ...
7 years, 6 months ago (2013-05-29 02:15:37 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/morrita@chromium.org/15856002/32001
7 years, 6 months ago (2013-05-29 07:38:29 UTC) #11
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
7 years, 6 months ago (2013-05-29 07:55:36 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/morrita@chromium.org/15856002/40001
7 years, 6 months ago (2013-05-29 08:42:30 UTC) #13
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
7 years, 6 months ago (2013-05-29 09:00:22 UTC) #14
Hajime Morrita
what's this :-( I need to try it locally.
7 years, 6 months ago (2013-05-29 23:25:18 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/morrita@chromium.org/15856002/45001
7 years, 6 months ago (2013-05-30 08:42:01 UTC) #16
commit-bot: I haz the power
Retried try job too often on linux_layout_rel for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_layout_rel&number=10890
7 years, 6 months ago (2013-05-30 09:36:03 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/morrita@chromium.org/15856002/45001
7 years, 6 months ago (2013-05-30 23:58:03 UTC) #18
commit-bot: I haz the power
Retried try job too often on win_layout_rel for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_layout_rel&number=7940
7 years, 6 months ago (2013-05-31 04:41:40 UTC) #19
Hajime Morrita
7 years, 6 months ago (2013-05-31 05:09:56 UTC) #20
Message was sent while issue was closed.
Committed patchset #7 manually as r151523 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698