mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
style: Make Gecko's media query evaluation work with a document, not a pres context.
Returning a zero-sized viewport in the case there's no shell / pres context. For now, no other change yet. After this we can start tweaking the ShadowRoot Stylist setup, and even try to return computed styles without a document \o/. Bug: 1430608 MozReview-Commit-ID: 3cT2PKQISri
This commit is contained in:
parent
e858dc060e
commit
75af7c0b41
1 changed files with 5 additions and 3 deletions
|
@ -684,9 +684,11 @@ impl Expression {
|
|||
pub fn matches(&self, device: &Device, quirks_mode: QuirksMode) -> bool {
|
||||
let mut css_value = nsCSSValue::null();
|
||||
unsafe {
|
||||
(self.feature.mGetter.unwrap())(device.pres_context,
|
||||
self.feature,
|
||||
&mut css_value)
|
||||
(self.feature.mGetter.unwrap())(
|
||||
device.pres_context().mDocument.raw::<structs::nsIDocument>(),
|
||||
self.feature,
|
||||
&mut css_value,
|
||||
)
|
||||
};
|
||||
|
||||
let value = match MediaExpressionValue::from_css_value(self, &css_value) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue