Commit 9f1f5191 authored by Hwanseung Lee's avatar Hwanseung Lee Committed by Commit Bot

[css-typed-om] support block-size and inline-size

block-size[1], inline-size[2], max-block-size[3],
max-inline-size[4], min-block-size[5], min-inline-size[6]
are added to support in whitelist.
and test file are also added.

[1]https://drafts.csswg.org/css-logical-1/#propdef-block-size
[2]https://drafts.csswg.org/css-logical-1/#propdef-inline-size
[3]https://drafts.csswg.org/css-logical-1/#propdef-max-block-size
[4]https://drafts.csswg.org/css-logical-1/#propdef-max-inline-size
[5]https://drafts.csswg.org/css-logical-1/#propdef-min-block-size
[6]https://drafts.csswg.org/css-logical-1/#propdef-min-inline-size

Bug: 820299
Change-Id: I97c589deea28bfedc82ec1b1686ceaf9979cb95e
Reviewed-on: https://chromium-review.googlesource.com/973561
Commit-Queue: Hwanseung Lee <hwanseung@chromium.org>
Reviewed-by: default avatarDarren Shen <shend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#545802}
parent 4cdf2e98
<!doctype html>
<meta charset="utf-8">
<title>'block-size' 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('block-size', [
{ syntax: 'auto' },
{
syntax: '<percentage>',
specified: assert_is_equal_with_range_handling
},
{
syntax: '<length>',
specified: assert_is_equal_with_range_handling
},
]);
runPropertyTests('min-block-size', [
{
syntax: '<percentage>',
specified: assert_is_equal_with_range_handling
},
{
syntax: '<length>',
specified: assert_is_equal_with_range_handling
},
]);
runPropertyTests('max-block-size', [
{ syntax: 'none' },
{
syntax: '<percentage>',
specified: assert_is_equal_with_range_handling
},
{
syntax: '<length>',
specified: assert_is_equal_with_range_handling
},
]);
</script>
\ No newline at end of file
<!doctype html>
<meta charset="utf-8">
<title>'inline-size' 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('inline-size', [
{ syntax: 'auto' },
{
syntax: '<percentage>',
specified: assert_is_equal_with_range_handling
},
{
syntax: '<length>',
specified: assert_is_equal_with_range_handling
},
]);
runPropertyTests('min-inline-size', [
{
syntax: '<percentage>',
specified: assert_is_equal_with_range_handling
},
{
syntax: '<length>',
specified: assert_is_equal_with_range_handling
},
]);
runPropertyTests('max-inline-size', [
{ syntax: 'none' },
{
syntax: '<percentage>',
specified: assert_is_equal_with_range_handling
},
{
syntax: '<length>',
specified: assert_is_equal_with_range_handling
},
]);
</script>
\ No newline at end of file
......@@ -3615,6 +3615,8 @@
logical_side: "width",
shorthand_for_physical_side: "CSSProperty",
},
keywords: ["auto"],
typedom_types: ["Keyword", "Length", "Percentage"],
},
{
name: "block-size",
......@@ -3623,6 +3625,8 @@
logical_side: "height",
shorthand_for_physical_side: "CSSProperty",
},
keywords: ["auto"],
typedom_types: ["Keyword", "Length", "Percentage"],
},
{
name: "min-inline-size",
......@@ -3631,6 +3635,7 @@
logical_side: "width",
shorthand_for_physical_side: "CSSPropertyMin",
},
typedom_types: ["Length", "Percentage"],
},
{
name: "min-block-size",
......@@ -3639,6 +3644,7 @@
logical_side: "height",
shorthand_for_physical_side: "CSSPropertyMin",
},
typedom_types: ["Length", "Percentage"],
},
{
name: "max-inline-size",
......@@ -3647,6 +3653,8 @@
logical_side: "width",
shorthand_for_physical_side: "CSSPropertyMax",
},
keywords: ["none"],
typedom_types: ["Keyword", "Length", "Percentage"],
},
{
name: "max-block-size",
......@@ -3655,6 +3663,8 @@
logical_side: "height",
shorthand_for_physical_side: "CSSPropertyMax",
},
keywords: ["none"],
typedom_types: ["Keyword", "Length", "Percentage"],
},
// Non-standard direction aware properties
......
......@@ -44,11 +44,17 @@ bool IsValueOutOfRangeForProperty(CSSPropertyID property_id, double value) {
// For non-length properties and special cases.
switch (property_id) {
case CSSPropertyBlockSize:
case CSSPropertyFlexGrow:
case CSSPropertyFlexShrink:
case CSSPropertyFontSize:
case CSSPropertyFontSizeAdjust:
case CSSPropertyFontStretch:
case CSSPropertyInlineSize:
case CSSPropertyMaxBlockSize:
case CSSPropertyMaxInlineSize:
case CSSPropertyMinBlockSize:
case CSSPropertyMinInlineSize:
return value < 0;
case CSSPropertyFontWeight:
return value < 0 || value > 1000;
......
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