Auto merge of #17920 - heycam:hasr-assertion, r=emilio

geckolib: Add friendly panic message to Servo_HasAuthorSpecifiedRules.

This just adds a friendlier panic message when `Servo_HasAuthorSpecifiedRules` is called with an unstyled element.

<!-- 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/17920)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-07-30 06:53:19 -05:00 committed by GitHub
commit 0c9abac373

View file

@ -1610,7 +1610,10 @@ pub extern "C" fn Servo_HasAuthorSpecifiedRules(element: RawGeckoElementBorrowed
{
let element = GeckoElement(element);
let data = element.borrow_data().unwrap();
let data =
element.borrow_data()
.expect("calling Servo_HasAuthorSpecifiedRules on an unstyled element");
let primary_style = data.styles.primary();
let guard = (*GLOBAL_STYLE_DATA).shared_lock.read();