| 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 3597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3608 oldFocusedElement->dispatchFocusOutEvent(EventTypeNames::focusout, n
ewFocusedElement.get(), params.sourceCapabilities); // DOM level 3 name for the
bubbling blur event. | 3608 oldFocusedElement->dispatchFocusOutEvent(EventTypeNames::focusout, n
ewFocusedElement.get(), params.sourceCapabilities); // DOM level 3 name for the
bubbling blur event. |
| 3609 // FIXME: We should remove firing DOMFocusOutEvent event when we are
sure no content depends | 3609 // FIXME: We should remove firing DOMFocusOutEvent event when we are
sure no content depends |
| 3610 // on it, probably when <rdar://problem/8503958> is resolved. | 3610 // on it, probably when <rdar://problem/8503958> is resolved. |
| 3611 oldFocusedElement->dispatchFocusOutEvent(EventTypeNames::DOMFocusOut
, newFocusedElement.get(), params.sourceCapabilities); // DOM level 2 name for c
ompatibility. | 3611 oldFocusedElement->dispatchFocusOutEvent(EventTypeNames::DOMFocusOut
, newFocusedElement.get(), params.sourceCapabilities); // DOM level 2 name for c
ompatibility. |
| 3612 | 3612 |
| 3613 if (m_focusedElement) { | 3613 if (m_focusedElement) { |
| 3614 // handler shifted focus | 3614 // handler shifted focus |
| 3615 focusChangeBlocked = true; | 3615 focusChangeBlocked = true; |
| 3616 newFocusedElement = nullptr; | 3616 newFocusedElement = nullptr; |
| 3617 } | 3617 } |
| 3618 // Event handlers might make newFocusedElement dirty. | |
| 3619 if (newFocusedElement) | |
| 3620 updateLayoutTreeIgnorePendingStylesheets(); | |
| 3621 } | 3618 } |
| 3622 | 3619 |
| 3623 if (view()) { | 3620 if (view()) { |
| 3624 Widget* oldWidget = widgetForElement(*oldFocusedElement); | 3621 Widget* oldWidget = widgetForElement(*oldFocusedElement); |
| 3625 if (oldWidget) | 3622 if (oldWidget) |
| 3626 oldWidget->setFocus(false, params.type); | 3623 oldWidget->setFocus(false, params.type); |
| 3627 else | 3624 else |
| 3628 view()->setFocus(false, params.type); | 3625 view()->setFocus(false, params.type); |
| 3629 } | 3626 } |
| 3630 } | 3627 } |
| 3631 | 3628 |
| 3629 if (newFocusedElement) |
| 3630 updateLayoutTreeIgnorePendingStylesheets(); |
| 3632 if (newFocusedElement && newFocusedElement->isFocusable()) { | 3631 if (newFocusedElement && newFocusedElement->isFocusable()) { |
| 3633 if (newFocusedElement->isRootEditableElement() && !acceptsEditingFocus(*
newFocusedElement)) { | 3632 if (newFocusedElement->isRootEditableElement() && !acceptsEditingFocus(*
newFocusedElement)) { |
| 3634 // delegate blocks focus change | 3633 // delegate blocks focus change |
| 3635 focusChangeBlocked = true; | 3634 focusChangeBlocked = true; |
| 3636 goto SetFocusedElementDone; | 3635 goto SetFocusedElementDone; |
| 3637 } | 3636 } |
| 3638 // Set focus on the new node | 3637 // Set focus on the new node |
| 3639 m_focusedElement = newFocusedElement; | 3638 m_focusedElement = newFocusedElement; |
| 3640 | 3639 |
| 3641 m_focusedElement->setFocus(true); | 3640 m_focusedElement->setFocus(true); |
| (...skipping 2300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5942 #ifndef NDEBUG | 5941 #ifndef NDEBUG |
| 5943 using namespace blink; | 5942 using namespace blink; |
| 5944 void showLiveDocumentInstances() | 5943 void showLiveDocumentInstances() |
| 5945 { | 5944 { |
| 5946 Document::WeakDocumentSet& set = Document::liveDocumentSet(); | 5945 Document::WeakDocumentSet& set = Document::liveDocumentSet(); |
| 5947 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 5946 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
| 5948 for (Document* document : set) | 5947 for (Document* document : set) |
| 5949 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str
ing().utf8().data()); | 5948 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str
ing().utf8().data()); |
| 5950 } | 5949 } |
| 5951 #endif | 5950 #endif |
| OLD | NEW |