Bug 161805 - URLParser: Handle \ in path according to spec
Summary: URLParser: Handle \ in path according to spec
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alex Christensen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-09 10:46 PDT by Alex Christensen
Modified: 2016-09-09 10:59 PDT (History)
1 user (show)

See Also:


Attachments
Patch (5.22 KB, patch)
2016-09-09 10:48 PDT, Alex Christensen
aestes: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Christensen 2016-09-09 10:46:34 PDT
URLParser: Handle \ in path according to spec
Comment 1 Alex Christensen 2016-09-09 10:48:01 PDT
Created attachment 288414 [details]
Patch
Comment 2 WebKit Commit Bot 2016-09-09 10:49:32 PDT
Attachment 288414 [details] did not pass style-queue:


ERROR: Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp:266:  One space before end of line comments  [whitespace/comments] [5]
ERROR: Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp:266:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp:417:  One space before end of line comments  [whitespace/comments] [5]
ERROR: Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp:417:  Should have a space between // and comment  [whitespace/comments] [4]
Total errors found: 4 in 4 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Andy Estes 2016-09-09 10:53:42 PDT
Comment on attachment 288414 [details]
Patch

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

> Source/WebCore/platform/URLParser.cpp:618
> +            {

Can we just put the entire case statement in a block?

> Source/WebCore/platform/URLParser.cpp:620
> +                bool isSlash = *c == '/' || (m_urlIsSpecial && *c == '\\');
> +                if (isSlash || *c == '?' || *c == '#') {

Can you dereference c once and store it in a char?
Comment 4 Alex Christensen 2016-09-09 10:58:28 PDT
http://trac.webkit.org/changeset/205752
Comment 5 Alex Christensen 2016-09-09 10:59:48 PDT
(In reply to comment #3)
> > Source/WebCore/platform/URLParser.cpp:620
> > +                bool isSlash = *c == '/' || (m_urlIsSpecial && *c == '\\');
> > +                if (isSlash || *c == '?' || *c == '#') {
> 
> Can you dereference c once and store it in a char?
I could, but I'm planning on optimizing all these if (*c==this || *c == that || ...) into tables once everything works anyways, so I'll get to it.  Until then, this reads better than having another variable with a strange name.