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 4757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4768 if (!element->isInTopLayer()) | 4768 if (!element->isInTopLayer()) |
4769 return; | 4769 return; |
4770 size_t position = m_topLayerElements.find(element); | 4770 size_t position = m_topLayerElements.find(element); |
4771 ASSERT(position != kNotFound); | 4771 ASSERT(position != kNotFound); |
4772 m_topLayerElements.remove(position); | 4772 m_topLayerElements.remove(position); |
4773 element->setIsInTopLayer(false); | 4773 element->setIsInTopLayer(false); |
4774 } | 4774 } |
4775 | 4775 |
4776 HTMLDialogElement* Document::activeModalDialog() const | 4776 HTMLDialogElement* Document::activeModalDialog() const |
4777 { | 4777 { |
4778 if (m_topLayerElements.isEmpty()) | 4778 Vector<RefPtr<Element> >::const_reverse_iterator end = m_topLayerElements.re
nd(); |
4779 return 0; | 4779 for (Vector<RefPtr<Element> >::const_reverse_iterator it = m_topLayerElement
s.rbegin(); it != end; ++it) { |
4780 return toHTMLDialogElement(m_topLayerElements.last().get()); | 4780 if (!it->get()->hasTagName(dialogTag)) |
| 4781 continue; |
| 4782 HTMLDialogElement* dialog = toHTMLDialogElement(it->get()); |
| 4783 if (dialog->isModal()) |
| 4784 return dialog; |
| 4785 } |
| 4786 return 0; |
4781 } | 4787 } |
4782 | 4788 |
4783 void Document::webkitExitPointerLock() | 4789 void Document::webkitExitPointerLock() |
4784 { | 4790 { |
4785 if (!page()) | 4791 if (!page()) |
4786 return; | 4792 return; |
4787 if (Element* target = page()->pointerLockController().element()) { | 4793 if (Element* target = page()->pointerLockController().element()) { |
4788 if (target->document() != this) | 4794 if (target->document() != this) |
4789 return; | 4795 return; |
4790 } | 4796 } |
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5295 if (!page->focusController().isActive() || !page->focusController().isFocuse
d()) | 5301 if (!page->focusController().isActive() || !page->focusController().isFocuse
d()) |
5296 return false; | 5302 return false; |
5297 if (Frame* focusedFrame = page->focusController().focusedFrame()) { | 5303 if (Frame* focusedFrame = page->focusController().focusedFrame()) { |
5298 if (focusedFrame->tree().isDescendantOf(frame())) | 5304 if (focusedFrame->tree().isDescendantOf(frame())) |
5299 return true; | 5305 return true; |
5300 } | 5306 } |
5301 return false; | 5307 return false; |
5302 } | 5308 } |
5303 | 5309 |
5304 } // namespace WebCore | 5310 } // namespace WebCore |
OLD | NEW |