Changeset 89492 in webkit


Ignore:
Timestamp:
Jun 22, 2011 4:18:57 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-06-22 Annie Sullivan <sullivan@chromium.org>

Reviewed by Ryosuke Niwa.

REGRESSION: Hitting enter in the middle of this span causes the cursor to go to the end of the span
https://bugs.webkit.org/show_bug.cgi?id=61594

Adds two layout tests to verify that hitting enter in the middle of the span splits the span correctly
and places the cursor in the correct position.

  • editing/inserting/return-key-before-br-in-span-expected.txt: Added.
  • editing/inserting/return-key-before-br-in-span.html: Added.
  • editing/inserting/return-key-middle-of-span-expected.txt: Added.
  • editing/inserting/return-key-middle-of-span.html: Added.

2011-06-22 Annie Sullivan <sullivan@chromium.org>

Reviewed by Ryosuke Niwa.

REGRESSION: Hitting enter in the middle of this span causes the cursor to go to the end of the span
https://bugs.webkit.org/show_bug.cgi?id=61594

When the tree is split at the cursor in InsertParagraphSeparatorCommand, it is possible for the position
split at to be at the end of a text node. The code assumes the position is at the start of the node, so
pass the correct node into splitTreeToNode() in that case.

Tests: editing/inserting/return-key-before-br-in-span.html

editing/inserting/return-key-middle-of-span.html

  • editing/InsertParagraphSeparatorCommand.cpp: (WebCore::InsertParagraphSeparatorCommand::doApply):
Location:
trunk
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r89491 r89492  
     12011-06-22  Annie Sullivan  <sullivan@chromium.org>
     2
     3        Reviewed by Ryosuke Niwa.
     4
     5        REGRESSION: Hitting enter in the middle of this span causes the cursor to go to the end of the span
     6        https://bugs.webkit.org/show_bug.cgi?id=61594
     7
     8        Adds two layout tests to verify that hitting enter in the middle of the span splits the span correctly
     9        and places the cursor in the correct position.
     10
     11        * editing/inserting/return-key-before-br-in-span-expected.txt: Added.
     12        * editing/inserting/return-key-before-br-in-span.html: Added.
     13        * editing/inserting/return-key-middle-of-span-expected.txt: Added.
     14        * editing/inserting/return-key-middle-of-span.html: Added.
     15
    1162011-06-22  Jessie Berlin  <jberlin@apple.com>
    217
  • trunk/Source/WebCore/ChangeLog

    r89490 r89492  
     12011-06-22  Annie Sullivan  <sullivan@chromium.org>
     2
     3        Reviewed by Ryosuke Niwa.
     4
     5        REGRESSION: Hitting enter in the middle of this span causes the cursor to go to the end of the span
     6        https://bugs.webkit.org/show_bug.cgi?id=61594
     7
     8        When the tree is split at the cursor in InsertParagraphSeparatorCommand, it is possible for the position
     9        split at to be at the end of a text node. The code assumes the position is at the start of the node, so
     10        pass the correct node into splitTreeToNode() in that case.
     11
     12        Tests: editing/inserting/return-key-before-br-in-span.html
     13               editing/inserting/return-key-middle-of-span.html
     14
     15        * editing/InsertParagraphSeparatorCommand.cpp:
     16        (WebCore::InsertParagraphSeparatorCommand::doApply):
     17
    1182011-06-22  Rob Buis  <rbuis@rim.com>
    219
  • trunk/Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp

    r89145 r89492  
    357357            n = insertionPosition.computeNodeAfterPosition();
    358358        else {
    359             splitTreeToNode(insertionPosition.containerNode(), startBlock);
     359            Node* splitTo = insertionPosition.containerNode();
     360            if (splitTo->isTextNode() && insertionPosition.offsetInContainerNode() >= caretMaxOffset(splitTo))
     361              splitTo = splitTo->traverseNextNode(startBlock);
     362            ASSERT(splitTo);
     363            splitTreeToNode(splitTo, startBlock);
    360364
    361365            for (n = startBlock->firstChild(); n; n = n->nextSibling()) {
Note: See TracChangeset for help on using the changeset viewer.