mirror of
https://github.com/servo/servo.git
synced 2025-08-11 00:15:32 +01:00
Auto merge of #18367 - aethanyc:media-change-xbl-stylset, r=emilio
style: Expose stylist::set_device() for gecko This was reviewed in bug https://bugzilla.mozilla.org/show_bug.cgi?id=1382078 <!-- 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/18367) <!-- Reviewable:end -->
This commit is contained in:
commit
e97f28e2a6
5 changed files with 1097 additions and 591 deletions
|
@ -102,7 +102,7 @@ use style::gecko_bindings::sugar::ownership::{HasSimpleFFI, Strong};
|
|||
use style::gecko_bindings::sugar::refptr::RefPtr;
|
||||
use style::gecko_properties::style_structs;
|
||||
use style::invalidation::element::restyle_hints;
|
||||
use style::media_queries::{MediaList, parse_media_query_list};
|
||||
use style::media_queries::{Device, MediaList, parse_media_query_list};
|
||||
use style::parser::{ParserContext, self};
|
||||
use style::properties::{CascadeFlags, ComputedValues, Importance};
|
||||
use style::properties::{IS_FIELDSET_CONTENT, IS_LINK, IS_VISITED_LINK, LonghandIdSet};
|
||||
|
@ -948,6 +948,25 @@ pub extern "C" fn Servo_StyleSet_MediumFeaturesChanged(
|
|||
OriginFlags::from(origins_in_which_rules_changed).0
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_StyleSet_SetDevice(
|
||||
raw_data: RawServoStyleSetBorrowed,
|
||||
pres_context: RawGeckoPresContextOwned
|
||||
) -> u8 {
|
||||
let global_style_data = &*GLOBAL_STYLE_DATA;
|
||||
let guard = global_style_data.shared_lock.read();
|
||||
|
||||
let mut data = PerDocumentStyleData::from_ffi(raw_data).borrow_mut();
|
||||
let device = Device::new(pres_context);
|
||||
let origins_in_which_rules_changed =
|
||||
data.stylist.set_device(device, &guard);
|
||||
|
||||
// We'd like to return `OriginFlags` here, but bindgen bitfield enums don't
|
||||
// work as return values with the Linux 32-bit ABI at the moment because
|
||||
// they wrap the value in a struct, so for now just unwrap it.
|
||||
OriginFlags::from(origins_in_which_rules_changed).0
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_StyleSet_PrependStyleSheet(
|
||||
raw_data: RawServoStyleSetBorrowed,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue