Auto merge of #11176 - mbrubeck:stylo-zindex, r=bholley

Support z-index in geckolib

r? @bholley

cc @heycam

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11176)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-05-13 11:54:42 -07:00
commit 21be9e8768

View file

@ -543,13 +543,32 @@ fn static_assert() {
<% skip_position_longhands = " ".join(x.ident for x in SIDES) %>
<%self:impl_trait style_struct_name="Position"
skip_longhands="${skip_position_longhands}">
skip_longhands="${skip_position_longhands} z-index">
% for side in SIDES:
<% impl_split_style_coord("%s" % side.ident,
"mOffset.mUnits[%s]" % side.index,
"mOffset.mValues[%s]" % side.index) %>
% endfor
fn set_z_index(&mut self, v: longhands::z_index::computed_value::T) {
use gecko_bindings::structs::nsStyleUnit;
use style::properties::longhands::z_index::computed_value::T;
match v {
T::Auto => {
self.gecko.mZIndex.mUnit = nsStyleUnit::eStyleUnit_Auto;
unsafe { *self.gecko.mZIndex.mValue.mInt.as_mut() = 0; }
}
T::Number(n) => {
self.gecko.mZIndex.mUnit = nsStyleUnit::eStyleUnit_Integer;
unsafe { *self.gecko.mZIndex.mValue.mInt.as_mut() = n; }
}
}
}
fn copy_z_index_from(&mut self, other: &Self) {
self.gecko.mZIndex.mUnit = other.gecko.mZIndex.mUnit;
self.gecko.mZIndex.mValue = other.gecko.mZIndex.mValue;
}
</%self:impl_trait>
<% skip_outline_longhands = " ".join("outline-color outline-style outline-width".split() +