Commit fb2bb694 authored by Darren Shen's avatar Darren Shen Committed by Commit Bot

[css-typed-om] Add tests for images related properties.

This patch adds tests for properties taking an <image>. There are some
failing tests due to keywords not implemented in Blink yet.

Bug: 774887
Change-Id: Ie5fa1fa15a16440273517afdd62b078449e615e4
Reviewed-on: https://chromium-review.googlesource.com/928056
Commit-Queue: nainar <nainar@chromium.org>
Reviewed-by: default avatarnainar <nainar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#539118}
parent 18fc5e4a
<!doctype html>
<meta charset="utf-8">
<title>'border-image-source' property</title>
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-get">
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-set">
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#property-stle-value-normalization">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../../resources/testhelper.js"></script>
<script src="resources/testsuite.js"></script>
<body>
<div id="log"></div>
<script>
'use strict';
runPropertyTests('border-image-source', [
{ syntax: 'none' },
{ syntax: '<image>' },
]);
</script>
This is a testharness.js-based test.
FAIL Can set 'mask-image' to CSS-wide keywords Failed to execute 'set' on 'StylePropertyMap': Invalid propertyName: mask-image
FAIL Can set 'mask-image' to the 'none' keyword Failed to execute 'set' on 'StylePropertyMap': Invalid propertyName: mask-image
FAIL Can set 'mask-image' to an image Failed to execute 'get' on 'StylePropertyMapReadOnly': Invalid propertyName: mask-image
PASS Setting 'mask-image' to a length throws TypeError
PASS Setting 'mask-image' to a percent throws TypeError
PASS Setting 'mask-image' to a time throws TypeError
PASS Setting 'mask-image' to a number throws TypeError
PASS Setting 'mask-image' to a position throws TypeError
PASS Setting 'mask-image' to a transform throws TypeError
Harness: the test ran to completion.
<!doctype html>
<meta charset="utf-8">
<title>'mask-image' property</title>
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-get">
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-set">
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#property-stle-value-normalization">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../../resources/testhelper.js"></script>
<script src="resources/testsuite.js"></script>
<body>
<div id="log"></div>
<script>
'use strict';
// FIXME: mask-image is list-valued. Run list-valued tests here too.
runPropertyTests('mask-image', [
{ syntax: 'none' },
{ syntax: '<image>' },
]);
</script>
This is a testharness.js-based test.
PASS Can set 'shape-outside' to CSS-wide keywords
PASS Can set 'shape-outside' to the 'none' keyword
FAIL Can set 'shape-outside' to the 'margin-box' keyword Failed to execute 'set' on 'StylePropertyMap': Invalid type for property
FAIL Can set 'shape-outside' to the 'border-box' keyword Failed to execute 'set' on 'StylePropertyMap': Invalid type for property
FAIL Can set 'shape-outside' to the 'padding-box' keyword Failed to execute 'set' on 'StylePropertyMap': Invalid type for property
FAIL Can set 'shape-outside' to the 'content-box' keyword Failed to execute 'set' on 'StylePropertyMap': Invalid type for property
PASS Can set 'shape-outside' to an image
PASS Setting 'shape-outside' to a length throws TypeError
PASS Setting 'shape-outside' to a percent throws TypeError
PASS Setting 'shape-outside' to a time throws TypeError
PASS Setting 'shape-outside' to a number throws TypeError
PASS Setting 'shape-outside' to a position throws TypeError
PASS Setting 'shape-outside' to a transform throws TypeError
PASS 'shape-outside' does not supported 'inset(22% 12% 15px 35px)'
PASS 'shape-outside' does not supported 'circle(6rem at 12rem 6rem)'
PASS 'shape-outside' does not supported 'ellipse(115px 55px at 50% 40%)'
PASS 'shape-outside' does not supported 'polygon(50% 20%, 90% 80%, 10% 80%)'
Harness: the test ran to completion.
<!doctype html>
<meta charset="utf-8">
<title>'shape-outside' property</title>
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-get">
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-set">
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#property-stle-value-normalization">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../../resources/testhelper.js"></script>
<script src="resources/testsuite.js"></script>
<body>
<div id="log"></div>
<script>
'use strict';
runPropertyTests('shape-outside', [
{ syntax: 'none' },
{ syntax: 'margin-box' },
{ syntax: 'border-box' },
{ syntax: 'padding-box' },
{ syntax: 'content-box' },
{ syntax: '<image>' },
]);
// <basic-shape>s are not supported in level 1
runUnsupportedPropertyTests('shape-outside', [
'inset(22% 12% 15px 35px)',
'circle(6rem at 12rem 6rem)',
'ellipse(115px 55px at 50% 40%)',
'polygon(50% 20%, 90% 80%, 10% 80%)',
]);
</script>
...@@ -2431,6 +2431,7 @@ ...@@ -2431,6 +2431,7 @@
type_name: "ShapeValue", type_name: "ShapeValue",
computed_style_custom_functions: ["getter"], computed_style_custom_functions: ["getter"],
converter: "ConvertShapeValue", converter: "ConvertShapeValue",
keywords: ["none"]
}, },
{ {
name: "shape-rendering", name: "shape-rendering",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment