+2017-07-03 Matt Lewis <jlewis3@apple.com>
+
+ 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 <wenson_hsieh@apple.com>
Pasting single words copied to UIPasteboard inserts URLs in editable areas
0, // '$'
ForbiddenHost, // '%'
0, // '&'
- 0, // '''
+ QueryPercent, // '''
0, // '('
0, // ')'
0, // '*'
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)
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
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);
syntaxViolation(iterator);
break;
}
- if (UNLIKELY(shouldPercentEncodeQueryByte(byte, m_urlIsSpecial))) {
+ if (UNLIKELY(shouldPercentEncodeQueryByte(byte))) {
syntaxViolation(iterator);
break;
}
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);
+2017-07-03 Matt Lewis <jlewis3@apple.com>
+
+ 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 <cdumez@apple.com>
Drop ResourceLoadStatisticsStore's statisticsLock
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.
}