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

Side by Side Diff: sky/engine/core/editing/htmlediting.cpp

Issue 772743004: Remove more Node API. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after
749 } 749 }
750 750
751 bool isMailHTMLBlockquoteElement(const Node* node) 751 bool isMailHTMLBlockquoteElement(const Node* node)
752 { 752 {
753 return false; 753 return false;
754 } 754 }
755 755
756 int caretMinOffset(const Node* n) 756 int caretMinOffset(const Node* n)
757 { 757 {
758 RenderObject* r = n->renderer(); 758 RenderObject* r = n->renderer();
759 ASSERT(!n->isCharacterDataNode() || !r || r->isText()); // FIXME: This was a runtime check that seemingly couldn't fail; changed it to an assertion for now. 759 ASSERT(!n->isTextNode() || !r || r->isText()); // FIXME: This was a runtime check that seemingly couldn't fail; changed it to an assertion for now.
760 return r ? r->caretMinOffset() : 0; 760 return r ? r->caretMinOffset() : 0;
761 } 761 }
762 762
763 // If a node can contain candidates for VisiblePositions, return the offset of t he last candidate, otherwise 763 // If a node can contain candidates for VisiblePositions, return the offset of t he last candidate, otherwise
764 // return the number of children for container nodes and the length for unrender ed text nodes. 764 // return the number of children for container nodes and the length for unrender ed text nodes.
765 int caretMaxOffset(const Node* n) 765 int caretMaxOffset(const Node* n)
766 { 766 {
767 // For rendered text nodes, return the last position that a caret could occu py. 767 // For rendered text nodes, return the last position that a caret could occu py.
768 if (n->isTextNode() && n->renderer()) 768 if (n->isTextNode() && n->renderer())
769 return n->renderer()->caretMaxOffset(); 769 return n->renderer()->caretMaxOffset();
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
926 // if the selection starts just before a paragraph break, skip over it 926 // if the selection starts just before a paragraph break, skip over it
927 if (isEndOfParagraph(visiblePosition)) 927 if (isEndOfParagraph(visiblePosition))
928 return visiblePosition.next().deepEquivalent().downstream(); 928 return visiblePosition.next().deepEquivalent().downstream();
929 929
930 // otherwise, make sure to be at the start of the first selected node, 930 // otherwise, make sure to be at the start of the first selected node,
931 // instead of possibly at the end of the last node before the selection 931 // instead of possibly at the end of the last node before the selection
932 return visiblePosition.deepEquivalent().downstream(); 932 return visiblePosition.deepEquivalent().downstream();
933 } 933 }
934 934
935 } // namespace blink 935 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/editing/DeleteSelectionCommand.cpp ('k') | sky/engine/core/events/EventDispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698