| 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 if (m_anchorNode) | 114 if (m_anchorNode) |
| 115 DCHECK_GE(offset, 0); | 115 DCHECK_GE(offset, 0); |
| 116 else | 116 else |
| 117 DCHECK_EQ(offset, 0); | 117 DCHECK_EQ(offset, 0); |
| 118 #if DCHECK_IS_ON() | 118 #if DCHECK_IS_ON() |
| 119 DCHECK(canBeAnchorNode<Strategy>(m_anchorNode.get())) << m_anchorNode; | 119 DCHECK(canBeAnchorNode<Strategy>(m_anchorNode.get())) << m_anchorNode; |
| 120 #endif | 120 #endif |
| 121 } | 121 } |
| 122 | 122 |
| 123 template <typename Strategy> | 123 template <typename Strategy> |
| 124 PositionTemplate<Strategy>::PositionTemplate(const Node& anchorNode, int offset) |
| 125 : PositionTemplate(const_cast<Node*>(&anchorNode), offset) {} |
| 126 |
| 127 template <typename Strategy> |
| 124 PositionTemplate<Strategy>::PositionTemplate(const PositionTemplate& other) | 128 PositionTemplate<Strategy>::PositionTemplate(const PositionTemplate& other) |
| 125 : m_anchorNode(other.m_anchorNode), | 129 : m_anchorNode(other.m_anchorNode), |
| 126 m_offset(other.m_offset), | 130 m_offset(other.m_offset), |
| 127 m_anchorType(other.m_anchorType) {} | 131 m_anchorType(other.m_anchorType) {} |
| 128 | 132 |
| 129 // -- | 133 // -- |
| 130 | 134 |
| 131 template <typename Strategy> | 135 template <typename Strategy> |
| 132 Node* PositionTemplate<Strategy>::computeContainerNode() const { | 136 Node* PositionTemplate<Strategy>::computeContainerNode() const { |
| 133 if (!m_anchorNode) | 137 if (!m_anchorNode) |
| (...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 672 } | 676 } |
| 673 | 677 |
| 674 void showTree(const blink::Position* pos) { | 678 void showTree(const blink::Position* pos) { |
| 675 if (pos) | 679 if (pos) |
| 676 pos->showTreeForThis(); | 680 pos->showTreeForThis(); |
| 677 else | 681 else |
| 678 LOG(INFO) << "Cannot showTree for <null>"; | 682 LOG(INFO) << "Cannot showTree for <null>"; |
| 679 } | 683 } |
| 680 | 684 |
| 681 #endif | 685 #endif |
| OLD | NEW |