Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Signed-off-by: Oriol Brufau <[email protected]>
  • Loading branch information
Loirooriol committed Nov 21, 2024
1 parent b1317ca commit 6605bdb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 32 deletions.
9 changes: 0 additions & 9 deletions style/properties/properties.mako.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2248,15 +2248,6 @@ impl ComputedValuesInner {
}
}

#[cfg(feature = "servo")]
impl crate::properties::style_structs::InheritedUI {
/// Returns the ColorSchemeFlags corresponding to the value of `color-scheme`.
#[inline]
pub fn color_scheme_bits(&self) -> ColorSchemeFlags {
ColorSchemeFlags::default()
}
}

/// A reference to a style struct of the parent, or our own style struct.
pub enum StyleStructRef<'a, T: 'static> {
/// A borrowed struct from the parent, for example, for inheriting style.
Expand Down
24 changes: 1 addition & 23 deletions style/servo/media_queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@ use crate::font_metrics::FontMetrics;
use crate::queries::feature::{AllowsRanges, Evaluator, FeatureFlags, QueryFeatureDescription};
use crate::logical_geometry::WritingMode;
use crate::media_queries::MediaType;
use crate::parser::ParserContext;
use crate::properties::style_structs::Font;
use crate::properties::ComputedValues;
use crate::values::computed::{CSSPixelLength, Context, Length, LineHeight, NonNegativeLength, Resolution};
use crate::values::computed::font::GenericFontFamily;
use crate::values::specified::color::ColorSchemeFlags;
use crate::values::specified::color::{ColorSchemeFlags, ForcedColors};
use crate::values::specified::font::{FONT_MEDIUM_LINE_HEIGHT_PX, FONT_MEDIUM_PX};
use crate::values::specified::ViewportVariant;
use crate::values::KeyframesName;
Expand Down Expand Up @@ -391,24 +390,3 @@ pub static MEDIA_FEATURES: [QueryFeatureDescription; 5] = [
FeatureFlags::empty(),
),
];

/// Possible values for the forced-colors media query.
/// <https://drafts.csswg.org/mediaqueries-5/#forced-colors>
#[derive(Clone, Copy, Debug, FromPrimitive, Parse, PartialEq, ToCss)]
#[repr(u8)]
pub enum ForcedColors {
/// Page colors are not being forced.
None,
/// Page colors would be forced in content.
#[parse(condition = "ParserContext::chrome_rules_enabled")]
Requested,
/// Page colors are being forced.
Active,
}

impl ForcedColors {
/// Returns whether forced-colors is active for this page.
pub fn is_active(self) -> bool {
matches!(self, Self::Active)
}
}

0 comments on commit 6605bdb

Please sign in to comment.