Skip to content
  • pdr@google.com's avatar
    Repaint borders and outlines on pseudo content changes · ffe769be
    pdr@google.com authored
    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.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156619 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    ffe769be