Title: [200799] trunk
Revision
200799
Author
[email protected]
Date
2016-05-12 16:22:47 -0700 (Thu, 12 May 2016)

Log Message

REGRESSION (r199313): ICBC app: text field In the webview is not tappable
https://bugs.webkit.org/show_bug.cgi?id=157396
<rdar://problem/25931513>

Reviewed by David Kilzer.

Source/WebCore:

Add a quirk for WebKit1 apps.

* loader/SubframeLoader.cpp:
(WebCore::SubframeLoader::requestFrame):
Even though the HTML spec suggests that we should navigate to about:blank
for subframes/iframes, of which the src cannot be resolved to an valid URL,
many existing WebKit1 apps are relying on invalid URLs to bridge their WebView
codes and their native Objective-C codes. Therefore, a quirk is added to
escape the URL validation for existing WebKit1 apps.
(WebCore::SubframeLoader::shouldConvertInvalidURLsToBlank):
* loader/SubframeLoader.h:
* page/Settings.in:

Source/WebKit/mac:

Add a quirk for WebKit1 apps.

* WebView/WebView.mm:
(shouldConvertInvalidURLsToBlank):
(-[WebView _preferencesChanged:]):

LayoutTests:

The previous test is actually bogus, and therefore modify it to do the
real task.

* fast/loader/iframe-src-invalid-url-expected.txt:
* fast/loader/iframe-src-invalid-url.html:
* platform/ios-simulator-wk1/TestExpectations:
* platform/mac-wk1/TestExpectations:
* platform/win/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (200798 => 200799)


--- trunk/LayoutTests/ChangeLog	2016-05-12 23:11:05 UTC (rev 200798)
+++ trunk/LayoutTests/ChangeLog	2016-05-12 23:22:47 UTC (rev 200799)
@@ -1,3 +1,20 @@
+2016-05-12  Jiewen Tan  <[email protected]>
+
+        REGRESSION (r199313): ICBC app: text field In the webview is not tappable
+        https://bugs.webkit.org/show_bug.cgi?id=157396
+        <rdar://problem/25931513>
+
+        Reviewed by David Kilzer.
+
+        The previous test is actually bogus, and therefore modify it to do the
+        real task.
+
+        * fast/loader/iframe-src-invalid-url-expected.txt:
+        * fast/loader/iframe-src-invalid-url.html:
+        * platform/ios-simulator-wk1/TestExpectations:
+        * platform/mac-wk1/TestExpectations:
+        * platform/win/TestExpectations:
+
 2016-05-12  Ryosuke Niwa  <[email protected]>
 
         indexForVisiblePosition should use the root editable element as the scope

Modified: trunk/LayoutTests/fast/loader/iframe-src-invalid-url-expected.txt (200798 => 200799)


--- trunk/LayoutTests/fast/loader/iframe-src-invalid-url-expected.txt	2016-05-12 23:11:05 UTC (rev 200798)
+++ trunk/LayoutTests/fast/loader/iframe-src-invalid-url-expected.txt	2016-05-12 23:22:47 UTC (rev 200799)
@@ -1,13 +1,7 @@
-Test passes if the first child frame prints about:blank.
+ - decidePolicyForNavigationAction 
+<NSURLRequest URL data:text/html,    <iframe id='iframe' src=''></iframe>, main document URL iframe-src-invalid-url.html, http method GET> is main frame - no should open URLs externally - no
+ - decidePolicyForNavigationAction 
+<NSURLRequest URL about:blank, main document URL iframe-src-invalid-url.html, http method GET> is main frame - no should open URLs externally - no
+Test passes if the second iframe navigates to about:blank.
 
 
-
---------
-Frame: '<!--framePath //<!--frame0-->-->'
---------
-about:blank
-
---------
-Frame: 'iframe'
---------
-

Modified: trunk/LayoutTests/fast/loader/iframe-src-invalid-url.html (200798 => 200799)


--- trunk/LayoutTests/fast/loader/iframe-src-invalid-url.html	2016-05-12 23:11:05 UTC (rev 200798)
+++ trunk/LayoutTests/fast/loader/iframe-src-invalid-url.html	2016-05-12 23:22:47 UTC (rev 200799)
@@ -4,14 +4,13 @@
 <script>
     if (window.testRunner) {
         testRunner.dumpAsText();
-        testRunner.dumpChildFramesAsText();
+        testRunner.dumpPolicyDelegateCallbacks();
     }
 </script>
 </head>
 <body>
