| 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 3406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3417 { | 3417 { |
| 3418 return m_annotatedRegions; | 3418 return m_annotatedRegions; |
| 3419 } | 3419 } |
| 3420 | 3420 |
| 3421 void Document::setAnnotatedRegions(const Vector<AnnotatedRegionValue>& regions) | 3421 void Document::setAnnotatedRegions(const Vector<AnnotatedRegionValue>& regions) |
| 3422 { | 3422 { |
| 3423 m_annotatedRegions = regions; | 3423 m_annotatedRegions = regions; |
| 3424 setAnnotatedRegionsDirty(false); | 3424 setAnnotatedRegionsDirty(false); |
| 3425 } | 3425 } |
| 3426 | 3426 |
| 3427 bool Document::setFocusedElement(PassRefPtrWillBeRawPtr<Element> prpNewFocusedEl
ement, FocusType type) | 3427 bool Document::setFocusedElement(PassRefPtrWillBeRawPtr<Element> prpNewFocusedEl
ement, WebFocusType type) |
| 3428 { | 3428 { |
| 3429 m_clearFocusedElementTimer.stop(); | 3429 m_clearFocusedElementTimer.stop(); |
| 3430 | 3430 |
| 3431 RefPtrWillBeRawPtr<Element> newFocusedElement = prpNewFocusedElement; | 3431 RefPtrWillBeRawPtr<Element> newFocusedElement = prpNewFocusedElement; |
| 3432 | 3432 |
| 3433 // Make sure newFocusedNode is actually in this document | 3433 // Make sure newFocusedNode is actually in this document |
| 3434 if (newFocusedElement && (newFocusedElement->document() != this)) | 3434 if (newFocusedElement && (newFocusedElement->document() != this)) |
| 3435 return true; | 3435 return true; |
| 3436 | 3436 |
| 3437 if (NodeChildRemovalTracker::isBeingRemoved(newFocusedElement.get())) | 3437 if (NodeChildRemovalTracker::isBeingRemoved(newFocusedElement.get())) |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3472 if (m_focusedElement) { | 3472 if (m_focusedElement) { |
| 3473 // handler shifted focus | 3473 // handler shifted focus |
| 3474 focusChangeBlocked = true; | 3474 focusChangeBlocked = true; |
| 3475 newFocusedElement = nullptr; | 3475 newFocusedElement = nullptr; |
| 3476 } | 3476 } |
| 3477 } | 3477 } |
| 3478 | 3478 |
| 3479 if (view()) { | 3479 if (view()) { |
| 3480 Widget* oldWidget = widgetForElement(*oldFocusedElement); | 3480 Widget* oldWidget = widgetForElement(*oldFocusedElement); |
| 3481 if (oldWidget) | 3481 if (oldWidget) |
| 3482 oldWidget->setFocus(false); | 3482 oldWidget->setFocus(false, type); |
| 3483 else | 3483 else |
| 3484 view()->setFocus(false); | 3484 view()->setFocus(false, type); |
| 3485 } | 3485 } |
| 3486 } | 3486 } |
| 3487 | 3487 |
| 3488 if (newFocusedElement && newFocusedElement->isFocusable()) { | 3488 if (newFocusedElement && newFocusedElement->isFocusable()) { |
| 3489 if (newFocusedElement->isRootEditableElement() && !acceptsEditingFocus(*
newFocusedElement)) { | 3489 if (newFocusedElement->isRootEditableElement() && !acceptsEditingFocus(*
newFocusedElement)) { |
| 3490 // delegate blocks focus change | 3490 // delegate blocks focus change |
| 3491 focusChangeBlocked = true; | 3491 focusChangeBlocked = true; |
| 3492 goto SetFocusedElementDone; | 3492 goto SetFocusedElementDone; |
| 3493 } | 3493 } |
| 3494 // Set focus on the new node | 3494 // Set focus on the new node |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3536 Widget* focusWidget = widgetForElement(*m_focusedElement); | 3536 Widget* focusWidget = widgetForElement(*m_focusedElement); |
| 3537 if (focusWidget) { | 3537 if (focusWidget) { |
| 3538 // Make sure a widget has the right size before giving it focus. | 3538 // Make sure a widget has the right size before giving it focus. |
| 3539 // Otherwise, we are testing edge cases of the Widget code. | 3539 // Otherwise, we are testing edge cases of the Widget code. |
| 3540 // Specifically, in WebCore this does not work well for text fie
lds. | 3540 // Specifically, in WebCore this does not work well for text fie
lds. |
| 3541 updateLayout(); | 3541 updateLayout(); |
| 3542 // Re-get the widget in case updating the layout changed things. | 3542 // Re-get the widget in case updating the layout changed things. |
| 3543 focusWidget = widgetForElement(*m_focusedElement); | 3543 focusWidget = widgetForElement(*m_focusedElement); |
| 3544 } | 3544 } |
| 3545 if (focusWidget) | 3545 if (focusWidget) |
| 3546 focusWidget->setFocus(true); | 3546 focusWidget->setFocus(true, type); |
| 3547 else | 3547 else |
| 3548 view()->setFocus(true); | 3548 view()->setFocus(true, type); |
| 3549 } | 3549 } |
| 3550 } | 3550 } |
| 3551 | 3551 |
| 3552 if (!focusChangeBlocked && m_focusedElement) { | 3552 if (!focusChangeBlocked && m_focusedElement) { |
| 3553 // Create the AXObject cache in a focus change because Chromium relies o
n it. | 3553 // Create the AXObject cache in a focus change because Chromium relies o
n it. |
| 3554 if (AXObjectCache* cache = axObjectCache()) | 3554 if (AXObjectCache* cache = axObjectCache()) |
| 3555 cache->handleFocusedUIElementChanged(oldFocusedElement.get(), newFoc
usedElement.get()); | 3555 cache->handleFocusedUIElementChanged(oldFocusedElement.get(), newFoc
usedElement.get()); |
| 3556 } | 3556 } |
| 3557 | 3557 |
| 3558 if (!focusChangeBlocked && frameHost()) | 3558 if (!focusChangeBlocked && frameHost()) |
| (...skipping 2210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5769 #ifndef NDEBUG | 5769 #ifndef NDEBUG |
| 5770 using namespace blink; | 5770 using namespace blink; |
| 5771 void showLiveDocumentInstances() | 5771 void showLiveDocumentInstances() |
| 5772 { | 5772 { |
| 5773 WeakDocumentSet& set = liveDocumentSet(); | 5773 WeakDocumentSet& set = liveDocumentSet(); |
| 5774 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 5774 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
| 5775 for (Document* document : set) | 5775 for (Document* document : set) |
| 5776 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str
ing().utf8().data()); | 5776 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str
ing().utf8().data()); |
| 5777 } | 5777 } |
| 5778 #endif | 5778 #endif |
| OLD | NEW |