Changeset 96870 in webkit


Ignore:
Timestamp:
Oct 6, 2011 4:16:01 PM (13 years ago)
Author:
rniwa@webkit.org
Message:

Deleting line break before h1 converts h1 to span
https://bugs.webkit.org/show_bug.cgi?id=45784

Reviewed by Enrica Casucci.

Source/WebCore:

This patch fundamentally alters the kind of styles we preserve while merging or moving paragraphs.
StylizedMarkupAccumulator no longer wraps nodes by computed style when it's not annotating for interchange.
Instead, it accumulates implicit and inline styles of ancestors of the serialized contents.

The most significant code change is in StyledMarkupAccumulator::serializeNodes where we setup m_wrappingStyle
by merging implicit and inline style of ancestors with mergeInlineAndImplicitStyleOfElement. Because it walks up
the DOM tree upwards, it should not be overriding any CSS properties. Consequently, mergeStyle,
mergeInlineStyleOfElement, and mergeInlineAndImplicitStyleOfElement are modified to take CSSPropertyOverrideMode.

New behavior matches that of Internet Explorer and Firefox when merging paragraphs.

Tests: editing/deleting/merge-paragraph-from-address.html

editing/deleting/merge-paragraph-from-h6-with-style-2.html
editing/deleting/merge-paragraph-from-h6-with-style.html
editing/deleting/merge-paragraph-from-h6.html
editing/deleting/merge-paragraph-from-listing.html
editing/deleting/merge-paragraph-from-p-with-style-2.html
editing/deleting/merge-paragraph-from-p-with-style-3.html
editing/deleting/merge-paragraph-from-p-with-style.html
editing/deleting/merge-paragraph-into-h1-with-style.html
editing/deleting/merge-paragraph-into-h1.html
editing/deleting/merge-paragraph-into-pre.html

  • css/CSSValueList.cpp:

(WebCore::CSSValueList::hasValue): Made const.

  • css/CSSValueList.h:
  • editing/ApplyStyleCommand.cpp:

(WebCore::ApplyStyleCommand::removeInlineStyleFromElement): Calls mergeInlineStyleOfElement.
(WebCore::ApplyStyleCommand::applyInlineStyleToPushDown): Ditto.

  • editing/EditingStyle.cpp:

(WebCore::copyEditingProperties): Takes a boolean includeBackgroundColor.
(WebCore::isEditingProperty): Extracted from elementIsStyledSpanOrHTMLEquivalent.
(WebCore::EditingStyle::elementIsStyledSpanOrHTMLEquivalent): Calls isEditingProperty.
(WebCore::EditingStyle::mergeTypingStyle): Calls mergeStyle.
(WebCore::EditingStyle::mergeInlineStyleOfElement): Takes CSSPropertyOverrideMode.
(WebCore::elementMatchesAndPropertyIsNotInInlineStyleDecl): Added.
(WebCore::EditingStyle::mergeInlineAndImplicitStyleOfElement): Added.
(WebCore::mergeTextDecorationValues): Extracted from mergeStyle.
(WebCore::EditingStyle::mergeStyle): Takes CSSPropertyOverrideMode.

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

(WebCore::nodeToSplitToAvoidPastingIntoInlineNodesWithStyle): Extracted from doApply.
(WebCore::ReplaceSelectionCommand::doApply): Calls nodeToSplitToAvoidPastingIntoInlineNodesWithStyle.
(WebCore::ReplaceSelectionCommand::performTrivialReplace): Exit early when we need to split the tree to avoid
pasting into inline nodes with style. Also remove a collapsed or spurious br.

  • editing/markup.cpp:

(WebCore::StyledMarkupAccumulator::serializeNodes):

LayoutTests:

Many rebaselines are due to text nodes merged correctly after ReplaceSelectionCommand because
they started to use the fast path (perfromTrivialReplace).

New tests:

  • editing/deleting/merge-paragraph-from-address-expected.txt: Added.
  • editing/deleting/merge-paragraph-from-address.html: Added.
  • editing/deleting/merge-paragraph-from-h6-expected.txt: Added.
  • editing/deleting/merge-paragraph-from-h6-with-style-2-expected.txt: Added.
  • editing/deleting/merge-paragraph-from-h6-with-style-2.html: Added.
  • editing/deleting/merge-paragraph-from-h6-with-style-3-expected.txt: Added.
  • editing/deleting/merge-paragraph-from-h6-with-style-3.html: Added.
  • editing/deleting/merge-paragraph-from-h6-with-style-expected.txt: Added.
  • editing/deleting/merge-paragraph-from-h6-with-style.html: Added.
  • editing/deleting/merge-paragraph-from-h6.html: Added.
  • editing/deleting/merge-paragraph-from-listing-expected.txt: Added.
  • editing/deleting/merge-paragraph-from-listing.html: Added.
  • editing/deleting/merge-paragraph-from-p-with-style-2-expected.txt: Added.
  • editing/deleting/merge-paragraph-from-p-with-style-2.html: Added.
  • editing/deleting/merge-paragraph-from-p-with-style-expected.txt: Added.
  • editing/deleting/merge-paragraph-from-p-with-style.html: Added.
  • editing/deleting/merge-paragraph-into-blockquote-expected.txt:
  • editing/deleting/merge-paragraph-into-h1-expected.txt: Added.
  • editing/deleting/merge-paragraph-into-h1-style-expected.txt: Added.
  • editing/deleting/merge-paragraph-into-h1-with-style-expected.txt: Added.
  • editing/deleting/merge-paragraph-into-h1-with-style.html: Added.
  • editing/deleting/merge-paragraph-into-h1.html: Added.
  • editing/deleting/merge-paragraph-into-pre-expected.txt: Added.
  • editing/deleting/merge-paragraph-into-pre.html: Added.

Rebaselines:

  • editing/pasteboard/5521237-expected.txt: A collapsed br at the end is removed.
  • editing/spelling/script-tests/spelling-backspace-between-lines.js: text nodes are merged.

(testWithDelete):
(testWithForwardDelete):

  • editing/spelling/spelling-backspace-between-lines-expected.txt:
  • editing/style/apply-through-end-of-document-expected.txt: A collapsed br at the end is removed.
  • platform/mac/editing/deleting/merge-whitespace-pre-expected.png:
  • platform/mac/editing/deleting/merge-whitespace-pre-expected.txt: "bar" is merged into p from

pre and losing monospace style.

  • platform/mac/editing/pasteboard/paste-match-style-001-expected.txt: A text node is split into

two with no visual effect.

Rebaselines due to text nodes being merged:

  • editing/deleting/5032066-expected.txt:
  • editing/deleting/delete-across-editable-content-boundaries-2-expected.txt:
  • editing/deleting/delete-across-editable-content-boundaries-3-expected.txt:
  • editing/deleting/delete-line-011-expected.txt:
  • editing/deleting/delete-to-end-of-paragraph-expected.txt:
  • editing/deleting/deleting-line-break-preserves-underline-color-expected.txt:
  • editing/pasteboard/copy-null-characters-expected.txt:
  • editing/pasteboard/insert-div-text-into-text-expected.txt:
  • editing/pasteboard/interchange-newline-1-expected.txt:
  • editing/pasteboard/interchange-newline-2-expected.txt:
  • editing/pasteboard/merge-end-3-expected.txt:
  • editing/pasteboard/merge-end-4-expected.txt:
  • editing/pasteboard/merge-end-5-expected.txt:
  • editing/pasteboard/merge-end-list-2-expected.txt:
  • editing/pasteboard/merge-end-table-2-expected.txt:
  • editing/pasteboard/paste-after-inline-style-element-expected.txt:
  • editing/pasteboard/paste-blockquote-2-expected.txt:
  • editing/pasteboard/paste-blockquote-3-expected.txt:
  • editing/pasteboard/paste-blockquote-into-blockquote-2-expected.txt:
  • editing/pasteboard/paste-blockquote-into-blockquote-expected.txt:
  • editing/pasteboard/paste-into-blockquote-with-document-font-color-expected.txt:
  • editing/pasteboard/pasting-word-in-div-extra-line-expected.txt:
  • platform/mac/editing/deleting/delete-block-merge-contents-001-expected.txt:
  • platform/mac/editing/deleting/delete-block-merge-contents-002-expected.txt:
  • platform/mac/editing/deleting/delete-block-merge-contents-003-expected.txt:
  • platform/mac/editing/deleting/delete-block-merge-contents-004-expected.txt:
  • platform/mac/editing/deleting/delete-block-merge-contents-005-expected.txt:
  • platform/mac/editing/deleting/delete-block-merge-contents-006-expected.txt:
  • platform/mac/editing/deleting/delete-block-merge-contents-007-expected.txt:
  • platform/mac/editing/deleting/delete-block-merge-contents-008-expected.txt:
  • platform/mac/editing/deleting/delete-block-merge-contents-009-expected.txt:
  • platform/mac/editing/deleting/delete-block-merge-contents-010-expected.txt:
  • platform/mac/editing/deleting/delete-block-merge-contents-012-expected.txt:
  • platform/mac/editing/deleting/delete-block-merge-contents-013-expected.txt:
  • platform/mac/editing/deleting/delete-block-merge-contents-014-expected.txt:
  • platform/mac/editing/deleting/delete-block-merge-contents-015-expected.txt:
  • platform/mac/editing/deleting/delete-block-merge-contents-016-expected.txt:
  • platform/mac/editing/deleting/delete-block-merge-contents-017-expected.txt:
  • platform/mac/editing/deleting/delete-br-010-expected.txt:
  • platform/mac/editing/deleting/delete-line-012-expected.txt:
  • platform/mac/editing/deleting/delete-listitem-001-expected.txt:
  • platform/mac/editing/inserting/multiple-lines-selected-expected.txt:
  • platform/mac/editing/pasteboard/5032095-expected.txt:
  • platform/mac/editing/pasteboard/merge-after-delete-1-expected.txt:
  • platform/mac/editing/pasteboard/merge-after-delete-2-expected.txt:
  • platform/mac/editing/pasteboard/merge-after-delete-expected.txt:
  • platform/mac/editing/pasteboard/merge-end-blockquote-expected.txt:
  • platform/mac/editing/pasteboard/paste-blockquote-into-blockquote-4-expected.txt:
