WebCore:
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 28 Apr 2008 21:28:51 +0000 (21:28 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 28 Apr 2008 21:28:51 +0000 (21:28 +0000)
commitb044338fda240840b43b63fe3804f24b7313af1d
treea2d789cc24eab3ab2197f1cde2015b74d9e3b9eb
parentf46441c1599ae5f33ca9efaf64eb89b1f1482543
WebCore:

        Reviewed by Dave Hyatt.

        - support multiple box- and text-shadows

        Tests: fast/css/shadow-multiple.html
               fast/repaint/shadow-multiple-horizontal.html
               fast/repaint/shadow-multiple-strict-horizontal.html
               fast/repaint/shadow-multiple-strict-vertical.html
               fast/repaint/shadow-multiple-vertical.html

        * css/CSSComputedStyleDeclaration.cpp:
        (WebCore::valueForShadow): Changed to account for reversing the order
        of the shadow values in the ShadowData list.

        * css/CSSValueList.cpp:
        (WebCore::CSSValueList::prepend): Added.
        * css/CSSValueList.h:

        * rendering/InlineFlowBox.cpp:
        (WebCore::InlineFlowBox::placeBoxesHorizontally): Changed to account for
        all shadows in overflow calculation.
        (WebCore::InlineFlowBox::placeBoxesVertically): Ditto.
        (WebCore::InlineFlowBox::paint): Changed to account for all shadows
        when testing for intersection with the damage rect.
        (WebCore::InlineFlowBox::paintTextDecorations): Changed to paint all
        shadows.

        * rendering/InlineTextBox.cpp:
        (WebCore::paintTextWithShadows): Factored out from paint() and changed
        to paint all shadows.
        (WebCore::InlineTextBox::paint): Moved the text painting code out to
        paintTextWithShadows(). Changed to not paint shadows for markers and
        composition underlines and in "force black text" mode.
        (WebCore::InlineTextBox::paintSelection):
        (WebCore::InlineTextBox::paintCompositionBackground):
        (WebCore::InlineTextBox::paintDecoration): Changed to paint all shadows.
        * rendering/InlineTextBox.h: Changed some public methods to private
        or protected.

        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::overflowHeight): Changed to account for all
        shadows.
        (WebCore::RenderBlock::overflowWidth): Ditto.
        (WebCore::RenderBlock::overflowLeft): Ditto.
        (WebCore::RenderBlock::overflowTop): Ditto.
        (WebCore::RenderBlock::overflowRect): Ditto.
        (WebCore::RenderBlock::layoutBlock): Ditto.

        * rendering/RenderFlexibleBox.cpp:
        (WebCore::RenderFlexibleBox::layoutBlock): Ditto.

        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::calculateRects): Ditto.

        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::paintBoxShadow): Changed to paint all shadows.
        Changed to avoid clipping out the box if it has a fully opaque
        background.
        (WebCore::RenderObject::repaintAfterLayoutIfNeeded): Changed to account
        for all shadows.
        (WebCore::RenderObject::selectionForegroundColor): Cleaned up.
        (WebCore::RenderObject::adjustRectForOutlineAndShadow): Changed to
        account for all shadows.

        * rendering/RenderReplaced.cpp:
        (WebCore::RenderReplaced::adjustOverflowForBoxShadow): Ditto.

        * rendering/RenderStyle.cpp:
        (WebCore::RenderStyle::setTextShadow): Changed to prepend when adding
        so that the stacking order of shadows when painting will be "first o
        top".
        (WebCore::RenderStyle::setBoxShadow): Ditto.

        * rendering/RenderTable.cpp:
        (WebCore::RenderTable::layout): Changed to account for all shadows.

LayoutTests:

        Reviewed by Dave Hyatt.

        - add rendering and invalidation tests for multiple shadows

        * fast/css/shadow-multiple.html: Added.
        * fast/repaint/shadow-multiple-horizontal.html: Added.
        * fast/repaint/shadow-multiple-strict-horizontal.html: Added.
        * fast/repaint/shadow-multiple-strict-vertical.html: Added.
        * fast/repaint/shadow-multiple-vertical.html: Added.
        * platform/mac/fast/css/shadow-multiple-expected.checksum: Added.
        * platform/mac/fast/css/shadow-multiple-expected.png: Added.
        * platform/mac/fast/css/shadow-multiple-expected.txt: Added.
        * platform/mac/fast/repaint/shadow-multiple-horizontal-expected.checksum: Added.
        * platform/mac/fast/repaint/shadow-multiple-horizontal-expected.png: Added.
        * platform/mac/fast/repaint/shadow-multiple-horizontal-expected.txt: Added.
        * platform/mac/fast/repaint/shadow-multiple-strict-horizontal-expected.checksum: Added.
        * platform/mac/fast/repaint/shadow-multiple-strict-horizontal-expected.png: Added.
        * platform/mac/fast/repaint/shadow-multiple-strict-horizontal-expected.txt: Added.
        * platform/mac/fast/repaint/shadow-multiple-strict-vertical-expected.checksum: Added.
        * platform/mac/fast/repaint/shadow-multiple-strict-vertical-expected.png: Added.
        * platform/mac/fast/repaint/shadow-multiple-strict-vertical-expected.txt: Added.
        * platform/mac/fast/repaint/shadow-multiple-vertical-expected.checksum: Added.
        * platform/mac/fast/repaint/shadow-multiple-vertical-expected.png: Added.
        * platform/mac/fast/repaint/shadow-multiple-vertical-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@32660 268f45cc-cd09-0410-ab3c-d52691b4dbfc
35 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/css/shadow-multiple.html [new file with mode: 0644]
LayoutTests/fast/repaint/shadow-multiple-horizontal.html [new file with mode: 0644]
LayoutTests/fast/repaint/shadow-multiple-strict-horizontal.html [new file with mode: 0644]
LayoutTests/fast/repaint/shadow-multiple-strict-vertical.html [new file with mode: 0644]
LayoutTests/fast/repaint/shadow-multiple-vertical.html [new file with mode: 0644]
LayoutTests/platform/mac/fast/css/shadow-multiple-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/fast/css/shadow-multiple-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/css/shadow-multiple-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/fast/repaint/shadow-multiple-horizontal-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/fast/repaint/shadow-multiple-horizontal-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/repaint/shadow-multiple-horizontal-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/fast/repaint/shadow-multiple-strict-horizontal-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/fast/repaint/shadow-multiple-strict-horizontal-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/repaint/shadow-multiple-strict-horizontal-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/fast/repaint/shadow-multiple-strict-vertical-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/fast/repaint/shadow-multiple-strict-vertical-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/repaint/shadow-multiple-strict-vertical-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/fast/repaint/shadow-multiple-vertical-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/fast/repaint/shadow-multiple-vertical-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/repaint/shadow-multiple-vertical-expected.txt [new file with mode: 0644]
WebCore/ChangeLog
WebCore/css/CSSComputedStyleDeclaration.cpp
WebCore/css/CSSValueList.cpp
WebCore/css/CSSValueList.h
WebCore/rendering/InlineFlowBox.cpp
WebCore/rendering/InlineTextBox.cpp
WebCore/rendering/InlineTextBox.h
WebCore/rendering/RenderBlock.cpp
WebCore/rendering/RenderFlexibleBox.cpp
WebCore/rendering/RenderLayer.cpp
WebCore/rendering/RenderObject.cpp
WebCore/rendering/RenderReplaced.cpp
WebCore/rendering/RenderStyle.cpp
WebCore/rendering/RenderTable.cpp