Scheme of content utils should be compared in an ASCII case-insensitive manner
authorgyuyoung.kim@samsung.com <gyuyoung.kim@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 7 Jun 2014 01:29:21 +0000 (01:29 +0000)
committergyuyoung.kim@samsung.com <gyuyoung.kim@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 7 Jun 2014 01:29:21 +0000 (01:29 +0000)
https://bugs.webkit.org/show_bug.cgi?id=133502

Reviewed by Darin Adler.

Source/WebCore:
According to spec, scheme must be compared in an ASCII case-insensitive manner by user agents.

Covered by existing tests.

* Modules/navigatorcontentutils/NavigatorContentUtils.cpp:
(WebCore::isProtocolWhitelisted):

LayoutTests:
Tests are updated to compare protocol in ASCII case-insensitive manner.

* fast/dom/NavigatorContentUtils/register-protocol-handler-expected.txt:
* fast/dom/NavigatorContentUtils/register-protocol-handler.html:
* fast/dom/NavigatorContentUtils/unregister-protocol-handler-expected.txt:
* fast/dom/NavigatorContentUtils/unregister-protocol-handler.html:
* platform/efl/fast/dom/NavigatorContentUtils/register-protocol-handler-expected.txt:
* platform/efl/fast/dom/NavigatorContentUtils/unregister-protocol-handler-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@169670 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/dom/NavigatorContentUtils/register-protocol-handler-expected.txt
LayoutTests/fast/dom/NavigatorContentUtils/register-protocol-handler.html
LayoutTests/fast/dom/NavigatorContentUtils/unregister-protocol-handler-expected.txt
LayoutTests/fast/dom/NavigatorContentUtils/unregister-protocol-handler.html
LayoutTests/platform/efl/fast/dom/NavigatorContentUtils/register-protocol-handler-expected.txt
LayoutTests/platform/efl/fast/dom/NavigatorContentUtils/unregister-protocol-handler-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/Modules/navigatorcontentutils/NavigatorContentUtils.cpp

index 8bd6164..dc2967b 100644 (file)
@@ -1,3 +1,19 @@
+2014-06-06  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
+
+        Scheme of content utils should be compared in an ASCII case-insensitive manner
+        https://bugs.webkit.org/show_bug.cgi?id=133502
+
+        Reviewed by Darin Adler.
+
+        Tests are updated to compare protocol in ASCII case-insensitive manner.
+
+        * fast/dom/NavigatorContentUtils/register-protocol-handler-expected.txt:
+        * fast/dom/NavigatorContentUtils/register-protocol-handler.html:
+        * fast/dom/NavigatorContentUtils/unregister-protocol-handler-expected.txt:
+        * fast/dom/NavigatorContentUtils/unregister-protocol-handler.html:
+        * platform/efl/fast/dom/NavigatorContentUtils/register-protocol-handler-expected.txt:
+        * platform/efl/fast/dom/NavigatorContentUtils/unregister-protocol-handler-expected.txt:
+
 2014-06-06  David Hyatt  <hyatt@apple.com>
 
         REGRESSION: Hit testing of composited elements is broken in new multicolumn layout.
index bd49588..63f478a 100644 (file)
@@ -6,11 +6,14 @@ Fail: Invalid protocol "https" allowed.
 Fail: Invalid protocol "file" allowed.
 Fail: Invalid protocol "web+" allowed.
 Fail: Valid protocol "bitcoin" failed.
+Fail: Valid protocol "BitcoIn" failed.
 Fail: Valid protocol "geo" failed.
 Fail: Valid protocol "im" failed.
 Fail: Valid protocol "irc" failed.
+Fail: Valid protocol "Irc" failed.
 Fail: Valid protocol "ircs" failed.
 Fail: Valid protocol "magnet" failed.
+Fail: Valid protocol "MagneT" failed.
 Fail: Valid protocol "mailto" failed.
 Fail: Valid protocol "mms" failed.
 Fail: Valid protocol "news" failed.
@@ -18,11 +21,14 @@ Fail: Valid protocol "nntp" failed.
 Fail: Valid protocol "sip" failed.
 Fail: Valid protocol "sms" failed.
 Fail: Valid protocol "smsto" failed.
+Fail: Valid protocol "SmsTo" failed.
 Fail: Valid protocol "ssh" failed.
 Fail: Valid protocol "tel" failed.
 Fail: Valid protocol "urn" failed.
 Fail: Valid protocol "webcal" failed.