-    <p>Test passes if the first child frame prints about:blank.</p>
+    <p>Test passes if the second iframe navigates to about:blank.</p>
     <iframe src=""
-    <iframe id='iframe' src=''></iframe>
-    <script>document.write(document.getElementById('iframe').contentWindow.location.href);</script>"></iframe>
+    <iframe id='iframe' src=''></iframe>"></iframe>
 </body>
 </html>
\ No newline at end of file

Modified: trunk/LayoutTests/platform/ios-simulator-wk1/TestExpectations (200798 => 200799)


--- trunk/LayoutTests/platform/ios-simulator-wk1/TestExpectations	2016-05-12 23:11:05 UTC (rev 200798)
+++ trunk/LayoutTests/platform/ios-simulator-wk1/TestExpectations	2016-05-12 23:22:47 UTC (rev 200799)
@@ -1375,3 +1375,6 @@
 fast/scrolling/ios/textarea-scroll-touch.html [ Failure ]
 fast/scrolling/ios/touch-stacking.html [ Failure ]
 fast/scrolling/ios/touch-scroll-visibility-hidden.html [ Skip ]
+
+# dumpPolicyDelegateCallbacks is not supported in DumpRenderTree
+fast/loader/iframe-src-invalid-url.html [ Skip ]

Modified: trunk/LayoutTests/platform/mac-wk1/TestExpectations (200798 => 200799)


--- trunk/LayoutTests/platform/mac-wk1/TestExpectations	2016-05-12 23:11:05 UTC (rev 200798)
+++ trunk/LayoutTests/platform/mac-wk1/TestExpectations	2016-05-12 23:22:47 UTC (rev 200799)
@@ -216,3 +216,6 @@
 
 # This test relies on a settings option that we can only set with WKRT.
 js/dom/regress-157246.html
+
+# dumpPolicyDelegateCallbacks is not supported in DumpRenderTree
+fast/loader/iframe-src-invalid-url.html [ Skip ]

Modified: trunk/LayoutTests/platform/win/TestExpectations (200798 => 200799)


--- trunk/LayoutTests/platform/win/TestExpectations	2016-05-12 23:11:05 UTC (rev 200798)
+++ trunk/LayoutTests/platform/win/TestExpectations	2016-05-12 23:22:47 UTC (rev 200799)
@@ -3387,3 +3387,6 @@
 
 # This test relies on iOS-specific font fallback.
 fast/text/arabic-blacklisted-expected.html [ Pass ImageOnlyFailure ]
+
+# dumpPolicyDelegateCallbacks is not supported in DumpRenderTree
+fast/loader/iframe-src-invalid-url.html [ Skip ]

Modified: trunk/Source/WebCore/ChangeLog (200798 => 200799)


--- trunk/Source/WebCore/ChangeLog	2016-05-12 23:11:05 UTC (rev 200798)
+++ trunk/Source/WebCore/ChangeLog	2016-05-12 23:22:47 UTC (rev 200799)
@@ -1,3 +1,24 @@
+2016-05-12  Jiewen Tan  <[email protected]>
+
+        REGRESSION (r199313): ICBC app: text field In the webview is not tappable
+        https://bugs.webkit.org/show_bug.cgi?id=157396
+        <rdar://problem/25931513>
+
+        Reviewed by David Kilzer.
+
+        Add a quirk for WebKit1 apps.
+
+        * loader/SubframeLoader.cpp:
+        (WebCore::SubframeLoader::requestFrame):
+        Even though the HTML spec suggests that we should navigate to about:blank
+        for subframes/iframes, of which the src cannot be resolved to an valid URL,
+        many existing WebKit1 apps are relying on invalid URLs to bridge their WebView
+        codes and their native Objective-C codes. Therefore, a quirk is added to
+        escape the URL validation for existing WebKit1 apps.
+        (WebCore::SubframeLoader::shouldConvertInvalidURLsToBlank):
+        * loader/SubframeLoader.h:
+        * page/Settings.in:
+
 2016-05-12  Ada Chan  <[email protected]>
 
         Prevent clicks in the placeholder from playing or pausing the video in a MediaDocument.

Modified: trunk/Source/WebCore/loader/SubframeLoader.cpp (200798 => 200799)


