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

Side by Side Diff: Source/core/layout/LayoutTreeAsText.cpp

Issue 1299873002: ALL-IN-ONE Introduce enum class TextAffinity (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-19T18:08:52 Created 5 years, 4 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
« no previous file with comments | « Source/core/layout/LayoutText.cpp ('k') | Source/core/layout/PendingSelection.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 738 matching lines...) Expand 10 before | Expand all | Expand 10 after
749 return; 749 return;
750 750
751 Document* doc = toDocument(n); 751 Document* doc = toDocument(n);
752 LocalFrame* frame = doc->frame(); 752 LocalFrame* frame = doc->frame();
753 if (!frame) 753 if (!frame)
754 return; 754 return;
755 755
756 VisibleSelection selection = frame->selection().selection(); 756 VisibleSelection selection = frame->selection().selection();
757 if (selection.isCaret()) { 757 if (selection.isCaret()) {
758 ts << "caret: position " << selection.start().computeEditingOffset() << " of " << nodePositionAsStringForTesting(selection.start().anchorNode()); 758 ts << "caret: position " << selection.start().computeEditingOffset() << " of " << nodePositionAsStringForTesting(selection.start().anchorNode());
759 if (selection.affinity() == UPSTREAM) 759 if (selection.affinity() == TextAffinity::Upstream)
760 ts << " (upstream affinity)"; 760 ts << " (upstream affinity)";
761 ts << "\n"; 761 ts << "\n";
762 } else if (selection.isRange()) { 762 } else if (selection.isRange()) {
763 ts << "selection start: position " << selection.start().computeEditingOf fset() << " of " << nodePositionAsStringForTesting(selection.start().anchorNode( )) << "\n" 763 ts << "selection start: position " << selection.start().computeEditingOf fset() << " of " << nodePositionAsStringForTesting(selection.start().anchorNode( )) << "\n"
764 << "selection end: position " << selection.end().computeEditingOff set() << " of " << nodePositionAsStringForTesting(selection.end().anchorNode()) << "\n"; 764 << "selection end: position " << selection.end().computeEditingOff set() << " of " << nodePositionAsStringForTesting(selection.end().anchorNode()) << "\n";
765 } 765 }
766 } 766 }
767 767
768 static String externalRepresentation(LayoutBox* layoutObject, LayoutAsTextBehavi or behavior) 768 static String externalRepresentation(LayoutBox* layoutObject, LayoutAsTextBehavi or behavior)
769 { 769 {
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
842 element->document().updateLayout(); 842 element->document().updateLayout();
843 843
844 LayoutObject* layoutObject = element->layoutObject(); 844 LayoutObject* layoutObject = element->layoutObject();
845 if (!layoutObject || !layoutObject->isListItem()) 845 if (!layoutObject || !layoutObject->isListItem())
846 return String(); 846 return String();
847 847
848 return toLayoutListItem(layoutObject)->markerText(); 848 return toLayoutListItem(layoutObject)->markerText();
849 } 849 }
850 850
851 } // namespace blink 851 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutText.cpp ('k') | Source/core/layout/PendingSelection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698