[Bug 21391] [Shadow]: allow @host rules to match nodes in the host scope not just the host node

https://www.w3.org/Bugs/Public/show_bug.cgi?id=21391

Dominic Cooney <dominicc@chromium.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dominicc@chromium.org

--- Comment #4 from Dominic Cooney <dominicc@chromium.org> ---
I think a nice summary of this proposal is here:

<http://lists.w3.org/Archives/Public/public-webapps/2013JanMar/0661.html>

There were no responses on public-webapps at that time. FWIW I think this is a
good idea from a web developer ergonomics point of view.

I have a question about the proposed semantics in the case of nested shadows:
Are @host rules applied to the host's DOM, or to that DOM with distribution
done to its insertion points? For example, given this:

<div id="a">
  <div id="b">x</div>
</div>

<template id="t"> <!-- will be applied to #a -->
  <div id="c">
    <content></content>
  </div>
</template>

<template id="u"> <!-- will be applied to #c -->
  <style>
    @host {
      #b { color: green; }
    }
  </style>
  <content></content>
</template>

<script>
// Add a ShadowRoot to #a populated with #t
var root = document.querySelector('#a').createShadowRoot();
root.appendChild(document.querySelector('#t').content);

// Add a ShadowRoot to #c populated with #u
root.querySelector('#c').createShadowRoot()
.appendChild(document.querySelector('#u').content);
</script>

In this case, does the "x" appear in green or not?

My fear is that, based on the same rationale behind reprojection, the selectors
should be run on the result of distribution. But unlike the select attribute,
@host rules have access to the full power of CSS selectors. That will make
doing a high-performance implementation more difficult.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Sunday, 2 June 2013 01:12:35 UTC