Bug 228287

Summary: Location.href setter uses wrong window to resolve relative URLs
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: DOMAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: changseok, darin, eric.carlson, esprehn+autocc, ews-watchlist, ggaren, glenn, jer.noble, jfernandez, kondapallykalyan, pdr, philipj, rego, sam, sergio, svillar, webkit-bug-importer, ysuzuki, zsun
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
URL: https://html.spec.whatwg.org/#dom-location-href
See Also: https://bugs.webkit.org/show_bug.cgi?id=228295
Bug Depends on:    
Bug Blocks: 192193    
Attachments:
Description Flags
WIP Patch
ews-feeder: commit-queue-
WIP Patch
none
Test that shows the bug
none
WIP Patch
none
Patch
none
Patch none

Description Chris Dumez 2021-07-26 11:20:16 PDT
Location.href setter uses wrong window to resolve relative URLs:
- https://html.spec.whatwg.org/#dom-location-href
Comment 1 Chris Dumez 2021-07-26 11:20:57 PDT
Created attachment 434218 [details]
WIP Patch
Comment 2 Chris Dumez 2021-07-26 13:51:07 PDT
Created attachment 434232 [details]
WIP Patch
Comment 3 Chris Dumez 2021-07-26 14:00:54 PDT
Comment on attachment 434232 [details]
WIP Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=434232&action=review

> LayoutTests/http/tests/dom/window-location-set-href-relative-url-expected.txt:7
> +FAIL popup.location.href should be http://127.0.0.1:8000/dom/resources/square20.jpg. Was http://127.0.0.1:8000/resources/resources/square20.jpg.

This test is passing in Chrome and Firefox but failing in WebKit (with either firstWindow or activeWindow for the URL resolution).
Comment 4 Chris Dumez 2021-07-26 14:11:14 PDT
Created attachment 434236 [details]
Test that shows the bug

This test passes in Chrome and Firefox but fails in WebKit.
Comment 5 Chris Dumez 2021-07-26 14:47:34 PDT
Created attachment 434244 [details]
WIP Patch
Comment 6 Chris Dumez 2021-07-26 15:36:46 PDT
Created attachment 434251 [details]
Patch
Comment 7 EWS 2021-07-26 18:08:07 PDT
Committed r280333 (239980@main): <https://commits.webkit.org/239980@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 434251 [details].
Comment 8 Radar WebKit Bug Importer 2021-07-26 18:09:19 PDT
<rdar://problem/81139879>
Comment 9 zsun 2021-07-27 02:37:03 PDT
Reopening to attach new patch.
Comment 10 zsun 2021-07-27 02:37:06 PDT
Created attachment 434278 [details]
Patch