Bug 1345695 - stylo: Assert that we have computed style in Servo_ResolveStyle when lazy computation is forbidden. r=bholley

MozReview-Commit-ID: Bul00XOpfxA

--HG--
extra : rebase_source : 485668d0a92c9407c9dfeb5cd569aa1b07569a14
This commit is contained in:
Cameron McCormack 2017-03-30 12:54:25 +08:00
parent 67201815a8
commit 43e68fc196
2 changed files with 3 additions and 2 deletions

View File

@ -171,9 +171,9 @@ ServoStyleSet::GetContext(nsIContent* aContent,
Element* element = aContent->AsElement();
PreTraverseSync();
RefPtr<ServoComputedValues> computedValues;
if (aMayCompute == LazyComputeBehavior::Allow) {
PreTraverseSync();
computedValues = ResolveStyleLazily(element, nullptr);
} else {
computedValues = ResolveServoStyle(element);

View File

@ -1654,7 +1654,8 @@ pub extern "C" fn Servo_ResolveStyle(element: RawGeckoElementBorrowed,
};
if !valid_styles {
warn!("Resolving style on element without current styles with lazy computation forbidden.");
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();
}