| 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 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 #include "sky/engine/bindings/core/v8/ExceptionState.h" | 28 #include "sky/engine/bindings/core/v8/ExceptionState.h" |
| 29 #include "sky/engine/core/dom/ClientRect.h" | 29 #include "sky/engine/core/dom/ClientRect.h" |
| 30 #include "sky/engine/core/dom/ClientRectList.h" | 30 #include "sky/engine/core/dom/ClientRectList.h" |
| 31 #include "sky/engine/core/dom/DocumentFragment.h" | 31 #include "sky/engine/core/dom/DocumentFragment.h" |
| 32 #include "sky/engine/core/dom/ExceptionCode.h" | 32 #include "sky/engine/core/dom/ExceptionCode.h" |
| 33 #include "sky/engine/core/dom/Node.h" | 33 #include "sky/engine/core/dom/Node.h" |
| 34 #include "sky/engine/core/dom/NodeTraversal.h" | 34 #include "sky/engine/core/dom/NodeTraversal.h" |
| 35 #include "sky/engine/core/dom/NodeWithIndex.h" | 35 #include "sky/engine/core/dom/NodeWithIndex.h" |
| 36 #include "sky/engine/core/dom/Text.h" | 36 #include "sky/engine/core/dom/Text.h" |
| 37 #include "sky/engine/core/editing/markup.h" | |
| 38 #include "sky/engine/core/editing/TextIterator.h" | 37 #include "sky/engine/core/editing/TextIterator.h" |
| 39 #include "sky/engine/core/editing/VisiblePosition.h" | 38 #include "sky/engine/core/editing/VisiblePosition.h" |
| 40 #include "sky/engine/core/editing/VisibleUnits.h" | 39 #include "sky/engine/core/editing/VisibleUnits.h" |
| 41 #include "sky/engine/core/events/ScopedEventQueue.h" | 40 #include "sky/engine/core/events/ScopedEventQueue.h" |
| 42 #include "sky/engine/core/html/HTMLElement.h" | 41 #include "sky/engine/core/html/HTMLElement.h" |
| 43 #include "sky/engine/core/rendering/RenderBoxModelObject.h" | 42 #include "sky/engine/core/rendering/RenderBoxModelObject.h" |
| 44 #include "sky/engine/core/rendering/RenderText.h" | 43 #include "sky/engine/core/rendering/RenderText.h" |
| 45 #include "sky/engine/platform/geometry/FloatQuad.h" | 44 #include "sky/engine/platform/geometry/FloatQuad.h" |
| 46 #include "sky/engine/wtf/RefCountedLeakCounter.h" | 45 #include "sky/engine/wtf/RefCountedLeakCounter.h" |
| 47 #include "sky/engine/wtf/text/CString.h" | 46 #include "sky/engine/wtf/text/CString.h" |
| (...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 901 int length = data.length(); | 900 int length = data.length(); |
| 902 int start = (n == m_start.container()) ? std::min(std::max(0, m_star
t.offset()), length) : 0; | 901 int start = (n == m_start.container()) ? std::min(std::max(0, m_star
t.offset()), length) : 0; |
| 903 int end = (n == m_end.container()) ? std::min(std::max(start, m_end.
offset()), length) : length; | 902 int end = (n == m_end.container()) ? std::min(std::max(start, m_end.
offset()), length) : length; |
| 904 builder.append(data, start, end - start); | 903 builder.append(data, start, end - start); |
| 905 } | 904 } |
| 906 } | 905 } |
| 907 | 906 |
| 908 return builder.toString(); | 907 return builder.toString(); |
| 909 } | 908 } |
| 910 | 909 |
| 911 String Range::toHTML() const | |
| 912 { | |
| 913 return createMarkup(this); | |
| 914 } | |
| 915 | |
| 916 String Range::text() const | 910 String Range::text() const |
| 917 { | 911 { |
| 918 return plainText(this, TextIteratorEmitsObjectReplacementCharacter); | 912 return plainText(this, TextIteratorEmitsObjectReplacementCharacter); |
| 919 } | 913 } |
| 920 | 914 |
| 921 void Range::detach() | 915 void Range::detach() |
| 922 { | 916 { |
| 923 // This is now a no-op as per the DOM specification. | 917 // This is now a no-op as per the DOM specification. |
| 924 } | 918 } |
| 925 | 919 |
| (...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1520 | 1514 |
| 1521 void showTree(const blink::Range* range) | 1515 void showTree(const blink::Range* range) |
| 1522 { | 1516 { |
| 1523 if (range && range->boundaryPointsValid()) { | 1517 if (range && range->boundaryPointsValid()) { |
| 1524 range->startContainer()->showTreeAndMark(range->startContainer(), "S", r
ange->endContainer(), "E"); | 1518 range->startContainer()->showTreeAndMark(range->startContainer(), "S", r
ange->endContainer(), "E"); |
| 1525 fprintf(stderr, "start offset: %d, end offset: %d\n", range->startOffset
(), range->endOffset()); | 1519 fprintf(stderr, "start offset: %d, end offset: %d\n", range->startOffset
(), range->endOffset()); |
| 1526 } | 1520 } |
| 1527 } | 1521 } |
| 1528 | 1522 |
| 1529 #endif | 1523 #endif |
| OLD | NEW |