• rniwa@webkit.org's avatar
    2011-03-01 Ryosuke Niwa <rniwa@webkit.org> · bf57284a
    rniwa@webkit.org authored
            Reviewed by Tony Chang.
    
            applyInlineStyleToPushDown and removeInlineStyleFromElement should take EditingStyle
            https://bugs.webkit.org/show_bug.cgi?id=55338
    
            Deployed EditingStyle in applyInlineStyleToPushDown and removeInlineStyleFromElement.
    
            Also added a convenience function EditingStyle::setProperty, which lazily instantiates
            new CSSMutableStyleDeclaration for m_mutableStyle.
    
            * editing/ApplyStyleCommand.cpp:
            (WebCore::ApplyStyleCommand::removeInlineStyleFromElement): Takes EditingStyle*.
            (WebCore::ApplyStyleCommand::removeImplicitlyStyledElement): Ditto.
            (WebCore::ApplyStyleCommand::removeCSSStyle): Ditto.
            (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode): Calls the above three functions.
            (WebCore::ApplyStyleCommand::removeInlineStyle): Calls pushDownInlineStyleAroundNode.
            * editing/ApplyStyleCommand.h:
            * editing/EditingStyle.cpp:
            (WebCore::HTMLElementEquivalent::addToStyle): Takes EditingStyle*; calls EditingStyle::setProperty.
            (WebCore::HTMLAttributeEquivalent::addToStyle): Ditto.
            (WebCore::EditingStyle::setProperty): Added.  This member function lazily instantiates
            new CSSMutableStyleDeclaration for m_mutableStyle.
            (WebCore::EditingStyle::conflictsWithInlineStyleOfElement): Takes EditingStyle*.
            (WebCore::EditingStyle::conflictsWithImplicitStyleOfElement): Ditto.
            (WebCore::EditingStyle::extractConflictingImplicitStyleOfAttributes): Ditto.
            * editing/EditingStyle.h: Added HTMLElementEquivalent and HTMLAttributeEquivalent as friends.
            (WebCore::EditingStyle::conflictsWithInlineStyleOfElement): Ditto.
            * editing/InsertTextCommand.cpp: Removed unnecessary includes.
            * editing/RemoveCSSPropertyCommand.h: Ditto.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@79976 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    bf57284a
EditingStyle.cpp 27.4 KB