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 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 , m_documentClasses(documentClasses) | 422 , m_documentClasses(documentClasses) |
423 , m_isViewSource(false) | 423 , m_isViewSource(false) |
424 , m_sawElementsInKnownNamespaces(false) | 424 , m_sawElementsInKnownNamespaces(false) |
425 , m_isSrcdocDocument(false) | 425 , m_isSrcdocDocument(false) |
426 , m_isMobileDocument(false) | 426 , m_isMobileDocument(false) |
427 , m_mayDisplaySeamlesslyWithParent(false) | 427 , m_mayDisplaySeamlesslyWithParent(false) |
428 , m_renderView(0) | 428 , m_renderView(0) |
429 , m_weakFactory(this) | 429 , m_weakFactory(this) |
430 , m_contextDocument(initializer.contextDocument()) | 430 , m_contextDocument(initializer.contextDocument()) |
431 , m_hasFullscreenElementStack(false) | 431 , m_hasFullscreenElementStack(false) |
| 432 , m_activeModalDialog(0) |
432 , m_loadEventDelayCount(0) | 433 , m_loadEventDelayCount(0) |
433 , m_loadEventDelayTimer(this, &Document::loadEventDelayTimerFired) | 434 , m_loadEventDelayTimer(this, &Document::loadEventDelayTimerFired) |
434 , m_referrerPolicy(ReferrerPolicyDefault) | 435 , m_referrerPolicy(ReferrerPolicyDefault) |
435 , m_directionSetOnDocumentElement(false) | 436 , m_directionSetOnDocumentElement(false) |
436 , m_writingModeSetOnDocumentElement(false) | 437 , m_writingModeSetOnDocumentElement(false) |
437 , m_writeRecursionIsTooDeep(false) | 438 , m_writeRecursionIsTooDeep(false) |
438 , m_writeRecursionDepth(0) | 439 , m_writeRecursionDepth(0) |
439 , m_lastHandledUserGestureTimestamp(0) | 440 , m_lastHandledUserGestureTimestamp(0) |
440 , m_taskRunner(MainThreadTaskRunner::create(this)) | 441 , m_taskRunner(MainThreadTaskRunner::create(this)) |
441 , m_registrationContext(initializer.registrationContext(this)) | 442 , m_registrationContext(initializer.registrationContext(this)) |
(...skipping 4273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4715 bool Document::tasksNeedSuspension() | 4716 bool Document::tasksNeedSuspension() |
4716 { | 4717 { |
4717 Page* page = this->page(); | 4718 Page* page = this->page(); |
4718 return page && page->defersLoading(); | 4719 return page && page->defersLoading(); |
4719 } | 4720 } |
4720 | 4721 |
4721 void Document::addToTopLayer(Element* element, const Element* before) | 4722 void Document::addToTopLayer(Element* element, const Element* before) |
4722 { | 4723 { |
4723 if (element->isInTopLayer()) | 4724 if (element->isInTopLayer()) |
4724 return; | 4725 return; |
4725 | |
4726 ASSERT(!m_topLayerElements.contains(element)); | 4726 ASSERT(!m_topLayerElements.contains(element)); |
4727 ASSERT(!before || m_topLayerElements.contains(before)); | 4727 ASSERT(!before || m_topLayerElements.contains(before)); |
| 4728 |
4728 if (before) { | 4729 if (before) { |
4729 size_t beforePosition = m_topLayerElements.find(before); | 4730 size_t beforePosition = m_topLayerElements.find(before); |
4730 m_topLayerElements.insert(beforePosition, element); | 4731 m_topLayerElements.insert(beforePosition, element); |
4731 } else { | 4732 } else { |
4732 m_topLayerElements.append(element); | 4733 m_topLayerElements.append(element); |
4733 } | 4734 } |
4734 element->setIsInTopLayer(true); | 4735 element->setIsInTopLayer(true); |
4735 } | 4736 } |
4736 | 4737 |
4737 void Document::removeFromTopLayer(Element* element) | 4738 void Document::removeFromTopLayer(Element* element) |
4738 { | 4739 { |
4739 if (!element->isInTopLayer()) | 4740 if (!element->isInTopLayer()) |
4740 return; | 4741 return; |
4741 size_t position = m_topLayerElements.find(element); | 4742 size_t position = m_topLayerElements.find(element); |
4742 ASSERT(position != kNotFound); | 4743 ASSERT(position != kNotFound); |
4743 m_topLayerElements.remove(position); | 4744 m_topLayerElements.remove(position); |
4744 element->setIsInTopLayer(false); | 4745 element->setIsInTopLayer(false); |
4745 } | 4746 } |
4746 | 4747 |
| 4748 void Document::addToModalDialogStack(HTMLDialogElement* dialog) |
| 4749 { |
| 4750 if (dialog->isModal()) |
| 4751 return; |
| 4752 addToTopLayer(dialog); |
| 4753 dialog->setModal(true); |
| 4754 m_activeModalDialog = dialog; |
| 4755 } |
| 4756 |
| 4757 void Document::removeFromModalDialogStack(HTMLDialogElement* dialog) |
| 4758 { |
| 4759 if (!dialog->isModal()) |
| 4760 return; |
| 4761 |
| 4762 removeFromTopLayer(dialog); |
| 4763 dialog->setModal(false); |
| 4764 if (m_activeModalDialog != dialog) |
| 4765 return; |
| 4766 |
| 4767 m_activeModalDialog = 0; |
| 4768 Vector<RefPtr<Element> >::reverse_iterator end = m_topLayerElements.rend(); |
| 4769 for (Vector<RefPtr<Element> >::reverse_iterator it = m_topLayerElements.rbeg
in(); it != end; ++it) { |
| 4770 if (!it->get()->hasTagName(dialogTag)) |
| 4771 continue; |
| 4772 HTMLDialogElement* dialog = toHTMLDialogElement(it->get()); |
| 4773 if (dialog->isModal()) { |
| 4774 m_activeModalDialog = dialog; |
| 4775 return; |
| 4776 } |
| 4777 } |
| 4778 } |
| 4779 |
4747 HTMLDialogElement* Document::activeModalDialog() const | 4780 HTMLDialogElement* Document::activeModalDialog() const |
4748 { | 4781 { |
4749 if (m_topLayerElements.isEmpty()) | 4782 return m_activeModalDialog; |
4750 return 0; | |
4751 return toHTMLDialogElement(m_topLayerElements.last().get()); | |
4752 } | 4783 } |
4753 | 4784 |
4754 void Document::webkitExitPointerLock() | 4785 void Document::webkitExitPointerLock() |
4755 { | 4786 { |
4756 if (!page()) | 4787 if (!page()) |
4757 return; | 4788 return; |
4758 if (Element* target = page()->pointerLockController().element()) { | 4789 if (Element* target = page()->pointerLockController().element()) { |
4759 if (target->document() != this) | 4790 if (target->document() != this) |
4760 return; | 4791 return; |
4761 } | 4792 } |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5249 } | 5280 } |
5250 | 5281 |
5251 FastTextAutosizer* Document::fastTextAutosizer() | 5282 FastTextAutosizer* Document::fastTextAutosizer() |
5252 { | 5283 { |
5253 if (!m_fastTextAutosizer && RuntimeEnabledFeatures::fastTextAutosizingEnable
d()) | 5284 if (!m_fastTextAutosizer && RuntimeEnabledFeatures::fastTextAutosizingEnable
d()) |
5254 m_fastTextAutosizer = FastTextAutosizer::create(this); | 5285 m_fastTextAutosizer = FastTextAutosizer::create(this); |
5255 return m_fastTextAutosizer.get(); | 5286 return m_fastTextAutosizer.get(); |
5256 } | 5287 } |
5257 | 5288 |
5258 } // namespace WebCore | 5289 } // namespace WebCore |
OLD | NEW |