Location:
trunk
Files:
23 added
65 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r96868 r96870  
     12011-10-05  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Deleting line break before h1 converts h1 to span
     4        https://bugs.webkit.org/show_bug.cgi?id=45784
     5
     6        Reviewed by Enrica Casucci.
     7
     8        Many rebaselines are due to text nodes merged correctly after ReplaceSelectionCommand because
     9        they started to use the fast path (perfromTrivialReplace).
     10
     11        New tests:
     12        * editing/deleting/merge-paragraph-from-address-expected.txt: Added.
     13        * editing/deleting/merge-paragraph-from-address.html: Added.
     14        * editing/deleting/merge-paragraph-from-h6-expected.txt: Added.
     15        * editing/deleting/merge-paragraph-from-h6-with-style-2-expected.txt: Added.
     16        * editing/deleting/merge-paragraph-from-h6-with-style-2.html: Added.
     17        * editing/deleting/merge-paragraph-from-h6-with-style-3-expected.txt: Added.
     18        * editing/deleting/merge-paragraph-from-h6-with-style-3.html: Added.
     19        * editing/deleting/merge-paragraph-from-h6-with-style-expected.txt: Added.
     20        * editing/deleting/merge-paragraph-from-h6-with-style.html: Added.
     21        * editing/deleting/merge-paragraph-from-h6.html: Added.
     22        * editing/deleting/merge-paragraph-from-listing-expected.txt: Added.
     23        * editing/deleting/merge-paragraph-from-listing.html: Added.
     24        * editing/deleting/merge-paragraph-from-p-with-style-2-expected.txt: Added.
     25        * editing/deleting/merge-paragraph-from-p-with-style-2.html: Added.
     26        * editing/deleting/merge-paragraph-from-p-with-style-expected.txt: Added.
     27        * editing/deleting/merge-paragraph-from-p-with-style.html: Added.
     28        * editing/deleting/merge-paragraph-into-blockquote-expected.txt:
     29        * editing/deleting/merge-paragraph-into-h1-expected.txt: Added.
     30        * editing/deleting/merge-paragraph-into-h1-style-expected.txt: Added.
     31        * editing/deleting/merge-paragraph-into-h1-with-style-expected.txt: Added.
     32        * editing/deleting/merge-paragraph-into-h1-with-style.html: Added.
     33        * editing/deleting/merge-paragraph-into-h1.html: Added.
     34        * editing/deleting/merge-paragraph-into-pre-expected.txt: Added.
     35        * editing/deleting/merge-paragraph-into-pre.html: Added.
     36
     37        Rebaselines:
     38        * editing/pasteboard/5521237-expected.txt: A collapsed br at the end is removed.
     39        * editing/spelling/script-tests/spelling-backspace-between-lines.js: text nodes are merged.
     40        (testWithDelete):
     41        (testWithForwardDelete):
     42        * editing/spelling/spelling-backspace-between-lines-expected.txt:
     43        * editing/style/apply-through-end-of-document-expected.txt: A collapsed br at the end is removed.
     44        * platform/mac/editing/deleting/merge-whitespace-pre-expected.png:
     45        * platform/mac/editing/deleting/merge-whitespace-pre-expected.txt: "bar" is merged into p from
     46        pre and losing monospace style.
     47        * platform/mac/editing/pasteboard/paste-match-style-001-expected.txt: A text node is split into
     48        two with no visual effect.
     49
     50        Rebaselines due to text nodes being merged:
     51        * editing/deleting/5032066-expected.txt:
     52        * editing/deleting/delete-across-editable-content-boundaries-2-expected.txt:
     53        * editing/deleting/delete-across-editable-content-boundaries-3-expected.txt:
     54        * editing/deleting/delete-line-011-expected.txt:
     55        * editing/deleting/delete-to-end-of-paragraph-expected.txt:
     56        * editing/deleting/deleting-line-break-preserves-underline-color-expected.txt:
     57        * editing/pasteboard/copy-null-characters-expected.txt:
     58        * editing/pasteboard/insert-div-text-into-text-expected.txt:
     59        * editing/pasteboard/interchange-newline-1-expected.txt:
     60        * editing/pasteboard/interchange-newline-2-expected.txt:
     61        * editing/pasteboard/merge-end-3-expected.txt:
     62        * editing/pasteboard/merge-end-4-expected.txt:
     63        * editing/pasteboard/merge-end-5-expected.txt:
     64        * editing/pasteboard/merge-end-list-2-expected.txt:
     65        * editing/pasteboard/merge-end-table-2-expected.txt:
     66        * editing/pasteboard/paste-after-inline-style-element-expected.txt:
     67        * editing/pasteboard/paste-blockquote-2-expected.txt:
     68        * editing/pasteboard/paste-blockquote-3-expected.txt:
     69        * editing/pasteboard/paste-blockquote-into-blockquote-2-expected.txt:
     70        * editing/pasteboard/paste-blockquote-into-blockquote-expected.txt:
     71        * editing/pasteboard/paste-into-blockquote-with-document-font-color-expected.txt:
     72        * editing/pasteboard/pasting-word-in-div-extra-line-expected.txt:
     73        * platform/mac/editing/deleting/delete-block-merge-contents-001-expected.txt:
     74        * platform/mac/editing/deleting/delete-block-merge-contents-002-expected.txt:
     75        * platform/mac/editing/deleting/delete-block-merge-contents-003-expected.txt:
     76        * platform/mac/editing/deleting/delete-block-merge-contents-004-expected.txt:
     77        * platform/mac/editing/deleting/delete-block-merge-contents-005-expected.txt:
     78        * platform/mac/editing/deleting/delete-block-merge-contents-006-expected.txt:
     79        * platform/mac/editing/deleting/delete-block-merge-contents-007-expected.txt:
     80        * platform/mac/editing/deleting/delete-block-merge-contents-008-expected.txt:
     81        * platform/mac/editing/deleting/delete-block-merge-contents-009-expected.txt:
     82        * platform/mac/editing/deleting/delete-block-merge-contents-010-expected.txt:
     83        * platform/mac/editing/deleting/delete-block-merge-contents-012-expected.txt:
     84        * platform/mac/editing/deleting/delete-block-merge-contents-013-expected.txt:
     85        * platform/mac/editing/deleting/delete-block-merge-contents-014-expected.txt:
     86        * platform/mac/editing/deleting/delete-block-merge-contents-015-expected.txt:
     87        * platform/mac/editing/deleting/delete-block-merge-contents-016-expected.txt:
     88        * platform/mac/editing/deleting/delete-block-merge-contents-017-expected.txt:
     89        * platform/mac/editing/deleting/delete-br-010-expected.txt:
     90        * platform/mac/editing/deleting/delete-line-012-expected.txt:
     91        * platform/mac/editing/deleting/delete-listitem-001-expected.txt:
     92        * platform/mac/editing/inserting/multiple-lines-selected-expected.txt:
     93        * platform/mac/editing/pasteboard/5032095-expected.txt:
     94        * platform/mac/editing/pasteboard/merge-after-delete-1-expected.txt:
     95        * platform/mac/editing/pasteboard/merge-after-delete-2-expected.txt:
     96        * platform/mac/editing/pasteboard/merge-after-delete-expected.txt:
     97        * platform/mac/editing/pasteboard/merge-end-blockquote-expected.txt:
     98        * platform/mac/editing/pasteboard/paste-blockquote-into-blockquote-4-expected.txt:
     99
    11002011-10-06  Abhishek Arya  <inferno@chromium.org>
    2101
  • trunk/LayoutTests/editing/deleting/5032066-expected.txt

    r87466 r96870  
    55|     <tr>
    66|       <td>
    7 |         "All the content in this editable region <#selection-caret>"
    8 |         "should be in one table cell."
     7|         "All the content in this editable region <#selection-caret>should be in one table cell."
  • trunk/LayoutTests/editing/deleting/delete-across-editable-content-boundaries-2-expected.txt

    r89644 r96870  
    1616|       <td>
    1717|         contenteditable="true"
    18 |         "Editable <#selection-caret>"
    19 |         "content"
     18|         "Editable <#selection-caret>content"
    2019|       "
    2120        "
  • trunk/LayoutTests/editing/deleting/delete-across-editable-content-boundaries-3-expected.txt

    r89644 r96870  
    1717|       <td>
    1818|         contenteditable="true"
    19 |         "Editable <#selection-caret>"
    20 |         "content"
     19|         "Editable <#selection-caret>content"
    2120|       "
    2221        "
  • trunk/LayoutTests/editing/deleting/delete-line-011-expected.txt

    r96297 r96870  
    2525EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    2626EDITING DELEGATE: shouldDeleteDOMRange:range from 10 of #text > DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document
    27 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > DIV > BODY > HTML > #document to 2 of BODY > HTML > #document toDOMRange:range from 10 of #text > DIV > BODY > HTML > #document to 10 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     27EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 10 of #text > DIV > BODY > HTML > #document to 2 of BODY > HTML > #document toDOMRange:range from 10 of #text > DIV > BODY > HTML > #document to 10 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    2828EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    2929EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
     
    3434    RenderBody {BODY} at (8,8) size 784x584
    3535      RenderBlock {DIV} at (0,0) size 600x28
    36         RenderText {#text} at (0,0) size 96x28
    37           text run at (0,0) width 96: "There is a"
    38         RenderText {#text} at (96,0) size 241x28
    39           text run at (96,0) width 241: "Which taken at the flood"
     36        RenderText {#text} at (0,0) size 337x28
     37          text run at (0,0) width 337: "There is aWhich taken at the flood"
    4038caret: position 10 of child 0 {#text} of child 1 {DIV} of body
  • trunk/LayoutTests/editing/deleting/delete-to-end-of-paragraph-expected.txt

    r96257 r96870  
    1010EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    1111EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
    12 | <span>
    13 |   style="font-size: medium; "
    14 |   "<#selection-caret>four five six"
     12| "<#selection-caret>four five six"
    1513| <br>
  • trunk/LayoutTests/editing/deleting/deleting-line-break-preserves-underline-color-expected.txt

    r92823 r96870  
    1414|   "This should not be underlined.<#selection-caret>"
    1515|   <span>
    16 |     style="text-decoration: underline; color: blue; "
     16|     style="text-decoration: underline; color: blue;"
    1717|     <span>
    1818|       style="color:red;"
  • trunk/LayoutTests/editing/deleting/merge-paragraph-into-blockquote-expected.txt

    r96257 r96870  
    1515"
    1616| <blockquote>
    17 |   "hello<#selection-caret>"
    18 |   "world"
     17|   "hello<#selection-caret>world"
  • trunk/LayoutTests/editing/pasteboard/5521237-expected.txt

    r55271 r96870  
    11This tests for a bug when pasting a word copied from TextEdit after a regular, breaking space.
    22
    3 Everything in this editable region should be in one paragraph.
     3Everything in this editable region should be in one paragraph.
  • trunk/LayoutTests/editing/pasteboard/copy-null-characters-expected.txt

    r93001 r96870  
    2929|     "Copy paste me"
    3030|   <span>
    31 |     style="color: rgb(0, 128, 0); "
     31|     style="color: green; "
    3232|     "green"
    3333|   "Copy paste me"
  • trunk/LayoutTests/editing/pasteboard/insert-div-text-into-text-expected.txt

    r96257 r96870  
    55EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    66EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    7 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 36 of #text > DIV > BODY > HTML > #document to 36 of #text > DIV > BODY > HTML > #document toDOMRange:range from 6 of #text > DIV > BODY > HTML > #document to 6 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     7EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 48 of #text > DIV > BODY > HTML > #document to 48 of #text > DIV > BODY > HTML > #document toDOMRange:range from 12 of #text > DIV > BODY > HTML > #document to 12 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    88EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    99EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
    1010EDITING DELEGATE: webViewDidEndEditing:WebViewDidEndEditingNotification
    1111This tests inserting a text wrapped in a div inside a text node.
    12 | "There "
    13 | "should<#selection-caret>"
    14 | " be no line breaks in this sentence."
     12| "There should<#selection-caret> be no line breaks in this sentence."
  • trunk/LayoutTests/editing/pasteboard/interchange-newline-1-expected.txt

    r96257 r96870  
    99There is an interchange newline at the end of the incoming fragment. "bar" and "x" should be in separate paragraphs
    1010The paragraph "bar" is inside a div wrapped in a span, and the old paste code that handled interchange newlines did not handle this case.
    11 | "x"
    12 | "foo"
     11| "xfoo"
    1312| <div>
    1413|   "bar"
  • trunk/LayoutTests/editing/pasteboard/interchange-newline-2-expected.txt

    r96264 r96870  
    55EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    66EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    7 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > DIV > DIV > BODY > HTML > #document to 3 of #text > DIV > BODY > HTML > #document toDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     7EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > DIV > DIV > BODY > HTML > #document to 3 of #text > DIV > BODY > HTML > #document toDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    88EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    99EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
     
    1212The selection being pasted into contain multiple blocks, which breaks the old code in paste that handled interchange newlines.
    1313| <div>
    14 |   "f"
    15 |   "bar"
     14|   "fbar"
    1615| "baz"
    1716| <div>
  • trunk/LayoutTests/editing/pasteboard/merge-end-3-expected.txt

    r96257 r96870  
    1313| "one "
    1414| <div>
    15 |   "two<#selection-caret>"
    16 |   "three"
     15|   "two<#selection-caret>three"
  • trunk/LayoutTests/editing/pasteboard/merge-end-4-expected.txt

    r96257 r96870  
    1111bar
    1212bazx.
    13 | "x"
    14 | "foo"
     13| "xfoo"
    1514| <div>
    1615|   "bar"
  • trunk/LayoutTests/editing/pasteboard/merge-end-5-expected.txt

    r96257 r96870  
    88EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    99EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    10 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 4 of #text > DIV > DIV > BODY > HTML > #document to 1 of DIV > BODY > HTML > #document toDOMRange:range from 36 of #text > DIV > DIV > BODY > HTML > #document to 36 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     10EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 4 of #text > DIV > DIV > BODY > HTML > #document to 1 of DIV > BODY > HTML > #document toDOMRange:range from 41 of #text > DIV > DIV > BODY > HTML > #document to 41 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    1111EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    1212EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
     
    1515| <div>
    1616|   style="border: 1px solid red;"
    17 |   "This "
    18 |   "text should have a red border around<#selection-caret>"
     17|   "This text should have a red border around<#selection-caret>"
    1918|   " it."
  • trunk/LayoutTests/editing/pasteboard/merge-end-list-2-expected.txt

    r96257 r96870  
    44EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    55EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    6 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 4 of #text > DIV > LI > UL > DIV > BODY > HTML > #document to 4 of #text > DIV > LI > UL > DIV > BODY > HTML > #document toDOMRange:range from 3 of #text > DIV > LI > UL > DIV > BODY > HTML > #document to 3 of #text > DIV > LI > UL > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     6EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 7 of #text > DIV > LI > UL > DIV > BODY > HTML > #document to 7 of #text > DIV > LI > UL > DIV > BODY > HTML > #document toDOMRange:range from 3 of #text > DIV > LI > UL > DIV > BODY > HTML > #document to 3 of #text > DIV > LI > UL > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    77EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    88EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
     
    2020|   <li>
    2121|     <div>
    22 |       "Item"
    23 |       "foo"
     22|       "Itemfoo"
    2423|     <div>
    25 |       "bar<#selection-caret>"
    26 |       " 1"
     24|       "bar<#selection-caret> 1"
  • trunk/LayoutTests/editing/pasteboard/merge-end-table-2-expected.txt

    r96257 r96870  
    44EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    55EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    6 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 4 of #text > DIV > TD > TR > TBODY > TABLE > DIV > BODY > HTML > #document to 4 of #text > DIV > TD > TR > TBODY > TABLE > DIV > BODY > HTML > #document toDOMRange:range from 3 of #text > DIV > TD > TR > TBODY > TABLE > DIV > BODY > HTML > #document to 3 of #text > DIV > TD > TR > TBODY > TABLE > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     6EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 7 of #text > DIV > TD > TR > TBODY > TABLE > DIV > BODY > HTML > #document to 7 of #text > DIV > TD > TR > TBODY > TABLE > DIV > BODY > HTML > #document toDOMRange:range from 3 of #text > DIV > TD > TR > TBODY > TABLE > DIV > BODY > HTML > #document to 3 of #text > DIV > TD > TR > TBODY > TABLE > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    77EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    88EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
     
    2626|       <div>
    2727|         id="test2"
    28 |         "Item"
    29 |         "foo"
     28|         "Itemfoo"
    3029|       <div>
    3130|         id="test2"
    32 |         "bar<#selection-caret>"
    33 |         " 1"
     31|         "bar<#selection-caret> 1"
    3432|     <td>
    3533|       "Item 2"
  • trunk/LayoutTests/editing/pasteboard/paste-after-inline-style-element-expected.txt

    r92695 r96870  
    55|   <b>
    66|     "line 1 "
    7 |   "line 2<#selection-caret>"
    8 |   " "
     7|   "line 2<#selection-caret> "
    98|   <b>
    109|     <br>
  • trunk/LayoutTests/editing/pasteboard/paste-blockquote-2-expected.txt

    r86716 r96870  
    11This tests pasting a blockquote at the start of a paragraph.
    2 | "This should not be blockquoted.<#selection-caret>"
    3 | " This should not be blockquoted."
     2| "This should not be blockquoted.<#selection-caret> This should not be blockquoted."
  • trunk/LayoutTests/editing/pasteboard/paste-blockquote-3-expected.txt

    r86716 r96870  
    11This tests pasting a blockquote into the middle of a paragraph.
    2 | "This should not be blockquoted."
    3 | " This should not be blockquoted."
     2| "This should not be blockquoted. This should not be blockquoted."
    43| <blockquote>
    54|   type="cite"
    65|   "This should be blockquoted."
    76|   <br>
    8 | "This should not be blockquoted.<#selection-caret>"
    9 | " This should not be blockquoted."
     7| "This should not be blockquoted.<#selection-caret> This should not be blockquoted."
  • trunk/LayoutTests/editing/pasteboard/paste-blockquote-into-blockquote-2-expected.txt

    r92620 r96870  
    33|   id="block"
    44|   type="cite"
    5 |   "One"
    6 |   "Two"
     5|   "OneTwo"
    76| <blockquote>
    87|   type="cite"
  • trunk/LayoutTests/editing/pasteboard/paste-blockquote-into-blockquote-expected.txt

    r92620 r96870  
    33|   id="block"
    44|   type="cite"
    5 |   "One"
    6 |   "Two"
     5|   "OneTwo"
    76| <blockquote>
    87|   type="cite"
  • trunk/LayoutTests/editing/pasteboard/paste-into-blockquote-with-document-font-color-expected.txt

    r87470 r96870  
    44|   type="cite"
    55|   <div>
    6 |     "("
    7 |     "This text should be blue.<#selection-caret>"
    8 |     ")"
     6|     "(This text should be blue.<#selection-caret>)"
  • trunk/LayoutTests/editing/pasteboard/pasting-word-in-div-extra-line-expected.txt

    r87471 r96870  
    11This test ensures pasting words copied from TextEdit in Mail does not add extra newline. See rdar://problem/5483567.
    2 | "x"
    3 | "foo<#selection-caret>"
    4 | "x"
     2| "xfoo<#selection-caret>x"
  • trunk/LayoutTests/editing/spelling/script-tests/spelling-backspace-between-lines.js

    r69952 r96870  
    3333    sel.modify("move", "right", "line"); // Moves to the line ending to focus the "OK zz OK" text.
    3434
    35     shouldBe("sel.anchorNode.data", "'OK zz OK'");
     35    shouldBe("sel.anchorNode.data", "'OKOK zz OK'");
    3636    shouldBe("firstLineText()", "'OKOK zz OK'");
    37     shouldBeTrue("layoutTestController.hasSpellingMarker(3, 2)");
     37    shouldBeTrue("layoutTestController.hasSpellingMarker(5, 2)");
    3838}
    3939
     
    5555
    5656    shouldBe("firstLineText()", "'OKOK zz OK'");
    57     shouldBe("sel.anchorNode.data", "'OK zz OK'");
    58     shouldBeTrue("layoutTestController.hasSpellingMarker(3, 2)");
     57    shouldBe("sel.anchorNode.data", "'OKOK zz OK'");
     58    shouldBeTrue("layoutTestController.hasSpellingMarker(5, 2)");
    5959}
    6060
  • trunk/LayoutTests/editing/spelling/spelling-backspace-between-lines-expected.txt

    r69952 r96870  
    77PASS sel.anchorNode.data is 'OK zz OK'
    88PASS layoutTestController.hasSpellingMarker(3, 2) is true
    9 PASS sel.anchorNode.data is 'OK zz OK'
     9PASS sel.anchorNode.data is 'OKOK zz OK'
    1010PASS firstLineText() is 'OKOK zz OK'
    11 PASS layoutTestController.hasSpellingMarker(3, 2) is true
     11PASS layoutTestController.hasSpellingMarker(5, 2) is true
    1212PASS firstLineText() is 'OK'
    1313PASS sel.anchorNode.data is 'OK zz OK'
    1414PASS layoutTestController.hasSpellingMarker(3, 2) is true
    1515PASS firstLineText() is 'OKOK zz OK'
    16 PASS sel.anchorNode.data is 'OK zz OK'
    17 PASS layoutTestController.hasSpellingMarker(3, 2) is true
     16PASS sel.anchorNode.data is 'OKOK zz OK'
     17PASS layoutTestController.hasSpellingMarker(5, 2) is true
    1818PASS successfullyParsed is true
    1919
  • trunk/LayoutTests/editing/style/apply-through-end-of-document-expected.txt

    r86777 r96870  
    55Copy the second word in this sentence.
    66the
    7 
  • trunk/LayoutTests/platform/mac/editing/deleting/delete-block-merge-contents-001-expected.txt

    r96264 r96870  
    77EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    88EDITING DELEGATE: shouldDeleteDOMRange:range from 6 of #text > DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > DIV > BODY > HTML > #document
    9 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 4 of #text > DIV > DIV > BODY > HTML > #document to 4 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 4 of #text > DIV > DIV > BODY > HTML > #document to 4 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     9EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 7 of #text > DIV > DIV > BODY > HTML > #document to 7 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 4 of #text > DIV > DIV > BODY > HTML > #document to 4 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    1010EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    1111EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
     
    1717      RenderBlock {DIV} at (0,0) size 784x56 [border: (2px solid #FF0000)]
    1818        RenderBlock {DIV} at (14,14) size 756x28
    19           RenderText {#text} at (0,0) size 40x28
    20             text run at (0,0) width 40: "One"
    21           RenderText {#text} at (40,0) size 44x28
    22             text run at (40,0) width 44: "Two"
    23           RenderText {#text} at (0,0) size 0x0
     19          RenderText {#text} at (0,0) size 84x28
     20            text run at (0,0) width 84: "OneTwo"
    2421caret: position 4 of child 0 {#text} of child 1 {DIV} of child 1 {DIV} of body
  • trunk/LayoutTests/platform/mac/editing/deleting/delete-block-merge-contents-002-expected.txt

    r96264 r96870  
    77EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    88EDITING DELEGATE: shouldDeleteDOMRange:range from 6 of #text > DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > DIV > BODY > HTML > #document
    9 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 4 of #text > DIV > DIV > BODY > HTML > #document to 4 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 4 of #text > DIV > DIV > BODY > HTML > #document to 4 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     9EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 7 of #text > DIV > DIV > BODY > HTML > #document to 7 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 4 of #text > DIV > DIV > BODY > HTML > #document to 4 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    1010EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    1111EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
     
    1717      RenderBlock {DIV} at (0,0) size 784x84 [border: (2px solid #FF0000)]
    1818        RenderBlock {DIV} at (14,14) size 756x56
    19           RenderText {#text} at (0,0) size 40x28
    20             text run at (0,0) width 40: "One"
    21           RenderText {#text} at (40,0) size 44x28
    22             text run at (40,0) width 44: "Two"
     19          RenderText {#text} at (0,0) size 84x28
     20            text run at (0,0) width 84: "OneTwo"
    2321          RenderBR {BR} at (84,22) size 0x0
    2422          RenderText {#text} at (0,28) size 57x28
  • trunk/LayoutTests/platform/mac/editing/deleting/delete-block-merge-contents-003-expected.txt

    r96264 r96870  
    77EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    88EDITING DELEGATE: shouldDeleteDOMRange:range from 6 of #text > DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > DIV > BODY > HTML > #document
    9 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 4 of #text > DIV > DIV > BODY > HTML > #document to 4 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 4 of #text > DIV > DIV > BODY > HTML > #document to 4 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     9EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 7 of #text > DIV > DIV > BODY > HTML > #document to 7 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 4 of #text > DIV > DIV > BODY > HTML > #document to 4 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    1010EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    1111EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
     
    1717      RenderBlock {DIV} at (0,0) size 784x84 [border: (2px solid #FF0000)]
    1818        RenderBlock {DIV} at (14,14) size 756x56
    19           RenderText {#text} at (0,0) size 40x28
    20             text run at (0,0) width 40: "One"
    21           RenderText {#text} at (40,0) size 44x28
    22             text run at (40,0) width 44: "Two"
     19          RenderText {#text} at (0,0) size 84x28
     20            text run at (0,0) width 84: "OneTwo"
    2321          RenderBR {BR} at (84,22) size 0x0
    2422          RenderText {#text} at (0,28) size 57x28
  • trunk/LayoutTests/platform/mac/editing/deleting/delete-block-merge-contents-004-expected.txt

    r96264 r96870  
    77EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    88EDITING DELEGATE: shouldDeleteDOMRange:range from 6 of #text > DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > DIV > BODY > HTML > #document
    9 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 4 of #text > DIV > DIV > BODY > HTML > #document to 4 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 4 of #text > DIV > DIV > BODY > HTML > #document to 4 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     9EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 7 of #text > DIV > DIV > BODY > HTML > #document to 7 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 4 of #text > DIV > DIV > BODY > HTML > #document to 4 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    1010EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    1111EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
     
    1717      RenderBlock {DIV} at (0,0) size 784x84 [border: (2px solid #FF0000)]
    1818        RenderBlock {DIV} at (14,14) size 756x56
    19           RenderText {#text} at (0,0) size 40x28
    20             text run at (0,0) width 40: "One"
    21           RenderText {#text} at (40,0) size 44x28
    22             text run at (40,0) width 44: "Two"
     19          RenderText {#text} at (0,0) size 84x28
     20            text run at (0,0) width 84: "OneTwo"
    2321          RenderBR {BR} at (84,22) size 0x0
    2422          RenderText {#text} at (0,28) size 57x28
  • trunk/LayoutTests/platform/mac/editing/deleting/delete-block-merge-contents-005-expected.txt

    r96264 r96870  
    1818        RenderBlock {DIV} at (14,14) size 756x84
    1919          RenderBlock (anonymous) at (0,0) size 756x28
    20             RenderText {#text} at (0,0) size 40x28
    21               text run at (0,0) width 40: "One"
    22             RenderText {#text} at (40,0) size 44x28
    23               text run at (40,0) width 44: "Two"
     20            RenderText {#text} at (0,0) size 84x28
     21              text run at (0,0) width 84: "OneTwo"
    2422          RenderBlock {DIV} at (0,28) size 756x28
    2523            RenderBlock (anonymous) at (0,0) size 756x0
  • trunk/LayoutTests/platform/mac/editing/deleting/delete-block-merge-contents-006-expected.txt

    r96264 r96870  
    1818        RenderBlock {DIV} at (14,14) size 756x84
    1919          RenderBlock (anonymous) at (0,0) size 756x28
    20             RenderText {#text} at (0,0) size 40x28
    21               text run at (0,0) width 40: "One"
    22             RenderText {#text} at (40,0) size 44x28
    23               text run at (40,0) width 44: "Two"
     20            RenderText {#text} at (0,0) size 84x28
     21              text run at (0,0) width 84: "OneTwo"
    2422          RenderBlock {DIV} at (0,28) size 756x28
    2523            RenderBlock (anonymous) at (0,0) size 756x0
  • trunk/LayoutTests/platform/mac/editing/deleting/delete-block-merge-contents-007-expected.txt

    r96264 r96870  
    1818        RenderBlock {DIV} at (14,14) size 756x84
    1919          RenderBlock (anonymous) at (0,0) size 756x28
    20             RenderText {#text} at (0,0) size 40x28
    21               text run at (0,0) width 40: "One"
    22             RenderText {#text} at (40,0) size 44x28
    23               text run at (40,0) width 44: "Two"
     20            RenderText {#text} at (0,0) size 84x28
     21              text run at (0,0) width 84: "OneTwo"
    2422          RenderBlock {DIV} at (0,28) size 756x28
    2523            RenderBlock (anonymous) at (0,0) size 756x0
  • trunk/LayoutTests/platform/mac/editing/deleting/delete-block-merge-contents-008-expected.txt

    r96264 r96870  
    1818        RenderBlock {DIV} at (14,14) size 756x84
    1919          RenderBlock (anonymous) at (0,0) size 756x28
    20             RenderText {#text} at (0,0) size 40x28
    21               text run at (0,0) width 40: "One"
    22             RenderText {#text} at (40,0) size 44x28
    23               text run at (40,0) width 44: "Two"
     20            RenderText {#text} at (0,0) size 84x28
     21              text run at (0,0) width 84: "OneTwo"
    2422          RenderBlock {DIV} at (0,28) size 756x56
    2523            RenderBlock {DIV} at (0,0) size 756x28
  • trunk/LayoutTests/platform/mac/editing/deleting/delete-block-merge-contents-009-expected.txt

    r96264 r96870  
    1111EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    1212EDITING DELEGATE: shouldDeleteDOMRange:range from 1 of DIV > DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > DIV > DIV > BODY > HTML > #document
    13 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 3 of #text > DIV > DIV > DIV > BODY > HTML > #document to 3 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 3 of #text > DIV > DIV > DIV > BODY > HTML > #document to 3 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     13EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 8 of #text > DIV > DIV > DIV > BODY > HTML > #document to 8 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 3 of #text > DIV > DIV > DIV > BODY > HTML > #document to 3 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    1414EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    1515EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
     
    2525              text run at (0,0) width 40: "One"
    2626          RenderBlock {DIV} at (0,28) size 756x56
    27             RenderText {#text} at (0,0) size 44x28
    28               text run at (0,0) width 44: "Two"
    29             RenderText {#text} at (44,0) size 57x28
    30               text run at (44,0) width 57: "Three"
     27            RenderText {#text} at (0,0) size 101x28
     28              text run at (0,0) width 101: "TwoThree"
    3129            RenderBR {BR} at (101,22) size 0x0
    3230            RenderText {#text} at (0,28) size 45x28
  • trunk/LayoutTests/platform/mac/editing/deleting/delete-block-merge-contents-010-expected.txt

    r96264 r96870  
    1414EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    1515EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    16 EDITING DELEGATE: shouldDeleteDOMRange:range from 3 of #text > DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > DIV > DIV > BODY > HTML > #document
    17 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 3 of #text > DIV > DIV > BODY > HTML > #document to 3 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 3 of #text > DIV > DIV > BODY > HTML > #document to 3 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     16EDITING DELEGATE: shouldDeleteDOMRange:range from 7 of #text > DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > DIV > DIV > BODY > HTML > #document
     17EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 12 of #text > DIV > DIV > BODY > HTML > #document to 12 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 7 of #text > DIV > DIV > BODY > HTML > #document to 7 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    1818EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    1919EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
     
    2424EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    2525EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    26 EDITING DELEGATE: shouldDeleteDOMRange:range from 3 of DIV > DIV > BODY > HTML > #document to 4 of DIV > DIV > BODY > HTML > #document
     26EDITING DELEGATE: shouldDeleteDOMRange:range from 1 of DIV > DIV > BODY > HTML > #document to 2 of DIV > DIV > BODY > HTML > #document
    2727EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    28 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 5 of #text > DIV > DIV > BODY > HTML > #document to 5 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 5 of #text > DIV > DIV > BODY > HTML > #document to 5 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     28EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 12 of #text > DIV > DIV > BODY > HTML > #document to 12 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 12 of #text > DIV > DIV > BODY > HTML > #document to 12 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    2929EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    3030EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
     
    3636      RenderBlock {DIV} at (0,0) size 784x56 [border: (2px solid #FF0000)]
    3737        RenderBlock {DIV} at (14,14) size 756x28
    38           RenderText {#text} at (0,0) size 40x28
    39             text run at (0,0) width 40: "One"
    40           RenderText {#text} at (40,0) size 44x28
    41             text run at (40,0) width 44: "Two"
    42           RenderText {#text} at (84,0) size 57x28
    43             text run at (84,0) width 57: "Three"
     38          RenderText {#text} at (0,0) size 141x28
     39            text run at (0,0) width 141: "OneTwoThree"
    4440          RenderText {#text} at (141,0) size 45x28
    4541            text run at (141,0) width 45: "Four"
    46 caret: position 5 of child 2 {#text} of child 1 {DIV} of child 1 {DIV} of body
     42caret: position 12 of child 0 {#text} of child 1 {DIV} of child 1 {DIV} of body
  • trunk/LayoutTests/platform/mac/editing/deleting/delete-block-merge-contents-012-expected.txt

    r96264 r96870  
    4242        RenderBlock {DIV} at (14,14) size 756x28
    4343          RenderBlock {DIV} at (0,0) size 756x28
    44             RenderText {#text} at (0,0) size 71x28
    45               text run at (0,0) width 71: "This is "
    46             RenderText {#text} at (71,0) size 106x28
    47               text run at (71,0) width 106: " some text."
     44            RenderText {#text} at (0,0) size 177x28
     45              text run at (0,0) width 177: "This is  some text."
    4846caret: position 8 of child 0 {#text} of child 1 {DIV} of child 1 {DIV} of child 1 {DIV} of body
  • trunk/LayoutTests/platform/mac/editing/deleting/delete-block-merge-contents-013-expected.txt

    r96264 r96870  
    4343        RenderBlock {DIV} at (14,14) size 756x28
    4444          RenderBlock {DIV} at (0,0) size 756x28
    45             RenderText {#text} at (0,0) size 71x28
    46               text run at (0,0) width 71: "This is "
    47             RenderText {#text} at (71,0) size 100x28
    48               text run at (71,0) width 100: "some text."
     45            RenderText {#text} at (0,0) size 171x28
     46              text run at (0,0) width 171: "This is some text."
    4947caret: position 8 of child 0 {#text} of child 1 {DIV} of child 1 {DIV} of child 1 {DIV} of body
  • trunk/LayoutTests/platform/mac/editing/deleting/delete-block-merge-contents-014-expected.txt

    r96264 r96870  
    3030EDITING DELEGATE: shouldDeleteDOMRange:range from 7 of #text > DIV > DIV > DIV > BODY > HTML > #document to 7 of #text > DIV > DIV > DIV > BODY > HTML > #document
    3131EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    32 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > DIV > DIV > DIV > BODY > HTML > #document to 2 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 7 of #text > DIV > DIV > DIV > BODY > HTML > #document to 7 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     32EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 7 of #text > DIV > DIV > DIV > BODY > HTML > #document to 2 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 7 of #text > DIV > DIV > DIV > BODY > HTML > #document to 7 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    3333EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    3434EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
     
    4141        RenderBlock {DIV} at (14,14) size 756x28
    4242          RenderBlock {DIV} at (0,0) size 756x28
    43             RenderText {#text} at (0,0) size 65x28
    44               text run at (0,0) width 65: "This is"
    45             RenderText {#text} at (65,0) size 106x28
    46               text run at (65,0) width 106: " some text."
     43            RenderText {#text} at (0,0) size 171x28
     44              text run at (0,0) width 171: "This is some text."
    4745caret: position 7 of child 0 {#text} of child 1 {DIV} of child 1 {DIV} of child 1 {DIV} of body
  • trunk/LayoutTests/platform/mac/editing/deleting/delete-block-merge-contents-015-expected.txt

    r96264 r96870  
    3030EDITING DELEGATE: shouldDeleteDOMRange:range from 7 of #text > DIV > DIV > DIV > BODY > HTML > #document to 7 of #text > DIV > DIV > DIV > BODY > HTML > #document
    3131EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    32 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > DIV > DIV > DIV > BODY > HTML > #document to 2 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 7 of #text > DIV > DIV > DIV > BODY > HTML > #document to 7 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     32EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 7 of #text > DIV > DIV > DIV > BODY > HTML > #document to 2 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 7 of #text > DIV > DIV > DIV > BODY > HTML > #document to 7 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    3333EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    3434EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
     
    4141        RenderBlock {DIV} at (14,14) size 756x28
    4242          RenderBlock {DIV} at (0,0) size 756x28
    43             RenderText {#text} at (0,0) size 65x28
    44               text run at (0,0) width 65: "This is"
    45             RenderText {#text} at (65,0) size 106x28
    46               text run at (65,0) width 106: " some text."
     43            RenderText {#text} at (0,0) size 171x28
     44              text run at (0,0) width 171: "This is some text."
    4745caret: position 7 of child 0 {#text} of child 1 {DIV} of child 1 {DIV} of child 1 {DIV} of body
  • trunk/LayoutTests/platform/mac/editing/deleting/delete-block-merge-contents-016-expected.txt

    r96264 r96870  
    3030EDITING DELEGATE: shouldDeleteDOMRange:range from 7 of #text > DIV > DIV > DIV > BODY > HTML > #document to 7 of #text > DIV > DIV > DIV > BODY > HTML > #document
    3131EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    32 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > DIV > DIV > DIV > BODY > HTML > #document to 2 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 7 of #text > DIV > DIV > DIV > BODY > HTML > #document to 7 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     32EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 7 of #text > DIV > DIV > DIV > BODY > HTML > #document to 2 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 7 of #text > DIV > DIV > DIV > BODY > HTML > #document to 7 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    3333EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    3434EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
     
    4141        RenderBlock {DIV} at (14,14) size 756x28
    4242          RenderBlock {DIV} at (0,0) size 756x28
    43             RenderText {#text} at (0,0) size 65x28
    44               text run at (0,0) width 65: "This is"
    45             RenderText {#text} at (65,0) size 106x28
    46               text run at (65,0) width 106: " some text."
     43            RenderText {#text} at (0,0) size 171x28
     44              text run at (0,0) width 171: "This is some text."
    4745caret: position 7 of child 0 {#text} of child 1 {DIV} of child 1 {DIV} of child 1 {DIV} of body
  • trunk/LayoutTests/platform/mac/editing/deleting/delete-block-merge-contents-017-expected.txt

    r96264 r96870  
    4343        RenderBlock {DIV} at (14,14) size 756x28
    4444          RenderBlock {DIV} at (0,0) size 756x28
    45             RenderText {#text} at (0,0) size 71x28
    46               text run at (0,0) width 71: "This is "
    47             RenderText {#text} at (71,0) size 106x28
    48               text run at (71,0) width 106: " some text."
     45            RenderText {#text} at (0,0) size 177x28
     46              text run at (0,0) width 177: "This is  some text."
    4947caret: position 8 of child 0 {#text} of child 1 {DIV} of child 1 {DIV} of child 1 {DIV} of body
  • trunk/LayoutTests/platform/mac/editing/deleting/delete-br-010-expected.txt

    r96264 r96870  
    2020    RenderBody {BODY} at (8,8) size 784x584
    2121      RenderBlock {DIV} at (0,0) size 784x56 [border: (2px solid #FF0000)]
    22         RenderText {#text} at (14,14) size 40x28
    23           text run at (14,14) width 40: "One"
    24         RenderText {#text} at (54,14) size 44x28
    25           text run at (54,14) width 44: "Two"
     22        RenderText {#text} at (14,14) size 84x28
     23          text run at (14,14) width 84: "OneTwo"
    2624      RenderBlock (anonymous) at (0,56) size 784x0
    2725caret: position 3 of child 0 {#text} of child 1 {DIV} of body
  • trunk/LayoutTests/platform/mac/editing/deleting/delete-line-012-expected.txt

    r96264 r96870  
    2525EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    2626EDITING DELEGATE: shouldDeleteDOMRange:range from 10 of #text > DIV > BODY > HTML > #document to 2 of DIV > BODY > HTML > #document
    27 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > DIV > BODY > HTML > #document to 2 of BODY > HTML > #document toDOMRange:range from 10 of #text > DIV > BODY > HTML > #document to 10 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     27EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 10 of #text > DIV > BODY > HTML > #document to 2 of BODY > HTML > #document toDOMRange:range from 10 of #text > DIV > BODY > HTML > #document to 10 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    2828EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    2929EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
     
    3434    RenderBody {BODY} at (8,8) size 784x584
    3535      RenderBlock {DIV} at (0,0) size 600x28
    36         RenderText {#text} at (0,0) size 96x28
    37           text run at (0,0) width 96: "There is a"
    38         RenderText {#text} at (96,0) size 241x28
    39           text run at (96,0) width 241: "Which taken at the flood"
     36        RenderText {#text} at (0,0) size 337x28
     37          text run at (0,0) width 337: "There is aWhich taken at the flood"
    4038caret: position 10 of child 0 {#text} of child 1 {DIV} of body
  • trunk/LayoutTests/platform/mac/editing/deleting/delete-listitem-001-expected.txt

    r96264 r96870  
    1818EDITING DELEGATE: shouldDeleteDOMRange:range from 0 of #text > LI > UL > DIV > BODY > HTML > #document to 1 of #text > LI > UL > DIV > BODY > HTML > #document
    1919EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    20 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of LI > UL > DIV > BODY > HTML > #document to 0 of LI > UL > DIV > BODY > HTML > #document toDOMRange:range from 0 of LI > UL > DIV > BODY > HTML > #document to 0 of LI > UL > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    2120EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    2221EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
     
    3332        RenderBlock {UL} at (14,38) size 756x84
    3433          RenderListItem {LI} at (40,0) size 716x28
    35             RenderText {#text} at (0,0) size 35x28
    36               text run at (0,0) width 35: "one"
    37             RenderText {#text} at (35,0) size 49x28
    38               text run at (35,0) width 49: "three"
     34            RenderText {#text} at (0,0) size 84x28
     35              text run at (0,0) width 84: "onethree"
    3936          RenderListItem {LI} at (40,28) size 716x28
    4037            RenderText {#text} at (0,0) size 40x28
  • trunk/LayoutTests/platform/mac/editing/deleting/merge-whitespace-pre-expected.txt

    r95745 r96870  
    1111      RenderBlock {DIV} at (0,52) size 784x46
    1212        RenderBlock {DIV} at (0,0) size 784x18
    13           RenderText {#text} at (0,0) size 21x18
    14             text run at (0,0) width 21: "foo"
    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"
     13          RenderText {#text} at (0,0) size 41x18
     14            text run at (0,0) width 41: "foobar"
    1815        RenderBlock {PRE} at (0,31) size 784x15
    1916          RenderText {#text} at (0,0) size 24x15
  • trunk/LayoutTests/platform/mac/editing/inserting/multiple-lines-selected-expected.txt

    r96264 r96870  
    55EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    66EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    7 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > DIV > DIV > BODY > HTML > #document to 1 of DIV > BODY > HTML > #document toDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     7EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
     8EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of DIV > DIV > BODY > HTML > #document to 1 of DIV > BODY > HTML > #document toDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    89EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    910EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
  • trunk/LayoutTests/platform/mac/editing/pasteboard/5032095-expected.txt

    r63291 r96870  
    1010          text run at (0,18) width 145: "see 'helloworld' below."
    1111      RenderBlock {DIV} at (0,52) size 784x18
    12         RenderText {#text} at (0,0) size 31x18
    13           text run at (0,0) width 31: "hello"
    14         RenderText {#text} at (31,0) size 37x18
    15           text run at (31,0) width 37: "world"
    16 caret: position 5 of child 1 {#text} of child 2 {DIV} of body
     12        RenderText {#text} at (0,0) size 68x18
     13          text run at (0,0) width 68: "helloworld"
     14caret: position 10 of child 0 {#text} of child 2 {DIV} of body
  • trunk/LayoutTests/platform/mac/editing/pasteboard/merge-after-delete-1-expected.txt

    r96264 r96870  
    55EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    66EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    7 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > DIV > DIV > BODY > HTML > #document to 1 of DIV > BODY > HTML > #document toDOMRange:range from 3 of #text > DIV > DIV > BODY > HTML > #document to 3 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     7EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > DIV > DIV > BODY > HTML > #document to 1 of DIV > BODY > HTML > #document toDOMRange:range from 3 of #text > DIV > DIV > BODY > HTML > #document to 3 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    88EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    99EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
     
    2929      RenderBlock {DIV} at (2,158) size 780x48 [border: (1px solid #000000)]
    3030        RenderBlock {DIV} at (3,3) size 774x20 [border: (1px solid #FF0000)]
    31           RenderText {#text} at (1,1) size 8x18
    32             text run at (1,1) width 8: "b"
    33           RenderText {#text} at (9,1) size 21x18
    34             text run at (9,1) width 21: "foo"
     31          RenderText {#text} at (1,1) size 29x18
     32            text run at (1,1) width 29: "bfoo"
    3533        RenderBlock {DIV} at (3,25) size 774x20 [border: (1px solid #000000)]
    3634          RenderText {#text} at (1,1) size 20x18
  • trunk/LayoutTests/platform/mac/editing/pasteboard/merge-after-delete-2-expected.txt

    r96264 r96870  
    55EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    66EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    7 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > DIV > DIV > BODY > HTML > #document to 1 of DIV > BODY > HTML > #document toDOMRange:range from 3 of #text > DIV > DIV > BODY > HTML > #document to 3 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     7EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > DIV > DIV > BODY > HTML > #document to 1 of DIV > BODY > HTML > #document toDOMRange:range from 3 of #text > DIV > DIV > BODY > HTML > #document to 3 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    88EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    99EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
     
    2929      RenderBlock {DIV} at (2,158) size 780x48 [border: (1px solid #000000)]
    3030        RenderBlock {DIV} at (3,3) size 774x20 [border: (1px solid #FF0000)]
    31           RenderText {#text} at (1,1) size 8x18
    32             text run at (1,1) width 8: "b"
    33           RenderText {#text} at (9,1) size 21x18
    34             text run at (9,1) width 21: "foo"
     31          RenderText {#text} at (1,1) size 29x18
     32            text run at (1,1) width 29: "bfoo"
    3533        RenderBlock (anonymous) at (1,25) size 778x0
    3634        RenderBlock {DIV} at (3,25) size 774x20 [border: (1px solid #000000)]
  • trunk/LayoutTests/platform/mac/editing/pasteboard/merge-after-delete-expected.txt

    r96264 r96870  
    55EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    66EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    7 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > DIV > DIV > BODY > HTML > #document to 1 of DIV > BODY > HTML > #document toDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     7EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > DIV > DIV > BODY > HTML > #document to 1 of DIV > BODY > HTML > #document toDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    88EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    99EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
     
    1515      RenderBlock {DIV} at (4,0) size 776x54 [border: (1px solid #0000FF)]
    1616        RenderBlock {DIV} at (5,5) size 766x20 [border: (1px solid #0000FF)]
    17           RenderText {#text} at (1,1) size 5x18
    18             text run at (1,1) width 5: "f"
    19           RenderText {#text} at (6,1) size 21x18
    20             text run at (6,1) width 21: "foo"
     17          RenderText {#text} at (1,1) size 26x18
     18            text run at (1,1) width 26: "ffoo"
    2119        RenderBlock (anonymous) at (1,29) size 774x0
    2220        RenderBlock {DIV} at (5,29) size 766x20 [border: (1px solid #0000FF)]
  • trunk/LayoutTests/platform/mac/editing/pasteboard/merge-end-blockquote-expected.txt

    r96264 r96870  
    22EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
    33EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    4 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 16 of #text > DIV > BODY > HTML > #document to 16 of #text > DIV > BODY > HTML > #document toDOMRange:range from 16 of #text > DIV > BODY > HTML > #document to 16 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     4EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 16 of #text > DIV > BODY > HTML > #document to 16 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    55EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    66EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
    7 EDITING DELEGATE: shouldEndEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 2 of DIV > BODY > HTML > #document
     7EDITING DELEGATE: shouldEndEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 1 of DIV > BODY > HTML > #document
    88EDITING DELEGATE: webViewDidEndEditing:WebViewDidEndEditingNotification
    99EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 1 of DIV > BODY > HTML > #document
     
    1212EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    1313EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    14 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 11 of #text > DIV > BLOCKQUOTE > DIV > BODY > HTML > #document to 11 of #text > DIV > BLOCKQUOTE > DIV > BODY > HTML > #document toDOMRange:range from 3 of #text > DIV > BLOCKQUOTE > DIV > BODY > HTML > #document to 3 of #text > DIV > BLOCKQUOTE > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     14EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 14 of #text > DIV > BLOCKQUOTE > DIV > BODY > HTML > #document to 14 of #text > DIV > BLOCKQUOTE > DIV > BODY > HTML > #document toDOMRange:range from 4 of #text > DIV > BLOCKQUOTE > DIV > BODY > HTML > #document to 4 of #text > DIV > BLOCKQUOTE > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    1515EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    1616EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
     
    2525          text run at (397,0) width 209: "Blockquoting should be stripped."
    2626      RenderBlock {DIV} at (0,34) size 784x18
    27         RenderText {#text} at (0,0) size 114x18
    28           text run at (0,0) width 114: "Blockquoted Text"
    29         RenderText {#text} at (114,0) size 8x18
    30           text run at (114,0) width 8: "x"
     27        RenderText {#text} at (0,0) size 122x18
     28          text run at (0,0) width 122: "Blockquoted Textx"
    3129      RenderBlock {P} at (0,68) size 784x36
    3230        RenderText {#text} at (0,0) size 759x36
     
    3735        RenderBlock {BLOCKQUOTE} at (40,0) size 704x18
    3836          RenderBlock {DIV} at (0,0) size 704x18
    39             RenderText {#text} at (0,0) size 81x18
    40               text run at (0,0) width 81: "Blockquoted"
    41             RenderText {#text} at (81,0) size 21x18
    42               text run at (81,0) width 21: "foo"
     37            RenderText {#text} at (0,0) size 102x18
     38              text run at (0,0) width 102: "Blockquotedfoo"
    4339        RenderBlock (anonymous) at (0,34) size 784x0
    4440        RenderBlock {BLOCKQUOTE} at (40,34) size 704x18
    4541          RenderBlock {DIV} at (0,0) size 704x18
    46             RenderText {#text} at (0,0) size 20x18
    47               text run at (0,0) width 20: "bar"
    48             RenderText {#text} at (20,0) size 29x18
    49               text run at (20,0) width 29: "Text"
    50 caret: position 3 of child 0 {#text} of child 0 {DIV} of child 1 {BLOCKQUOTE} of child 10 {DIV} of body
     42            RenderText {#text} at (0,0) size 49x18
     43              text run at (0,0) width 49: "barText"
     44caret: position 4 of child 0 {#text} of child 0 {DIV} of child 1 {BLOCKQUOTE} of child 10 {DIV} of body
  • trunk/LayoutTests/platform/mac/editing/pasteboard/paste-blockquote-into-blockquote-4-expected.txt

    r63291 r96870  
    1212            text run at (22,0) width 33: "Paste"
    1313          RenderBR {BR} at (55,14) size 0x0
    14           RenderText {#text} at (22,18) size 31x18
    15             text run at (22,18) width 31: "Here"
    16           RenderText {#text} at (53,18) size 27x18
    17             text run at (53,18) width 27: "One"
     14          RenderText {#text} at (22,18) size 58x18
     15            text run at (22,18) width 58: "HereOne"
    1816        RenderBlock (anonymous) at (0,36) size 784x18
    1917          RenderText {#text} at (0,0) size 30x18
  • trunk/LayoutTests/platform/mac/editing/pasteboard/paste-match-style-001-expected.txt

    r96264 r96870  
    1212EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
    1313EDITING DELEGATE: shouldInsertText:b replacingDOMRange:range from 1 of #text > B > DIV > DIV > BODY > HTML > #document to 1 of #text > B > DIV > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
    14 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > B > DIV > DIV > BODY > HTML > #document to 1 of #text > B > DIV > DIV > BODY > HTML > #document toDOMRange:range from 2 of #text > B > DIV > DIV > BODY > HTML > #document to 2 of #text > B > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     14EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > B > DIV > DIV > BODY > HTML > #document to 1 of #text > B > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    1515EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    1616EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
     
    4242        RenderBlock {DIV} at (0,0) size 784x32 [border: (2px solid #FF0000)]
    4343          RenderInline {B} at (0,0) size 25x28
    44             RenderText {#text} at (2,2) size 25x28
    45               text run at (2,2) width 25: "ab"
    46 caret: position 2 of child 0 {#text} of child 0 {B} of child 1 {DIV} of child 3 {DIV} of body
     44            RenderText {#text} at (2,2) size 12x28
     45              text run at (2,2) width 12: "a"
     46            RenderText {#text} at (14,2) size 13x28
     47              text run at (14,2) width 13: "b"
     48        RenderBlock (anonymous) at (0,32) size 784x0
     49          RenderText {#text} at (0,0) size 0x0
     50caret: position 1 of child 1 {#text} of child 0 {B} of child 1 {DIV} of child 3 {DIV} of body
  • trunk/Source/WebCore/ChangeLog

    r96868 r96870  
     12011-10-05  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Deleting line break before h1 converts h1 to span
     4        https://bugs.webkit.org/show_bug.cgi?id=45784
     5
     6        Reviewed by Enrica Casucci.
     7
     8        This patch fundamentally alters the kind of styles we preserve while merging or moving paragraphs.
     9        StylizedMarkupAccumulator no longer wraps nodes by computed style when it's not annotating for interchange.
     10        Instead, it accumulates implicit and inline styles of ancestors of the serialized contents.
     11
     12        The most significant code change is in StyledMarkupAccumulator::serializeNodes where we setup m_wrappingStyle
     13        by merging implicit and inline style of ancestors with mergeInlineAndImplicitStyleOfElement. Because it walks up
     14        the DOM tree upwards, it should not be overriding any CSS properties. Consequently, mergeStyle,
     15        mergeInlineStyleOfElement, and mergeInlineAndImplicitStyleOfElement are modified to take CSSPropertyOverrideMode.
     16
     17        New behavior matches that of Internet Explorer and Firefox when merging paragraphs.
     18
     19        Tests: editing/deleting/merge-paragraph-from-address.html
     20               editing/deleting/merge-paragraph-from-h6-with-style-2.html
     21               editing/deleting/merge-paragraph-from-h6-with-style.html
     22               editing/deleting/merge-paragraph-from-h6.html
     23               editing/deleting/merge-paragraph-from-listing.html
     24               editing/deleting/merge-paragraph-from-p-with-style-2.html
     25               editing/deleting/merge-paragraph-from-p-with-style-3.html
     26               editing/deleting/merge-paragraph-from-p-with-style.html
     27               editing/deleting/merge-paragraph-into-h1-with-style.html
     28               editing/deleting/merge-paragraph-into-h1.html
     29               editing/deleting/merge-paragraph-into-pre.html
     30
     31        * css/CSSValueList.cpp:
     32        (WebCore::CSSValueList::hasValue): Made const.
     33        * css/CSSValueList.h:
     34        * editing/ApplyStyleCommand.cpp:
     35        (WebCore::ApplyStyleCommand::removeInlineStyleFromElement): Calls mergeInlineStyleOfElement.
     36        (WebCore::ApplyStyleCommand::applyInlineStyleToPushDown): Ditto.
     37        * editing/EditingStyle.cpp:
     38        (WebCore::copyEditingProperties): Takes a boolean includeBackgroundColor.
     39        (WebCore::isEditingProperty): Extracted from elementIsStyledSpanOrHTMLEquivalent.
     40        (WebCore::EditingStyle::elementIsStyledSpanOrHTMLEquivalent): Calls isEditingProperty.
     41        (WebCore::EditingStyle::mergeTypingStyle): Calls mergeStyle.
     42        (WebCore::EditingStyle::mergeInlineStyleOfElement): Takes CSSPropertyOverrideMode.
     43        (WebCore::elementMatchesAndPropertyIsNotInInlineStyleDecl): Added.
     44        (WebCore::EditingStyle::mergeInlineAndImplicitStyleOfElement): Added.
     45        (WebCore::mergeTextDecorationValues): Extracted from mergeStyle.
     46        (WebCore::EditingStyle::mergeStyle): Takes CSSPropertyOverrideMode.
     47        * editing/EditingStyle.h:
     48        * editing/ReplaceSelectionCommand.cpp:
     49        (WebCore::nodeToSplitToAvoidPastingIntoInlineNodesWithStyle): Extracted from doApply.
     50        (WebCore::ReplaceSelectionCommand::doApply): Calls nodeToSplitToAvoidPastingIntoInlineNodesWithStyle.
     51        (WebCore::ReplaceSelectionCommand::performTrivialReplace): Exit early when we need to split the tree to avoid
     52        pasting into inline nodes with style. Also remove a collapsed or spurious br.
     53        * editing/markup.cpp:
     54        (WebCore::StyledMarkupAccumulator::serializeNodes):
     55
    1562011-10-06  Abhishek Arya  <inferno@chromium.org>
    257
  • trunk/Source/WebCore/css/CSSValueList.cpp

    r92106 r96870  
    7777}
    7878   
    79 bool CSSValueList::hasValue(CSSValue* val)
     79bool CSSValueList::hasValue(CSSValue* val) const
    8080{
    8181    // FIXME: we should be implementing operator== to CSSValue and its derived classes
  • trunk/Source/WebCore/css/CSSValueList.h

    r92106 r96870  
    5454    void prepend(PassRefPtr<CSSValue>);
    5555    bool removeAll(CSSValue*);
    56     bool hasValue(CSSValue*);
     56    bool hasValue(CSSValue*) const;
    5757    PassRefPtr<CSSValueList> copy();
    5858
  • trunk/Source/WebCore/editing/ApplyStyleCommand.cpp

    r94840 r96870  
    820820            return true;
    821821        ASSERT(extractedStyle);
    822         extractedStyle->mergeInlineStyleOfElement(element.get());
     822        extractedStyle->mergeInlineStyleOfElement(element.get(), EditingStyle::OverrideValues);
    823823        removeNodePreservingChildren(element);
    824824        return true;
     
    938938    if (node->isHTMLElement() && static_cast<HTMLElement*>(node)->inlineStyleDecl()) {
    939939        newInlineStyle = style->copy();
    940         newInlineStyle->mergeInlineStyleOfElement(static_cast<HTMLElement*>(node));
     940        newInlineStyle->mergeInlineStyleOfElement(static_cast<HTMLElement*>(node), EditingStyle::OverrideValues);
    941941    }
    942942
  • trunk/Source/WebCore/editing/EditingStyle.cpp

    r95901 r96870  
    11/*
    22 * Copyright (C) 2007, 2008, 2009 Apple Computer, Inc.
    3  * Copyright (C) 2010 Google Inc. All rights reserved.
     3 * Copyright (C) 2010, 2011 Google Inc. All rights reserved.
    44 *
    55 * Redistribution and use in source and binary forms, with or without
     
    5353// Editing style properties must be preserved during editing operation.
    5454// e.g. when a user inserts a new paragraph, all properties listed here must be copied to the new paragraph.
    55 static const int editingInheritableProperties[] = {
     55static const int editingProperties[] = {
     56    CSSPropertyBackgroundColor,
     57
    5658    // CSS inheritable properties
    5759    CSSPropertyColor,
     
    7678    CSSPropertyWebkitTextStrokeWidth,
    7779};
    78 size_t numEditingInheritableProperties = WTF_ARRAY_LENGTH(editingInheritableProperties);
    79 
    80 static PassRefPtr<CSSMutableStyleDeclaration> copyEditingProperties(CSSStyleDeclaration* style)
    81 {
    82     return style->copyPropertiesInSet(editingInheritableProperties, numEditingInheritableProperties);
     80
     81static PassRefPtr<CSSMutableStyleDeclaration> copyEditingProperties(CSSStyleDeclaration* style, bool includeBackgroundColor = false)
     82{
     83    if (includeBackgroundColor)
     84        return style->copyPropertiesInSet(editingProperties, WTF_ARRAY_LENGTH(editingProperties));
     85    return style->copyPropertiesInSet(editingProperties + 1, WTF_ARRAY_LENGTH(editingProperties) - 1);
     86}
     87
     88static inline bool isEditingProperty(int id)
     89{
     90    for (size_t i = 0; i < WTF_ARRAY_LENGTH(editingProperties); ++i) {
     91        if (editingProperties[i] == id)
     92            return true;
     93    }
     94    return false;
    8395}
    8496
     
    102114    virtual bool matches(const Element* element) const { return !m_tagName || element->hasTagName(*m_tagName); }
    103115    virtual bool hasAttribute() const { return false; }
    104     virtual bool propertyExistsInStyle(CSSStyleDeclaration* style) const { return style->getPropertyCSSValue(m_propertyID); }
     116    virtual bool propertyExistsInStyle(CSSStyleDeclaration* style) const { return style && style->getPropertyCSSValue(m_propertyID); }
    105117    virtual bool valueIsPresentInStyle(Element*, CSSStyleDeclaration*) const;
    106118    virtual void addToStyle(Element*, EditingStyle*) const;
     
    785797            CSSMutableStyleDeclaration::const_iterator end = style->end();
    786798            for (CSSMutableStyleDeclaration::const_iterator it = style->begin(); it != end; ++it) {
    787                 bool matched = false;
    788                 for (size_t i = 0; i < numEditingInheritableProperties; ++i) {
    789                     if (editingInheritableProperties[i] == it->id()) {
    790                         matched = true;
    791                         break;
    792                     }
    793                 }
    794                 if (!matched && it->id() != CSSPropertyBackgroundColor)
     799                if (!isEditingProperty(it->id()))
    795800                    return false;
    796801            }
     
    844849        return;
    845850
    846     mergeStyle(typingStyle->style());
    847 }
    848 
    849 void EditingStyle::mergeInlineStyleOfElement(StyledElement* element)
     851    mergeStyle(typingStyle->style(), OverrideValues);
     852}
     853
     854void EditingStyle::mergeInlineStyleOfElement(StyledElement* element, CSSPropertyOverrideMode mode, PropertiesToInclude propertiesToInclude)
    850855{
    851856    ASSERT(element);
    852     mergeStyle(element->inlineStyleDecl());
    853 }
    854 
    855 void EditingStyle::mergeStyle(CSSMutableStyleDeclaration* style)
     857    if (!element->inlineStyleDecl())
     858        return;
     859
     860    switch (propertiesToInclude) {
     861    case AllProperties:
     862        mergeStyle(element->inlineStyleDecl(), mode);
     863        return;
     864    case OnlyEditingInheritableProperties:
     865    case EditingInheritablePropertiesAndBackgroundColorInEffect:
     866        mergeStyle(copyEditingProperties(element->inlineStyleDecl(), propertiesToInclude == EditingInheritablePropertiesAndBackgroundColorInEffect).get(), mode);
     867        return;
     868    }
     869}
     870
     871static inline bool elementMatchesAndPropertyIsNotInInlineStyleDecl(const HTMLElementEquivalent* equivalent, const StyledElement* element,
     872    EditingStyle::CSSPropertyOverrideMode mode, CSSMutableStyleDeclaration* style)
     873{
     874    return equivalent->matches(element) && !equivalent->propertyExistsInStyle(element->inlineStyleDecl())
     875        && (mode == EditingStyle::OverrideValues || !equivalent->propertyExistsInStyle(style));
     876}
     877
     878void EditingStyle::mergeInlineAndImplicitStyleOfElement(StyledElement* element, CSSPropertyOverrideMode mode, PropertiesToInclude propertiesToInclude)
     879{
     880    mergeInlineStyleOfElement(element, mode, propertiesToInclude);
     881
     882    const Vector<OwnPtr<HTMLElementEquivalent> >& elementEquivalents = htmlElementEquivalents();
     883    for (size_t i = 0; i < elementEquivalents.size(); ++i) {
     884        if (elementMatchesAndPropertyIsNotInInlineStyleDecl(elementEquivalents[i].get(), element, mode, m_mutableStyle.get()))
     885            elementEquivalents[i]->addToStyle(element, this);
     886    }
     887
     888    const Vector<OwnPtr<HTMLAttributeEquivalent> >& attributeEquivalents = htmlAttributeEquivalents();
     889    for (size_t i = 0; i < attributeEquivalents.size(); ++i) {
     890        if (elementMatchesAndPropertyIsNotInInlineStyleDecl(attributeEquivalents[i].get(), element, mode, m_mutableStyle.get()))
     891            attributeEquivalents[i]->addToStyle(element, this);
     892    }
     893}
     894
     895static void mergeTextDecorationValues(CSSValueList* mergedValue, const CSSValueList* valueToMerge)
     896{
     897    DEFINE_STATIC_LOCAL(const RefPtr<CSSPrimitiveValue>, underline, (CSSPrimitiveValue::createIdentifier(CSSValueUnderline)));
     898    DEFINE_STATIC_LOCAL(const RefPtr<CSSPrimitiveValue>, lineThrough, (CSSPrimitiveValue::createIdentifier(CSSValueLineThrough)));
     899
     900    if (valueToMerge->hasValue(underline.get()) && !mergedValue->hasValue(underline.get()))
     901        mergedValue->append(underline.get());
     902
     903    if (valueToMerge->hasValue(lineThrough.get()) && !mergedValue->hasValue(lineThrough.get()))
     904        mergedValue->append(lineThrough.get());
     905}
     906
     907void EditingStyle::mergeStyle(CSSMutableStyleDeclaration* style, CSSPropertyOverrideMode mode)
    856908{
    857909    if (!style)
     
    865917    CSSMutableStyleDeclaration::const_iterator end = style->end();
    866918    for (CSSMutableStyleDeclaration::const_iterator it = style->begin(); it != end; ++it) {
    867         RefPtr<CSSValue> value;
    868         if ((it->id() == CSSPropertyTextDecoration || it->id() == CSSPropertyWebkitTextDecorationsInEffect) && it->value()->isValueList()) {
    869             value = m_mutableStyle->getPropertyCSSValue(it->id());
    870             if (value && !value->isValueList())
    871                 value = 0;
     919        RefPtr<CSSValue> value = m_mutableStyle->getPropertyCSSValue(it->id());
     920        ExceptionCode ec;
     921
     922        // text decorations never override values
     923        if ((it->id() == CSSPropertyTextDecoration || it->id() == CSSPropertyWebkitTextDecorationsInEffect) && it->value()->isValueList() && value) {
     924            if (value->isValueList()) {
     925                mergeTextDecorationValues(static_cast<CSSValueList*>(value.get()), static_cast<CSSValueList*>(it->value()));
     926                continue;
     927            }
     928            value = 0; // text-decoration: none is equivalent to not having the property
    872929        }
    873930
    874         if (!value) {
    875             ExceptionCode ec;
     931        if (mode == OverrideValues || (mode == DoNotOverrideValues && !value))
    876932            m_mutableStyle->setProperty(it->id(), it->value()->cssText(), it->isImportant(), ec);
    877             continue;
    878         }
    879 
    880         CSSValueList* newTextDecorations = static_cast<CSSValueList*>(it->value());
    881         CSSValueList* textDecorations = static_cast<CSSValueList*>(value.get());
    882 
    883         DEFINE_STATIC_LOCAL(const RefPtr<CSSPrimitiveValue>, underline, (CSSPrimitiveValue::createIdentifier(CSSValueUnderline)));
    884         DEFINE_STATIC_LOCAL(const RefPtr<CSSPrimitiveValue>, lineThrough, (CSSPrimitiveValue::createIdentifier(CSSValueLineThrough)));
    885 
    886         if (newTextDecorations->hasValue(underline.get()) && !textDecorations->hasValue(underline.get()))
    887             textDecorations->append(underline.get());
    888 
    889         if (newTextDecorations->hasValue(lineThrough.get()) && !textDecorations->hasValue(lineThrough.get()))
    890             textDecorations->append(lineThrough.get());
    891933    }
    892934}
  • trunk/Source/WebCore/editing/EditingStyle.h

    r95901 r96870  
    124124    void prepareToApplyAt(const Position&, ShouldPreserveWritingDirection = DoNotPreserveWritingDirection);
    125125    void mergeTypingStyle(Document*);
    126     void mergeInlineStyleOfElement(StyledElement*);
     126    enum CSSPropertyOverrideMode { OverrideValues, DoNotOverrideValues };
     127    void mergeInlineStyleOfElement(StyledElement*, CSSPropertyOverrideMode, PropertiesToInclude = AllProperties);
     128    void mergeInlineAndImplicitStyleOfElement(StyledElement*, CSSPropertyOverrideMode, PropertiesToInclude);
    127129    void mergeStyleFromRules(StyledElement*);
    128130    void mergeStyleFromRulesForSerialization(StyledElement*);
     
    147149    void extractFontSizeDelta();
    148150    bool conflictsWithInlineStyleOfElement(StyledElement*, EditingStyle* extractedStyle, Vector<CSSPropertyID>* conflictingProperties) const;
    149     void mergeStyle(CSSMutableStyleDeclaration*);
     151    void mergeStyle(CSSMutableStyleDeclaration*, CSSPropertyOverrideMode);
    150152
    151153    RefPtr<CSSMutableStyleDeclaration> m_mutableStyle;
  • trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp

    r96553 r96870  
    11/*
    22 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved.
     3 * Copyright (C) 2009, 2010, 2011 Google Inc. All rights reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    755756}
    756757
     758inline Node* nodeToSplitToAvoidPastingIntoInlineNodesWithStyle(const Position& insertionPos)
     759{
     760    Node* containgBlock = enclosingBlock(insertionPos.containerNode());
     761    return highestEnclosingNodeOfType(insertionPos, isInlineNodeWithStyle, CannotCrossEditingBoundary, containgBlock);
     762}
     763
    757764void ReplaceSelectionCommand::doApply()
    758765{
     
    908915        }
    909916
    910         if (RefPtr<Node> nodeToSplitTo = highestEnclosingNodeOfType(insertionPos, isInlineNodeWithStyle, CannotCrossEditingBoundary,
    911             enclosingBlock(insertionPos.containerNode()))) {
     917        if (RefPtr<Node> nodeToSplitTo = nodeToSplitToAvoidPastingIntoInlineNodesWithStyle(insertionPos)) {
    912918            if (insertionPos.containerNode() != nodeToSplitTo->parentNode()) {
    913919                nodeToSplitTo = splitTreeToNode(insertionPos.anchorNode(), nodeToSplitTo->parentNode()).get();
     
    12671273    if (m_smartReplace || fragment.hasInterchangeNewlineAtStart() || fragment.hasInterchangeNewlineAtEnd())
    12681274        return false;
    1269    
     1275
     1276    // e.g. when "bar" is inserted after "foo" in <div><u>foo</u></div>, "bar" should not be underlined.
     1277    if (nodeToSplitToAvoidPastingIntoInlineNodesWithStyle(endingSelection().start()))
     1278        return false;
     1279
     1280    Node* nodeAfterInsertionPos = endingSelection().end().downstream().anchorNode();
    12701281    Text* textNode = static_cast<Text*>(fragment.firstChild());
    12711282    // Our fragment creation code handles tabs, spaces, and newlines, so we don't have to worry about those here.
     
    12761287        return false;
    12771288
     1289    if (nodeAfterInsertionPos && nodeAfterInsertionPos->hasTagName(brTag) && shouldRemoveEndBR(nodeAfterInsertionPos, positionBeforeNode(nodeAfterInsertionPos)))
     1290        removeNodeAndPruneAncestors(nodeAfterInsertionPos);
     1291
    12781292    VisibleSelection selectionAfterReplace(m_selectReplacement ? start : end, end);
    12791293
  • trunk/Source/WebCore/editing/markup.cpp

    r95745 r96870  
    11/*
    22 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
    3  * Copyright (C) 2008, 2009 Google Inc.
     3 * Copyright (C) 2008, 2009, 2010, 2011 Google Inc. All rights reserved.
    44 * Copyright (C) 2011 Igalia S.L.
    55 * Copyright (C) 2011 Motorola Mobility. All rights reserved.
     
    344344    }
    345345
    346     Node* parentOfHighestNode = m_highestNodeToBeSerialized ? m_highestNodeToBeSerialized->parentNode() : 0;
    347     if (parentOfHighestNode) {
    348         m_wrappingStyle = EditingStyle::create(parentOfHighestNode, EditingStyle::EditingInheritablePropertiesAndBackgroundColorInEffect);
    349 
    350         // Styles that Mail blockquotes contribute should only be placed on the Mail blockquote,
    351         // to help us differentiate those styles from ones that the user has applied.
    352         // This helps us get the color of content pasted into blockquotes right.
    353         m_wrappingStyle->removeStyleAddedByNode(enclosingNodeOfType(firstPositionInOrBeforeNode(parentOfHighestNode), isMailBlockquote, CanCrossEditingBoundary));
    354 
    355         // Call collapseTextDecorationProperties first or otherwise it'll copy the value over from in-effect to text-decorations.
    356         m_wrappingStyle->collapseTextDecorationProperties();
     346    if (Node* parentOfHighestNode = m_highestNodeToBeSerialized ? m_highestNodeToBeSerialized->parentNode() : 0) {
     347        if (shouldAnnotate()) {
     348            m_wrappingStyle = EditingStyle::create(parentOfHighestNode, EditingStyle::EditingInheritablePropertiesAndBackgroundColorInEffect);
     349
     350            // Styles that Mail blockquotes contribute should only be placed on the Mail blockquote,
     351            // to help us differentiate those styles from ones that the user has applied.
     352            // This helps us get the color of content pasted into blockquotes right.
     353            m_wrappingStyle->removeStyleAddedByNode(enclosingNodeOfType(firstPositionInOrBeforeNode(parentOfHighestNode), isMailBlockquote, CanCrossEditingBoundary));
     354
     355            // Call collapseTextDecorationProperties first or otherwise it'll copy the value over from in-effect to text-decorations.
     356            m_wrappingStyle->collapseTextDecorationProperties();
     357        } else {
     358            m_wrappingStyle = EditingStyle::create();
     359
     360            // When not annotating for interchange, we only preserve inline style declarations.
     361            for (Node* node = parentOfHighestNode; node && !node->isDocumentNode(); node = node->parentNode()) {
     362                if (node->isStyledElement()) {
     363                    m_wrappingStyle->mergeInlineAndImplicitStyleOfElement(static_cast<StyledElement*>(node), EditingStyle::DoNotOverrideValues,
     364                        EditingStyle::EditingInheritablePropertiesAndBackgroundColorInEffect);
     365                }
     366            }
     367        }
    357368    }
    358369
Note: See TracChangeset for help on using the changeset viewer.