Commit a6a38496 authored by justing's avatar justing

LayoutTests:

        Reviewed by harrison
        
        Demonstrates bug:
        * editing/execCommand/5190926-expected.checksum: Added.
        * editing/execCommand/5190926-expected.png: Added.
        * editing/execCommand/5190926-expected.txt: Added.
        * editing/execCommand/5190926.html: Added.
        
        Avoided some nesting:
        * editing/execCommand/5142012-2-expected.txt:
        * editing/execCommand/switch-list-type-expected.txt:

WebCore:

        Reviewed by harrison

        <rdar://problem/5190926> 
        Gmail Editor: Crash when removing list style from underlined, multi-item list
        
        The user underlined some text, then created a list.
        The list was placed inside the inline element carrying 
        the underline style, so, that element surrounded the 
        list instead of being at the lowest level (just above 
        text nodes). This kind of markup is more difficult to 
        edit. Filed 5192089 and added a workaround so that we 
        don't produce this kind of markup.

        * editing/InsertListCommand.cpp:
        (WebCore::InsertListCommand::doApply): Avoid inline
        elements when inserting the new list.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@21534 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 69153351
2007-05-17 Justin Garcia <justin.garcia@apple.com>
Reviewed by harrison
Demonstrates bug:
* editing/execCommand/5190926-expected.checksum: Added.
* editing/execCommand/5190926-expected.png: Added.
* editing/execCommand/5190926-expected.txt: Added.
* editing/execCommand/5190926.html: Added.
Avoided some nesting:
* editing/execCommand/5142012-2-expected.txt:
* editing/execCommand/switch-list-type-expected.txt:
2007-05-16 Maciej Stachowiak <mjs@apple.com>
Reviewed by Justin.
......@@ -7,12 +7,10 @@ layer at (0,0) size 800x600
RenderListItem {LI} at (40,0) size 744x18
RenderListMarker at (-17,0) size 7x18: bullet
RenderInline {A} at (0,0) size 736x18 [color=#0000EE]
RenderInline {SPAN} at (0,0) size 736x18 [color=#000000]
RenderInline {A} at (0,0) size 736x18 [color=#0000EE]
RenderText {#text} at (0,0) size 736x18
text run at (0,0) width 336: "This tests for a crash when creating a list from a link. "
text run at (336,0) width 400: "This paragraph should be a link and should be inside a list item."
RenderText {#text} at (0,0) size 0x0
RenderText {#text} at (0,0) size 736x18
text run at (0,0) width 336: "This tests for a crash when creating a list from a link. "
text run at (336,0) width 400: "This paragraph should be a link and should be inside a list item."
RenderText {#text} at (0,0) size 0x0
RenderBlock (anonymous) at (0,34) size 784x0
selection start: position 0 of child 0 {#text} of child 0 {A} of child 0 {SPAN} of child 0 {A} of child 0 {LI} of child 0 {UL} of child 0 {BODY} of child 0 {HTML} of document
selection end: position 123 of child 0 {#text} of child 0 {A} of child 0 {SPAN} of child 0 {A} of child 0 {LI} of child 0 {UL} of child 0 {BODY} of child 0 {HTML} of document
selection start: position 0 of child 0 {#text} of child 0 {A} of child 0 {LI} of child 0 {UL} of child 0 {BODY} of child 0 {HTML} of document
selection end: position 123 of child 0 {#text} of child 0 {A} of child 0 {LI} of child 0 {UL} of child 0 {BODY} of child 0 {HTML} of document
3d32428be763e57396ab7bf8a0e9e7c9
\ No newline at end of file
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x576
RenderBlock {OL} at (0,0) size 784x54
RenderListItem {LI} at (40,0) size 744x18
RenderListMarker at (-20,0) size 16x18: "1"
RenderInline {SPAN} at (0,0) size 497x18
RenderText {#text} at (0,0) size 497x18
text run at (0,0) width 497: "This tests for a crash when making and removing lists from underlined content."
RenderListItem {LI} at (40,18) size 744x18
RenderListMarker at (-20,0) size 16x18: "2"
RenderInline {SPAN} at (0,0) size 272x18
RenderText {#text} at (0,0) size 272x18
text run at (0,0) width 272: "All three paragraphs should be in list items."
RenderListItem {LI} at (40,36) size 744x18
RenderListMarker at (-20,0) size 16x18: "3"
RenderInline {SPAN} at (0,0) size 222x18
RenderText {#text} at (0,0) size 222x18
text run at (0,0) width 222: "And all three should be underlined."
RenderBlock (anonymous) at (0,70) size 784x0
selection start: position 0 of child 0 {#text} of child 0 {SPAN} of child 0 {LI} of child 0 {OL} of child 1 {BODY} of child 0 {HTML} of document
selection end: position 35 of child 0 {#text} of child 0 {SPAN} of child 2 {LI} of child 0 {OL} of child 1 {BODY} of child 0 {HTML} of document
<head>
<script>
function runTest() {
document.body.focus();
document.execCommand("InsertText", false, "This tests for a crash when making and removing lists from underlined content.");
document.execCommand("InsertParagraph");
document.execCommand("InsertText", false, "All three paragraphs should be in list items.");
document.execCommand("InsertParagraph");
document.execCommand("InsertText", false, "And all three should be underlined.");
document.execCommand("SelectAll");
document.execCommand("Underline");
document.execCommand("InsertOrderedList");
document.execCommand("InsertOrderedList");
document.execCommand("InsertOrderedList");
}
</script>
</head>
<body contenteditable="true" onload="runTest();"></body>
\ No newline at end of file
......@@ -91,4 +91,4 @@ layer at (0,0) size 800x600
RenderText {#text} at (0,0) size 206x18
text run at (0,0) width 206: "This should be in an ordered list."
RenderBlock (anonymous) at (0,350) size 784x0
caret: position 0 of child 0 {#text} of child 0 {LI} of child 11 {OL} of child 2 {DIV} of child 1 {BODY} of child 0 {HTML} of document
caret: position 0 of child 0 {#text} of child 0 {LI} of child 10 {OL} of child 2 {DIV} of child 1 {BODY} of child 0 {HTML} of document
2007-05-17 Justin Garcia <justin.garcia@apple.com>
Reviewed by harrison
<rdar://problem/5190926>
Gmail Editor: Crash when removing list style from underlined, multi-item list
The user underlined some text, then created a list.
The list was placed inside the inline element carrying
the underline style, so, that element surrounded the
list instead of being at the lowest level (just above
text nodes). This kind of markup is more difficult to
edit. Filed 5192089 and added a workaround so that we
don't produce this kind of markup.
* editing/InsertListCommand.cpp:
(WebCore::InsertListCommand::doApply): Avoid inline
elements when inserting the new list.
2007-05-17 David Hyatt <hyatt@apple.com>
Allow redundant attributes with the same name in view source mode.
......@@ -208,7 +208,12 @@ void InsertListCommand::doApply()
end = start;
}
insertNodeAt(listElement.get(), start.deepEquivalent());
// Insert the list at a position visually equivalent to start of the
// paragraph that is being moved into the list.
// Try to avoid inserting it somewhere where it will be surrounded by
// inline ancestors of start, since it is easier for editing to produce
// clean markup when inline elements are pushed down as far as possible.
insertNodeAt(listElement.get(), start.deepEquivalent().upstream());
}
moveParagraph(start, end, VisiblePosition(Position(placeholder.get(), 0)), true);
if (nextList && previousList)
......
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