mirror of
https://github.com/servo/servo.git
synced 2025-08-14 18:05:36 +01:00
Add a Stylo API for reparenting a given style.
Servo side of part 4 of the fix for Gecko bug 1324619. r=emilio
This commit is contained in:
parent
8db39f8fde
commit
7161fff1b8
6 changed files with 189 additions and 36 deletions
|
@ -204,6 +204,15 @@ impl PerDocumentStyleDataImpl {
|
|||
pub fn clear_stylist(&mut self) {
|
||||
self.stylist.clear();
|
||||
}
|
||||
|
||||
/// Returns whether visited links are enabled.
|
||||
fn visited_links_enabled(&self) -> bool {
|
||||
unsafe { bindings::Gecko_AreVisitedLinksEnabled() }
|
||||
}
|
||||
/// Returns whether visited styles are enabled.
|
||||
pub fn visited_styles_enabled(&self) -> bool {
|
||||
self.visited_links_enabled() && !self.is_private_browsing_enabled()
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl HasFFI for PerDocumentStyleData {
|
||||
|
|
|
@ -2820,6 +2820,16 @@ extern "C" {
|
|||
set: RawServoStyleSetBorrowed)
|
||||
-> ServoStyleContextStrong;
|
||||
}
|
||||
extern "C" {
|
||||
pub fn Servo_ReparentStyle(style_to_reparent: ServoStyleContextBorrowed,
|
||||
parent_style: ServoStyleContextBorrowed,
|
||||
parent_style_ignoring_first_line:
|
||||
ServoStyleContextBorrowed,
|
||||
layout_parent_style: ServoStyleContextBorrowed,
|
||||
element: RawGeckoElementBorrowedOrNull,
|
||||
set: RawServoStyleSetBorrowed)
|
||||
-> ServoStyleContextStrong;
|
||||
}
|
||||
extern "C" {
|
||||
pub fn Servo_TraverseSubtree(root: RawGeckoElementBorrowed,
|
||||
set: RawServoStyleSetBorrowed,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue