⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 267528 in webkit


Ignore:
Timestamp:
Sep 24, 2020, 6:21:13 AM (6 years ago)
Author:
Antti Koivisto
Message:

currentColor isn't recalculated when a text node doesn't exist
https://bugs.webkit.org/show_bug.cgi?id=216780
<rdar://problem/69320933>

Reviewed by Antoine Quint.

Source/WebCore:

We fail to repaint with the new background color when 'background-color' property has value 'currentColor' and the current color changes.

Test case by Cory LaViska.

Test: fast/css/currentColor-background-paint.html

  • rendering/style/RenderStyle.cpp:

(WebCore::RenderStyle::changeRequiresRepaint const):

  • rendering/style/StyleBackgroundData.cpp:

(WebCore::StyleBackgroundData::isEquivalentForPainting const):

  • rendering/style/StyleBackgroundData.h:

LayoutTests:

  • fast/css/currentColor-background-paint-expected.html: Added.
  • fast/css/currentColor-background-paint.html: Added.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r267526 r267528  
     12020-09-24  Antti Koivisto  <antti@apple.com>
     2
     3        currentColor isn't recalculated when a text node doesn't exist
     4        https://bugs.webkit.org/show_bug.cgi?id=216780
     5        <rdar://problem/69320933>
     6
     7        Reviewed by Antoine Quint.
     8
     9        * fast/css/currentColor-background-paint-expected.html: Added.
     10        * fast/css/currentColor-background-paint.html: Added.
     11
    1122020-09-24  Commit Queue  <commit-queue@webkit.org>
    213
  • trunk/Source/WebCore/ChangeLog

    r267527 r267528  
     12020-09-24  Antti Koivisto  <antti@apple.com>
     2
     3        currentColor isn't recalculated when a text node doesn't exist
     4        https://bugs.webkit.org/show_bug.cgi?id=216780
     5        <rdar://problem/69320933>
     6
     7        Reviewed by Antoine Quint.
     8
     9        We fail to repaint with the new background color when 'background-color' property has value 'currentColor' and the current color changes.
     10
     11        Test case by Cory LaViska.
     12
     13        Test: fast/css/currentColor-background-paint.html
     14
     15        * rendering/style/RenderStyle.cpp:
     16        (WebCore::RenderStyle::changeRequiresRepaint const):
     17        * rendering/style/StyleBackgroundData.cpp:
     18        (WebCore::StyleBackgroundData::isEquivalentForPainting const):
     19        * rendering/style/StyleBackgroundData.h:
     20
    1212020-09-24  Cathie Chen  <cathiechen@igalia.com>
    222
  • trunk/Source/WebCore/rendering/style/RenderStyle.cpp

    r266717 r267528  
    11161116        return false;
    11171117
     1118    bool currentColorDiffers = m_inheritedData->color != other.m_inheritedData->color;
     1119
    11181120    if (m_inheritedFlags.visibility != other.m_inheritedFlags.visibility
    11191121        || m_inheritedFlags.printColorAdjust != other.m_inheritedFlags.printColorAdjust
     
    11211123        || m_inheritedFlags.insideDefaultButton != other.m_inheritedFlags.insideDefaultButton
    11221124        || m_surroundData->border != other.m_surroundData->border
    1123         || !m_backgroundData->isEquivalentForPainting(*other.m_backgroundData))
     1125        || !m_backgroundData->isEquivalentForPainting(*other.m_backgroundData, currentColorDiffers))
    11241126        return true;
    11251127
  • trunk/Source/WebCore/rendering/style/StyleBackgroundData.cpp

    r266344 r267528  
    5252}
    5353
    54 bool StyleBackgroundData::isEquivalentForPainting(const StyleBackgroundData& other) const
     54bool StyleBackgroundData::isEquivalentForPainting(const StyleBackgroundData& other, bool currentColorDiffers) const
    5555{
    5656    if (background != other.background || color != other.color)
    5757        return false;
     58    if (currentColorDiffers && color == RenderStyle::currentColor())
     59        return false;
    5860    if (!outline.isVisible() && !other.outline.isVisible())
    5961        return true;
     62    if (currentColorDiffers && outline.color() == RenderStyle::currentColor())
     63        return false;
    6064    return outline == other.outline;
    6165}
  • trunk/Source/WebCore/rendering/style/StyleBackgroundData.h

    r266344 r267528  
    4242    bool operator!=(const StyleBackgroundData& other) const { return !(*this == other); }
    4343
    44     bool isEquivalentForPainting(const StyleBackgroundData&) const;
     44    bool isEquivalentForPainting(const StyleBackgroundData&, bool currentColorDiffers) const;
    4545
    4646    DataRef<FillLayer> background;
Note: See TracChangeset for help on using the changeset viewer.