Skip to content

Commit

Permalink
Bug 1338087 - Drop Servo_RestyleWithAddedDeclaration. r=manishearth
Browse files Browse the repository at this point in the history
MozReview-Commit-ID: KnhvwYsR7Pf
  • Loading branch information
BorisChiou committed Feb 13, 2017
1 parent dd6d7ae commit 7ed37d2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 40 deletions.
8 changes: 0 additions & 8 deletions components/style/gecko_bindings/bindings.rs
Expand Up @@ -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,
Expand Down
34 changes: 2 additions & 32 deletions ports/geckolib/glue.rs
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7ed37d2

Please sign in to comment.