Changeset 207305 in webkit
- Timestamp:
- Oct 13, 2016 2:01:58 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r207302 r207305 1 2016-10-13 Alex Christensen <achristensen@webkit.org> 2 3 Disable URLParser for non-Safari iOS and Mac apps for now 4 https://bugs.webkit.org/show_bug.cgi?id=163397 5 6 Reviewed by Tim Horton. 7 8 r207268 was an awful hack, and it was insufficient. 9 Disable the URLParser for other apps for now. Hopefully we can enable it everywhere soon. 10 11 No change in behavior for testing infrastructure. 12 Old URLs were well tested before making the switch, and nothing has changed for them. 13 14 * platform/URLParser.cpp: 15 (WebCore::URLParser::parse): 16 (WebCore::URLParser::parseHostAndPort): 17 (WebCore::URLParser::setEnabled): 18 (WebCore::URLParser::enabled): 19 * platform/URLParser.h: 20 1 21 2016-10-13 Chris Dumez <cdumez@apple.com> 2 22 -
trunk/Source/WebCore/platform/URLParser.cpp
r207301 r207305 1129 1129 void URLParser::parse(const CharacterType* input, const unsigned length, const URL& base, const TextEncoding& encoding) 1130 1130 { 1131 #if PLATFORM(MAC)1132 static bool isMail = MacApplication::isAppleMail();1133 #else1134 static bool isMail = false;1135 #endif1136 1137 1131 URL_PARSER_LOG("Parsing URL <%s> base <%s> encoding <%s>", String(input, length).utf8().data(), base.string().utf8().data(), encoding.name()); 1138 1132 m_url = { }; … … 1461 1455 m_url.m_userEnd = currentPosition(authorityOrHostBegin); 1462 1456 m_url.m_passwordEnd = m_url.m_userEnd; 1463 if (!parseHostAndPort(iterator , isMail)) {1457 if (!parseHostAndPort(iterator)) { 1464 1458 failure(); 1465 1459 return; … … 1483 1477 LOG_STATE("Host"); 1484 1478 if (*c == '/' || *c == '?' || *c == '#') { 1485 if (!parseHostAndPort(CodePointIterator<CharacterType>(authorityOrHostBegin, c) , isMail)) {1479 if (!parseHostAndPort(CodePointIterator<CharacterType>(authorityOrHostBegin, c))) { 1486 1480 failure(); 1487 1481 return; … … 1654 1648 break; 1655 1649 } 1656 if (!parseHostAndPort(CodePointIterator<CharacterType>(authorityOrHostBegin, c) , isMail)) {1650 if (!parseHostAndPort(CodePointIterator<CharacterType>(authorityOrHostBegin, c))) { 1657 1651 failure(); 1658 1652 return; … … 1874 1868 m_url.m_portEnd = m_url.m_userStart; 1875 1869 m_url.m_pathEnd = m_url.m_userStart + 2; 1876 } else if (!parseHostAndPort(authorityOrHostBegin , isMail)) {1870 } else if (!parseHostAndPort(authorityOrHostBegin)) { 1877 1871 failure(); 1878 1872 return; 1879 1873 } else { 1880 if (LIKELY(!isMail || m_urlIsSpecial)) { 1881 syntaxViolation(c); 1882 appendToASCIIBuffer('/'); 1883 m_url.m_pathEnd = m_url.m_portEnd + 1; 1884 } else 1885 m_url.m_pathEnd = m_url.m_portEnd; 1874 syntaxViolation(c); 1875 appendToASCIIBuffer('/'); 1876 m_url.m_pathEnd = m_url.m_portEnd + 1; 1886 1877 } 1887 1878 m_url.m_pathAfterLastSlash = m_url.m_pathEnd; … … 1891 1882 case State::Host: 1892 1883 LOG_FINAL_STATE("Host"); 1893 if (!parseHostAndPort(authorityOrHostBegin , isMail)) {1884 if (!parseHostAndPort(authorityOrHostBegin)) { 1894 1885 failure(); 1895 1886 return; 1896 1887 } 1897 if (LIKELY(!isMail || m_urlIsSpecial)) { 1898 syntaxViolation(c); 1899 appendToASCIIBuffer('/'); 1900 m_url.m_pathEnd = m_url.m_portEnd + 1; 1901 } else 1902 m_url.m_pathEnd = m_url.m_portEnd; 1888 syntaxViolation(c); 1889 appendToASCIIBuffer('/'); 1890 m_url.m_pathEnd = m_url.m_portEnd + 1; 1903 1891 m_url.m_pathAfterLastSlash = m_url.m_pathEnd; 1904 1892 m_url.m_queryEnd = m_url.m_pathEnd; … … 1954 1942 } 1955 1943 1956 if (!parseHostAndPort(CodePointIterator<CharacterType>(authorityOrHostBegin, c) , isMail)) {1944 if (!parseHostAndPort(CodePointIterator<CharacterType>(authorityOrHostBegin, c))) { 1957 1945 failure(); 1958 1946 return; … … 2569 2557 2570 2558 template<typename CharacterType> 2571 bool URLParser::parseHostAndPort(CodePointIterator<CharacterType> iterator , const bool& isMail)2559 bool URLParser::parseHostAndPort(CodePointIterator<CharacterType> iterator) 2572 2560 { 2573 2561 if (iterator.atEnd()) … … 2619 2607 for (; hostIterator != iterator; ++hostIterator) { 2620 2608 if (LIKELY(!isTabOrNewline(*hostIterator))) { 2621 if (UNLIKELY(isMail && !m_urlIsSpecial)) 2622 appendToASCIIBuffer(*hostIterator); 2623 else { 2624 if (UNLIKELY(isASCIIUpper(*hostIterator))) 2625 syntaxViolation(hostIterator); 2626 appendToASCIIBuffer(toASCIILower(*hostIterator)); 2627 } 2609 if (UNLIKELY(isASCIIUpper(*hostIterator))) 2610 syntaxViolation(hostIterator); 2611 appendToASCIIBuffer(toASCIILower(*hostIterator)); 2628 2612 } else 2629 2613 syntaxViolation(hostIterator); … … 2804 2788 } 2805 2789 2806 static bool urlParserEnabled = true; 2790 enum class URLParserEnabled { 2791 Undetermined, 2792 Yes, 2793 No 2794 }; 2795 2796 static URLParserEnabled urlParserEnabled = URLParserEnabled::Undetermined; 2807 2797 2808 2798 void URLParser::setEnabled(bool enabled) 2809 2799 { 2810 urlParserEnabled = enabled ;2800 urlParserEnabled = enabled ? URLParserEnabled::Yes : URLParserEnabled::No; 2811 2801 } 2812 2802 2813 2803 bool URLParser::enabled() 2814 2804 { 2815 return urlParserEnabled; 2805 if (urlParserEnabled == URLParserEnabled::Undetermined) { 2806 #if PLATFORM(MAC) 2807 urlParserEnabled = MacApplication::isSafari() ? URLParserEnabled::Yes : URLParserEnabled::No; 2808 #elif PLATFORM(IOS) 2809 urlParserEnabled = IOSApplication::isMobileSafari() ? URLParserEnabled::Yes : URLParserEnabled::No; 2810 #else 2811 urlParserEnabled = URLParserEnabled::Yes; 2812 #endif 2813 } 2814 return urlParserEnabled == URLParserEnabled::Yes; 2816 2815 } 2817 2816 -
trunk/Source/WebCore/platform/URLParser.h
r207301 r207305 61 61 template<typename CharacterType> void parse(const CharacterType*, const unsigned length, const URL&, const TextEncoding&); 62 62 template<typename CharacterType> void parseAuthority(CodePointIterator<CharacterType>); 63 template<typename CharacterType> bool parseHostAndPort(CodePointIterator<CharacterType> , const bool& isMail);63 template<typename CharacterType> bool parseHostAndPort(CodePointIterator<CharacterType>); 64 64 template<typename CharacterType> bool parsePort(CodePointIterator<CharacterType>&); 65 65 -
trunk/Source/WebCore/testing/js/WebCoreTestSupport.cpp
r205275 r207305 36 36 #include "MockGamepadProvider.h" 37 37 #include "Page.h" 38 #include "URLParser.h" 38 39 #include "WheelEventTestTrigger.h" 39 40 #include <JavaScriptCore/APICast.h> … … 121 122 } 122 123 124 void setURLParserEnabled(bool enabled) 125 { 126 URLParser::setEnabled(enabled); 127 } 128 123 129 void installMockGamepadProvider() 124 130 { -
trunk/Source/WebCore/testing/js/WebCoreTestSupport.h
r204853 r207305 57 57 void initializeLogChannelsIfNecessary() TEST_SUPPORT_EXPORT; 58 58 void setAllowsAnySSLCertificate(bool) TEST_SUPPORT_EXPORT; 59 void setURLParserEnabled(bool) TEST_SUPPORT_EXPORT; 59 60 60 61 void installMockGamepadProvider() TEST_SUPPORT_EXPORT; -
trunk/Tools/ChangeLog
r207301 r207305 1 2016-10-13 Alex Christensen <achristensen@webkit.org> 2 3 Disable URLParser for non-Safari iOS and Mac apps for now 4 https://bugs.webkit.org/show_bug.cgi?id=163397 5 6 Reviewed by Tim Horton. 7 8 * DumpRenderTree/mac/DumpRenderTree.mm: 9 (DumpRenderTreeMain): 10 * WebKitTestRunner/TestController.cpp: 11 Enable the URLParser for testing. 12 * WebKitTestRunner/Configurations/WebKitTestRunnerApp.xcconfig: 13 Link with WebCoreTestSupport so we can find setURLParserEnabled. 14 1 15 2016-10-13 Ryan Haddad <ryanhaddad@apple.com> 2 16 -
trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm
r207301 r207305 1410 1410 int DumpRenderTreeMain(int argc, const char *argv[]) 1411 1411 { 1412 WebCoreTestSupport::setURLParserEnabled(true); 1412 1413 atexit(atexitFunction); 1413 1414 -
trunk/Tools/WebKitTestRunner/Configurations/WebKitTestRunnerApp.xcconfig
r204386 r207305 30 30 GCC_ENABLE_OBJC_EXCEPTIONS = YES; 31 31 32 OTHER_LDFLAGS = $(inherited) -l$(WEBKIT_SYSTEM_INTERFACE_LIBRARY) -lWebKitTestRunner - framework JavaScriptCore -framework CoreGraphics -framework QuartzCore -framework ImageIO -framework IOKit -framework UIKit -framework WebKit -framework Foundation;32 OTHER_LDFLAGS = $(inherited) -l$(WEBKIT_SYSTEM_INTERFACE_LIBRARY) -lWebKitTestRunner -lWebCoreTestSupport -framework JavaScriptCore -framework CoreGraphics -framework QuartzCore -framework ImageIO -framework IOKit -framework UIKit -framework WebKit -framework Foundation; 33 33 34 34 SKIP_INSTALL[sdk=macosx*] = YES; -
trunk/Tools/WebKitTestRunner/TestController.cpp
r206596 r207305 116 116 TestController::TestController(int argc, const char* argv[]) 117 117 { 118 WebCoreTestSupport::setURLParserEnabled(true); 118 119 initialize(argc, argv); 119 120 controller = this;
Note: See TracChangeset
for help on using the changeset viewer.