--- trunk/Source/WebCore/loader/SubframeLoader.cpp	2016-05-12 23:11:05 UTC (rev 200798)
+++ trunk/Source/WebCore/loader/SubframeLoader.cpp	2016-05-12 23:22:47 UTC (rev 200799)
@@ -84,7 +84,7 @@
     } else
         url = ""
 
-    if (!url.isValid())
+    if (shouldConvertInvalidURLsToBlank() && !url.isValid())
         url = ""
 
     Frame* frame = loadOrRedirectSubframe(ownerElement, url, frameName, lockHistory, lockBackForwardList);
@@ -450,4 +450,11 @@
     return m_frame.document()->completeURL(url);
 }
 
+bool SubframeLoader::shouldConvertInvalidURLsToBlank() const
+{
+    if (Settings* settings = document() ? document()->settings() : nullptr)
+        return settings->shouldConvertInvalidURLsToBlank();
+    return true;
+}
+
 } // namespace WebCore

Modified: trunk/Source/WebCore/loader/SubframeLoader.h (200798 => 200799)


--- trunk/Source/WebCore/loader/SubframeLoader.h	2016-05-12 23:11:05 UTC (rev 200798)
+++ trunk/Source/WebCore/loader/SubframeLoader.h	2016-05-12 23:22:47 UTC (rev 200799)
@@ -84,6 +84,8 @@
 
     Document* document() const;
 
+    bool shouldConvertInvalidURLsToBlank() const;
+
     bool m_containsPlugins;
     Frame& m_frame;
 

Modified: trunk/Source/WebCore/page/Settings.in (200798 => 200799)


--- trunk/Source/WebCore/page/Settings.in	2016-05-12 23:11:05 UTC (rev 200798)
+++ trunk/Source/WebCore/page/Settings.in	2016-05-12 23:22:47 UTC (rev 200799)
@@ -265,3 +265,4 @@
 
 selectionPaintingWithoutSelectionGapsEnabled initial=false
 
+shouldConvertInvalidURLsToBlank initial=true

Modified: trunk/Source/WebKit/mac/ChangeLog (200798 => 200799)


--- trunk/Source/WebKit/mac/ChangeLog	2016-05-12 23:11:05 UTC (rev 200798)
+++ trunk/Source/WebKit/mac/ChangeLog	2016-05-12 23:22:47 UTC (rev 200799)
@@ -1,3 +1,17 @@
+2016-05-12  Jiewen Tan  <[email protected]>
+
+        REGRESSION (r199313): ICBC app: text field In the webview is not tappable
+        https://bugs.webkit.org/show_bug.cgi?id=157396
+        <rdar://problem/25931513>
+
+        Reviewed by David Kilzer.
+
+        Add a quirk for WebKit1 apps.
+
+        * WebView/WebView.mm:
+        (shouldConvertInvalidURLsToBlank):
+        (-[WebView _preferencesChanged:]):
+
 2016-05-12  Beth Dakin  <[email protected]>
 
         WebKitAdditions needs to be notified before the WebView is dealloc'd

Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (200798 => 200799)


--- trunk/Source/WebKit/mac/WebView/WebView.mm	2016-05-12 23:11:05 UTC (rev 200798)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm	2016-05-12 23:22:47 UTC (rev 200799)
@@ -875,6 +875,19 @@
 #endif
 }
 
+static bool shouldConvertInvalidURLsToBlank()
+{
+#if PLATFORM(IOS)
+    static bool shouldConvertInvalidURLsToBlank = dyld_get_program_sdk_version() >= 0x000A0000;
+#elif PLATFORM(MAC)
+    static bool shouldConvertInvalidURLsToBlank = dyld_get_program_sdk_version() >= 0x000A0C00;
+#else
+    static bool shouldConvertInvalidURLsToBlank = true;
+#endif
+
+    return shouldConvertInvalidURLsToBlank;
+}
+
 #if ENABLE(GAMEPAD)
 static void WebKitInitializeGamepadProviderIfNecessary()
 {
@@ -2525,6 +2538,8 @@
 #endif
 
     settings.setAllowContentSecurityPolicySourceStarToMatchAnyProtocol(shouldAllowContentSecurityPolicySourceStarToMatchAnyProtocol());
+
+    settings.setShouldConvertInvalidURLsToBlank(shouldConvertInvalidURLsToBlank());
 }
 
 static inline IMP getMethod(id o, SEL s)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to