OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. |
3 * Copyright (C) 2008 Nuanti Ltd. | 3 * Copyright (C) 2008 Nuanti Ltd. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 29 matching lines...) Expand all Loading... |
40 #include "core/editing/Editor.h" | 40 #include "core/editing/Editor.h" |
41 #include "core/editing/FrameSelection.h" | 41 #include "core/editing/FrameSelection.h" |
42 #include "core/editing/htmlediting.h" // For firstPositionInOrBeforeNode | 42 #include "core/editing/htmlediting.h" // For firstPositionInOrBeforeNode |
43 #include "core/events/Event.h" | 43 #include "core/events/Event.h" |
44 #include "core/events/ThreadLocalEventNames.h" | 44 #include "core/events/ThreadLocalEventNames.h" |
45 #include "core/frame/DOMWindow.h" | 45 #include "core/frame/DOMWindow.h" |
46 #include "core/frame/FrameView.h" | 46 #include "core/frame/FrameView.h" |
47 #include "core/frame/LocalFrame.h" | 47 #include "core/frame/LocalFrame.h" |
48 #include "core/html/HTMLAreaElement.h" | 48 #include "core/html/HTMLAreaElement.h" |
49 #include "core/html/HTMLImageElement.h" | 49 #include "core/html/HTMLImageElement.h" |
| 50 #include "core/html/HTMLPlugInElement.h" |
50 #include "core/html/HTMLShadowElement.h" | 51 #include "core/html/HTMLShadowElement.h" |
51 #include "core/page/Chrome.h" | 52 #include "core/page/Chrome.h" |
52 #include "core/page/ChromeClient.h" | 53 #include "core/page/ChromeClient.h" |
53 #include "core/page/EventHandler.h" | 54 #include "core/page/EventHandler.h" |
54 #include "core/page/FrameTree.h" | 55 #include "core/page/FrameTree.h" |
55 #include "core/page/Page.h" | 56 #include "core/page/Page.h" |
56 #include "core/frame/Settings.h" | 57 #include "core/frame/Settings.h" |
57 #include "core/page/SpatialNavigation.h" | 58 #include "core/page/SpatialNavigation.h" |
58 #include "core/rendering/HitTestResult.h" | 59 #include "core/rendering/HitTestResult.h" |
59 #include "core/rendering/RenderLayer.h" | 60 #include "core/rendering/RenderLayer.h" |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 | 376 |
376 if (node == document->focusedElement()) | 377 if (node == document->focusedElement()) |
377 // Focus wrapped around to the same node. | 378 // Focus wrapped around to the same node. |
378 return true; | 379 return true; |
379 | 380 |
380 if (!node->isElementNode()) | 381 if (!node->isElementNode()) |
381 // FIXME: May need a way to focus a document here. | 382 // FIXME: May need a way to focus a document here. |
382 return false; | 383 return false; |
383 | 384 |
384 Element* element = toElement(node); | 385 Element* element = toElement(node); |
385 if (element->isFrameOwnerElement() && (!element->isPluginElement() || !eleme
nt->isKeyboardFocusable())) { | 386 if (element->isFrameOwnerElement() && (!isHTMLPlugInElement(*element) || !el
ement->isKeyboardFocusable())) { |
386 // We focus frames rather than frame owners. | 387 // We focus frames rather than frame owners. |
387 // FIXME: We should not focus frames that have no scrollbars, as focusin
g them isn't useful to the user. | 388 // FIXME: We should not focus frames that have no scrollbars, as focusin
g them isn't useful to the user. |
388 HTMLFrameOwnerElement* owner = toHTMLFrameOwnerElement(element); | 389 HTMLFrameOwnerElement* owner = toHTMLFrameOwnerElement(element); |
389 if (!owner->contentFrame()) | 390 if (!owner->contentFrame()) |
390 return false; | 391 return false; |
391 | 392 |
392 document->setFocusedElement(nullptr); | 393 document->setFocusedElement(nullptr); |
393 setFocusedFrame(owner->contentFrame()); | 394 setFocusedFrame(owner->contentFrame()); |
394 return true; | 395 return true; |
395 } | 396 } |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
904 startingRect = nodeRectInAbsoluteCoordinates(container, true /* ignore b
order */); | 905 startingRect = nodeRectInAbsoluteCoordinates(container, true /* ignore b
order */); |
905 container = scrollableEnclosingBoxOrParentFrameForNodeInDirection(type,
container); | 906 container = scrollableEnclosingBoxOrParentFrameForNodeInDirection(type,
container); |
906 if (container && container->isDocumentNode()) | 907 if (container && container->isDocumentNode()) |
907 toDocument(container)->updateLayoutIgnorePendingStylesheets(); | 908 toDocument(container)->updateLayoutIgnorePendingStylesheets(); |
908 } while (!consumed && container); | 909 } while (!consumed && container); |
909 | 910 |
910 return consumed; | 911 return consumed; |
911 } | 912 } |
912 | 913 |
913 } // namespace WebCore | 914 } // namespace WebCore |
OLD | NEW |