Modified: tags/Safari-603.1.9/Source/WebCore/ChangeLog (207302 => 207303)
--- tags/Safari-603.1.9/Source/WebCore/ChangeLog 2016-10-13 19:26:19 UTC (rev 207302)
+++ tags/Safari-603.1.9/Source/WebCore/ChangeLog 2016-10-13 20:03:39 UTC (rev 207303)
@@ -1,3 +1,25 @@
+2016-10-13 Matthew Hanson <matthew_han...@apple.com>
+
+ Merge r207268. rdar://problem/28756748
+
+ 2016-10-12 Alex Christensen <achristen...@webkit.org>
+
+ Mail needs nonspecial URLs to keep case in host and not have slash after host
+ https://bugs.webkit.org/show_bug.cgi?id=163373
+
+ Reviewed by Saam Barati.
+
+ Mail uses urls like scheme://HoSt which were not changed when canonicalized
+ before enabling the URLParser but now are canonicalized to scheme://host/
+ I manually verified this fixes the issue.
+ This should be reverted once Mail will accept modern canonicalized URLs.
+
+ * platform/URLParser.cpp:
+ (WebCore::URLParser::parse):
+ (WebCore::URLParser::parseHostAndPort):
+ * platform/URLParser.h:
+ If the application is mail and the scheme is nonspecial, don't make the host lower case and don't add a slash after the host.
+
2016-10-12 Jeremy Huddleston Sequoia <jerem...@apple.com>
[SOUP] trunk r207192 fails to compile due to missing std::function being unavailable (missing #include <functional>)
Modified: tags/Safari-603.1.9/Source/WebCore/platform/URLParser.cpp (207302 => 207303)
--- tags/Safari-603.1.9/Source/WebCore/platform/URLParser.cpp 2016-10-13 19:26:19 UTC (rev 207302)
+++ tags/Safari-603.1.9/Source/WebCore/platform/URLParser.cpp 2016-10-13 20:03:39 UTC (rev 207303)
@@ -27,6 +27,7 @@
#include "URLParser.h"
#include "Logging.h"
+#include "RuntimeApplicationChecks.h"
#include <array>
#include <unicode/uidna.h>
#include <unicode/utypes.h>
@@ -1127,6 +1128,12 @@
template<typename CharacterType>
void URLParser::parse(const CharacterType* input, const unsigned length, const URL& base, const TextEncoding& encoding)
{
+#if PLATFORM(MAC)
+ static bool isMail = MacApplication::isAppleMail();
+#else
+ static bool isMail = false;
+#endif
+
URL_PARSER_LOG("Parsing URL <%s> base <%s> encoding <%s>", String(input, length).utf8().data(), base.string().utf8().data(), encoding.name());
m_url = { };
ASSERT(m_asciiBuffer.isEmpty());
@@ -1453,7 +1460,7 @@
} else {
m_url.m_userEnd = currentPosition(authorityOrHostBegin);
m_url.m_passwordEnd = m_url.m_userEnd;
- if (!parseHostAndPort(iterator)) {
+ if (!parseHostAndPort(iterator, isMail)) {
failure();
return;
}
@@ -1475,7 +1482,7 @@
do {
LOG_STATE("Host");
if (*c == '/' || *c == '?' || *c == '#') {
- if (!parseHostAndPort(CodePointIterator<CharacterType>(authorityOrHostBegin, c))) {
+ if (!parseHostAndPort(CodePointIterator<CharacterType>(authorityOrHostBegin, c), isMail)) {
failure();
return;
}
@@ -1646,7 +1653,7 @@
state = State::Path;
break;
}
- if (!parseHostAndPort(CodePointIterator<CharacterType>(authorityOrHostBegin, c))) {
+ if (!parseHostAndPort(CodePointIterator<CharacterType>(authorityOrHostBegin, c), isMail)) {
failure();
return;
}
@@ -1866,13 +1873,16 @@
m_url.m_hostEnd = m_url.m_userStart;
m_url.m_portEnd = m_url.m_userStart;
m_url.m_pathEnd = m_url.m_userStart + 2;
- } else if (!parseHostAndPort(authorityOrHostBegin)) {
+ } else if (!parseHostAndPort(authorityOrHostBegin, isMail)) {
failure();
return;
} else {
- syntaxViolation(c);
- appendToASCIIBuffer('/');
- m_url.m_pathEnd = m_url.m_portEnd + 1;
+ if (LIKELY(!isMail || m_urlIsSpecial)) {
+ syntaxViolation(c);
+ appendToASCIIBuffer('/');
+ m_url.m_pathEnd = m_url.m_portEnd + 1;
+ } else
+ m_url.m_pathEnd = m_url.m_portEnd;
}
m_url.m_pathAfterLastSlash = m_url.m_pathEnd;
m_url.m_queryEnd = m_url.m_pathEnd;
@@ -1880,13 +1890,16 @@
break;
case State::Host:
LOG_FINAL_STATE("Host");
- if (!parseHostAndPort(authorityOrHostBegin)) {
+ if (!parseHostAndPort(authorityOrHostBegin, isMail)) {
failure();
return;
}
- syntaxViolation(c);
- appendToASCIIBuffer('/');
- m_url.m_pathEnd = m_url.m_portEnd + 1;
+ if (LIKELY(!isMail || m_urlIsSpecial)) {
+ syntaxViolation(c);
+ appendToASCIIBuffer('/');
+ m_url.m_pathEnd = m_url.m_portEnd + 1;
+ } else
+ m_url.m_pathEnd = m_url.m_portEnd;
m_url.m_pathAfterLastSlash = m_url.m_pathEnd;
m_url.m_queryEnd = m_url.m_pathEnd;
m_url.m_fragmentEnd = m_url.m_pathEnd;
@@ -1940,7 +1953,7 @@
break;
}
- if (!parseHostAndPort(CodePointIterator<CharacterType>(authorityOrHostBegin, c))) {
+ if (!parseHostAndPort(CodePointIterator<CharacterType>(authorityOrHostBegin, c), isMail)) {
failure();
return;
}
@@ -2555,7 +2568,7 @@
}
template<typename CharacterType>
-bool URLParser::parseHostAndPort(CodePointIterator<CharacterType> iterator)
+bool URLParser::parseHostAndPort(CodePointIterator<CharacterType> iterator, const bool& isMail)
{
if (iterator.atEnd())
return false;
@@ -2605,9 +2618,13 @@
}
for (; hostIterator != iterator; ++hostIterator) {
if (LIKELY(!isTabOrNewline(*hostIterator))) {
- if (UNLIKELY(isASCIIUpper(*hostIterator)))
- syntaxViolation(hostIterator);
- appendToASCIIBuffer(toASCIILower(*hostIterator));
+ if (UNLIKELY(isMail && !m_urlIsSpecial))
+ appendToASCIIBuffer(*hostIterator);
+ else {
+ if (UNLIKELY(isASCIIUpper(*hostIterator)))
+ syntaxViolation(hostIterator);
+ appendToASCIIBuffer(toASCIILower(*hostIterator));
+ }
} else
syntaxViolation(hostIterator);
}
Modified: tags/Safari-603.1.9/Source/WebCore/platform/URLParser.h (207302 => 207303)
--- tags/Safari-603.1.9/Source/WebCore/platform/URLParser.h 2016-10-13 19:26:19 UTC (rev 207302)
+++ tags/Safari-603.1.9/Source/WebCore/platform/URLParser.h 2016-10-13 20:03:39 UTC (rev 207303)
@@ -60,7 +60,7 @@
template<typename CharacterType> void parse(const CharacterType*, const unsigned length, const URL&, const TextEncoding&);
template<typename CharacterType> void parseAuthority(CodePointIterator<CharacterType>);
- template<typename CharacterType> bool parseHostAndPort(CodePointIterator<CharacterType>);
+ template<typename CharacterType> bool parseHostAndPort(CodePointIterator<CharacterType>, const bool& isMail);
template<typename CharacterType> bool parsePort(CodePointIterator<CharacterType>&);
void failure();