| 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 737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 748 if (!n || !n->isDocumentNode()) | 748 if (!n || !n->isDocumentNode()) |
| 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().deprecatedEditingOffset()
<< " of " << nodePositionAsStringForTesting(selection.start().deprecatedNode()); | 758 ts << "caret: position " << selection.start().deprecatedEditingOffset()
<< " of " << nodePositionAsStringForTesting(selection.start().anchorNode()); |
| 759 if (selection.affinity() == UPSTREAM) | 759 if (selection.affinity() == 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().deprecatedEditin
gOffset() << " of " << nodePositionAsStringForTesting(selection.start().deprecat
edNode()) << "\n" | 763 ts << "selection start: position " << selection.start().deprecatedEditin
gOffset() << " of " << nodePositionAsStringForTesting(selection.start().anchorNo
de()) << "\n" |
| 764 << "selection end: position " << selection.end().deprecatedEditing
Offset() << " of " << nodePositionAsStringForTesting(selection.end().deprecatedN
ode()) << "\n"; | 764 << "selection end: position " << selection.end().deprecatedEditing
Offset() << " 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 { |
| 770 TextStream ts; | 770 TextStream ts; |
| 771 if (!layoutObject->hasLayer()) | 771 if (!layoutObject->hasLayer()) |
| 772 return ts.release(); | 772 return ts.release(); |
| 773 | 773 |
| 774 DeprecatedPaintLayer* layer = layoutObject->layer(); | 774 DeprecatedPaintLayer* layer = layoutObject->layer(); |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| OLD | NEW |