Closed Bug 1735962 Opened 3 years ago Closed 3 years ago

[wpt-sync] Sync PR 31259 - Fix element hash fallback in iframes

Categories

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

task

Tracking

(firefox95 fixed)

RESOLVED FIXED
95 Branch
Tracking Status
firefox95 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

David Bokan <bokan@chromium.org> wrote:

Fix element hash fallback in iframes

The text directive element-id fallback tries to scroll to the element-id
if a text match wasn't found. It does so in PerformPreRafActions since
element fragments cause focus which can execute script. Invoke(), where
the text fragment performs its text search, occurs from lifecycle
updates where script execution is forbidden.

Text directives used to be limited to main-frames but were enabled
explicitly for iframes in https://crrev.com/a71830a90b72f0a613fe9.
However, PerformPreRafActions wasn't updated to call into the
FragmentAnchor of an iframe

We also need to strip the fragment directives in
ElementFragmentAnchor::TryCreate. In cases where a text fragment is
successfully created, the element id fallback works by creating an
ElementFragmentAnchor from inside TextFragmentAnchor. However, if the
TextFragmentAnchor is blocked or not parsed correctly, the URL passed to
ElementFragmentAnchor in FragmentDirective::TryCreate will still include
the directives. A test for this was added in the new
same-document.tests.html

Bug: 1260135
Change-Id: Ib3f19b462016d34cc41d21b05933aa9cb822a9b8
Reviewed-on: https://chromium-review.googlesource.com/3224519
WPT-Export-Revision: b4d377159ab6f75572a97ba647267ae4b5d9f646

CI Results

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

Total 2 tests and 3 subtests

Status Summary

Firefox

OK : 2
FAIL: 8

Chrome

OK : 2
PASS: 5
FAIL: 3

Safari

OK : 2
FAIL: 8

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

/scroll-to-text-fragment/iframes.sub.html: OK [GitHub], SKIP [Gecko-android-em-7.0-x86_64-lite-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-lite-qr-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-linux1804-64-tsan-qr-opt, Gecko-windows10-32-2004-qr-debug, Gecko-windows10-32-2004-qr-opt, Gecko-windows10-64-2004-qr-debug, Gecko-windows10-64-2004-qr-opt] (Chrome: OK, Safari: OK)
Text fragment specified in iframe.src: FAIL (Chrome: PASS, Safari: FAIL)
Navigate same-origin iframe via window.location: FAIL (Chrome: PASS, Safari: FAIL)
Navigate cross-origin iframe via window.location: FAIL (Chrome: PASS, Safari: FAIL)
Non-matching text with element-id fallback: FAIL (Chrome: FAIL, Safari: FAIL)
Cross-origin with element-id fallback: FAIL (Chrome: FAIL, Safari: FAIL)
/scroll-to-text-fragment/same-document-tests.html: OK [GitHub], SKIP [Gecko-android-em-7.0-x86_64-lite-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-lite-qr-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-linux1804-64-tsan-qr-opt, Gecko-windows10-32-2004-qr-debug, Gecko-windows10-32-2004-qr-opt, Gecko-windows10-64-2004-qr-debug, Gecko-windows10-64-2004-qr-opt] (Chrome: OK, Safari: OK)
Basic text directive navigation: FAIL (Chrome: PASS, Safari: FAIL)
Basic element id fallback: FAIL (Chrome: PASS, Safari: FAIL)
Malformed text directive element id fallback: FAIL (Chrome: FAIL, Safari: FAIL)

Tests Disabled in Gecko Infrastructure

/scroll-to-text-fragment/iframes.sub.html: OK [GitHub], SKIP [Gecko-android-em-7.0-x86_64-lite-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-lite-qr-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-linux1804-64-tsan-qr-opt, Gecko-windows10-32-2004-qr-debug, Gecko-windows10-32-2004-qr-opt, Gecko-windows10-64-2004-qr-debug, Gecko-windows10-64-2004-qr-opt] (Chrome: OK, Safari: OK)
/scroll-to-text-fragment/same-document-tests.html: OK [GitHub], SKIP [Gecko-android-em-7.0-x86_64-lite-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-lite-qr-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-linux1804-64-tsan-qr-opt, Gecko-windows10-32-2004-qr-debug, Gecko-windows10-32-2004-qr-opt, Gecko-windows10-64-2004-qr-debug, Gecko-windows10-64-2004-qr-opt] (Chrome: OK, Safari: OK)

Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/065694f15d9a [wpt PR 31259] - Fix element hash fallback in iframes, a=testonly
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 95 Branch
You need to log in before you can comment on or make changes to this bug.