Closed Bug 1699035 Opened 4 years ago Closed 4 years ago

[wpt-sync] Sync PR 28115 - Fix scroll-to-text-fragment behavior for same-document navigation

Categories

(Testing :: web-platform-tests, task, P4)

task

Tracking

(firefox88 fixed)

RESOLVED FIXED
88 Branch
Tracking Status
firefox88 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 28115 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/28115
Details from upstream follow.

b'Stefan Zager <szager@chromium.org>' wrote:

Fix scroll-to-text-fragment behavior for same-document navigation

A same-document navigation to a URL with a text fragment anchor
should not scroll the page to the text fragment. The test
modified by this CL is meant to test that. However, that behavior
was broken by this CL:

https://chromium-review.googlesource.com/c/chromium/src/+/2533688

The reason the test hasn't been failing is that it has been checking
to see whether the page was scrolled too soon. When a text fragment
anchor finds a match, it doesn't scroll the page right away; it
schedules a task to scroll the page which runs at rAF timing on the
next lifecycle update. This scheduling behavior was added by:

https://chromium-review.googlesource.com/c/chromium/src/+/2182992

Just adding requestAnimationFrame to the test caused it to fail;
the change to document_loader.cc fixes it.

Bug: 1147453
Change-Id: I001a315418f5f8a61ded7d87023740cd366389f8
Reviewed-on: https://chromium-review.googlesource.com/2766287
WPT-Export-Revision: a173f284a2e783c9367f573efd056590c73fce44

CI Results

Ran 0 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 1 tests and 2 subtests

Status Summary

Firefox

OK : 1
PASS: 1
FAIL: 1

Chrome

OK : 1
PASS: 1
FAIL: 1

Safari

OK : 1
PASS: 1
FAIL: 1

Links

GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

/scroll-to-text-fragment/scroll-to-text-fragment-same-doc.html
Test that a text fragment directive cannot be activated on a same-document navigation: FAIL (Chrome: FAIL, Safari: FAIL)

Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/28ff33df386c [wpt PR 28115] - Fix scroll-to-text-fragment behavior for same-document navigation, a=testonly
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 88 Branch
You need to log in before you can comment on or make changes to this bug.