Visitar URL original
Fix document onscrollend event handler test by dlrobertson · Pull Request #37018 · web-platform-tests/wpt · GitHub
Skip to content

Fix document onscrollend event handler test - #37018

Open
dlrobertson wants to merge 1 commit into
web-platform-tests:masterfrom
dlrobertson:onscrollend-fix
Open

dlrobertson wants to merge 1 commit into
web-platform-tests:masterfrom
dlrobertson:onscrollend-fix

Conversation

@dlrobertson

Copy link
Copy Markdown
Member

The document onscrollend event handler test should pass if the document scrolling element scrolls.

Related to: whatwg/html#8461

@dlrobertson

Copy link
Copy Markdown
Member Author

CC: @domenic

}

let document_scrollend_arrived = false;
function failOnScrollEnd(event) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Function name is no longer very accurate.

element_scrollend_arrived = true;
}

let document_scrollend_arrived = false;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's actually body, not document, right?

let document_scrollend_arrived = false;
function failOnScrollEnd(event) {
assert_true(false, "Scrollend should not be called on: " + event.target);
document_scrollend_arrived = true;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It'd be good to test that event.target === document.body, since that's the actual spec change being made in whatwg/html#8461. (Before, it was event.target === document.)

@dlrobertson dlrobertson left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I used document.scrollingElement instead of body since we're in standards mode.

@dlrobertson
dlrobertson force-pushed the onscrollend-fix branch 2 times, most recently from 115f1a2 to 51c4a6a Compare November 28, 2022 15:54
The document onscrollend event handler test should pass if the document
scrolling element scrolls.

This branch has not been deployed

No deployments
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.

4 participants