• rniwa@webkit.org's avatar
    2010-11-04 Ryosuke Niwa <rniwa@webkit.org> · 7e06f4ab
    rniwa@webkit.org authored
            Reviewed by Darin Adler.
    
            Bug 46335 - Add EditingStyle
            https://bugs.webkit.org/show_bug.cgi?id=46335
    
            Added EditingStyle to WebCore/editing.  This class is intended to encapsulate getPropertiesNotIn, removeNonEditingProperties,
            editingStyleAtPosition, and prepareEditingStyleToApplyAt in ApplyStyleCommand.cpp once deployed everywhere.
            Deployed it in typing styles.
    
            No new tests are added since this is a refactoring in progress.
    
            * CMakeLists.txt: Added EditingStyle.cpp
            * GNUmakefile.am: Added EditingStyle.cpp and EditingStyle.h
            * WebCore.gypi: Ditto.
            * WebCore.pro: Ditto.
            * WebCore.xcodeproj/project.pbxproj: Ditto.
            * editing/CompositeEditCommand.cpp:
            (WebCore::CompositeEditCommand::moveParagraphs): Calls editingStyleIncludingTypingStyle.
            (WebCore::CompositeEditCommand::breakOutOfEmptyListItem): Uses EditingStyle.
            * editing/DeleteSelectionCommand.cpp:
            (WebCore::DeleteSelectionCommand::saveTypingStyleState): Ditto.
            (WebCore::DeleteSelectionCommand::calculateTypingStyleAfterDelete): Ditto.
            * editing/DeleteSelectionCommand.h:
            * editing/EditingStyle.cpp: Added.
            (WebCore::editingStyleFromComputedStyle): Added.
            (WebCore::EditingStyle::EditingStyle): Added.
            (WebCore::EditingStyle::init): Added; a clone of ApplyStyleCommand::editingStyleAtPosition.
            (WebCore::EditingStyle::removeTextFillAndStrokeColorsIfNeeded): Extracted from init.
            (WebCore::EditingStyle::replaceFontSizeByKeywordIfPossible): Extracted from init.
            (WebCore::EditingStyle::isEmpty): Added.
            (WebCore::EditingStyle::setStyle): Added.
            (WebCore::EditingStyle::clear): Added.
            (WebCore::EditingStyle::removeBlockProperties): Added.
            (WebCore::EditingStyle::prepareToApplyAt): Added.
            (WebCore::editingStyleIncludingTypingStyle): Added.
            * editing/EditingStyle.h: Added.
            (WebCore::EditingStyle::create): Added.
            (WebCore::EditingStyle::style): Added.
            * editing/RemoveFormatCommand.cpp:
            (WebCore::RemoveFormatCommand::doApply): Uses EditingStyle.
            * editing/SelectionController.h:
            (WebCore::SelectionController::typingStyle): Uses EditingStyle.
            (WebCore::SelectionController::clearTypingStyle): Uses EditingStyle.
            (WebCore::SelectionController::setTypingStyle): Uses EditingStyle.
            * rendering/style/RenderStyle.h: Added EditingStyle as a friend.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71469 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    7e06f4ab
CMakeLists.txt 68.2 KB