Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(180)

Side by Side Diff: third_party/WebKit/Source/core/testing/Internals.cpp

Issue 1675163002: Rename ComposedTree to FlatTree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: wip Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2013 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 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 #include "core/dom/Element.h" 52 #include "core/dom/Element.h"
53 #include "core/dom/ExceptionCode.h" 53 #include "core/dom/ExceptionCode.h"
54 #include "core/dom/Iterator.h" 54 #include "core/dom/Iterator.h"
55 #include "core/dom/NodeComputedStyle.h" 55 #include "core/dom/NodeComputedStyle.h"
56 #include "core/dom/PseudoElement.h" 56 #include "core/dom/PseudoElement.h"
57 #include "core/dom/Range.h" 57 #include "core/dom/Range.h"
58 #include "core/dom/StaticNodeList.h" 58 #include "core/dom/StaticNodeList.h"
59 #include "core/dom/StyleEngine.h" 59 #include "core/dom/StyleEngine.h"
60 #include "core/dom/TreeScope.h" 60 #include "core/dom/TreeScope.h"
61 #include "core/dom/ViewportDescription.h" 61 #include "core/dom/ViewportDescription.h"
62 #include "core/dom/shadow/ComposedTreeTraversal.h"
63 #include "core/dom/shadow/ElementShadow.h" 62 #include "core/dom/shadow/ElementShadow.h"
63 #include "core/dom/shadow/FlatTreeTraversal.h"
64 #include "core/dom/shadow/SelectRuleFeatureSet.h" 64 #include "core/dom/shadow/SelectRuleFeatureSet.h"
65 #include "core/dom/shadow/ShadowRoot.h" 65 #include "core/dom/shadow/ShadowRoot.h"
66 #include "core/editing/Editor.h" 66 #include "core/editing/Editor.h"
67 #include "core/editing/PlainTextRange.h" 67 #include "core/editing/PlainTextRange.h"
68 #include "core/editing/SurroundingText.h" 68 #include "core/editing/SurroundingText.h"
69 #include "core/editing/iterators/TextIterator.h" 69 #include "core/editing/iterators/TextIterator.h"
70 #include "core/editing/markers/DocumentMarker.h" 70 #include "core/editing/markers/DocumentMarker.h"
71 #include "core/editing/markers/DocumentMarkerController.h" 71 #include "core/editing/markers/DocumentMarkerController.h"
72 #include "core/editing/serializers/Serialization.h" 72 #include "core/editing/serializers/Serialization.h"
73 #include "core/editing/spellcheck/SpellCheckRequester.h" 73 #include "core/editing/spellcheck/SpellCheckRequester.h"
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 size_t Internals::countElementShadow(const Node* root, ExceptionState& exception State) const 585 size_t Internals::countElementShadow(const Node* root, ExceptionState& exception State) const
586 { 586 {
587 ASSERT(root); 587 ASSERT(root);
588 if (!root->isShadowRoot()) { 588 if (!root->isShadowRoot()) {
589 exceptionState.throwDOMException(InvalidAccessError, "The node argument is not a shadow root."); 589 exceptionState.throwDOMException(InvalidAccessError, "The node argument is not a shadow root.");
590 return 0; 590 return 0;
591 } 591 }
592 return toShadowRoot(root)->childShadowRootCount(); 592 return toShadowRoot(root)->childShadowRootCount();
593 } 593 }
594 594
595 Node* Internals::nextSiblingInComposedTree(Node* node, ExceptionState& exception State) 595 Node* Internals::nextSiblingInFlatTree(Node* node, ExceptionState& exceptionStat e)
596 { 596 {
597 ASSERT(node); 597 ASSERT(node);
598 if (!node->canParticipateInComposedTree()) { 598 if (!node->canParticipateInFlatTree()) {
599 exceptionState.throwDOMException(InvalidAccessError, "The node argument doesn't particite in the composed tree."); 599 exceptionState.throwDOMException(InvalidAccessError, "The node argument doesn't particite in the flat tree.");
600 return 0; 600 return 0;
601 } 601 }
602 return ComposedTreeTraversal::nextSibling(*node); 602 return FlatTreeTraversal::nextSibling(*node);
603 } 603 }
604 604
605 Node* Internals::firstChildInComposedTree(Node* node, ExceptionState& exceptionS tate) 605 Node* Internals::firstChildInFlatTree(Node* node, ExceptionState& exceptionState )
606 { 606 {
607 ASSERT(node); 607 ASSERT(node);
608 if (!node->canParticipateInComposedTree()) { 608 if (!node->canParticipateInFlatTree()) {
609 exceptionState.throwDOMException(InvalidAccessError, "The node argument doesn't particite in the composed tree"); 609 exceptionState.throwDOMException(InvalidAccessError, "The node argument doesn't particite in the flat tree");
610 return 0; 610 return 0;
611 } 611 }
612 return ComposedTreeTraversal::firstChild(*node); 612 return FlatTreeTraversal::firstChild(*node);
613 } 613 }
614 614
615 Node* Internals::lastChildInComposedTree(Node* node, ExceptionState& exceptionSt ate) 615 Node* Internals::lastChildInFlatTree(Node* node, ExceptionState& exceptionState)
616 { 616 {
617 ASSERT(node); 617 ASSERT(node);
618 if (!node->canParticipateInComposedTree()) { 618 if (!node->canParticipateInFlatTree()) {
619 exceptionState.throwDOMException(InvalidAccessError, "The node argument doesn't particite in the composed tree."); 619 exceptionState.throwDOMException(InvalidAccessError, "The node argument doesn't particite in the flat tree.");
620 return 0; 620 return 0;
621 } 621 }
622 return ComposedTreeTraversal::lastChild(*node); 622 return FlatTreeTraversal::lastChild(*node);
623 } 623 }
624 624
625 Node* Internals::nextInComposedTree(Node* node, ExceptionState& exceptionState) 625 Node* Internals::nextInFlatTree(Node* node, ExceptionState& exceptionState)
626 { 626 {
627 ASSERT(node); 627 ASSERT(node);
628 if (!node->canParticipateInComposedTree()) { 628 if (!node->canParticipateInFlatTree()) {
629 exceptionState.throwDOMException(InvalidAccessError, "The node argument doesn't particite in the composed tree."); 629 exceptionState.throwDOMException(InvalidAccessError, "The node argument doesn't particite in the flat tree.");
630 return 0; 630 return 0;
631 } 631 }
632 return ComposedTreeTraversal::next(*node); 632 return FlatTreeTraversal::next(*node);
633 } 633 }
634 634
635 Node* Internals::previousInComposedTree(Node* node, ExceptionState& exceptionSta te) 635 Node* Internals::previousInFlatTree(Node* node, ExceptionState& exceptionState)
636 { 636 {
637 ASSERT(node); 637 ASSERT(node);
638 if (!node->canParticipateInComposedTree()) { 638 if (!node->canParticipateInFlatTree()) {
639 exceptionState.throwDOMException(InvalidAccessError, "The node argument doesn't particite in the composed tree."); 639 exceptionState.throwDOMException(InvalidAccessError, "The node argument doesn't particite in the flat tree.");
640 return 0; 640 return 0;
641 } 641 }
642 return ComposedTreeTraversal::previous(*node); 642 return FlatTreeTraversal::previous(*node);
643 } 643 }
644 644
645 String Internals::elementLayoutTreeAsText(Element* element, ExceptionState& exce ptionState) 645 String Internals::elementLayoutTreeAsText(Element* element, ExceptionState& exce ptionState)
646 { 646 {
647 ASSERT(element); 647 ASSERT(element);
648 String representation = externalRepresentation(element); 648 String representation = externalRepresentation(element);
649 if (representation.isEmpty()) { 649 if (representation.isEmpty()) {
650 exceptionState.throwDOMException(InvalidAccessError, "The element provid ed has no external representation."); 650 exceptionState.throwDOMException(InvalidAccessError, "The element provid ed has no external representation.");
651 return String(); 651 return String();
652 } 652 }
(...skipping 1907 matching lines...) Expand 10 before | Expand all | Expand 10 after
2560 } 2560 }
2561 2561
2562 int Internals::getScrollAnimationState(Node* node) const 2562 int Internals::getScrollAnimationState(Node* node) const
2563 { 2563 {
2564 if (ScrollableArea* scrollableArea = scrollableAreaForNode(node)) 2564 if (ScrollableArea* scrollableArea = scrollableAreaForNode(node))
2565 return static_cast<int>(scrollableArea->scrollAnimator().m_runState); 2565 return static_cast<int>(scrollableArea->scrollAnimator().m_runState);
2566 return -1; 2566 return -1;
2567 } 2567 }
2568 2568
2569 } // namespace blink 2569 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698