Changeset 87466 in webkit


Ignore:
Timestamp:
May 26, 2011 9:18:25 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-05-26 Annie Sullivan <sullivan@chromium.org>

Reviewed by Ryosuke Niwa.

Delete table in contentEditable/designMode produces odd contents
https://bugs.webkit.org/show_bug.cgi?id=57148

Add a test for the case given in the bug: deleting an unstyled table
should not leave behind a style span.

Rebaseline tests now that border-collapse, -webkit-border-horizontal-spacing,
and -webkit-border-vertical-spacing style spans are no longer added on
table and table cell deletion, and no longer applied when copying to the
clipboard.

  • editing/deleting/5026848-2-expected.txt:
  • editing/deleting/5026848-3-expected.txt:
  • editing/deleting/5032066-expected.txt:
  • editing/deleting/5115601-expected.txt:
  • editing/deleting/5206311-2-expected.txt:
  • editing/deleting/delete-block-table-expected.txt:
  • editing/deleting/delete-last-char-in-table-expected.txt: Added.
  • editing/deleting/delete-last-char-in-table.html: Added. New test for bug.
  • editing/deleting/delete-select-all-001-expected.txt:
  • editing/pasteboard/data-transfer-items-expected.txt:
  • editing/pasteboard/onpaste-text-html-expected.txt:
  • editing/selection/4895428-1-expected.txt:
  • editing/selection/4895428-4-expected.txt:
  • fast/events/ondrop-text-html-expected.txt:

2011-05-26 Annie Sullivan <sullivan@chromium.org>

Reviewed by Ryosuke Niwa.

Delete table in contentEditable/designMode produces odd contents
https://bugs.webkit.org/show_bug.cgi?id=57148

Removes border-collapse, -webkit-border-horizontal-spacing, and
-webkit-border-vertical-spacing from the list of properties which
should be preserved during edit operations. Also renames this
list to editingInheritableProperties to be more clear about what
the list is for.

Test: editing/deleting/delete-last-char-in-table.html

  • editing/EditingStyle.cpp: Removes border vertical/horizontal spacing from editingStyleProperties.
  • editing/EditingStyle.h: Renames OnlyInheritableProperties to OnlyEditingInheritableProperties.
  • editing/markup.cpp: Renames InheritablePropertiesAndBackgroundColorInEffect.
