New issue
Advanced search Search tips

Issue 600733 link

Starred by 2 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

<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.

 

Comment 2 by r...@opera.com, Apr 6 2016

Likewise for processing instructions.

Comment 3 by r...@opera.com, Apr 6 2016

Owner: r...@opera.com
Status: Started (was: Available)
Project Member

Comment 4 by bugdroid1@chromium.org, 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

Comment 5 by r...@opera.com, Apr 6 2016

Status: Fixed (was: Started)
Project Member

Comment 6 by bugdroid1@chromium.org, 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

Comment 7 by r...@opera.com, Apr 8 2016

Status: Assigned (was: Fixed)
Labels: Hotlist-Interop

Comment 9 by nainar@chromium.org, Feb 13 2017

Components: -Blink>Loader
The reverted CL is proof the fix lies in Style land. So retaining the CSS label 
Labels: Update-Quarterly
Project Member

Comment 11 by sheriffbot@chromium.org, Oct 19 2017

Labels: Hotlist-Recharge-BouncingOwner
Owner: ----
Status: Untriaged (was: Assigned)
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
Labels: Hotlist-Reassign-In-Nov
Owner: nainar@chromium.org
Status: Assigned (was: Untriaged)
Labels: -Hotlist-Recharge-BouncingOwner -Hotlist-Reassign-In-Nov
Owner: futhark@chromium.org
Cc: futhark@chromium.org
Owner: ----
Status: Available (was: Assigned)
Labels: -Update-Quarterly
Project Member

Comment 16 by sheriffbot@chromium.org, Dec 6

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
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
Status: Available (was: Untriaged)
Still an issue.

Sign in to add a comment