From 99bdd54a8adc811da1f8826e58a99c178f4ed217 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20S=C3=B6derquist?= Date: Fri, 28 Feb 2020 07:37:53 -0800 Subject: [PATCH] Fixes to wpt/svg/styling/presentation-attributes-* tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Missing negation in the "d presentation attribute not supported on other elements" subtest in ...-special-cases.html test. Set 'irrelevantElement' to null for 'd', 'height', 'r', 'rx', 'ry', 'transform', 'width', 'x' and 'y' since they are all mentioned in the table in the spec[1] as being special. They are also covered by the ...-special-cases.html test. The definition of 'Applies to' for the 'transform' attribute varies slightly between the SVG specification and CSS transforms specifications, so this applies essentially the intersection of those two. [1] https://svgwg.org/svg2-draft/styling.html#PresentationAttributes Bug: 1056055 Change-Id: Id7a6e604d4f48abbd601bdc09ec9f7ff795b86ca Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2078581 Reviewed-by: Stephen Chenney Commit-Queue: Fredrik Söderquist Cr-Commit-Position: refs/heads/master@{#745452} --- .../presentation-attributes-special-cases.html | 2 +- svg/styling/presentation-attributes.js | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/svg/styling/presentation-attributes-special-cases.html b/svg/styling/presentation-attributes-special-cases.html index c544c9c7a64d8b..8fa045984d9ad5 100644 --- a/svg/styling/presentation-attributes-special-cases.html +++ b/svg/styling/presentation-attributes-special-cases.html @@ -89,7 +89,7 @@ if (CSS.supports("d", "initial")) { test(function() { - assertPresentationAttributeIsSupported("g", "d", "M0,0 L1,1", "d"); + assertPresentationAttributeIsNotSupported("g", "d", "M0,0 L1,1", "d"); }, `d presentation attribute not supported on other elements`); } diff --git a/svg/styling/presentation-attributes.js b/svg/styling/presentation-attributes.js index c9dc14ad49072c..552041496f187e 100644 --- a/svg/styling/presentation-attributes.js +++ b/svg/styling/presentation-attributes.js @@ -62,7 +62,7 @@ const PROPERTIES = { "d": { value: "M0,0 L1,1", relevantElement: "path", - irrelevantElement: "image", + irrelevantElement: null, }, "dominant-baseline": { value: "middle", @@ -142,7 +142,7 @@ const PROPERTIES = { "height": { value: "1", relevantElement: "rect", - irrelevantElement: "path", + irrelevantElement: null, }, "image-rendering": { value: "optimizeSpeed", @@ -207,17 +207,17 @@ const PROPERTIES = { "r": { value: "1", relevantElement: "circle", - irrelevantElement: "rect", + irrelevantElement: null, }, "rx": { value: "1", relevantElement: "rect", - irrelevantElement: "path", + irrelevantElement: null, }, "ry": { value: "1", relevantElement: "rect", - irrelevantElement: "path", + irrelevantElement: null, }, "shape-rendering": { value: "geometricPrecision", @@ -302,7 +302,7 @@ const PROPERTIES = { "transform": { value: "scale(2)", relevantElement: "g", - irrelevantElement: "linearGradient", + irrelevantElement: null, }, "unicode-bidi": { value: "embed", @@ -327,7 +327,7 @@ const PROPERTIES = { "width": { value: "1", relevantElement: "rect", - irrelevantElement: "path", + irrelevantElement: null, }, "word-spacing": { value: "1", @@ -342,12 +342,12 @@ const PROPERTIES = { "x": { value: "1", relevantElement: "rect", - irrelevantElement: "path", + irrelevantElement: null, }, "y": { value: "1", relevantElement: "rect", - irrelevantElement: "path", + irrelevantElement: null, }, };