Bug 214318

Summary: Setting URL.hash to '#' should set empty fragment
Product: WebKit Reporter: Rob Buis <rbuis>
Component: DOMAssignee: Rob Buis <rbuis>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, changseok, darin, esprehn+autocc, ews-watchlist, gyuyoung.kim, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: Safari Technology Preview   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=214561
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description Rob Buis 2020-07-14 13:25:27 PDT
Setting URL.hash to '#' should preserve '#'
Comment 1 Rob Buis 2020-07-14 13:35:09 PDT
Created attachment 404273 [details]
Patch
Comment 2 Rob Buis 2020-07-17 06:50:00 PDT
Created attachment 404558 [details]
Patch
Comment 3 Rob Buis 2020-07-20 03:14:41 PDT
Created attachment 404707 [details]
Patch
Comment 4 Rob Buis 2020-07-20 05:18:48 PDT
The equivalent patch landed today in Chrome:
https://chromium-review.googlesource.com/c/chromium/src/+/2302696
Comment 5 EWS 2020-07-20 06:51:19 PDT
Committed r264599: <https://trac.webkit.org/changeset/264599>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 404707 [details].
Comment 6 Radar WebKit Bug Importer 2020-07-20 06:52:17 PDT
<rdar://problem/65822989>
Comment 7 Darin Adler 2020-07-20 10:32:32 PDT
Comment on attachment 404707 [details]
Patch

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

> Source/WebCore/html/URLDecomposition.cpp:245
> +        auto newFragment = value.startsWith('#') ? StringView(value).substring(1) : StringView(value);

Not new to this patch, but just noticed: Should just be "value" instead of "StringView(value)" in the two places on this line.