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

Changeset 277320 in webkit


Ignore:
Timestamp:
May 11, 2021, 5:24:00 AM (5 years ago)
Author:
Antti Koivisto
Message:

Don't allow :visited link style in subtrees that use mix-blend-mode
https://bugs.webkit.org/show_bug.cgi?id=225446
rdar://65686091

Reviewed by Darin Adler.
Source/WebCore:

Test: fast/css/visited-link-mix-blend-mode.html

  • rendering/style/RenderStyle.cpp:

(WebCore::RenderStyle::visitedDependentColor const):

Return unvisited style in substrees that use mix-blend-mode.

  • rendering/style/RenderStyle.h:

(WebCore::RenderStyle::setBlendMode):
(WebCore::RenderStyle::isInSubtreeWithBlendMode const):

Add an inherited fake property for tracking this.

  • rendering/style/StyleRareInheritedData.cpp:

(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator== const):

  • rendering/style/StyleRareInheritedData.h:

LayoutTests:

  • fast/css/visited-link-mix-blend-mode-expected.html: Added.
  • fast/css/visited-link-mix-blend-mode.html: Added.
Location:
trunk
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r277315 r277320  
     12021-05-11  Antti Koivisto  <antti@apple.com>
     2
     3        Don't allow :visited link style in subtrees that use mix-blend-mode
     4        https://bugs.webkit.org/show_bug.cgi?id=225446
     5        rdar://65686091
     6
     7        Reviewed by Darin Adler.
     8
     9        * fast/css/visited-link-mix-blend-mode-expected.html: Added.
     10        * fast/css/visited-link-mix-blend-mode.html: Added.
     11
    1122021-05-10  Chris Dumez  <cdumez@apple.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r277316 r277320  
     12021-05-11  Antti Koivisto  <antti@apple.com>
     2
     3        Don't allow :visited link style in subtrees that use mix-blend-mode
     4        https://bugs.webkit.org/show_bug.cgi?id=225446
     5        rdar://65686091
     6
     7        Reviewed by Darin Adler.
     8       
     9        Test: fast/css/visited-link-mix-blend-mode.html
     10
     11        * rendering/style/RenderStyle.cpp:
     12        (WebCore::RenderStyle::visitedDependentColor const):
     13       
     14        Return unvisited style in substrees that use mix-blend-mode.
     15
     16        * rendering/style/RenderStyle.h:
     17        (WebCore::RenderStyle::setBlendMode):
     18        (WebCore::RenderStyle::isInSubtreeWithBlendMode const):
     19       
     20        Add an inherited fake property for tracking this.
     21       
     22        * rendering/style/StyleRareInheritedData.cpp:
     23        (WebCore::StyleRareInheritedData::StyleRareInheritedData):
     24        (WebCore::StyleRareInheritedData::operator== const):
     25        * rendering/style/StyleRareInheritedData.h:
     26
    1272021-05-10  Wenson Hsieh  <wenson_hsieh@apple.com>
    228
  • trunk/Source/WebCore/rendering/style/RenderStyle.cpp

    r276465 r277320  
    21152115        return unvisitedColor;
    21162116
     2117#if ENABLE(CSS_COMPOSITING)
     2118    if (isInSubtreeWithBlendMode())
     2119        return unvisitedColor;
     2120#endif
     2121   
    21172122    Color visitedColor = colorResolvingCurrentColor(colorProperty, true);
    21182123
  • trunk/Source/WebCore/rendering/style/RenderStyle.h

    r276465 r277320  
    821821#if ENABLE(CSS_COMPOSITING)
    822822    BlendMode blendMode() const { return static_cast<BlendMode>(m_rareNonInheritedData->effectiveBlendMode); }
    823     void setBlendMode(BlendMode mode) { SET_VAR(m_rareNonInheritedData, effectiveBlendMode, static_cast<unsigned>(mode)); }
     823    void setBlendMode(BlendMode);
    824824    bool hasBlendMode() const { return static_cast<BlendMode>(m_rareNonInheritedData->effectiveBlendMode) != BlendMode::Normal; }
     825    bool isInSubtreeWithBlendMode() const { return m_rareInheritedData->isInSubtreeWithBlendMode; }
    825826
    826827    Isolation isolation() const { return static_cast<Isolation>(m_rareNonInheritedData->isolation); }
     
    22032204}
    22042205
     2206inline void RenderStyle::setBlendMode(BlendMode mode)
     2207{
     2208    SET_VAR(m_rareNonInheritedData, effectiveBlendMode, static_cast<unsigned>(mode));
     2209    SET_VAR(m_rareInheritedData, isInSubtreeWithBlendMode, mode != BlendMode::Normal);
     2210}
     2211
    22052212inline void RenderStyle::setLogicalWidth(Length&& logicalWidth)
    22062213{
  • trunk/Source/WebCore/rendering/style/StyleRareInheritedData.cpp

    r275199 r277320  
    136136    , hasAutoCaretColor(true)
    137137    , hasVisitedLinkAutoCaretColor(true)
     138    , isInSubtreeWithBlendMode(false)
    138139    , effectiveTouchActions(RenderStyle::initialTouchActions())
    139140    , strokeWidth(RenderStyle::initialStrokeWidth())
     
    232233    , hasAutoCaretColor(o.hasAutoCaretColor)
    233234    , hasVisitedLinkAutoCaretColor(o.hasVisitedLinkAutoCaretColor)
     235    , isInSubtreeWithBlendMode(o.isInSubtreeWithBlendMode)
    234236    , effectiveTouchActions(o.effectiveTouchActions)
    235237    , eventListenerRegionTypes(o.eventListenerRegionTypes)
     
    355357        && hasAutoCaretColor == o.hasAutoCaretColor
    356358        && hasVisitedLinkAutoCaretColor == o.hasVisitedLinkAutoCaretColor
     359        && isInSubtreeWithBlendMode == o.isInSubtreeWithBlendMode
    357360        && effectiveTouchActions == o.effectiveTouchActions
    358361        && eventListenerRegionTypes == o.eventListenerRegionTypes
  • trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h

    r275199 r277320  
    162162    unsigned hasVisitedLinkAutoCaretColor : 1;
    163163
     164    unsigned isInSubtreeWithBlendMode : 1;
     165
    164166    OptionSet<TouchAction> effectiveTouchActions;
    165167    OptionSet<EventListenerRegionType> eventListenerRegionTypes;
Note: See TracChangeset for help on using the changeset viewer.