+Fail: Valid protocol "WebCAL" failed.
 Fail: Valid protocol "wtai" failed.
+Fail: Valid protocol "WTAI" failed.
 Fail: Valid protocol "xmpp" failed.
 Pass: Invalid scheme "mailto:" failed.
 Pass: Invalid scheme "ssh:/" failed.
index 2a6be78..87c58b1 100644 (file)
@@ -32,7 +32,7 @@ invalid_protocols.forEach(function (protocol) {
         debug('Fail: Invalid protocol "' + protocol + '" allowed.');
 });
 
-var valid_protocols = ['bitcoin', 'geo', 'im', 'irc', 'ircs', 'magnet', 'mailto', 'mms', 'news', 'nntp', 'sip', 'sms', 'smsto', 'ssh', 'tel', 'urn', 'webcal', 'wtai', 'xmpp'];
+var valid_protocols = ['bitcoin', 'BitcoIn', 'geo', 'im', 'irc', 'Irc', 'ircs', 'magnet', 'MagneT', 'mailto', 'mms', 'news', 'nntp', 'sip', 'sms', 'smsto', 'SmsTo', 'ssh', 'tel', 'urn', 'webcal', 'WebCAL', 'wtai', 'WTAI', 'xmpp'];
 valid_protocols.forEach(function (protocol) {
     var succeeded = false;
     try {
index 1aa74a0..6da808e 100644 (file)
@@ -6,11 +6,14 @@ Fail: Invalid protocol "https" allowed.
 Fail: Invalid protocol "file" allowed.
 Fail: Invalid protocol "web+" allowed.
 Fail: Valid protocol "bitcoin" failed.
+Fail: Valid protocol "BitcoIn" failed.
 Fail: Valid protocol "geo" failed.
 Fail: Valid protocol "im" failed.
 Fail: Valid protocol "irc" failed.
+Fail: Valid protocol "Irc" failed.
 Fail: Valid protocol "ircs" failed.
 Fail: Valid protocol "magnet" failed.
+Fail: Valid protocol "MagneT" failed.
 Fail: Valid protocol "mailto" failed.
 Fail: Valid protocol "mms" failed.
 Fail: Valid protocol "news" failed.
@@ -18,11 +21,14 @@ Fail: Valid protocol "nntp" failed.
 Fail: Valid protocol "sip" failed.
 Fail: Valid protocol "sms" failed.
 Fail: Valid protocol "smsto" failed.
+Fail: Valid protocol "SmsTo" failed.
 Fail: Valid protocol "ssh" failed.
 Fail: Valid protocol "tel" failed.
 Fail: Valid protocol "urn" failed.
 Fail: Valid protocol "webcal" failed.
+Fail: Valid protocol "WebCAL" failed.
 Fail: Valid protocol "wtai" failed.
+Fail: Valid protocol "WTAI" failed.
 Fail: Valid protocol "xmpp" failed.
 Pass: Invalid scheme "mailto:" failed.
 Pass: Invalid scheme "ssh:/" failed.
index bb656f3..c75f0ba 100644 (file)
@@ -32,7 +32,7 @@ invalid_protocols.forEach(function (protocol) {
         debug('Fail: Invalid protocol "' + protocol + '" allowed.');
 });
 
-var valid_protocols = ['bitcoin', 'geo', 'im', 'irc', 'ircs', 'magnet', 'mailto', 'mms', 'news', 'nntp', 'sip', 'sms', 'smsto', 'ssh', 'tel', 'urn', 'webcal', 'wtai', 'xmpp'];
+var valid_protocols = ['bitcoin', 'BitcoIn', 'geo', 'im', 'irc', 'Irc', 'ircs', 'magnet', 'MagneT', 'mailto', 'mms', 'news', 'nntp', 'sip', 'sms', 'smsto', 'SmsTo', 'ssh', 'tel', 'urn', 'webcal', 'WebCAL', 'wtai', 'WTAI', 'xmpp'];
 valid_protocols.forEach(function (protocol) {
     var succeeded = false;
     try {
index 449d1c8..4bf7018 100644 (file)
@@ -6,11 +6,14 @@ Pass: Invalid protocol "https" threw SecurityError exception.
 Pass: Invalid protocol "file" threw SecurityError exception.
 Pass: Invalid protocol "web+" threw SecurityError exception.
 Pass: Valid protocol "bitcoin" allowed.
+Pass: Valid protocol "BitcoIn" allowed.
 Pass: Valid protocol "geo" allowed.
 Pass: Valid protocol "im" allowed.
 Pass: Valid protocol "irc" allowed.
+Pass: Valid protocol "Irc" allowed.
 Pass: Valid protocol "ircs" allowed.
 Pass: Valid protocol "magnet" allowed.
+Pass: Valid protocol "MagneT" allowed.
 Pass: Valid protocol "mailto" allowed.
 Pass: Valid protocol "mms" allowed.
 Pass: Valid protocol "news" allowed.
@@ -18,11 +21,14 @@ Pass: Valid protocol "nntp" allowed.
 Pass: Valid protocol "sip" allowed.
 Pass: Valid protocol "sms" allowed.
 Pass: Valid protocol "smsto" allowed.
+Pass: Valid protocol "SmsTo" allowed.
 Pass: Valid protocol "ssh" allowed.
 Pass: Valid protocol "tel" allowed.
 Pass: Valid protocol "urn" allowed.
 Pass: Valid protocol "webcal" allowed.
+Pass: Valid protocol "WebCAL" allowed.
 Pass: Valid protocol "wtai" allowed.
+Pass: Valid protocol "WTAI" allowed.
 Pass: Valid protocol "xmpp" allowed.
 Pass: Invalid scheme "mailto:" failed.
 Pass: Invalid scheme "ssh:/" failed.
index 695bc5a..d719aed 100644 (file)
@@ -6,11 +6,14 @@ Pass: Invalid protocol "https" threw SecurityError exception.
 Pass: Invalid protocol "file" threw SecurityError exception.
 Pass: Invalid protocol "web+" threw SecurityError exception.
 Pass: Valid protocol "bitcoin" allowed.
+Pass: Valid protocol "BitcoIn" allowed.
 Pass: Valid protocol "geo" allowed.
 Pass: Valid protocol "im" allowed.
 Pass: Valid protocol "irc" allowed.
+Pass: Valid protocol "Irc" allowed.
 Pass: Valid protocol "ircs" allowed.
 Pass: Valid protocol "magnet" allowed.
+Pass: Valid protocol "MagneT" allowed.
 Pass: Valid protocol "mailto" allowed.
 Pass: Valid protocol "mms" allowed.
 Pass: Valid protocol "news" allowed.
@@ -18,11 +21,14 @@ Pass: Valid protocol "nntp" allowed.
 Pass: Valid protocol "sip" allowed.
 Pass: Valid protocol "sms" allowed.
 Pass: Valid protocol "smsto" allowed.
+Pass: Valid protocol "SmsTo" allowed.
 Pass: Valid protocol "ssh" allowed.
 Pass: Valid protocol "tel" allowed.
 Pass: Valid protocol "urn" allowed.
 Pass: Valid protocol "webcal" allowed.
+Pass: Valid protocol "WebCAL" allowed.
 Pass: Valid protocol "wtai" allowed.
+Pass: Valid protocol "WTAI" allowed.
 Pass: Valid protocol "xmpp" allowed.
 Pass: Invalid scheme "mailto:" failed.
 Pass: Invalid scheme "ssh:/" failed.
index 041eec0..a5c3878 100644 (file)
@@ -1,3 +1,17 @@
+2014-06-06  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
+
+        Scheme of content utils should be compared in an ASCII case-insensitive manner
+        https://bugs.webkit.org/show_bug.cgi?id=133502
+
+        Reviewed by Darin Adler.
+
+        According to spec, scheme must be compared in an ASCII case-insensitive manner by user agents.
+
+        Covered by existing tests.
+
+        * Modules/navigatorcontentutils/NavigatorContentUtils.cpp:
+        (WebCore::isProtocolWhitelisted):
+
 2014-06-06  Andreas Kling  <akling@apple.com>
 
         Indexed getters should return values directly on the PropertySlot.
index 6769741..9c688b6 100644 (file)
@@ -98,7 +98,7 @@ static bool isProtocolWhitelisted(const String& scheme)
 {
     if (!protocolWhitelist)
         initProtocolHandlerWhitelist();
-    return protocolWhitelist->contains(scheme);
+    return protocolWhitelist->contains(scheme.convertToASCIILowercase());
 }
 
 static bool verifyProtocolHandlerScheme(const String& scheme, ExceptionCode& ec)