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 2215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2226 void Document::removeAllEventListeners() | 2226 void Document::removeAllEventListeners() |
2227 { | 2227 { |
2228 ContainerNode::removeAllEventListeners(); | 2228 ContainerNode::removeAllEventListeners(); |
2229 | 2229 |
2230 if (LocalDOMWindow* domWindow = this->domWindow()) | 2230 if (LocalDOMWindow* domWindow = this->domWindow()) |
2231 domWindow->removeAllEventListeners(); | 2231 domWindow->removeAllEventListeners(); |
2232 } | 2232 } |
2233 | 2233 |
2234 Document& Document::axObjectCacheOwner() const | 2234 Document& Document::axObjectCacheOwner() const |
2235 { | 2235 { |
2236 Document& top = topDocument(); | 2236 if (frame() && frame()->pagePopupOwner()) { |
2237 if (top.frame() && top.frame()->pagePopupOwner()) { | 2237 ASSERT(!m_axObjectCache); |
2238 ASSERT(!top.m_axObjectCache); | 2238 return frame()->pagePopupOwner()->document().axObjectCacheOwner(); |
2239 return top.frame()->pagePopupOwner()->document().axObjectCacheOwner(); | |
2240 } | 2239 } |
2241 return top; | 2240 return *const_cast<Document*>(this); |
dcheng
2015/09/17 21:54:08
If this method can return a mutable ref to this, i
dmazzoni
2015/09/17 22:11:57
Yeah, note that topDocument() is doing a const_cas
| |
2242 } | 2241 } |
2243 | 2242 |
2244 void Document::clearAXObjectCache() | 2243 void Document::clearAXObjectCache() |
2245 { | 2244 { |
2246 ASSERT(&axObjectCacheOwner() == this); | 2245 ASSERT(&axObjectCacheOwner() == this); |
2247 // Clear the cache member variable before calling delete because attempts | 2246 // Clear the cache member variable before calling delete because attempts |
2248 // are made to access it during destruction. | 2247 // are made to access it during destruction. |
2249 if (m_axObjectCache) | 2248 if (m_axObjectCache) |
2250 m_axObjectCache->dispose(); | 2249 m_axObjectCache->dispose(); |
2251 m_axObjectCache.clear(); | 2250 m_axObjectCache.clear(); |
(...skipping 1269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3521 // Re-get the widget in case updating the layout changed things. | 3520 // Re-get the widget in case updating the layout changed things. |
3522 focusWidget = widgetForElement(*m_focusedElement); | 3521 focusWidget = widgetForElement(*m_focusedElement); |
3523 } | 3522 } |
3524 if (focusWidget) | 3523 if (focusWidget) |
3525 focusWidget->setFocus(true, type); | 3524 focusWidget->setFocus(true, type); |
3526 else | 3525 else |
3527 view()->setFocus(true, type); | 3526 view()->setFocus(true, type); |
3528 } | 3527 } |
3529 } | 3528 } |
3530 | 3529 |
3531 if (!focusChangeBlocked && m_focusedElement) { | 3530 if (!focusChangeBlocked) { |
3532 // Create the AXObject cache in a focus change because Chromium relies o n it. | 3531 // Create the AXObject cache in a focus change because Chromium relies o n it. |
3533 if (AXObjectCache* cache = axObjectCache()) | 3532 if (AXObjectCache* cache = axObjectCache()) |
3534 cache->handleFocusedUIElementChanged(oldFocusedElement.get(), newFoc usedElement.get()); | 3533 cache->handleFocusedUIElementChanged(oldFocusedElement.get(), newFoc usedElement.get()); |
3535 } | 3534 } |
3536 | 3535 |
3537 if (!focusChangeBlocked && frameHost()) | 3536 if (!focusChangeBlocked && frameHost()) |
3538 frameHost()->chromeClient().focusedNodeChanged(oldFocusedElement.get(), m_focusedElement.get()); | 3537 frameHost()->chromeClient().focusedNodeChanged(oldFocusedElement.get(), m_focusedElement.get()); |
3539 | 3538 |
3540 SetFocusedElementDone: | 3539 SetFocusedElementDone: |
3541 updateLayoutTreeIfNeeded(); | 3540 updateLayoutTreeIfNeeded(); |
(...skipping 2197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5739 #ifndef NDEBUG | 5738 #ifndef NDEBUG |
5740 using namespace blink; | 5739 using namespace blink; |
5741 void showLiveDocumentInstances() | 5740 void showLiveDocumentInstances() |
5742 { | 5741 { |
5743 Document::WeakDocumentSet& set = Document::liveDocumentSet(); | 5742 Document::WeakDocumentSet& set = Document::liveDocumentSet(); |
5744 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 5743 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
5745 for (Document* document : set) | 5744 for (Document* document : set) |
5746 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data()); | 5745 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data()); |
5747 } | 5746 } |
5748 #endif | 5747 #endif |
OLD | NEW |