Title: [87568] branches/safari-534-branch

Diff

Modified: branches/safari-534-branch/LayoutTests/ChangeLog (87567 => 87568)


--- branches/safari-534-branch/LayoutTests/ChangeLog	2011-05-27 21:16:49 UTC (rev 87567)
+++ branches/safari-534-branch/LayoutTests/ChangeLog	2011-05-27 21:18:57 UTC (rev 87568)
@@ -1,5 +1,20 @@
 2011-05-27  Mark Rowe  <mr...@apple.com>
 
+        Merge r87322.
+
+    2011-05-25  Jer Noble  <jer.no...@apple.com>
+
+        Reviewed by Darin Adler.
+
+        REGRESSION: Fullscreen button on embedded Vimeo videos does nothing
+        https://bugs.webkit.org/show_bug.cgi?id=61461
+
+        * fullscreen/full-screen-iframe-legacy-expected.txt: Added.
+        * fullscreen/full-screen-iframe-legacy.html: Added.
+        * fullscreen/resources/legacy.html: Added.
+
+2011-05-27  Mark Rowe  <mr...@apple.com>
+
         Merge r87387.
 
     2011-05-25  Simon Fraser  <simon.fra...@apple.com>

Added: branches/safari-534-branch/LayoutTests/fullscreen/full-screen-iframe-legacy-expected.txt (0 => 87568)


--- branches/safari-534-branch/LayoutTests/fullscreen/full-screen-iframe-legacy-expected.txt	                        (rev 0)
+++ branches/safari-534-branch/LayoutTests/fullscreen/full-screen-iframe-legacy-expected.txt	2011-05-27 21:18:57 UTC (rev 87568)
@@ -0,0 +1,8 @@
+Test for bug 61461: Handle entering full screen security restrictions
+
+To test manually, click the video "full screen" button - the page should enter full screen mode.
+
+EVENT(webkitfullscreenchange)
+TEST(document.getElementById('frame').contentDocument.width==document.width) OK
+END OF TEST
+

Added: branches/safari-534-branch/LayoutTests/fullscreen/full-screen-iframe-legacy.html (0 => 87568)


--- branches/safari-534-branch/LayoutTests/fullscreen/full-screen-iframe-legacy.html	                        (rev 0)
+++ branches/safari-534-branch/LayoutTests/fullscreen/full-screen-iframe-legacy.html	2011-05-27 21:18:57 UTC (rev 87568)
@@ -0,0 +1,27 @@
+<p>Test for <a href="" 61461</a>: 
+Handle entering full screen security restrictions</p>
+<p>To test manually, click the video "full screen" button - the page should enter full screen mode.</p>
+<script src=""
+<script>
+function runTest() {
+    var frame = document.getElementById('frame');
+
+    waitForEvent(frame.contentDocument, 'webkitfullscreenchange', function() { 
+            test("document.getElementById('frame').contentDocument.width==document.width")
+            endTest();
+    });
+
+    runWithKeyDown(function() {
+
+        setTimeout(function() { 
+            consoleWrite("FAIL - did not enter full screen!"); 
+            endTest(); 
+        }, 50);
+
+        var video = frame.contentDocument.getElementsByTagName('video')[0];
+        video.webkitEnterFullScreen();
+    });
+}
+</script>
+<iframe id="frame" src="" _onload_="runTest()" width="336" height="256">
+</iframe>

Added: branches/safari-534-branch/LayoutTests/fullscreen/resources/legacy.html (0 => 87568)


--- branches/safari-534-branch/LayoutTests/fullscreen/resources/legacy.html	                        (rev 0)
+++ branches/safari-534-branch/LayoutTests/fullscreen/resources/legacy.html	2011-05-27 21:18:57 UTC (rev 87568)
@@ -0,0 +1,7 @@
+<video controls width="320" height="240"></video>
+<script src=""
+<script>
+    video = mediaElement = document.getElementsByTagName('video')[0];
+    var mediaFile = findMediaFile("video", "../../media/content/test");
+    video.src = ""
+</script>

Modified: branches/safari-534-branch/Source/WebCore/ChangeLog (87567 => 87568)


--- branches/safari-534-branch/Source/WebCore/ChangeLog	2011-05-27 21:16:49 UTC (rev 87567)
+++ branches/safari-534-branch/Source/WebCore/ChangeLog	2011-05-27 21:18:57 UTC (rev 87568)
@@ -1,5 +1,34 @@
 2011-05-27  Mark Rowe  <mr...@apple.com>
 
+        Merge r87322.
+
+    2011-05-25  Jer Noble  <jer.no...@apple.com>
+
+        Reviewed by Darin Adler.
+
+        REGRESSION: Fullscreen button on embedded Vimeo videos does nothing
+        https://bugs.webkit.org/show_bug.cgi?id=61461
+
+        Tests: fullscreen/full-screen-iframe-legacy.html
+
+        Allow calls from the legacy full-screen API to bypass the iframe
+        "webkitallowfullscreen" requirement by adding a parameter to 
+        Document::webkitRequestFullScreenForElement specifying the strictness
+        of that check.  Specify this new parameter everywhere that function is 
+        called, including in the default controls' full-screen button handler.
+
+        * dom/Document.cpp:
+        (WebCore::Document::webkitRequestFullScreenForElement):
+        * dom/Document.h:
+        * dom/Element.cpp:
+        (WebCore::Element::requestFullScreen): Renamed from webkitRequestFullScreen.
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::enterFullscreen):
+        * html/shadow/MediaControlElements.cpp:
+        (WebCore::MediaControlFullscreenButtonElement::defaultEventHandler):
+
+2011-05-27  Mark Rowe  <mr...@apple.com>
+
         Merge r87363.
 
     2011-05-25  Jer Noble  <jer.no...@apple.com>

