haikuwebkit/LayoutTests/fast/css/stroke-color-fallback.html

38 lines
1.4 KiB
HTML
Raw Permalink Normal View History

Implement stroke-color CSS property. https://bugs.webkit.org/show_bug.cgi?id=169352 Reviewed by Jon Lee. Source/WebCore: Support setting text stroke color using the CSS property stroke-color, see https://drafts.fxtf.org/paint/. Text stroke color can currently be set with the -webkit-text-stroke-color property. To make sure this still works, I added a check to determine if the stroke-color property has been explicitly set. If it has not been set, we fall back to the value of the -webkit-text-stroke-color property. Tests: fast/css/stroke-color-fallback.html fast/css/stroke-color.html fast/css/visited-link-stroke-color.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * css/CSSProperties.json: * css/StyleBuilderCustom.h: (WebCore::StyleBuilderCustom::applyValueStrokeColor): * css/StyleResolver.cpp: (WebCore::isValidVisitedLinkProperty): * css/parser/CSSParserFastPaths.cpp: (WebCore::isColorPropertyID): * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseSingleValue): * rendering/TextDecorationPainter.cpp: (WebCore::decorationColor): * rendering/TextPaintStyle.cpp: (WebCore::computeTextPaintStyle): (WebCore::computeTextSelectionPaintStyle): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::changeRequiresRepaintIfTextOrBorderOrOutline): (WebCore::RenderStyle::colorIncludingFallback): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::strokeColor): (WebCore::RenderStyle::setStrokeColor): (WebCore::RenderStyle::setVisitedLinkStrokeColor): (WebCore::RenderStyle::visitedLinkStrokeColor): (WebCore::RenderStyle::setHasExplicitlySetStrokeColor): (WebCore::RenderStyle::hasExplicitlySetStrokeColor): * rendering/style/StyleRareInheritedData.cpp: (WebCore::StyleRareInheritedData::StyleRareInheritedData): (WebCore::StyleRareInheritedData::operator==): * rendering/style/StyleRareInheritedData.h: LayoutTests: * fast/css/stroke-color-expected.html: Added. * fast/css/stroke-color-fallback-expected.html: Added. * fast/css/stroke-color-fallback.html: Added. * fast/css/stroke-color.html: Added. * fast/css/visited-link-stroke-color-expected.html: Added. * fast/css/visited-link-stroke-color.html: Added. Canonical link: https://commits.webkit.org/187686@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215261 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-12 08:01:51 +00:00
<!DOCTYPE html>
<html>
<head>
<style>
div {
font-size: 80px;
color: gray;
text-shadow: none;
The css properties stroke-width/stroke-color and -webkit-text-stroke-width/-webkit-text-stroke-color should not be mixed. https://bugs.webkit.org/show_bug.cgi?id=174737 Reviewed by Antti Koivisto. Source/WebCore: Previously, the stroke width and stroke color would independently fall back to the -webkit-text-stroke-width and -webkit-text-stroke-color values if stroke-width and/or stroke-color were not explicitly specified. This is problematic, since we might end up mixing the new stroke properties with the legacy Webkit stroke properties. The new strategy is to use the stroke-width and stroke-color value combination only if stroke-color has been explicitly specified. This should work well, since there will be no visible stroke when specifying only stroke-width (because stroke-color by default is transparent). We can then safely fall back to the legacy Webkit stroke value combination. In the case where only stroke-color is specified, we should use the stroke-width/ stroke-color combination, since stroke-width by default is 1, and we will then have a visible stroke. No new tests, existing tests have been updated to reflect behavior changes. * rendering/TextDecorationPainter.cpp: (WebCore::decorationColor): * rendering/TextPaintStyle.cpp: (WebCore::computeTextPaintStyle): (WebCore::computeTextSelectionPaintStyle): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::computedStrokeWidth const): (WebCore::RenderStyle::hasPositiveStrokeWidth const): (WebCore::RenderStyle::computedStrokeColor const): * rendering/style/RenderStyle.h: LayoutTests: * fast/css/stroke-color-expected.html: * fast/css/stroke-color-fallback-expected.html: * fast/css/stroke-color-fallback.html: * fast/css/stroke-color.html: * fast/css/stroke-width-expected.html: * fast/css/stroke-width-fallback-expected.html: * fast/css/stroke-width-fallback.html: * fast/css/stroke-width.html: Canonical link: https://commits.webkit.org/195665@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224780 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-11-13 22:13:34 +00:00
stroke-width: 10px;
Implement stroke-color CSS property. https://bugs.webkit.org/show_bug.cgi?id=169352 Reviewed by Jon Lee. Source/WebCore: Support setting text stroke color using the CSS property stroke-color, see https://drafts.fxtf.org/paint/. Text stroke color can currently be set with the -webkit-text-stroke-color property. To make sure this still works, I added a check to determine if the stroke-color property has been explicitly set. If it has not been set, we fall back to the value of the -webkit-text-stroke-color property. Tests: fast/css/stroke-color-fallback.html fast/css/stroke-color.html fast/css/visited-link-stroke-color.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * css/CSSProperties.json: * css/StyleBuilderCustom.h: (WebCore::StyleBuilderCustom::applyValueStrokeColor): * css/StyleResolver.cpp: (WebCore::isValidVisitedLinkProperty): * css/parser/CSSParserFastPaths.cpp: (WebCore::isColorPropertyID): * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseSingleValue): * rendering/TextDecorationPainter.cpp: (WebCore::decorationColor): * rendering/TextPaintStyle.cpp: (WebCore::computeTextPaintStyle): (WebCore::computeTextSelectionPaintStyle): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::changeRequiresRepaintIfTextOrBorderOrOutline): (WebCore::RenderStyle::colorIncludingFallback): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::strokeColor): (WebCore::RenderStyle::setStrokeColor): (WebCore::RenderStyle::setVisitedLinkStrokeColor): (WebCore::RenderStyle::visitedLinkStrokeColor): (WebCore::RenderStyle::setHasExplicitlySetStrokeColor): (WebCore::RenderStyle::hasExplicitlySetStrokeColor): * rendering/style/StyleRareInheritedData.cpp: (WebCore::StyleRareInheritedData::StyleRareInheritedData): (WebCore::StyleRareInheritedData::operator==): * rendering/style/StyleRareInheritedData.h: LayoutTests: * fast/css/stroke-color-expected.html: Added. * fast/css/stroke-color-fallback-expected.html: Added. * fast/css/stroke-color-fallback.html: Added. * fast/css/stroke-color.html: Added. * fast/css/visited-link-stroke-color-expected.html: Added. * fast/css/visited-link-stroke-color.html: Added. Canonical link: https://commits.webkit.org/187686@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215261 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-12 08:01:51 +00:00
-webkit-text-stroke-width: 10px;
The css properties stroke-width/stroke-color and -webkit-text-stroke-width/-webkit-text-stroke-color should not be mixed. https://bugs.webkit.org/show_bug.cgi?id=174737 Reviewed by Antti Koivisto. Source/WebCore: Previously, the stroke width and stroke color would independently fall back to the -webkit-text-stroke-width and -webkit-text-stroke-color values if stroke-width and/or stroke-color were not explicitly specified. This is problematic, since we might end up mixing the new stroke properties with the legacy Webkit stroke properties. The new strategy is to use the stroke-width and stroke-color value combination only if stroke-color has been explicitly specified. This should work well, since there will be no visible stroke when specifying only stroke-width (because stroke-color by default is transparent). We can then safely fall back to the legacy Webkit stroke value combination. In the case where only stroke-color is specified, we should use the stroke-width/ stroke-color combination, since stroke-width by default is 1, and we will then have a visible stroke. No new tests, existing tests have been updated to reflect behavior changes. * rendering/TextDecorationPainter.cpp: (WebCore::decorationColor): * rendering/TextPaintStyle.cpp: (WebCore::computeTextPaintStyle): (WebCore::computeTextSelectionPaintStyle): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::computedStrokeWidth const): (WebCore::RenderStyle::hasPositiveStrokeWidth const): (WebCore::RenderStyle::computedStrokeColor const): * rendering/style/RenderStyle.h: LayoutTests: * fast/css/stroke-color-expected.html: * fast/css/stroke-color-fallback-expected.html: * fast/css/stroke-color-fallback.html: * fast/css/stroke-color.html: * fast/css/stroke-width-expected.html: * fast/css/stroke-width-fallback-expected.html: * fast/css/stroke-width-fallback.html: * fast/css/stroke-width.html: Canonical link: https://commits.webkit.org/195665@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224780 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-11-13 22:13:34 +00:00
display: inline;
Implement stroke-color CSS property. https://bugs.webkit.org/show_bug.cgi?id=169352 Reviewed by Jon Lee. Source/WebCore: Support setting text stroke color using the CSS property stroke-color, see https://drafts.fxtf.org/paint/. Text stroke color can currently be set with the -webkit-text-stroke-color property. To make sure this still works, I added a check to determine if the stroke-color property has been explicitly set. If it has not been set, we fall back to the value of the -webkit-text-stroke-color property. Tests: fast/css/stroke-color-fallback.html fast/css/stroke-color.html fast/css/visited-link-stroke-color.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * css/CSSProperties.json: * css/StyleBuilderCustom.h: (WebCore::StyleBuilderCustom::applyValueStrokeColor): * css/StyleResolver.cpp: (WebCore::isValidVisitedLinkProperty): * css/parser/CSSParserFastPaths.cpp: (WebCore::isColorPropertyID): * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseSingleValue): * rendering/TextDecorationPainter.cpp: (WebCore::decorationColor): * rendering/TextPaintStyle.cpp: (WebCore::computeTextPaintStyle): (WebCore::computeTextSelectionPaintStyle): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::changeRequiresRepaintIfTextOrBorderOrOutline): (WebCore::RenderStyle::colorIncludingFallback): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::strokeColor): (WebCore::RenderStyle::setStrokeColor): (WebCore::RenderStyle::setVisitedLinkStrokeColor): (WebCore::RenderStyle::visitedLinkStrokeColor): (WebCore::RenderStyle::setHasExplicitlySetStrokeColor): (WebCore::RenderStyle::hasExplicitlySetStrokeColor): * rendering/style/StyleRareInheritedData.cpp: (WebCore::StyleRareInheritedData::StyleRareInheritedData): (WebCore::StyleRareInheritedData::operator==): * rendering/style/StyleRareInheritedData.h: LayoutTests: * fast/css/stroke-color-expected.html: Added. * fast/css/stroke-color-fallback-expected.html: Added. * fast/css/stroke-color-fallback.html: Added. * fast/css/stroke-color.html: Added. * fast/css/visited-link-stroke-color-expected.html: Added. * fast/css/visited-link-stroke-color.html: Added. Canonical link: https://commits.webkit.org/187686@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215261 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-12 08:01:51 +00:00
}
The css properties stroke-width/stroke-color and -webkit-text-stroke-width/-webkit-text-stroke-color should not be mixed. https://bugs.webkit.org/show_bug.cgi?id=174737 Reviewed by Antti Koivisto. Source/WebCore: Previously, the stroke width and stroke color would independently fall back to the -webkit-text-stroke-width and -webkit-text-stroke-color values if stroke-width and/or stroke-color were not explicitly specified. This is problematic, since we might end up mixing the new stroke properties with the legacy Webkit stroke properties. The new strategy is to use the stroke-width and stroke-color value combination only if stroke-color has been explicitly specified. This should work well, since there will be no visible stroke when specifying only stroke-width (because stroke-color by default is transparent). We can then safely fall back to the legacy Webkit stroke value combination. In the case where only stroke-color is specified, we should use the stroke-width/ stroke-color combination, since stroke-width by default is 1, and we will then have a visible stroke. No new tests, existing tests have been updated to reflect behavior changes. * rendering/TextDecorationPainter.cpp: (WebCore::decorationColor): * rendering/TextPaintStyle.cpp: (WebCore::computeTextPaintStyle): (WebCore::computeTextSelectionPaintStyle): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::computedStrokeWidth const): (WebCore::RenderStyle::hasPositiveStrokeWidth const): (WebCore::RenderStyle::computedStrokeColor const): * rendering/style/RenderStyle.h: LayoutTests: * fast/css/stroke-color-expected.html: * fast/css/stroke-color-fallback-expected.html: * fast/css/stroke-color-fallback.html: * fast/css/stroke-color.html: * fast/css/stroke-width-expected.html: * fast/css/stroke-width-fallback-expected.html: * fast/css/stroke-width-fallback.html: * fast/css/stroke-width.html: Canonical link: https://commits.webkit.org/195665@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224780 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-11-13 22:13:34 +00:00
div.stroke-color-class {
Implement stroke-color CSS property. https://bugs.webkit.org/show_bug.cgi?id=169352 Reviewed by Jon Lee. Source/WebCore: Support setting text stroke color using the CSS property stroke-color, see https://drafts.fxtf.org/paint/. Text stroke color can currently be set with the -webkit-text-stroke-color property. To make sure this still works, I added a check to determine if the stroke-color property has been explicitly set. If it has not been set, we fall back to the value of the -webkit-text-stroke-color property. Tests: fast/css/stroke-color-fallback.html fast/css/stroke-color.html fast/css/visited-link-stroke-color.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * css/CSSProperties.json: * css/StyleBuilderCustom.h: (WebCore::StyleBuilderCustom::applyValueStrokeColor): * css/StyleResolver.cpp: (WebCore::isValidVisitedLinkProperty): * css/parser/CSSParserFastPaths.cpp: (WebCore::isColorPropertyID): * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseSingleValue): * rendering/TextDecorationPainter.cpp: (WebCore::decorationColor): * rendering/TextPaintStyle.cpp: (WebCore::computeTextPaintStyle): (WebCore::computeTextSelectionPaintStyle): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::changeRequiresRepaintIfTextOrBorderOrOutline): (WebCore::RenderStyle::colorIncludingFallback): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::strokeColor): (WebCore::RenderStyle::setStrokeColor): (WebCore::RenderStyle::setVisitedLinkStrokeColor): (WebCore::RenderStyle::visitedLinkStrokeColor): (WebCore::RenderStyle::setHasExplicitlySetStrokeColor): (WebCore::RenderStyle::hasExplicitlySetStrokeColor): * rendering/style/StyleRareInheritedData.cpp: (WebCore::StyleRareInheritedData::StyleRareInheritedData): (WebCore::StyleRareInheritedData::operator==): * rendering/style/StyleRareInheritedData.h: LayoutTests: * fast/css/stroke-color-expected.html: Added. * fast/css/stroke-color-fallback-expected.html: Added. * fast/css/stroke-color-fallback.html: Added. * fast/css/stroke-color.html: Added. * fast/css/visited-link-stroke-color-expected.html: Added. * fast/css/visited-link-stroke-color.html: Added. Canonical link: https://commits.webkit.org/187686@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215261 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-12 08:01:51 +00:00
stroke-color: green;
}
</style>
</head>
<body>
<div style="-webkit-text-stroke-color: blue;">&#x25fc;</div>
<div style="stroke-color: green; -webkit-text-stroke-color: blue;">&#x25fc;</div>
<div style="-webkit-text-stroke-color: blue; stroke-color: green;">&#x25fc;</div>
<div style="-webkit-text-stroke-color: blue; stroke-color: green; stroke-color: yellow;">&#x25fc;</div>
<div style="-webkit-text-stroke-color: blue; stroke-color: green; -webkit-text-stroke-color: red;">&#x25fc;</div>
<div style="stroke-color: green;"><span style="-webkit-text-stroke-color: blue;">&#x25fc;</span></div>
<div style="-webkit-text-stroke-color: blue;"><span style="stroke-color: green;">&#x25fc;</span></div>
<div style="-webkit-text-stroke-color: blue;"><span>&#x25fc;</span></div>
<div style="stroke-color: green; -webkit-text-stroke-color: blue;"><span>&#x25fc;</span></div>
<div style="-webkit-text-stroke-color: blue; stroke-color: green;"><span>&#x25fc;</span></div>
<div class="stroke-color-class" style="-webkit-text-stroke-color: blue;">&#x25fc;</div>
</body>
</html>