Changeset 95745 in webkit


Ignore:
Timestamp:
Sep 22, 2011 12:25:54 PM (13 years ago)
Author:
rniwa@webkit.org
Message:

Unreviewed, rolling out r95335 and r95645.
http://trac.webkit.org/changeset/95335
http://trac.webkit.org/changeset/95645
https://bugs.webkit.org/show_bug.cgi?id=68649

Wrong fix (Requested by rniwa on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2011-09-22

Source/WebCore:

  • editing/DeleteSelectionCommand.cpp:

(WebCore::DeleteSelectionCommand::saveTypingStyleState):

  • editing/EditingStyle.cpp:

(WebCore::EditingStyle::removeStyleAddedByNode):

  • editing/EditingStyle.h:
  • editing/ReplaceSelectionCommand.cpp:

(WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):

  • editing/markup.cpp:

(WebCore::StyledMarkupAccumulator::serializeNodes):
(WebCore::ancestorToRetainStructureAndAppearance):

  • editing/markup.h:

LayoutTests:

  • editing/deleting/merge-paragraph-from-address-expected.txt: Removed.
  • editing/deleting/merge-paragraph-from-address.html: Removed.
  • editing/deleting/merge-paragraph-from-h6-expected.txt: Removed.
  • editing/deleting/merge-paragraph-from-h6-with-style-expected.txt: Removed.
  • editing/deleting/merge-paragraph-from-h6-with-style.html: Removed.
  • editing/deleting/merge-paragraph-from-h6.html: Removed.
  • editing/deleting/merge-paragraph-from-listing-expected.txt: Removed.
  • editing/deleting/merge-paragraph-from-listing.html: Removed.
  • editing/deleting/merge-paragraph-from-p-with-style-expected.txt: Removed.
  • editing/deleting/merge-paragraph-from-p-with-style.html: Removed.
  • editing/deleting/merge-paragraph-into-h1-expected.txt: Removed.
  • editing/deleting/merge-paragraph-into-h1-style-expected.txt: Removed.
  • editing/deleting/merge-paragraph-into-h1-with-style-expected.txt: Removed.
  • editing/deleting/merge-paragraph-into-h1-with-style.html: Removed.
  • editing/deleting/merge-paragraph-into-h1.html: Removed.
  • editing/deleting/merge-paragraph-into-pre-expected.txt: Removed.
  • editing/deleting/merge-paragraph-into-pre.html: Removed.
  • platform/mac/editing/deleting/merge-whitespace-pre-expected.png:
  • platform/mac/editing/deleting/merge-whitespace-pre-expected.txt:
Location:
trunk
Files:
17 deleted
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r95744 r95745  
     12011-09-22  Sheriff Bot  <webkit.review.bot@gmail.com>
     2
     3        Unreviewed, rolling out r95335 and r95645.
     4        http://trac.webkit.org/changeset/95335
     5        http://trac.webkit.org/changeset/95645
     6        https://bugs.webkit.org/show_bug.cgi?id=68649
     7
     8        Wrong fix (Requested by rniwa on #webkit).
     9
     10        * editing/deleting/merge-paragraph-from-address-expected.txt: Removed.
     11        * editing/deleting/merge-paragraph-from-address.html: Removed.
     12        * editing/deleting/merge-paragraph-from-h6-expected.txt: Removed.
     13        * editing/deleting/merge-paragraph-from-h6-with-style-expected.txt: Removed.
     14        * editing/deleting/merge-paragraph-from-h6-with-style.html: Removed.
     15        * editing/deleting/merge-paragraph-from-h6.html: Removed.
     16        * editing/deleting/merge-paragraph-from-listing-expected.txt: Removed.
     17        * editing/deleting/merge-paragraph-from-listing.html: Removed.
     18        * editing/deleting/merge-paragraph-from-p-with-style-expected.txt: Removed.
     19        * editing/deleting/merge-paragraph-from-p-with-style.html: Removed.
     20        * editing/deleting/merge-paragraph-into-h1-expected.txt: Removed.
     21        * editing/deleting/merge-paragraph-into-h1-style-expected.txt: Removed.
     22        * editing/deleting/merge-paragraph-into-h1-with-style-expected.txt: Removed.
     23        * editing/deleting/merge-paragraph-into-h1-with-style.html: Removed.
     24        * editing/deleting/merge-paragraph-into-h1.html: Removed.
     25        * editing/deleting/merge-paragraph-into-pre-expected.txt: Removed.
     26        * editing/deleting/merge-paragraph-into-pre.html: Removed.
     27        * platform/mac/editing/deleting/merge-whitespace-pre-expected.png:
     28        * platform/mac/editing/deleting/merge-whitespace-pre-expected.txt:
     29
    1302011-09-22  Robert Hogan  <robert@webkit.org>
    231
  • trunk/LayoutTests/platform/mac/editing/deleting/merge-whitespace-pre-expected.txt

    r95335 r95745  
    1313          RenderText {#text} at (0,0) size 21x18
    1414            text run at (0,0) width 21: "foo"
    15           RenderText {#text} at (21,0) size 20x18
    16             text run at (21,0) width 20: "bar"
     15          RenderInline {SPAN} at (0,0) size 24x15
     16            RenderText {#text} at (21,2) size 24x15
     17              text run at (21,2) width 24: "bar"
    1718        RenderBlock {PRE} at (0,31) size 784x15
    1819          RenderText {#text} at (0,0) size 24x15
  • trunk/Source/WebCore/ChangeLog

    r95743 r95745  
     12011-09-22  Sheriff Bot  <webkit.review.bot@gmail.com>
     2
     3        Unreviewed, rolling out r95335 and r95645.
     4        http://trac.webkit.org/changeset/95335
     5        http://trac.webkit.org/changeset/95645
     6        https://bugs.webkit.org/show_bug.cgi?id=68649
     7
     8        Wrong fix (Requested by rniwa on #webkit).
     9
     10        * editing/DeleteSelectionCommand.cpp:
     11        (WebCore::DeleteSelectionCommand::saveTypingStyleState):
     12        * editing/EditingStyle.cpp:
     13        (WebCore::EditingStyle::removeStyleAddedByNode):
     14        * editing/EditingStyle.h:
     15        * editing/ReplaceSelectionCommand.cpp:
     16        (WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
     17        * editing/markup.cpp:
     18        (WebCore::StyledMarkupAccumulator::serializeNodes):
     19        (WebCore::ancestorToRetainStructureAndAppearance):
     20        * editing/markup.h:
     21
    1222011-09-22  Ryosuke Niwa  <rniwa@webkit.org>
    223
  • trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp

    r95645 r95745  
    284284    // Figure out the typing style in effect before the delete is done.
    285285    m_typingStyle = EditingStyle::create(m_selectionToDelete.start());
    286     m_typingStyle->removeStyleFromRules(enclosingAnchorElement(m_selectionToDelete.start()));
     286    m_typingStyle->removeStyleAddedByNode(enclosingAnchorElement(m_selectionToDelete.start()));
    287287
    288288    // If we're deleting into a Mail blockquote, save the style at end() instead of start()
  • trunk/Source/WebCore/editing/EditingStyle.cpp

    r95645 r95745  
    520520}
    521521
    522 void EditingStyle::removeStyleFromRules(Node* node)
    523 {
    524     // FIXME: This should share code with removeStyleFromRulesAndContext
    525     // but it's hard to do until we figure out how to compare font-size property without computed style.
     522void EditingStyle::removeStyleAddedByNode(Node* node)
     523{
    526524    if (!node || !node->parentNode())
    527525        return;
     
    529527    RefPtr<CSSMutableStyleDeclaration> nodeStyle = editingStyleFromComputedStyle(computedStyle(node));
    530528    parentStyle->diff(nodeStyle.get());
    531     if (node->isStyledElement() && static_cast<StyledElement*>(node)->inlineStyleDecl())
    532         nodeStyle = getPropertiesNotIn(nodeStyle.get(), static_cast<StyledElement*>(node)->inlineStyleDecl());
    533529    nodeStyle->diff(m_mutableStyle.get());
    534530}
  • trunk/Source/WebCore/editing/EditingStyle.h

    r95645 r95745  
    103103    PassRefPtr<EditingStyle> extractAndRemoveTextDirection();
    104104    void removeBlockProperties();
    105     void removeStyleFromRules(Node*);
     105    void removeStyleAddedByNode(Node*);
    106106    void removeStyleConflictingWithStyleOfNode(Node*);
    107107    void removeNonEditingProperties();
  • trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp

    r95335 r95745  
    497497            // If Mail wraps the fragment with a Paste as Quotation blockquote, or if you're pasting into a quoted region,
    498498            // styles from blockquoteNode are allowed to override those from the source document, see <rdar://problem/4930986> and <rdar://problem/5089327>.
    499             Node* blockquoteNode = isMailPasteAsQuotationNode(context) ? context : enclosingNodeOfType(firstPositionInNode(context), isBlockNodeToRetainAppearance, CanCrossEditingBoundary);
     499            Node* blockquoteNode = isMailPasteAsQuotationNode(context) ? context : enclosingNodeOfType(firstPositionInNode(context), isMailBlockquote, CanCrossEditingBoundary);
    500500            if (blockquoteNode)
    501501                newInlineStyle->removeStyleFromRulesAndContext(element, document()->documentElement());
  • trunk/Source/WebCore/editing/markup.cpp

    r95645 r95745  
    337337}
    338338
    339 bool isBlockNodeToRetainAppearance(const Node* node)
    340 {
    341     DEFINE_STATIC_LOCAL(HashSet<QualifiedName::QualifiedNameImpl*>, names, ());
    342     if (!names.size()) {
    343         names.add(addressTag.impl());
    344         names.add(blockquoteTag.impl());
    345         names.add(h1Tag.impl());
    346         names.add(h2Tag.impl());
    347         names.add(h3Tag.impl());
    348         names.add(h4Tag.impl());
    349         names.add(h5Tag.impl());
    350         names.add(h6Tag.impl());
    351         names.add(listingTag.impl());
    352         names.add(pTag.impl());
    353         names.add(preTag.impl());
    354     }
    355     return node->isElementNode() && names.contains(toElement(node)->tagQName().impl());
    356 }
    357 
    358339Node* StyledMarkupAccumulator::serializeNodes(Node* startNode, Node* pastEnd)
    359340{
     
    370351        // to help us differentiate those styles from ones that the user has applied.
    371352        // This helps us get the color of content pasted into blockquotes right.
    372         m_wrappingStyle->removeStyleFromRules(enclosingNodeOfType(firstPositionInOrBeforeNode(parentOfHighestNode), isBlockNodeToRetainAppearance, CanCrossEditingBoundary));
     353        m_wrappingStyle->removeStyleAddedByNode(enclosingNodeOfType(firstPositionInOrBeforeNode(parentOfHighestNode), isMailBlockquote, CanCrossEditingBoundary));
    373354
    374355        // Call collapseTextDecorationProperties first or otherwise it'll copy the value over from in-effect to text-decorations.
     
    473454    }
    474455
    475     if (isBlockNodeToRetainAppearance(commonAncestorBlock)
     456    if (commonAncestorBlock->hasTagName(listingTag)
    476457        || commonAncestorBlock->hasTagName(olTag)
     458        || commonAncestorBlock->hasTagName(preTag)
    477459        || commonAncestorBlock->hasTagName(tableTag)
    478460        || commonAncestorBlock->hasTagName(ulTag)
    479         || commonAncestorBlock->hasTagName(xmpTag))
     461        || commonAncestorBlock->hasTagName(xmpTag)
     462        || commonAncestorBlock->hasTagName(h1Tag)
     463        || commonAncestorBlock->hasTagName(h2Tag)
     464        || commonAncestorBlock->hasTagName(h3Tag)
     465        || commonAncestorBlock->hasTagName(h4Tag)
     466        || commonAncestorBlock->hasTagName(h5Tag))
    480467        return commonAncestorBlock;
    481468
  • trunk/Source/WebCore/editing/markup.h

    r95335 r95745  
    5050    bool isPlainTextMarkup(Node *node);
    5151
    52     bool isBlockNodeToRetainAppearance(const Node*);
    5352    String createMarkup(const Range*,
    5453        Vector<Node*>* = 0, EAnnotateForInterchange = DoNotAnnotateForInterchange, bool convertBlocksToInlines = false, EAbsoluteURLs = DoNotResolveURLs);
    5554    String createMarkup(const Node*, EChildrenOnly = IncludeNode, Vector<Node*>* = 0, EAbsoluteURLs = DoNotResolveURLs);
    56 
     55   
    5756    String createFullMarkup(const Node*);
    5857    String createFullMarkup(const Range*);
Note: See TracChangeset for help on using the changeset viewer.