Location:
trunk
Files:
2 added
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r87465 r87466  
     12011-05-26  Annie Sullivan  <sullivan@chromium.org>
     2
     3        Reviewed by Ryosuke Niwa.
     4
     5        Delete table in contentEditable/designMode produces odd contents
     6        https://bugs.webkit.org/show_bug.cgi?id=57148
     7
     8        Add a test for the case given in the bug: deleting an unstyled table
     9        should not leave behind a style span.
     10
     11        Rebaseline tests now that border-collapse, -webkit-border-horizontal-spacing,
     12        and -webkit-border-vertical-spacing style spans are no longer added on
     13        table and table cell deletion, and no longer applied when copying to the
     14        clipboard.
     15
     16        * editing/deleting/5026848-2-expected.txt:
     17        * editing/deleting/5026848-3-expected.txt:
     18        * editing/deleting/5032066-expected.txt:
     19        * editing/deleting/5115601-expected.txt:
     20        * editing/deleting/5206311-2-expected.txt:
     21        * editing/deleting/delete-block-table-expected.txt:
     22        * editing/deleting/delete-last-char-in-table-expected.txt: Added.
     23        * editing/deleting/delete-last-char-in-table.html: Added. New test for bug.
     24        * editing/deleting/delete-select-all-001-expected.txt:
     25        * editing/pasteboard/data-transfer-items-expected.txt:
     26        * editing/pasteboard/onpaste-text-html-expected.txt:
     27        * editing/selection/4895428-1-expected.txt:
     28        * editing/selection/4895428-4-expected.txt:
     29        * fast/events/ondrop-text-html-expected.txt:
     30
    1312011-05-26  Ryosuke Niwa  <rniwa@webkit.org>
    232
  • trunk/LayoutTests/editing/deleting/5026848-2-expected.txt

    r87132 r87466  
    1717|         contenteditable="true"
    1818|         "Editable <#selection-caret>"
    19 |         <span>
    20 |           class="Apple-style-span"
    21 |           style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "
    22 |           "content"
     19|         "content"
    2320|       "
    2421        "
  • trunk/LayoutTests/editing/deleting/5026848-3-expected.txt

    r87132 r87466  
    1818|         contenteditable="true"
    1919|         "Editable <#selection-caret>"
    20 |         <span>
    21 |           class="Apple-style-span"
    22 |           style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "
    23 |           "content"
     20|         "content"
    2421|       "
    2522        "
  • trunk/LayoutTests/editing/deleting/5032066-expected.txt

    r87264 r87466  
    66|       <td>
    77|         "All the content in this editable region <#selection-caret>"
    8 |         <span>
    9 |           class="Apple-style-span"
    10 |           style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "
    11 |           "should be in one table cell."
     8|         "should be in one table cell."
  • trunk/LayoutTests/editing/deleting/5115601-expected.txt

    r87263 r87466  
    1111|           contenteditable="true"
    1212|           id="start"
    13 |           <span>
    14 |             class="Apple-style-span"
    15 |             style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "
    16 |             "<#selection-caret>This sentence should be inside the editable cell."
     13|           "<#selection-caret>This sentence should be inside the editable cell."
  • trunk/LayoutTests/editing/deleting/5206311-2-expected.txt

    r87262 r87466  
    2525|       <td>
    2626|         class="start"
    27 |         <span>
    28 |           class="Apple-style-span"
    29 |           style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "
    30 |           "<#selection-caret>world!"
     27|         "<#selection-caret>world!"
    3128|         <br>
    3229|       <td>
  • trunk/LayoutTests/editing/deleting/delete-block-table-expected.txt

    r87261 r87466  
    55bar              buffalfter
    66execDeleteCommand: <div>Before</div> <table style="border:3px solid #aaa;"> <tbody><tr> <td> Foo </td> <td> baz </td> </tr> <tr> <td> bar </td> <td> buffalo </td> </tr> </tbody></table> <span id="start">fter</span>
    7 execDeleteCommand: <div>Before</div> <table style="border:3px solid #aaa;"> <tbody><tr> <td> Foo </td> <td> baz </td> </tr> <tr> <td> bar </td> <td> buffalo<span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; ">fter</span></td></tr></tbody></table>
    8 execDeleteCommand: <div>Before</div> <table style="border:3px solid #aaa;"> <tbody><tr> <td> Foo </td> <td> baz </td> </tr> <tr> <td> bar </td> <td> buffal<span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; ">fter</span></td></tr></tbody></table>
     7execDeleteCommand: <div>Before</div> <table style="border:3px solid #aaa;"> <tbody><tr> <td> Foo </td> <td> baz </td> </tr> <tr> <td> bar </td> <td> buffalofter</td></tr></tbody></table>
     8execDeleteCommand: <div>Before</div> <table style="border:3px solid #aaa;"> <tbody><tr> <td> Foo </td> <td> baz </td> </tr> <tr> <td> bar </td> <td> buffalfter</td></tr></tbody></table>
  • trunk/LayoutTests/editing/deleting/delete-select-all-001-expected.txt

    r67170 r87466  
    11
    2 execDeleteCommand: <font class="Apple-style-span" size="3"><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;"><br></span></font>
     2execDeleteCommand: <font class="Apple-style-span" size="3"><br></font>
  • trunk/LayoutTests/editing/pasteboard/data-transfer-items-expected.txt

    r81632 r87466  
    2121copy: items[0] value: Hello World!
    2222copy: items[1] value: <b>Hello World!
    23 paste: items[0] value: <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">This file tests the basic functionality and properties of DataTransferItems. This test requires DRT.</span>
     23paste: items[0] value: <span class="Apple-style-span" style="color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">This file tests the basic functionality and properties of DataTransferItems. This test requires DRT.</span>
    2424paste: items[1] value: This file tests the basic functionality and properties of DataTransferItems. This test requires DRT.
    2525
  • trunk/LayoutTests/editing/pasteboard/onpaste-text-html-expected.txt

    r66589 r87466  
    11CONSOLE MESSAGE: line 21: text/plain: This test verifies that we can get text/html from the clipboard during an onpaste event.
    2 CONSOLE MESSAGE: line 23: text/html: <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0);  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">This test verifies that we can get text/html from the clipboard during an onpaste event.<span class="Apple-converted-space"> </span></span>
     2CONSOLE MESSAGE: line 23: text/html: <span class="Apple-style-span" style="color: rgb(0, 0, 0);  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">This test verifies that we can get text/html from the clipboard during an onpaste event.<span class="Apple-converted-space"> </span></span>
    33This test verifies that we can get text/html from the clipboard during an onpaste event. This test requires DRT.
    44Paste content in this div.This test verifies that we can get text/html from the clipboard during an onpaste event. 
  • trunk/LayoutTests/editing/selection/4895428-1-expected.txt

    r87270 r87466  
    66|   id="source"
    77|   style="border: 1px solid blue;"
    8 |   <span>
    9 |     class="Apple-style-span"
    10 |     style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;"
    11 |     <br>
     8|   <br>
    129| "
    1310"
  • trunk/LayoutTests/editing/selection/4895428-4-expected.txt

    r87270 r87466  
    88|   "
    99"
    10 |   <span>
    11 |     class="Apple-style-span"
    12 |     style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;"
    13 |     <br>
     10|   <br>
    1411|   "
    1512"
  • trunk/LayoutTests/fast/events/ondrop-text-html-expected.txt

    r66589 r87466  
    11CONSOLE MESSAGE: line 21: text/plain: This test verifies that we can get text/html from the drag object during an ondrop event.
    2 CONSOLE MESSAGE: line 23: text/html: <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0);  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">This test verifies that we can get text/html from the drag object during an ondrop event.<span class="Apple-converted-space"> </span></span>
     2CONSOLE MESSAGE: line 23: text/html: <span class="Apple-style-span" style="color: rgb(0, 0, 0);  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">This test verifies that we can get text/html from the drag object during an ondrop event.<span class="Apple-converted-space"> </span></span>
    33This test verifies that we can get text/html from the drag object during an ondrop event. This test requires DRT.
    44PASS
  • trunk/Source/WebCore/ChangeLog

    r87464 r87466  
     12011-05-26  Annie Sullivan  <sullivan@chromium.org>
     2
     3        Reviewed by Ryosuke Niwa.
     4
     5        Delete table in contentEditable/designMode produces odd contents
     6        https://bugs.webkit.org/show_bug.cgi?id=57148
     7
     8        Removes border-collapse, -webkit-border-horizontal-spacing, and
     9        -webkit-border-vertical-spacing from the list of properties which
     10        should be preserved during edit operations. Also renames this
     11        list to editingInheritableProperties to be more clear about what
     12        the list is for.
     13
     14        Test: editing/deleting/delete-last-char-in-table.html
     15
     16        * editing/EditingStyle.cpp: Removes border vertical/horizontal
     17        spacing from editingStyleProperties.
     18        * editing/EditingStyle.h: Renames OnlyInheritableProperties to
     19        OnlyEditingInheritableProperties.
     20        * editing/markup.cpp: Renames InheritablePropertiesAndBackgroundColorInEffect.
     21
    1222011-05-26  Yuta Kitamura  <yutak@chromium.org>
    223
  • trunk/Source/WebCore/editing/EditingStyle.cpp

    r87400 r87466  
    5050// Editing style properties must be preserved during editing operation.
    5151// e.g. when a user inserts a new paragraph, all properties listed here must be copied to the new paragraph.
    52 // FIXME: The current editingStyleProperties contains all inheritableProperties but we may not need to preserve all inheritable properties
    53 static const int editingStyleProperties[] = {
     52static const int editingInheritableProperties[] = {
    5453    // CSS inheritable properties
    55     CSSPropertyBorderCollapse,
    5654    CSSPropertyColor,
    5755    CSSPropertyFontFamily,
     
    6967    CSSPropertyWidows,
    7068    CSSPropertyWordSpacing,
    71     CSSPropertyWebkitBorderHorizontalSpacing,
    72     CSSPropertyWebkitBorderVerticalSpacing,
    7369    CSSPropertyWebkitTextDecorationsInEffect,
    7470    CSSPropertyWebkitTextFillColor,
     
    7773    CSSPropertyWebkitTextStrokeWidth,
    7874};
    79 size_t numEditingStyleProperties = WTF_ARRAY_LENGTH(editingStyleProperties);
     75size_t numEditingInheritableProperties = WTF_ARRAY_LENGTH(editingInheritableProperties);
    8076
    8177static PassRefPtr<CSSMutableStyleDeclaration> copyEditingProperties(CSSStyleDeclaration* style)
    8278{
    83     return style->copyPropertiesInSet(editingStyleProperties, numEditingStyleProperties);
     79    return style->copyPropertiesInSet(editingInheritableProperties, numEditingInheritableProperties);
    8480}
    8581
     
    338334    m_mutableStyle = propertiesToInclude == AllProperties && computedStyleAtPosition ? computedStyleAtPosition->copy() : editingStyleFromComputedStyle(computedStyleAtPosition);
    339335
    340     if (propertiesToInclude == InheritablePropertiesAndBackgroundColorInEffect) {
     336    if (propertiesToInclude == EditingInheritablePropertiesAndBackgroundColorInEffect) {
    341337        if (RefPtr<CSSValue> value = backgroundColorInEffect(node))
    342338            m_mutableStyle->setProperty(CSSPropertyBackgroundColor, value->cssText());
     
    730726    // If this function was modified in the future to delete all redundant properties, then add a boolean value to indicate
    731727    // which one of editingStyleAtPosition or computedStyle is called.
    732     RefPtr<EditingStyle> style = EditingStyle::create(position, InheritablePropertiesAndBackgroundColorInEffect);
     728    RefPtr<EditingStyle> style = EditingStyle::create(position, EditingInheritablePropertiesAndBackgroundColorInEffect);
    733729
    734730    RefPtr<CSSValue> unicodeBidi;
  • trunk/Source/WebCore/editing/EditingStyle.h

    r87400 r87466  
    6060public:
    6161
    62     enum PropertiesToInclude { AllProperties, OnlyInheritableProperties, InheritablePropertiesAndBackgroundColorInEffect };
     62    enum PropertiesToInclude { AllProperties, OnlyEditingInheritableProperties, EditingInheritablePropertiesAndBackgroundColorInEffect };
    6363    enum ShouldPreserveWritingDirection { PreserveWritingDirection, DoNotPreserveWritingDirection };
    6464    enum ShouldExtractMatchingStyle { ExtractMatchingStyle, DoNotExtractMatchingStyle };
     
    7070    }
    7171
    72     static PassRefPtr<EditingStyle> create(Node* node, PropertiesToInclude propertiesToInclude = OnlyInheritableProperties)
     72    static PassRefPtr<EditingStyle> create(Node* node, PropertiesToInclude propertiesToInclude = OnlyEditingInheritableProperties)
    7373    {
    7474        return adoptRef(new EditingStyle(node, propertiesToInclude));
    7575    }
    7676
    77     static PassRefPtr<EditingStyle> create(const Position& position, PropertiesToInclude propertiesToInclude = OnlyInheritableProperties)
     77    static PassRefPtr<EditingStyle> create(const Position& position, PropertiesToInclude propertiesToInclude = OnlyEditingInheritableProperties)
    7878    {
    7979        return adoptRef(new EditingStyle(position, propertiesToInclude));
  • trunk/Source/WebCore/editing/markup.cpp

    r87400 r87466  
    590590    ContainerNode* parentOfLastClosed = lastClosed ? lastClosed->parentNode() : 0;
    591591    if (parentOfLastClosed && parentOfLastClosed->renderer()) {
    592         RefPtr<EditingStyle> style = EditingStyle::create(parentOfLastClosed, EditingStyle::InheritablePropertiesAndBackgroundColorInEffect);
     592        RefPtr<EditingStyle> style = EditingStyle::create(parentOfLastClosed, EditingStyle::EditingInheritablePropertiesAndBackgroundColorInEffect);
    593593
    594594        // Styles that Mail blockquotes contribute should only be placed on the Mail blockquote, to help
Note: See TracChangeset for help on using the changeset viewer.