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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
157 #include "core/html/HTMLCollection.h" | 157 #include "core/html/HTMLCollection.h" |
158 #include "core/html/HTMLDialogElement.h" | 158 #include "core/html/HTMLDialogElement.h" |
159 #include "core/html/HTMLDocument.h" | 159 #include "core/html/HTMLDocument.h" |
160 #include "core/html/HTMLFrameOwnerElement.h" | 160 #include "core/html/HTMLFrameOwnerElement.h" |
161 #include "core/html/HTMLHeadElement.h" | 161 #include "core/html/HTMLHeadElement.h" |
162 #include "core/html/HTMLHtmlElement.h" | 162 #include "core/html/HTMLHtmlElement.h" |
163 #include "core/html/HTMLIFrameElement.h" | 163 #include "core/html/HTMLIFrameElement.h" |
164 #include "core/html/HTMLInputElement.h" | 164 #include "core/html/HTMLInputElement.h" |
165 #include "core/html/HTMLLinkElement.h" | 165 #include "core/html/HTMLLinkElement.h" |
166 #include "core/html/HTMLMetaElement.h" | 166 #include "core/html/HTMLMetaElement.h" |
167 #include "core/html/HTMLPlugInElement.h" | |
167 #include "core/html/HTMLScriptElement.h" | 168 #include "core/html/HTMLScriptElement.h" |
168 #include "core/html/HTMLTemplateElement.h" | 169 #include "core/html/HTMLTemplateElement.h" |
169 #include "core/html/HTMLTitleElement.h" | 170 #include "core/html/HTMLTitleElement.h" |
170 #include "core/html/PluginDocument.h" | 171 #include "core/html/PluginDocument.h" |
171 #include "core/html/WindowNameCollection.h" | 172 #include "core/html/WindowNameCollection.h" |
172 #include "core/html/canvas/CanvasContextCreationAttributes.h" | 173 #include "core/html/canvas/CanvasContextCreationAttributes.h" |
173 #include "core/html/canvas/CanvasFontCache.h" | 174 #include "core/html/canvas/CanvasFontCache.h" |
174 #include "core/html/canvas/CanvasRenderingContext.h" | 175 #include "core/html/canvas/CanvasRenderingContext.h" |
175 #include "core/html/forms/FormController.h" | 176 #include "core/html/forms/FormController.h" |
176 #include "core/html/imports/HTMLImportLoader.h" | 177 #include "core/html/imports/HTMLImportLoader.h" |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
360 | 361 |
361 // rule (d) above | 362 // rule (d) above |
362 CharDecompositionType decompType = decompositionType(c); | 363 CharDecompositionType decompType = decompositionType(c); |
363 if (decompType == DecompositionFont || decompType == DecompositionCompat) | 364 if (decompType == DecompositionFont || decompType == DecompositionCompat) |
364 return false; | 365 return false; |
365 | 366 |
366 return true; | 367 return true; |
367 } | 368 } |
368 | 369 |
369 static FrameViewBase* frameViewBaseForElement(const Element& focusedElement) { | 370 static FrameViewBase* frameViewBaseForElement(const Element& focusedElement) { |
371 // Return either plugin or frame. | |
372 // TODO(joelhockey): FrameViewBase class will soon be removed. It will be | |
373 // replaced with Focusable ABC that FrameView and PluginView will implement | |
374 // and this method will return Focusable. | |
375 if (isHTMLPlugInElement(focusedElement)) | |
376 return toHTMLPlugInElement(focusedElement).plugin(); | |
dcheng
2017/04/05 09:12:24
Btw, I would suggest just changing 381 to use plug
joelhockey
2017/04/05 22:10:31
I'll stick with this for right now in the hope of
| |
377 | |
370 LayoutObject* layoutObject = focusedElement.layoutObject(); | 378 LayoutObject* layoutObject = focusedElement.layoutObject(); |
371 if (!layoutObject || !layoutObject->isLayoutPart()) | 379 if (!layoutObject || !layoutObject->isLayoutPart()) |
372 return 0; | 380 return 0; |
373 return toLayoutPart(layoutObject)->frameViewBase(); | 381 return toLayoutPart(layoutObject)->frameViewBase(); |
374 } | 382 } |
375 | 383 |
376 static bool acceptsEditingFocus(const Element& element) { | 384 static bool acceptsEditingFocus(const Element& element) { |
377 DCHECK(hasEditableStyle(element)); | 385 DCHECK(hasEditableStyle(element)); |
378 | 386 |
379 return element.document().frame() && rootEditableElement(element); | 387 return element.document().frame() && rootEditableElement(element); |
(...skipping 6248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6628 } | 6636 } |
6629 | 6637 |
6630 void showLiveDocumentInstances() { | 6638 void showLiveDocumentInstances() { |
6631 WeakDocumentSet& set = liveDocumentSet(); | 6639 WeakDocumentSet& set = liveDocumentSet(); |
6632 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 6640 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
6633 for (blink::Document* document : set) | 6641 for (blink::Document* document : set) |
6634 fprintf(stderr, "- Document %p URL: %s\n", document, | 6642 fprintf(stderr, "- Document %p URL: %s\n", document, |
6635 document->url().getString().utf8().data()); | 6643 document->url().getString().utf8().data()); |
6636 } | 6644 } |
6637 #endif | 6645 #endif |
OLD | NEW |