Ignore:
Timestamp:
Sep 29, 2013, 3:16:06 PM (12 years ago)
Author:
[email protected]
Message:

Repaint borders and outlines on pseudo content changes
https://bugs.webkit.org/show_bug.cgi?id=122070

Reviewed by Andreas Kling.

Source/WebCore:

This patch fixes a regression from wkrev.com/150259 where pseudo content with
borders or outlines would fail to repaint if the color property changed.
The root bug is that border-color and outline-color properties use 'color' if
no explicit border-color or outline-color are given, and changing color should
repaint borders and outlines even if the text content is empty.

Relevant spec sections:
border: http://www.w3.org/TR/CSS1/#border-color
outline: http://www.w3.org/TR/CSS2/ui.html#propdef-outline-color

This patch also renames StyleDifferenceRepaintIfText to
StyleDifferenceRepaintIfTextOrBorderOrOutline and updates the relevant functions.

Test: fast/repaint/hover-pseudo-borders.html

  • rendering/RenderElement.cpp:

(WebCore::RenderElement::hasImmediateNonWhitespaceTextChildOrBorderOrOutline):

This function has been renamed to reflect that it returns true for borders
or outlines as well.

(WebCore::RenderElement::shouldRepaintForStyleDifference):

  • rendering/RenderElement.h:
  • rendering/style/RenderStyle.cpp:

(WebCore::RenderStyle::changeRequiresRepaintIfTextOrBorderOrOutline):
(WebCore::RenderStyle::diff):

  • rendering/style/RenderStyle.h:
  • rendering/style/RenderStyleConstants.h:
  • rendering/svg/SVGResourcesCache.cpp:

(WebCore::SVGResourcesCache::clientStyleChanged):

These have also been renamed to reflect the new borders and outlines check.

LayoutTests:

  • fast/repaint/hover-pseudo-borders.html: Added.
  • platform/mac/fast/repaint/hover-pseudo-borders-expected.png: Added.
  • platform/mac/fast/repaint/hover-pseudo-borders-expected.txt: Added.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/rendering/RenderElement.h

    r156608 r156619  
    114114
    115115    bool shouldRepaintForStyleDifference(StyleDifference) const;
    116     bool hasImmediateNonWhitespaceTextChild() const;
     116    bool hasImmediateNonWhitespaceTextChildOrBorderOrOutline() const;
    117117
    118118    void updateFillImages(const FillLayer*, const FillLayer*);
Note: See TracChangeset for help on using the changeset viewer.