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 | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All |
7 * rights reserved. | 7 * rights reserved. |
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
9 * (http://www.torchmobile.com/) | 9 * (http://www.torchmobile.com/) |
10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. | 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. |
(...skipping 4026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4037 newFocusedElement, | 4037 newFocusedElement, |
4038 params.sourceCapabilities); | 4038 params.sourceCapabilities); |
4039 | 4039 |
4040 if (m_focusedElement) { | 4040 if (m_focusedElement) { |
4041 // handler shifted focus | 4041 // handler shifted focus |
4042 focusChangeBlocked = true; | 4042 focusChangeBlocked = true; |
4043 newFocusedElement = nullptr; | 4043 newFocusedElement = nullptr; |
4044 } | 4044 } |
4045 } | 4045 } |
4046 | 4046 |
4047 // TODO(joelhockey): Do we need spcial handling for plugins? | |
dcheng
2017/03/23 07:21:42
Unfortunately, I'm pretty sure the answer here is
joelhockey
2017/03/27 06:42:21
I can confirm that plugin is expecting a call here
| |
4047 if (view()) { | 4048 if (view()) { |
4048 FrameViewBase* oldFrameViewBase = | 4049 FrameViewBase* oldFrameViewBase = |
4049 frameViewBaseForElement(*oldFocusedElement); | 4050 frameViewBaseForElement(*oldFocusedElement); |
4050 if (oldFrameViewBase) | 4051 if (oldFrameViewBase) |
4051 oldFrameViewBase->setFocused(false, params.type); | 4052 oldFrameViewBase->setFocused(false, params.type); |
4052 else | 4053 else |
4053 view()->setFocused(false, params.type); | 4054 view()->setFocused(false, params.type); |
4054 } | 4055 } |
4055 } | 4056 } |
4056 | 4057 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4113 goto SetFocusedElementDone; | 4114 goto SetFocusedElementDone; |
4114 } | 4115 } |
4115 } | 4116 } |
4116 | 4117 |
4117 if (isRootEditableElement(*m_focusedElement)) | 4118 if (isRootEditableElement(*m_focusedElement)) |
4118 frame()->spellChecker().didBeginEditing(m_focusedElement.get()); | 4119 frame()->spellChecker().didBeginEditing(m_focusedElement.get()); |
4119 | 4120 |
4120 // eww, I suck. set the qt focus correctly | 4121 // eww, I suck. set the qt focus correctly |
4121 // ### find a better place in the code for this | 4122 // ### find a better place in the code for this |
4122 if (view()) { | 4123 if (view()) { |
4124 // TODO(joelhockey): Do we need special handling for plugins? | |
4123 FrameViewBase* focusFrameViewBase = | 4125 FrameViewBase* focusFrameViewBase = |
4124 frameViewBaseForElement(*m_focusedElement); | 4126 frameViewBaseForElement(*m_focusedElement); |
4125 if (focusFrameViewBase) { | 4127 if (focusFrameViewBase) { |
4126 // Make sure a FrameViewBase has the right size before giving it focus. | 4128 // Make sure a FrameViewBase has the right size before giving it focus. |
4127 // Otherwise, we are testing edge cases of the FrameViewBase code. | 4129 // Otherwise, we are testing edge cases of the FrameViewBase code. |
4128 // Specifically, in WebCore this does not work well for text fields. | 4130 // Specifically, in WebCore this does not work well for text fields. |
4129 updateStyleAndLayout(); | 4131 updateStyleAndLayout(); |
4130 // Re-get the FrameViewBase in case updating the layout changed things. | 4132 // Re-get the FrameViewBase in case updating the layout changed things. |
4131 focusFrameViewBase = frameViewBaseForElement(*m_focusedElement); | 4133 focusFrameViewBase = frameViewBaseForElement(*m_focusedElement); |
4132 } | 4134 } |
(...skipping 2521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6654 } | 6656 } |
6655 | 6657 |
6656 void showLiveDocumentInstances() { | 6658 void showLiveDocumentInstances() { |
6657 WeakDocumentSet& set = liveDocumentSet(); | 6659 WeakDocumentSet& set = liveDocumentSet(); |
6658 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 6660 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
6659 for (blink::Document* document : set) | 6661 for (blink::Document* document : set) |
6660 fprintf(stderr, "- Document %p URL: %s\n", document, | 6662 fprintf(stderr, "- Document %p URL: %s\n", document, |
6661 document->url().getString().utf8().data()); | 6663 document->url().getString().utf8().data()); |
6662 } | 6664 } |
6663 #endif | 6665 #endif |
OLD | NEW |