Modified: branches/safari-534-branch/Source/WebCore/dom/Document.cpp (87567 => 87568)


--- branches/safari-534-branch/Source/WebCore/dom/Document.cpp	2011-05-27 21:16:49 UTC (rev 87567)
+++ branches/safari-534-branch/Source/WebCore/dom/Document.cpp	2011-05-27 21:18:57 UTC (rev 87568)
@@ -4824,7 +4824,7 @@
     return true;
 }
 
-void Document::webkitRequestFullScreenForElement(Element* element, unsigned short flags)
+void Document::requestFullScreenForElement(Element* element, unsigned short flags, FullScreenCheckType checkType)
 {
     if (!page() || !page()->settings()->fullScreenEnabled())
         return;
@@ -4832,7 +4832,7 @@
     if (!element)
         element = documentElement();
     
-    if (!fullScreenIsAllowedForElement(element))
+    if (checkType == EnforceIFrameAllowFulScreenRequirement && !fullScreenIsAllowedForElement(element))
         return;
     
     if (!ScriptController::processingUserGesture())

Modified: branches/safari-534-branch/Source/WebCore/dom/Document.h (87567 => 87568)


--- branches/safari-534-branch/Source/WebCore/dom/Document.h	2011-05-27 21:16:49 UTC (rev 87567)
+++ branches/safari-534-branch/Source/WebCore/dom/Document.h	2011-05-27 21:18:57 UTC (rev 87568)
@@ -1055,7 +1055,13 @@
     bool webkitIsFullScreen() const { return m_fullScreenElement.get(); }
     bool webkitFullScreenKeyboardInputAllowed() const { return m_fullScreenElement.get() && m_areKeysEnabledInFullScreen; }
     Element* webkitCurrentFullScreenElement() const { return m_fullScreenElement.get(); }
-    void webkitRequestFullScreenForElement(Element*, unsigned short flags);
+    
+    enum FullScreenCheckType {
+        EnforceIFrameAllowFulScreenRequirement,
+        ExemptIFrameAllowFulScreenRequirement,
+    };
+
+    void requestFullScreenForElement(Element*, unsigned short flags, FullScreenCheckType);
     void webkitCancelFullScreen();
     
     void webkitWillEnterFullScreenForElement(Element*);

Modified: branches/safari-534-branch/Source/WebCore/dom/Element.cpp (87567 => 87568)


--- branches/safari-534-branch/Source/WebCore/dom/Element.cpp	2011-05-27 21:16:49 UTC (rev 87567)
+++ branches/safari-534-branch/Source/WebCore/dom/Element.cpp	2011-05-27 21:18:57 UTC (rev 87568)
@@ -1884,7 +1884,7 @@
 #if ENABLE(FULLSCREEN_API)
 void Element::webkitRequestFullScreen(unsigned short flags)
 {
-    document()->webkitRequestFullScreenForElement(this, flags);
+    document()->requestFullScreenForElement(this, flags, Document::EnforceIFrameAllowFulScreenRequirement);
 }
 #endif    
 

Modified: branches/safari-534-branch/Source/WebCore/html/HTMLMediaElement.cpp (87567 => 87568)


--- branches/safari-534-branch/Source/WebCore/html/HTMLMediaElement.cpp	2011-05-27 21:16:49 UTC (rev 87567)
+++ branches/safari-534-branch/Source/WebCore/html/HTMLMediaElement.cpp	2011-05-27 21:18:57 UTC (rev 87568)
@@ -2530,7 +2530,7 @@
     LOG(Media, "HTMLMediaElement::enterFullscreen");
 #if ENABLE(FULLSCREEN_API)
     if (document() && document()->settings() && document()->settings()->fullScreenEnabled()) {
-        webkitRequestFullScreen(0);
+        document()->requestFullScreenForElement(this, 0, Document::ExemptIFrameAllowFulScreenRequirement);
         return;
     }
 #endif

Modified: branches/safari-534-branch/Source/WebCore/html/shadow/MediaControlElements.cpp (87567 => 87568)


--- branches/safari-534-branch/Source/WebCore/html/shadow/MediaControlElements.cpp	2011-05-27 21:16:49 UTC (rev 87567)
+++ branches/safari-534-branch/Source/WebCore/html/shadow/MediaControlElements.cpp	2011-05-27 21:18:57 UTC (rev 87568)
@@ -797,7 +797,7 @@
                 document()->webkitCancelFullScreen();
                 m_controls->exitedFullscreen();
             } else {
-                mediaElement()->webkitRequestFullScreen(0);
+                document()->requestFullScreenForElement(mediaElement(), 0, Document::ExemptIFrameAllowFulScreenRequirement);
                 m_controls->enteredFullscreen();
             }
         } else
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to