window-name-after-cross-origin-main-frame-navigation.sub.html expects window.name cleared in a popup that has an opener, which HTML keeps
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- html, javascript
Research direction
Start with html/browsers/browsing-the-web/history-traversal/window-name-after-cross-origin-main-frame-navigation.sub.html and its helper support/window-name-navigation.sub.html, then compare them with the aux-frame sibling test, which expects the name kept. Confirm the failure by running the main-frame test with the WPT runner. Done means the test either expects the name to be kept (shouldhavename=true) or is removed as a duplicate, and it passes or is cleanly dropped in the browsers the issue lists.
Written by the indexing model from the issue text.
Description
Test: html/browsers/browsing-the-web/history-traversal/window-name-after-cross-origin-main-frame-navigation.sub.html at 2358bd4835.
What it does. It opens a popup with an opener (line 11), and the test expects the popup's name to be empty after it navigates itself cross-origin:
window.popupWin = window.open('support/window-name-after-cross-origin-main-frame-navigation-popup.sub.html', '_blank');
The popup navigates to support/window-name-navigation.sub.html with shouldhavename=false, which sets window.name = "test" (line 8) and navigates to the www1 host (line 9). There support/window-name-test.sub.html posts window.name == "" to window.opener (lines 4-5), and the test asserts it is true (line 19).
Why it cannot pass. HTML clears the target name on a cross-origin navigation only for a browsing context that is not an auxiliary browsing context with an opener. Finalize a cross-document navigation, step 4:
If all of the following are true:
- navigable's parent is null;
- historyEntry's document's browsing context is not an auxiliary browsing context whose opener browsing context is non-null; and
- historyEntry's document's origin is not same origin with navigable's active document's origin,
then set historyEntry's document state's navigable target name to the empty string.
The popup here is auxiliary and its opener is non-null (the test needs the opener: the result is posted to window.opener), so the name stays "test". The sibling test window-name-after-cross-origin-aux-frame-navigation.sub.html runs the same navigation in a popup with an opener, expects the name kept (shouldhavename=true), and passes in Chrome, Firefox and Safari. The no-opener case is covered by unset_context_name.html, which opens its window with "noopener".
Results at 2358bd4835 (wpt.fyi):
- Chrome 157 (run 4786307730243584): FAIL,
assert_true: expected true got false - Firefox 160 (run 4877168468033536): FAIL,
assert_true: expected true got false - Safari 27.2 (run 6479119966273536): FAIL,
assert_true: expected true got false
Suggested fix. The test duplicates the aux-frame test with the opposite expectation. Remove it, or make it expect the name kept (shouldhavename=true), as the aux-frame test does. If the intent is a top-level browsing context with no opener, that case needs a noopener window and a reporting path other than window.opener, as unset_context_name.html already has.
- Dominant language
- HTML
- Stars
- 6.3k
- Forks
- 4.1k
- Avg merge
- 17h 53m
- Merged PRs (30d)
- 840
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from web-platform-tests/wpt
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
web-platform-tests/wpt#65241 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
web-platform-tests/wpt#65204 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
web-platform-tests/wpt#65067 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
web-platform-tests/wpt#64928 · 4 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
web-platform-tests/wpt#64927 ·
Maintainers usually reply within 1 day
All issues in web-platform-tests/wpt
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NimblePros/eShopOnWeb#333 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
btclib-org/portanode#968 · 1 comment ·
Maintainers usually reply within 1 day
-
documentation help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Eyevinn/open-live-ingest#36 · 1 comment ·
Maintainers usually reply within 1 day