WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
189554
URL::string should return a null String if parsing failed
https://bugs.webkit.org/show_bug.cgi?id=189554
Summary
URL::string should return a null String if parsing failed
Alex Christensen
Reported
2018-09-12 11:21:56 PDT
URL::string should return a null String if parsing failed
Attachments
Patch
(4.83 KB, patch)
2018-09-12 11:23 PDT
,
Alex Christensen
no flags
Details
Formatted Diff
Diff
Patch
(4.96 KB, patch)
2018-09-12 11:24 PDT
,
Alex Christensen
no flags
Details
Formatted Diff
Diff
Patch
(4.96 KB, patch)
2018-09-12 11:25 PDT
,
Alex Christensen
no flags
Details
Formatted Diff
Diff
Archive of layout-test-results from ews102 for mac-sierra
(655.56 KB, application/zip)
2018-09-12 12:35 PDT
,
EWS Watchlist
no flags
Details
Archive of layout-test-results from ews115 for mac-sierra
(629.45 KB, application/zip)
2018-09-12 12:37 PDT
,
EWS Watchlist
no flags
Details
Archive of layout-test-results from ews124 for ios-simulator-wk2
(11.29 MB, application/zip)
2018-09-12 13:09 PDT
,
EWS Watchlist
no flags
Details
Patch
(6.31 KB, patch)
2018-09-12 13:47 PDT
,
Alex Christensen
achristensen
: review-
ews-watchlist
: commit-queue-
Details
Formatted Diff
Diff
Archive of layout-test-results from ews112 for mac-sierra
(1.52 MB, application/zip)
2018-09-12 15:01 PDT
,
EWS Watchlist
no flags
Details
Archive of layout-test-results from ews102 for mac-sierra
(484.68 KB, application/zip)
2018-09-12 15:04 PDT
,
EWS Watchlist
no flags
Details
Show Obsolete
(6)
View All
Add attachment
proposed patch, testcase, etc.
Alex Christensen
Comment 1
2018-09-12 11:23:27 PDT
Created
attachment 349563
[details]
Patch
Alex Christensen
Comment 2
2018-09-12 11:24:36 PDT
Created
attachment 349564
[details]
Patch
Alex Christensen
Comment 3
2018-09-12 11:25:23 PDT
Created
attachment 349565
[details]
Patch
Alexey Proskuryakov
Comment 4
2018-09-12 12:28:06 PDT
Comment on
attachment 349565
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=349565&action=review
> Source/WTF/ChangeLog:3 > + URL::string should return a null String if parsing failed
The URL class is routinely used to represent invalid URLs, so this would require a large refactoring (if even desirable at all). It is of course true that clients that assume the string to always be valid are a problem.
EWS Watchlist
Comment 5
2018-09-12 12:35:11 PDT
Comment on
attachment 349565
[details]
Patch
Attachment 349565
[details]
did not pass mac-ews (mac): Output:
https://webkit-queues.webkit.org/results/9194040
Number of test failures exceeded the failure limit.
EWS Watchlist
Comment 6
2018-09-12 12:35:12 PDT
Created
attachment 349567
[details]
Archive of layout-test-results from ews102 for mac-sierra The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews102 Port: mac-sierra Platform: Mac OS X 10.12.6
EWS Watchlist
Comment 7
2018-09-12 12:37:55 PDT
Comment on
attachment 349565
[details]
Patch
Attachment 349565
[details]
did not pass mac-debug-ews (mac): Output:
https://webkit-queues.webkit.org/results/9193956
Number of test failures exceeded the failure limit.
EWS Watchlist
Comment 8
2018-09-12 12:37:57 PDT
Created
attachment 349568
[details]
Archive of layout-test-results from ews115 for mac-sierra The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews115 Port: mac-sierra Platform: Mac OS X 10.12.6
EWS Watchlist
Comment 9
2018-09-12 13:09:13 PDT
Comment on
attachment 349565
[details]
Patch
Attachment 349565
[details]
did not pass ios-sim-ews (ios-simulator-wk2): Output:
https://webkit-queues.webkit.org/results/9194042
Number of test failures exceeded the failure limit.
EWS Watchlist
Comment 10
2018-09-12 13:09:15 PDT
Created
attachment 349572
[details]
Archive of layout-test-results from ews124 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews124 Port: ios-simulator-wk2 Platform: Mac OS X 10.13.4
Alex Christensen
Comment 11
2018-09-12 13:47:27 PDT
Created
attachment 349578
[details]
Patch
Daniel Bates
Comment 12
2018-09-12 14:57:30 PDT
Comment on
attachment 349578
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=349578&action=review
> Source/WTF/wtf/text/WTFString.cpp:1220 > +const String& nullString() > +{ > + static NeverDestroyed<String> nullString; > + return nullString; > +} > +
Why?
EWS Watchlist
Comment 13
2018-09-12 15:01:42 PDT
Comment on
attachment 349578
[details]
Patch
Attachment 349578
[details]
did not pass mac-debug-ews (mac): Output:
https://webkit-queues.webkit.org/results/9195254
Number of test failures exceeded the failure limit.
EWS Watchlist
Comment 14
2018-09-12 15:01:44 PDT
Created
attachment 349584
[details]
Archive of layout-test-results from ews112 for mac-sierra The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews112 Port: mac-sierra Platform: Mac OS X 10.12.6
EWS Watchlist
Comment 15
2018-09-12 15:04:46 PDT
Comment on
attachment 349578
[details]
Patch
Attachment 349578
[details]
did not pass mac-ews (mac): Output:
https://webkit-queues.webkit.org/results/9195504
Number of test failures exceeded the failure limit.
EWS Watchlist
Comment 16
2018-09-12 15:04:48 PDT
Created
attachment 349585
[details]
Archive of layout-test-results from ews102 for mac-sierra The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews102 Port: mac-sierra Platform: Mac OS X 10.12.6
Chris Dumez
Comment 17
2018-09-12 15:06:14 PDT
(In reply to Daniel Bates from
comment #12
)
> Comment on
attachment 349578
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=349578&action=review
> > > Source/WTF/wtf/text/WTFString.cpp:1220 > > +const String& nullString() > > +{ > > + static NeverDestroyed<String> nullString; > > + return nullString; > > +} > > + > > Why?
+1
Alex Christensen
Comment 18
2018-09-12 15:34:31 PDT
(In reply to Daniel Bates from
comment #12
)
> Comment on
attachment 349578
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=349578&action=review
> > > Source/WTF/wtf/text/WTFString.cpp:1220 > > +const String& nullString() > > +{ > > + static NeverDestroyed<String> nullString; > > + return nullString; > > +} > > + > > Why?
So we can return a String& to a null string. Same reason emptyString() exists.
Alex Christensen
Comment 19
2018-09-12 15:35:12 PDT
Comment on
attachment 349578
[details]
Patch There are a few more places we need stringMaybeInvalid, and they're tied up in URLUtils.
Alex Christensen
Comment 20
2018-09-13 09:25:09 PDT
(In reply to Alexey Proskuryakov from
comment #4
)
> Comment on
attachment 349565
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=349565&action=review
> > > Source/WTF/ChangeLog:3 > > + URL::string should return a null String if parsing failed > > The URL class is routinely used to represent invalid URLs, so this would > require a large refactoring (if even desirable at all).
I believe the anchor element is the only valid use of a URL representing an invalid URL because of its href definition being the canonicalized URL if it parses and whatever string it had if it doesn't parse. If there are more, please let me know.
> It is of course true that clients that assume the string to always be valid > are a problem.
The way the class is currently designed, this is done frequently, unintentionally, and unknowingly.
Alexey Proskuryakov
Comment 21
2018-09-13 09:47:12 PDT
Various URLs using custom schemes sometimes happen to be invalid per WebCore. We now have quite a few custom scheme workflows.
Bug 136010
was one tangentially related example, but I think that we had something where it was even more clear that strings supplied by clients needed to be preserved verbatim.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug