Skip to content

Commit 4cabb09

Browse files
authored
Implement vendor prefixing for mask properties (parcel-bundler#114)
1 parent 1b5b0c0 commit 4cabb09

File tree

8 files changed

+1068
-65
lines changed

8 files changed

+1068
-65
lines changed

src/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub(crate) enum DeclarationContext {
3636

3737
#[derive(Debug)]
3838
pub(crate) struct PropertyHandlerContext<'i> {
39-
targets: Option<Browsers>,
39+
pub targets: Option<Browsers>,
4040
pub used_logical: bool,
4141
pub is_important: bool,
4242
supports: Vec<SupportsEntry<'i>>,

src/declaration.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use cssparser::*;
22
use crate::properties::Property;
33
use crate::properties::box_shadow::BoxShadowHandler;
4+
use crate::properties::masking::MaskHandler;
45
use crate::traits::{PropertyHandler, ToCss};
56
use crate::printer::Printer;
67
use crate::properties::{
@@ -189,6 +190,7 @@ pub(crate) struct DeclarationHandler<'i> {
189190
overflow: OverflowHandler,
190191
transform: TransformHandler,
191192
box_shadow: BoxShadowHandler,
193+
mask: MaskHandler<'i>,
192194
fallback: FallbackHandler,
193195
prefix: PrefixHandler,
194196
decls: DeclarationList<'i>
@@ -219,6 +221,7 @@ impl<'i> DeclarationHandler<'i> {
219221
overflow: OverflowHandler::new(targets),
220222
transform: TransformHandler::new(targets),
221223
box_shadow: BoxShadowHandler::new(targets),
224+
mask: MaskHandler::default(),
222225
fallback: FallbackHandler::new(targets),
223226
prefix: PrefixHandler::new(targets),
224227
decls: DeclarationList::new()
@@ -248,6 +251,7 @@ impl<'i> DeclarationHandler<'i> {
248251
self.overflow.handle_property(property, &mut self.decls, context) ||
249252
self.transform.handle_property(property, &mut self.decls, context) ||
250253
self.box_shadow.handle_property(property, &mut self.decls, context) ||
254+
self.mask.handle_property(property, &mut self.decls, context) ||
251255
self.fallback.handle_property(property, &mut self.decls, context) ||
252256
self.prefix.handle_property(property, &mut self.decls, context)
253257
}
@@ -275,6 +279,7 @@ impl<'i> DeclarationHandler<'i> {
275279
self.overflow.finalize(&mut self.decls, context);
276280
self.transform.finalize(&mut self.decls, context);
277281
self.box_shadow.finalize(&mut self.decls, context);
282+
self.mask.finalize(&mut self.decls, context);
278283
self.fallback.finalize(&mut self.decls, context);
279284
self.prefix.finalize(&mut self.decls, context);
280285
}

0 commit comments

Comments
 (0)