+1 vote for some way to observe these mutations.

If I understand Justin's description, he's observing distribution changes 
by observing the light DOM node's children. I've been doing that for a 
while, but I've also been faced with numerous cases where I want to observe 
*re*distributed content, and don't see an obvious way to do that. That is, 
I have an element that wants to watch itself for distribution changes. Then 
that element itself is instantiated somewhere by some outer element, which 
puts a <content> node inside of the inner element instance. Now changes 
made to the outer element's children effect what's distributed to the inner 
element, but as far as the inner element is concerned, it's own children 
aren't changing (it just see that it contains a <content> node).

Without native support for this, it seems an element that wanted to handle 
redistributed nodes would need to not only monitor its own content, but 
would also need to look to see if its own content includes <content> 
elements, try to figure out the parent elements that added the <content>, 
then observe the *parent* for mutations as well... which all seems to 
quickly get ugly.

Are there any better solutions to this today? Or, if it needs to be done 
the hard way, has anyone already taken a shot at this?

On Sunday, April 20, 2014 11:26:02 AM UTC-7, Scott Miles wrote:
>
> Key info, thanks for that insight Elliott.
>
>
> On Sun, Apr 20, 2014 at 11:14 AM, Elliott Sprehn 
> <[email protected]<javascript:>
> > wrote:
>
>> The biggest issue with this is that we don't distribute nodes until we 
>> recalculate style which is at requestAnimationFrame time, but after all 
>> your callbacks have run. So your MutationObserver would always miss one 
>> frame.
>>
>>
>>
>> On Sun, Apr 20, 2014 at 1:31 PM, Scott Miles <[email protected]<javascript:>
>> > wrote:
>>
>>> We've been lobbying for such changes to be observable as Mutations (or 
>>> at least as an event) for some time now. 
>>>
>>> Will add your votes to the lobby effort!
>>>
>>>
>>> On Sun, Apr 20, 2014 at 10:17 AM, Justin Fagnani 
>>> <[email protected]<javascript:>
>>> > wrote:
>>>
>>>> +polymer-dev
>>>> Is there a way to observe mutations on distributed nodes of 
>>>> ContentElement using MutationObserver? Observing on childList doesn't seem 
>>>> to fire when distributed nodes are added or removed to ContentElement. I 
>>>> am 
>>>> forced to observe on root PolymerElement for now.
>>>>
>>>> Thanks!
>>>>
>>>> -- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "Dart Web Development" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to [email protected] <javascript:>.
>>>> Visit this group at http://groups.google.com/a/dartlang.org/group/web/.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/a/dartlang.org/d/msgid/web/15960217-310d-4eb0-a1f7-ba31553b91cf%40dartlang.org<https://groups.google.com/a/dartlang.org/d/msgid/web/15960217-310d-4eb0-a1f7-ba31553b91cf%40dartlang.org?utm_medium=email&utm_source=footer>
>>>> .
>>>>  
>>>> Follow Polymer on Google+: plus.google.com/107187849809354688692
>>>> --- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "Polymer" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to [email protected] <javascript:>.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/polymer-dev/CAEKsHmAFApXNHqQ3BBDEHZUGAY3MdoXv003bSHuugog8Dn-4nw%40mail.gmail.com<https://groups.google.com/d/msgid/polymer-dev/CAEKsHmAFApXNHqQ3BBDEHZUGAY3MdoXv003bSHuugog8Dn-4nw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>  Follow Polymer on Google+: plus.google.com/107187849809354688692
>>> --- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Polymer" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to [email protected] <javascript:>.
>>>  To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/polymer-dev/CAHbmOLZ0ZvaB_tA%3D2tvWij8%2BOsPBttBW4eHe%2BmUvhuNVF6JG-A%40mail.gmail.com<https://groups.google.com/d/msgid/polymer-dev/CAHbmOLZ0ZvaB_tA%3D2tvWij8%2BOsPBttBW4eHe%2BmUvhuNVF6JG-A%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>  
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>  Follow Polymer on Google+: plus.google.com/107187849809354688692
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Polymer" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/polymer-dev/CAPJYB1gf67N78mpCiN8sx%3DwagqfH0%3DFYet3S2rxFejb1k%2BZYUg%40mail.gmail.com<https://groups.google.com/d/msgid/polymer-dev/CAPJYB1gf67N78mpCiN8sx%3DwagqfH0%3DFYet3S2rxFejb1k%2BZYUg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

Follow Polymer on Google+: plus.google.com/107187849809354688692
--- 
You received this message because you are subscribed to the Google Groups 
"Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/polymer-dev/7456be68-bec6-4dc2-86fb-00829d720caa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to