1. 07 Apr, 2011 2 commits
    • rniwa@webkit.org's avatar
      2011-04-07 Ryosuke Niwa <rniwa@webkit.org> · 5614540c
      rniwa@webkit.org authored
              Reviewed by Darin Adler.
              REGRESSION (r46914, r48764): When typing in Mail, line wrapping frequently occurs in the middle of words
              Added tests to ensure WebKit inserts a paragraph separator properly around tab span.
              * editing/inserting/insert-div-021-expected.txt: No longer duplicates span[id="test"] incorrectly.
              * editing/inserting/insert-paragraph-after-tab-span-and-text-expected.txt: Added.
              * editing/inserting/insert-paragraph-after-tab-span-and-text.html: Added.
              * editing/inserting/insert-paragraph-separator-tab-span-expected.txt: Added.
              * editing/inserting/insert-paragraph-separator-tab-span.html: Added.
              * editing/inserting/insert-paragraph-at-end-of-line-expected.txt: No longer duplicates a[id="anchor"] incorrectly.
      2011-04-07  Ryosuke Niwa  <rniwa@webkit.org>
              Reviewed by Eric Seidel.
              REGRESSION (r46914, r48764): When typing in Mail, line wrapping frequently occurs in the middle of words
              r46914 initially introduced a regression by replacing calls to styleAtPosition by editingStyleAtPosition
              because editingStyleAtPosition did not avoid tab span to obtain the computed style unlike styleAtPosition.
              r46914 also introduced a regression by cloning hierarchy under new block at the insertion position without
              avoiding the tab span.
              Fixed the both regressions by avoiding tab spans when computing the editing style and when cloning hierarchy.
              Also reverted r46914 for the general code path because re-creating node hierarchy duplicates nodes when
              we're moving nodes after the paragraph separator. Instead, we now split the tree up until the start block
              before moving the nodes.
              Tests: editing/inserting/insert-paragraph-after-tab-span-and-text.html
              * editing/DeleteSelectionCommand.cpp:
              (WebCore::DeleteSelectionCommand::saveTypingStyleState): Since EditingStyle's constructor avoids a tab span,
              no longer calls positionBeforeTabSpan on the position passed to EditingStyle's constructor.
              * editing/EditingStyle.cpp:
              (WebCore::EditingStyle::init): Always avoid a tab span when computing the editing style.
              * editing/InsertParagraphSeparatorCommand.cpp:
              (WebCore::InsertParagraphSeparatorCommand::doApply): Avoid cloning tab spans and inserting a paragraph
              separator into a paragraph separator.
              * editing/htmlediting.cpp:
              (WebCore::positionOutsideTabSpan): Renamed from positionBeforeTabSpan. Also returns the position in the parent
              node after the tab span if the position was at the end of the tab span.
              * editing/htmlediting.h:
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@83247 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    • rniwa@webkit.org's avatar
      2011-04-07 Ryosuke Niwa <rniwa@webkit.org> · 04696f10
      rniwa@webkit.org authored
              Reviewed by Eric Seidel.
              editing/inserting/6633727.html should be renamed and converted into a dump-as-markup test
              Renamed 6633727.html to insert-paragraph-at-end-of-line.html and converted it to a dump-as-markup test.
              * editing/inserting/6633727-expected.txt: Removed.
              * editing/inserting/6633727.html: Removed.
              * editing/inserting/insert-paragraph-at-end-of-line-expected.txt: Added.
              * editing/inserting/insert-paragraph-at-end-of-line.html: Copied from LayoutTests/editing/inserting/6633727.html.
              * editing/inserting/script-tests/6633727.js: Removed.
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@83181 268f45cc-cd09-0410-ab3c-d52691b4dbfc