| 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, 2011, 2012 Apple Inc. All r
ights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 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) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. |
| 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
| 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. | 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. |
| (...skipping 4712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4723 // An algorithm is allowed to show a pop-up if, in the task in which t
he algorithm is running, either: | 4723 // An algorithm is allowed to show a pop-up if, in the task in which t
he algorithm is running, either: |
| 4724 // - an activation behavior is currently being processed whose click e
vent was trusted, or | 4724 // - an activation behavior is currently being processed whose click e
vent was trusted, or |
| 4725 // - the event listener for a trusted click event is being handled. | 4725 // - the event listener for a trusted click event is being handled. |
| 4726 if (!ScriptController::processingUserGesture()) | 4726 if (!ScriptController::processingUserGesture()) |
| 4727 break; | 4727 break; |
| 4728 | 4728 |
| 4729 // There is a previously-established user preference, security risk, or
platform limitation. | 4729 // There is a previously-established user preference, security risk, or
platform limitation. |
| 4730 if (!page() || !page()->settings()->fullScreenEnabled()) | 4730 if (!page() || !page()->settings()->fullScreenEnabled()) |
| 4731 break; | 4731 break; |
| 4732 | 4732 |
| 4733 if (!page()->chrome()->client()->supportsFullScreenForElement(element, f
lags & Element::ALLOW_KEYBOARD_INPUT)) { | |
| 4734 // The new full screen API does not accept a "flags" parameter, so f
all back to disallowing | |
| 4735 // keyboard input if the chrome client refuses to allow keyboard inp
ut. | |
| 4736 if (!inLegacyMozillaMode && flags & Element::ALLOW_KEYBOARD_INPUT) { | |
| 4737 flags &= ~Element::ALLOW_KEYBOARD_INPUT; | |
| 4738 if (!page()->chrome()->client()->supportsFullScreenForElement(el
ement, false)) | |
| 4739 break; | |
| 4740 } else | |
| 4741 break; | |
| 4742 } | |
| 4743 | |
| 4744 // 2. Let doc be element's node document. (i.e. "this") | 4733 // 2. Let doc be element's node document. (i.e. "this") |
| 4745 Document* currentDoc = this; | 4734 Document* currentDoc = this; |
| 4746 | 4735 |
| 4747 // 3. Let docs be all doc's ancestor browsing context's documents (if an
y) and doc. | 4736 // 3. Let docs be all doc's ancestor browsing context's documents (if an
y) and doc. |
| 4748 Deque<Document*> docs; | 4737 Deque<Document*> docs; |
| 4749 | 4738 |
| 4750 do { | 4739 do { |
| 4751 docs.prepend(currentDoc); | 4740 docs.prepend(currentDoc); |
| 4752 currentDoc = currentDoc->ownerElement() ? currentDoc->ownerElement()
->document() : 0; | 4741 currentDoc = currentDoc->ownerElement() ? currentDoc->ownerElement()
->document() : 0; |
| 4753 } while (currentDoc); | 4742 } while (currentDoc); |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5001 else if (renderer && m_fullScreenRenderer && m_fullScreenRenderer->placehold
er()) { | 4990 else if (renderer && m_fullScreenRenderer && m_fullScreenRenderer->placehold
er()) { |
| 5002 RenderBlock* placeholder = m_fullScreenRenderer->placeholder(); | 4991 RenderBlock* placeholder = m_fullScreenRenderer->placeholder(); |
| 5003 renderer->createPlaceholder(RenderStyle::clone(placeholder->style()), pl
aceholder->frameRect()); | 4992 renderer->createPlaceholder(RenderStyle::clone(placeholder->style()), pl
aceholder->frameRect()); |
| 5004 } | 4993 } |
| 5005 | 4994 |
| 5006 if (m_fullScreenRenderer) | 4995 if (m_fullScreenRenderer) |
| 5007 m_fullScreenRenderer->destroy(); | 4996 m_fullScreenRenderer->destroy(); |
| 5008 ASSERT(!m_fullScreenRenderer); | 4997 ASSERT(!m_fullScreenRenderer); |
| 5009 | 4998 |
| 5010 m_fullScreenRenderer = renderer; | 4999 m_fullScreenRenderer = renderer; |
| 5011 | |
| 5012 // This notification can come in after the page has been destroyed. | |
| 5013 if (page()) | |
| 5014 page()->chrome()->client()->fullScreenRendererChanged(m_fullScreenRender
er); | |
| 5015 } | 5000 } |
| 5016 | 5001 |
| 5017 void Document::fullScreenRendererDestroyed() | 5002 void Document::fullScreenRendererDestroyed() |
| 5018 { | 5003 { |
| 5019 m_fullScreenRenderer = 0; | 5004 m_fullScreenRenderer = 0; |
| 5020 | |
| 5021 if (page()) | |
| 5022 page()->chrome()->client()->fullScreenRendererChanged(0); | |
| 5023 } | 5005 } |
| 5024 | 5006 |
| 5025 void Document::setFullScreenRendererSize(const IntSize& size) | 5007 void Document::setFullScreenRendererSize(const IntSize& size) |
| 5026 { | 5008 { |
| 5027 ASSERT(m_fullScreenRenderer); | 5009 ASSERT(m_fullScreenRenderer); |
| 5028 if (!m_fullScreenRenderer) | 5010 if (!m_fullScreenRenderer) |
| 5029 return; | 5011 return; |
| 5030 | 5012 |
| 5031 if (m_fullScreenRenderer) { | 5013 if (m_fullScreenRenderer) { |
| 5032 RefPtr<RenderStyle> newStyle = RenderStyle::clone(m_fullScreenRenderer->
style()); | 5014 RefPtr<RenderStyle> newStyle = RenderStyle::clone(m_fullScreenRenderer->
style()); |
| (...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5698 | 5680 |
| 5699 PassRefPtr<FontLoader> Document::fontloader() | 5681 PassRefPtr<FontLoader> Document::fontloader() |
| 5700 { | 5682 { |
| 5701 if (!m_fontloader) | 5683 if (!m_fontloader) |
| 5702 m_fontloader = FontLoader::create(this); | 5684 m_fontloader = FontLoader::create(this); |
| 5703 return m_fontloader; | 5685 return m_fontloader; |
| 5704 } | 5686 } |
| 5705 | 5687 |
| 5706 void Document::didAssociateFormControl(Element* element) | 5688 void Document::didAssociateFormControl(Element* element) |
| 5707 { | 5689 { |
| 5708 if (!frame() || !frame()->page() || !frame()->page()->chrome()->client()->sh
ouldNotifyOnFormChanges()) | 5690 if (!frame() || !frame()->page()) |
| 5709 return; | 5691 return; |
| 5710 m_associatedFormControls.add(element); | 5692 m_associatedFormControls.add(element); |
| 5711 if (!m_didAssociateFormControlsTimer.isActive()) | 5693 if (!m_didAssociateFormControlsTimer.isActive()) |
| 5712 m_didAssociateFormControlsTimer.startOneShot(0); | 5694 m_didAssociateFormControlsTimer.startOneShot(0); |
| 5713 } | 5695 } |
| 5714 | 5696 |
| 5715 void Document::didAssociateFormControlsTimerFired(Timer<Document>* timer) | 5697 void Document::didAssociateFormControlsTimerFired(Timer<Document>* timer) |
| 5716 { | 5698 { |
| 5717 ASSERT_UNUSED(timer, timer == &m_didAssociateFormControlsTimer); | 5699 ASSERT_UNUSED(timer, timer == &m_didAssociateFormControlsTimer); |
| 5718 if (!frame() || !frame()->page()) | 5700 if (!frame() || !frame()->page()) |
| 5719 return; | 5701 return; |
| 5720 | 5702 |
| 5721 Vector<RefPtr<Element> > associatedFormControls; | 5703 Vector<RefPtr<Element> > associatedFormControls; |
| 5722 copyToVector(m_associatedFormControls, associatedFormControls); | 5704 copyToVector(m_associatedFormControls, associatedFormControls); |
| 5723 | 5705 |
| 5724 frame()->page()->chrome()->client()->didAssociateFormControls(associatedForm
Controls); | 5706 frame()->page()->chrome()->client()->didAssociateFormControls(associatedForm
Controls); |
| 5725 m_associatedFormControls.clear(); | 5707 m_associatedFormControls.clear(); |
| 5726 } | 5708 } |
| 5727 | 5709 |
| 5728 } // namespace WebCore | 5710 } // namespace WebCore |
| OLD | NEW |