Re: [shadow-styling] Scoping at-rules like @font-face in scoped styled and shadow trees?

On Wed, Feb 26, 2014 at 3:09 PM, Cameron McCormack <cam@mcc.id.au> wrote:
> Tab Atkins Jr. wrote:
>> Because it's harder and slower to do a tree-walk like that, where
>> jumping to an ID-scoping root is cheap.
>
> For rules in the <style scoped> you don't need to search.

You will have to search, unless you're saying that rules in *another*
<style scoped> with the same scoping element can't refer to the scoped
name.  That would be inconsistent with allowing it in style='', and
inconsistent with what makes sense in a shadow root.

It's also just more difficult for us - we already have the data
structures set up to handle scoping names to shadow roots, but not
arbitrary elements.  Then again, we also don't have scoped stylesheets
right now.

> For style=""
> attributes on elements within a style scope, you are right that you won't
> know what your scope element is (although in Gecko we do know that the
> element is in a style scope) and will have to traverse up to find it.

While we're talking about style='', this seems fragile.  If this
allows arbitrary descendants to opt in, then it means that you can
accidentally co-opt it by inserting *another* scoped stylesheet
between the intended stylesheet and the element reffing the name.

Sticking to just ID-scoping roots avoids this, because those are very
intentional boundaries that are visible across the whole document, not
accidental ones meant to apply only to the contents of a single
stylesheet.

~TJ

Received on Wednesday, 26 February 2014 23:27:25 UTC