mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-03 13:02:09 +02:00
Tests: Import some more inset() tests
This commit is contained in:
committed by
Jelle Raaijmakers
parent
7ac6aecef0
commit
a2b2baca7e
Notes:
github-actions[bot]
2026-01-06 09:51:55 +00:00
Author: https://github.com/Calme1709 Commit: https://github.com/LadybirdBrowser/ladybird/commit/a2b2baca7ed Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/7339 Reviewed-by: https://github.com/gmta ✅
@@ -0,0 +1,76 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Shape Outside Inset Valid Formats</title>
|
||||
<link rel="author" title="Adobe" href="http://html.adobe.com/">
|
||||
<link rel="author" title="Bear Travis" href="mailto:betravis@adobe.com">
|
||||
<link rel="reviewer" title="Alan Stearns" href="mailto:stearns@adobe.com"> <!-- 2014-03-04 -->
|
||||
<link rel="help" href="http://www.w3.org/TR/css-shapes-1/#funcdef-inset">
|
||||
<link rel="help" href="http://www.w3.org/TR/css-shapes-1/#shape-outside-property">
|
||||
<meta name="assert" content="An inset has 1 to 4 insets, and optional border radii that follow the border-radius format">
|
||||
<meta name="flags" content="ahem dom">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1">
|
||||
<script src="../../../../resources/testharness.js"></script>
|
||||
<script src="../../../../resources/testharnessreport.js"></script>
|
||||
<script src="support/parsing-utils.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script type="text/javascript">
|
||||
var valid_inset_tests = [
|
||||
{
|
||||
"name": "1 inset",
|
||||
"actual": "inset(10px)",
|
||||
"expected_inline": "inset(10px)",
|
||||
"expected_computed": "inset(10px)"
|
||||
},
|
||||
{
|
||||
"name": "2 insets",
|
||||
"actual": "inset(10px 20px)",
|
||||
"expected_inline": "inset(10px 20px)",
|
||||
"expected_computed": "inset(10px 20px)"
|
||||
},
|
||||
{
|
||||
"name": "3 insets",
|
||||
"actual": "inset(10px 20px 30px)",
|
||||
"expected_inline": "inset(10px 20px 30px)",
|
||||
"expected_computed": "inset(10px 20px 30px)"
|
||||
},
|
||||
{
|
||||
"name": "4 insets",
|
||||
"actual": "inset(10px 20px 30px 40px)",
|
||||
"expected_inline": "inset(10px 20px 30px 40px)",
|
||||
"expected_computed": "inset(10px 20px 30px 40px)"
|
||||
},
|
||||
{
|
||||
"name": "1 inset and round",
|
||||
"actual": "inset(10px round 20px)",
|
||||
"expected_inline": "inset(10px round 20px)",
|
||||
"expected_computed": "inset(10px round 20px)"
|
||||
},
|
||||
{
|
||||
"name": "2 insets and round",
|
||||
"actual": "inset(10px 20px round 30px)",
|
||||
"expected_inline": "inset(10px 20px round 30px)",
|
||||
"expected_computed": "inset(10px 20px round 30px)"
|
||||
},
|
||||
{
|
||||
"name": "3 insets and round",
|
||||
"actual": "inset(10px 20px 30px round 40px)",
|
||||
"expected_inline": "inset(10px 20px 30px round 40px)",
|
||||
"expected_computed": "inset(10px 20px 30px round 40px)"
|
||||
},
|
||||
{
|
||||
"name": "4 insets and round",
|
||||
"actual": "inset(10px 20px 30px 40px round 50px)",
|
||||
"expected_inline": "inset(10px 20px 30px 40px round 50px)",
|
||||
"expected_computed": "inset(10px 20px 30px 40px round 50px)"
|
||||
}
|
||||
];
|
||||
generate_tests( ParsingUtils.testInlineStyle,
|
||||
ParsingUtils.buildTestCases(valid_inset_tests, "inline") );
|
||||
generate_tests( ParsingUtils.testComputedStyle,
|
||||
ParsingUtils.buildTestCases(valid_inset_tests, "computed") );
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Shape Outside Inset Valid Insets</title>
|
||||
<link rel="author" title="Adobe" href="http://html.adobe.com/">
|
||||
<link rel="author" title="Bear Travis" href="mailto:betravis@adobe.com">
|
||||
<link rel="reviewer" title="Alan Stearns" href="mailto:stearns@adobe.com"> <!-- 2014-03-04 -->
|
||||
<link rel="help" href="http://www.w3.org/TR/css-shapes-1/#funcdef-inset">
|
||||
<link rel="help" href="http://www.w3.org/TR/css-shapes-1/#shape-outside-property">
|
||||
<meta name="assert" content="An inset has 1 to 4 insets as percentages or length in any unit">
|
||||
<meta name="flags" content="ahem dom">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1">
|
||||
<script src="../../../../resources/testharness.js"></script>
|
||||
<script src="../../../../resources/testharnessreport.js"></script>
|
||||
<script src="support/parsing-utils.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script type="text/javascript">
|
||||
generate_tests( ParsingUtils.testInlineStyle,
|
||||
ParsingUtils.buildInsetTests(ParsingUtils.validUnits, "%", "inline") );
|
||||
generate_tests( ParsingUtils.testComputedStyle,
|
||||
ParsingUtils.buildInsetTests(ParsingUtils.validUnits, "%", "computed") );
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,32 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Shape Outside Inset Valid Rounds</title>
|
||||
<link rel="author" title="Adobe" href="http://html.adobe.com/">
|
||||
<link rel="author" title="Bear Travis" href="mailto:betravis@adobe.com">
|
||||
<link rel="reviewer" title="Alan Stearns" href="mailto:stearns@adobe.com"> <!-- 2014-03-04 -->
|
||||
<link rel="help" href="http://www.w3.org/TR/css-shapes-1/#funcdef-inset">
|
||||
<link rel="help" href="http://www.w3.org/TR/css-shapes-1/#shape-outside-property">
|
||||
<meta name="assert" content="An inset's radial component has 1 to 4 length/percentages, optionally followed by a '/'
|
||||
and an additional 1 to 4 length/percentages and lengths can be in any unit.">
|
||||
<meta name="flags" content="ahem dom">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1">
|
||||
<script src="../../../../resources/testharness.js"></script>
|
||||
<script src="../../../../resources/testharnessreport.js"></script>
|
||||
<script src="support/parsing-utils.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script type="text/javascript">
|
||||
generate_tests( ParsingUtils.testInlineStyle,
|
||||
ParsingUtils.generateInsetRoundCases('px', 'inline'));
|
||||
generate_tests( ParsingUtils.testInlineStyle,
|
||||
ParsingUtils.generateInsetRoundCases('%', 'inline'));
|
||||
generate_tests( ParsingUtils.testComputedStyle,
|
||||
ParsingUtils.generateInsetRoundCases('px', 'computed'));
|
||||
generate_tests( ParsingUtils.testComputedStyle,
|
||||
ParsingUtils.generateInsetRoundCases('%', 'computed'));
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,36 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Shape Outside Inset Valid Round Length Units</title>
|
||||
<link rel="author" title="Adobe" href="http://html.adobe.com/">
|
||||
<link rel="author" title="Rebecca Hauck" href="mailto:rhauck@adobe.com">
|
||||
<link rel="reviewer" title="Alan Stearns" href="mailto:stearns@adobe.com"> <!-- 2014-03-04 -->
|
||||
<link rel="help" href="http://www.w3.org/TR/css-shapes-1/#funcdef-inset">
|
||||
<link rel="help" href="http://www.w3.org/TR/css-shapes-1/#shape-outside-property">
|
||||
<link rel="help" href="http://www.w3.org/TR/css3-values/#lengths">
|
||||
<meta name="assert" content="An inset's radial component's values can be in any length unit">
|
||||
<meta name="flags" content="ahem dom">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1">
|
||||
<script src="../../../../resources/testharness.js"></script>
|
||||
<script src="../../../../resources/testharnessreport.js"></script>
|
||||
<script src="support/parsing-utils.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="../../../../fonts/ahem.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script type="text/javascript">
|
||||
setup({explicit_done: true});
|
||||
ParsingUtils.validUnits.forEach(function(unit) {
|
||||
generate_tests(ParsingUtils.testInlineStyle, ParsingUtils.generateInsetRoundCases(unit, 'inline'));
|
||||
});
|
||||
ParsingUtils.setupFonts();
|
||||
document.fonts.load("10px Ahem").then(()=> {
|
||||
ParsingUtils.validUnits.forEach(function(unit) {
|
||||
generate_tests(ParsingUtils.testComputedStyle, ParsingUtils.generateInsetRoundCases(unit, 'computed'));
|
||||
});
|
||||
ParsingUtils.restoreFonts();
|
||||
done();
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,59 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Shape Outside Inset - positive/negative, decimal/non-decimal args</title>
|
||||
<link rel="author" title="Adobe" href="http://html.adobe.com/">
|
||||
<link rel="author" title="Rebecca Hauck" href="mailto:rhauck@adobe.com">
|
||||
<link rel="reviewer" title="Alan Stearns" href="mailto:stearns@adobe.com"> <!-- 2014-03-04 -->
|
||||
<link rel="help" href="http://www.w3.org/TR/css-shapes-1/#funcdef-inset">
|
||||
<link rel="help" href="http://www.w3.org/TR/css-shapes-1/#shape-outside-property">
|
||||
<meta name="assert" content="These tests verify that shape-outside inset() arguments can be numbers that are signed in
|
||||
positive and negative and/or decimal/non-decimal form.">
|
||||
<meta name="flags" content="ahem dom">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1">
|
||||
<script src="../../../../resources/testharness.js"></script>
|
||||
<script src="../../../../resources/testharnessreport.js"></script>
|
||||
<script src="support/parsing-utils.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script type="text/javascript">
|
||||
var valid_inset_args_tests = [
|
||||
{
|
||||
"actual": "inset(+10px -20px +30px -40px)",
|
||||
"expected_inline": "inset(10px -20px 30px -40px)",
|
||||
"expected_computed": "inset(10px -20px 30px -40px)"
|
||||
},
|
||||
{
|
||||
"actual": "inset(-10px +20px -30px +40px)",
|
||||
"expected_inline": "inset(-10px 20px -30px 40px)",
|
||||
"expected_computed": "inset(-10px 20px -30px 40px)"
|
||||
},
|
||||
{
|
||||
"actual": "inset(10.1200px 20.34px 30.56px 40.780px)",
|
||||
"expected_inline": "inset(10.12px 20.34px 30.56px 40.78px)",
|
||||
"expected_computed": "inset(10.12px 20.34px 30.56px 40.78px)"
|
||||
},
|
||||
{
|
||||
"actual": "inset(10.123px 20.00px 30.10px 40.5678px)",
|
||||
"expected_inline": "inset(10.123px 20px 30.1px 40.5678px)",
|
||||
"expected_computed": "inset(10.123px 20px 30.1px 40.5678px)"
|
||||
},
|
||||
{
|
||||
"actual": "inset(+10.1200px -20.340px +30.56px -40.780px)",
|
||||
"expected_inline": "inset(10.12px -20.34px 30.56px -40.78px)",
|
||||
"expected_computed": "inset(10.12px -20.34px 30.56px -40.78px)"
|
||||
},
|
||||
{
|
||||
"actual": "inset(-10.123px +20.00px -30.10px +40.5678px)",
|
||||
"expected_inline": "inset(-10.123px 20px -30.1px 40.5678px)",
|
||||
"expected_computed": "inset(-10.123px 20px -30.1px 40.5678px)"
|
||||
}
|
||||
];
|
||||
generate_tests( ParsingUtils.testInlineStyle,
|
||||
ParsingUtils.buildTestCases(valid_inset_args_tests, "inline") );
|
||||
generate_tests( ParsingUtils.testComputedStyle,
|
||||
ParsingUtils.buildTestCases(valid_inset_args_tests, "computed") );
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,42 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Shape Outside Inset - Invalid args</title>
|
||||
<link rel="author" title="Adobe" href="http://html.adobe.com/">
|
||||
<link rel="author" title="Rebecca Hauck" href="mailto:rhauck@adobe.com">
|
||||
<link rel="reviewer" title="Alan Stearns" href="mailto:stearns@adobe.com"> <!-- 2014-03-04 -->
|
||||
<link rel="help" href="http://www.w3.org/TR/css-shapes-1/#funcdef-inset">
|
||||
<link rel="help" href="http://www.w3.org/TR/css-shapes-1/#shape-outside-property">
|
||||
<meta name="assert" content="These tests verifies that invalid inset() arguments don't parse.">
|
||||
<meta name="flags" content="ahem dom">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1">
|
||||
<script src="../../../../resources/testharness.js"></script>
|
||||
<script src="../../../../resources/testharnessreport.js"></script>
|
||||
<script src="support/parsing-utils.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script type="text/javascript">
|
||||
var invalid_inset_args_tests = [
|
||||
// no units
|
||||
{"name": "inset(10 20px 30px 40px)"},
|
||||
{"name": "inset(10px 20 30px 40px)"},
|
||||
{"name": "inset(10px, 20px 30 40px)"},
|
||||
{"name": "inset(10px 20px 30px 40)"},
|
||||
{"name": "inset(10 20 30 40)"},
|
||||
// comma delimited args
|
||||
{"name": "inset(10px, 20px, 30px, 40px)"},
|
||||
{"name": "inset(10px, 20px, 30px 40px)"},
|
||||
{"name": "inset(10px, 20px 30px 40px)"},
|
||||
{"name": "inset(10px 20px, 30px, 40px)"},
|
||||
{"name": "inset(10px 20px 30px, 40px)"},
|
||||
// bogus args
|
||||
{"name": "inset(foo bar blah woo)"},
|
||||
{"name": "inset(10px roo 30px coo)"},
|
||||
{"name": "inset(may 20px blah 40px)"}
|
||||
];
|
||||
generate_tests(ParsingUtils.testInlineStyle,
|
||||
ParsingUtils.buildTestCases(invalid_inset_args_tests) );
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,82 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Shape Outside Inset Radial Args - positive/negative, decimal/non-decimal</title>
|
||||
<link rel="author" title="Adobe" href="http://html.adobe.com/">
|
||||
<link rel="author" title="Rebecca Hauck" href="mailto:rhauck@adobe.com">
|
||||
<link rel="reviewer" title="Alan Stearns" href="mailto:stearns@adobe.com"> <!-- 2014-03-04 -->
|
||||
<link rel="help" href="http://www.w3.org/TR/css-shapes-1/#funcdef-inset">
|
||||
<link rel="help" href="http://www.w3.org/TR/css-shapes-1/#shape-outside-property">
|
||||
<meta name="assert" content="These tests verify that shape-outside inset() radial component can be numbers that are in
|
||||
signed positive and/or decimal/non-decimal form. Negative values are not allowed">
|
||||
<meta name="flags" content="ahem dom">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1">
|
||||
<script src="../../../../resources/testharness.js"></script>
|
||||
<script src="../../../../resources/testharnessreport.js"></script>
|
||||
<script src="support/parsing-utils.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script type="text/javascript">
|
||||
var valid_inset_radial_args_tests = [
|
||||
{
|
||||
"actual": "inset(10px round +10px +20px +30px +40px)",
|
||||
"expected_inline": "inset(10px round 10px 20px 30px 40px)",
|
||||
"expected_computed": "inset(10px round 10px 20px 30px 40px)"
|
||||
},
|
||||
{
|
||||
"actual": "inset(10px round 10.1200px 20.34px 30.56px 40.780px)",
|
||||
"expected_inline": "inset(10px round 10.12px 20.34px 30.56px 40.78px)",
|
||||
"expected_computed": "inset(10px round 10.12px 20.34px 30.56px 40.78px)"
|
||||
},
|
||||
{
|
||||
"actual": "inset(10px round 10.123px 20.00px 30.10px 40.5678px)",
|
||||
"expected_inline": "inset(10px round 10.123px 20px 30.1px 40.5678px)",
|
||||
"expected_computed": "inset(10px round 10.123px 20px 30.1px 40.5678px)"
|
||||
},
|
||||
{
|
||||
"actual": "inset(10px round +10.1200px +20.340px +30.56px +40.780px)",
|
||||
"expected_inline": "inset(10px round 10.12px 20.34px 30.56px 40.78px)",
|
||||
"expected_computed": "inset(10px round 10.12px 20.34px 30.56px 40.78px)"
|
||||
},
|
||||
{
|
||||
"actual": "inset(10px round +10px +20px +30px +40px / +10px +20px +30px +40px )",
|
||||
"expected_inline": "inset(10px round 10px 20px 30px 40px)",
|
||||
"expected_computed": "inset(10px round 10px 20px 30px 40px)"
|
||||
},
|
||||
{
|
||||
"actual": "inset(10px round 10.1200px 20.34px 30.56px 40.780px / 10.1200px 20.34px 30.56px 40.780px)",
|
||||
"expected_inline": "inset(10px round 10.12px 20.34px 30.56px 40.78px)",
|
||||
"expected_computed": "inset(10px round 10.12px 20.34px 30.56px 40.78px)"
|
||||
},
|
||||
{
|
||||
"actual": "inset(10px round 10.123px 20.00px 30.10px 40.5678px / 10.123px 20.00px 30.10px 40.5678px)",
|
||||
"expected_inline": "inset(10px round 10.123px 20px 30.1px 40.5678px)",
|
||||
"expected_computed": "inset(10px round 10.123px 20px 30.1px 40.5678px)"
|
||||
},
|
||||
{
|
||||
"actual": "inset(10px round +10.1200px +20.340px +30.56px +40.780px / +10.1200px +20.340px +30.56px +40.780px)",
|
||||
"expected_inline": "inset(10px round 10.12px 20.34px 30.56px 40.78px)",
|
||||
"expected_computed": "inset(10px round 10.12px 20.34px 30.56px 40.78px)"
|
||||
},
|
||||
{
|
||||
"actual": "inset(10px round +10.123px +20.00px +30.10px +40.5678px / 10.123px +20.00px +30.10px +40.5678px)",
|
||||
"expected_inline": "inset(10px round 10.123px 20px 30.1px 40.5678px)",
|
||||
"expected_computed": "inset(10px round 10.123px 20px 30.1px 40.5678px)"
|
||||
}
|
||||
];
|
||||
invalid_radial_args_tests = [
|
||||
{"name": "inset(10px round -10px -20px -30px -40px)"},
|
||||
{"name": "inset(10px round -10.1200px -20.340px -30.56px -40.780px)"},
|
||||
{"name": "inset(10px round -10px -20px -30px -40px / -10px -20px -30px -40px)"},
|
||||
{"name": "inset(10px round -10.123px -20.00px -30.10px -40.5678px / 10.123px -20.00px -30.10px -40.5678px)"}
|
||||
];
|
||||
generate_tests( ParsingUtils.testInlineStyle,
|
||||
ParsingUtils.buildTestCases(valid_inset_radial_args_tests, 'inline') );
|
||||
generate_tests( ParsingUtils.testComputedStyle,
|
||||
ParsingUtils.buildTestCases(valid_inset_radial_args_tests, 'computed') );
|
||||
generate_tests( ParsingUtils.testInlineStyle,
|
||||
ParsingUtils.buildTestCases(invalid_radial_args_tests) );
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,48 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Shape Outside Inset Radial Args - Invalid</title>
|
||||
<link rel="author" title="Adobe" href="http://html.adobe.com/">
|
||||
<link rel="author" title="Rebecca Hauck" href="mailto:rhauck@adobe.com">
|
||||
<link rel="reviewer" title="Alan Stearns" href="mailto:stearns@adobe.com"> <!-- 2014-03-04 -->
|
||||
<link rel="help" href="http://www.w3.org/TR/css-shapes-1/#funcdef-inset">
|
||||
<link rel="help" href="http://www.w3.org/TR/css-shapes-1/#shape-outside-property">
|
||||
<meta name="assert" content="These tests verify invalid radial component arguments don't parse.">
|
||||
<meta name="flags" content="ahem dom">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1">
|
||||
<script src="../../../../resources/testharness.js"></script>
|
||||
<script src="../../../../resources/testharnessreport.js"></script>
|
||||
<script src="support/parsing-utils.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script type="text/javascript">
|
||||
var invalid_radial_args_tests = [
|
||||
// no units
|
||||
{"name": "inset(10px round 10 20 30 40)"},
|
||||
{"name": "inset(10px round 10px 20 30 40)"},
|
||||
{"name": "inset(10px round 10px 20px 30 40)"},
|
||||
{"name": "inset(10px round 10px 20px 30px 40)"},
|
||||
{"name": "inset(10px round 10px 20px 30px 40px / 10 20 30 40)"},
|
||||
{"name": "inset(10px round 10px 20px 30px 40px / 10px 20 30 40)"},
|
||||
{"name": "inset(10px round 10px 20px 30px 40px / 10px 20px 30 40)"},
|
||||
{"name": "inset(10px round 10px 20px 30px 40px / 10px 20px 30px 40)"},
|
||||
// commas
|
||||
{"name": "inset(10px round 10px, 20px, 30px, 40px)"},
|
||||
{"name": "inset(10px round 10px, 20px, 30px 40px)"},
|
||||
{"name": "inset(10px round 10px, 20px 30px 40px)"},
|
||||
{"name": "inset(10px round 10px 20px, 30px, 40px)"},
|
||||
{"name": "inset(10px round 10px 20px 30px, 40px)"},
|
||||
{"name": "inset(10px round 10px, 20px, 30px, 40px / 10px, 20px, 30px, 40px)"},
|
||||
{"name": "inset(10px round 10px 20px, 30px, 40px / 10px 20px, 30px, 40)"},
|
||||
{"name": "inset(10px round 10px 20px 30px, 40px / 10px 20px 30px, 40)"},
|
||||
// bogus args
|
||||
{"name": "inset(10px round foo, bar, boo, $$)"},
|
||||
{"name": "inset(10px round 10px, xx, px pt)"},
|
||||
{"name": "inset(10px round word)"}
|
||||
];
|
||||
generate_tests( ParsingUtils.testInlineStyle,
|
||||
ParsingUtils.buildTestCases(invalid_radial_args_tests) );
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,46 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Shape Outside Inset Args - calc() values</title>
|
||||
<link rel="author" title="Adobe" href="http://html.adobe.com/">
|
||||
<link rel="author" title="Rebecca Hauck" href="mailto:rhauck@adobe.com">
|
||||
<link rel="reviewer" title="Alan Stearns" href="mailto:stearns@adobe.com"> <!-- 2014-03-04 -->
|
||||
<link rel="help" href="http://www.w3.org/TR/css-shapes-1/#funcdef-inset">
|
||||
<link rel="help" href="http://www.w3.org/TR/css-shapes-1/#shape-outside-property">
|
||||
<link rel="help" href="http://www.w3.org/TR/css3-values/#calc-notation">
|
||||
<meta name="assert" content="An inset's arguments may be in calc() values.">
|
||||
<meta name="flags" content="ahem dom">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1">
|
||||
<script src="../../../../resources/testharness.js"></script>
|
||||
<script src="../../../../resources/testharnessreport.js"></script>
|
||||
<script src="support/parsing-utils.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script type="text/javascript">
|
||||
var inset_calc_tests = [];
|
||||
ParsingUtils.calcTestValues.forEach(function(value) {
|
||||
testCase = ['inset('+ value[0] +')',
|
||||
'inset('+ value[1] +')'];
|
||||
if(Object.prototype.toString.call( value[2] ) === '[object Array]' && value[2].length == 2) {
|
||||
testCase.push([ 'inset('+ value[2][0] +')', 'inset('+ value[2][1] +')' ]);
|
||||
} else {
|
||||
testCase.push('inset('+ value[2] +')');
|
||||
}
|
||||
inset_calc_tests.push(testCase);
|
||||
});
|
||||
ParsingUtils.calcTestValues.forEach(function(value) {
|
||||
testCase = ['inset('+ value[0] +' '+ value[0] +')',
|
||||
'inset('+ value[1] +')'];
|
||||
if(Object.prototype.toString.call( value[2] ) === '[object Array]' && value[2].length == 2) {
|
||||
testCase.push([ 'inset('+ value[2][0] +')', 'inset('+ value[2][1] +')' ]);
|
||||
} else {
|
||||
testCase.push('inset('+ value[2] +')');
|
||||
}
|
||||
inset_calc_tests.push(testCase);
|
||||
});
|
||||
generate_tests(ParsingUtils.testInlineStyle, ParsingUtils.buildCalcTests(inset_calc_tests, 'value'));
|
||||
generate_tests(ParsingUtils.testComputedStyle, ParsingUtils.buildCalcTests(inset_calc_tests, 'computed'));
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,56 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Shape Outside Inset round args - calc() values</title>
|
||||
<link rel="author" title="Adobe" href="http://html.adobe.com/">
|
||||
<link rel="author" title="Rebecca Hauck" href="mailto:rhauck@adobe.com">
|
||||
<link rel="reviewer" title="Alan Stearns" href="mailto:stearns@adobe.com"> <!-- 2014-03-04 -->
|
||||
<link rel="help" href="http://www.w3.org/TR/css-shapes-1/#funcdef-inset">
|
||||
<link rel="help" href="http://www.w3.org/TR/css-shapes-1/#shape-outside-property">
|
||||
<link rel="help" href="http://www.w3.org/TR/css3-values/#calc-notation">
|
||||
<meta name="assert" content="An inset's radial component arguments may be in calc() values.">
|
||||
<meta name="flags" content="ahem dom">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1">
|
||||
<script src="../../../../resources/testharness.js"></script>
|
||||
<script src="../../../../resources/testharnessreport.js"></script>
|
||||
<script src="support/parsing-utils.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script type="text/javascript">
|
||||
var fullInset = '10px 10px 10px 10px';
|
||||
var serializedInset = "10px";
|
||||
|
||||
var inset_round_calc_tests = [];
|
||||
ParsingUtils.calcTestValues.forEach(function(value) {
|
||||
testCase = ['inset('+ fullInset +' round '+ value[0] +')',
|
||||
'inset('+ serializedInset +' round '+ value[1] +')'];
|
||||
// array check
|
||||
if(Object.prototype.toString.call( value[2] ) === '[object Array]' && value[2].length == 2) {
|
||||
testCase.push([
|
||||
'inset('+ serializedInset +' round '+ value[2][0] +')',
|
||||
'inset('+ serializedInset +' round '+ value[2][1] +')'
|
||||
]);
|
||||
} else {
|
||||
testCase.push('inset('+ serializedInset +' round '+ value[2] +')');
|
||||
}
|
||||
inset_round_calc_tests.push(testCase);
|
||||
});
|
||||
ParsingUtils.calcTestValues.forEach(function(value) {
|
||||
testCase = ['inset('+ fullInset +' round '+ value[0] +' '+ value[0] +')',
|
||||
'inset('+ serializedInset +' round '+ value[1] +')'];
|
||||
if(Object.prototype.toString.call( value[2] ) === '[object Array]' && value[2].length == 2) {
|
||||
testCase.push([
|
||||
'inset('+ serializedInset +' round '+ value[2][0] +')',
|
||||
'inset('+ serializedInset +' round '+ value[2][1] +')'
|
||||
]);
|
||||
} else {
|
||||
testCase.push('inset('+ serializedInset +' round '+ value[2] +')');
|
||||
}
|
||||
inset_round_calc_tests.push(testCase);
|
||||
});
|
||||
generate_tests(ParsingUtils.testInlineStyle, ParsingUtils.buildCalcTests(inset_round_calc_tests, 'inline'));
|
||||
generate_tests(ParsingUtils.testComputedStyle, ParsingUtils.buildCalcTests(inset_round_calc_tests, 'computed'));
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user