Force layout of elements used in animations#9150
Force layout of elements used in animations#9150dvoytenko merged 5 commits intoampproject:masterfrom
Conversation
| Resource.setOwner(element, owner); | ||
| } | ||
|
|
||
| /** |
There was a problem hiding this comment.
hmm, so in
<amp-selector>
<amp-layout>
<amp-img>
resource.requireLayout(ampSelectorComponent); won't layout and wait for <amp-img> because it is not top level? Is there a reason to restrict to top-level sub components (instead of drawing the line at where ownership of sub-components is assumed by parent)?
There was a problem hiding this comment.
(we chatted offline about this)
There was a problem hiding this comment.
Yes. We currently do not have an option to do recursive filtering well enough. But such a use case is also somewhat rare in animations. I'll follow up on this and see if we can find a way to do this right for all cases.
src/service/resources-impl.js
Outdated
| }); | ||
| } | ||
| } | ||
| if (resource.isDisplayed()) { |
There was a problem hiding this comment.
should be movable inside the other if( resource.isDisplayed() ) above.
There was a problem hiding this comment.
Good catch. Made me realize it was a slight bug - the first isDisplayed/measure should have been inside the promise. Fixed now.
Closes #7921.