| OLD | NEW |
| 1 /* | 1 /* |
| 2 * (C) 1999 Lars Knoll (knoll@kde.org) | 2 * (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 2000 Gunnstein Lye (gunnstein@netcom.no) | 3 * (C) 2000 Gunnstein Lye (gunnstein@netcom.no) |
| 4 * (C) 2000 Frederik Holljen (frederik.holljen@hig.no) | 4 * (C) 2000 Frederik Holljen (frederik.holljen@hig.no) |
| 5 * (C) 2001 Peter Kelly (pmk@post.com) | 5 * (C) 2001 Peter Kelly (pmk@post.com) |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. |
| 7 * Copyright (C) 2011 Motorola Mobility. All rights reserved. | 7 * Copyright (C) 2011 Motorola Mobility. All rights reserved. |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 982 int length = data.length(); | 982 int length = data.length(); |
| 983 int start = (n == m_start.container()) ? std::min(std::max(0, m_star
t.offset()), length) : 0; | 983 int start = (n == m_start.container()) ? std::min(std::max(0, m_star
t.offset()), length) : 0; |
| 984 int end = (n == m_end.container()) ? std::min(std::max(start, m_end.
offset()), length) : length; | 984 int end = (n == m_end.container()) ? std::min(std::max(start, m_end.
offset()), length) : length; |
| 985 builder.append(data, start, end - start); | 985 builder.append(data, start, end - start); |
| 986 } | 986 } |
| 987 } | 987 } |
| 988 | 988 |
| 989 return builder.toString(); | 989 return builder.toString(); |
| 990 } | 990 } |
| 991 | 991 |
| 992 String Range::toHTML() const | |
| 993 { | |
| 994 return createMarkup(this); | |
| 995 } | |
| 996 | |
| 997 String Range::text() const | 992 String Range::text() const |
| 998 { | 993 { |
| 999 return plainText(this, TextIteratorEmitsObjectReplacementCharacter); | 994 return plainText(this, TextIteratorEmitsObjectReplacementCharacter); |
| 1000 } | 995 } |
| 1001 | 996 |
| 1002 PassRefPtrWillBeRawPtr<DocumentFragment> Range::createContextualFragment(const S
tring& markup, ExceptionState& exceptionState) | 997 PassRefPtrWillBeRawPtr<DocumentFragment> Range::createContextualFragment(const S
tring& markup, ExceptionState& exceptionState) |
| 1003 { | 998 { |
| 1004 // Algorithm: http://domparsing.spec.whatwg.org/#extensions-to-the-range-int
erface | 999 // Algorithm: http://domparsing.spec.whatwg.org/#extensions-to-the-range-int
erface |
| 1005 | 1000 |
| 1006 Node* node = m_start.container(); | 1001 Node* node = m_start.container(); |
| (...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1781 | 1776 |
| 1782 void showTree(const blink::Range* range) | 1777 void showTree(const blink::Range* range) |
| 1783 { | 1778 { |
| 1784 if (range && range->boundaryPointsValid()) { | 1779 if (range && range->boundaryPointsValid()) { |
| 1785 range->startContainer()->showTreeAndMark(range->startContainer(), "S", r
ange->endContainer(), "E"); | 1780 range->startContainer()->showTreeAndMark(range->startContainer(), "S", r
ange->endContainer(), "E"); |
| 1786 fprintf(stderr, "start offset: %d, end offset: %d\n", range->startOffset
(), range->endOffset()); | 1781 fprintf(stderr, "start offset: %d, end offset: %d\n", range->startOffset
(), range->endOffset()); |
| 1787 } | 1782 } |
| 1788 } | 1783 } |
| 1789 | 1784 |
| 1790 #endif | 1785 #endif |
| OLD | NEW |