Title: [219073] trunk
Revision
219073
Author
[email protected]
Date
2017-07-03 09:57:25 -0700 (Mon, 03 Jul 2017)

Log Message

Unreviewed, rolling out r219024.

This patch cause 3 didferent test to fail.

Reverted changeset:

"REGRESSION(r215096) Queries of URLs with non-special schemes
should not percent-encode single quotes"
https://bugs.webkit.org/show_bug.cgi?id=174051
http://trac.webkit.org/changeset/219024

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (219072 => 219073)


--- trunk/Source/WebCore/ChangeLog	2017-07-03 16:56:05 UTC (rev 219072)
+++ trunk/Source/WebCore/ChangeLog	2017-07-03 16:57:25 UTC (rev 219073)
@@ -1,3 +1,16 @@
+2017-07-03  Matt Lewis  <[email protected]>
+
+        Unreviewed, rolling out r219024.
+
+        This patch cause 3 didferent test to fail.
+
+        Reverted changeset:
+
+        "REGRESSION(r215096) Queries of URLs with non-special schemes
+        should not percent-encode single quotes"
+        https://bugs.webkit.org/show_bug.cgi?id=174051
+        http://trac.webkit.org/changeset/219024
+
 2017-07-03  Wenson Hsieh  <[email protected]>
 
         Pasting single words copied to UIPasteboard inserts URLs in editable areas

Modified: trunk/Source/WebCore/platform/URLParser.cpp (219072 => 219073)


--- trunk/Source/WebCore/platform/URLParser.cpp	2017-07-03 16:56:05 UTC (rev 219072)
+++ trunk/Source/WebCore/platform/URLParser.cpp	2017-07-03 16:57:25 UTC (rev 219073)
@@ -191,7 +191,7 @@
     0, // '$'
     ForbiddenHost, // '%'
     0, // '&'
-    0, // '''
+    QueryPercent, // '''
     0, // '('
     0, // ')'
     0, // '*'
@@ -420,14 +420,7 @@
 template<typename CharacterType> ALWAYS_INLINE static bool isSlashQuestionOrHash(CharacterType character) { return character <= '\\' && characterClassTable[character] & SlashQuestionOrHash; }
 template<typename CharacterType> ALWAYS_INLINE static bool isValidSchemeCharacter(CharacterType character) { return character <= 'z' && characterClassTable[character] & ValidScheme; }
 template<typename CharacterType> ALWAYS_INLINE static bool isForbiddenHostCodePoint(CharacterType character) { return character <= ']' && characterClassTable[character] & ForbiddenHost; }
-ALWAYS_INLINE static bool shouldPercentEncodeQueryByte(uint8_t byte, const bool& urlIsSpecial)
-{
-    if (characterClassTable[byte] & QueryPercent)
-        return true;
-    if (byte == '\'' && urlIsSpecial)
-        return true;
-    return false;
-}
+static bool shouldPercentEncodeQueryByte(uint8_t byte) { return characterClassTable[byte] & QueryPercent; }
 
 template<typename CharacterType, URLParser::ReportSyntaxViolation reportSyntaxViolation>
 ALWAYS_INLINE void URLParser::advance(CodePointIterator<CharacterType>& iterator, const CodePointIterator<CharacterType>& iteratorForSyntaxViolationPosition)
@@ -585,7 +578,7 @@
     ASSERT(!iterator.atEnd());
     UChar32 codePoint = *iterator;
     if (LIKELY(isASCII(codePoint))) {
-        if (UNLIKELY(shouldPercentEncodeQueryByte(codePoint, m_urlIsSpecial))) {
+        if (UNLIKELY(shouldPercentEncodeQueryByte(codePoint))) {
             syntaxViolation(iterator);
             percentEncodeByte(codePoint);
         } else
@@ -605,7 +598,7 @@
     U8_APPEND_UNSAFE(buffer, offset, codePoint);
     for (int32_t i = 0; i < offset; ++i) {
         auto byte = buffer[i];
-        if (shouldPercentEncodeQueryByte(byte, m_urlIsSpecial))
+        if (shouldPercentEncodeQueryByte(byte))
             percentEncodeByte(byte);
         else
             appendToASCIIBuffer(byte);
@@ -633,7 +626,7 @@
             syntaxViolation(iterator);
             break;
         }
-        if (UNLIKELY(shouldPercentEncodeQueryByte(byte, m_urlIsSpecial))) {
+        if (UNLIKELY(shouldPercentEncodeQueryByte(byte))) {
             syntaxViolation(iterator);
             break;
         }
@@ -646,7 +639,7 @@
     for (; i < length; ++i) {
         ASSERT(m_didSeeSyntaxViolation);
         uint8_t byte = data[i];
-        if (shouldPercentEncodeQueryByte(byte, m_urlIsSpecial))
+        if (shouldPercentEncodeQueryByte(byte))
             percentEncodeByte(byte);
         else
             appendToASCIIBuffer(byte);

Modified: trunk/Tools/ChangeLog (219072 => 219073)


--- trunk/Tools/ChangeLog	2017-07-03 16:56:05 UTC (rev 219072)
+++ trunk/Tools/ChangeLog	2017-07-03 16:57:25 UTC (rev 219073)
@@ -1,3 +1,16 @@
+2017-07-03  Matt Lewis  <[email protected]>
+
+        Unreviewed, rolling out r219024.
+
+        This patch cause 3 didferent test to fail.
+
+        Reverted changeset:
+
+        "REGRESSION(r215096) Queries of URLs with non-special schemes
+        should not percent-encode single quotes"
+        https://bugs.webkit.org/show_bug.cgi?id=174051
+        http://trac.webkit.org/changeset/219024
+
 2017-07-03  Chris Dumez  <[email protected]>
 
         Drop ResourceLoadStatisticsStore's statisticsLock

Modified: trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp (219072 => 219073)


--- trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp	2017-07-03 16:56:05 UTC (rev 219072)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp	2017-07-03 16:57:25 UTC (rev 219073)
@@ -1298,8 +1298,6 @@
     checkURL(makeString("gopher://host/path?", withUmlauts, "#fragment"), "asdf://example.com/?doesntmatter", iso88591, {"gopher", "", "", "host", 0, "/path", "%DC%26%231072%3B%26%231105%3B", "fragment", "gopher://host/path?%DC%26%231072%3B%26%231105%3B#fragment"});
     checkURL(makeString("asdf://host/path?", withUmlauts, "#fragment"), "http://example.com/?doesntmatter", iso88591, {"asdf", "", "", "host", 0, "/path", "%C3%9C%D0%B0%D1%91", "fragment", "asdf://host/path?%C3%9C%D0%B0%D1%91#fragment"});
 
-    checkURL("http://host/pa'th?qu'ery#fr'agment", UTF8Encoding(), {"http", "", "", "host", 0, "/pa'th", "qu%27ery", "fr'agment", "http://host/pa'th?qu%27ery#fr'agment"});
-    checkURL("asdf://host/pa'th?qu'ery#fr'agment", UTF8Encoding(), {"asdf", "", "", "host", 0, "/pa'th", "qu'ery", "fr'agment", "asdf://host/pa'th?qu'ery#fr'agment"});
     checkURL("http://host/?query=foo'bar", UTF8Encoding(), {"http", "", "", "host", 0, "/", "query=foo%27bar", "", "http://host/?query=foo%27bar"});
     // FIXME: Add more tests with other encodings and things like non-ascii characters, emoji and unmatched surrogate pairs.
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to