Skip to content
This repository has been archived by the owner on Feb 22, 2018. It is now read-only.

feat(block): Chain ElementProbe parents; add to shadowRoot #625

Closed
wants to merge 1 commit into from

Conversation

mhevery
Copy link
Contributor

@mhevery mhevery commented Feb 26, 2014

This allows one to retrieve ElementProbe from any element including
a shadowRoot. The ElementProbe contains element, injector, and scope.
The added benefit is that by waling the ElementProbe parent one can
get the parent element of a shadow DOM.

@mhevery
Copy link
Contributor Author

mhevery commented Feb 26, 2014

@pavelgj @codelogic

This allows one to retrieve ElementProbe from any element including
a shadowRoot. The ElementProbe contains element, injector, and scope. 
The added benefit is that by waling the ElementProbe parent one can 
get the parent element of a shadow DOM.

Closes dart-archive#625
@mhevery mhevery removed the cla: no label Feb 26, 2014
@pavelgj
Copy link
Contributor

pavelgj commented Feb 26, 2014

Is this still meant as a debugging only feature? Jailbreaking Shadow DOM encapsulation seems dangerous if people start using this as a prod feature.

@codelogic
Copy link
Contributor

No, its for optimization. Specifically in the case of animation we want to be able to find out if any animations are running on any parents. This is especially important during page loads and routing changes where an entire page could contain a large number of animations. In order to do this, we need to walk the dom and break out of the shadow root. Also, having a is version of an element is lighter to touch and for parent animation checks we may not even have to touch the Dom at all.

@mhevery mhevery closed this in b307c82 Feb 26, 2014
mhevery pushed a commit to mhevery/angular.dart that referenced this pull request Feb 26, 2014
This allows one to retrieve ElementProbe from any element including
a shadowRoot. The ElementProbe contains element, injector, and scope. 
The added benefit is that by waling the ElementProbe parent one can 
get the parent element of a shadow DOM.

Closes dart-archive#625
Closes dart-archive#630
@codelogic
Copy link
Contributor

Did you intend for this to also wrap an element probe around every directive (not just components)? I was tinkering around with the code for animation optimization after this went in and I couldn't rely on the element probe to reliably exist on every element I wanted to check.

@zoechi
Copy link
Contributor

zoechi commented Feb 27, 2014

Isn't there a way to register animations centrally (like in a service) when they are started, and go through that list, instead of iterating the DOM?

@codelogic
Copy link
Contributor

That would be awesome, but the problem is how do you know given Element "A" and Element "B" if "Element C" is a child somewhere down the chain of either A or B without doing a dom walk up the tree from C?

@mhevery mhevery deleted the element-probe branch March 17, 2014 16:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging this pull request may close these issues.

4 participants