<style> and <link> applied differently for loading @imports
Reported by
r...@opera.com,
Apr 5 2016
|
||||||||||||||
Issue description
This can typically happen for updateLayoutIgnorePendingStyleSheets().
Here, <body> will be green while slow.css is loading:
<style>
@import url(slow.css)
body { color: green }
</style>
while here, body will not be green while slow.css is loading:
<link rel="stylesheet" href="data:text/css,@import url(slow.css); body { color:green }">
This seems inconsistent to me. I think the link-behavior makes most sense.
,
Apr 6 2016
Likewise for processing instructions.
,
Apr 6 2016
,
Apr 6 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/456c101025b6c470dce2a6af3b0d70cb2950a980 commit 456c101025b6c470dce2a6af3b0d70cb2950a980 Author: rune <rune@opera.com> Date: Wed Apr 06 22:13:30 2016 Don't apply style elements or PIs with loading imports. updateLayoutTreeIgnorePendingStylesheets may resolve styles when sheets are loading. For link elements, the main stylesheet is not applied if any of its @imports are still loading. For style elements and xml-stylesheets, we did apply the contents of the main stylesheet while its @imports were loading. That means we applied half-baked stylesheets and we had an inconsistency between link and style. Instead regard style elements and processing instructions as loading when @imports are loading. BUG=600733 Review URL: https://codereview.chromium.org/1867513002 Cr-Commit-Position: refs/heads/master@{#385564} [add] https://crrev.com/456c101025b6c470dce2a6af3b0d70cb2950a980/third_party/WebKit/LayoutTests/http/tests/css/ignore-pending-link-import-expected.txt [add] https://crrev.com/456c101025b6c470dce2a6af3b0d70cb2950a980/third_party/WebKit/LayoutTests/http/tests/css/ignore-pending-link-import.html [add] https://crrev.com/456c101025b6c470dce2a6af3b0d70cb2950a980/third_party/WebKit/LayoutTests/http/tests/css/ignore-pending-pi-import-expected.txt [add] https://crrev.com/456c101025b6c470dce2a6af3b0d70cb2950a980/third_party/WebKit/LayoutTests/http/tests/css/ignore-pending-pi-import.xhtml [add] https://crrev.com/456c101025b6c470dce2a6af3b0d70cb2950a980/third_party/WebKit/LayoutTests/http/tests/css/ignore-pending-style-import-expected.txt [add] https://crrev.com/456c101025b6c470dce2a6af3b0d70cb2950a980/third_party/WebKit/LayoutTests/http/tests/css/ignore-pending-style-import.html [modify] https://crrev.com/456c101025b6c470dce2a6af3b0d70cb2950a980/third_party/WebKit/Source/core/dom/StyleSheetCandidate.cpp
,
Apr 6 2016
,
Apr 8 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/e0eec65f8c6f763775fbf7df75c52ea6c680ea90 commit e0eec65f8c6f763775fbf7df75c52ea6c680ea90 Author: rune <rune@opera.com> Date: Fri Apr 08 15:22:21 2016 Revert of Don't apply style elements or PIs with loading imports. (patchset #2 id:20001 of https://codereview.chromium.org/1867513002/ ) Reason for revert: This change is incompatible with what Gecko and Blink used to do when inserting an @import rule with insertRule() into a style element sheet. Inserting a style element with script, immediately followed by an @import insertRule() behaves differently than inserting the style element containing that @import rule in the text because the <style> element is processed before the insertRule. Both Gecko and Blink (without this CL) applies the main stylesheet while the @import inserted with insertRule is loading, while they don't when @import is part of the text node child. The behavior for inserting @import is not specified, and zcorpan reported [1]. [1] https://www.w3.org/Bugs/Public/show_bug.cgi?id=29566 Original issue's description: > Don't apply style elements or PIs with loading imports. > > updateLayoutTreeIgnorePendingStylesheets may resolve styles when sheets > are loading. For link elements, the main stylesheet is not applied if > any of its @imports are still loading. For style elements and > xml-stylesheets, we did apply the contents of the main stylesheet while > its @imports were loading. That means we applied half-baked stylesheets > and we had an inconsistency between link and style. Instead regard > style elements and processing instructions as loading when @imports are > loading. > > BUG=600733 > > Committed: https://crrev.com/456c101025b6c470dce2a6af3b0d70cb2950a980 > Cr-Commit-Position: refs/heads/master@{#385564} TBR=esprehn@chromium.org,timloh@chromium.org # Not skipping CQ checks because original CL landed more than 1 days ago. BUG=600733 Review URL: https://codereview.chromium.org/1867753006 Cr-Commit-Position: refs/heads/master@{#386081} [delete] https://crrev.com/0c7efcf9ce5d2223c6aba69b94be77da64adea2b/third_party/WebKit/LayoutTests/http/tests/css/ignore-pending-link-import-expected.txt [delete] https://crrev.com/0c7efcf9ce5d2223c6aba69b94be77da64adea2b/third_party/WebKit/LayoutTests/http/tests/css/ignore-pending-link-import.html [delete] https://crrev.com/0c7efcf9ce5d2223c6aba69b94be77da64adea2b/third_party/WebKit/LayoutTests/http/tests/css/ignore-pending-pi-import-expected.txt [delete] https://crrev.com/0c7efcf9ce5d2223c6aba69b94be77da64adea2b/third_party/WebKit/LayoutTests/http/tests/css/ignore-pending-pi-import.xhtml [delete] https://crrev.com/0c7efcf9ce5d2223c6aba69b94be77da64adea2b/third_party/WebKit/LayoutTests/http/tests/css/ignore-pending-style-import-expected.txt [delete] https://crrev.com/0c7efcf9ce5d2223c6aba69b94be77da64adea2b/third_party/WebKit/LayoutTests/http/tests/css/ignore-pending-style-import.html [modify] https://crrev.com/e0eec65f8c6f763775fbf7df75c52ea6c680ea90/third_party/WebKit/Source/core/dom/StyleSheetCandidate.cpp
,
Apr 8 2016
,
Aug 10 2016
,
Feb 13 2017
The reverted CL is proof the fix lies in Style land. So retaining the CSS label
,
Feb 13 2017
,
Oct 19 2017
The assigned owner "rune@opera.com" is not able to receive e-mails, please re-triage. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Oct 19 2017
,
Nov 8 2017
,
Nov 30 2017
,
Dec 6 2017
,
Dec 6
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Dec 7
Still an issue. |
||||||||||||||
►
Sign in to add a comment |
||||||||||||||
Comment 1 by r...@opera.com
, Apr 6 2016