| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r
ights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r
ights reserved. |
| 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
| 8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
| 9 * Copyright (C) 2013 Google Inc. All rights reserved. | 9 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 10 * | 10 * |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 | 193 |
| 194 // This algorithm is not allowed to show a pop-up: | 194 // This algorithm is not allowed to show a pop-up: |
| 195 // An algorithm is allowed to show a pop-up if, in the task in which t
he algorithm is running, either: | 195 // An algorithm is allowed to show a pop-up if, in the task in which t
he algorithm is running, either: |
| 196 // - an activation behavior is currently being processed whose click e
vent was trusted, or | 196 // - an activation behavior is currently being processed whose click e
vent was trusted, or |
| 197 // - the event listener for a trusted click event is being handled. | 197 // - the event listener for a trusted click event is being handled. |
| 198 // FIXME: Does this need to null-check settings()? | 198 // FIXME: Does this need to null-check settings()? |
| 199 if (!UserGestureIndicator::processingUserGesture() && (!isHTMLMediaEleme
nt(*element) || document()->settings()->mediaFullscreenRequiresUserGesture())) | 199 if (!UserGestureIndicator::processingUserGesture() && (!isHTMLMediaEleme
nt(*element) || document()->settings()->mediaFullscreenRequiresUserGesture())) |
| 200 break; | 200 break; |
| 201 | 201 |
| 202 // There is a previously-established user preference, security risk, or
platform limitation. | 202 // There is a previously-established user preference, security risk, or
platform limitation. |
| 203 if (!document()->settings() || !document()->settings()->fullScreenEnable
d()) | |
| 204 break; | |
| 205 | 203 |
| 206 // 2. Let doc be element's node document. (i.e. "this") | 204 // 2. Let doc be element's node document. (i.e. "this") |
| 207 Document* currentDoc = document(); | 205 Document* currentDoc = document(); |
| 208 | 206 |
| 209 // 3. Let docs be all doc's ancestor browsing context's documents (if an
y) and doc. | 207 // 3. Let docs be all doc's ancestor browsing context's documents (if an
y) and doc. |
| 210 Deque<Document*> docs; | 208 Deque<Document*> docs; |
| 211 | 209 |
| 212 do { | 210 do { |
| 213 docs.prepend(currentDoc); | 211 docs.prepend(currentDoc); |
| 214 currentDoc = currentDoc->ownerElement() ? ¤tDoc->ownerElement(
)->document() : 0; | 212 currentDoc = currentDoc->ownerElement() ? ¤tDoc->ownerElement(
)->document() : 0; |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 // Top-level browsing contexts are implied to have their allowFullScreen att
ribute set. | 365 // Top-level browsing contexts are implied to have their allowFullScreen att
ribute set. |
| 368 return fullscreenIsAllowedForAllOwners(document); | 366 return fullscreenIsAllowedForAllOwners(document); |
| 369 } | 367 } |
| 370 | 368 |
| 371 void FullscreenElementStack::webkitWillEnterFullScreenForElement(Element* elemen
t) | 369 void FullscreenElementStack::webkitWillEnterFullScreenForElement(Element* elemen
t) |
| 372 { | 370 { |
| 373 ASSERT(element); | 371 ASSERT(element); |
| 374 if (!document()->isActive()) | 372 if (!document()->isActive()) |
| 375 return; | 373 return; |
| 376 | 374 |
| 377 ASSERT(document()->settings()); // If we're active we must have settings. | |
| 378 ASSERT(document()->settings()->fullScreenEnabled()); | |
| 379 | |
| 380 if (m_fullScreenRenderer) | 375 if (m_fullScreenRenderer) |
| 381 m_fullScreenRenderer->unwrapRenderer(); | 376 m_fullScreenRenderer->unwrapRenderer(); |
| 382 | 377 |
| 383 m_fullScreenElement = element; | 378 m_fullScreenElement = element; |
| 384 | 379 |
| 385 // Create a placeholder block for a the full-screen element, to keep the pag
e from reflowing | 380 // Create a placeholder block for a the full-screen element, to keep the pag
e from reflowing |
| 386 // when the element is removed from the normal flow. Only do this for a Rend
erBox, as only | 381 // when the element is removed from the normal flow. Only do this for a Rend
erBox, as only |
| 387 // a box will have a frameRect. The placeholder will be created in setFullSc
reenRenderer() | 382 // a box will have a frameRect. The placeholder will be created in setFullSc
reenRenderer() |
| 388 // during layout. | 383 // during layout. |
| 389 RenderObject* renderer = m_fullScreenElement->renderer(); | 384 RenderObject* renderer = m_fullScreenElement->renderer(); |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 if (!target) | 571 if (!target) |
| 577 target = fullscreen->webkitCurrentFullScreenElement(); | 572 target = fullscreen->webkitCurrentFullScreenElement(); |
| 578 } | 573 } |
| 579 | 574 |
| 580 if (!target) | 575 if (!target) |
| 581 target = doc; | 576 target = doc; |
| 582 m_fullScreenChangeEventTargetQueue.append(target); | 577 m_fullScreenChangeEventTargetQueue.append(target); |
| 583 } | 578 } |
| 584 | 579 |
| 585 } // namespace WebCore | 580 } // namespace WebCore |
| OLD | NEW |