mirror of
https://github.com/servo/servo.git
synced 2025-06-24 17:14:33 +01:00
Add support for -moz-top-layer
This commit is contained in:
parent
143dfc879e
commit
aa33dfff05
1 changed files with 47 additions and 7 deletions
|
@ -94,9 +94,52 @@
|
||||||
|
|
||||||
</%helpers:longhand>
|
</%helpers:longhand>
|
||||||
|
|
||||||
${helpers.single_keyword("position", "static absolute relative fixed",
|
${helpers.single_keyword("-moz-top-layer", "none top",
|
||||||
need_clone=True, extra_gecko_values="sticky", animatable=False,
|
gecko_constant_prefix="NS_STYLE_TOP_LAYER",
|
||||||
spec="https://drafts.csswg.org/css-position/#position-property")}
|
gecko_ffi_name="mTopLayer", need_clone=True,
|
||||||
|
products="gecko", animatable=False, internal=True,
|
||||||
|
spec="Internal (not web-exposed)")}
|
||||||
|
|
||||||
|
<%helpers:single_keyword_computed name="position"
|
||||||
|
values="static absolute relative fixed"
|
||||||
|
need_clone="True"
|
||||||
|
extra_gecko_values="sticky"
|
||||||
|
animatable="False"
|
||||||
|
spec="https://drafts.csswg.org/css-position/#position-property">
|
||||||
|
impl SpecifiedValue {
|
||||||
|
pub fn is_absolutely_positioned_style(&self) -> bool {
|
||||||
|
matches!(*self, SpecifiedValue::absolute | SpecifiedValue::fixed)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
use values::NoViewportPercentage;
|
||||||
|
impl NoViewportPercentage for SpecifiedValue {}
|
||||||
|
impl ToComputedValue for SpecifiedValue {
|
||||||
|
type ComputedValue = computed_value::T;
|
||||||
|
|
||||||
|
#[inline]
|
||||||
|
fn to_computed_value(&self, _context: &Context) -> computed_value::T {
|
||||||
|
% if product == "gecko":
|
||||||
|
// https://fullscreen.spec.whatwg.org/#new-stacking-layer
|
||||||
|
// Any position value other than 'absolute' and 'fixed' are
|
||||||
|
// computed to 'absolute' if the element is in a top layer.
|
||||||
|
if !self.is_absolutely_positioned_style() &&
|
||||||
|
matches!(_context.style().get_box().clone__moz_top_layer(),
|
||||||
|
longhands::_moz_top_layer::SpecifiedValue::top) {
|
||||||
|
SpecifiedValue::absolute
|
||||||
|
} else {
|
||||||
|
*self
|
||||||
|
}
|
||||||
|
% else:
|
||||||
|
*self
|
||||||
|
% endif
|
||||||
|
}
|
||||||
|
#[inline]
|
||||||
|
fn from_computed_value(computed: &computed_value::T) -> SpecifiedValue {
|
||||||
|
*computed
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</%helpers:single_keyword_computed>
|
||||||
|
|
||||||
<%helpers:single_keyword_computed name="float"
|
<%helpers:single_keyword_computed name="float"
|
||||||
values="none left right"
|
values="none left right"
|
||||||
|
@ -115,10 +158,7 @@ ${helpers.single_keyword("position", "static absolute relative fixed",
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn to_computed_value(&self, context: &Context) -> computed_value::T {
|
fn to_computed_value(&self, context: &Context) -> computed_value::T {
|
||||||
let positioned = matches!(context.style().get_box().clone_position(),
|
if context.style().get_box().clone_position().is_absolutely_positioned_style() {
|
||||||
longhands::position::SpecifiedValue::absolute |
|
|
||||||
longhands::position::SpecifiedValue::fixed);
|
|
||||||
if positioned {
|
|
||||||
computed_value::T::none
|
computed_value::T::none
|
||||||
} else {
|
} else {
|
||||||
let ltr = context.style().writing_mode.is_bidi_ltr();
|
let ltr = context.style().writing_mode.is_bidi_ltr();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue