Unify allowfullscreen logic in Document::webkitFullScreenEnabled and fullScreenIsAllo...
authorscheib@chromium.org <scheib@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Jul 2012 20:06:12 +0000 (20:06 +0000)
committerscheib@chromium.org <scheib@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Jul 2012 20:06:12 +0000 (20:06 +0000)
commitf6b79ebed9834a2e713fdd80f042c1d7241b881e
treee06eeb42c5e94b1fe922bab8ee711bcaeea7d44f
parenta94a422f6b49ecc6aaadd0b2f0d274a447f9cf92
Unify allowfullscreen logic in Document::webkitFullScreenEnabled and fullScreenIsAllowedForElement.
https://bugs.webkit.org/show_bug.cgi?id=91448

Reviewed by Adrienne Walker.

Unifies redundant traversal logic and static cast previously used
to determine if an element or document can be made fullscreen.
This clean up prepares for pointer lock, which will use the same logic.

Added a test to detect an edge case of an owning document with
fullscreen permision moving an iframe to fullscreen, while that iframe
does not have permision for its contents to be made fullscreen.

Source/WebCore:

Test: fullscreen/full-screen-iframe-without-allow-attribute-allowed-from-parent.html

* dom/Document.cpp:
(WebCore::isAttributeOnAllOwners):
(WebCore::Document::fullScreenIsAllowedForElement):
(WebCore::Document::webkitFullscreenEnabled):

LayoutTests:

* fullscreen/full-screen-iframe-without-allow-attribute-allowed-from-parent-expected.txt: Added.
* fullscreen/full-screen-iframe-without-allow-attribute-allowed-from-parent.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123005 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fullscreen/full-screen-iframe-without-allow-attribute-allowed-from-parent-expected.txt [new file with mode: 0644]
LayoutTests/fullscreen/full-screen-iframe-without-allow-attribute-allowed-from-parent.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp
Source/WebCore/html/HTMLFrameElementBase.cpp
Source/WebCore/html/HTMLFrameElementBase.h