Changeset 259532 in webkit
- Timestamp:
- Apr 4, 2020, 11:16:25 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 8 deleted
- 20 edited
- 1 copied
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/TestExpectations (modified) (3 diffs)
-
LayoutTests/fast/borders/border-color-inherit-expected.html (copied) (copied from trunk/LayoutTests/fast/borders/border-color-inherit.html ) (3 diffs)
-
LayoutTests/fast/borders/border-color-inherit.html (modified) (2 diffs)
-
LayoutTests/fast/css/webkit-text-fill-color-inherit.html (modified) (1 diff)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/parsing/text-decoration-color-computed-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/currentcolor-animation-001-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/svg/pservers/scripted/stop-color-inheritance-currentcolor-expected.txt (modified) (1 diff)
-
LayoutTests/platform/gtk/fast/borders/border-color-inherit-expected.png (deleted)
-
LayoutTests/platform/gtk/fast/borders/border-color-inherit-expected.txt (deleted)
-
LayoutTests/platform/ios/fast/borders/border-color-inherit-expected.txt (deleted)
-
LayoutTests/platform/mac/fast/borders/border-color-inherit-expected.png (deleted)
-
LayoutTests/platform/mac/fast/borders/border-color-inherit-expected.txt (deleted)
-
LayoutTests/platform/win/fast/borders/border-color-inherit-expected.txt (deleted)
-
LayoutTests/platform/wincairo/fast/borders/border-color-inherit-expected.txt (deleted)
-
LayoutTests/platform/wpe/fast/borders/border-color-inherit-expected.txt (deleted)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/css/CSSComputedStyleDeclaration.cpp (modified) (1 diff)
-
Source/WebCore/css/CSSGradientValue.cpp (modified) (1 diff)
-
Source/WebCore/css/CSSProperties.json (modified) (15 diffs)
-
Source/WebCore/css/makeprop.pl (modified) (2 diffs)
-
Source/WebCore/page/animation/CSSPropertyAnimation.cpp (modified) (1 diff)
-
Source/WebCore/rendering/style/RenderStyle.cpp (modified) (2 diffs)
-
Source/WebCore/rendering/style/RenderStyle.h (modified) (3 diffs)
-
Source/WebCore/style/StyleBuilderCustom.h (modified) (1 diff)
-
Source/WebCore/style/StyleBuilderState.cpp (modified) (2 diffs)
-
Source/WebCore/style/StyleBuilderState.h (modified) (1 diff)
-
Source/WebCore/svg/SVGStopElement.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r259531 r259532 1 2020-04-04 Antti Koivisto <antti@apple.com> 2 3 Implement the css-color-4 behavior for inheritance of currentColor 4 https://bugs.webkit.org/show_bug.cgi?id=193171 5 <rdar://problem/47287516> 6 7 Reviewed by Simon Fraser. 8 9 * TestExpectations: 10 * fast/borders/border-color-inherit-expected.html: Copied from LayoutTests/fast/borders/border-color-inherit.html. 11 * fast/borders/border-color-inherit.html: 12 13 Fix for the new behavior and make it a reftest. 14 15 * fast/css/webkit-text-fill-color-inherit.html: 16 * platform/gtk/fast/borders/border-color-inherit-expected.png: Removed. 17 * platform/gtk/fast/borders/border-color-inherit-expected.txt: Removed. 18 * platform/ios/fast/borders/border-color-inherit-expected.txt: Removed. 19 * platform/mac/fast/borders/border-color-inherit-expected.png: Removed. 20 * platform/mac/fast/borders/border-color-inherit-expected.txt: Removed. 21 * platform/win/fast/borders/border-color-inherit-expected.txt: Removed. 22 * platform/wincairo/fast/borders/border-color-inherit-expected.txt: Removed. 23 * platform/wpe/fast/borders/border-color-inherit-expected.txt: Removed. 24 1 25 2020-04-04 Peng Liu <peng.liu6@apple.com> 2 26 -
trunk/LayoutTests/TestExpectations
r259452 r259532 1816 1816 webkit.org/b/148650 fast/repaint/add-table-overpaint.html [ Pass Failure ] 1817 1817 1818 imported/w3c/web-platform-tests/css/css-cascade/all-prop-inherit-color.html [ ImageOnlyFailure ]1819 imported/w3c/web-platform-tests/css/css-cascade/all-prop-revert-color.html [ ImageOnlyFailure ]1820 imported/w3c/web-platform-tests/css/css-cascade/all-prop-unset-color.html [ ImageOnlyFailure ]1821 1818 imported/w3c/web-platform-tests/css/css-cascade/important-prop.html [ ImageOnlyFailure ] 1822 1819 webkit.org/b/187093 [ Debug ] imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml.html [ Skip ] … … 1844 1841 1845 1842 # Initial failures on the import of css-color 1846 imported/w3c/web-platform-tests/css/css-color/currentcolor-002.html [ ImageOnlyFailure ]1847 1843 imported/w3c/web-platform-tests/css/css-color/t31-color-text-a.xht [ ImageOnlyFailure ] 1848 imported/w3c/web-platform-tests/css/css-color/t44-currentcolor-inherited-c.xht [ ImageOnlyFailure ]1849 1844 1850 1845 # Need to re-import canvas tests … … 1897 1892 imported/w3c/web-platform-tests/css/css-multicol/multicol-nested-margin-005.xht [ ImageOnlyFailure ] 1898 1893 webkit.org/b/148816 imported/w3c/web-platform-tests/css/css-multicol/multicol-rule-004.xht [ ImageOnlyFailure ] 1899 imported/w3c/web-platform-tests/css/css-multicol/multicol-rule-color-inherit-002.xht [ ImageOnlyFailure ]1900 1894 imported/w3c/web-platform-tests/css/css-multicol/multicol-rule-nested-balancing-001.html 1901 1895 imported/w3c/web-platform-tests/css/css-multicol/multicol-rule-nested-balancing-002.html -
trunk/LayoutTests/fast/borders/border-color-inherit-expected.html
r259531 r259532 1 <! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">1 <!doctype html> 2 2 <html> 3 3 <head> … … 5 5 <style type="text/css"> 6 6 .test { display: block; color: green; border: none;} 7 .test .inner { border-color: inherit; border-style: solid; color: red; } 8 .test .inner .text { color: green;} 7 .test .inner { border-color: inherit; border-style: solid; } 9 8 .test2 {margin: 1em 0 0;} 10 9 .test2 .inner {border-right-color: inherit; border-bottom-color: inherit; border-top-color: inherit;} 11 .test3 {margin: 1em 0 0; border: 3px solid; }10 .test3 {margin: 1em 0 0; border: 3px solid; } 12 11 .test3 .inner {border-top: inherit; border-right: inherit; border-left: inherit; border-bottom: inherit; border-top-width: 3px; border-top-style: solid; border-right-width: 3px; border-right-style: solid; border-left-width: 3px; border-left-style: solid; border-bottom-width: 3px; border-bottom-style: solid;} 13 12 </style> … … 17 16 <div class="inner"> 18 17 <div class="text"> 19 This should have a green border, because the computed value of 20 'border-color' set to its initial value is the computed value 21 of 'color', which is then inherited as a color. 18 This should have a green border. 22 19 </div> 23 20 </div> -
trunk/LayoutTests/fast/borders/border-color-inherit.html
r32421 r259532 1 <! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">1 <!doctype html> 2 2 <html> 3 3 <head> 4 4 <title>CSS inheritance: border-color</title> 5 5 <style type="text/css"> 6 .test { display: block; color: green; border: none;}7 .test .inner { border-color: inherit; border-style: solid; color: red; }6 .test { display: block; color: red; border: none;} 7 .test .inner { border-color: inherit; border-style: solid; color: green; } 8 8 .test .inner .text { color: green;} 9 9 .test2 {margin: 1em 0 0;} 10 10 .test2 .inner {border-right-color: inherit; border-bottom-color: inherit; border-top-color: inherit;} 11 .test3 {margin: 1em 0 0; border: 3px solid; }11 .test3 {margin: 1em 0 0; border: 3px solid; color: green } 12 12 .test3 .inner {border-top: inherit; border-right: inherit; border-left: inherit; border-bottom: inherit; border-top-width: 3px; border-top-style: solid; border-right-width: 3px; border-right-style: solid; border-left-width: 3px; border-left-style: solid; border-bottom-width: 3px; border-bottom-style: solid;} 13 13 </style> … … 17 17 <div class="inner"> 18 18 <div class="text"> 19 This should have a green border, because the computed value of 20 'border-color' set to its initial value is the computed value 21 of 'color', which is then inherited as a color. 19 This should have a green border. 22 20 </div> 23 21 </div> -
trunk/LayoutTests/fast/css/webkit-text-fill-color-inherit.html
r231805 r259532 2 2 <html> 3 3 <body> 4 <div style="color: green">5 <div id="undefined-parent" style="color: red; -webkit-text-fill-color: inherit">Green</div>4 <div style="color: red"> 5 <div id="undefined-parent" style="color: green; -webkit-text-fill-color: inherit">Green</div> 6 6 </div> 7 7 <div style="color: purple; -webkit-text-fill-color: green"> -
trunk/LayoutTests/imported/w3c/ChangeLog
r259261 r259532 1 2020-04-04 Antti Koivisto <antti@apple.com> 2 3 Implement the css-color-4 behavior for inheritance of currentColor 4 https://bugs.webkit.org/show_bug.cgi?id=193171 5 <rdar://problem/47287516> 6 7 Reviewed by Simon Fraser. 8 9 * web-platform-tests/css/css-text-decor/parsing/text-decoration-color-computed-expected.txt: 10 * web-platform-tests/css/css-transitions/currentcolor-animation-001-expected.txt: 11 * web-platform-tests/svg/pservers/scripted/stop-color-inheritance-currentcolor-expected.txt: 12 1 13 2020-03-30 Devin Rousso <drousso@apple.com> 2 14 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/parsing/text-decoration-color-computed-expected.txt
r251689 r259532 2 2 PASS Property text-decoration-color value 'rgb(0, 0, 255)' computes to 'rgb(0, 0, 255)' 3 3 PASS Property text-decoration-color value 'currentcolor' computes to 'rgb(0, 255, 0)' 4 FAIL Property text-decoration-color value 'inherit' computes to 'rgb(0, 255, 0)' assert_equals: expected "rgb(0, 255, 0)" but got "rgb(255, 0, 0)" 4 PASS Property text-decoration-color value 'inherit' computes to 'rgb(0, 255, 0)' 5 5 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/currentcolor-animation-001-expected.txt
r251591 r259532 1 1 2 FAIL Transition does not occur when the value is currentcolor and color changes assert_true: expected true got false 2 PASS Transition does not occur when the value is currentcolor and color changes 3 3 -
trunk/LayoutTests/imported/w3c/web-platform-tests/svg/pservers/scripted/stop-color-inheritance-currentcolor-expected.txt
r251777 r259532 1 1 2 FAIL "currentcolor" is inherited as a keyword assert_equals: expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)" 2 PASS "currentcolor" is inherited as a keyword 3 3 -
trunk/Source/WebCore/ChangeLog
r259531 r259532 1 2020-04-04 Antti Koivisto <antti@apple.com> 2 3 Implement the css-color-4 behavior for inheritance of currentColor 4 https://bugs.webkit.org/show_bug.cgi?id=193171 5 <rdar://problem/47287516> 6 7 Reviewed by Simon Fraser. 8 9 In CSS3/4 'currentcolor' inherits as 'currentcolor' instead of as a resolved color value. 10 11 Value 'currentcolor' is represented in RenderStyle as invalid Color object. This has been true 12 even before the explicit property value for it was added. Fallback to 'color' has always been 13 the default behavior of most color properties. 14 15 As a result the correct behavior falls pretty easily from WebKit code. It essentially amounts to allowing 16 color properties to inherit normally even when they are invalid/currentcolor. 17 18 In future we might want to wrap RenderStyle color values into a type that makes 'currentcolor' more explicit. 19 20 * css/CSSComputedStyleDeclaration.cpp: 21 (WebCore::ComputedStyleExtractor::valueForPropertyInStyle): 22 * css/CSSGradientValue.cpp: 23 (WebCore::CSSGradientValue::gradientWithStylesResolved): 24 * css/CSSProperties.json: 25 26 - Remove 'no-default-color' which triggered to old inheritance behavior. 27 - Rename initial value invalidColor to currentColor for clarity. 28 29 * css/makeprop.pl: 30 31 Code for 'no-default-color' generation is not needed anymore. 32 33 (generateInheritValueSetter): 34 * page/animation/CSSPropertyAnimation.cpp: 35 (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap): 36 * rendering/style/RenderStyle.cpp: 37 (WebCore::RenderStyle::colorIncludingFallback const): 38 39 Resolve 'background-color' like the rest so setting it to 'currentcolor' works correctly. 40 41 * rendering/style/RenderStyle.h: 42 (WebCore::RenderStyle::currentColor): 43 (WebCore::RenderStyle::invalidColor): Deleted. 44 * style/StyleBuilderCustom.h: 45 (WebCore::Style::BuilderCustom::applyTextOrBoxShadowValue): 46 * style/StyleBuilderState.cpp: 47 (WebCore::Style::BuilderState::createFilterOperations): 48 (WebCore::Style::BuilderState::colorFromPrimitiveValue const): 49 50 Don't resolve 'currentcolor', instead return it as a value. 51 52 (WebCore::Style::BuilderState::colorFromPrimitiveValueWithResolvedCurrentColor const): 53 54 Helper for a few cases where we still resolve current color during style building time. It is 55 used for filters and generated images. 56 57 * style/StyleBuilderState.h: 58 * svg/SVGStopElement.cpp: 59 (WebCore::SVGStopElement::stopColorIncludingOpacity const): 60 61 Resolve 'currentcolor' during use time for svg color stops. 62 1 63 2020-04-04 Peng Liu <peng.liu6@apple.com> 2 64 -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r259006 r259532 2457 2457 2458 2458 case CSSPropertyBackgroundColor: 2459 return cssValuePool.createColorValue(m_allowVisitedStyle? style.visitedDependentColor(CSSPropertyBackgroundColor) :style.backgroundColor());2459 return m_allowVisitedStyle ? cssValuePool.createColorValue(style.visitedDependentColor(CSSPropertyBackgroundColor)) : currentColorOrValidColor(&style, style.backgroundColor()); 2460 2460 case CSSPropertyBackgroundImage: 2461 2461 case CSSPropertyWebkitMaskImage: { -
trunk/Source/WebCore/css/CSSGradientValue.cpp
r257966 r259532 112 112 auto result = hasColorDerivedFromElement() ? clone(*this) : makeRef(*this); 113 113 resolveStopColors(result->m_stops, [&](const CSSPrimitiveValue& colorValue) { 114 return builderState.colorFromPrimitiveValue (colorValue);114 return builderState.colorFromPrimitiveValueWithResolvedCurrentColor(colorValue); 115 115 }); 116 116 return result; -
trunk/Source/WebCore/css/CSSProperties.json
r259006 r259532 89 89 "StyleResolver::applyPropertyToRegularStyle() returns true.", 90 90 "", 91 "* no-default-color:",92 "Should only be used with \"VisitedLinkColorSupport\". It indicates that when",93 "setting the inherited value, it will not fallback to using the parent's",94 "\"color\" property if the inherited color is invalid.",95 "",96 91 "* font-property:", 97 92 "Indicates that this CSS property is font-related. It must have corresponding", … … 185 180 "inherited": true, 186 181 "codegen-properties": { 187 "initial": " invalidColor",182 "initial": "currentColor", 188 183 "visited-link-color-support": true 189 184 }, … … 197 192 "codegen-properties": { 198 193 "visited-link-color-support": true, 199 "no-default-color": true,200 194 "high-priority": true 201 195 }, … … 1060 1054 "background-color": { 1061 1055 "codegen-properties": { 1062 "visited-link-color-support": true, 1063 "no-default-color": true 1056 "visited-link-color-support": true 1064 1057 }, 1065 1058 "specification": { … … 1421 1414 "border-bottom-color": { 1422 1415 "codegen-properties": { 1423 "initial": " invalidColor",1416 "initial": "currentColor", 1424 1417 "visited-link-color-support": true 1425 1418 }, … … 1774 1767 "border-left-color": { 1775 1768 "codegen-properties": { 1776 "initial": " invalidColor",1769 "initial": "currentColor", 1777 1770 "visited-link-color-support": true 1778 1771 }, … … 1842 1835 "border-right-color": { 1843 1836 "codegen-properties": { 1844 "initial": " invalidColor",1837 "initial": "currentColor", 1845 1838 "visited-link-color-support": true 1846 1839 }, … … 1923 1916 "border-top-color": { 1924 1917 "codegen-properties": { 1925 "initial": " invalidColor",1918 "initial": "currentColor", 1926 1919 "visited-link-color-support": true 1927 1920 }, … … 3197 3190 "outline-color": { 3198 3191 "codegen-properties": { 3199 "initial": " invalidColor",3192 "initial": "currentColor", 3200 3193 "visited-link-color-support": true 3201 3194 }, … … 3744 3737 "codegen-properties": { 3745 3738 "custom": "Value", 3746 "initial": " invalidColor",3739 "initial": "currentColor", 3747 3740 "visited-link-color-support": true 3748 3741 }, … … 4842 4835 "-webkit-column-rule-color" 4843 4836 ], 4844 "initial": " invalidColor",4837 "initial": "currentColor", 4845 4838 "visited-link-color-support": true 4846 4839 }, … … 6176 6169 "text-decoration-color": { 6177 6170 "codegen-properties": { 6178 "initial": " invalidColor",6171 "initial": "currentColor", 6179 6172 "visited-link-color-support": true, 6180 6173 "aliases": [ … … 6289 6282 "text-emphasis-color" 6290 6283 ], 6291 "initial": " invalidColor",6284 "initial": "currentColor", 6292 6285 "visited-link-color-support": true 6293 6286 }, … … 6336 6329 "inherited": true, 6337 6330 "codegen-properties": { 6338 "initial": " invalidColor",6331 "initial": "currentColor", 6339 6332 "visited-link-color-support": true 6340 6333 }, … … 6367 6360 "inherited": true, 6368 6361 "codegen-properties": { 6369 "initial": " invalidColor",6362 "initial": "currentColor", 6370 6363 "visited-link-color-support": true 6371 6364 }, -
trunk/Source/WebCore/css/makeprop.pl
r259006 r259532 78 78 "longhands" => 1, 79 79 "name-for-methods" => 1, 80 "no-default-color" => 1,81 80 "svg" => 1, 82 81 "skip-builder" => 1, … … 981 980 } elsif (exists $propertiesWithStyleBuilderOptions{$name}{"visited-link-color-support"}) { 982 981 $setterContent .= $indent . " Color color = " . $parentStyle . "." . $getter . "();\n"; 983 if (!exists($propertiesWithStyleBuilderOptions{$name}{"no-default-color"})) {984 $setterContent .= $indent . " if (!color.isValid())\n";985 $setterContent .= $indent . " color = " . $parentStyle . ".color();\n";986 }987 982 $setterContent .= generateColorValueSetter($name, "color", $indent . " "); 988 983 $didCallSetValue = 1; -
trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp
r254861 r259532 1588 1588 new PropertyWrapperVisitedAffectedColor(CSSPropertyColor, &RenderStyle::color, &RenderStyle::setColor, &RenderStyle::visitedLinkColor, &RenderStyle::setVisitedLinkColor), 1589 1589 1590 new PropertyWrapperVisitedAffectedColor(CSSPropertyBackgroundColor, &RenderStyle::backgroundColor, &RenderStyle::setBackgroundColor, &RenderStyle::visitedLinkBackgroundColor, &RenderStyle::setVisitedLinkBackgroundColor),1590 new PropertyWrapperVisitedAffectedColor(CSSPropertyBackgroundColor, MaybeInvalidColor, &RenderStyle::backgroundColor, &RenderStyle::setBackgroundColor, &RenderStyle::visitedLinkBackgroundColor, &RenderStyle::setVisitedLinkBackgroundColor), 1591 1591 1592 1592 new FillLayersPropertyWrapper(CSSPropertyBackgroundImage, &RenderStyle::backgroundLayers, &RenderStyle::ensureBackgroundLayers), -
trunk/Source/WebCore/rendering/style/RenderStyle.cpp
r258416 r259532 1954 1954 switch (colorProperty) { 1955 1955 case CSSPropertyBackgroundColor: 1956 return visitedLink ? visitedLinkBackgroundColor() : backgroundColor(); // Background color doesn't fall back. 1956 result = visitedLink ? visitedLinkBackgroundColor() : backgroundColor(); 1957 break; 1957 1958 case CSSPropertyBorderLeftColor: 1958 1959 result = visitedLink ? visitedLinkBorderLeftColor() : borderLeftColor(); … … 2010 2011 } 2011 2012 return result; 2013 } 2014 2015 Color RenderStyle::colorResolvingCurrentColor(const Color& color) const 2016 { 2017 if (color == currentColor()) 2018 return this->color(); 2019 2020 return color; 2012 2021 } 2013 2022 -
trunk/Source/WebCore/rendering/style/RenderStyle.h
r258416 r259532 1441 1441 void setLastChildState() { setUnique(); m_nonInheritedFlags.lastChildState = true; } 1442 1442 1443 Color colorResolvingCurrentColor(const Color&) const; 1443 1444 WEBCORE_EXPORT Color visitedDependentColor(CSSPropertyID) const; 1444 1445 WEBCORE_EXPORT Color visitedDependentColorWithColorFilter(CSSPropertyID) const; … … 1585 1586 static Length initialPerspectiveOriginY() { return Length(50.0f, Percent); } 1586 1587 static Color initialBackgroundColor() { return Color::transparent; } 1587 static Color initialTextEmphasisColor() { return Color(); }1588 static Color initialTextEmphasisColor() { return currentColor(); } 1588 1589 static TextEmphasisFill initialTextEmphasisFill() { return TextEmphasisFill::Filled; } 1589 1590 static TextEmphasisMark initialTextEmphasisMark() { return TextEmphasisMark::None; } … … 1732 1733 void getShadowBlockDirectionExtent(const ShadowData*, LayoutUnit& logicalTop, LayoutUnit& logicalBottom) const; 1733 1734 1734 static Color invalidColor() { return Color(); } 1735 // In RenderStyle invalid color value is used to signify 'currentcolor' which resolves to color(). 1736 static Color currentColor() { return { }; } 1735 1737 const Color& borderLeftColor() const { return m_surroundData->border.left().color(); } 1736 1738 const Color& borderRightColor() const { return m_surroundData->border.right().color(); } -
trunk/Source/WebCore/style/StyleBuilderCustom.h
r259006 r259532 820 820 Color color; 821 821 if (shadowValue.color) 822 color = builderState.colorFromPrimitiveValue (*shadowValue.color);822 color = builderState.colorFromPrimitiveValueWithResolvedCurrentColor(*shadowValue.color); 823 823 else 824 824 color = builderState.style().color(); 825 825 826 auto shadowData = makeUnique<ShadowData>(LayoutPoint(x, y), blur, spread, shadowStyle, property == CSSPropertyWebkitBoxShadow, color.isValid() ? color : Color::transparent); 826 827 if (property == CSSPropertyTextShadow) -
trunk/Source/WebCore/style/StyleBuilderState.cpp
r255490 r259532 268 268 Color color; 269 269 if (item.color) 270 color = colorFromPrimitiveValue (*item.color);270 color = colorFromPrimitiveValueWithResolvedCurrentColor(*item.color); 271 271 272 272 operations.operations().append(DropShadowFilterOperation::create(location, blur, color.isValid() ? color : Color::transparent)); … … 313 313 case CSSValueCurrentcolor: 314 314 // Color is an inherited property so depending on it effectively makes the property inherited. 315 // FIXME: Setting the flag as a side effect of calling this function is a bit oblique. Can we do better? 315 m_style.setHasExplicitlyInheritedProperties(); 316 return RenderStyle::currentColor(); 317 default: 318 return StyleColor::colorFromKeyword(identifier, document().styleColorOptions(&m_style)); 319 } 320 } 321 322 Color BuilderState::colorFromPrimitiveValueWithResolvedCurrentColor(const CSSPrimitiveValue& value) const 323 { 324 // FIXME: 'currentcolor' should be resolved at use time to make it inherit correctly. https://bugs.webkit.org/show_bug.cgi?id=210005 325 if (value.valueID() == CSSValueCurrentcolor) { 326 // Color is an inherited property so depending on it effectively makes the property inherited. 316 327 m_style.setHasExplicitlyInheritedProperties(); 317 328 return m_style.color(); 318 default:319 return StyleColor::colorFromKeyword(identifier, document().styleColorOptions(&m_style)); 320 }329 } 330 331 return colorFromPrimitiveValue(value); 321 332 } 322 333 -
trunk/Source/WebCore/style/StyleBuilderState.h
r254861 r259532 89 89 static bool isColorFromPrimitiveValueDerivedFromElement(const CSSPrimitiveValue&); 90 90 Color colorFromPrimitiveValue(const CSSPrimitiveValue&, bool forVisitedLink = false) const; 91 // FIXME: Remove. 'currentcolor' should be resolved at use time. All call sites are broken with inheritance. 92 Color colorFromPrimitiveValueWithResolvedCurrentColor(const CSSPrimitiveValue&) const; 91 93 92 94 const Vector<AtomString>& registeredContentAttributes() const { return m_registeredContentAttributes; } -
trunk/Source/WebCore/svg/SVGStopElement.cpp
r246490 r259532 88 88 Color SVGStopElement::stopColorIncludingOpacity() const 89 89 { 90 auto* style = renderer() ? &renderer()->style() : nullptr; 91 // FIXME: This check for null style exists to address Bug WK 90814, a rare crash condition in which the renderer or style is null. 92 if (!style) 90 if (!renderer()) 93 91 return Color(Color::transparent, true); 94 92 95 const SVGRenderStyle& svgStyle = style->svgStyle(); 96 float colorAlpha = svgStyle.stopColor().alpha() / 255.0; 93 auto& style = renderer()->style(); 94 auto& svgStyle = style.svgStyle(); 95 auto stopColor = style.colorResolvingCurrentColor(svgStyle.stopColor()); 96 97 float colorAlpha = stopColor.alpha() / 255.0; 97 98 // FIXME: This should use colorWithAlphaMultipliedBy() but that has different rounding of the alpha component. 98 return colorWithOverrideAlpha(s vgStyle.stopColor().rgb(), colorAlpha * svgStyle.stopOpacity());99 return colorWithOverrideAlpha(stopColor.rgb(), colorAlpha * svgStyle.stopOpacity()); 99 100 } 100 101
Note:
See TracChangeset
for help on using the changeset viewer.