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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 Node* PositionTemplate<Strategy>::commonAncestorContainer(const PositionTemplate
<Strategy>& other) const | 282 Node* PositionTemplate<Strategy>::commonAncestorContainer(const PositionTemplate
<Strategy>& other) const |
283 { | 283 { |
284 return Strategy::commonAncestor(*computeContainerNode(), *other.computeConta
inerNode()); | 284 return Strategy::commonAncestor(*computeContainerNode(), *other.computeConta
inerNode()); |
285 } | 285 } |
286 | 286 |
287 int comparePositions(const PositionInComposedTree& positionA, const PositionInCo
mposedTree& positionB) | 287 int comparePositions(const PositionInComposedTree& positionA, const PositionInCo
mposedTree& positionB) |
288 { | 288 { |
289 ASSERT(positionA.isNotNull()); | 289 ASSERT(positionA.isNotNull()); |
290 ASSERT(positionB.isNotNull()); | 290 ASSERT(positionB.isNotNull()); |
291 | 291 |
| 292 positionA.anchorNode()->updateDistribution(); |
292 Node* containerA = positionA.computeContainerNode(); | 293 Node* containerA = positionA.computeContainerNode(); |
| 294 positionB.anchorNode()->updateDistribution(); |
293 Node* containerB = positionB.computeContainerNode(); | 295 Node* containerB = positionB.computeContainerNode(); |
294 int offsetA = positionA.computeOffsetInContainerNode(); | 296 int offsetA = positionA.computeOffsetInContainerNode(); |
295 int offsetB = positionB.computeOffsetInContainerNode(); | 297 int offsetB = positionB.computeOffsetInContainerNode(); |
296 return comparePositionsInComposedTree(containerA, offsetA, containerB, offse
tB); | 298 return comparePositionsInComposedTree(containerA, offsetA, containerB, offse
tB); |
297 } | 299 } |
298 | 300 |
299 template <typename Strategy> | 301 template <typename Strategy> |
300 int PositionTemplate<Strategy>::compareTo(const PositionTemplate<Strategy>& othe
r) const | 302 int PositionTemplate<Strategy>::compareTo(const PositionTemplate<Strategy>& othe
r) const |
301 { | 303 { |
302 return comparePositions(*this, other); | 304 return comparePositions(*this, other); |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 | 540 |
539 void showTree(const blink::Position* pos) | 541 void showTree(const blink::Position* pos) |
540 { | 542 { |
541 if (pos) | 543 if (pos) |
542 pos->showTreeForThis(); | 544 pos->showTreeForThis(); |
543 else | 545 else |
544 fprintf(stderr, "Cannot showTree for (nil)\n"); | 546 fprintf(stderr, "Cannot showTree for (nil)\n"); |
545 } | 547 } |
546 | 548 |
547 #endif | 549 #endif |
OLD | NEW |