Bug 161805

Summary: URLParser: Handle \ in path according to spec
Product: WebKit Reporter: Alex Christensen <achristensen>
Component: New BugsAssignee: Alex Christensen <achristensen>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch aestes: review+

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.