aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2017-07-13 22:03:53 +0200
committerEmilio Cobos Álvarez <emilio@crisal.io>2017-07-15 14:48:59 +0200
commit3000326885145aae70655be1c2043b26bc12b2b8 (patch)
treeb6be21f60f581f21589596080b3d2bdaadd41041
parentf9642b36bda3beb01dfedbc33e3586e5f7df473a (diff)
downloadservo-3000326885145aae70655be1c2043b26bc12b2b8.tar.gz
servo-3000326885145aae70655be1c2043b26bc12b2b8.zip
stylo: Assert our stuff properly.
MozReview-Commit-ID: KBrJtWcoKp8
-rw-r--r--ports/geckolib/glue.rs16
1 files changed, 7 insertions, 9 deletions
diff --git a/ports/geckolib/glue.rs b/ports/geckolib/glue.rs
index 0ae6264e12f..ed698531c07 100644
--- a/ports/geckolib/glue.rs
+++ b/ports/geckolib/glue.rs
@@ -2770,20 +2770,18 @@ pub extern "C" fn Servo_TakeChangeHint(element: RawGeckoElementBorrowed,
#[no_mangle]
pub extern "C" fn Servo_ResolveStyle(element: RawGeckoElementBorrowed,
- raw_data: RawServoStyleSetBorrowed)
+ _raw_data: RawServoStyleSetBorrowed)
-> ServoComputedValuesStrong
{
let element = GeckoElement(element);
debug!("Servo_ResolveStyle: {:?}", element);
- let data = unsafe { element.ensure_data() }.borrow();
-
- if !element.has_current_styles(&*data) {
- debug_assert!(false, "Resolving style on element without current styles with lazy \
- computation forbidden.");
- let per_doc_data = PerDocumentStyleData::from_ffi(raw_data).borrow();
- return per_doc_data.default_computed_values().clone().into_strong();
- }
+ let data =
+ element.borrow_data().expect("Resolving style on unstyled element");
+ // TODO(emilio): Downgrade to debug assertions when close to release.
+ assert!(data.has_styles(), "Resolving style on unstyled element");
+ assert!(element.has_current_styles(&*data),
+ "Resolving style on element without current styles");
data.styles.primary().clone().into_strong()
}