Changeset 19441 in webkit


Ignore:
Timestamp:
Feb 6, 2007 2:17:20 PM (17 years ago)
Author:
justing
Message:

LayoutTests:

Reviewed by john

<rdar://problem/4959067>
Bullets get erased or moved down to another line
<rdar://problem/4912529>
Seed: Bulleted list in Note in Mail.app does not work with Japanese input mode

  • editing/inserting/4959067-expected.checksum: Added.
  • editing/inserting/4959067-expected.png: Added.
  • editing/inserting/4959067-expected.txt: Added.
  • editing/inserting/4959067.html: Added.

WebCore:

Reviewed by john

<rdar://problem/4959067>
Bullets get erased or moved down to another line
<rdar://problem/4912529>
Seed: Bulleted list in Note in Mail.app does not work with Japanese input mode


Do not expand the selection to include fully selected
special elements when insering text over a selection.

  • editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::deleteSelection): Pass expandForSpecialElements through to DeleteSelectionCommand's constructor. (WebCore::CompositeEditCommand::moveParagraphs): Use the convenience function.
  • editing/CompositeEditCommand.h:
  • editing/DeleteSelectionCommand.h:
  • editing/InsertTextCommand.cpp: (WebCore::InsertTextCommand::input): Do not expand the selection to be deleted for special elements.
  • editing/ReplaceSelectionCommand.cpp: (WebCore::ReplaceSelectionCommand::doApply): Added a FIXME about when we should expand the selection.
