mirror of
https://github.com/servo/servo.git
synced 2025-08-11 08:25:32 +01:00
style: Refactor ImportLayer into enum
Refactored ImportLayer into an enum instead of a struct and using Option everywhere. Differential Revision: https://phabricator.services.mozilla.com/D176793
This commit is contained in:
parent
2e713d4366
commit
a5b85ec834
4 changed files with 28 additions and 18 deletions
|
@ -28,6 +28,7 @@ use crate::shared_lock::{Locked, SharedRwLockReadGuard, StylesheetGuards};
|
|||
use crate::stylesheet_set::{DataValidity, DocumentStylesheetSet, SheetRebuildKind};
|
||||
use crate::stylesheet_set::{DocumentStylesheetFlusher, SheetCollectionFlusher};
|
||||
use crate::stylesheets::container_rule::ContainerCondition;
|
||||
use crate::stylesheets::import_rule::ImportLayer;
|
||||
use crate::stylesheets::keyframes_rule::KeyframesAnimation;
|
||||
use crate::stylesheets::layer_rule::{LayerName, LayerOrder};
|
||||
use crate::stylesheets::viewport_rule::{self, MaybeNew, ViewportRule};
|
||||
|
@ -2944,8 +2945,10 @@ impl CascadeData {
|
|||
self.effective_media_query_results
|
||||
.saw_effective(import_rule);
|
||||
}
|
||||
if let Some(ref layer) = import_rule.layer {
|
||||
maybe_register_layers(self, layer.name.as_ref(), containing_rule_state);
|
||||
match import_rule.layer {
|
||||
ImportLayer::Named(ref name) => maybe_register_layers(self, Some(name), containing_rule_state),
|
||||
ImportLayer::Anonymous => maybe_register_layers(self, None, containing_rule_state),
|
||||
ImportLayer::None => {},
|
||||
}
|
||||
},
|
||||
CssRule::Media(ref lock) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue