Changeset 49414 in webkit


Ignore:
Timestamp:
Oct 9, 2009 8:36:51 PM (15 years ago)
Author:
rniwa@webkit.org
Message:

ApplyStyleCommand removes presentational tags even when not necessary
https://bugs.webkit.org/show_bug.cgi?id=28091

Patch by Ryosuke Niwa <rniwa@webkit.org> on 2009-10-09
Reviewed by Eric Seidel.

WebCore:

This patch updates implicitlyStyledElementShouldBeRemovedWhenApplyingStyle to return true
(triggering removal of tag) only if the style implicitly added by the element is not present in
the new style to apply. It also changes surroundNodeRangeWithElement so that it merges the
surrounding element when possible. applyTextDecorationStyle is modified so that it does not add
style span when the style attribute is empty.

Test: editing/execCommand/toggle-style-3.html

  • editing/ApplyStyleCommand.cpp:

(WebCore::ApplyStyleCommand::shouldRemoveTextDecorationTag): Returns true if specified text
decoration is not present in the style to apply
(WebCore::ApplyStyleCommand::implicitlyStyledElementShouldBeRemovedWhenApplyingStyle): No longer
returns true if the tag is used in new style
(WebCore::ApplyStyleCommand::applyTextDecorationStyle): Does not add style-span when redundant
(WebCore::ApplyStyleCommand::surroundNodeRangeWithElement): Merges the newly created element
with the surrounding identical elements

  • editing/ApplyStyleCommand.h:

LayoutTests:

This patch adds test to make sure to preserve presentational tag
(u, s, strike, i, em, sup, sub, b, & strong) when the corresponding style is present in
the final computed style. i.e. avoid removing tag and re-applying the style later

  • editing/execCommand/19653-2-expected.txt: Two b elements are merged.
  • editing/execCommand/createLink-expected.txt: Two anchor elements are merged.
  • editing/execCommand/script-tests/toggle-style-3.js: Added.

(testSingleToggle):

  • editing/execCommand/strikethroughSelection-expected.txt: Redundant style spans are no longer added.
  • editing/execCommand/toggle-style-3-expected.txt: Added.
  • editing/execCommand/toggle-style-3.html: Added.
  • editing/execCommand/unlink-expected.txt: Two anchor elements are merged.
  • platform/mac/editing/style/5228141-expected.txt: Two b elements are merged.
  • platform/mac/editing/style/style-boundary-001-expected.txt: Two b elements are merged.
