mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Add a runtime-wide initialization hook for Geckolib.
This commit is contained in:
parent
9fdb791e93
commit
aa0e3e25e2
2 changed files with 11 additions and 2 deletions
|
@ -104,6 +104,7 @@ extern "C" {
|
||||||
-> *const u16;
|
-> *const u16;
|
||||||
pub fn Gecko_Namespace(element: *mut RawGeckoElement, length: *mut u32)
|
pub fn Gecko_Namespace(element: *mut RawGeckoElement, length: *mut u32)
|
||||||
-> *const u16;
|
-> *const u16;
|
||||||
|
pub fn Servo_Initialize();
|
||||||
pub fn Servo_RestyleDocument(doc: *mut RawGeckoDocument,
|
pub fn Servo_RestyleDocument(doc: *mut RawGeckoDocument,
|
||||||
set: *mut RawServoStyleSet);
|
set: *mut RawServoStyleSet);
|
||||||
pub fn Gecko_Construct_nsStyleFont(ptr: *mut nsStyleFont);
|
pub fn Gecko_Construct_nsStyleFont(ptr: *mut nsStyleFont);
|
||||||
|
|
|
@ -61,6 +61,10 @@ pub fn pseudo_element_from_atom(pseudo: *mut nsIAtom,
|
||||||
* depend on but good enough for our purposes.
|
* depend on but good enough for our purposes.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#[no_mangle]
|
||||||
|
pub extern "C" fn Servo_Initialize() -> () {
|
||||||
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_RestyleDocument(doc: *mut RawGeckoDocument, raw_data: *mut RawServoStyleSet) -> () {
|
pub extern "C" fn Servo_RestyleDocument(doc: *mut RawGeckoDocument, raw_data: *mut RawServoStyleSet) -> () {
|
||||||
let document = unsafe { GeckoDocument::from_raw(doc) };
|
let document = unsafe { GeckoDocument::from_raw(doc) };
|
||||||
|
@ -71,8 +75,12 @@ pub extern "C" fn Servo_RestyleDocument(doc: *mut RawGeckoDocument, raw_data: *m
|
||||||
let data = unsafe { &mut *(raw_data as *mut PerDocumentStyleData) };
|
let data = unsafe { &mut *(raw_data as *mut PerDocumentStyleData) };
|
||||||
|
|
||||||
// Force the creation of our lazily-constructed initial computed values on
|
// Force the creation of our lazily-constructed initial computed values on
|
||||||
// the main thread, since it's not safe to call elsewhere. This should move
|
// the main thread, since it's not safe to call elsewhere.
|
||||||
// into a runtime-wide init hook at some point.
|
//
|
||||||
|
// FIXME(bholley): this should move into Servo_Initialize as soon as we get
|
||||||
|
// rid of the HackilyFindSomeDeviceContext stuff that happens during
|
||||||
|
// initial_values computation, since that stuff needs to be called further
|
||||||
|
// along in startup than the sensible place to call Servo_Initialize.
|
||||||
GeckoComputedValues::initial_values();
|
GeckoComputedValues::initial_values();
|
||||||
|
|
||||||
let _needs_dirtying = Arc::get_mut(&mut data.stylist).unwrap()
|
let _needs_dirtying = Arc::get_mut(&mut data.stylist).unwrap()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue