Title: [87713] trunk
Revision
87713
Author
[email protected]
Date
2011-05-30 23:28:58 -0700 (Mon, 30 May 2011)

Log Message

2011-05-30  James Kozianski  <[email protected]>

        Reviewed by Kent Tamura.

        [Chromium] Make isValidProtocol() accept protocols with '+'.
        https://bugs.webkit.org/show_bug.cgi?id=61759

        * platform/chromium/fast/dom/navigator-detached-no-crash-expected.txt: Added.
        * platform/chromium/fast/dom/register-protocol-handler-expected.txt: Added.
2011-05-30  James Kozianski  <[email protected]>

        Reviewed by Kent Tamura.

        [Chromium] Make isValidProtocol() accept protocols with '+'.
        https://bugs.webkit.org/show_bug.cgi?id=61759

        Also, detect syntax errors before security errors; some syntax errors
        will also trigger a security error, but it's more helpful to the
        programmer to know if they have a syntax error, which are well-defined
        in the spec, rather than a security error, which aren't.

        * page/Navigator.cpp:
        (WebCore::Navigator::registerProtocolHandler):
        Detect syntax errors before security errors.
        * platform/KURLGoogle.cpp:
        (WebCore::isSchemeChar):
        Include '+' in the list of valid characters.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (87712 => 87713)


--- trunk/LayoutTests/ChangeLog	2011-05-31 05:22:17 UTC (rev 87712)
+++ trunk/LayoutTests/ChangeLog	2011-05-31 06:28:58 UTC (rev 87713)
@@ -1,3 +1,13 @@
+2011-05-30  James Kozianski  <[email protected]>
+
+        Reviewed by Kent Tamura.
+
+        [Chromium] Make isValidProtocol() accept protocols with '+'.
+        https://bugs.webkit.org/show_bug.cgi?id=61759
+
+        * platform/chromium/fast/dom/navigator-detached-no-crash-expected.txt: Added.
+        * platform/chromium/fast/dom/register-protocol-handler-expected.txt: Added.
+
 2011-05-30  Andrey Petrov  <[email protected]>
 
         Reviewed by Hajime Morita.

Added: trunk/LayoutTests/platform/chromium/fast/dom/navigator-detached-no-crash-expected.txt (0 => 87713)


--- trunk/LayoutTests/platform/chromium/fast/dom/navigator-detached-no-crash-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/chromium/fast/dom/navigator-detached-no-crash-expected.txt	2011-05-31 06:28:58 UTC (rev 87713)
@@ -0,0 +1,37 @@
+This tests that the navigator object of a deleted frame is disconnected properly. Accessing fields or methods shouldn't crash the browser. 
+ Check Navigator
+navigator.appCodeName is OK
+navigator.appName is OK
+navigator.appVersion is OK
+navigator.cookieEnabled is OK
+navigator.getStorageUpdates() is OK
+navigator.javaEnabled() is OK
+navigator.language is OK
+navigator.mimeTypes is OK
+navigator.onLine is OK
+navigator.platform is OK
+navigator.plugins is OK
+navigator.product is OK
+navigator.productSub is OK
+navigator.registerProtocolHandler() is OK
+navigator.userAgent is OK
+navigator.vendor is OK
+navigator.vendorSub is OK
+navigator.appCodeName is OK
+navigator.appName is OK
+navigator.appVersion is OK
+navigator.cookieEnabled is OK
+navigator.getStorageUpdates() is OK
+navigator.javaEnabled() is OK
+navigator.language is OK
+navigator.mimeTypes is OK
+navigator.onLine is OK
+navigator.platform is OK
+navigator.plugins is OK
+navigator.product is OK
+navigator.productSub is OK
+navigator.registerProtocolHandler() is OK
+navigator.userAgent is OK
+navigator.vendor is OK
+navigator.vendorSub is OK
+

Added: trunk/LayoutTests/platform/chromium/fast/dom/register-protocol-handler-expected.txt (0 => 87713)


--- trunk/LayoutTests/platform/chromium/fast/dom/register-protocol-handler-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/chromium/fast/dom/register-protocol-handler-expected.txt	2011-05-31 06:28:58 UTC (rev 87713)
@@ -0,0 +1,10 @@
+This test makes sure that navigator.registerProtocolHandler throws the proper exceptions and has no-op default implementation.
+
+Pass: window.navigator.registerProtocolHandler is defined.
+Pass: Invalid protocol "http" threw SECURITY_ERR exception.
+Pass: Invalid protocol "https" threw SECURITY_ERR exception.
+Pass: Invalid protocol "file" threw SECURITY_ERR exception.
+Pass: Invalid url "" threw SYNTAX_ERR exception.
+Pass: Invalid url "%S" threw SYNTAX_ERR exception.
+Pass: Valid call succeeded.
+

Modified: trunk/Source/WebCore/ChangeLog (87712 => 87713)


--- trunk/Source/WebCore/ChangeLog	2011-05-31 05:22:17 UTC (rev 87712)
+++ trunk/Source/WebCore/ChangeLog	2011-05-31 06:28:58 UTC (rev 87713)
@@ -1,3 +1,22 @@
+2011-05-30  James Kozianski  <[email protected]>
+
+        Reviewed by Kent Tamura.
+
+        [Chromium] Make isValidProtocol() accept protocols with '+'.
+        https://bugs.webkit.org/show_bug.cgi?id=61759
+
+        Also, detect syntax errors before security errors; some syntax errors
+        will also trigger a security error, but it's more helpful to the
+        programmer to know if they have a syntax error, which are well-defined
+        in the spec, rather than a security error, which aren't.
+
+        * page/Navigator.cpp:
+        (WebCore::Navigator::registerProtocolHandler):
+        Detect syntax errors before security errors.
+        * platform/KURLGoogle.cpp:
+        (WebCore::isSchemeChar):
+        Include '+' in the list of valid characters.
+
 2011-05-30  Andrey Petrov  <[email protected]>
 
         Reviewed by Hajime Morita.

Modified: trunk/Source/WebCore/page/Navigator.cpp (87712 => 87713)


--- trunk/Source/WebCore/page/Navigator.cpp	2011-05-31 05:22:17 UTC (rev 87712)
+++ trunk/Source/WebCore/page/Navigator.cpp	2011-05-31 06:28:58 UTC (rev 87713)
@@ -251,9 +251,6 @@
 
 void Navigator::registerProtocolHandler(const String& scheme, const String& url, const String& title, ExceptionCode& ec)
 {
-    if (!verifyProtocolHandlerScheme(scheme, ec))
-        return;
-
     if (!m_frame)
         return;
 
@@ -266,6 +263,9 @@
     if (!verifyCustomHandlerURL(baseURL, url, ec))
         return;
 
+    if (!verifyProtocolHandlerScheme(scheme, ec))
+        return;
+
     Page* page = m_frame->page();
     if (!page)
         return;

Modified: trunk/Source/WebCore/platform/KURLGoogle.cpp (87712 => 87713)


--- trunk/Source/WebCore/platform/KURLGoogle.cpp	2011-05-31 05:22:17 UTC (rev 87712)
+++ trunk/Source/WebCore/platform/KURLGoogle.cpp	2011-05-31 06:28:58 UTC (rev 87713)
@@ -130,7 +130,7 @@
 
 static inline bool isSchemeChar(char c)
 {
-    return isSchemeFirstChar(c) || (c >= '0' && c <= '9') || c == '.' || c == '-' || c == '*';
+    return isSchemeFirstChar(c) || (c >= '0' && c <= '9') || c == '.' || c == '-' || c == '+';
 }
 
 bool isValidProtocol(const String& protocol)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to