| 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 783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 794 } | 794 } |
| 795 | 795 |
| 796 // Helper function that tells whether a particular node is an element that has | 796 // Helper function that tells whether a particular node is an element that has |
| 797 // an entire LocalFrame and FrameView, a <frame>, <iframe>, or <object>. | 797 // an entire LocalFrame and FrameView, a <frame>, <iframe>, or <object>. |
| 798 static bool IsFrameElement(const Node* n) { | 798 static bool IsFrameElement(const Node* n) { |
| 799 if (!n) | 799 if (!n) |
| 800 return false; | 800 return false; |
| 801 LayoutObject* layout_object = n->GetLayoutObject(); | 801 LayoutObject* layout_object = n->GetLayoutObject(); |
| 802 if (!layout_object || !layout_object->IsLayoutPart()) | 802 if (!layout_object || !layout_object->IsLayoutPart()) |
| 803 return false; | 803 return false; |
| 804 FrameViewBase* frame_view_base = | 804 return ToLayoutPart(layout_object)->GetNodeFrameView(); |
| 805 ToLayoutPart(layout_object)->GetFrameViewBase(); | |
| 806 return frame_view_base && frame_view_base->IsFrameView(); | |
| 807 } | 805 } |
| 808 | 806 |
| 809 void FrameSelection::SetFocusedNodeIfNeeded() { | 807 void FrameSelection::SetFocusedNodeIfNeeded() { |
| 810 if (ComputeVisibleSelectionInDOMTreeDeprecated().IsNone() || !IsFocused()) | 808 if (ComputeVisibleSelectionInDOMTreeDeprecated().IsNone() || !IsFocused()) |
| 811 return; | 809 return; |
| 812 | 810 |
| 813 if (Element* target = | 811 if (Element* target = |
| 814 ComputeVisibleSelectionInDOMTreeDeprecated().RootEditableElement()) { | 812 ComputeVisibleSelectionInDOMTreeDeprecated().RootEditableElement()) { |
| 815 // Walk up the DOM tree to search for a node to focus. | 813 // Walk up the DOM tree to search for a node to focus. |
| 816 GetDocument().UpdateStyleAndLayoutTreeIgnorePendingStylesheets(); | 814 GetDocument().UpdateStyleAndLayoutTreeIgnorePendingStylesheets(); |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1156 } | 1154 } |
| 1157 | 1155 |
| 1158 void showTree(const blink::FrameSelection* sel) { | 1156 void showTree(const blink::FrameSelection* sel) { |
| 1159 if (sel) | 1157 if (sel) |
| 1160 sel->ShowTreeForThis(); | 1158 sel->ShowTreeForThis(); |
| 1161 else | 1159 else |
| 1162 LOG(INFO) << "Cannot showTree for <null> FrameSelection."; | 1160 LOG(INFO) << "Cannot showTree for <null> FrameSelection."; |
| 1163 } | 1161 } |
| 1164 | 1162 |
| 1165 #endif | 1163 #endif |
| OLD | NEW |