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

autofocus: Change the timing of 'flush autofocus candidates' #19747

Merged
merged 1 commit into from
Oct 21, 2019

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Oct 17, 2019

  • ScriptedAnimationController kicks Document::FlushAutofocusCandidates
    Now ScriptedAnimationController takes into account of existence of
    autofocus candidates.

  • Document::FlushAutofocusCandidates needs to call
    UpdateStyleAndLayoutTree() for each of candidates.
    IsFocusable() needs up-to-date style. UpdateStyleAndLayoutTree() was
    unnecessary because FlushAutofocusCandidates() was called after
    layout.

Bug: 1015275
Change-Id: I06dcb9b3cd2564d35fba3f893e7ce4b8736c91bf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1863067
Commit-Queue: Kent Tamura <tkent@chromium.org>
Reviewed-by: Mason Freed <masonfreed@chromium.org>
Cr-Commit-Position: refs/heads/master@{#707201}

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

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

Already reviewed downstream.

@chromium-wpt-export-bot chromium-wpt-export-bot changed the title autofoucs: Change the timing of 'flush autofocus candidates' autofocus: Change the timing of 'flush autofocus candidates' Oct 18, 2019
domenic pushed a commit to whatwg/html that referenced this pull request Oct 18, 2019
Now it runs before "run the resize steps".

The previous timing could cause an issue that the auto-focused element
didn't have up-to-date appearance even though "update the rendering" was
done. Fixes #4992.

Tests: web-platform-tests/wpt#19747
* ScriptedAnimationController kicks Document::FlushAutofocusCandidates
Now ScriptedAnimationController takes into account of existence of
autofocus candidates.

* Document::FlushAutofocusCandidates needs to call
  UpdateStyleAndLayoutTree() for each of candidates.
IsFocusable() needs up-to-date style. UpdateStyleAndLayoutTree() was
unnecessary because FlushAutofocusCandidates() was called after
layout.

Bug: 1015275
Change-Id: I06dcb9b3cd2564d35fba3f893e7ce4b8736c91bf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1863067
Commit-Queue: Kent Tamura <tkent@chromium.org>
Reviewed-by: Mason Freed <masonfreed@chromium.org>
Cr-Commit-Position: refs/heads/master@{#707201}
@LukeZielinski
Copy link
Contributor

The following three tests are flaky on Chrome (logs):

Unstable results

Test Subtest Results Messages
/html/interaction/focus/the-autofocus-attribute/focusable-area-in-top-document.html If topDocument's focused area is not topDocument, autofocus is not processed. FAIL: 1/10, PASS: 9/10 assert_equals: activeElement should not be changed expected Element node <iframe srcdoc="<input><script>document.querySelector('in... but got Element node <input autofocus=""></input>
/html/interaction/focus/the-autofocus-attribute/skip-document-with-fragment.html Autofocus elements in iframed documents with URL fragments should be skipped. FAIL: 7/10, PASS: 3/10 assert_equals: Autofocus elements in iframes should not be focused. expected Element node <body><iframe src="resources/frame-with-autofocus-element... but got Element node <iframe src="resources/frame-with-autofocus-element.html#...
/html/interaction/focus/the-autofocus-attribute/update-the-rendering.html "Flush autofocus candidates" should be happen before a scroll event and animation frame callbacks FAIL: 5/10, PASS: 5/10 assert_array_equals: animationFrame lengths differ, expected 3 got 1

Reproducible locally via:
$ ./wpt run chrome html/interaction/focus/the-autofocus-attribute/ --verify --log-tbpl -

@LukeZielinski
Copy link
Contributor

@tkent-google
Copy link
Contributor

The flakiness should be resolved when Chrome is updated to a version including r707201.

@stephenmcgruer
Copy link
Contributor

@foolip @Hexcles Can we admin merge this, since the flakiness is (hopefully) fixed in Chromium already (but we're blocked on M79 upgrades due to https://crbug.com/1014629), and it isn't flaky on other browsers?

@foolip
Copy link
Member

foolip commented Oct 21, 2019

Confirmed only wpt-chrome-dev-stability is failing in Taskcluster, admin merging now.

@foolip foolip merged commit fd4814c into master Oct 21, 2019
@foolip foolip deleted the chromium-export-cl-1863067 branch October 21, 2019 13:28
zcorpan pushed a commit to whatwg/html that referenced this pull request Nov 6, 2019
Now it runs before "run the resize steps".

The previous timing could cause an issue that the auto-focused element
didn't have up-to-date appearance even though "update the rendering" was
done. Fixes #4992.

Tests: web-platform-tests/wpt#19747
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants