diff options
Diffstat (limited to 'Source/WebCore/editing/FormatBlockCommand.cpp')
-rw-r--r-- | Source/WebCore/editing/FormatBlockCommand.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Source/WebCore/editing/FormatBlockCommand.cpp b/Source/WebCore/editing/FormatBlockCommand.cpp index e43f330..58157af 100644 --- a/Source/WebCore/editing/FormatBlockCommand.cpp +++ b/Source/WebCore/editing/FormatBlockCommand.cpp @@ -67,6 +67,9 @@ void FormatBlockCommand::formatRange(const Position& start, const Position& end, RefPtr<Range> range = Range::create(document(), start, endOfSelection); Element* refNode = enclosingBlockFlowElement(end); Element* root = editableRootForPosition(start); + // Root is null for elements with contenteditable=false. + if (!root) + return; if (isElementForFormatBlock(refNode->tagQName()) && start == startOfBlock(start) && (end == endOfBlock(end) || isNodeVisiblyContainedWithin(refNode, range.get())) && refNode != root && !root->isDescendantOf(refNode)) { |