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

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

Issue 1309903003: Introduce composed tree version of enclosingNodeOfType() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-26T13:10:19 Created 5 years, 4 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 | Source/core/editing/EditingUtilities.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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 Element* lowestEditableAncestor(Node*); 71 Element* lowestEditableAncestor(Node*);
72 72
73 Element* enclosingBlock(Node*, EditingBoundaryCrossingRule = CannotCrossEditingB oundary); 73 Element* enclosingBlock(Node*, EditingBoundaryCrossingRule = CannotCrossEditingB oundary);
74 Element* enclosingBlockFlowElement(Node&); // Deprecated, use enclosingBlock ins tead. 74 Element* enclosingBlockFlowElement(Node&); // Deprecated, use enclosingBlock ins tead.
75 bool inSameContainingBlockFlowElement(Node*, Node*); 75 bool inSameContainingBlockFlowElement(Node*, Node*);
76 Element* enclosingTableCell(const Position&); 76 Element* enclosingTableCell(const Position&);
77 Element* associatedElementOf(const Position&); 77 Element* associatedElementOf(const Position&);
78 Node* enclosingEmptyListItem(const VisiblePosition&); 78 Node* enclosingEmptyListItem(const VisiblePosition&);
79 Element* enclosingAnchorElement(const Position&); 79 Element* enclosingAnchorElement(const Position&);
80 Element* enclosingElementWithTag(const Position&, const QualifiedName&); 80 Element* enclosingElementWithTag(const Position&, const QualifiedName&);
81 Node* enclosingNodeOfType(const Position&, bool (*nodeIsOfType)(const Node*), Ed itingBoundaryCrossingRule = CannotCrossEditingBoundary); 81 CORE_EXPORT Node* enclosingNodeOfType(const Position&, bool (*nodeIsOfType)(cons t Node*), EditingBoundaryCrossingRule = CannotCrossEditingBoundary);
82 CORE_EXPORT Node* enclosingNodeOfType(const PositionInComposedTree&, bool (*node IsOfType)(const Node*), EditingBoundaryCrossingRule = CannotCrossEditingBoundary );
82 83
83 HTMLSpanElement* tabSpanElement(const Node*); 84 HTMLSpanElement* tabSpanElement(const Node*);
84 Element* isLastPositionBeforeTable(const VisiblePosition&); 85 Element* isLastPositionBeforeTable(const VisiblePosition&);
85 Element* isFirstPositionAfterTable(const VisiblePosition&); 86 Element* isFirstPositionAfterTable(const VisiblePosition&);
86 87
87 // Returns the next leaf node or nullptr if there are no more. 88 // Returns the next leaf node or nullptr if there are no more.
88 // Delivers leaf nodes as if the whole DOM tree were a linear chain of its leaf nodes. 89 // Delivers leaf nodes as if the whole DOM tree were a linear chain of its leaf nodes.
89 Node* nextAtomicLeafNode(const Node& start); 90 Node* nextAtomicLeafNode(const Node& start);
90 91
91 // Returns the previous leaf node or nullptr if there are no more. 92 // Returns the previous leaf node or nullptr if there are no more.
(...skipping 29 matching lines...) Expand all
121 { 122 {
122 return EditingStrategy::editingIgnoresContent(node); 123 return EditingStrategy::editingIgnoresContent(node);
123 } 124 }
124 125
125 inline bool canHaveChildrenForEditing(const Node* node) 126 inline bool canHaveChildrenForEditing(const Node* node)
126 { 127 {
127 return !node->isTextNode() && node->canContainRangeEndPoint(); 128 return !node->isTextNode() && node->canContainRangeEndPoint();
128 } 129 }
129 130
130 bool isAtomicNode(const Node*); 131 bool isAtomicNode(const Node*);
131 bool isBlock(const Node*); 132 CORE_EXPORT bool isBlock(const Node*);
hajimehoshi 2015/08/26 04:50:53 Is this a global function? I guess the name isBloc
yosin_UTC9 2015/08/26 04:53:13 Good catch. I'll rename it to another name, e.g. i
hajimehoshi 2015/08/26 04:55:28 isBlockElement would be much better (as long as an
132 bool isInline(const Node*); 133 bool isInline(const Node*);
133 bool isTabHTMLSpanElement(const Node*); 134 bool isTabHTMLSpanElement(const Node*);
134 bool isTabHTMLSpanElementTextNode(const Node*); 135 bool isTabHTMLSpanElementTextNode(const Node*);
135 bool isMailHTMLBlockquoteElement(const Node*); 136 bool isMailHTMLBlockquoteElement(const Node*);
136 bool isRenderedTableElement(const Node*); 137 bool isRenderedTableElement(const Node*);
137 bool isRenderedHTMLTableElement(const Node*); 138 bool isRenderedHTMLTableElement(const Node*);
138 bool isTableCell(const Node*); 139 bool isTableCell(const Node*);
139 bool isEmptyTableCell(const Node*); 140 bool isEmptyTableCell(const Node*);
140 bool isTableStructureNode(const Node*); 141 bool isTableStructureNode(const Node*);
141 bool isHTMLListElement(Node*); 142 bool isHTMLListElement(Node*);
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 // FIXME: this is required until 6853027 is fixed and text checking can do t his for us. 307 // FIXME: this is required until 6853027 is fixed and text checking can do t his for us.
307 return character == '\'' || character == rightSingleQuotationMarkCharacter | | character == hebrewPunctuationGershayimCharacter; 308 return character == '\'' || character == rightSingleQuotationMarkCharacter | | character == hebrewPunctuationGershayimCharacter;
308 } 309 }
309 310
310 String stringWithRebalancedWhitespace(const String&, bool startIsStartOfParagrap h, bool endIsEndOfParagraph); 311 String stringWithRebalancedWhitespace(const String&, bool startIsStartOfParagrap h, bool endIsEndOfParagraph);
311 const String& nonBreakingSpaceString(); 312 const String& nonBreakingSpaceString();
312 313
313 } 314 }
314 315
315 #endif 316 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/core/editing/EditingUtilities.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698