Commit 1b5e9630 authored by philipj@opera.com's avatar philipj@opera.com

Simplify an error condition in requestFullScreenForElement()

Use the existing getter for the top element and do the ancestor test
in a more direct manner.

BUG=383813
R=falken@chromium.org

Review URL: https://codereview.chromium.org/392913002

git-svn-id: svn://svn.chromium.org/blink/trunk@178360 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent b32f6db6
...@@ -173,9 +173,8 @@ void FullscreenElementStack::requestFullScreenForElement(Element& element, Reque ...@@ -173,9 +173,8 @@ void FullscreenElementStack::requestFullScreenForElement(Element& element, Reque
// The context object's node document fullscreen element stack is not empty and its top element // 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 // is not an ancestor of the context object. (NOTE: Ignore this requirement if the request was
// made via the legacy Mozilla-style API.) // made via the legacy Mozilla-style API.)
if (!m_fullScreenElementStack.isEmpty()) { if (Element* lastElementOnStack = fullscreenElement()) {
Element* lastElementOnStack = m_fullScreenElementStack.last().get(); if (!element.isDescendantOf(lastElementOnStack)) {
if (lastElementOnStack == &element || !lastElementOnStack->contains(&element)) {
if (inLegacyMozillaMode) if (inLegacyMozillaMode)
UseCounter::count(element.document(), UseCounter::LegacyFullScreenErrorExemption); UseCounter::count(element.document(), UseCounter::LegacyFullScreenErrorExemption);
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment