OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006, 2007 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 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 | 714 |
715 String nodePositionAsStringForTesting(Node* node) | 715 String nodePositionAsStringForTesting(Node* node) |
716 { | 716 { |
717 StringBuilder result; | 717 StringBuilder result; |
718 | 718 |
719 Element* body = node->document().body(); | 719 Element* body = node->document().body(); |
720 Node* parent; | 720 Node* parent; |
721 for (Node* n = node; n; n = parent) { | 721 for (Node* n = node; n; n = parent) { |
722 parent = n->parentOrShadowHostNode(); | 722 parent = n->parentOrShadowHostNode(); |
723 if (n != node) | 723 if (n != node) |
724 result.append(" of "); | 724 result.appendLiteral(" of "); |
725 if (parent) { | 725 if (parent) { |
726 if (body && n == body) { | 726 if (body && n == body) { |
727 // We don't care what offset body may be in the document. | 727 // We don't care what offset body may be in the document. |
728 result.append("body"); | 728 result.appendLiteral("body"); |
729 break; | 729 break; |
730 } | 730 } |
731 if (n->isShadowRoot()) { | 731 if (n->isShadowRoot()) { |
732 result.append('{'); | 732 result.append('{'); |
733 result.append(getTagName(n)); | 733 result.append(getTagName(n)); |
734 result.append('}'); | 734 result.append('}'); |
735 } else { | 735 } else { |
736 result.append("child "); | 736 result.appendLiteral("child "); |
737 result.appendNumber(n->nodeIndex()); | 737 result.appendNumber(n->nodeIndex()); |
738 result.append(" {"); | 738 result.appendLiteral(" {"); |
739 result.append(getTagName(n)); | 739 result.append(getTagName(n)); |
740 result.append('}'); | 740 result.append('}'); |
741 } | 741 } |
742 } else { | 742 } else { |
743 result.append("document"); | 743 result.appendLiteral("document"); |
744 } | 744 } |
745 } | 745 } |
746 | 746 |
747 return result.toString(); | 747 return result.toString(); |
748 } | 748 } |
749 | 749 |
750 static void writeSelection(TextStream& ts, const LayoutObject* o) | 750 static void writeSelection(TextStream& ts, const LayoutObject* o) |
751 { | 751 { |
752 Node* n = o->node(); | 752 Node* n = o->node(); |
753 if (!n || !n->isDocumentNode()) | 753 if (!n || !n->isDocumentNode()) |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
845 element->document().updateStyleAndLayout(); | 845 element->document().updateStyleAndLayout(); |
846 | 846 |
847 LayoutObject* layoutObject = element->layoutObject(); | 847 LayoutObject* layoutObject = element->layoutObject(); |
848 if (!layoutObject || !layoutObject->isListItem()) | 848 if (!layoutObject || !layoutObject->isListItem()) |
849 return String(); | 849 return String(); |
850 | 850 |
851 return toLayoutListItem(layoutObject)->markerText(); | 851 return toLayoutListItem(layoutObject)->markerText(); |
852 } | 852 } |
853 | 853 |
854 } // namespace blink | 854 } // namespace blink |
OLD | NEW |