Title: [104757] trunk
Revision
104757
Author
[email protected]
Date
2012-01-11 15:56:24 -0800 (Wed, 11 Jan 2012)

Log Message

Source/WebCore: https://bugs.webkit.org/show_bug.cgi?id=75860
[Chromium Mac] no background is drawn for input elements

Patch by Avi Drissman <[email protected]> on 2012-01-09
Reviewed by Eric Seidel.

Reverts r104240 for Chromium. Unfortunately the code that uses Cocoa
API misbehaves when built with the 10.5 SDK, so we use SPI. For now.

* rendering/RenderThemeChromiumMac.h:
* rendering/RenderThemeChromiumMac.mm:
(WebCore::RenderThemeChromiumMac::paintTextField):

LayoutTests: iframe sandbox doesn't block videos from autoplaying (IETC automatic-feature-block-autoplay-video)
https://bugs.webkit.org/show_bug.cgi?id=76111

Reviewed by Eric Seidel.

Test based on video-no-autoplay.html.

* media/no-auto-play-in-sandbox-expected.txt: Added.
* media/no-auto-play-in-sandbox.html: Added.
* media/resources/no-auto-play-in-sandbox-iframe.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (104756 => 104757)


--- trunk/LayoutTests/ChangeLog	2012-01-11 23:54:28 UTC (rev 104756)
+++ trunk/LayoutTests/ChangeLog	2012-01-11 23:56:24 UTC (rev 104757)
@@ -1,3 +1,16 @@
+2012-01-11  Adam Barth  <[email protected]>
+
+        iframe sandbox doesn't block videos from autoplaying (IETC automatic-feature-block-autoplay-video)
+        https://bugs.webkit.org/show_bug.cgi?id=76111
+
+        Reviewed by Eric Seidel.
+
+        Test based on video-no-autoplay.html.
+
+        * media/no-auto-play-in-sandbox-expected.txt: Added.
+        * media/no-auto-play-in-sandbox.html: Added.
+        * media/resources/no-auto-play-in-sandbox-iframe.html: Added.
+
 2012-01-11  Joshua Bell  <[email protected]>
 
         IndexedDB: Version change transaction should abort if constraints fail during createIndex

Added: trunk/LayoutTests/media/no-auto-play-in-sandbox-expected.txt (0 => 104757)


--- trunk/LayoutTests/media/no-auto-play-in-sandbox-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/media/no-auto-play-in-sandbox-expected.txt	2012-01-11 23:56:24 UTC (rev 104757)
@@ -0,0 +1,12 @@
+
+
+--------
+Frame: '<!--framePath //<!--frame0-->-->'
+--------
+Test that play event does not fire when "src" set with an autoplay attribute in a sandbox.
+
+EXPECTED (video.paused == 'true') OK
+EVENT(canplaythrough)
+EXPECTED (video.paused == 'true') OK
+END OF TEST
+

Added: trunk/LayoutTests/media/no-auto-play-in-sandbox.html (0 => 104757)


--- trunk/LayoutTests/media/no-auto-play-in-sandbox.html	                        (rev 0)
+++ trunk/LayoutTests/media/no-auto-play-in-sandbox.html	2012-01-11 23:56:24 UTC (rev 104757)
@@ -0,0 +1,10 @@
+<script>
+if (window.layoutTestController) {
+    layoutTestController.dumpAsText();
+    layoutTestController.dumpChildFramesAsText();
+}
+</script>
+<iframe
+    style="width: 400px; height: 600px"
+    sandbox="allow-scripts allow-same-origin"
+    src=""

Added: trunk/LayoutTests/media/resources/no-auto-play-in-sandbox-iframe.html (0 => 104757)


--- trunk/LayoutTests/media/resources/no-auto-play-in-sandbox-iframe.html	                        (rev 0)
+++ trunk/LayoutTests/media/resources/no-auto-play-in-sandbox-iframe.html	2012-01-11 23:56:24 UTC (rev 104757)
@@ -0,0 +1,22 @@
+<base href=""
+<video autoplay controls></video>
+<p>Test that play event does not fire when "src" set with an autoplay attribute in a sandbox.</p>
+<script src=""
+<script src=""
+<script>
+    testExpected("video.paused", true);
+
+    waitForEvent('play', function () { 
+        logResult(false, "PLAY fired");
+        endTest();
+    } );
+
+    function testPaused () 
+    { 
+        testExpected("video.paused", true);
+        endTest();
+    }
+    waitForEvent('canplaythrough', function () { setTimeout(testPaused, 500);} );
+
+    video.src = "" "content/test");
+</script>

