LayoutTests:
authorharrison <harrison@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Oct 2006 18:17:52 +0000 (18:17 +0000)
committerharrison <harrison@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Oct 2006 18:17:52 +0000 (18:17 +0000)
commit7afbc3acb8d6512eae44b2db91419ed1a8ac0c77
tree8b9145907afd84dda77b9e28e6fee9aea55cde64
parentbe183b0da517e1c8c5c1afe4d87e1c9f0666d233
LayoutTests:

        Reviewed by Justin.

        <rdar://problem/4746860> Mail crash in WebCore::CSSMutableStyleDeclaration::merge(WebCore::CSSMutableStyleDeclaration*, bool)

        * editing/style/style-boundary-005.html: Added. Matches steps from bug.
        * editing/execCommand/hilitecolor-expected.txt: Updated (no empty Apple style spans).
        * editing/style/remove-underline-across-paragraph-in-bold-expected.txt: Updated (no empty Apple style spans).
        * editing/style/remove-underline-in-bold-expected.txt: Updated (no empty Apple style spans).
        * editing/style/typing-style-003-expected.txt: Updated (no empty Apple style spans).

WebCore:

        Reviewed by Justin.

        <rdar://problem/4746860> Mail crash in WebCore::CSSMutableStyleDeclaration::merge(WebCore::CSSMutableStyleDeclaration*, bool)

        Tests added or changed:
        * editing/style/style-boundary-005.html: Added. Matches steps from bug.
        * editing/execCommand/hilitecolor-expected.txt: Updated (no empty Apple style spans).
        * editing/style/remove-underline-across-paragraph-in-bold-expected.txt: Updated (no empty Apple style spans).
        * editing/style/remove-underline-in-bold-expected.txt: Updated (no empty Apple style spans).
        * editing/style/typing-style-003-expected.txt: Updated (no empty Apple style spans).

        * dom/Text.cpp:
        (WebCore::Text::splitText):
        Comment changes.

        * editing/ApplyStyleCommand.cpp:
        (WebCore::isUnstyledStyleSpan):
        Renamed from isEmptyStyleSpan.

        (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
        Rename emptySpans local to unstyledSpans.

        (WebCore::dummySpanAncestorForNode):
        New. To locate Apple style span created when splitting a text node.

        (WebCore::ApplyStyleCommand::cleanupUnstyledAppleStyleSpans):
        Renamed from cleanUpEmptyStyleSpans. Algorithm changed to scan children
        of dummy span's parents, rather than traversing up from start and
        end locations. Old algorithm would miss empty spans in the bug case.

        (WebCore::ApplyStyleCommand::applyInlineStyle):
        Use dummySpanAncestorForNode() and cleanupUnstyledAppleStyleSpans().

        (WebCore::ApplyStyleCommand::removeCSSStyle):
        Renamed isEmptyStyleSpan() to isUnstyledStyleSpan().

        (WebCore::ApplyStyleCommand::mergeStartWithPreviousIfIdentical):
        Comment changes.

        * editing/ApplyStyleCommand.h:
        Renamed cleanUpEmptyStyleSpans() to cleanupUnstyledAppleStyleSpans().

        * editing/ReplaceSelectionCommand.cpp:
        (WebCore::ReplaceSelectionCommand::removeRedundantStyles):
        Allow for Apple style span to be unstyled, because old email may have this in the DOM.
        Use !node->hasChildNodes() instead of !node->firstChild().

        * editing/SplitTextNodeCommand.cpp:
        (WebCore::SplitTextNodeCommand::doApply):
        Comment changes.

        * rendering/RenderTreeAsText.cpp:
        (WebCore::isEmptyOrUnstyledAppleStyleSpan):
        (WebCore::operator<<):
        Flag empty or unstyled AppleStyleSpa nbecause we never want to leave them in the DOM

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@17036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
LayoutTests/ChangeLog
LayoutTests/editing/execCommand/hilitecolor-expected.txt
LayoutTests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt
LayoutTests/editing/style/remove-underline-in-bold-expected.txt
LayoutTests/editing/style/style-boundary-005-expected.checksum [new file with mode: 0644]
LayoutTests/editing/style/style-boundary-005-expected.png [new file with mode: 0644]
LayoutTests/editing/style/style-boundary-005-expected.txt [new file with mode: 0644]
LayoutTests/editing/style/style-boundary-005.html [new file with mode: 0644]
LayoutTests/editing/style/typing-style-003-expected.txt
WebCore/ChangeLog
WebCore/dom/Text.cpp
WebCore/editing/ApplyStyleCommand.cpp
WebCore/editing/ApplyStyleCommand.h
WebCore/editing/ReplaceSelectionCommand.cpp
WebCore/editing/SplitTextNodeCommand.cpp
WebCore/rendering/RenderTreeAsText.cpp