Re: [csswg-drafts] [css-scoping] Handling global name-defining constructs in shadow trees (#1995)

Okay. Note that we're not disputing that the need to pair each `@font-face` declaration with the scope for the purpose of writing a spec. I was mostly describing the author observable behavior in https://github.com/w3c/csswg-drafts/issues/1995#issuecomment-439275301.

If the reference of a global name is pair (name, scope), why should there be any ambiguity when it gets inherited to the content of a shadow tree? In the above example:
```html
<!doctype html>
<style>
@font-face { font-family: foo; src: url(foo); }
body { font-family: foo; }
</style>
This text is in the outer page's "foo" font.
<x-component>
 <::shadow>
  <style>
  @font-face { font-family: foo; src: url(bar); }
  p.special { font-family: foo; }
  </style>
  This inherits font-family: ("foo", document).
  <p class=special>This text is in the shadow's "foo" font on purpose.
 </::shadow>
</x-component>
```

The child of the shadow root refers to the `font-family` of ("foo", document) so we wouldn't accidentally resolve as ("foo", ::shadow). Any reference to "foo" within the shadow tree would implicitly resolve to ("foo", ::shadow) so there is no ambiguity there either.

-- 
GitHub Notification of comment by rniwa
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1995#issuecomment-483492922 using your GitHub account

Received on Tuesday, 16 April 2019 03:02:37 UTC