Skip to content
Snippets Groups Projects
Commit 1a53afba authored by Wei-Cheng Pan's avatar Wei-Cheng Pan
Browse files

servo: Merge #18229 - Add an API to process all invalidations on the main...

servo: Merge #18229 - Add an API to process all invalidations on the main thread (from legnaleurc:bug_1388298); r=emilio

fixes [bug 1388298](https://bugzil.la/1388298)

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 04e60517425c49fa36341cffe4c3b205c2d8ce37

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 09f90f1f95590de4f69b35296e41847c7ad8189b
parent 6fd5b9e1
No related branches found
No related tags found
No related merge requests found
......@@ -3659,3 +3659,31 @@ pub extern "C" fn Servo_GetCustomPropertyNameAt(computed_values: ServoStyleConte
true
}
#[no_mangle]
pub extern "C" fn Servo_ProcessInvalidations(set: RawServoStyleSetBorrowed,
element: RawGeckoElementBorrowed,
snapshots: *const ServoElementSnapshotTable) {
debug_assert!(!snapshots.is_null());
let element = GeckoElement(element);
debug_assert!(element.has_snapshot());
debug_assert!(!element.handled_snapshot());
let mut data = element.mutate_data();
debug_assert!(data.is_some());
let global_style_data = &*GLOBAL_STYLE_DATA;
let guard = global_style_data.shared_lock.read();
let per_doc_data = PerDocumentStyleData::from_ffi(set).borrow();
let shared_style_context = create_shared_context(&global_style_data,
&guard,
&per_doc_data,
TraversalFlags::empty(),
unsafe { &*snapshots });
let mut data = data.as_mut().map(|d| &mut **d);
if let Some(ref mut data) = data {
data.invalidate_style_if_needed(element, &shared_style_context);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment