[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198
commit-queue at webkit.org
commit-queue at webkit.org
Mon Feb 21 00:06:24 UTC 2011
The following commit has been merged in the webkit-1.3 branch:
commit c79b7be0d6c7f0ec559c9feb02b2906f3cc0f7d8
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Jan 28 02:41:33 2011 +0000
2011-01-27 Emil A Eklund <eae at chromium.org>
Reviewed by Darin Adler.
contentEditable formatBlock crashes on divs with contenteditable="false"
https://bugs.webkit.org/show_bug.cgi?id=53263
Add test for executing a formatBlock command on a selection containing an
element with contenteditable=false.
* editing/execCommand/format-block-contenteditable-false-expected.txt: Added.
* editing/execCommand/format-block-contenteditable-false.html: Added.
2011-01-27 Emil A Eklund <eae at chromium.org>
Reviewed by Darin Adler.
contentEditable formatBlock crashes on divs with contenteditable="false"
https://bugs.webkit.org/show_bug.cgi?id=53263
Check if editableRootForPosition returns null for position.
Test: editing/execCommand/format-block-contenteditable-false.html
* editing/FormatBlockCommand.cpp:
(WebCore::FormatBlockCommand::formatRange):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76903 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 6a0b894..cda1085 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,16 @@
+2011-01-27 Emil A Eklund <eae at chromium.org>
+
+ Reviewed by Darin Adler.
+
+ contentEditable formatBlock crashes on divs with contenteditable="false"
+ https://bugs.webkit.org/show_bug.cgi?id=53263
+
+ Add test for executing a formatBlock command on a selection containing an
+ element with contenteditable=false.
+
+ * editing/execCommand/format-block-contenteditable-false-expected.txt: Added.
+ * editing/execCommand/format-block-contenteditable-false.html: Added.
+
2011-01-27 Kenneth Russell <kbr at google.com>
Reviewed by James Robinson.
diff --git a/LayoutTests/editing/execCommand/format-block-contenteditable-false-expected.txt b/LayoutTests/editing/execCommand/format-block-contenteditable-false-expected.txt
new file mode 100644
index 0000000..ea1147d
--- /dev/null
+++ b/LayoutTests/editing/execCommand/format-block-contenteditable-false-expected.txt
@@ -0,0 +1,16 @@
+formatblock on selection with a contenteditable="false" child.
+| <h1>
+| <i>
+| "
+ <#selection-anchor>Will select from here
+ "
+| <br>
+| <i>
+| "
+ until here.<#selection-focus>
+ "
+| <div>
+| contenteditable="false"
+| "
+ over this contenteditable=false div
+ "
diff --git a/LayoutTests/editing/execCommand/format-block-contenteditable-false.html b/LayoutTests/editing/execCommand/format-block-contenteditable-false.html
new file mode 100644
index 0000000..deae85a
--- /dev/null
+++ b/LayoutTests/editing/execCommand/format-block-contenteditable-false.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script src="../../resources/dump-as-markup.js"></script>
+</head>
+<body>
+ <div id="editorcontainer" contenteditable="true">
+ Will select from here
+ <div contenteditable="false">
+ over this contenteditable=false div
+ </div>
+ until here.
+ </div>
+</body>
+<script>
+ Markup.description('formatblock on selection with a contenteditable="false" child.');
+
+ var selection = window.getSelection();
+ selection.removeAllRanges();
+
+ var container = document.getElementById('editorcontainer');
+ var range = document.createRange()
+ range.setStartBefore(container.firstChild);
+ range.setEndAfter(container.lastChild);
+ selection.addRange(range);
+
+ document.execCommand('italic', false, "");
+ document.execCommand('formatblock', false, "<h1>");
+
+ Markup.dump(container);
+</script>
+</html>
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index ac66953..61f006e 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,17 @@
+2011-01-27 Emil A Eklund <eae at chromium.org>
+
+ Reviewed by Darin Adler.
+
+ contentEditable formatBlock crashes on divs with contenteditable="false"
+ https://bugs.webkit.org/show_bug.cgi?id=53263
+
+ Check if editableRootForPosition returns null for position.
+
+ Test: editing/execCommand/format-block-contenteditable-false.html
+
+ * editing/FormatBlockCommand.cpp:
+ (WebCore::FormatBlockCommand::formatRange):
+
2011-01-27 Dimitri Glazkov <dglazkov at chromium.org>
Reviewed by Darin Adler.
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)) {
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list