| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 #include "core/frame/FrameView.h" | 51 #include "core/frame/FrameView.h" |
| 52 #include "core/page/Page.h" | 52 #include "core/page/Page.h" |
| 53 #include "core/frame/Settings.h" | 53 #include "core/frame/Settings.h" |
| 54 #include "core/rendering/HitTestRequest.h" | 54 #include "core/rendering/HitTestRequest.h" |
| 55 #include "core/rendering/HitTestResult.h" | 55 #include "core/rendering/HitTestResult.h" |
| 56 #include "core/rendering/InlineTextBox.h" | 56 #include "core/rendering/InlineTextBox.h" |
| 57 #include "core/rendering/RenderLayer.h" | 57 #include "core/rendering/RenderLayer.h" |
| 58 #include "core/rendering/RenderText.h" | 58 #include "core/rendering/RenderText.h" |
| 59 #include "core/rendering/RenderTheme.h" | 59 #include "core/rendering/RenderTheme.h" |
| 60 #include "core/rendering/RenderView.h" | 60 #include "core/rendering/RenderView.h" |
| 61 #include "core/rendering/RenderWidget.h" | |
| 62 #include "platform/geometry/FloatQuad.h" | 61 #include "platform/geometry/FloatQuad.h" |
| 63 #include "platform/graphics/GraphicsContext.h" | 62 #include "platform/graphics/GraphicsContext.h" |
| 64 #include "wtf/text/CString.h" | 63 #include "wtf/text/CString.h" |
| 65 #include <stdio.h> | 64 #include <stdio.h> |
| 66 | 65 |
| 67 #define EDIT_DEBUG 0 | 66 #define EDIT_DEBUG 0 |
| 68 | 67 |
| 69 namespace blink { | 68 namespace blink { |
| 70 | 69 |
| 71 static inline LayoutUnit NoXPosForVerticalArrowNavigation() | 70 static inline LayoutUnit NoXPosForVerticalArrowNavigation() |
| (...skipping 1461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1533 } | 1532 } |
| 1534 | 1533 |
| 1535 void FrameSelection::notifyRendererOfSelectionChange(EUserTriggered userTriggere
d) | 1534 void FrameSelection::notifyRendererOfSelectionChange(EUserTriggered userTriggere
d) |
| 1536 { | 1535 { |
| 1537 } | 1536 } |
| 1538 | 1537 |
| 1539 // Helper function that tells whether a particular node is an element that has a
n entire | 1538 // Helper function that tells whether a particular node is an element that has a
n entire |
| 1540 // LocalFrame and FrameView, a <frame>, <iframe>, or <object>. | 1539 // LocalFrame and FrameView, a <frame>, <iframe>, or <object>. |
| 1541 static bool isFrameElement(const Node* n) | 1540 static bool isFrameElement(const Node* n) |
| 1542 { | 1541 { |
| 1543 if (!n) | 1542 // FIXME(sky): Remove this. |
| 1544 return false; | 1543 return false; |
| 1545 RenderObject* renderer = n->renderer(); | |
| 1546 if (!renderer || !renderer->isWidget()) | |
| 1547 return false; | |
| 1548 Widget* widget = toRenderWidget(renderer)->widget(); | |
| 1549 return widget && widget->isFrameView(); | |
| 1550 } | 1544 } |
| 1551 | 1545 |
| 1552 void FrameSelection::setFocusedNodeIfNeeded() | 1546 void FrameSelection::setFocusedNodeIfNeeded() |
| 1553 { | 1547 { |
| 1554 if (isNone() || !isFocused()) | 1548 if (isNone() || !isFocused()) |
| 1555 return; | 1549 return; |
| 1556 | 1550 |
| 1557 if (Element* target = rootEditableElement()) { | 1551 if (Element* target = rootEditableElement()) { |
| 1558 // Walk up the DOM tree to search for a node to focus. | 1552 // Walk up the DOM tree to search for a node to focus. |
| 1559 while (target) { | 1553 while (target) { |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1748 sel.showTreeForThis(); | 1742 sel.showTreeForThis(); |
| 1749 } | 1743 } |
| 1750 | 1744 |
| 1751 void showTree(const blink::FrameSelection* sel) | 1745 void showTree(const blink::FrameSelection* sel) |
| 1752 { | 1746 { |
| 1753 if (sel) | 1747 if (sel) |
| 1754 sel->showTreeForThis(); | 1748 sel->showTreeForThis(); |
| 1755 } | 1749 } |
| 1756 | 1750 |
| 1757 #endif | 1751 #endif |
| OLD | NEW |