File tree Expand file tree Collapse file tree 2 files changed +6
-24
lines changed Expand file tree Collapse file tree 2 files changed +6
-24
lines changed Original file line number Diff line number Diff line change @@ -339,8 +339,10 @@ impl<'a> CSSInliner<'a> {
339
339
340
340
fn process_css ( document : & NodeRef , css : & str ) -> Result < ( ) > {
341
341
let mut parse_input = cssparser:: ParserInput :: new ( css) ;
342
- let mut parser = parser:: CSSParser :: new ( & mut parse_input) ;
343
- for parsed in parser. parse ( ) {
342
+ let mut parser = cssparser:: Parser :: new ( & mut parse_input) ;
343
+ let rule_list =
344
+ cssparser:: RuleListParser :: new_for_stylesheet ( & mut parser, parser:: CSSRuleListParser ) ;
345
+ for parsed in rule_list {
344
346
if let Ok ( ( selector, declarations) ) = parsed {
345
347
if let Ok ( rule) = Rule :: new ( selector, declarations) {
346
348
let matching_elements = document
Original file line number Diff line number Diff line change @@ -79,8 +79,8 @@ impl<'i> cssparser::DeclarationParser<'i> for CSSDeclarationListParser {
79
79
}
80
80
81
81
impl < ' i > cssparser:: AtRuleParser < ' i > for CSSRuleListParser {
82
- type PreludeNoBlock = String ;
83
- type PreludeBlock = String ;
82
+ type PreludeNoBlock = & ' i str ;
83
+ type PreludeBlock = & ' i str ;
84
84
type AtRule = QualifiedRule < ' i > ;
85
85
type Error = ( ) ;
86
86
}
@@ -93,23 +93,3 @@ impl<'i> cssparser::AtRuleParser<'i> for CSSDeclarationListParser {
93
93
type AtRule = Declaration < ' i > ;
94
94
type Error = ( ) ;
95
95
}
96
-
97
- pub ( crate ) struct CSSParser < ' i , ' t > {
98
- input : cssparser:: Parser < ' i , ' t > ,
99
- }
100
-
101
- impl < ' i : ' t , ' t > CSSParser < ' i , ' t > {
102
- #[ inline]
103
- pub ( crate ) fn new ( css : & ' t mut cssparser:: ParserInput < ' i > ) -> CSSParser < ' i , ' t > {
104
- CSSParser {
105
- input : cssparser:: Parser :: new ( css) ,
106
- }
107
- }
108
-
109
- #[ inline]
110
- pub ( crate ) fn parse < ' a > (
111
- & ' a mut self ,
112
- ) -> cssparser:: RuleListParser < ' i , ' t , ' a , CSSRuleListParser > {
113
- cssparser:: RuleListParser :: new_for_stylesheet ( & mut self . input , CSSRuleListParser )
114
- }
115
- }
You can’t perform that action at this time.
0 commit comments