mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Move util::vec::ForgetfulSink to style::sink and simplify it
This commit is contained in:
parent
51ff916e09
commit
a5b524d559
14 changed files with 58 additions and 89 deletions
|
@ -18,6 +18,7 @@ use selectors::bloom::BloomFilter;
|
|||
use selectors::matching::DeclarationBlock as GenericDeclarationBlock;
|
||||
use selectors::matching::{Rule, SelectorMap};
|
||||
use selectors::parser::SelectorImpl;
|
||||
use sink::Push;
|
||||
use smallvec::VecLike;
|
||||
use std::collections::HashMap;
|
||||
use std::hash::BuildHasherDefault;
|
||||
|
@ -389,7 +390,7 @@ impl<Impl: SelectorImplExt> Stylist<Impl> {
|
|||
applicable_declarations: &mut V)
|
||||
-> bool
|
||||
where E: Element<Impl=Impl> + PresentationalHintsSynthetizer,
|
||||
V: VecLike<DeclarationBlock> {
|
||||
V: Push<DeclarationBlock> + VecLike<DeclarationBlock> {
|
||||
assert!(!self.is_device_dirty);
|
||||
assert!(style_attribute.is_none() || pseudo_element.is_none(),
|
||||
"Style attributes do not apply to pseudo-elements");
|
||||
|
@ -430,7 +431,8 @@ impl<Impl: SelectorImplExt> Stylist<Impl> {
|
|||
// Step 4: Normal style attributes.
|
||||
style_attribute.map(|sa| {
|
||||
shareable = false;
|
||||
applicable_declarations.push(
|
||||
Push::push(
|
||||
applicable_declarations,
|
||||
GenericDeclarationBlock::from_declarations(sa.normal.clone()))
|
||||
});
|
||||
|
||||
|
@ -443,7 +445,8 @@ impl<Impl: SelectorImplExt> Stylist<Impl> {
|
|||
// Step 6: `!important` style attributes.
|
||||
style_attribute.map(|sa| {
|
||||
shareable = false;
|
||||
applicable_declarations.push(
|
||||
Push::push(
|
||||
applicable_declarations,
|
||||
GenericDeclarationBlock::from_declarations(sa.important.clone()))
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue