Changeset 81038 in webkit
- Timestamp:
- Mar 14, 2011 10:52:31 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r81035 r81038 1 2011-03-12 Jer Noble <jer.noble@apple.com> 2 3 Reviewed by Eric Carlson. 4 5 FullScreen: Handle entering full screen security restrictions 6 https://bugs.webkit.org/show_bug.cgi?id=56264 7 8 * fullscreen/full-screen-css.html: Use runWithKeyDown. 9 * fullscreen/full-screen-remove-ancestor.html: Ditto. 10 * fullscreen/full-screen-remove.html: Ditto. 11 * fullscreen/full-screen-request.html: Ditto. 12 * fullscreen/full-screen-twice.html: Ditto. 13 * fullscreen/full-screen-test.js: 14 * fullscreen/full-screen-iframe-allowed-expected.txt: Added. 15 * fullscreen/full-screen-iframe-allowed.html: Added. 16 * fullscreen/full-screen-iframe-not-allowed-expected.txt: Added. 17 * fullscreen/full-screen-iframe-not-allowed.html: Added. 18 (runWithKeyDown): Added. Wraps the command in a keyDown/keyPress 19 listener. 20 * platform/mac-wk2/Skipped: Added new tests to skipped list. 21 * platform/qt-wk2/Skipped: Ditto. 22 1 23 2011-02-28 Luiz Agostini <luiz.agostini@openbossa.org> 2 24 -
trunk/LayoutTests/fullscreen/full-screen-css.html
r75277 r81038 34 34 35 35 callback = documentEnteredFullScreen; 36 document.documentElement.webkitRequestFullScreen();36 runWithKeyDown(function(){document.documentElement.webkitRequestFullScreen()}); 37 37 }; 38 38 … … 46 46 47 47 callback = spanEnteredFullScreen; 48 span.webkitRequestFullScreen();48 runWithKeyDown(function(){span.webkitRequestFullScreen()}); 49 49 } 50 50 </script> -
trunk/LayoutTests/fullscreen/full-screen-remove-ancestor.html
r66251 r81038 32 32 33 33 callback = spanEnteredFullScreen; 34 span.webkitRequestFullScreen();34 runWithKeyDown(function(){span.webkitRequestFullScreen()}); 35 35 } 36 36 </script> -
trunk/LayoutTests/fullscreen/full-screen-remove.html
r66251 r81038 31 31 32 32 callback = spanEnteredFullScreen; 33 span.webkitRequestFullScreen();33 runWithKeyDown(function(){span.webkitRequestFullScreen()}); 34 34 } 35 35 </script> -
trunk/LayoutTests/fullscreen/full-screen-request.html
r75277 r81038 8 8 } else { 9 9 waitForEventTestAndEnd(document, 'webkitfullscreenchange', "document.webkitIsFullScreen==true"); 10 document.documentElement.webkitRequestFullScreen();10 runWithKeyDown(function(){document.documentElement.webkitRequestFullScreen()}); 11 11 } 12 12 </script> -
trunk/LayoutTests/fullscreen/full-screen-test.js
r66267 r81038 7 7 layoutTestController.dumpAsText(); 8 8 layoutTestController.waitUntilDone(); 9 } 10 11 function runWithKeyDown(fn) 12 { 13 document.addEventListener('keypress', function() { fn(); }, false); 14 if (window.layoutTestController) { 15 eventSender.keyDown(" ", []); 16 } 9 17 } 10 18 -
trunk/LayoutTests/fullscreen/full-screen-twice.html
r66251 r81038 21 21 testExpected("document.webkitCurrentFullScreenElement", span); 22 22 callback = documentEnteredFullScreen; 23 document.documentElement.webkitRequestFullScreen();23 runWithKeyDown(function(){document.documentElement.webkitRequestFullScreen()}); 24 24 }; 25 25 … … 31 31 32 32 callback = spanEnteredFullScreen; 33 span.webkitRequestFullScreen();33 runWithKeyDown(function(){span.webkitRequestFullScreen()}); 34 34 } 35 35 </script> -
trunk/LayoutTests/platform/mac-wk2/Skipped
r80503 r81038 1914 1914 # WebKit2 needs fullscreen support 1915 1915 fullscreen/full-screen-css.html 1916 fullscreen/full-screen-iframe-allowed.html 1917 fullscreen/full-screen-iframe-not-allowed.html 1916 1918 fullscreen/full-screen-remove-ancestor.html 1917 1919 fullscreen/full-screen-remove.html -
trunk/LayoutTests/platform/qt-wk2/Skipped
r81018 r81038 2058 2058 # WebKit2 needs fullscreen support 2059 2059 fullscreen/full-screen-css.html 2060 fullscreen/full-screen-iframe-allowed.html 2061 fullscreen/full-screen-iframe-not-allowed.html 2060 2062 fullscreen/full-screen-remove-ancestor.html 2061 2063 fullscreen/full-screen-remove.html -
trunk/Source/WebCore/ChangeLog
r81037 r81038 1 2011-03-13 Jer Noble <jer.noble@apple.com> 2 3 FullScreen: Handle entering full screen security restrictions 4 https://bugs.webkit.org/show_bug.cgi?id=56264 5 6 Tests: fullscreen/full-screen-iframe-allowed.html 7 fullscreen/full-screen-iframe-not-allowed.html 8 9 Disable full screen documents in the following conditions: 10 1) requesting element is in an iframe which does not have a 11 webkitallowfullscreen attribute. 12 2) page is not processing a user gesture. 13 14 * dom/Document.cpp: 15 (WebCore::Document::fullScreenIsAllowedForElement): Added. Checks 16 to see if elements contained in IFRAMES are allowed to 17 enter full screen. 18 (WebCore::Document::webkitRequestFullScreenForElement): Checks 19 if page is currently processing a user gesture. 20 * dom/Document.h: 21 * html/HTMLAttributeNames.in: Added webkitallowfullscreenAttr. 22 * html/HTMLFrameElementBase.cpp: 23 (WebCore::HTMLFrameElementBase::allowFullScreen): Added. 24 * html/HTMLFrameElementBase.h: 25 1 26 2011-03-14 Anton D'Auria <adauria@apple.com> 2 27 -
trunk/Source/WebCore/dom/Document.cpp
r80930 r81038 4850 4850 4851 4851 #if ENABLE(FULLSCREEN_API) 4852 bool Document::fullScreenIsAllowedForElement(Element* element) const 4853 { 4854 ASSERT(element); 4855 while (HTMLFrameOwnerElement* ownerElement = element->document()->ownerElement()) { 4856 if (!ownerElement->hasTagName(frameTag) && !ownerElement->hasTagName(iframeTag)) 4857 continue; 4858 4859 if (!static_cast<HTMLFrameElementBase*>(ownerElement)->allowFullScreen()) 4860 return false; 4861 element = ownerElement; 4862 } 4863 return true; 4864 } 4865 4852 4866 void Document::webkitRequestFullScreenForElement(Element* element, unsigned short flags) 4853 4867 { … … 4857 4871 if (!element) 4858 4872 element = documentElement(); 4873 4874 if (!fullScreenIsAllowedForElement(element)) 4875 return; 4876 4877 if (!ScriptController::processingUserGesture()) 4878 return; 4859 4879 4860 4880 if (!page()->chrome()->client()->supportsFullScreenForElement(element)) -
trunk/Source/WebCore/dom/Document.h
r80797 r81038 1094 1094 1095 1095 void fullScreenChangeDelayTimerFired(Timer<Document>*); 1096 bool fullScreenIsAllowedForElement(Element*) const; 1096 1097 #endif 1097 1098 -
trunk/Source/WebCore/html/HTMLAttributeNames.in
r80297 r81038 299 299 vlink 300 300 vspace 301 webkitallowfullscreen 301 302 webkitdirectory 302 303 width -
trunk/Source/WebCore/html/HTMLFrameElementBase.cpp
r76872 r81038 284 284 } 285 285 286 #if ENABLE(FULLSCREEN_API) 287 bool HTMLFrameElementBase::allowFullScreen() const 288 { 289 return hasAttribute(webkitallowfullscreenAttr); 290 } 291 #endif 292 286 293 } // namespace WebCore -
trunk/Source/WebCore/html/HTMLFrameElementBase.h
r78232 r81038 44 44 45 45 void setRemainsAliveOnRemovalFromTree(bool); 46 #if ENABLE(FULLSCREEN_API) 47 virtual bool allowFullScreen() const; 48 #endif 46 49 47 50 protected:
Note: See TracChangeset
for help on using the changeset viewer.