2011-02-22 Ryosuke Niwa <rniwa@webkit.org>
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Feb 2011 02:22:33 +0000 (02:22 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Feb 2011 02:22:33 +0000 (02:22 +0000)
commitff045d9a43e8ca90a5a2fa37b91b59104718fdb6
tree9b20daa73e8612a93663f935f72cc0202912bde9
parent75b445da84ad0b100ef649861ecc43c0b77382ad
2011-02-22  Ryosuke Niwa  <rniwa@webkit.org>

        Reviewed by Darin Adler.

        Deploy EditingStyle in removeInlineStyleFromElement and removeCSSStyle
        https://bugs.webkit.org/show_bug.cgi?id=54944

        Deployed EditingStyle in removeInlineStyleFromElement and removeCSSStyle.

        Also extracted EditingStyle::conflictsWithInlineStyleOfElement from ApplyStyleCommand::removeCSSStyle,
        which returns true iff the specified element has inline style that conflicts or matches the editing style.
        It also appends conflicting property IDs to the vector of property IDs if one is specified.

        * editing/ApplyStyleCommand.cpp:
        (WebCore::ApplyStyleCommand::applyBlockStyle): Calls removeCSSStyle.
        (WebCore::ApplyStyleCommand::applyInlineStyle): Calls shouldSplitTextElement.
        (WebCore::ApplyStyleCommand::removeStyleFromRunBeforeApplyingStyle): Calls removeInlineStyleFromElement.
        (WebCore::ApplyStyleCommand::removeInlineStyleFromElement): Takes EditingStyle* instead of CSSMutableStyleDeclaration*.
        (WebCore::ApplyStyleCommand::removeCSSStyle): Ditto; extracted the logic to decide properties to remove as
        conflictsWithInlineStyleOfElement.
        (WebCore::ApplyStyleCommand::highestAncestorWithConflictingInlineStyle): Calls shouldRemoveInlineStyleFromElement.
        (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode): Calls removeInlineStyleFromElement.
        (WebCore::ApplyStyleCommand::removeInlineStyle): Ditto.
        (WebCore::ApplyStyleCommand::shouldSplitTextElement): Takes EditingStyle* instead of CSSMutableStyleDeclaration*.
        * editing/ApplyStyleCommand.h:
        (WebCore::ApplyStyleCommand::shouldRemoveInlineStyleFromElement): Ditto.
        * editing/EditingStyle.cpp:
        (WebCore::EditingStyle::conflictsWithInlineStyleOfElement): Extracted from ApplyStyleCommand::removeCSSStyle.
        * editing/EditingStyle.h:
        (WebCore::EditingStyle::conflictsWithInlineStyleOfElement): Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@79382 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/editing/ApplyStyleCommand.cpp
Source/WebCore/editing/ApplyStyleCommand.h
Source/WebCore/editing/EditingStyle.cpp
Source/WebCore/editing/EditingStyle.h