style: Implement scroll-margin parser and serializer.

The reason why we use  RelaxedAtomBool is 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
This commit is contained in:
Hiroyuki Ikezoe 2019-02-18 02:25:54 +00:00 committed by Emilio Cobos Álvarez
parent d6750de0c3
commit 79a5e97c13
3 changed files with 50 additions and 1 deletions

View file

@ -27,3 +27,18 @@
servo_restyle_damage="reflow"
)}
% endfor
% for side in ALL_SIDES:
${helpers.predefined_type(
"scroll-margin-%s" % side[0],
"Length",
"computed::Length::zero()",
products="gecko",
gecko_pref="layout.css.scroll-snap-v1.enabled",
logical=side[1],
logical_group="scroll-margin",
spec="https://drafts.csswg.org/css-scroll-snap-1/#propdef-scroll-margin-%s" % side[0],
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE",
animation_value_type="ComputedValue",
)}
% endfor