Title: [135866] trunk
Revision
135866
Author
[email protected]
Date
2012-11-27 09:39:22 -0800 (Tue, 27 Nov 2012)

Log Message

Don't throw an exception if user gesture is required for load
https://bugs.webkit.org/show_bug.cgi?id=103318

Patch by Min Qin <[email protected]> on 2012-11-27
Reviewed by Eric Carlson.

Source/WebCore:

There is no need to throw an exception if media load requires user gesture.
Since chrome does not render the poster and media control after an exception is thrown, throwing an exception may break a lot of sites on android.
Change a current test to match the new behavior: media/video-load-require-user-gesture.html

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::load):

LayoutTests:

Check that exception is not thrown and metadata is not loaded if media load requires user gesture.

* media/video-load-require-user-gesture-expected.txt:
* media/video-load-require-user-gesture.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (135865 => 135866)


--- trunk/LayoutTests/ChangeLog	2012-11-27 17:11:53 UTC (rev 135865)
+++ trunk/LayoutTests/ChangeLog	2012-11-27 17:39:22 UTC (rev 135866)
@@ -1,3 +1,15 @@
+2012-11-27  Min Qin  <[email protected]>
+
+        Don't throw an exception if user gesture is required for load
+        https://bugs.webkit.org/show_bug.cgi?id=103318
+
+        Reviewed by Eric Carlson.
+
+        Check that exception is not thrown and metadata is not loaded if media load requires user gesture.
+
+        * media/video-load-require-user-gesture-expected.txt:
+        * media/video-load-require-user-gesture.html:
+
 2012-11-27  Csaba Osztrogonác  <[email protected]>
 
         [Qt] Unreviewed gardening, skip a new failing test to paint the bots green.

Modified: trunk/LayoutTests/media/video-load-require-user-gesture-expected.txt (135865 => 135866)


--- trunk/LayoutTests/media/video-load-require-user-gesture-expected.txt	2012-11-27 17:11:53 UTC (rev 135865)
+++ trunk/LayoutTests/media/video-load-require-user-gesture-expected.txt	2012-11-27 17:39:22 UTC (rev 135866)
@@ -2,8 +2,7 @@
 
 * Setting video.src, no data should load.
 
-* Calling video.load(). It should throw an exception, and no data should load.
-TEST(video.load()) THROWS(DOMException.INVALID_STATE_ERR) OK
+* Calling video.load() should not load any data.
 
 END OF TEST
 

Modified: trunk/LayoutTests/media/video-load-require-user-gesture.html (135865 => 135866)


--- trunk/LayoutTests/media/video-load-require-user-gesture.html	2012-11-27 17:11:53 UTC (rev 135865)
+++ trunk/LayoutTests/media/video-load-require-user-gesture.html	2012-11-27 17:39:22 UTC (rev 135866)
@@ -31,8 +31,8 @@
                 }
                 
                 state = "load";
-                consoleWrite("* Calling video.load(). It should throw an exception, and no data should load.");
-                testException("video.load()", "DOMException.INVALID_STATE_ERR");
+                consoleWrite("* Calling video.load() should not load any data.");
+                video.load();
                 setTimeout(checkLoad, 250);
             }
 

Modified: trunk/Source/WebCore/ChangeLog (135865 => 135866)


--- trunk/Source/WebCore/ChangeLog	2012-11-27 17:11:53 UTC (rev 135865)
+++ trunk/Source/WebCore/ChangeLog	2012-11-27 17:39:22 UTC (rev 135866)
@@ -1,3 +1,17 @@
+2012-11-27  Min Qin  <[email protected]>
+
+        Don't throw an exception if user gesture is required for load
+        https://bugs.webkit.org/show_bug.cgi?id=103318
+
+        Reviewed by Eric Carlson.
+
+        There is no need to throw an exception if media load requires user gesture.
+        Since chrome does not render the poster and media control after an exception is thrown, throwing an exception may break a lot of sites on android.
+        Change a current test to match the new behavior: media/video-load-require-user-gesture.html
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::load):
+
 2012-11-27  Víctor Manuel Jáquez Leal  <[email protected]>
 
         [GStreamer] Verify if GStreamer was previously initialized

Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (135865 => 135866)


--- trunk/Source/WebCore/html/HTMLMediaElement.cpp	2012-11-27 17:11:53 UTC (rev 135865)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp	2012-11-27 17:39:22 UTC (rev 135866)
@@ -682,10 +682,8 @@
     
     LOG(Media, "HTMLMediaElement::load()");
     
-    if (userGestureRequiredForLoad() && !ScriptController::processingUserGesture()) {
-        ec = INVALID_STATE_ERR;
+    if (userGestureRequiredForLoad() && !ScriptController::processingUserGesture())
         return;
-    }
     
     m_loadInitiatedByUserGesture = ScriptController::processingUserGesture();
     if (m_loadInitiatedByUserGesture)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to