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

Unified Diff: Source/core/editing/htmlediting.cpp

Issue 416393005: Move Node::isBlockFlowElement() to htmlediting.h (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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
« no previous file with comments | « Source/core/editing/htmlediting.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/htmlediting.cpp
diff --git a/Source/core/editing/htmlediting.cpp b/Source/core/editing/htmlediting.cpp
index 08fecaa38404e3b71bcc208e5a2df6077399a8d5..bd9eef7e1f8b471f9f8b92270ccbc05ac8cb231a 100644
--- a/Source/core/editing/htmlediting.cpp
+++ b/Source/core/editing/htmlediting.cpp
@@ -336,11 +336,11 @@ Element* enclosingBlock(Node* node, EditingBoundaryCrossingRule rule)
Element* enclosingBlockFlowElement(Node& node)
{
- if (node.isBlockFlowElement())
+ if (isBlockFlowElement(node))
return &toElement(node);
for (Node* n = node.parentNode(); n; n = n->parentNode()) {
- if (n->isBlockFlowElement() || isHTMLBodyElement(*n))
+ if (isBlockFlowElement(*n) || isHTMLBodyElement(*n))
return toElement(n);
}
return 0;
@@ -1199,6 +1199,12 @@ bool isNonTableCellHTMLBlockElement(const Node* node)
|| element.hasTagName(h5Tag);
}
+bool isBlockFlowElement(const Node& node)
+{
+ RenderObject* renderer = node.renderer();
+ return node.isElementNode() && renderer && renderer->isRenderBlockFlow();
+}
+
Position adjustedSelectionStartForStyleComputation(const VisibleSelection& selection)
{
// This function is used by range style computations to avoid bugs like:
« no previous file with comments | « Source/core/editing/htmlediting.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698