mirror of
https://github.com/servo/servo.git
synced 2025-06-24 17:14:33 +01:00
Bug 1298588 part 7, servo piece. Stop using initial_values in general in Gecko glue code. r=bholley
This commit is contained in:
parent
c313c8d17e
commit
d3e34db508
2 changed files with 6 additions and 3 deletions
|
@ -1387,6 +1387,7 @@ extern "C" {
|
|||
}
|
||||
extern "C" {
|
||||
pub fn Servo_ResolveStyle(element: RawGeckoElementBorrowed,
|
||||
set: RawServoStyleSetBorrowed,
|
||||
consume: ConsumeStyleBehavior)
|
||||
-> ServoComputedValuesStrong;
|
||||
}
|
||||
|
|
|
@ -544,6 +544,7 @@ pub extern "C" fn Servo_ResolvePseudoStyle(element: RawGeckoElementBorrowed,
|
|||
{
|
||||
let element = GeckoElement(element);
|
||||
let data = unsafe { element.ensure_data() }.borrow_mut();
|
||||
let doc_data = PerDocumentStyleData::from_ffi(raw_data);
|
||||
|
||||
// FIXME(bholley): Assert against this.
|
||||
if data.get_styles().is_none() {
|
||||
|
@ -551,11 +552,10 @@ pub extern "C" fn Servo_ResolvePseudoStyle(element: RawGeckoElementBorrowed,
|
|||
return if is_probe {
|
||||
Strong::null()
|
||||
} else {
|
||||
Arc::new(ComputedValues::initial_values().clone()).into_strong()
|
||||
doc_data.borrow().default_computed_values.clone().into_strong()
|
||||
};
|
||||
}
|
||||
|
||||
let doc_data = PerDocumentStyleData::from_ffi(raw_data);
|
||||
match get_pseudo_style(element, pseudo_tag, data.styles(), doc_data) {
|
||||
Some(values) => values.into_strong(),
|
||||
None if !is_probe => data.styles().primary.values.clone().into_strong(),
|
||||
|
@ -942,6 +942,7 @@ pub extern "C" fn Servo_CheckChangeHint(element: RawGeckoElementBorrowed) -> nsC
|
|||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_ResolveStyle(element: RawGeckoElementBorrowed,
|
||||
raw_data: RawServoStyleSetBorrowed,
|
||||
consume: structs::ConsumeStyleBehavior)
|
||||
-> ServoComputedValuesStrong
|
||||
{
|
||||
|
@ -949,10 +950,11 @@ pub extern "C" fn Servo_ResolveStyle(element: RawGeckoElementBorrowed,
|
|||
debug!("Servo_ResolveStyle: {:?}, consume={:?}", element, consume);
|
||||
|
||||
let mut data = unsafe { element.ensure_data() }.borrow_mut();
|
||||
let per_doc_data = PerDocumentStyleData::from_ffi(raw_data).borrow();
|
||||
|
||||
if !data.has_current_styles() {
|
||||
error!("Resolving style on unstyled element with lazy computation forbidden.");
|
||||
return Arc::new(ComputedValues::initial_values().clone()).into_strong();
|
||||
return per_doc_data.default_computed_values.clone().into_strong();
|
||||
}
|
||||
|
||||
let values = data.styles().primary.values.clone();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue