Auto merge of #12631 - Manishearth:stylo-unsafe-coord, r=bholley

stylo: Use unsafe accessors for coord data

depends on https://bugzilla.mozilla.org/show_bug.cgi?id=1290061

r? @bholley

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12631)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-07-29 03:38:14 -05:00 committed by GitHub
commit 7e39efa2df
4 changed files with 150 additions and 31 deletions

View file

@ -661,9 +661,10 @@ fn static_assert() {
use gecko_bindings::structs::nsStyleUnit;
// z-index is never a calc(). If it were, we'd be leaking here, so
// assert that it isn't.
debug_assert!(self.gecko.mZIndex.mUnit != nsStyleUnit::eStyleUnit_Calc);
self.gecko.mZIndex.mUnit = other.gecko.mZIndex.mUnit;
self.gecko.mZIndex.mValue = other.gecko.mZIndex.mValue;
debug_assert!(self.gecko.mZIndex.unit() != nsStyleUnit::eStyleUnit_Calc);
unsafe {
self.gecko.mZIndex.copy_from_unchecked(&other.gecko.mZIndex);
}
}
pub fn clone_z_index(&self) -> longhands::z_index::computed_value::T {