Skip to content

Commit

Permalink
SVG Geometry: computed value of properties
Browse files Browse the repository at this point in the history
cx cy r rx ry x y computed values are lengths or percentages.
https://svgwg.org/svg2-draft/geometry.html
  • Loading branch information
ericwilligers committed Nov 16, 2018
1 parent 706ee77 commit bb2b9f8
Show file tree
Hide file tree
Showing 8 changed files with 199 additions and 0 deletions.
6 changes: 6 additions & 0 deletions css/support/computed-testcommon.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,16 @@ function test_computed_value(property, specified, computed) {
if (!computed)
computed = specified;
test(() => {
const target = document.getElementById('target');
if (!getComputedStyle(target)[property])
return;
target.style[property] = '';
target.style[property] = specified;
assert_equals(getComputedStyle(target)[property], computed);
if (computed !== specified) {
target.style[property] = '';
target.style[property] = computed;
assert_equals(getComputedStyle(target)[property], computed, 'computed value should round-trip');
}
}, "Property " + property + " value '" + specified + "' computes to '" + computed + "'");
}
27 changes: 27 additions & 0 deletions svg/geometry/parsing/cx-computed.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions svg/geometry/parsing/cy-computed.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions svg/geometry/parsing/r-computed.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions svg/geometry/parsing/rx-computed.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions svg/geometry/parsing/ry-computed.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions svg/geometry/parsing/x-computed.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions svg/geometry/parsing/y-computed.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit bb2b9f8

Please sign in to comment.