Chromium Code Reviews| Index: Source/core/dom/FullscreenElementStack.cpp |
| diff --git a/Source/core/dom/FullscreenElementStack.cpp b/Source/core/dom/FullscreenElementStack.cpp |
| index 2f72ac811d85fb537842fe0cb8faf66730c4b3fd..ee3e84f8343c9f39f51e44c1ba339f17e8f2f915 100644 |
| --- a/Source/core/dom/FullscreenElementStack.cpp |
| +++ b/Source/core/dom/FullscreenElementStack.cpp |
| @@ -34,6 +34,7 @@ |
| #include "core/frame/FrameHost.h" |
| #include "core/frame/LocalFrame.h" |
| #include "core/frame/Settings.h" |
| +#include "core/frame/UseCounter.h" |
| #include "core/html/HTMLFrameOwnerElement.h" |
| #include "core/html/HTMLMediaElement.h" |
| #include "core/page/Chrome.h" |
| @@ -45,13 +46,18 @@ namespace WebCore { |
| using namespace HTMLNames; |
| -static bool isAttributeOnAllOwners(const WebCore::QualifiedName& attribute, const WebCore::QualifiedName& prefixedAttribute, const HTMLFrameOwnerElement* owner) |
| +static bool allowFullscreenOnAllOwners(const Document& document) |
|
falken
2014/03/26 13:59:32
nit: would isAllowFullscreenOnAllOwners or fullscr
philipj_slow
2014/03/26 16:18:58
I wanted something with "allowfullscreen" in the n
|
| { |
| + const HTMLFrameOwnerElement* owner = document.ownerElement(); |
| if (!owner) |
| return true; |
| do { |
| - if (!(owner->hasAttribute(attribute) || owner->hasAttribute(prefixedAttribute))) |
| - return false; |
| + if (!owner->hasAttribute(allowfullscreenAttr)) { |
| + if (owner->hasAttribute(webkitallowfullscreenAttr)) |
| + UseCounter::count(document, UseCounter::PrefixedAllowFullscreenAttribute); |
| + else |
| + return false; |
| + } |
| } while ((owner = owner->document().ownerElement())); |
| return true; |
| } |
| @@ -134,7 +140,7 @@ void FullscreenElementStack::documentWasDisposed() |
| bool FullscreenElementStack::fullScreenIsAllowedForElement(Element* element) const |
| { |
| ASSERT(element); |
| - return isAttributeOnAllOwners(allowfullscreenAttr, webkitallowfullscreenAttr, element->document().ownerElement()); |
| + return allowFullscreenOnAllOwners(element->document()); |
| } |
| void FullscreenElementStack::requestFullScreenForElement(Element* element, unsigned short flags, FullScreenCheckType checkType) |
| @@ -359,8 +365,7 @@ bool FullscreenElementStack::webkitFullscreenEnabled(Document& document) |
| // browsing context's documents have their fullscreen enabled flag set, or false otherwise. |
| // Top-level browsing contexts are implied to have their allowFullScreen attribute set. |
| - return isAttributeOnAllOwners(allowfullscreenAttr, webkitallowfullscreenAttr, document.ownerElement()); |
| - |
| + return allowFullscreenOnAllOwners(document); |
| } |
| void FullscreenElementStack::webkitWillEnterFullScreenForElement(Element* element) |