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

Issue 727603 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
NOT IN USE
Closed: May 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

:host rules do not apply with default html @namespace

Reported by r...@opera.com, May 30 2017

Issue description

Adding @namespace url(http://www.w3.org/1999/xhtml); to a shadow dom stylesheet causes simple :host rules to stop matching. Test case attached.

What happens is probably that we add an implicit namespaced universal selector in front of the :host rule which should not match when specified explicitly like htmlns|*:host. Instead, we should probably have an implicit namespace inside the host pseudo instead: :host(htmlns|*)

hayato@, kochi@: any comments?

 
host.html
261 bytes View Download

Comment 1 by r...@opera.com, May 30 2017

So, I think:

<style>
  @namespace url(http://www.w3.org/1999/xhtml);

  :host {} /* matches host regardless of namespace */
  :host(*|*) {} /* matches host regardless of namespace */
  :host(*) {} /* matches host if host is in html namespace */
</style>

Comment 3 by nainar@chromium.org, May 31 2017

Labels: Hotlist-Interop

Comment 4 by nainar@chromium.org, May 31 2017

Labels: Update-Quarterly

Comment 5 by kochi@chromium.org, May 31 2017

Sounds reasonable.
Adding a WPT test is a good idea.
Project Member

Comment 6 by bugdroid1@chromium.org, May 31 2017

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

commit 9eb2ce73f3fd97937175208086cfe85901e6ecf6
Author: Rune Lillesveen <rune@opera.com>
Date: Wed May 31 07:06:33 2017

Do not prepend implicit type selectors to :host rules.

:host and :host-context() should not have implicit type selectors pre-
pended for universal rules with default @namespace. Default @namespace
applies to type and universal selectors inside :host() and
:host-context(), but a default @namespace rule should not affect :host.
That is, :host matches the host element regardless of any @namespace
rules.

R=hayato@chromium.org,kochi@chromium.org
BUG= 727603 

Change-Id: I78d2919275aa6bdc4fdc5b02a4772d2352819258
Reviewed-on: https://chromium-review.googlesource.com/518019
Reviewed-by: Takayoshi Kochi <kochi@chromium.org>
Commit-Queue: Rune Lillesveen <rune@opera.com>
Cr-Commit-Position: refs/heads/master@{#475834}
[add] https://crrev.com/9eb2ce73f3fd97937175208086cfe85901e6ecf6/third_party/WebKit/LayoutTests/external/wpt/css/css-scoping-1/css-scoping-shadow-host-namespace.html
[modify] https://crrev.com/9eb2ce73f3fd97937175208086cfe85901e6ecf6/third_party/WebKit/Source/core/css/parser/CSSSelectorParser.cpp

Comment 7 by r...@opera.com, May 31 2017

Status: Fixed (was: Assigned)

Sign in to add a comment