Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

amp-bind: Don't get stuck on sibling-less amp-list #23333

Merged
merged 3 commits into from Jul 15, 2019

Conversation

dreamofabear
Copy link

Fixes #23281.

/to @jridgewell


// But cousins and the amp-list itself shouldn't be skipped.
expect(list.className).to.equal('x');
expect(cousin.textContent).to.equal('6');
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified this line fails without the fix.

Copy link
Contributor

@jridgewell jridgewell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this require a cherry-pick?

skipSubtree_(walker) {
let n = walker.currentNode;
while (n) {
if (n.nextSibling) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use walker.parentNode() and walker.nextSibling() only. As is, this will traverse outside of the walker's root and scan unrelated DOM trees.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, done.

@dreamofabear dreamofabear merged commit 0e105d9 into ampproject:master Jul 15, 2019
@dreamofabear dreamofabear deleted the bind-stuck-on-amp-list branch July 15, 2019 22:25
jridgewell pushed a commit that referenced this pull request Jul 15, 2019
* Don't get stuck on sibling-less amp-list.

* Use nextSibling/parentNode.

* Yikes infinite loop.
rindo pushed a commit to logly/amphtml that referenced this pull request Jul 24, 2019
* Don't get stuck on sibling-less amp-list.

* Use nextSibling/parentNode.

* Yikes infinite loop.
thekorn pushed a commit to edelight/amphtml that referenced this pull request Sep 11, 2019
* Don't get stuck on sibling-less amp-list.

* Use nextSibling/parentNode.

* Yikes infinite loop.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AMP-Carousel icon numbers don't change when scrolling/swiping
3 participants