| 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 return selectionRoot ? selectionRoot : m_frame->document()->documentElement(
); | 146 return selectionRoot ? selectionRoot : m_frame->document()->documentElement(
); |
| 147 } | 147 } |
| 148 | 148 |
| 149 ContainerNode* FrameSelection::rootEditableElementOrTreeScopeRootNode() const | 149 ContainerNode* FrameSelection::rootEditableElementOrTreeScopeRootNode() const |
| 150 { | 150 { |
| 151 Element* selectionRoot = selection().rootEditableElement(); | 151 Element* selectionRoot = selection().rootEditableElement(); |
| 152 if (selectionRoot) | 152 if (selectionRoot) |
| 153 return selectionRoot; | 153 return selectionRoot; |
| 154 | 154 |
| 155 Node* node = selection().base().computeContainerNode(); | 155 Node* node = selection().base().computeContainerNode(); |
| 156 return node ? &node->treeScope().rootNode() : 0; | 156 return node ? &node->treeScopeOrDocument().rootNode() : 0; |
| 157 } | 157 } |
| 158 | 158 |
| 159 const VisibleSelection& FrameSelection::selection() const | 159 const VisibleSelection& FrameSelection::selection() const |
| 160 { | 160 { |
| 161 return visibleSelection<EditingStrategy>(); | 161 return visibleSelection<EditingStrategy>(); |
| 162 } | 162 } |
| 163 | 163 |
| 164 const VisibleSelectionInFlatTree& FrameSelection::selectionInFlatTree() const | 164 const VisibleSelectionInFlatTree& FrameSelection::selectionInFlatTree() const |
| 165 { | 165 { |
| 166 return visibleSelection<EditingInFlatTreeStrategy>(); | 166 return visibleSelection<EditingInFlatTreeStrategy>(); |
| (...skipping 1252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1419 | 1419 |
| 1420 void showTree(const blink::FrameSelection* sel) | 1420 void showTree(const blink::FrameSelection* sel) |
| 1421 { | 1421 { |
| 1422 if (sel) | 1422 if (sel) |
| 1423 sel->showTreeForThis(); | 1423 sel->showTreeForThis(); |
| 1424 else | 1424 else |
| 1425 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n"); | 1425 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n"); |
| 1426 } | 1426 } |
| 1427 | 1427 |
| 1428 #endif | 1428 #endif |
| OLD | NEW |