New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 817355 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Bug



Sign in to add a comment

Changing rel or href attribute of link rel="stylesheet" within shadow root does not remove stylesheet

Reported by tomalec...@gmail.com, Feb 28 2018

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.167 Safari/537.36

Steps to reproduce the problem:
1. Create shadow root,
2. Add `link rel="stylesheet"` into shadow root,
3. Add something to the shadow root, to see if rules from stylesheet are applied,
4. Change `rel` or `href` attribute of the link from 2. to something else,

http://jsbin.com/hosokep/6/edit?html,output

What is the expected behavior?
Rules should no longer be applied

What went wrong?
Rules are still applied as if it was `link rel="stylesheet" href="style.css"`

Did this work before? N/A 

Chrome version: 64.0.3282.167  Channel: stable
OS Version: 10.0
Flash Version: 

It is working exactly the same in V0 API http://jsbin.com/faboyeyiwe/1/edit?html,output
 
Labels: Needs-Triage-M64
Labels: Triaged-ET M-66 FoundIn-66 Target-66 OS-Linux OS-Mac
Status: Untriaged (was: Unconfirmed)
Able to reproduce this issue on Mac 10.13.3, Win-10 and Ubuntu 14.04 using chrome reported version #64.0.3282.167.
Note: On latest canary #66.0.3358.0, the output is a blank page.
This is a non-regression issue as it is observed from M60 old builds. 

Hence, marking it as untriaged to get more inputs from dev team.

Thanks...!!
Components: -Blink Blink>CSS Blink>DOM>ShadowDOM
This seems to be a CSS invalidation bug.

Comment 4 by e...@chromium.org, Mar 1 2018

Cc: futhark@chromium.org
Status: Available (was: Untriaged)
Labels: Hotlist-Interop

Comment 6 by hayato@chromium.org, Mar 29 2018

Cc: kochi@chromium.org
Owner: rakina@chromium.org
Status: Assigned (was: Available)
rakina@, could you work on this?

cc: kochi@
Project Member

Comment 7 by bugdroid1@chromium.org, Apr 5 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6b65abd7fa82b44258dd602846c49043c3b805a2

commit 6b65abd7fa82b44258dd602846c49043c3b805a2
Author: Rakina Zata Amni <rakina@chromium.org>
Date: Thu Apr 05 07:07:38 2018

Remove stylesheet of link element when rel != stylesheet

Stylesheets from link elements that previously have rel = "stylesheet"
but then changed to something else should be removed/not considered
anymore until the rel attribute is changed back to "stylesheet" again.

Currently this works correctly for link elements in the document tree,
but fails in link elements within a shadow tree because link elements
in shadow tree with rel attribute != "stylesheet"  are skipped from
processing. Because of that, the stylesheet in the link element was
never cleared and no style recalc happened.
JSBin from bug: http://jsbin.com/bojunajaju/edit?html,console,output


Bug:  817355 
Change-Id: I57c71c79c0cc471d36eb988b8a81eef82c33548a
Reviewed-on: https://chromium-review.googlesource.com/995116
Commit-Queue: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: Hayato Ito <hayato@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548357}
[add] https://crrev.com/6b65abd7fa82b44258dd602846c49043c3b805a2/third_party/WebKit/LayoutTests/external/wpt/html/semantics/document-metadata/the-link-element/link-rel-attribute.html
[add] https://crrev.com/6b65abd7fa82b44258dd602846c49043c3b805a2/third_party/WebKit/LayoutTests/external/wpt/html/semantics/document-metadata/the-link-element/resources/link-rel-attribute.css
[modify] https://crrev.com/6b65abd7fa82b44258dd602846c49043c3b805a2/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp
[modify] https://crrev.com/6b65abd7fa82b44258dd602846c49043c3b805a2/third_party/WebKit/Source/core/html/LinkStyle.cpp

Status: Fixed (was: Assigned)

Sign in to add a comment