OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All Rights Reserved. | 2 * Copyright (C) 2011 Google Inc. All Rights Reserved. |
3 * Copyright (C) 2012 Apple Inc. All rights reserved. | 3 * Copyright (C) 2012 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 if (child == child1) | 440 if (child == child1) |
441 return Node::kDocumentPositionFollowing; | 441 return Node::kDocumentPositionFollowing; |
442 } | 442 } |
443 | 443 |
444 return Node::kDocumentPositionPreceding; | 444 return Node::kDocumentPositionPreceding; |
445 } | 445 } |
446 } | 446 } |
447 | 447 |
448 // There was no difference between the two parent chains, i.e., one was a | 448 // There was no difference between the two parent chains, i.e., one was a |
449 // subset of the other. The shorter chain is the ancestor. | 449 // subset of the other. The shorter chain is the ancestor. |
450 return index1 < index2 | 450 return index1 < index2 ? Node::kDocumentPositionFollowing | |
451 ? Node::kDocumentPositionFollowing | | 451 Node::kDocumentPositionContainedBy |
452 Node::kDocumentPositionContainedBy | 452 : Node::kDocumentPositionPreceding | |
453 : Node::kDocumentPositionPreceding | | 453 Node::kDocumentPositionContains; |
454 Node::kDocumentPositionContains; | |
455 } | 454 } |
456 | 455 |
457 const TreeScope* TreeScope::commonAncestorTreeScope( | 456 const TreeScope* TreeScope::commonAncestorTreeScope( |
458 const TreeScope& other) const { | 457 const TreeScope& other) const { |
459 HeapVector<Member<const TreeScope>, 16> thisChain; | 458 HeapVector<Member<const TreeScope>, 16> thisChain; |
460 for (const TreeScope* tree = this; tree; tree = tree->parentTreeScope()) | 459 for (const TreeScope* tree = this; tree; tree = tree->parentTreeScope()) |
461 thisChain.push_back(tree); | 460 thisChain.push_back(tree); |
462 | 461 |
463 HeapVector<Member<const TreeScope>, 16> otherChain; | 462 HeapVector<Member<const TreeScope>, 16> otherChain; |
464 for (const TreeScope* tree = &other; tree; tree = tree->parentTreeScope()) | 463 for (const TreeScope* tree = &other; tree; tree = tree->parentTreeScope()) |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 visitor->trace(m_idTargetObserverRegistry); | 528 visitor->trace(m_idTargetObserverRegistry); |
530 visitor->trace(m_selection); | 529 visitor->trace(m_selection); |
531 visitor->trace(m_elementsById); | 530 visitor->trace(m_elementsById); |
532 visitor->trace(m_imageMapsByName); | 531 visitor->trace(m_imageMapsByName); |
533 visitor->trace(m_scopedStyleResolver); | 532 visitor->trace(m_scopedStyleResolver); |
534 visitor->trace(m_radioButtonGroupScope); | 533 visitor->trace(m_radioButtonGroupScope); |
535 visitor->trace(m_svgTreeScopedResources); | 534 visitor->trace(m_svgTreeScopedResources); |
536 } | 535 } |
537 | 536 |
538 } // namespace blink | 537 } // namespace blink |
OLD | NEW |