Files
sousa-gecko/testing/web-platform/tests/css/css-shapes/parsing/shape-outside-path-invalid.html
T
Jason Leo f69f9a00dc Bug 2032337 [wpt PR 59240] - Support path() and shape() for shape-outside, a=testonly
Automatic update from web-platform-tests
Support path() and shape() for shape-outside

Extend the shape-outside property to accept path() and shape() basic
shape functions, and introduce a new CSSShapeOutsidePathAndShapeSupport
feature flag gates path() and shape().

Two key changes were made:

1. Handle the additional <basic-shape> values in
   StyleBuilderConverter::ConvertShapeValue(). Without this, the
   code fell into the else branch and crashed on
   To<CSSIdentifierValue>().

2. Shape::CreateShape() had no case for kStylePathType or
   kStyleShapeType. Both types provide a GetPath() virtual method,
   so they are rasterized into a RasterShape using the same approach
   as rounded polygons.

WPT tests are added for parsing (valid and invalid values) and layout
(float text wrapping) for all four shape functions.

ChromeStatus: https://chromestatus.com/feature/5080980370096128
Bug: 490343454, 490316313, 502328208
Change-Id: I4a838f6389e771d2e695e1b97ab238487cd809a8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7762682
Commit-Queue: Jason Leo <cgqaq@chromium.org>
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/main@{#1615362}

--

wpt-commits: 8b902687a14a83ad5a40c041d5786cd7bd215408
wpt-pr: 59240
2026-04-23 10:14:26 +00:00

19 lines
1.0 KiB
HTML

<!DOCTYPE html>
<title>CSS Shapes Module Level 1: parsing shape-outside with invalid path() values</title>
<link rel="author" title="Jason Leo" href="mailto:cgqaq@chromium.org">
<link rel="help" href="https://www.w3.org/TR/css-shapes-1/#funcdef-basic-shape-path">
<link rel="help" href="https://www.w3.org/TR/css-shapes-1/#shape-outside-property">
<meta name="assert" content="Invalid path() values should not be accepted for shape-outside.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
<script>
test_invalid_value("shape-outside", "path()");
test_invalid_value("shape-outside", "path('')");
test_invalid_value("shape-outside", "path(evenodd)");
test_invalid_value("shape-outside", "path(evenodd, 'not-a-path')");
test_invalid_value("shape-outside", "path(badfillrule, 'M10,10')");
test_invalid_value("shape-outside", "path(10, 20)");
test_invalid_value("shape-outside", "path('M10,10', evenodd)");
</script>