2011-02-22 Ryosuke Niwa <rniwa@webkit.org>
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Feb 2011 05:35:44 +0000 (05:35 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Feb 2011 05:35:44 +0000 (05:35 +0000)
commita360262232738494b798297e79b382062eea507b
treedafb8b6d0def25a85af81a176443ea479b21da03
parenta48c3b23358b8947a6371f5e938a69fc583bbc43
2011-02-22  Ryosuke Niwa  <rniwa@webkit.org>

        Reviewed by Darin Adler.

        Make Editor::selectionComputedStyle return EditingStyle
        https://bugs.webkit.org/show_bug.cgi?id=54933

        Renamed selectionComputedStyle to selectionStartStyle and changed the return type to EditingStyle.
        It also no longer takes a boolean shouldUseFixedFontDefaultSize.

        Also added EditingStyle::mergeTypingStyle which replaced old editingStyleIncludingTypingStyle. This function
        doesn't extract inheritable properties prior to merge because this turned out be a bug, which was revealed
        by an existing layout test only after the code was shared with selectionStartStyle.

        No tests are added since this is a refactoring.

        * editing/CompositeEditCommand.cpp:
        (WebCore::CompositeEditCommand::moveParagraphs): Calls EditingStyle::create and EditingStyle::mergeTypingStyle.
        (WebCore::CompositeEditCommand::breakOutOfEmptyListItem): Ditto.
        * editing/EditingStyle.cpp: Removed editingStyleIncludingTypingStyle.
        (WebCore::EditingStyle::mergeTypingStyle): Added.
        * editing/EditingStyle.h:
        (WebCore::EditingStyle::shouldUseFixedDefaultFontSize): Added.
        * editing/Editor.cpp:
        (WebCore::Editor::selectionStartHasStyle): Calls selectionStartStyle.
        (WebCore::Editor::selectionHasStyle): Ditto.
        (WebCore::Editor::selectionStartCSSPropertyValue): Ditto.
        (WebCore::Editor::selectionStartStyle): Renamed from selectionComputedStyle; returns EditingStyle.
        * editing/Editor.h:
        * editing/EditorCommand.cpp:
        (WebCore::executeToggleStyleInList): Calls selectionStartStyle.
        * editing/InsertLineBreakCommand.cpp:
        * editing/InsertParagraphSeparatorCommand.cpp:
        (WebCore::InsertParagraphSeparatorCommand::calculateStyleBeforeInsertion): Calls EditingStyle::create and
        EditingStyle::mergeTypingStyle.
        * editing/ReplaceSelectionCommand.cpp:
        (WebCore::ReplaceSelectionCommand::doApply): Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@79398 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/editing/CompositeEditCommand.cpp
Source/WebCore/editing/EditingStyle.cpp
Source/WebCore/editing/EditingStyle.h
Source/WebCore/editing/Editor.cpp
Source/WebCore/editing/Editor.h
Source/WebCore/editing/EditorCommand.cpp
Source/WebCore/editing/InsertLineBreakCommand.cpp
Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp
Source/WebCore/editing/ReplaceSelectionCommand.cpp