Commit 7ec0e4e0 authored by Darren Shen's avatar Darren Shen Committed by Commit Bot

[css-typed-om] Add a few keyword properties.

Add support for the following properties:
- image-rendering
- text-anchor
- text-combine-upright
- text-overflow
- text-rendering
- transform-style
- user-select

Lots of failing tests, usually because a keyword isn't implemented in
Blink yet.

Bug: 820299
Change-Id: Ifd0193ac55d12a31d28b486166ad78a38012314b
Reviewed-on: https://chromium-review.googlesource.com/985337Reviewed-by: default avatarRune Lillesveen <futhark@chromium.org>
Commit-Queue: Darren Shen <shend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#547665}
parent 3eef95f1
This is a testharness.js-based test.
PASS Can set 'image-rendering' to CSS-wide keywords
PASS Can set 'image-rendering' to var() references
PASS Can set 'image-rendering' to the 'auto' keyword
FAIL Can set 'image-rendering' to the 'smooth' keyword Failed to execute 'set' on 'StylePropertyMap': Invalid type for property
FAIL Can set 'image-rendering' to the 'high-quality' keyword Failed to execute 'set' on 'StylePropertyMap': Invalid type for property
FAIL Can set 'image-rendering' to the 'crisp-edges' keyword Failed to execute 'set' on 'StylePropertyMap': Invalid type for property
PASS Can set 'image-rendering' to the 'pixelated' keyword
PASS Setting 'image-rendering' to a length throws TypeError
PASS Setting 'image-rendering' to a percent throws TypeError
PASS Setting 'image-rendering' to a time throws TypeError
PASS Setting 'image-rendering' to a number throws TypeError
PASS Setting 'image-rendering' to a position throws TypeError
PASS Setting 'image-rendering' to a URL throws TypeError
PASS Setting 'image-rendering' to a transform throws TypeError
Harness: the test ran to completion.
<!doctype html>
<meta charset="utf-8">
<title>'image-rendering' 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('image-rendering', [
{ syntax: 'auto' },
{ syntax: 'smooth' },
{ syntax: 'high-quality' },
{ syntax: 'crisp-edges' },
{ syntax: 'pixelated' },
]);
</script>
<!doctype html>
<meta charset="utf-8">
<title>'text-anchor' 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('text-anchor', [
{ syntax: 'start' },
{ syntax: 'middle' },
{ syntax: 'end' },
]);
</script>
This is a testharness.js-based test.
PASS Can set 'text-combine-upright' to CSS-wide keywords
PASS Can set 'text-combine-upright' to var() references
PASS Can set 'text-combine-upright' to the 'none' keyword
PASS Can set 'text-combine-upright' to the 'all' keyword
PASS Setting 'text-combine-upright' to a length throws TypeError
PASS Setting 'text-combine-upright' to a percent throws TypeError
PASS Setting 'text-combine-upright' to a time throws TypeError
PASS Setting 'text-combine-upright' to a number throws TypeError
PASS Setting 'text-combine-upright' to a position throws TypeError
PASS Setting 'text-combine-upright' to a URL throws TypeError
PASS Setting 'text-combine-upright' to a transform throws TypeError
FAIL 'text-combine-upright' does not supported 'digits 3' assert_not_equals: Unsupported value must not be null got disallowed value null
Harness: the test ran to completion.
<!doctype html>
<meta charset="utf-8">
<title>'text-combine-upright' 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('text-combine-upright', [
{ syntax: 'none' },
{ syntax: 'all' },
]);
runUnsupportedPropertyTests('text-combine-upright', [
'digits 3'
]);
</script>
This is a testharness.js-based test.
PASS Can set 'text-overflow' to CSS-wide keywords
PASS Can set 'text-overflow' to var() references
PASS Can set 'text-overflow' to the 'clip' keyword
PASS Can set 'text-overflow' to the 'ellipsis' keyword
FAIL Can set 'text-overflow' to the 'fade' keyword Failed to execute 'set' on 'StylePropertyMap': Invalid type for property
PASS Setting 'text-overflow' to a length throws TypeError
PASS Setting 'text-overflow' to a percent throws TypeError
PASS Setting 'text-overflow' to a time throws TypeError
PASS Setting 'text-overflow' to a number throws TypeError
PASS Setting 'text-overflow' to a position throws TypeError
PASS Setting 'text-overflow' to a URL throws TypeError
PASS Setting 'text-overflow' to a transform throws TypeError
FAIL 'text-overflow' does not supported 'clip ellipsis' assert_not_equals: Unsupported value must not be null got disallowed value null
FAIL 'text-overflow' does not supported '"..."' assert_not_equals: Unsupported value must not be null got disallowed value null
FAIL 'text-overflow' does not supported 'fade(1px, 50%)' assert_not_equals: Unsupported value must not be null got disallowed value null
Harness: the test ran to completion.
<!doctype html>
<meta charset="utf-8">
<title>'text-overflow' 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('text-overflow', [
{ syntax: 'clip' },
{ syntax: 'ellipsis' },
{ syntax: 'fade' },
]);
runUnsupportedPropertyTests('text-overflow', [
'clip ellipsis', '"..."', 'fade(1px, 50%)'
]);
</script>
<!doctype html>
<meta charset="utf-8">
<title>'text-rendering' 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('text-rendering', [
{ syntax: 'auto' },
{ syntax: 'optimizeSpeed' },
{ syntax: 'optimizeLegibility' },
{ syntax: 'geometricPrecision' },
]);
</script>
This is a testharness.js-based test.
Harness Error. harness_status.status = 1 , harness_status.message = Uncaught Error: 'preserve-3d' is not a valid CSS component
PASS Can set 'transform-style' to CSS-wide keywords
PASS Can set 'transform-style' to var() references
FAIL Can set 'transform-style' to the 'auto' keyword Failed to execute 'set' on 'StylePropertyMap': Invalid type for property
PASS Can set 'transform-style' to the 'flat' keyword
Harness: the test ran to completion.
<!doctype html>
<meta charset="utf-8">
<title>'transform-style' 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('transform-style', [
{ syntax: 'auto' },
{ syntax: 'flat' },
{ syntax: 'preserve-3d' },
]);
</script>
This is a testharness.js-based test.
PASS Can set 'user-select' to CSS-wide keywords
PASS Can set 'user-select' to var() references
PASS Can set 'user-select' to the 'auto' keyword
PASS Can set 'user-select' to the 'text' keyword
PASS Can set 'user-select' to the 'none' keyword
FAIL Can set 'user-select' to the 'contain' keyword Failed to execute 'set' on 'StylePropertyMap': Invalid type for property
PASS Can set 'user-select' to the 'all' keyword
PASS Setting 'user-select' to a length throws TypeError
PASS Setting 'user-select' to a percent throws TypeError
PASS Setting 'user-select' to a time throws TypeError
PASS Setting 'user-select' to a number throws TypeError
PASS Setting 'user-select' to a position throws TypeError
PASS Setting 'user-select' to a URL throws TypeError
PASS Setting 'user-select' to a transform throws TypeError
Harness: the test ran to completion.
<!doctype html>
<meta charset="utf-8">
<title>'user-select' 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('user-select', [
{ syntax: 'auto' },
{ syntax: 'text' },
{ syntax: 'none' },
{ syntax: 'contain' },
{ syntax: 'all' },
]);
</script>
...@@ -673,6 +673,8 @@ ...@@ -673,6 +673,8 @@
inherited: true, inherited: true,
font: true, font: true,
type_name: "TextRenderingMode", type_name: "TextRenderingMode",
keywords: ["auto", "optimizeSpeed", "optimizeLegibility", "geometricPrecision"],
typedom_types: ["Keyword"],
priority: "High", priority: "High",
}, },
{ {
...@@ -1586,6 +1588,7 @@ ...@@ -1586,6 +1588,7 @@
"auto", "optimizeSpeed", "optimizeQuality", "auto", "optimizeSpeed", "optimizeQuality",
"-webkit-optimize-contrast", "pixelated" "-webkit-optimize-contrast", "pixelated"
], ],
typedom_types: ["Keyword"],
default_value: "auto", default_value: "auto",
}, },
{ {
...@@ -2705,6 +2708,8 @@ ...@@ -2705,6 +2708,8 @@
property_methods: ["CSSValueFromComputedStyleInternal"], property_methods: ["CSSValueFromComputedStyleInternal"],
inherited: true, inherited: true,
svg: true, svg: true,
keywords: ["start", "middle", "end"],
typedom_types: ["Keyword"]
}, },
{ {
name: "text-combine-upright", name: "text-combine-upright",
...@@ -2713,6 +2718,7 @@ ...@@ -2713,6 +2718,7 @@
field_group: "*", field_group: "*",
field_template: "keyword", field_template: "keyword",
keywords: ["none", "all"], keywords: ["none", "all"],
typedom_types: ["Keyword"],
default_value: "none", default_value: "none",
name_for_methods: "TextCombine", name_for_methods: "TextCombine",
}, },
...@@ -2789,6 +2795,7 @@ ...@@ -2789,6 +2795,7 @@
field_group: "*", field_group: "*",
field_template: "keyword", field_template: "keyword",
keywords: ["clip", "ellipsis"], keywords: ["clip", "ellipsis"],
typedom_types: ["Keyword"],
default_value: "clip", default_value: "clip",
}, },
{ {
...@@ -2904,6 +2911,7 @@ ...@@ -2904,6 +2911,7 @@
field_template: "keyword", field_template: "keyword",
keywords: ["flat", "preserve-3d"], keywords: ["flat", "preserve-3d"],
default_value: "flat", default_value: "flat",
typedom_types: ["Keyword"],
name_for_methods: "TransformStyle3D", name_for_methods: "TransformStyle3D",
}, },
{ {
...@@ -3550,6 +3558,7 @@ ...@@ -3550,6 +3558,7 @@
field_group: "*", field_group: "*",
field_template: "keyword", field_template: "keyword",
keywords: ["auto", "none", "text", "all"], keywords: ["auto", "none", "text", "all"],
typedom_types: ["Keyword"],
default_value: "auto", default_value: "auto",
}, },
{ {
......
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