Changeset 25373 in webkit


Ignore:
Timestamp:
Sep 5, 2007 1:46:41 PM (17 years ago)
Author:
harrison
Message:

WebCore:

Reviewed by Kevin Decker.

<rdar://problem/5306171> Mail: The first return after an attachment in multipart/mixed message is lost

Test added: editing/selection/toString-1.html


Source changes:

  • editing/TextIterator.cpp: (WebCore::TextIterator::shouldRepresentNodeOffsetZero):
  • Remove outdated and erroneous check for m_lastTextNode.
  • Fix VisiblePosition check to look for line diff. Simple position diff gives the wrong answer when the start is table/0 and the current is the first position inside the content of the table.

LayoutTests:

Reviewed by Kevin Decker.

Testcase for:
<rdar://problem/5306171> Mail: The first return after an attachment in multipart/mixed message is lost

  • editing/selection/toString-1-expected.txt: Added.
  • editing/selection/toString-1.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r25367 r25373  
     12007-09-05  David Harrison  <harrison@apple.com>
     2
     3        Reviewed by Kevin Decker.
     4
     5        Testcase for:
     6        <rdar://problem/5306171> Mail: The first return after an attachment in multipart/mixed message is lost
     7
     8        * editing/selection/toString-1-expected.txt: Added.
     9        * editing/selection/toString-1.html: Added.
     10
    1112007-09-04  Oliver Hunt  <oliver@apple.com>
    212
  • trunk/WebCore/ChangeLog

    r25368 r25373  
     12007-09-05  David Harrison  <harrison@apple.com>
     2
     3        Reviewed by Kevin Decker.
     4
     5        <rdar://problem/5306171> Mail: The first return after an attachment in multipart/mixed message is lost
     6
     7        Test added: editing/selection/toString-1.html
     8       
     9        Source changes:
     10        * editing/TextIterator.cpp:
     11        (WebCore::TextIterator::shouldRepresentNodeOffsetZero):
     12        - Remove outdated and erroneous check for m_lastTextNode.
     13        - Fix VisiblePosition check to look for line diff. Simple position diff gives the
     14        wrong answer when the start is table/0 and the current is the first position
     15        inside the content of the table.
     16
    1172007-09-04  Marvin Decker  <marv.decker@gmail.com>
    218
  • trunk/WebCore/editing/TextIterator.cpp

    r25319 r25373  
    509509bool TextIterator::shouldRepresentNodeOffsetZero()
    510510{
    511     // Can't represent the position without m_lastTextNode
    512     if (!m_lastTextNode)
    513         return false;
    514    
    515511    // Leave element positioned flush with start of a paragraph
    516512    // (e.g. do not insert tab before a table cell at the start of a paragraph)
     
    523519   
    524520    // We've not emitted anything yet. Generally, there is no need for any positioning then.
    525     // The only exception is when the element is visually not in the same position as
     521    // The only exception is when the element is visually not in the same line as
    526522    // the start of the range (e.g. the range starts at the end of the previous paragraph).
    527523    // NOTE: Creating VisiblePositions and comparing them is relatively expensive, so we
     
    537533    VisiblePosition startPos = VisiblePosition(m_startContainer, m_startOffset, DOWNSTREAM);
    538534    VisiblePosition currPos = VisiblePosition(m_node, 0, DOWNSTREAM);
    539     return startPos != currPos;
     535    return !inSameLine(startPos, currPos);
    540536}
    541537
Note: See TracChangeset for help on using the changeset viewer.