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

Side by Side Diff: Source/core/editing/htmlediting.h

Issue 1085163002: Introduce EditingAlgorithm<Traversal> class (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-04-15T16:50:42 Rebase for Position.h updates Created 5 years, 8 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 | « Source/core/editing/EditingStrategy.cpp ('k') | Source/core/editing/htmlediting.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 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2006, 2008 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 Element* isFirstPositionAfterTable(const VisiblePosition&); 78 Element* isFirstPositionAfterTable(const VisiblePosition&);
79 79
80 // offset functions on Node 80 // offset functions on Node
81 81
82 int lastOffsetForEditing(const Node*); 82 int lastOffsetForEditing(const Node*);
83 int caretMinOffset(const Node*); 83 int caretMinOffset(const Node*);
84 int caretMaxOffset(const Node*); 84 int caretMaxOffset(const Node*);
85 85
86 // boolean functions on Node 86 // boolean functions on Node
87 87
88 inline bool isEmptyNonEditableNodeInEditable(const Node* node)
89 {
90 return !node->hasChildren() && !node->hasEditableStyle() && node->parentNode () && node->parentNode()->hasEditableStyle();
91 }
92
93 // FIXME: editingIgnoresContent, canHaveChildrenForEditing, and isAtomicNode 88 // FIXME: editingIgnoresContent, canHaveChildrenForEditing, and isAtomicNode
94 // should be renamed to reflect its usage. 89 // should be renamed to reflect its usage.
95 90
96 // Returns true for nodes that either have no content, or have content that is i gnored (skipped over) while editing. 91 // Returns true for nodes that either have no content, or have content that is i gnored (skipped over) while editing.
97 // There are no VisiblePositions inside these nodes. 92 // There are no VisiblePositions inside these nodes.
98 inline bool editingIgnoresContent(const Node* node) 93 inline bool editingIgnoresContent(const Node* node)
99 { 94 {
100 return !node->canContainRangeEndPoint() || isEmptyNonEditableNodeInEditable( node); 95 return EditingStrategy::editingIgnoresContent(node);
101 } 96 }
102 97
103 inline bool canHaveChildrenForEditing(const Node* node) 98 inline bool canHaveChildrenForEditing(const Node* node)
104 { 99 {
105 return !node->isTextNode() && node->canContainRangeEndPoint(); 100 return !node->isTextNode() && node->canContainRangeEndPoint();
106 } 101 }
107 102
108 bool isAtomicNode(const Node*); 103 bool isAtomicNode(const Node*);
109 bool isBlock(const Node*); 104 bool isBlock(const Node*);
110 bool isInline(const Node*); 105 bool isInline(const Node*);
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 // FIXME: this is required until 6853027 is fixed and text checking can do t his for us. 253 // FIXME: this is required until 6853027 is fixed and text checking can do t his for us.
259 return character == '\'' || character == rightSingleQuotationMark || charact er == hebrewPunctuationGershayim; 254 return character == '\'' || character == rightSingleQuotationMark || charact er == hebrewPunctuationGershayim;
260 } 255 }
261 256
262 String stringWithRebalancedWhitespace(const String&, bool startIsStartOfParagrap h, bool endIsEndOfParagraph); 257 String stringWithRebalancedWhitespace(const String&, bool startIsStartOfParagrap h, bool endIsEndOfParagraph);
263 const String& nonBreakingSpaceString(); 258 const String& nonBreakingSpaceString();
264 259
265 } 260 }
266 261
267 #endif 262 #endif
OLDNEW
« no previous file with comments | « Source/core/editing/EditingStrategy.cpp ('k') | Source/core/editing/htmlediting.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698