| 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 1561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1572 ASSERT(oldNode.parentNode()); | 1572 ASSERT(oldNode.parentNode()); |
| 1573 ASSERT(oldNode.nextSibling()); | 1573 ASSERT(oldNode.nextSibling()); |
| 1574 ASSERT(oldNode.nextSibling()->isTextNode()); | 1574 ASSERT(oldNode.nextSibling()->isTextNode()); |
| 1575 boundaryTextNodeSplit(m_start, oldNode); | 1575 boundaryTextNodeSplit(m_start, oldNode); |
| 1576 boundaryTextNodeSplit(m_end, oldNode); | 1576 boundaryTextNodeSplit(m_end, oldNode); |
| 1577 ASSERT(boundaryPointsValid()); | 1577 ASSERT(boundaryPointsValid()); |
| 1578 } | 1578 } |
| 1579 | 1579 |
| 1580 void Range::expand(const String& unit, ExceptionState& exceptionState) | 1580 void Range::expand(const String& unit, ExceptionState& exceptionState) |
| 1581 { | 1581 { |
| 1582 VisiblePosition start(startPosition()); | 1582 VisiblePosition start = createVisiblePosition(startPosition()); |
| 1583 VisiblePosition end(endPosition()); | 1583 VisiblePosition end = createVisiblePosition(endPosition()); |
| 1584 if (unit == "word") { | 1584 if (unit == "word") { |
| 1585 start = startOfWord(start); | 1585 start = startOfWord(start); |
| 1586 end = endOfWord(end); | 1586 end = endOfWord(end); |
| 1587 } else if (unit == "sentence") { | 1587 } else if (unit == "sentence") { |
| 1588 start = startOfSentence(start); | 1588 start = startOfSentence(start); |
| 1589 end = endOfSentence(end); | 1589 end = endOfSentence(end); |
| 1590 } else if (unit == "block") { | 1590 } else if (unit == "block") { |
| 1591 start = startOfParagraph(start); | 1591 start = startOfParagraph(start); |
| 1592 end = endOfParagraph(end); | 1592 end = endOfParagraph(end); |
| 1593 } else if (unit == "document") { | 1593 } else if (unit == "document") { |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1682 { | 1682 { |
| 1683 if (range && range->boundaryPointsValid()) { | 1683 if (range && range->boundaryPointsValid()) { |
| 1684 range->startContainer()->showTreeAndMark(range->startContainer(), "S", r
ange->endContainer(), "E"); | 1684 range->startContainer()->showTreeAndMark(range->startContainer(), "S", r
ange->endContainer(), "E"); |
| 1685 fprintf(stderr, "start offset: %d, end offset: %d\n", range->startOffset
(), range->endOffset()); | 1685 fprintf(stderr, "start offset: %d, end offset: %d\n", range->startOffset
(), range->endOffset()); |
| 1686 } else { | 1686 } else { |
| 1687 fprintf(stderr, "Cannot show tree if range is null, or if boundary point
s are invalid.\n"); | 1687 fprintf(stderr, "Cannot show tree if range is null, or if boundary point
s are invalid.\n"); |
| 1688 } | 1688 } |
| 1689 } | 1689 } |
| 1690 | 1690 |
| 1691 #endif | 1691 #endif |
| OLD | NEW |