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

Side by Side Diff: third_party/WebKit/Source/core/dom/Range.cpp

Issue 2426513002: Prune createVisiblePositionDeprecated (Closed)
Patch Set: Created 4 years, 2 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 | « no previous file | third_party/WebKit/Source/core/editing/FrameCaret.cpp » ('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 * (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 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
7 * rights reserved. 7 * rights reserved.
8 * Copyright (C) 2011 Motorola Mobility. All rights reserved. 8 * Copyright (C) 2011 Motorola Mobility. All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 1590 matching lines...) Expand 10 before | Expand all | Expand 10 after
1601 DCHECK_EQ(oldNode.document(), m_ownerDocument); 1601 DCHECK_EQ(oldNode.document(), m_ownerDocument);
1602 DCHECK(oldNode.parentNode()); 1602 DCHECK(oldNode.parentNode());
1603 DCHECK(oldNode.nextSibling()); 1603 DCHECK(oldNode.nextSibling());
1604 DCHECK(oldNode.nextSibling()->isTextNode()); 1604 DCHECK(oldNode.nextSibling()->isTextNode());
1605 boundaryTextNodeSplit(m_start, oldNode); 1605 boundaryTextNodeSplit(m_start, oldNode);
1606 boundaryTextNodeSplit(m_end, oldNode); 1606 boundaryTextNodeSplit(m_end, oldNode);
1607 DCHECK(boundaryPointsValid()); 1607 DCHECK(boundaryPointsValid());
1608 } 1608 }
1609 1609
1610 void Range::expand(const String& unit, ExceptionState& exceptionState) { 1610 void Range::expand(const String& unit, ExceptionState& exceptionState) {
1611 VisiblePosition start = createVisiblePositionDeprecated(startPosition()); 1611 m_ownerDocument->updateStyleAndLayoutIgnorePendingStylesheets();
1612 VisiblePosition end = createVisiblePositionDeprecated(endPosition()); 1612
1613 VisiblePosition start = createVisiblePosition(startPosition());
1614 VisiblePosition end = createVisiblePosition(endPosition());
1613 if (unit == "word") { 1615 if (unit == "word") {
1614 start = startOfWord(start); 1616 start = startOfWord(start);
1615 end = endOfWord(end); 1617 end = endOfWord(end);
1616 } else if (unit == "sentence") { 1618 } else if (unit == "sentence") {
1617 start = startOfSentence(start); 1619 start = startOfSentence(start);
1618 end = endOfSentence(end); 1620 end = endOfSentence(end);
1619 } else if (unit == "block") { 1621 } else if (unit == "block") {
1620 start = startOfParagraph(start); 1622 start = startOfParagraph(start);
1621 end = endOfParagraph(end); 1623 end = endOfParagraph(end);
1622 } else if (unit == "document") { 1624 } else if (unit == "document") {
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
1727 .data() 1729 .data()
1728 << "start offset: " << range->startOffset() 1730 << "start offset: " << range->startOffset()
1729 << ", end offset: " << range->endOffset(); 1731 << ", end offset: " << range->endOffset();
1730 } else { 1732 } else {
1731 LOG(INFO) << "Cannot show tree if range is null, or if boundary points are " 1733 LOG(INFO) << "Cannot show tree if range is null, or if boundary points are "
1732 "invalid."; 1734 "invalid.";
1733 } 1735 }
1734 } 1736 }
1735 1737
1736 #endif 1738 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/FrameCaret.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698