Location:
trunk
Files:
4 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r19437 r19441  
     12007-02-06  Justin Garcia  <justin.garcia@apple.com>
     2
     3        Reviewed by john
     4
     5        <rdar://problem/4959067>
     6        Bullets get erased or moved down to another line
     7        <rdar://problem/4912529>
     8        Seed: Bulleted list in Note in Mail.app does not work with Japanese input mode
     9
     10        * editing/inserting/4959067-expected.checksum: Added.
     11        * editing/inserting/4959067-expected.png: Added.
     12        * editing/inserting/4959067-expected.txt: Added.
     13        * editing/inserting/4959067.html: Added.
     14
    1152007-02-06  Geoffrey Garen  <ggaren@apple.com>
    216
  • trunk/WebCore/ChangeLog

    r19436 r19441  
     12007-02-05  Justin Garcia  <justin.garcia@apple.com>
     2
     3        Reviewed by john
     4
     5        <rdar://problem/4959067>
     6        Bullets get erased or moved down to another line
     7        <rdar://problem/4912529>
     8        Seed: Bulleted list in Note in Mail.app does not work with Japanese input mode
     9       
     10        Do not expand the selection to include fully selected
     11        special elements when insering text over a selection.
     12
     13        * editing/CompositeEditCommand.cpp:
     14        (WebCore::CompositeEditCommand::deleteSelection): Pass
     15        expandForSpecialElements through to DeleteSelectionCommand's constructor.
     16        (WebCore::CompositeEditCommand::moveParagraphs): Use the
     17        convenience function.
     18        * editing/CompositeEditCommand.h:
     19        * editing/DeleteSelectionCommand.h:
     20        * editing/InsertTextCommand.cpp:
     21        (WebCore::InsertTextCommand::input): Do not expand the selection
     22        to be deleted for special elements.
     23        * editing/ReplaceSelectionCommand.cpp:
     24        (WebCore::ReplaceSelectionCommand::doApply): Added a FIXME about
     25        when we should expand the selection.
     26
    1272007-02-06  Geoffrey Garen  <ggaren@apple.com>
    228
  • trunk/WebCore/editing/CompositeEditCommand.cpp

    r19088 r19441  
    300300}
    301301
    302 void CompositeEditCommand::deleteSelection(bool smartDelete, bool mergeBlocksAfterDelete, bool replace)
     302void CompositeEditCommand::deleteSelection(bool smartDelete, bool mergeBlocksAfterDelete, bool replace, bool expandForSpecialElements)
    303303{
    304304    if (endingSelection().isRange())
    305         applyCommandToComposite(new DeleteSelectionCommand(document(), smartDelete, mergeBlocksAfterDelete, replace));
    306 }
    307 
    308 void CompositeEditCommand::deleteSelection(const Selection &selection, bool smartDelete, bool mergeBlocksAfterDelete, bool replace)
     305        applyCommandToComposite(new DeleteSelectionCommand(document(), smartDelete, mergeBlocksAfterDelete, replace, expandForSpecialElements));
     306}
     307
     308void CompositeEditCommand::deleteSelection(const Selection &selection, bool smartDelete, bool mergeBlocksAfterDelete, bool replace, bool expandForSpecialElements)
    309309{
    310310    if (selection.isRange())
    311         applyCommandToComposite(new DeleteSelectionCommand(selection, smartDelete, mergeBlocksAfterDelete, replace));
     311        applyCommandToComposite(new DeleteSelectionCommand(selection, smartDelete, mergeBlocksAfterDelete, replace, expandForSpecialElements));
    312312}
    313313
     
    746746   
    747747    setEndingSelection(Selection(start, end, DOWNSTREAM));
    748     applyCommandToComposite(new DeleteSelectionCommand(document(), false, false, false, false));
     748    deleteSelection(false, false, false, false);
    749749
    750750    ASSERT(destination.deepEquivalent().node()->inDocument());
  • trunk/WebCore/editing/CompositeEditCommand.h

    r18874 r19441  
    5252    void removeStyledElement(Element*);
    5353    void deleteKeyPressed();
    54     void deleteSelection(bool smartDelete = false, bool mergeBlocksAfterDelete = true, bool replace = false);
    55     void deleteSelection(const Selection&, bool smartDelete = false, bool mergeBlocksAfterDelete = true, bool replace = false);
     54    void deleteSelection(bool smartDelete = false, bool mergeBlocksAfterDelete = true, bool replace = false, bool expandForSpecialElements = true);
     55    void deleteSelection(const Selection&, bool smartDelete = false, bool mergeBlocksAfterDelete = true, bool replace = false, bool expandForSpecialElements = true);
    5656    virtual void deleteTextFromNode(Text* node, int offset, int count);
    5757    void inputText(const String&, bool selectInsertedText = false);
  • trunk/WebCore/editing/DeleteSelectionCommand.h

    r19088 r19441  
    3333class DeleteSelectionCommand : public CompositeEditCommand {
    3434public:
    35     DeleteSelectionCommand(Document*, bool smartDelete = false, bool mergeBlocksAfterDelete = true, bool replace = false, bool expandForSpecialElements = true);
    36     DeleteSelectionCommand(const Selection&, bool smartDelete = false, bool mergeBlocksAfterDelete = true, bool replace = false, bool expandForSpecialElements = true);
     35    DeleteSelectionCommand(Document*, bool smartDelete = false, bool mergeBlocksAfterDelete = true, bool replace = false, bool expandForSpecialElements = false);
     36    DeleteSelectionCommand(const Selection&, bool smartDelete = false, bool mergeBlocksAfterDelete = true, bool replace = false, bool expandForSpecialElements = false);
    3737
    3838    virtual void doApply();
  • trunk/WebCore/editing/InsertTextCommand.cpp

    r18221 r19441  
    102102    // Delete the current selection.
    103103    if (endingSelection().isRange())
    104         deleteSelection(false, true, true);
     104        deleteSelection(false, true, true, false);
    105105   
    106106    // Insert the character at the leftmost candidate.
  • trunk/WebCore/editing/ReplaceSelectionCommand.cpp

    r19036 r19441  
    509509        // will leave hanging block(s).
    510510        bool mergeBlocksAfterDelete = isEndOfParagraph(visibleEnd) || isStartOfBlock(visibleStart);
     511        // FIXME: We should only expand to include fully selected special elements if we are copying a
     512        // selection and pasting it on top of itself.
    511513        deleteSelection(false, mergeBlocksAfterDelete, true);
    512514        visibleStart = endingSelection().visibleStart();
  • trunk/WebCore/editing/htmlediting.cpp

    r18968 r19441  
    305305   
    306306    if (pos.offset() <= 0) {
    307         if (node->parentNode() && (node->hasTagName(brTag) || editingIgnoresContent(node)))
     307        if (node->parentNode() && (node->hasTagName(brTag) || editingIgnoresContent(node)) || isTableElement(node))
    308308            return positionBeforeNode(node);
    309309        return Position(node, 0);
     
    328328        return node->parentNode() ? positionBeforeNode(node) : Position(node, 0);
    329329    }
     330   
     331    if (pos.offset() == maxCompliantOffset && (editingIgnoresContent(node) || isTableElement(node)))
     332        return positionAfterNode(node);
    330333   
    331334    return Position(pos);
Note: See TracChangeset for help on using the changeset viewer.