gecko-dev/testing/web-platform/tests/css/css-scroll-snap/parsing/scroll-margin-valid.html
Hiroyuki Ikezoe 842f78da12 Bug 1528639 - Implement scroll-margin parser and serializer. r=emilio
The reason why we use  RelaxedAtomBoolis that
ScrollSnapUtils::GetSnapPointForDestination() is called both from the main and
the compositor threads, and the function will have a branch depending on the
pref value.

Differential Revision: https://phabricator.services.mozilla.com/D20101

--HG--
extra : moz-landing-system : lando
2019-02-18 02:25:54 +00:00

44 lines
1.5 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Scroll Snap Test: scroll-margin with valid values</title>
<link rel="help" href="https://drafts.csswg.org/css-scroll-snap-1/#propdef-scroll-margin">
<meta name="assert" content="scroll-margin supports the full grammar '<length>{1,4}'.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
</head>
<body>
<script>
test_valid_value("scroll-margin-top", "0", "0px");
test_valid_value("scroll-margin-top", "-10px");
test_valid_value("scroll-margin-top", "calc(2em + 3ex)");
test_valid_value("scroll-margin-right", "0", "0px");
test_valid_value("scroll-margin-right", "-10px");
test_valid_value("scroll-margin-right", "calc(2em + 3ex)");
test_valid_value("scroll-margin-bottom", "0", "0px");
test_valid_value("scroll-margin-bottom", "-10px");
test_valid_value("scroll-margin-bottom", "calc(2em + 3ex)");
test_valid_value("scroll-margin-left", "0", "0px");
test_valid_value("scroll-margin-left", "-10px");
test_valid_value("scroll-margin-left", "calc(2em + 3ex)");
test_valid_value("scroll-margin", "0", "0px");
test_valid_value("scroll-margin", "-10px");
test_valid_value("scroll-margin", "calc(2em + 3ex)");
test_valid_value("scroll-margin", "1px 2px");
test_valid_value("scroll-margin", "1px 2px 3px");
test_valid_value("scroll-margin", "1px 2px 3px 4px");
test_valid_value("scroll-margin", "0 0 0 0", "0px");
</script>
</body>
</html>