Changeset 32497 in webkit


Ignore:
Timestamp:
Apr 24, 2008, 10:41:11 AM (17 years ago)
Author:
justin.garcia@apple.com
Message:

WebCore:

2008-04-24 Justin Garcia <justin.garcia@apple.com>

Reviewed by Darin Adler.

<rdar://problem/5604313> FormatBlock to apply an h1 also inserts a style span around the first letter (16004)


  • editing/TextIterator.cpp: (WebCore::TextIterator::advance): We emit an extra newline when leaving a block element that has atypical margin/padding. When we emit the extra newline, it needs to be positioned after that block's contents, not after the block. This is how we position the first newline, too, since the range for emitted newlines should start where the line break begins visually.

LayoutTests:

2008-04-24 Justin Garcia <justin.garcia@apple.com>

Reviewed by Darin Adler.

<rdar://problem/5604313> FormatBlock leaves first letter incorrectly styled (16004)

  • editing/execCommand/5604313-expected.txt: Added.
  • editing/execCommand/5604313.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r32456 r32497  
     12008-04-24  Justin Garcia  <justin.garcia@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        <rdar://problem/5604313> FormatBlock leaves first letter incorrectly styled (16004)
     6
     7        * editing/execCommand/5604313-expected.txt: Added.
     8        * editing/execCommand/5604313.html: Added.
     9
    110r2008-04-23  Dan Bernstein  <mitz@apple.com>
    211
  • trunk/WebCore/ChangeLog

    r32496 r32497  
     12008-04-24  Justin Garcia  <justin.garcia@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        <rdar://problem/5604313> FormatBlock to apply an h1 also inserts a style span around the first letter (16004)
     6       
     7        * editing/TextIterator.cpp:
     8        (WebCore::TextIterator::advance): We emit an extra newline when leaving a
     9        block element that has atypical margin/padding. When we emit the extra newline,
     10        it needs to be positioned after that block's contents, not after the block.
     11        This is how we position the first newline, too, since the range for emitted newlines
     12        should start where the line break begins visually.
     13
    1142008-04-24  Anders Carlsson  <andersca@apple.com>
    215
  • trunk/WebCore/editing/TextIterator.cpp

    r30973 r32497  
    146146    // handle remembered node that needed a newline after the text node's newline
    147147    if (m_needAnotherNewline) {
    148         // emit the newline, with position a collapsed range at the end of current node.
    149         emitCharacter('\n', m_node->parentNode(), m_node, 1, 1);
     148        // Emit the extra newline, and position it *inside* m_node, after m_node's
     149        // contents, in case it's a block, in the same way that we position the first
     150        // newline.  The range for the emitted newline should start where the line
     151        // break begins.
     152        // FIXME: It would be cleaner if we emitted two newlines during the last
     153        // iteration, instead of using m_needAnotherNewline.
     154        Node* baseNode = m_node->lastChild() ? m_node->lastChild() : m_node;
     155        emitCharacter('\n', baseNode->parentNode(), baseNode, 1, 1);
    150156        m_needAnotherNewline = false;
    151157        return;
Note: See TracChangeset for help on using the changeset viewer.