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

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

Issue 315493004: reset VisibleSelection at the Undo command. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 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
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 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 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 for (unsigned i = 0; container && i < offset; i++) 541 for (unsigned i = 0; container && i < offset; i++)
542 container = container->nextSibling(); 542 container = container->nextSibling();
543 } else { 543 } else {
544 while (container->parentNode() != commonRoot) 544 while (container->parentNode() != commonRoot)
545 container = container->parentNode(); 545 container = container->parentNode();
546 } 546 }
547 547
548 return container; 548 return container;
549 } 549 }
550 550
551 static inline unsigned lengthOfContentsInNode(Node* node) 551 unsigned Range::lengthOfContentsInNode(const Node* node)
Yuta Kitamura 2014/06/05 08:37:55 I don't think this function should be exposed as a
yoichio 2014/06/06 04:49:21 Done.
552 { 552 {
553 // This switch statement must be consistent with that of Range::processConte ntsBetweenOffsets. 553 // This switch statement must be consistent with that of Range::processConte ntsBetweenOffsets.
554 switch (node->nodeType()) { 554 switch (node->nodeType()) {
555 case Node::TEXT_NODE: 555 case Node::TEXT_NODE:
556 case Node::CDATA_SECTION_NODE: 556 case Node::CDATA_SECTION_NODE:
557 case Node::COMMENT_NODE: 557 case Node::COMMENT_NODE:
558 return toCharacterData(node)->length(); 558 return toCharacterData(node)->length();
559 case Node::PROCESSING_INSTRUCTION_NODE: 559 case Node::PROCESSING_INSTRUCTION_NODE:
560 return toProcessingInstruction(node)->data().length(); 560 return toProcessingInstruction(node)->data().length();
561 case Node::ELEMENT_NODE: 561 case Node::ELEMENT_NODE:
(...skipping 1129 matching lines...) Expand 10 before | Expand all | Expand 10 after
1691 1691
1692 void showTree(const WebCore::Range* range) 1692 void showTree(const WebCore::Range* range)
1693 { 1693 {
1694 if (range && range->boundaryPointsValid()) { 1694 if (range && range->boundaryPointsValid()) {
1695 range->startContainer()->showTreeAndMark(range->startContainer(), "S", r ange->endContainer(), "E"); 1695 range->startContainer()->showTreeAndMark(range->startContainer(), "S", r ange->endContainer(), "E");
1696 fprintf(stderr, "start offset: %d, end offset: %d\n", range->startOffset (), range->endOffset()); 1696 fprintf(stderr, "start offset: %d, end offset: %d\n", range->startOffset (), range->endOffset());
1697 } 1697 }
1698 } 1698 }
1699 1699
1700 #endif 1700 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698