Modified: trunk/Source/WebCore/ChangeLog (104756 => 104757)


--- trunk/Source/WebCore/ChangeLog	2012-01-11 23:54:28 UTC (rev 104756)
+++ trunk/Source/WebCore/ChangeLog	2012-01-11 23:56:24 UTC (rev 104757)
@@ -1,3 +1,35 @@
+2012-01-09  Avi Drissman  <[email protected]>
+
+        https://bugs.webkit.org/show_bug.cgi?id=75860
+        [Chromium Mac] no background is drawn for input elements
+
+        Reviewed by Eric Seidel.
+
+        Reverts r104240 for Chromium. Unfortunately the code that uses Cocoa
+        API misbehaves when built with the 10.5 SDK, so we use SPI. For now.
+
+        * rendering/RenderThemeChromiumMac.h:
+        * rendering/RenderThemeChromiumMac.mm:
+        (WebCore::RenderThemeChromiumMac::paintTextField):
+
+<<<<<<< .mine
+2012-01-11  Adam Barth  <[email protected]>
+
+        iframe sandbox doesn't block videos from autoplaying (IETC automatic-feature-block-autoplay-video)
+        https://bugs.webkit.org/show_bug.cgi?id=76111
+
+        Reviewed by Eric Seidel.
+
+        Test: media/no-auto-play-in-sandbox.html
+
+        * dom/SecurityContext.h:
+            - Add a flag for sandboxing automatic features, per the HTML5 spec.
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::setReadyState):
+            - Implement requirement in the HTML5 spec to not autoplay media
+              when automatic features are sandboxed.
+
+=======
 2012-01-11  Nate Chapin  <[email protected]>
 
         SubresourceLoader cleanup post r100311.
@@ -40,6 +72,7 @@
         (WebCore::IDBLevelDBBackingStore::forEachObjectStoreRecord):
         * storage/IDBObjectStoreBackendImpl.cpp:
 
+>>>>>>> .r104756
 2012-01-11  Greg Billock  <[email protected]>
 
         Switch web intents to use supplemental IDL for DOMWindow

Modified: trunk/Source/WebCore/dom/SecurityContext.h (104756 => 104757)


--- trunk/Source/WebCore/dom/SecurityContext.h	2012-01-11 23:54:28 UTC (rev 104756)
+++ trunk/Source/WebCore/dom/SecurityContext.h	2012-01-11 23:56:24 UTC (rev 104757)
@@ -38,6 +38,7 @@
 class KURL;
 
 enum SandboxFlag {
+    // See http://www.whatwg.org/specs/web-apps/current-work/#attr-iframe-sandbox for a list of the sandbox flags.
     SandboxNone = 0,
     SandboxNavigation = 1,
     SandboxPlugins = 1 << 1,
@@ -45,7 +46,9 @@
     SandboxForms = 1 << 3,
     SandboxScripts = 1 << 4,
     SandboxTopNavigation = 1 << 5,
-    SandboxPopups = 1 << 6,
+    SandboxPopups = 1 << 6, // See https://www.w3.org/Bugs/Public/show_bug.cgi?id=12393
+    SandboxAutomaticFeatures = 1 << 7,
+    // FIXME: Add http://www.whatwg.org/specs/web-apps/current-work/#sandboxed-seamless-iframes-flag when we implement seamless.
     SandboxAll = -1 // Mask with all bits set to 1.
 };
 

Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (104756 => 104757)


--- trunk/Source/WebCore/html/HTMLMediaElement.cpp	2012-01-11 23:54:28 UTC (rev 104756)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp	2012-01-11 23:56:24 UTC (rev 104757)
@@ -1398,7 +1398,7 @@
         if (isPotentiallyPlaying && oldState <= HAVE_CURRENT_DATA)
             scheduleEvent(eventNames().playingEvent);
 
-        if (m_autoplaying && m_paused && autoplay()) {
+        if (m_autoplaying && m_paused && autoplay() && !document()->isSandboxed(SandboxAutomaticFeatures)) {
             m_paused = false;
             invalidateCachedTime();
             scheduleEvent(eventNames().playEvent);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to