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 2227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2238 void Document::removeAllEventListeners() | 2238 void Document::removeAllEventListeners() |
2239 { | 2239 { |
2240 ContainerNode::removeAllEventListeners(); | 2240 ContainerNode::removeAllEventListeners(); |
2241 | 2241 |
2242 if (LocalDOMWindow* domWindow = this->domWindow()) | 2242 if (LocalDOMWindow* domWindow = this->domWindow()) |
2243 domWindow->removeAllEventListeners(); | 2243 domWindow->removeAllEventListeners(); |
2244 } | 2244 } |
2245 | 2245 |
2246 Document& Document::axObjectCacheOwner() const | 2246 Document& Document::axObjectCacheOwner() const |
2247 { | 2247 { |
2248 Document& top = topDocument(); | 2248 if (frame() && frame()->pagePopupOwner()) { |
2249 if (top.frame() && top.frame()->pagePopupOwner()) { | 2249 ASSERT(!m_axObjectCache); |
2250 ASSERT(!top.m_axObjectCache); | 2250 return frame()->pagePopupOwner()->document().axObjectCacheOwner(); |
2251 return top.frame()->pagePopupOwner()->document().axObjectCacheOwner(); | |
2252 } | 2251 } |
2253 return top; | 2252 return *const_cast<Document*>(this); |
2254 } | 2253 } |
2255 | 2254 |
2256 void Document::clearAXObjectCache() | 2255 void Document::clearAXObjectCache() |
2257 { | 2256 { |
2258 ASSERT(&axObjectCacheOwner() == this); | 2257 ASSERT(&axObjectCacheOwner() == this); |
2259 // Clear the cache member variable before calling delete because attempts | 2258 // Clear the cache member variable before calling delete because attempts |
2260 // are made to access it during destruction. | 2259 // are made to access it during destruction. |
2261 if (m_axObjectCache) | 2260 if (m_axObjectCache) |
2262 m_axObjectCache->dispose(); | 2261 m_axObjectCache->dispose(); |
2263 m_axObjectCache.clear(); | 2262 m_axObjectCache.clear(); |
(...skipping 1271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3535 // Re-get the widget in case updating the layout changed things. | 3534 // Re-get the widget in case updating the layout changed things. |
3536 focusWidget = widgetForElement(*m_focusedElement); | 3535 focusWidget = widgetForElement(*m_focusedElement); |
3537 } | 3536 } |
3538 if (focusWidget) | 3537 if (focusWidget) |
3539 focusWidget->setFocus(true, type); | 3538 focusWidget->setFocus(true, type); |
3540 else | 3539 else |
3541 view()->setFocus(true, type); | 3540 view()->setFocus(true, type); |
3542 } | 3541 } |
3543 } | 3542 } |
3544 | 3543 |
3545 if (!focusChangeBlocked && m_focusedElement) { | 3544 if (!focusChangeBlocked) { |
3546 // Create the AXObject cache in a focus change because Chromium relies o
n it. | 3545 // Create the AXObject cache in a focus change because Chromium relies o
n it. |
3547 if (AXObjectCache* cache = axObjectCache()) | 3546 if (AXObjectCache* cache = axObjectCache()) |
3548 cache->handleFocusedUIElementChanged(oldFocusedElement.get(), newFoc
usedElement.get()); | 3547 cache->handleFocusedUIElementChanged(oldFocusedElement.get(), newFoc
usedElement.get()); |
3549 } | 3548 } |
3550 | 3549 |
3551 if (!focusChangeBlocked && frameHost()) | 3550 if (!focusChangeBlocked && frameHost()) |
3552 frameHost()->chromeClient().focusedNodeChanged(oldFocusedElement.get(),
m_focusedElement.get()); | 3551 frameHost()->chromeClient().focusedNodeChanged(oldFocusedElement.get(),
m_focusedElement.get()); |
3553 | 3552 |
3554 SetFocusedElementDone: | 3553 SetFocusedElementDone: |
3555 updateLayoutTreeIfNeeded(); | 3554 updateLayoutTreeIfNeeded(); |
(...skipping 2198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5754 #ifndef NDEBUG | 5753 #ifndef NDEBUG |
5755 using namespace blink; | 5754 using namespace blink; |
5756 void showLiveDocumentInstances() | 5755 void showLiveDocumentInstances() |
5757 { | 5756 { |
5758 Document::WeakDocumentSet& set = Document::liveDocumentSet(); | 5757 Document::WeakDocumentSet& set = Document::liveDocumentSet(); |
5759 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 5758 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
5760 for (Document* document : set) | 5759 for (Document* document : set) |
5761 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str
ing().utf8().data()); | 5760 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str
ing().utf8().data()); |
5762 } | 5761 } |
5763 #endif | 5762 #endif |
OLD | NEW |