Changeset 102833 in webkit


Ignore:
Timestamp:
Dec 14, 2011 3:16:06 PM (12 years ago)
Author:
rniwa@webkit.org
Message:

Push more member functions from EditCommand to CompositeEditCommand
https://bugs.webkit.org/show_bug.cgi?id=74249

Reviewed by Enrica Casucci.

Moved startingRootEditableElement and endingRootEditableElement from EditCommand to EditCommandComposition,
and isTypingCommand, preservesTypingStyle, shouldRetainAutocorrectionIndicator,
setShouldRetainAutocorrectionIndicator, and shouldStopCaretBlinking from EditCommand to CompositeEditCommand.
Also removed EditCommand::updateLayout().

  • editing/ApplyBlockElementCommand.cpp:

(WebCore::ApplyBlockElementCommand::doApply):

  • editing/ApplyStyleCommand.cpp:

(WebCore::ApplyStyleCommand::applyBlockStyle):
(WebCore::ApplyStyleCommand::applyInlineStyle):

  • editing/CompositeEditCommand.cpp:

(WebCore::EditCommandComposition::EditCommandComposition):
(WebCore::EditCommandComposition::setStartingSelection):
(WebCore::EditCommandComposition::setEndingSelection):
(WebCore::CompositeEditCommand::preservesTypingStyle):
(WebCore::CompositeEditCommand::isTypingCommand):
(WebCore::CompositeEditCommand::shouldRetainAutocorrectionIndicator):
(WebCore::CompositeEditCommand::setShouldRetainAutocorrectionIndicator):
(WebCore::CompositeEditCommand::addBlockPlaceholderIfNeeded):
(WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary):
(WebCore::CompositeEditCommand::moveParagraphs):

  • editing/CompositeEditCommand.h:

(WebCore::EditCommandComposition::startingRootEditableElement):
(WebCore::EditCommandComposition::endingRootEditableElement):
(WebCore::CompositeEditCommand::shouldStopCaretBlinking):

  • editing/DeleteSelectionCommand.cpp:

(WebCore::DeleteSelectionCommand::removeNode):
(WebCore::DeleteSelectionCommand::fixupWhitespace):

  • editing/EditCommand.cpp:

(WebCore::EditCommand::apply):
(WebCore::EditCommand::unapply):
(WebCore::EditCommand::reapply):
(WebCore::EditCommand::setStartingSelection):
(WebCore::EditCommand::setEndingSelection):
(WebCore::EditCommand::setParent):

  • editing/EditCommand.h:

(WebCore::EditCommand::isEditCommandComposition):

  • editing/Editor.cpp:

(WebCore::dispatchEditableContentChangedEvents):
(WebCore::Editor::appliedEditing):
(WebCore::Editor::unappliedEditing):
(WebCore::Editor::reappliedEditing):

  • editing/Editor.h:

(WebCore::Editor::lastEditCommand):

  • editing/FrameSelection.cpp:

(WebCore::FrameSelection::updateAppearance):

  • editing/IndentOutdentCommand.cpp:

(WebCore::IndentOutdentCommand::outdentParagraph):

  • editing/InsertLineBreakCommand.cpp:

(WebCore::InsertLineBreakCommand::doApply):

  • editing/InsertParagraphSeparatorCommand.cpp:

(WebCore::InsertParagraphSeparatorCommand::doApply):

  • editing/TypingCommand.cpp:

(WebCore::TypingCommand::lastTypingCommandIfStillOpenForTyping):

  • editing/TypingCommand.h:

(WebCore::TypingCommand::shouldRetainAutocorrectionIndicator):

