Commit 064213e0 authored by rniwa@webkit.org's avatar rniwa@webkit.org

2010-09-10 Ryosuke Niwa <rniwa@webkit.org>

        Reviewed by Antonio Gomes.

        REGRESSION(r67176): editing/selection/doubleclick-inline-first-last-contenteditable.html crashes
        https://bugs.webkit.org/show_bug.cgi?id=45525

        The crash was caused by ancestorToRetainStructureAndAppearance not taking into consideration
        the case where there is no common block ancestor. Fixed this by adding a null check.

        Test: editing/pasteboard/copy-without-common-block-crash.html

        * editing/markup.cpp:
        (WebCore::ancestorToRetainStructureAndAppearance): Added a null check.
2010-09-10  Ryosuke Niwa  <rniwa@webkit.org>

        Reviewed by Antonio Gomes.

        REGRESSION(r67176): editing/selection/doubleclick-inline-first-last-contenteditable.html crashes
        https://bugs.webkit.org/show_bug.cgi?id=45525

        Added a test to ensure WebKit does not crash when copying a region that doesn't have any common block ancestor.
        Also removed doubleclick-inline-first-last-contenteditable.html from the qt's skipped list since
        this test should not crash anymore.

        * editing/pasteboard/copy-without-common-block-crash-expected.txt: Added.
        * editing/pasteboard/copy-without-common-block-crash.html: Added.
        * platform/qt/Skipped: Removed doubleclick-inline-first-last-contenteditable.html from the list.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67221 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 35a4a326
2010-09-10 Ryosuke Niwa <rniwa@webkit.org>
Reviewed by Antonio Gomes.
REGRESSION(r67176): editing/selection/doubleclick-inline-first-last-contenteditable.html crashes
https://bugs.webkit.org/show_bug.cgi?id=45525
Added a test to ensure WebKit does not crash when copying a region that doesn't have any common block ancestor.
Also removed doubleclick-inline-first-last-contenteditable.html from the qt's skipped list since
this test should not crash anymore.
* editing/pasteboard/copy-without-common-block-crash-expected.txt: Added.
* editing/pasteboard/copy-without-common-block-crash.html: Added.
* platform/qt/Skipped: Removed doubleclick-inline-first-last-contenteditable.html from the list.
2010-09-10 Adam Roben <aroben@apple.com>
Land new expected results for some tests on Windows
This tests crash when copying a text without a common ancestor block. To manually test, copy "hello" below and WebKit should not crash. On DRT, you should see PASS below.
PASS
<html>
<body>
<p>This tests crash when copying a text without a common ancestor block. To manually test, copy "hello" below and WebKit should not crash. On DRT, you should see PASS below.</p>
<span id="test" contenteditable>hello</span>
<script type="text/javascript">
if (window.layoutTestController)
window.layoutTestController.dumpAsText();
var test = document.getElementById('test');
document.getSelection().selectAllChildren(test);
document.execCommand('copy');
test.innerHTML = 'PASS';
</script>
</body>
</html>
......@@ -5449,6 +5449,3 @@ fullscreen/
# https://bugs.webkit.org/show_bug.cgi?id=45194
fast/text/decomposed-after-stacked-diacritics.html
# https://bugs.webkit.org/show_bug.cgi?id=45525
editing/selection/doubleclick-inline-first-last-contenteditable.html
2010-09-10 Ryosuke Niwa <rniwa@webkit.org>
Reviewed by Antonio Gomes.
REGRESSION(r67176): editing/selection/doubleclick-inline-first-last-contenteditable.html crashes
https://bugs.webkit.org/show_bug.cgi?id=45525
The crash was caused by ancestorToRetainStructureAndAppearance not taking into consideration
the case where there is no common block ancestor. Fixed this by adding a null check.
Test: editing/pasteboard/copy-without-common-block-crash.html
* editing/markup.cpp:
(WebCore::ancestorToRetainStructureAndAppearance): Added a null check.
2010-09-09 Kinuko Yasuda <kinuko@chromium.org>
Reviewed by Dumitru Daniliuc.
......@@ -896,6 +896,9 @@ static Node* ancestorToRetainStructureAndAppearance(Node* commonAncestor)
{
Node* commonAncestorBlock = enclosingBlock(commonAncestor);
if (!commonAncestorBlock)
return 0;
if (commonAncestorBlock->hasTagName(tbodyTag) || commonAncestorBlock->hasTagName(trTag)) {
Node* table = commonAncestorBlock->parentNode();
while (table && !table->hasTagName(tableTag))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment