This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 19681 - [Shadow]: Refactor styles to get rid of rule applicability
Summary: [Shadow]: Refactor styles to get rid of rule applicability
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: HISTORICAL - Component Model (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Dimitri Glazkov
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 18428
  Show dependency treegraph
 
Reported: 2012-10-23 22:52 UTC by Dimitri Glazkov
Modified: 2012-10-31 21:41 UTC (History)
2 users (show)

See Also:


Attachments

Description Dimitri Glazkov 2012-10-23 22:52:14 UTC
Rule applicability algorithm is complex and unintuitive.

It also has mistakes: https://www.w3.org/Bugs/Public/show_bug.cgi?id=16317#c9

Instead, we should just enumerate constraints.
Comment 1 Takashi Sakamoto 2012-10-24 02:55:47 UTC
>There is not /select/ attribute on "shadow". Can you explain why we would need something like this? (possibly on a new bug :P)

So only shadow reference combinator doesn't work for <shadow>? I'm thinking of something like:

<x-A>
  <template>
    <style>
    content /select/ div.special { color: red; }
    </style>
    <content>
  </template>
</x-a>

<x-B extend="x-A">
  <template>
    <style>
    shadow /select/ div.special { color: blue; }
    </style>
    <shadow>
  </template>
</x-B>

So, x-B cannot apply any styles to distributed nodes?

If we depend on select attribute, we can add our own fake select attribute to <shadow>. (It doesn't work, but <shadow> can have select.>

I'mean:

<shadow id="x">...

getElementById("x").setAttribute("select", ":first-child");

So, "select" should be used when solving /select/?

Best regards,
Takashi Sakamoto
Comment 2 Dimitri Glazkov 2012-10-24 03:06:19 UTC
(In reply to comment #1)
> >There is not /select/ attribute on "shadow". Can you explain why we would need something like this? (possibly on a new bug :P)

When I asked for a new bug, I didn't realize you were going to to reuse my other bug for this. I am starting to worry that I am mis-communicating something. I want to keep discussions on bugs focused and easily understood. That's why we have multiple bugs. One issue -- one bug. This bug is about refactoring the styles section to get rid of rule applicability algorithm. I can't figure out how the <shadow> discussion in your comment relates to it. I guess they are all related to styles. But then again, all bugs I've filed are related to Shadow DOM -- it doesn't mean we have just one bug for the whole spec :)
> 
> So only shadow reference combinator doesn't work for <shadow>? I'm thinking
> of something like:
> 
> <x-A>
>   <template>
>     <style>
>     content /select/ div.special { color: red; }
>     </style>
>     <content>
>   </template>
> </x-a>
> 
> <x-B extend="x-A">
>   <template>
>     <style>
>     shadow /select/ div.special { color: blue; }
>     </style>
>     <shadow>
>   </template>
> </x-B>
> 
> So, x-B cannot apply any styles to distributed nodes?

> 
> If we depend on select attribute, we can add our own fake select attribute
> to <shadow>. (It doesn't work, but <shadow> can have select.>
> 
> I'mean:
> 
> <shadow id="x">...
> 
> getElementById("x").setAttribute("select", ":first-child");
> 
> So, "select" should be used when solving /select/?

Not necessarily, I guess. However, I would avoid adding features to the spec until we have a good use case for it. I don't think there is one right now.
Comment 3 Takashi Sakamoto 2012-10-24 03:47:31 UTC
I'm sorry. I should file a new bug...

Now I can find the reason why I feel a little odd about a select reference combinator.

I filed a new bug, https://www.w3.org/Bugs/Public/show_bug.cgi?id=19684


(In reply to comment #2)
> (In reply to comment #1)
> > >There is not /select/ attribute on "shadow". Can you explain why we would need something like this? (possibly on a new bug :P)
> 
> When I asked for a new bug, I didn't realize you were going to to reuse my
> other bug for this. I am starting to worry that I am mis-communicating
> something. I want to keep discussions on bugs focused and easily understood.
> That's why we have multiple bugs. One issue -- one bug. This bug is about
> refactoring the styles section to get rid of rule applicability algorithm. I
> can't figure out how the <shadow> discussion in your comment relates to it.
> I guess they are all related to styles. But then again, all bugs I've filed
> are related to Shadow DOM -- it doesn't mean we have just one bug for the
> whole spec :)
> > 
> > So only shadow reference combinator doesn't work for <shadow>? I'm thinking
> > of something like:
> > 
> > <x-A>
> >   <template>
> >     <style>
> >     content /select/ div.special { color: red; }
> >     </style>
> >     <content>
> >   </template>
> > </x-a>
> > 
> > <x-B extend="x-A">
> >   <template>
> >     <style>
> >     shadow /select/ div.special { color: blue; }
> >     </style>
> >     <shadow>
> >   </template>
> > </x-B>
> > 
> > So, x-B cannot apply any styles to distributed nodes?
> 
> > 
> > If we depend on select attribute, we can add our own fake select attribute
> > to <shadow>. (It doesn't work, but <shadow> can have select.>
> > 
> > I'mean:
> > 
> > <shadow id="x">...
> > 
> > getElementById("x").setAttribute("select", ":first-child");
> > 
> > So, "select" should be used when solving /select/?
> 
> Not necessarily, I guess. However, I would avoid adding features to the spec
> until we have a good use case for it. I don't think there is one right now.
Comment 4 Dimitri Glazkov 2012-10-31 21:41:26 UTC
http://dvcs.w3.org/hg/webcomponents/rev/3647bf47a736