mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
style: Move Origin into its own file.
This commit is contained in:
parent
4ddf6dbd15
commit
0635fddbfc
2 changed files with 23 additions and 16 deletions
|
@ -14,6 +14,7 @@ mod loader;
|
|||
mod media_rule;
|
||||
mod memory;
|
||||
mod namespace_rule;
|
||||
mod origin;
|
||||
mod page_rule;
|
||||
mod rule_list;
|
||||
mod rule_parser;
|
||||
|
@ -43,6 +44,7 @@ pub use self::memory::{MallocSizeOf, MallocSizeOfFn, MallocSizeOfWithGuard};
|
|||
#[cfg(feature = "gecko")]
|
||||
pub use self::memory::{MallocSizeOfWithRepeats, SizeOfState};
|
||||
pub use self::namespace_rule::NamespaceRule;
|
||||
pub use self::origin::Origin;
|
||||
pub use self::page_rule::PageRule;
|
||||
pub use self::rule_parser::{State, TopLevelRuleParser};
|
||||
pub use self::rule_list::{CssRules, CssRulesHelpers};
|
||||
|
@ -82,22 +84,6 @@ impl UrlExtraData {
|
|||
#[cfg(feature = "gecko")]
|
||||
impl Eq for UrlExtraData {}
|
||||
|
||||
/// Each style rule has an origin, which determines where it enters the cascade.
|
||||
///
|
||||
/// http://dev.w3.org/csswg/css-cascade/#cascading-origins
|
||||
#[derive(Clone, PartialEq, Eq, Copy, Debug)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub enum Origin {
|
||||
/// http://dev.w3.org/csswg/css-cascade/#cascade-origin-ua
|
||||
UserAgent,
|
||||
|
||||
/// http://dev.w3.org/csswg/css-cascade/#cascade-origin-author
|
||||
Author,
|
||||
|
||||
/// http://dev.w3.org/csswg/css-cascade/#cascade-origin-user
|
||||
User,
|
||||
}
|
||||
|
||||
/// A CSS rule.
|
||||
///
|
||||
/// TODO(emilio): Lots of spec links should be around.
|
||||
|
|
21
components/style/stylesheets/origin.rs
Normal file
21
components/style/stylesheets/origin.rs
Normal file
|
@ -0,0 +1,21 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
///! [CSS cascade origins](https://drafts.csswg.org/css-cascade/#cascading-origins).
|
||||
|
||||
/// Each style rule has an origin, which determines where it enters the cascade.
|
||||
///
|
||||
/// https://drafts.csswg.org/css-cascade/#cascading-origins
|
||||
#[derive(Clone, PartialEq, Eq, Copy, Debug)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub enum Origin {
|
||||
/// https://drafts.csswg.org/css-cascade/#cascade-origin-us
|
||||
UserAgent,
|
||||
|
||||
/// https://drafts.csswg.org/css-cascade/#cascade-origin-author
|
||||
Author,
|
||||
|
||||
/// https://drafts.csswg.org/css-cascade/#cascade-origin-user
|
||||
User,
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue