Reviewed by Darin
authorkocienda <kocienda@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Aug 2004 17:34:56 +0000 (17:34 +0000)
committerkocienda <kocienda@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Aug 2004 17:34:56 +0000 (17:34 +0000)
commit7ce4e301d211485a9625e8499d4e00d92810ba98
tree7ba24ef68184177dc6f0ec157c241a3cf3e8c5a2
parent7252253d460eb2e19a65c0808d93cda1e1b939c7
    Reviewed by Darin

        Fix for this bug:
        <rdar://problem/3751098> HTML email has one set of SPAN tags per character in the message

        Progress on this bug:
        <rdar://problem/3755562> Typing styles do not use same tag application conventions as font and color panel

        * khtml/editing/htmlediting_impl.cpp:
        (khtml::CompositeEditCommandImpl::applyTypingStyle): Name changed from createTypingStyleElement.
        Also, interface changed to take the node to which the typing style is to be applied.
        This makes it easier to apply what may be up to three levels of nested tags to get the
        desired style (<B>, <I>, and <SPAN STYLE="">).
        Also, Borrow some of the style change smarts from ApplyStyleCommandImpl to use bold and
        italic tags for applying styles when that is apprpriate. This creates on opportunity to
        factor the code to do this so that this function and the ApplyStyleCommandImpl class can
        share the implementation. I will follow up with a change to do that after landing this
        change. Some future code factoring could be done here to bring together some similar code
        into one place.
        (khtml::ApplyStyleCommandImpl::applyStyleIfNeeded): Add comment about code factoring work.
        (khtml::ApplyStyleCommandImpl::computeStyleChange): StyleChange struct no longer a member of the
        ApplyStyleCommandImpl class. CompositeEditCommandImpl needs it now in its applyTypingStyle()
        function.
        (khtml::InputNewlineCommandImpl::doApply): Pass along node to style to applyTypingStyle.
        (khtml::InputTextCommandImpl::prepareForTextInsertion): Ditto.
        * khtml/editing/htmlediting_impl.h:
        (khtml::StyleChange::StyleChange): Pull this struct out of ApplyStyleCommandImpl so
        CompositeEditCommandImpl can use it.
        * khtml/khtml_part.cpp:
        (KHTMLPart::notifySelectionChanged): Always clear typing style when the selection
        changes, not only when closing typing. This fixes 3751098.

        These three tests actually had results that treated the buggy behavior as correct!

        * layout-tests/editing/style/style-3681552-fix-001-expected.txt
        * layout-tests/editing/style/style-3681552-fix-002-expected.txt
        * layout-tests/editing/style/typing-style-002-expected.txt

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@7240 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/editing/style/style-3681552-fix-001-expected.txt
LayoutTests/editing/style/style-3681552-fix-002-expected.txt
LayoutTests/editing/style/typing-style-002-expected.txt
WebCore/ChangeLog-2005-08-23
WebCore/khtml/editing/htmlediting_impl.cpp
WebCore/khtml/editing/htmlediting_impl.h
WebCore/khtml/khtml_part.cpp