Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(580)

Unified Diff: Source/core/dom/FullscreenElementStack.cpp

Issue 363493002: Add UseCounter for the Mozilla-style fullscreen error handling exemptions (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/core/frame/UseCounter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/FullscreenElementStack.cpp
diff --git a/Source/core/dom/FullscreenElementStack.cpp b/Source/core/dom/FullscreenElementStack.cpp
index 6349a0b490e5e4f0e8ea9d25e6f58b963edc911e..cdee89472c55a09a96684eb1ceef9efa67de884c 100644
--- a/Source/core/dom/FullscreenElementStack.cpp
+++ b/Source/core/dom/FullscreenElementStack.cpp
@@ -174,10 +174,14 @@ void FullscreenElementStack::requestFullScreenForElement(Element& element, Reque
// The context object's node document fullscreen element stack is not empty and its top element
// is not an ancestor of the context object. (NOTE: Ignore this requirement if the request was
// made via the legacy Mozilla-style API.)
- if (!m_fullScreenElementStack.isEmpty() && !inLegacyMozillaMode) {
+ if (!m_fullScreenElementStack.isEmpty()) {
Element* lastElementOnStack = m_fullScreenElementStack.last().get();
- if (lastElementOnStack == &element || !lastElementOnStack->contains(&element))
- break;
+ if (lastElementOnStack == &element || !lastElementOnStack->contains(&element)) {
+ if (inLegacyMozillaMode)
+ UseCounter::count(element.document(), UseCounter::LegacyFullScreenErrorExemption);
+ else
+ break;
+ }
}
// A descendant browsing context's document has a non-empty fullscreen element stack.
@@ -191,8 +195,12 @@ void FullscreenElementStack::requestFullScreenForElement(Element& element, Reque
break;
}
}
- if (descendentHasNonEmptyStack && !inLegacyMozillaMode)
- break;
+ if (descendentHasNonEmptyStack) {
+ if (inLegacyMozillaMode)
+ UseCounter::count(element.document(), UseCounter::LegacyFullScreenErrorExemption);
+ else
+ break;
+ }
// This algorithm is not allowed to show a pop-up:
// An algorithm is allowed to show a pop-up if, in the task in which the algorithm is running, either:
« no previous file with comments | « no previous file | Source/core/frame/UseCounter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698