Location:
trunk/Source/WebCore
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r102832 r102833  
     12011-12-14  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Push more member functions from EditCommand to CompositeEditCommand
     4        https://bugs.webkit.org/show_bug.cgi?id=74249
     5
     6        Reviewed by Enrica Casucci.
     7
     8        Moved startingRootEditableElement and endingRootEditableElement from EditCommand to EditCommandComposition,
     9        and isTypingCommand, preservesTypingStyle, shouldRetainAutocorrectionIndicator,
     10        setShouldRetainAutocorrectionIndicator, and shouldStopCaretBlinking from EditCommand to CompositeEditCommand.
     11        Also removed EditCommand::updateLayout().
     12
     13        * editing/ApplyBlockElementCommand.cpp:
     14        (WebCore::ApplyBlockElementCommand::doApply):
     15        * editing/ApplyStyleCommand.cpp:
     16        (WebCore::ApplyStyleCommand::applyBlockStyle):
     17        (WebCore::ApplyStyleCommand::applyInlineStyle):
     18        * editing/CompositeEditCommand.cpp:
     19        (WebCore::EditCommandComposition::EditCommandComposition):
     20        (WebCore::EditCommandComposition::setStartingSelection):
     21        (WebCore::EditCommandComposition::setEndingSelection):
     22        (WebCore::CompositeEditCommand::preservesTypingStyle):
     23        (WebCore::CompositeEditCommand::isTypingCommand):
     24        (WebCore::CompositeEditCommand::shouldRetainAutocorrectionIndicator):
     25        (WebCore::CompositeEditCommand::setShouldRetainAutocorrectionIndicator):
     26        (WebCore::CompositeEditCommand::addBlockPlaceholderIfNeeded):
     27        (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary):
     28        (WebCore::CompositeEditCommand::moveParagraphs):
     29        * editing/CompositeEditCommand.h:
     30        (WebCore::EditCommandComposition::startingRootEditableElement):
     31        (WebCore::EditCommandComposition::endingRootEditableElement):
     32        (WebCore::CompositeEditCommand::shouldStopCaretBlinking):
     33        * editing/DeleteSelectionCommand.cpp:
     34        (WebCore::DeleteSelectionCommand::removeNode):
     35        (WebCore::DeleteSelectionCommand::fixupWhitespace):
     36        * editing/EditCommand.cpp:
     37        (WebCore::EditCommand::apply):
     38        (WebCore::EditCommand::unapply):
     39        (WebCore::EditCommand::reapply):
     40        (WebCore::EditCommand::setStartingSelection):
     41        (WebCore::EditCommand::setEndingSelection):
     42        (WebCore::EditCommand::setParent):
     43        * editing/EditCommand.h:
     44        (WebCore::EditCommand::isEditCommandComposition):
     45        * editing/Editor.cpp:
     46        (WebCore::dispatchEditableContentChangedEvents):
     47        (WebCore::Editor::appliedEditing):
     48        (WebCore::Editor::unappliedEditing):
     49        (WebCore::Editor::reappliedEditing):
     50        * editing/Editor.h:
     51        (WebCore::Editor::lastEditCommand):
     52        * editing/FrameSelection.cpp:
     53        (WebCore::FrameSelection::updateAppearance):
     54        * editing/IndentOutdentCommand.cpp:
     55        (WebCore::IndentOutdentCommand::outdentParagraph):
     56        * editing/InsertLineBreakCommand.cpp:
     57        (WebCore::InsertLineBreakCommand::doApply):
     58        * editing/InsertParagraphSeparatorCommand.cpp:
     59        (WebCore::InsertParagraphSeparatorCommand::doApply):
     60        * editing/TypingCommand.cpp:
     61        (WebCore::TypingCommand::lastTypingCommandIfStillOpenForTyping):
     62        * editing/TypingCommand.h:
     63        (WebCore::TypingCommand::shouldRetainAutocorrectionIndicator):
     64
    1652011-12-14  Tony Chang  <tony@chromium.org>
    266
  • trunk/Source/WebCore/editing/ApplyBlockElementCommand.cpp

    r95901 r102833  
    8888    formatSelection(startOfSelection, endOfSelection);
    8989
    90     updateLayout();
    91    
     90    document()->updateLayoutIgnorePendingStylesheets();
     91
    9292    ASSERT(startScope == endScope);
    9393    ASSERT(startIndex >= 0);
  • trunk/Source/WebCore/editing/ApplyStyleCommand.cpp

    r101707 r102833  
    244244    // so that we avoid the expense of updating before each and every call
    245245    // to check a computed style
    246     updateLayout();
     246    document()->updateLayoutIgnorePendingStylesheets();
    247247
    248248    // get positions we want to use for applying style
     
    541541    // so that we avoid the expense of updating before each and every call
    542542    // to check a computed style
    543     updateLayout();
     543    document()->updateLayoutIgnorePendingStylesheets();
    544544
    545545    // adjust to the positions we want to use for applying style
     
    631631    // so that we avoid the expense of updating before each and every call
    632632    // to check a computed style
    633     updateLayout();
     633    document()->updateLayoutIgnorePendingStylesheets();
    634634
    635635    RefPtr<EditingStyle> styleToApply = style;
  • trunk/Source/WebCore/editing/CompositeEditCommand.cpp

    r102643 r102833  
    7979EditCommandComposition::EditCommandComposition(Document* document, const VisibleSelection& startingSelection, const VisibleSelection& endingSelection, bool wasCreateLinkCommand)
    8080    : EditCommand(document, startingSelection, endingSelection)
     81    , m_startingRootEditableElement(startingSelection.rootEditableElement())
     82    , m_endingRootEditableElement(endingSelection.rootEditableElement())
    8183    , m_wasCreateLinkCommand(wasCreateLinkCommand)
    8284{
     
    105107{
    106108    m_commands.append(command);
     109}
     110
     111void EditCommandComposition::setStartingSelection(const VisibleSelection& selection)
     112{
     113    EditCommand::setStartingSelection(selection);
     114    m_startingRootEditableElement = selection.rootEditableElement();
     115}
     116
     117void EditCommandComposition::setEndingSelection(const VisibleSelection& selection)
     118{
     119    EditCommand::setEndingSelection(selection);
     120    m_endingRootEditableElement = selection.rootEditableElement();
    107121}
    108122
     
    149163{
    150164    return false;
     165}
     166
     167bool CompositeEditCommand::preservesTypingStyle() const
     168{
     169    return false;
     170}
     171
     172bool CompositeEditCommand::isTypingCommand() const
     173{
     174    return false;
     175}
     176
     177bool CompositeEditCommand::shouldRetainAutocorrectionIndicator() const
     178{
     179    return false;
     180}
     181
     182void CompositeEditCommand::setShouldRetainAutocorrectionIndicator(bool)
     183{
    151184}
    152185
     
    729762        return 0;
    730763
    731     updateLayout();
     764    document()->updateLayoutIgnorePendingStylesheets();
    732765
    733766    RenderObject* renderer = container->renderer();
     
    774807        return 0;
    775808   
    776     updateLayout();
     809    document()->updateLayoutIgnorePendingStylesheets();
    777810   
    778811    // It's strange that this function is responsible for verifying that pos has not been invalidated
     
    10841117        insertNodeAt(createBreakElement(document()), beforeParagraph.deepEquivalent());
    10851118        // Need an updateLayout here in case inserting the br has split a text node.
    1086         updateLayout();
     1119        document()->updateLayoutIgnorePendingStylesheets();
    10871120    }
    10881121
  • trunk/Source/WebCore/editing/CompositeEditCommand.h

    r102643 r102833  
    4848    bool wasCreateLinkCommand() const { return m_wasCreateLinkCommand; }
    4949
     50    Element* startingRootEditableElement() const { return m_startingRootEditableElement.get(); }
     51    Element* endingRootEditableElement() const { return m_endingRootEditableElement.get(); }
     52
    5053#ifndef NDEBUG
    5154    virtual void getNodesInCommand(HashSet<Node*>&);
     
    5558    EditCommandComposition(Document*, const VisibleSelection& startingSelection, const VisibleSelection& endingSelection, bool wasCreateLinkCommand);
    5659    virtual bool isEditCommandComposition() const OVERRIDE { return true; }
     60    virtual void setStartingSelection(const VisibleSelection&) OVERRIDE;
     61    virtual void setEndingSelection(const VisibleSelection&) OVERRIDE;
    5762
    5863    Vector<RefPtr<SimpleEditCommand> > m_commands;
     64    RefPtr<Element> m_startingRootEditableElement;
     65    RefPtr<Element> m_endingRootEditableElement;
    5966    bool m_wasCreateLinkCommand;
    6067};
     
    6976
    7077    virtual bool isCreateLinkCommand() const;
     78    virtual bool isTypingCommand() const;
     79    virtual bool preservesTypingStyle() const;
     80    virtual bool shouldRetainAutocorrectionIndicator() const;
     81    virtual void setShouldRetainAutocorrectionIndicator(bool);
     82    virtual bool shouldStopCaretBlinking() const { return false; }
    7183
    7284protected:
  • trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp

    r101830 r102833  
    362362       
    363363        // Make sure empty cell has some height, if a placeholder can be inserted.
    364         updateLayout();
     364        document()->updateLayoutIgnorePendingStylesheets();
    365365        RenderObject *r = node->renderer();
    366366        if (r && r->isTableCell() && toRenderTableCell(r)->contentHeight() <= 0) {
     
    529529void DeleteSelectionCommand::fixupWhitespace()
    530530{
    531     updateLayout();
     531    document()->updateLayoutIgnorePendingStylesheets();
    532532    // FIXME: isRenderedCharacter should be removed, and we should use VisiblePosition::characterAfter and VisiblePosition::characterBefore
    533533    if (m_leadingWhitespace.isNotNull() && !m_leadingWhitespace.isRenderedCharacter() && m_leadingWhitespace.deprecatedNode()->isTextNode()) {
  • trunk/Source/WebCore/editing/EditCommand.cpp

    r102643 r102833  
    9696    // use them perform one if one is necessary (like for the creation of VisiblePositions).
    9797    if (isTopLevelCommand())
    98         updateLayout();
     98        document()->updateLayoutIgnorePendingStylesheets();
    9999
    100100    {
     
    108108    if (isTopLevelCommand()) {
    109109        ASSERT(isCompositeEditCommand());
     110        CompositeEditCommand* command = toCompositeEditCommand(this);
    110111        // Only need to call appliedEditing for top-level commands, and TypingCommands do it on their
    111112        // own (see TypingCommand::typingAddedToOpenCommand).
    112         if (!isTypingCommand())
    113             frame->editor()->appliedEditing(toCompositeEditCommand(this));
    114     }
    115 
    116     setShouldRetainAutocorrectionIndicator(false);
     113        if (!command->isTypingCommand())
     114            frame->editor()->appliedEditing(command);
     115        command->setShouldRetainAutocorrectionIndicator(false);
     116    }
    117117}
    118118
     
    129129    // use them perform one if one is necessary (like for the creation of VisiblePositions).
    130130    if (isTopLevelCommand())
    131         updateLayout();
     131        document()->updateLayoutIgnorePendingStylesheets();
    132132   
    133133    DeleteButtonController* deleteButtonController = frame->editor()->deleteButtonController();
     
    152152    // use them perform one if one is necessary (like for the creation of VisiblePositions).
    153153    if (isTopLevelCommand())
    154         updateLayout();
     154        document()->updateLayoutIgnorePendingStylesheets();
    155155
    156156    DeleteButtonController* deleteButtonController = frame->editor()->deleteButtonController();
     
    182182void EditCommand::setStartingSelection(const VisibleSelection& s)
    183183{
    184     Element* root = s.rootEditableElement();
    185184    for (EditCommand* cmd = this; ; cmd = cmd->m_parent) {
    186185        if (EditCommandComposition* composition = compositionIfPossible(cmd)) {
    187186            ASSERT(cmd->isTopLevelCommand());
    188             composition->m_startingSelection = s;
    189             composition->m_startingRootEditableElement = root;
     187            static_cast<EditCommand*>(composition)->setStartingSelection(s);
    190188        }
    191189        cmd->m_startingSelection = s;
    192         cmd->m_startingRootEditableElement = root;
    193190        if (!cmd->m_parent || cmd->m_parent->isFirstCommand(cmd))
    194191            break;
     
    198195void EditCommand::setEndingSelection(const VisibleSelection &s)
    199196{
    200     Element* root = s.rootEditableElement();
    201197    for (EditCommand* cmd = this; cmd; cmd = cmd->m_parent) {
    202198        if (EditCommandComposition* composition = compositionIfPossible(cmd)) {
    203199            ASSERT(cmd->isTopLevelCommand());
    204             composition->m_endingSelection = s;
    205             composition->m_endingRootEditableElement = root;
     200            static_cast<EditCommand*>(composition)->setEndingSelection(s);
    206201        }
    207202        cmd->m_endingSelection = s;
    208         cmd->m_endingRootEditableElement = root;
    209     }
    210 }
    211 
    212 bool EditCommand::preservesTypingStyle() const
    213 {
    214     return false;
    215 }
    216 
    217 bool EditCommand::isTypingCommand() const
    218 {
    219     return false;
    220 }
    221 
    222 bool EditCommand::shouldRetainAutocorrectionIndicator() const
    223 {
    224     return false;
    225 }
    226 
    227 void EditCommand::setShouldRetainAutocorrectionIndicator(bool)
    228 {
    229 }
    230 
    231 void EditCommand::updateLayout() const
    232 {
    233     document()->updateLayoutIgnorePendingStylesheets();
     203    }
    234204}
    235205
     
    242212        m_startingSelection = parent->m_endingSelection;
    243213        m_endingSelection = parent->m_endingSelection;
    244         m_startingRootEditableElement = parent->m_endingRootEditableElement;
    245         m_endingRootEditableElement = parent->m_endingRootEditableElement;
    246214    }
    247215}
  • trunk/Source/WebCore/editing/EditCommand.h

    r102643 r102833  
    5555    const VisibleSelection& endingSelection() const { return m_endingSelection; }
    5656
    57     Element* startingRootEditableElement() const { return m_startingRootEditableElement.get(); }
    58     Element* endingRootEditableElement() const { return m_endingRootEditableElement.get(); }
    59    
    6057    virtual bool isSimpleEditCommand() const { return false; }
    6158    virtual bool isCompositeEditCommand() const { return false; }
    6259    virtual bool isEditCommandComposition() const { return false; }
    63     virtual bool isTypingCommand() const;
    64 
    65     virtual bool preservesTypingStyle() const;
    66 
    6760    bool isTopLevelCommand() const { return !m_parent; }
    68 
    69     virtual bool shouldRetainAutocorrectionIndicator() const;
    70     virtual void setShouldRetainAutocorrectionIndicator(bool);
    71     virtual bool shouldStopCaretBlinking() const { return false; }
    7261
    7362protected:
     
    7867    CompositeEditCommand* parent() const { return m_parent; }
    7968
    80     void setStartingSelection(const VisibleSelection&);
    81     void setEndingSelection(const VisibleSelection&);
    82 
    83     void updateLayout() const;
     69    virtual void setStartingSelection(const VisibleSelection&);
     70    virtual void setEndingSelection(const VisibleSelection&);
    8471
    8572private:
     
    9178    VisibleSelection m_startingSelection;
    9279    VisibleSelection m_endingSelection;
    93     RefPtr<Element> m_startingRootEditableElement;
    94     RefPtr<Element> m_endingRootEditableElement;
    9580    CompositeEditCommand* m_parent;
    9681
  • trunk/Source/WebCore/editing/Editor.cpp

    r102553 r102833  
    855855}
    856856
    857 static void dispatchEditableContentChangedEvents(const EditCommand& command)
    858 {
    859     Element* startRoot = command.startingRootEditableElement();
    860     Element* endRoot = command.endingRootEditableElement();
     857static void dispatchEditableContentChangedEvents(Element* startRoot, Element* endRoot)
     858{
    861859    ExceptionCode ec;
    862860    if (startRoot)
     
    870868    m_frame->document()->updateLayout();
    871869
    872     dispatchEditableContentChangedEvents(*cmd);
     870    EditCommandComposition* composition = cmd->composition();
     871    ASSERT(composition);
     872    dispatchEditableContentChangedEvents(composition->startingRootEditableElement(), composition->endingRootEditableElement());
    873873    VisibleSelection newSelection(cmd->endingSelection());
    874874
     
    899899    m_frame->document()->updateLayout();
    900900   
    901     dispatchEditableContentChangedEvents(*cmd);
     901    dispatchEditableContentChangedEvents(cmd->startingRootEditableElement(), cmd->endingRootEditableElement());
    902902   
    903903    VisibleSelection newSelection(cmd->startingSelection());
     
    915915    m_frame->document()->updateLayout();
    916916   
    917     dispatchEditableContentChangedEvents(*cmd);
     917    dispatchEditableContentChangedEvents(cmd->startingRootEditableElement(), cmd->endingRootEditableElement());
    918918   
    919919    VisibleSelection newSelection(cmd->endingSelection());
  • trunk/Source/WebCore/editing/Editor.h

    r102627 r102833  
    9292    Frame* frame() const { return m_frame; }
    9393    DeleteButtonController* deleteButtonController() const { return m_deleteButtonController.get(); }
    94     EditCommand* lastEditCommand() { return m_lastEditCommand.get(); }
     94    CompositeEditCommand* lastEditCommand() { return m_lastEditCommand.get(); }
    9595
    9696    void handleKeyboardEvent(KeyboardEvent*);
     
    386386    Frame* m_frame;
    387387    OwnPtr<DeleteButtonController> m_deleteButtonController;
    388     RefPtr<EditCommand> m_lastEditCommand;
     388    RefPtr<CompositeEditCommand> m_lastEditCommand;
    389389    RefPtr<Node> m_removedAnchor;
    390390    RefPtr<Text> m_compositionNode;
  • trunk/Source/WebCore/editing/FrameSelection.cpp

    r102413 r102833  
    16581658    bool shouldBlink = caretIsVisible() && isCaret() && (isContentEditable() || caretBrowsing);
    16591659   
    1660     EditCommand* lastEditCommand = m_frame ? m_frame->editor()->lastEditCommand() : 0;
     1660    CompositeEditCommand* lastEditCommand = m_frame ? m_frame->editor()->lastEditCommand() : 0;
    16611661    bool shouldStopBlinkingDueToTypingCommand = lastEditCommand && lastEditCommand->shouldStopCaretBlinking();
    16621662
  • trunk/Source/WebCore/editing/IndentOutdentCommand.cpp

    r99918 r102833  
    162162            }
    163163        }
    164        
    165         updateLayout();
     164
     165        document()->updateLayoutIgnorePendingStylesheets();
    166166        visibleStartOfParagraph = VisiblePosition(visibleStartOfParagraph.deepEquivalent());
    167167        visibleEndOfParagraph = VisiblePosition(visibleEndOfParagraph.deepEquivalent());
  • trunk/Source/WebCore/editing/InsertLineBreakCommand.cpp

    r93134 r102833  
    144144       
    145145        // Handle whitespace that occurs after the split
    146         updateLayout();
     146        document()->updateLayoutIgnorePendingStylesheets();
    147147        if (!endingPosition.isRenderedCharacter()) {
    148148            Position positionBeforeTextNode(positionInParentBeforeNode(textNode));
  • trunk/Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp

    r93134 r102833  
    349349        insertNodeAfter(blockToInsert.get(), startBlock);
    350350
    351     updateLayout();
     351    document()->updateLayoutIgnorePendingStylesheets();
    352352
    353353    // If the paragraph separator was inserted at the end of a paragraph, an empty line must be
     
    385385    // Handle whitespace that occurs after the split
    386386    if (splitText) {
    387         updateLayout();
     387        document()->updateLayoutIgnorePendingStylesheets();
    388388        if (insertionPosition.anchorType() == Position::PositionIsOffsetInAnchor)
    389389            insertionPosition.moveToOffset(0);
  • trunk/Source/WebCore/editing/SpellingCorrectionController.cpp

    r102643 r102833  
    428428}
    429429
    430 void SpellingCorrectionController::respondToAppliedEditing(EditCommand* command)
     430void SpellingCorrectionController::respondToAppliedEditing(CompositeEditCommand* command)
    431431{
    432432    if (command->isTopLevelCommand() && !command->shouldRetainAutocorrectionIndicator())
  • trunk/Source/WebCore/editing/SpellingCorrectionController.h

    r102643 r102833  
    3737namespace WebCore {
    3838
     39class CompositeEditCommand;
    3940class EditorClient;
    4041class EditCommand;
     
    8990
    9091    void respondToUnappliedSpellCorrection(const VisibleSelection&, const String& corrected, const String& correction) UNLESS_ENABLED({ UNUSED_PARAM(corrected); UNUSED_PARAM(correction); })
    91     void respondToAppliedEditing(EditCommand*) UNLESS_ENABLED({})
     92    void respondToAppliedEditing(CompositeEditCommand*) UNLESS_ENABLED({ })
    9293    void respondToUnappliedEditing(EditCommandComposition*) UNLESS_ENABLED({ })
    9394    void respondToChangedSelection(const VisibleSelection& oldSelection) UNLESS_ENABLED({ UNUSED_PARAM(oldSelection); })
  • trunk/Source/WebCore/editing/TypingCommand.cpp

    r102225 r102833  
    241241    ASSERT(frame);
    242242
    243     EditCommand* lastEditCommand = frame->editor()->lastEditCommand();
     243    CompositeEditCommand* lastEditCommand = frame->editor()->lastEditCommand();
    244244    if (!lastEditCommand || !lastEditCommand->isTypingCommand() || !static_cast<TypingCommand*>(lastEditCommand)->isOpenForMoreTyping())
    245245        return 0;
  • trunk/Source/WebCore/editing/TypingCommand.h

    r102413 r102833  
    102102    virtual bool isTypingCommand() const;
    103103    virtual bool preservesTypingStyle() const { return m_preservesTypingStyle; }
    104     virtual bool shouldRetainAutocorrectionIndicator() const { return m_shouldRetainAutocorrectionIndicator; }
     104    virtual bool shouldRetainAutocorrectionIndicator() const
     105    {
     106        ASSERT(isTopLevelCommand());
     107        return m_shouldRetainAutocorrectionIndicator;
     108    }
    105109    virtual void setShouldRetainAutocorrectionIndicator(bool retain) { m_shouldRetainAutocorrectionIndicator = retain; }
    106110    virtual bool shouldStopCaretBlinking() const { return true; }
Note: See TracChangeset for help on using the changeset viewer.