haikuwebkit/LayoutTests/fast/css/paint-order.html

32 lines
859 B
HTML
Raw Permalink Normal View History

Add support for CSS properties paint-order, stroke-linecap, and stroke-linejoin in text rendering. https://bugs.webkit.org/show_bug.cgi?id=168601 Source/WebCore: rdar://problem/30583872 Reviewed by Simon Fraser. Text rendering should respect the CSS properties paint-order, stroke-linecap, and stroke-linejoin, see https://drafts.fxtf.org/paint/. The text rendering changes are mainly in the TextPainter class, where text is painted in three phases (fill, stroke, markers), where the order follows the paint-order property. The linecap and linejoin properties are set on the graphics context before rendering the text. Tests: fast/css/paint-order.html fast/css/paint-order-shadow.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::paintOrder): * css/StyleBuilderConverter.h: (WebCore::StyleBuilderConverter::convertPaintOrder): * rendering/TextPaintStyle.cpp: (WebCore::computeTextPaintStyle): (WebCore::updateGraphicsContext): * rendering/TextPaintStyle.h: * rendering/TextPainter.cpp: (WebCore::TextPainter::paintTextAndEmphasisMarksIfNeeded): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::paintTypesForPaintOrder): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::setPaintOrder): (WebCore::RenderStyle::initialPaintOrder): * rendering/style/RenderStyleConstants.h: * rendering/style/SVGRenderStyleDefs.h: * rendering/style/StyleRareInheritedData.cpp: (WebCore::StyleRareInheritedData::StyleRareInheritedData): * rendering/svg/RenderSVGShape.cpp: (WebCore::RenderSVGShape::fillStrokeMarkers): * rendering/svg/SVGInlineTextBox.cpp: (WebCore::SVGInlineTextBox::paint): LayoutTests: Reviewed by Simon Fraser. * fast/css/paint-order-expected.html: Added. * fast/css/paint-order-shadow-expected.html: Added. * fast/css/paint-order-shadow.html: Added. * fast/css/paint-order.html: Added. Canonical link: https://commits.webkit.org/185713@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212808 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-02-22 06:55:54 +00:00
<!DOCTYPE html>
<html>
<head>
<style>
div {
font-size: 100px;
Add support for CSS properties paint-order, stroke-linecap, and stroke-linejoin in text rendering. https://bugs.webkit.org/show_bug.cgi?id=168601 Source/WebCore: rdar://problem/30583872 Reviewed by Simon Fraser. Text rendering should respect the CSS properties paint-order, stroke-linecap, and stroke-linejoin, see https://drafts.fxtf.org/paint/. The text rendering changes are mainly in the TextPainter class, where text is painted in three phases (fill, stroke, markers), where the order follows the paint-order property. The linecap and linejoin properties are set on the graphics context before rendering the text. Tests: fast/css/paint-order.html fast/css/paint-order-shadow.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::paintOrder): * css/StyleBuilderConverter.h: (WebCore::StyleBuilderConverter::convertPaintOrder): * rendering/TextPaintStyle.cpp: (WebCore::computeTextPaintStyle): (WebCore::updateGraphicsContext): * rendering/TextPaintStyle.h: * rendering/TextPainter.cpp: (WebCore::TextPainter::paintTextAndEmphasisMarksIfNeeded): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::paintTypesForPaintOrder): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::setPaintOrder): (WebCore::RenderStyle::initialPaintOrder): * rendering/style/RenderStyleConstants.h: * rendering/style/SVGRenderStyleDefs.h: * rendering/style/StyleRareInheritedData.cpp: (WebCore::StyleRareInheritedData::StyleRareInheritedData): * rendering/svg/RenderSVGShape.cpp: (WebCore::RenderSVGShape::fillStrokeMarkers): * rendering/svg/SVGInlineTextBox.cpp: (WebCore::SVGInlineTextBox::paint): LayoutTests: Reviewed by Simon Fraser. * fast/css/paint-order-expected.html: Added. * fast/css/paint-order-shadow-expected.html: Added. * fast/css/paint-order-shadow.html: Added. * fast/css/paint-order.html: Added. Canonical link: https://commits.webkit.org/185713@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212808 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-02-22 06:55:54 +00:00
color: gray;
width: 100px;
Add support for CSS properties paint-order, stroke-linecap, and stroke-linejoin in text rendering. https://bugs.webkit.org/show_bug.cgi?id=168601 Source/WebCore: rdar://problem/30583872 Reviewed by Simon Fraser. Text rendering should respect the CSS properties paint-order, stroke-linecap, and stroke-linejoin, see https://drafts.fxtf.org/paint/. The text rendering changes are mainly in the TextPainter class, where text is painted in three phases (fill, stroke, markers), where the order follows the paint-order property. The linecap and linejoin properties are set on the graphics context before rendering the text. Tests: fast/css/paint-order.html fast/css/paint-order-shadow.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::paintOrder): * css/StyleBuilderConverter.h: (WebCore::StyleBuilderConverter::convertPaintOrder): * rendering/TextPaintStyle.cpp: (WebCore::computeTextPaintStyle): (WebCore::updateGraphicsContext): * rendering/TextPaintStyle.h: * rendering/TextPainter.cpp: (WebCore::TextPainter::paintTextAndEmphasisMarksIfNeeded): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::paintTypesForPaintOrder): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::setPaintOrder): (WebCore::RenderStyle::initialPaintOrder): * rendering/style/RenderStyleConstants.h: * rendering/style/SVGRenderStyleDefs.h: * rendering/style/StyleRareInheritedData.cpp: (WebCore::StyleRareInheritedData::StyleRareInheritedData): * rendering/svg/RenderSVGShape.cpp: (WebCore::RenderSVGShape::fillStrokeMarkers): * rendering/svg/SVGInlineTextBox.cpp: (WebCore::SVGInlineTextBox::paint): LayoutTests: Reviewed by Simon Fraser. * fast/css/paint-order-expected.html: Added. * fast/css/paint-order-shadow-expected.html: Added. * fast/css/paint-order-shadow.html: Added. * fast/css/paint-order.html: Added. Canonical link: https://commits.webkit.org/185713@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212808 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-02-22 06:55:54 +00:00
}
.test-stroke {
text-shadow: none;
-webkit-text-stroke: 60px red;
Add support for CSS properties paint-order, stroke-linecap, and stroke-linejoin in text rendering. https://bugs.webkit.org/show_bug.cgi?id=168601 Source/WebCore: rdar://problem/30583872 Reviewed by Simon Fraser. Text rendering should respect the CSS properties paint-order, stroke-linecap, and stroke-linejoin, see https://drafts.fxtf.org/paint/. The text rendering changes are mainly in the TextPainter class, where text is painted in three phases (fill, stroke, markers), where the order follows the paint-order property. The linecap and linejoin properties are set on the graphics context before rendering the text. Tests: fast/css/paint-order.html fast/css/paint-order-shadow.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::paintOrder): * css/StyleBuilderConverter.h: (WebCore::StyleBuilderConverter::convertPaintOrder): * rendering/TextPaintStyle.cpp: (WebCore::computeTextPaintStyle): (WebCore::updateGraphicsContext): * rendering/TextPaintStyle.h: * rendering/TextPainter.cpp: (WebCore::TextPainter::paintTextAndEmphasisMarksIfNeeded): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::paintTypesForPaintOrder): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::setPaintOrder): (WebCore::RenderStyle::initialPaintOrder): * rendering/style/RenderStyleConstants.h: * rendering/style/SVGRenderStyleDefs.h: * rendering/style/StyleRareInheritedData.cpp: (WebCore::StyleRareInheritedData::StyleRareInheritedData): * rendering/svg/RenderSVGShape.cpp: (WebCore::RenderSVGShape::fillStrokeMarkers): * rendering/svg/SVGInlineTextBox.cpp: (WebCore::SVGInlineTextBox::paint): LayoutTests: Reviewed by Simon Fraser. * fast/css/paint-order-expected.html: Added. * fast/css/paint-order-shadow-expected.html: Added. * fast/css/paint-order-shadow.html: Added. * fast/css/paint-order.html: Added. Canonical link: https://commits.webkit.org/185713@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212808 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-02-22 06:55:54 +00:00
/* Clip used to isolate the stroke */
-webkit-clip-path: inset(55px 35px 55px 35px);
Add support for CSS properties paint-order, stroke-linecap, and stroke-linejoin in text rendering. https://bugs.webkit.org/show_bug.cgi?id=168601 Source/WebCore: rdar://problem/30583872 Reviewed by Simon Fraser. Text rendering should respect the CSS properties paint-order, stroke-linecap, and stroke-linejoin, see https://drafts.fxtf.org/paint/. The text rendering changes are mainly in the TextPainter class, where text is painted in three phases (fill, stroke, markers), where the order follows the paint-order property. The linecap and linejoin properties are set on the graphics context before rendering the text. Tests: fast/css/paint-order.html fast/css/paint-order-shadow.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::paintOrder): * css/StyleBuilderConverter.h: (WebCore::StyleBuilderConverter::convertPaintOrder): * rendering/TextPaintStyle.cpp: (WebCore::computeTextPaintStyle): (WebCore::updateGraphicsContext): * rendering/TextPaintStyle.h: * rendering/TextPainter.cpp: (WebCore::TextPainter::paintTextAndEmphasisMarksIfNeeded): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::paintTypesForPaintOrder): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::setPaintOrder): (WebCore::RenderStyle::initialPaintOrder): * rendering/style/RenderStyleConstants.h: * rendering/style/SVGRenderStyleDefs.h: * rendering/style/StyleRareInheritedData.cpp: (WebCore::StyleRareInheritedData::StyleRareInheritedData): * rendering/svg/RenderSVGShape.cpp: (WebCore::RenderSVGShape::fillStrokeMarkers): * rendering/svg/SVGInlineTextBox.cpp: (WebCore::SVGInlineTextBox::paint): LayoutTests: Reviewed by Simon Fraser. * fast/css/paint-order-expected.html: Added. * fast/css/paint-order-shadow-expected.html: Added. * fast/css/paint-order-shadow.html: Added. * fast/css/paint-order.html: Added. Canonical link: https://commits.webkit.org/185713@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212808 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-02-22 06:55:54 +00:00
}
</style>
</head>
<body>
<div class="test-stroke" style="paint-order: fill;">&#x25fc;</div>
<div class="test-stroke" style="paint-order: fill markers;">&#x25fc;</div>
<div class="test-stroke" style="paint-order: stroke;">&#x25fc;</div>
<div class="test-stroke" style="paint-order: stroke markers;">&#x25fc;</div>
<div class="test-stroke" style="paint-order: markers;">&#x25fc;</div>
<div class="test-stroke" style="paint-order: markers stroke;">&#x25fc;</div>
Add support for CSS properties paint-order, stroke-linecap, and stroke-linejoin in text rendering. https://bugs.webkit.org/show_bug.cgi?id=168601 Source/WebCore: rdar://problem/30583872 Reviewed by Simon Fraser. Text rendering should respect the CSS properties paint-order, stroke-linecap, and stroke-linejoin, see https://drafts.fxtf.org/paint/. The text rendering changes are mainly in the TextPainter class, where text is painted in three phases (fill, stroke, markers), where the order follows the paint-order property. The linecap and linejoin properties are set on the graphics context before rendering the text. Tests: fast/css/paint-order.html fast/css/paint-order-shadow.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::paintOrder): * css/StyleBuilderConverter.h: (WebCore::StyleBuilderConverter::convertPaintOrder): * rendering/TextPaintStyle.cpp: (WebCore::computeTextPaintStyle): (WebCore::updateGraphicsContext): * rendering/TextPaintStyle.h: * rendering/TextPainter.cpp: (WebCore::TextPainter::paintTextAndEmphasisMarksIfNeeded): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::paintTypesForPaintOrder): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::setPaintOrder): (WebCore::RenderStyle::initialPaintOrder): * rendering/style/RenderStyleConstants.h: * rendering/style/SVGRenderStyleDefs.h: * rendering/style/StyleRareInheritedData.cpp: (WebCore::StyleRareInheritedData::StyleRareInheritedData): * rendering/svg/RenderSVGShape.cpp: (WebCore::RenderSVGShape::fillStrokeMarkers): * rendering/svg/SVGInlineTextBox.cpp: (WebCore::SVGInlineTextBox::paint): LayoutTests: Reviewed by Simon Fraser. * fast/css/paint-order-expected.html: Added. * fast/css/paint-order-shadow-expected.html: Added. * fast/css/paint-order-shadow.html: Added. * fast/css/paint-order.html: Added. Canonical link: https://commits.webkit.org/185713@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212808 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-02-22 06:55:54 +00:00
</body>
</html>