summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/editing/FormatBlockCommand.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/editing/FormatBlockCommand.cpp')
-rw-r--r--Source/WebCore/editing/FormatBlockCommand.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/Source/WebCore/editing/FormatBlockCommand.cpp b/Source/WebCore/editing/FormatBlockCommand.cpp
index 9d90a1e..759ca31 100644
--- a/Source/WebCore/editing/FormatBlockCommand.cpp
+++ b/Source/WebCore/editing/FormatBlockCommand.cpp
@@ -112,8 +112,7 @@ Element* FormatBlockCommand::elementForFormatBlockCommand(Range* range)
if (!rootEditableElement || commonAncestor->contains(rootEditableElement))
return 0;
- ASSERT(commonAncestor->isElementNode());
- return static_cast<Element*>(commonAncestor);
+ return commonAncestor->isElementNode() ? toElement(commonAncestor) : 0;
}
bool isElementForFormatBlock(const QualifiedName& tagName)
@@ -149,14 +148,14 @@ Node* enclosingBlockToSplitTreeTo(Node* startNode)
{
Node* lastBlock = startNode;
for (Node* n = startNode; n; n = n->parentNode()) {
- if (!n->isContentEditable())
+ if (!n->rendererIsEditable())
return lastBlock;
- if (isTableCell(n) || n->hasTagName(bodyTag) || !n->parentNode() || !n->parentNode()->isContentEditable() || isElementForFormatBlock(n))
+ if (isTableCell(n) || n->hasTagName(bodyTag) || !n->parentNode() || !n->parentNode()->rendererIsEditable() || isElementForFormatBlock(n))
return n;
if (isBlock(n))
lastBlock = n;
if (isListElement(n))
- return n->parentNode()->isContentEditable() ? n->parentNode() : n;
+ return n->parentNode()->rendererIsEditable() ? n->parentNode() : n;
}
return lastBlock;
}