Chromium Code Reviews| 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 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 443 , m_documentClasses(documentClasses) | 443 , m_documentClasses(documentClasses) |
| 444 , m_isViewSource(false) | 444 , m_isViewSource(false) |
| 445 , m_sawElementsInKnownNamespaces(false) | 445 , m_sawElementsInKnownNamespaces(false) |
| 446 , m_isSrcdocDocument(false) | 446 , m_isSrcdocDocument(false) |
| 447 , m_isMobileDocument(false) | 447 , m_isMobileDocument(false) |
| 448 , m_mayDisplaySeamlesslyWithParent(false) | 448 , m_mayDisplaySeamlesslyWithParent(false) |
| 449 , m_renderView(0) | 449 , m_renderView(0) |
| 450 , m_weakFactory(this) | 450 , m_weakFactory(this) |
| 451 , m_contextDocument(initializer.contextDocument()) | 451 , m_contextDocument(initializer.contextDocument()) |
| 452 , m_hasFullscreenElementStack(false) | 452 , m_hasFullscreenElementStack(false) |
| 453 , m_activeModalDialog(0) | |
| 453 , m_loadEventDelayCount(0) | 454 , m_loadEventDelayCount(0) |
| 454 , m_loadEventDelayTimer(this, &Document::loadEventDelayTimerFired) | 455 , m_loadEventDelayTimer(this, &Document::loadEventDelayTimerFired) |
| 455 , m_referrerPolicy(ReferrerPolicyDefault) | 456 , m_referrerPolicy(ReferrerPolicyDefault) |
| 456 , m_directionSetOnDocumentElement(false) | 457 , m_directionSetOnDocumentElement(false) |
| 457 , m_writingModeSetOnDocumentElement(false) | 458 , m_writingModeSetOnDocumentElement(false) |
| 458 , m_writeRecursionIsTooDeep(false) | 459 , m_writeRecursionIsTooDeep(false) |
| 459 , m_writeRecursionDepth(0) | 460 , m_writeRecursionDepth(0) |
| 460 , m_lastHandledUserGestureTimestamp(0) | 461 , m_lastHandledUserGestureTimestamp(0) |
| 461 , m_taskRunner(MainThreadTaskRunner::create(this)) | 462 , m_taskRunner(MainThreadTaskRunner::create(this)) |
| 462 , m_registrationContext(initializer.registrationContext(this)) | 463 , m_registrationContext(initializer.registrationContext(this)) |
| (...skipping 4307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4770 void Document::removeFromTopLayer(Element* element) | 4771 void Document::removeFromTopLayer(Element* element) |
| 4771 { | 4772 { |
| 4772 if (!element->isInTopLayer()) | 4773 if (!element->isInTopLayer()) |
| 4773 return; | 4774 return; |
| 4774 size_t position = m_topLayerElements.find(element); | 4775 size_t position = m_topLayerElements.find(element); |
| 4775 ASSERT(position != kNotFound); | 4776 ASSERT(position != kNotFound); |
| 4776 m_topLayerElements.remove(position); | 4777 m_topLayerElements.remove(position); |
| 4777 element->setIsInTopLayer(false); | 4778 element->setIsInTopLayer(false); |
| 4778 } | 4779 } |
| 4779 | 4780 |
| 4781 void Document::addToModalDialogStack(HTMLDialogElement* dialog) | |
| 4782 { | |
| 4783 if (dialog->isModal()) | |
| 4784 return; | |
| 4785 addToTopLayer(dialog); | |
| 4786 dialog->setModal(true); | |
| 4787 m_activeModalDialog = dialog; | |
| 4788 } | |
| 4789 | |
| 4790 void Document::removeFromModalDialogStack(HTMLDialogElement* dialog) | |
| 4791 { | |
| 4792 if (!dialog->isModal()) | |
| 4793 return; | |
| 4794 removeFromTopLayer(dialog); | |
| 4795 dialog->setModal(false); | |
| 4796 | |
| 4797 if (m_activeModalDialog != dialog) | |
| 4798 return; | |
| 4799 m_activeModalDialog = 0; | |
|
esprehn
2014/01/21 18:59:05
Document::activeModalDialog() should just contain
falken
2014/01/22 06:08:02
Done.
| |
| 4800 Vector<RefPtr<Element> >::reverse_iterator end = m_topLayerElements.rend(); | |
| 4801 for (Vector<RefPtr<Element> >::reverse_iterator it = m_topLayerElements.rbeg in(); it != end; ++it) { | |
| 4802 if (!it->get()->hasTagName(dialogTag)) | |
| 4803 continue; | |
| 4804 HTMLDialogElement* dialog = toHTMLDialogElement(it->get()); | |
| 4805 if (dialog->isModal()) { | |
| 4806 m_activeModalDialog = dialog; | |
| 4807 return; | |
| 4808 } | |
| 4809 } | |
| 4810 } | |
| 4811 | |
| 4780 HTMLDialogElement* Document::activeModalDialog() const | 4812 HTMLDialogElement* Document::activeModalDialog() const |
| 4781 { | 4813 { |
| 4782 if (m_topLayerElements.isEmpty()) | 4814 return m_activeModalDialog; |
|
esprehn
2014/01/21 18:59:05
This should contain the loop.
| |
| 4783 return 0; | |
| 4784 return toHTMLDialogElement(m_topLayerElements.last().get()); | |
| 4785 } | 4815 } |
| 4786 | 4816 |
| 4787 void Document::webkitExitPointerLock() | 4817 void Document::webkitExitPointerLock() |
| 4788 { | 4818 { |
| 4789 if (!page()) | 4819 if (!page()) |
| 4790 return; | 4820 return; |
| 4791 if (Element* target = page()->pointerLockController().element()) { | 4821 if (Element* target = page()->pointerLockController().element()) { |
| 4792 if (target->document() != this) | 4822 if (target->document() != this) |
| 4793 return; | 4823 return; |
| 4794 } | 4824 } |
| (...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5293 if (!element) { | 5323 if (!element) { |
| 5294 m_autofocusElement = 0; | 5324 m_autofocusElement = 0; |
| 5295 return; | 5325 return; |
| 5296 } | 5326 } |
| 5297 if (!m_autofocusElement) | 5327 if (!m_autofocusElement) |
| 5298 m_taskRunner->postTask(AutofocusTask::create()); | 5328 m_taskRunner->postTask(AutofocusTask::create()); |
| 5299 m_autofocusElement = element; | 5329 m_autofocusElement = element; |
| 5300 } | 5330 } |
| 5301 | 5331 |
| 5302 } // namespace WebCore | 5332 } // namespace WebCore |
| OLD | NEW |