| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2005, 2006, 2009 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 } | 44 } |
| 45 | 45 |
| 46 template <> | 46 template <> |
| 47 bool canBeAnchorNode<EditingInFlatTreeStrategy>(Node* node) { | 47 bool canBeAnchorNode<EditingInFlatTreeStrategy>(Node* node) { |
| 48 return canBeAnchorNode<EditingStrategy>(node) && | 48 return canBeAnchorNode<EditingStrategy>(node) && |
| 49 node->canParticipateInFlatTree(); | 49 node->canParticipateInFlatTree(); |
| 50 } | 50 } |
| 51 #endif | 51 #endif |
| 52 | 52 |
| 53 template <typename Strategy> | 53 template <typename Strategy> |
| 54 DEFINE_TRACE(PositionTemplate<Strategy>) { |
| 55 visitor->trace(m_anchorNode); |
| 56 } |
| 57 |
| 58 template <typename Strategy> |
| 54 const TreeScope* PositionTemplate<Strategy>::commonAncestorTreeScope( | 59 const TreeScope* PositionTemplate<Strategy>::commonAncestorTreeScope( |
| 55 const PositionTemplate<Strategy>& a, | 60 const PositionTemplate<Strategy>& a, |
| 56 const PositionTemplate<Strategy>& b) { | 61 const PositionTemplate<Strategy>& b) { |
| 57 if (!a.computeContainerNode() || !b.computeContainerNode()) | 62 if (!a.computeContainerNode() || !b.computeContainerNode()) |
| 58 return nullptr; | 63 return nullptr; |
| 59 return a.computeContainerNode()->treeScope().commonAncestorTreeScope( | 64 return a.computeContainerNode()->treeScope().commonAncestorTreeScope( |
| 60 b.computeContainerNode()->treeScope()); | 65 b.computeContainerNode()->treeScope()); |
| 61 } | 66 } |
| 62 | 67 |
| 63 template <typename Strategy> | 68 template <typename Strategy> |
| (...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 672 } | 677 } |
| 673 | 678 |
| 674 void showTree(const blink::Position* pos) { | 679 void showTree(const blink::Position* pos) { |
| 675 if (pos) | 680 if (pos) |
| 676 pos->showTreeForThis(); | 681 pos->showTreeForThis(); |
| 677 else | 682 else |
| 678 LOG(INFO) << "Cannot showTree for <null>"; | 683 LOG(INFO) << "Cannot showTree for <null>"; |
| 679 } | 684 } |
| 680 | 685 |
| 681 #endif | 686 #endif |
| OLD | NEW |