[SCM] WebKit Debian packaging branch, debian/experimental, updated. debian/1.3.8-1-1049-g2e11a8e
rniwa at webkit.org
rniwa at webkit.org
Fri Jan 21 14:39:41 UTC 2011
The following commit has been merged in the debian/experimental branch:
commit d3928144d903e052e991898726588b7638dbe825
Author: rniwa at webkit.org <rniwa at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Dec 24 02:33:40 2010 +0000
2010-12-23 Ryosuke Niwa <rniwa at webkit.org>
Reviewed by Darin Adler.
queryCommandValue("FormatBlock") does not respect editing boundaries
https://bugs.webkit.org/show_bug.cgi?id=51219
Added test cases to ensure queryCommandValue("FormatBlock") respects editing boundaries.
* editing/execCommand/query-format-block-expected.txt:
* editing/execCommand/script-tests/query-format-block.js:
2010-12-23 Ryosuke Niwa <rniwa at webkit.org>
Reviewed by Darin Adler.
queryCommandValue("FormatBlock") does not respect editing boundaries
https://bugs.webkit.org/show_bug.cgi?id=51219
Fixed the bug by checking the element we found in elementForFormatBlockCommand
does not contain the editable root.
* editing/FormatBlockCommand.cpp:
(WebCore::FormatBlockCommand::elementForFormatBlockCommand):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74603 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 888c24a..08d2e71 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,5 +1,17 @@
2010-12-23 Ryosuke Niwa <rniwa at webkit.org>
+ Reviewed by Darin Adler.
+
+ queryCommandValue("FormatBlock") does not respect editing boundaries
+ https://bugs.webkit.org/show_bug.cgi?id=51219
+
+ Added test cases to ensure queryCommandValue("FormatBlock") respects editing boundaries.
+
+ * editing/execCommand/query-format-block-expected.txt:
+ * editing/execCommand/script-tests/query-format-block.js:
+
+2010-12-23 Ryosuke Niwa <rniwa at webkit.org>
+
Unreviewed Chromium rebaselines for r74593.
* platform/chromium-linux/editing/deleting/smart-delete-001-expected.txt:
diff --git a/LayoutTests/editing/execCommand/query-format-block-expected.txt b/LayoutTests/editing/execCommand/query-format-block-expected.txt
index dab9fd5..450850a 100644
--- a/LayoutTests/editing/execCommand/query-format-block-expected.txt
+++ b/LayoutTests/editing/execCommand/query-format-block-expected.txt
@@ -6,6 +6,10 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
Basic cases
PASS queryCommand('formatBlock') returned "" selecting none of "hello"
PASS queryCommand('formatBlock') returned "" selecting first position of "hello"
+PASS queryCommand('formatBlock') returned "" selecting first position of "<div contenteditable="false"><h1 contenteditable>hello</h1></div>"
+PASS queryCommand('formatBlock') returned "" selecting first position of "<h1 contenteditable="false"><span contenteditable>hello</span></h1>"
+PASS queryCommand('formatBlock') returned "" selecting first position of "<div><h1 contenteditable="false"><span contenteditable>hello</span></h1></div>"
+PASS queryCommand('formatBlock') returned "" selecting first position of "<div><header contenteditable="false"><h1 contenteditable>hello</h1></header></div>"
PASS queryCommand('formatBlock') returned "" selecting first position of "<a>hello</a>"
PASS queryCommand('formatBlock') returned "" selecting first position of "<abbr>hello</abbr>"
PASS queryCommand('formatBlock') returned "" selecting first position of "<acronym>hello</acronym>"
diff --git a/LayoutTests/editing/execCommand/script-tests/query-format-block.js b/LayoutTests/editing/execCommand/script-tests/query-format-block.js
index e9123a1..5adab66 100644
--- a/LayoutTests/editing/execCommand/script-tests/query-format-block.js
+++ b/LayoutTests/editing/execCommand/script-tests/query-format-block.js
@@ -37,6 +37,10 @@ function selectMiddleOfHelloWorld(container) {
debug('Basic cases');
queryFormatBlock(function () {return 'none' }, 'hello', '');
queryFormatBlock(selectFirstPosition, 'hello', '');
+queryFormatBlock(selectFirstPosition, '<div contenteditable="false"><h1 contenteditable>hello</h1></div>', '');
+queryFormatBlock(selectFirstPosition, '<h1 contenteditable="false"><span contenteditable>hello</span></h1>', '');
+queryFormatBlock(selectFirstPosition, '<div><h1 contenteditable="false"><span contenteditable>hello</span></h1></div>', '');
+queryFormatBlock(selectFirstPosition, '<div><header contenteditable="false"><h1 contenteditable>hello</h1></header></div>', '');
queryFormatBlock(selectFirstPosition, '<a>hello</a>', '');
queryFormatBlock(selectFirstPosition, '<abbr>hello</abbr>', '');
queryFormatBlock(selectFirstPosition, '<acronym>hello</acronym>', '');
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 0b39b1e..0058759 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -2,6 +2,19 @@
Reviewed by Darin Adler.
+ queryCommandValue("FormatBlock") does not respect editing boundaries
+ https://bugs.webkit.org/show_bug.cgi?id=51219
+
+ Fixed the bug by checking the element we found in elementForFormatBlockCommand
+ does not contain the editable root.
+
+ * editing/FormatBlockCommand.cpp:
+ (WebCore::FormatBlockCommand::elementForFormatBlockCommand):
+
+2010-12-23 Ryosuke Niwa <rniwa at webkit.org>
+
+ Reviewed by Darin Adler.
+
FormatBlock doesn't preserve typing style but it should
https://bugs.webkit.org/show_bug.cgi?id=51140
diff --git a/WebCore/editing/FormatBlockCommand.cpp b/WebCore/editing/FormatBlockCommand.cpp
index c40eaa0..e43f330 100644
--- a/WebCore/editing/FormatBlockCommand.cpp
+++ b/WebCore/editing/FormatBlockCommand.cpp
@@ -105,6 +105,10 @@ Element* FormatBlockCommand::elementForFormatBlockCommand(Range* range)
if (!commonAncestor)
return 0;
+ Element* rootEditableElement = range->startContainer()->rootEditableElement();
+ if (!rootEditableElement || commonAncestor->contains(rootEditableElement))
+ return 0;
+
ASSERT(commonAncestor->isElementNode());
return static_cast<Element*>(commonAncestor);
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list