Bug 1338087 - Drop Servo_RestyleWithAddedDeclaration. r=manishearth

MozReview-Commit-ID: KnhvwYsR7Pf
This commit is contained in:
Boris Chiou 2017-02-13 12:24:58 +08:00
parent dd6d7ae59d
commit 7ed37d27d8
2 changed files with 2 additions and 40 deletions

View file

@ -1271,14 +1271,6 @@ extern "C" {
principal: *mut ThreadSafePrincipalHolder)
-> RawServoDeclarationBlockStrong;
}
extern "C" {
pub fn Servo_RestyleWithAddedDeclaration(set: RawServoStyleSetBorrowed,
declarations:
RawServoDeclarationBlockBorrowed,
previous_style:
ServoComputedValuesBorrowed)
-> ServoComputedValuesStrong;
}
extern "C" {
pub fn Servo_AnimationValues_Populate(arg1:
RawGeckoAnimationValueListBorrowedMut,

View file

@ -64,10 +64,10 @@ use style::gecko_properties::style_structs;
use style::keyframes::KeyframesStepValue;
use style::parallel;
use style::parser::{ParserContext, ParserContextExtraData};
use style::properties::{CascadeFlags, ComputedValues, Importance, PropertyDeclaration};
use style::properties::{ComputedValues, Importance, PropertyDeclaration};
use style::properties::{PropertyDeclarationParseResult, PropertyDeclarationBlock, PropertyId};
use style::properties::{apply_declarations, parse_one_declaration};
use style::properties::animated_properties::{AnimationValue, Interpolate, TransitionProperty};
use style::properties::parse_one_declaration;
use style::restyle_hints::RestyleHint;
use style::selector_parser::PseudoElementCascadeType;
use style::sequential;
@ -331,36 +331,6 @@ pub extern "C" fn Servo_AnimationValue_Release(anim: RawServoAnimationValueBorro
unsafe { AnimationValue::release(anim) };
}
#[no_mangle]
pub extern "C" fn Servo_RestyleWithAddedDeclaration(raw_data: RawServoStyleSetBorrowed,
declarations: RawServoDeclarationBlockBorrowed,
previous_style: ServoComputedValuesBorrowed)
-> ServoComputedValuesStrong
{
let previous_style = ComputedValues::as_arc(&previous_style);
let declarations = RwLock::<PropertyDeclarationBlock>::as_arc(&declarations);
let guard = declarations.read();
let declarations = || {
guard.declarations.iter().rev().map(|&(ref decl, _importance)| decl)
};
let data = PerDocumentStyleData::from_ffi(raw_data).borrow();
// FIXME (bug 1303229): Use the actual viewport size here
let computed = apply_declarations(Size2D::new(Au(0), Au(0)),
/* is_root_element = */ false,
declarations,
previous_style,
data.default_computed_values(),
None,
Box::new(StdoutErrorReporter),
None,
CascadeFlags::empty());
Arc::new(computed).into_strong()
}
#[no_mangle]
pub extern "C" fn Servo_StyleWorkerThreadCount() -> u32 {
*NUM_THREADS as u32