Index: Source/core/dom/FullscreenElementStack.cpp |
diff --git a/Source/core/dom/FullscreenElementStack.cpp b/Source/core/dom/FullscreenElementStack.cpp |
index 2f72ac811d85fb537842fe0cb8faf66730c4b3fd..8fb5ebceaff45fd9e99583562649b08a5d3600e1 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 fullscreenIsAllowedForAllOwners(const Document& document) |
{ |
+ 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 fullscreenIsAllowedForAllOwners(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 fullscreenIsAllowedForAllOwners(document); |
} |
void FullscreenElementStack::webkitWillEnterFullScreenForElement(Element* element) |