Location:
trunk
Files:
3 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r49406 r49414  
     12009-10-09  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        ApplyStyleCommand removes presentational tags even when not necessary
     6        https://bugs.webkit.org/show_bug.cgi?id=28091
     7
     8        This patch adds test to make sure to preserve presentational tag
     9        (u, s, strike, i, em, sup, sub, b, & strong) when the corresponding style is present in
     10        the final computed style. i.e. avoid removing tag and re-applying the style later
     11
     12        * editing/execCommand/19653-2-expected.txt: Two b elements are merged.
     13        * editing/execCommand/createLink-expected.txt: Two anchor elements are merged.
     14        * editing/execCommand/script-tests/toggle-style-3.js: Added.
     15        (testSingleToggle):
     16        * editing/execCommand/strikethroughSelection-expected.txt: Redundant style spans are no longer added.
     17        * editing/execCommand/toggle-style-3-expected.txt: Added.
     18        * editing/execCommand/toggle-style-3.html: Added.
     19        * editing/execCommand/unlink-expected.txt: Two anchor elements are merged.
     20        * platform/mac/editing/style/5228141-expected.txt: Two b elements are merged.
     21        * platform/mac/editing/style/style-boundary-001-expected.txt: Two b elements are merged.
     22
    1232009-10-09  Alexey Proskuryakov  <ap@apple.com>
    224
  • trunk/LayoutTests/editing/execCommand/19653-2-expected.txt

    r34681 r49414  
    33
    44This tests splitting two paragraphs with InsertLineBreak while the typing style is bold. New text entered after the split should be bold. The inserted <br> doesn't need to be surrounded by a bold tag here.
    5 x<b><br></b><b>Bold</b>x
     5x<b><br>Bold</b>x
  • trunk/LayoutTests/editing/execCommand/createLink-expected.txt

    r30635 r49414  
    6060<a href="http://www.apple.com/">This</a><a href="http://www.google.com/"> paragraph</a><a href="http://www.apple.com/"> starts out as a link to apple.com. The second word in the paragraph should end up being a link to google.com.</a>
    6161<a href="http://www.apple.com/">This</a><a href="http://www.google.com/"> paragraph</a><a href="http://www.apple.com/"> starts out as a link to apple.com. The second word in the paragraph should end up being a link to google.com.</a>
    62 <p><a href="http://www.google.com/">This </a><i><a href="http://www.google.com/">editable region</a></i><a href="http://www.google.com/"> contains lists, tables, styled text, and images. The entire region should end up being a link to google.com.</a></p> <ul> <li><a href="http://www.google.com/">Item 1</a></li> <li><a href="http://www.google.com/">Item 2</a></li> </ul> <table border="1"><tbody><tr><td><a href="http://www.google.com/">1</a></td><td><a href="http://www.google.com/">2</a></td><td><a href="http://www.google.com/">3</a></td></tr></tbody></table> <a href="http://www.google.com/"><br> This </a><b><a href="http://www.google.com/">line</a></b><a href="http://www.google.com/"> contains </a><a href="http://www.google.com/"><img src="../resources/abe.png"> an image. </a>
     62<p><a href="http://www.google.com/">This </a><i><a href="http://www.google.com/">editable region</a></i><a href="http://www.google.com/"> contains lists, tables, styled text, and images. The entire region should end up being a link to google.com.</a></p> <ul> <li><a href="http://www.google.com/">Item 1</a></li> <li><a href="http://www.google.com/">Item 2</a></li> </ul> <table border="1"><tbody><tr><td><a href="http://www.google.com/">1</a></td><td><a href="http://www.google.com/">2</a></td><td><a href="http://www.google.com/">3</a></td></tr></tbody></table> <a href="http://www.google.com/"><br> This </a><b><a href="http://www.google.com/">line</a></b><a href="http://www.google.com/"> contains <img src="../resources/abe.png"> an image. </a>
  • trunk/LayoutTests/editing/execCommand/strikethroughSelection-expected.txt

    r47640 r49414  
    55execStrikethroughCommand: <span id="test">"The quick brown fox jumps over the lazy dog" uses every letter in the english language. </span>
    66execStrikethroughCommand: <span id="test"><s>"Th</s>e quick brown fox jumps over the lazy dog" uses every letter in the english language. </span>
    7 execStrikethroughCommand: <span id="test">"<span class="Apple-style-span">T</span><span class="Apple-style-span">h</span>e quick brown fox jumps over the lazy dog" uses every letter in the english language. </span>
    8 execStrikethroughCommand: <span id="test"><s>"</s><span class="Apple-style-span"><s>T</s></span><span class="Apple-style-span"><s>h</s></span><s>e </s>quick brown fox jumps over the lazy dog" uses every letter in the english language. </span>
    9 execStrikethroughCommand: <span id="test">"<span class="Apple-style-span">T</span><span class="Apple-style-span">h</span>e quick brown fox jumps over the lazy dog" uses every letter in the english language. </span>
    10 execStrikethroughCommand: <span id="test"><s>"</s><span class="Apple-style-span"><s>T</s></span><span class="Apple-style-span"><s>h</s></span><s>e qu</s>ick brown fox jumps over the lazy dog" uses every letter in the english language. </span>
    11 execStrikethroughCommand: <span id="test">"<span class="Apple-style-span">T</span><span class="Apple-style-span">h</span>e quick brown fox jumps over the lazy dog" uses every letter in the english language. </span>
    12 execStrikethroughCommand: <span id="test"><s>"</s><span class="Apple-style-span"><s>T</s></span><span class="Apple-style-span"><s>h</s></span><s>e quic</s>k brown fox jumps over the lazy dog" uses every letter in the english language. </span>
    13 execStrikethroughCommand: <span id="test">"<span class="Apple-style-span">T</span><span class="Apple-style-span">h</span>e quick brown fox jumps over the lazy dog" uses every letter in the english language. </span>
    14 execStrikethroughCommand: <span id="test"><s>"</s><span class="Apple-style-span"><s>T</s></span><span class="Apple-style-span"><s>h</s></span><s>e quick </s>brown fox jumps over the lazy dog" uses every letter in the english language. </span>
    15 execStrikethroughCommand: <span id="test">"<span class="Apple-style-span">T</span><span class="Apple-style-span">h</span>e quick brown fox jumps over the lazy dog" uses every letter in the english language. </span>
    16 execStrikethroughCommand: <span id="test"><s>"</s><span class="Apple-style-span"><s>T</s></span><span class="Apple-style-span"><s>h</s></span><s>e quick br</s>own fox jumps over the lazy dog" uses every letter in the english language. </span>
    17 execStrikethroughCommand: <span id="test">"<span class="Apple-style-span">T</span><span class="Apple-style-span">h</span>e quick brown fox jumps over the lazy dog" uses every letter in the english language. </span>
    18 execStrikethroughCommand: <span id="test"><s>"</s><span class="Apple-style-span"><s>T</s></span><span class="Apple-style-span"><s>h</s></span><s>e quick brow</s>n fox jumps over the lazy dog" uses every letter in the english language. </span>
    19 execStrikethroughCommand: <span id="test">"<span class="Apple-style-span">T</span><span class="Apple-style-span">h</span>e quick brown fox jumps over the lazy dog" uses every letter in the english language. </span>
    20 execStrikethroughCommand: <span id="test"><s>"</s><span class="Apple-style-span"><s>T</s></span><span class="Apple-style-span"><s>h</s></span><s>e quick brown </s>fox jumps over the lazy dog" uses every letter in the english language. </span>
    21 execStrikethroughCommand: <span id="test">"<span class="Apple-style-span">T</span><span class="Apple-style-span">h</span>e quick brown fox jumps over the lazy dog" uses every letter in the english language. </span>
    22 execStrikethroughCommand: <span id="test"><s>"</s><span class="Apple-style-span"><s>T</s></span><span class="Apple-style-span"><s>h</s></span><s>e quick brown fo</s>x jumps over the lazy dog" uses every letter in the english language. </span>
    23 execStrikethroughCommand: <span id="test">"<span class="Apple-style-span">T</span><span class="Apple-style-span">h</span>e quick brown fox jumps over the lazy dog" uses every letter in the english language. </span>
    24 execStrikethroughCommand: <span id="test"><s>"</s><span class="Apple-style-span"><s>T</s></span><span class="Apple-style-span"><s>h</s></span><s>e quick brown fox </s>jumps over the lazy dog" uses every letter in the english language. </span>
     7execStrikethroughCommand: <span id="test">"The quick brown fox jumps over the lazy dog" uses every letter in the english language. </span>
     8execStrikethroughCommand: <span id="test"><s>"The </s>quick brown fox jumps over the lazy dog" uses every letter in the english language. </span>
     9execStrikethroughCommand: <span id="test">"The quick brown fox jumps over the lazy dog" uses every letter in the english language. </span>
     10execStrikethroughCommand: <span id="test"><s>"The qu</s>ick brown fox jumps over the lazy dog" uses every letter in the english language. </span>
     11execStrikethroughCommand: <span id="test">"The quick brown fox jumps over the lazy dog" uses every letter in the english language. </span>
     12execStrikethroughCommand: <span id="test"><s>"The quic</s>k brown fox jumps over the lazy dog" uses every letter in the english language. </span>
     13execStrikethroughCommand: <span id="test">"The quick brown fox jumps over the lazy dog" uses every letter in the english language. </span>
     14execStrikethroughCommand: <span id="test"><s>"The quick </s>brown fox jumps over the lazy dog" uses every letter in the english language. </span>
     15execStrikethroughCommand: <span id="test">"The quick brown fox jumps over the lazy dog" uses every letter in the english language. </span>
     16execStrikethroughCommand: <span id="test"><s>"The quick br</s>own fox jumps over the lazy dog" uses every letter in the english language. </span>
     17execStrikethroughCommand: <span id="test">"The quick brown fox jumps over the lazy dog" uses every letter in the english language. </span>
     18execStrikethroughCommand: <span id="test"><s>"The quick brow</s>n fox jumps over the lazy dog" uses every letter in the english language. </span>
     19execStrikethroughCommand: <span id="test">"The quick brown fox jumps over the lazy dog" uses every letter in the english language. </span>
     20execStrikethroughCommand: <span id="test"><s>"The quick brown </s>fox jumps over the lazy dog" uses every letter in the english language. </span>
     21execStrikethroughCommand: <span id="test">"The quick brown fox jumps over the lazy dog" uses every letter in the english language. </span>
     22execStrikethroughCommand: <span id="test"><s>"The quick brown fo</s>x jumps over the lazy dog" uses every letter in the english language. </span>
     23execStrikethroughCommand: <span id="test">"The quick brown fox jumps over the lazy dog" uses every letter in the english language. </span>
     24execStrikethroughCommand: <span id="test"><s>"The quick brown fox </s>jumps over the lazy dog" uses every letter in the english language. </span>
  • trunk/LayoutTests/editing/execCommand/unlink-expected.txt

    r30635 r49414  
    6767<a href="http://www.apple.com/">The</a> second<a href="http://www.apple.com/"> word in this paragraph should end up being unlinked, everything else should be a link.</a>
    6868This paragraph starts with <i><a href="http://www.google.com">a</a></i><span id="test3start"> link</span> in the middle. Only the 'a' in the previous sentence should be linked after the test.
    69 <p>This <i>editable region</i> contains lists, tables, styled text, and images. Everything in this region that is not selected should be a link, nothing that is selected should be a link.</p> <ul> <li>Item 1</li> <li>Item 2</li> </ul> <table border="1"><tbody><tr><td>1</td><td>2</td><td><span id="test4end"><a href="http://www.google.com/">3</a></span></td></tr></tbody></table> <a href="http://www.google.com/"><br> This </a><b><a href="http://www.google.com/">line</a></b><a href="http://www.google.com/"> contains </a><a href="http://www.google.com/"><img src="../resources/abe.png"> an image. </a>
     69<p>This <i>editable region</i> contains lists, tables, styled text, and images. Everything in this region that is not selected should be a link, nothing that is selected should be a link.</p> <ul> <li>Item 1</li> <li>Item 2</li> </ul> <table border="1"><tbody><tr><td>1</td><td>2</td><td><span id="test4end"><a href="http://www.google.com/">3</a></span></td></tr></tbody></table> <a href="http://www.google.com/"><br> This </a><b><a href="http://www.google.com/">line</a></b><a href="http://www.google.com/"> contains <img src="../resources/abe.png"> an image. </a>
  • trunk/LayoutTests/platform/mac/editing/style/5228141-expected.txt

    r43215 r49414  
    1212            RenderBR {BR} at (0,0) size 0x18
    1313        RenderBlock {DIV} at (0,18) size 784x107
    14           RenderInline {B} at (0,0) size 166x18
     14          RenderInline {B} at (0,0) size 242x18
    1515            RenderText {#text} at (0,89) size 166x18
    1616              text run at (0,89) width 166: "This text should be bold."
    17           RenderInline {B} at (0,0) size 76x18
    1817            RenderImage {IMG} at (166,0) size 76x103
    1918selection start: position 0 of child 0 {BR} of child 0 {B} of child 2 {DIV} of child 1 {BODY} of child 0 {HTML} of document
    20 selection end:   position 1 of child 0 {IMG} of child 1 {B} of child 1 {DIV} of child 2 {DIV} of child 1 {BODY} of child 0 {HTML} of document
     19selection end:   position 1 of child 1 {IMG} of child 0 {B} of child 1 {DIV} of child 2 {DIV} of child 1 {BODY} of child 0 {HTML} of document
  • trunk/LayoutTests/platform/mac/editing/style/style-boundary-001-expected.txt

    r25970 r49414  
    3232      RenderBlock {DIV} at (0,180) size 784x32
    3333        RenderBlock {DIV} at (0,0) size 784x32 [border: (2px solid #FF0000)]
    34           RenderInline {B} at (0,0) size 12x28
     34          RenderInline {B} at (0,0) size 25x28
    3535            RenderText {#text} at (2,2) size 12x28
    3636              text run at (2,2) width 12: "a"
    37           RenderInline {B} at (0,0) size 13x28
    3837            RenderText {#text} at (14,2) size 13x28
    3938              text run at (14,2) width 13: "b"
    40 selection start: position 0 of child 0 {#text} of child 1 {B} of child 1 {DIV} of child 3 {DIV} of child 1 {BODY} of child 0 {HTML} of document
    41 selection end:   position 1 of child 0 {#text} of child 1 {B} of child 1 {DIV} of child 3 {DIV} of child 1 {BODY} of child 0 {HTML} of document
     39selection start: position 0 of child 1 {#text} of child 0 {B} of child 1 {DIV} of child 3 {DIV} of child 1 {BODY} of child 0 {HTML} of document
     40selection end:   position 1 of child 1 {#text} of child 0 {B} of child 1 {DIV} of child 3 {DIV} of child 1 {BODY} of child 0 {HTML} of document
  • trunk/WebCore/ChangeLog

    r49413 r49414  
     12009-10-09  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        ApplyStyleCommand removes presentational tags even when not necessary
     6        https://bugs.webkit.org/show_bug.cgi?id=28091
     7
     8        This patch updates implicitlyStyledElementShouldBeRemovedWhenApplyingStyle to return true
     9        (triggering removal of tag) only if the style implicitly added by the element is not present in
     10        the new style to apply. It also changes surroundNodeRangeWithElement so that it merges the
     11        surrounding element when possible. applyTextDecorationStyle is modified so that it does not add
     12        style span when the style attribute is empty.
     13
     14        Test: editing/execCommand/toggle-style-3.html
     15
     16        * editing/ApplyStyleCommand.cpp:
     17        (WebCore::ApplyStyleCommand::shouldRemoveTextDecorationTag): Returns true if specified text
     18        decoration is not present in the style to apply
     19        (WebCore::ApplyStyleCommand::implicitlyStyledElementShouldBeRemovedWhenApplyingStyle): No longer
     20        returns true if the tag is used in new style
     21        (WebCore::ApplyStyleCommand::applyTextDecorationStyle): Does not add style-span when redundant
     22        (WebCore::ApplyStyleCommand::surroundNodeRangeWithElement): Merges the newly created element
     23        with the surrounding identical elements
     24        * editing/ApplyStyleCommand.h:
     25
    1262009-10-09  Adam Barth  <abarth@webkit.org>
    227
  • trunk/WebCore/editing/ApplyStyleCommand.cpp

    r49129 r49414  
    10801080}
    10811081
     1082bool ApplyStyleCommand::shouldRemoveTextDecorationTag(CSSStyleDeclaration* styleToApply, int textDecorationAddedByTag) const
     1083{
     1084    // Honor text-decorations-in-effect
     1085    RefPtr<CSSValue> textDecorationsToApply = styleToApply->getPropertyCSSValue(CSSPropertyWebkitTextDecorationsInEffect);
     1086    if (!textDecorationsToApply || !textDecorationsToApply->isValueList())
     1087        textDecorationsToApply = styleToApply->getPropertyCSSValue(CSSPropertyTextDecoration);
     1088
     1089    // When there is no text decorations to apply, remove any one of u, s, & strike
     1090    if (!textDecorationsToApply || !textDecorationsToApply->isValueList())
     1091        return true;
     1092
     1093    // Remove node if it implicitly adds style not present in styleToApply
     1094    CSSValueList* valueList = static_cast<CSSValueList*>(textDecorationsToApply.get());
     1095    RefPtr<CSSPrimitiveValue> value = CSSPrimitiveValue::createIdentifier(textDecorationAddedByTag);
     1096    return !valueList->hasValue(value.get());
     1097}
     1098
    10821099// This function maps from styling tags to CSS styles.  Used for knowing which
    10831100// styling tags should be removed when toggling styles.
     
    10931110            // IE inserts "strong" tags for execCommand("bold"), so we remove them, even though they're not strictly presentational
    10941111            if (elem->hasLocalName(bTag) || elem->hasLocalName(strongTag))
    1095                 return true;
     1112                return !equalIgnoringCase(property.value()->cssText(), "bold") || !elem->hasChildNodes();
    10961113            break;
    10971114        case CSSPropertyVerticalAlign:
    1098             if (elem->hasLocalName(subTag) || elem->hasLocalName(supTag))
    1099                 return true;
     1115            if (elem->hasLocalName(subTag))
     1116                return !equalIgnoringCase(property.value()->cssText(), "sub") || !elem->hasChildNodes();
     1117            if (elem->hasLocalName(supTag))
     1118                return !equalIgnoringCase(property.value()->cssText(), "sup") || !elem->hasChildNodes();
    11001119            break;
    11011120        case CSSPropertyFontStyle:
    11021121            // IE inserts "em" tags for execCommand("italic"), so we remove them, even though they're not strictly presentational
    11031122            if (elem->hasLocalName(iTag) || elem->hasLocalName(emTag))
    1104                 return true;
     1123                return !equalIgnoringCase(property.value()->cssText(), "italic") || !elem->hasChildNodes();
    11051124            break;
    11061125        case CSSPropertyTextDecoration:
    11071126        case CSSPropertyWebkitTextDecorationsInEffect:
    1108                 ASSERT(property.value());
    1109                 if (property.value()->isValueList()) {
    1110                     CSSValueList* valueList = static_cast<CSSValueList*>(property.value());
    1111                     DEFINE_STATIC_LOCAL(RefPtr<CSSPrimitiveValue>, underline, (CSSPrimitiveValue::createIdentifier(CSSValueUnderline)));
    1112                     DEFINE_STATIC_LOCAL(RefPtr<CSSPrimitiveValue>, lineThrough, (CSSPrimitiveValue::createIdentifier(CSSValueLineThrough)));
    1113                     // Because style is new style to be applied, we delete element only if the element is not used in style.
    1114                     if (!valueList->hasValue(underline.get()) && elem->hasLocalName(uTag))
    1115                         return true;
    1116                     if (!valueList->hasValue(lineThrough.get()) && (elem->hasLocalName(strikeTag) || elem->hasLocalName(sTag)))
    1117                         return true;
    1118                 } else {
    1119                     // If the value is NOT a list, then it must be "none", in which case we should remove all text decorations.
    1120                     ASSERT(property.value()->cssText() == "none");
    1121                     if (elem->hasLocalName(uTag) || elem->hasLocalName(strikeTag) || elem->hasLocalName(sTag))
    1122                         return true;
    1123                 }
    1124                 break;
     1127                if (elem->hasLocalName(uTag))
     1128                    return shouldRemoveTextDecorationTag(style, CSSValueUnderline) || !elem->hasChildNodes();
     1129                else if (elem->hasLocalName(sTag) || elem->hasTagName(strikeTag))
     1130                    return shouldRemoveTextDecorationTag(style,CSSValueLineThrough) || !elem->hasChildNodes();
    11251131        }
    11261132    }
     
    13081314        return;
    13091315
    1310     if (node->isTextNode()) {
    1311         RefPtr<HTMLElement> styleSpan = createStyleSpanElement(document());
    1312         surroundNodeRangeWithElement(node, node, styleSpan.get());
    1313         node = styleSpan.get();
    1314     }
    1315 
    1316     if (!node->isElementNode())
    1317         return;
    1318 
    1319     HTMLElement *element = static_cast<HTMLElement *>(node);
    1320 
    1321     StyleChange styleChange(style, Position(element, 0));
     1316    StyleChange styleChange(style, Position(node, 0));
    13221317    if (styleChange.cssStyle().length()) {
     1318        if (node->isTextNode()) {
     1319            RefPtr<HTMLElement> styleSpan = createStyleSpanElement(document());
     1320            surroundNodeRangeWithElement(node, node, styleSpan.get());
     1321            node = styleSpan.get();
     1322        }
     1323
     1324        if (!node->isElementNode())
     1325            return;
     1326
     1327        HTMLElement *element = static_cast<HTMLElement *>(node);
    13231328        String cssText = styleChange.cssStyle();
    13241329        CSSMutableStyleDeclaration *decl = element->inlineStyleDecl();
     
    16801685        node = next;
    16811686    }
     1687
     1688    Node* nextSibling = element->nextSibling();
     1689    Node* previousSibling = element->previousSibling();
     1690    if (nextSibling && nextSibling->isElementNode() && nextSibling->isContentEditable()
     1691        && areIdenticalElements(element.get(), static_cast<Element*>(nextSibling)))
     1692        mergeIdenticalElements(element, static_cast<Element*>(nextSibling));
     1693
     1694    if (previousSibling && previousSibling->isElementNode() && previousSibling->isContentEditable()) {
     1695        Node* mergedElement = previousSibling->nextSibling();
     1696        if (mergedElement->isElementNode() && mergedElement->isContentEditable()
     1697            && areIdenticalElements(static_cast<Element*>(previousSibling), static_cast<Element*>(mergedElement)))
     1698            mergeIdenticalElements(static_cast<Element*>(previousSibling), static_cast<Element*>(mergedElement));
     1699    }
     1700
    16821701    // FIXME: We should probably call updateStartEnd if the start or end was in the node
    16831702    // range so that the endingSelection() is canonicalized.  See the comments at the end of
  • trunk/WebCore/editing/ApplyStyleCommand.h

    r46914 r49414  
    6363
    6464    // style-removal helpers
     65    bool shouldRemoveTextDecorationTag(CSSStyleDeclaration* styleToApply, int textDecorationAddedByTag) const;
    6566    bool implicitlyStyledElementShouldBeRemovedWhenApplyingStyle(HTMLElement*, CSSMutableStyleDeclaration*);
    6667    void replaceWithSpanOrRemoveIfWithoutAttributes(HTMLElement*&);
Note: See TracChangeset for help on using the changeset viewer.