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

Unified Diff: third_party/WebKit/Source/core/editing/EditingUtilities.cpp

Issue 2804943002: Avoid duplicate functions/code in core/editing: endTag (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/editing/EditingUtilities.cpp
diff --git a/third_party/WebKit/Source/core/editing/EditingUtilities.cpp b/third_party/WebKit/Source/core/editing/EditingUtilities.cpp
index 13539b5bda7fc20fc738591c0044097ff6190ac3..314999c2a87a81600cf54862e74f59e23ec7fd72 100644
--- a/third_party/WebKit/Source/core/editing/EditingUtilities.cpp
+++ b/third_party/WebKit/Source/core/editing/EditingUtilities.cpp
@@ -1834,6 +1834,13 @@ bool lineBreakExistsAtPosition(const Position& position) {
return offset < textNode->length() && textNode->data()[offset] == '\n';
}
+bool elementCannotHaveEndTag(const Node& node) {
+ if (!node.isHTMLElement())
+ return false;
+
+ return !toHTMLElement(node).shouldSerializeEndTag();
Peter Kasting 2017/04/06 10:03:35 Drive-by: Possibly clearer: return node.isHTMLE
+}
+
// Modifies selections that have an end point at the edge of a table
// that contains the other endpoint so that they don't confuse
// code that iterates over selected paragraphs.

Powered by Google App Engine
This is Rietveld 408576698