mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Bug 1298588 part 12. Compile some bits that call ComputedValues::initial_values only for servo, not stylo. r=bholley
Stylist::set_device seems to only be used in servo code, and is the only consumer of ViewportConstraints::maybe_new.
This commit is contained in:
parent
8367c96c1b
commit
62961370ec
2 changed files with 20 additions and 2 deletions
|
@ -11,7 +11,9 @@ use data::ComputedStyle;
|
|||
use dom::{PresentationalHintsSynthetizer, TElement};
|
||||
use error_reporting::StdoutErrorReporter;
|
||||
use keyframes::KeyframesAnimation;
|
||||
use media_queries::{Device, MediaType};
|
||||
use media_queries::Device;
|
||||
#[cfg(feature = "servo")]
|
||||
use media_queries::MediaType;
|
||||
use parking_lot::RwLock;
|
||||
use properties::{self, CascadeFlags, ComputedValues, INHERIT_ALL, Importance};
|
||||
use properties::{PropertyDeclaration, PropertyDeclarationBlock};
|
||||
|
@ -34,6 +36,7 @@ use std::slice;
|
|||
use std::sync::Arc;
|
||||
use style_traits::viewport::ViewportConstraints;
|
||||
use stylesheets::{CssRule, Origin, StyleRule, Stylesheet, UserAgentStylesheets};
|
||||
#[cfg(feature = "servo")]
|
||||
use viewport::{self, MaybeNew, ViewportRule};
|
||||
|
||||
pub use ::fnv::FnvHashMap;
|
||||
|
@ -385,6 +388,10 @@ impl Stylist {
|
|||
///
|
||||
/// This means that we may need to rebuild style data even if the
|
||||
/// stylesheets haven't changed.
|
||||
///
|
||||
/// Viewport_Constraints::maybe_new is servo-only (see the comment above it
|
||||
/// explaining why), so we need to be servo-only too, since we call it.
|
||||
#[cfg(feature = "servo")]
|
||||
pub fn set_device(&mut self, mut device: Device, stylesheets: &[Arc<Stylesheet>]) {
|
||||
let cascaded_rule = ViewportRule {
|
||||
declarations: viewport::Cascade::from_stylesheets(stylesheets, &device).finish(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue