@@ -6,7 +6,7 @@ use canvas_traits::{Canvas2dMsg, CanvasCommonMsg, CanvasMsg};
66use canvas_traits:: { CompositionOrBlending , FillOrStrokeStyle , FillRule } ;
77use canvas_traits:: { LineCapStyle , LineJoinStyle , LinearGradientStyle } ;
88use canvas_traits:: { RadialGradientStyle , RepetitionStyle , byte_swap_and_premultiply} ;
9- use cssparser:: { Parser , RGBA } ;
9+ use cssparser:: { Parser , ParserInput , RGBA } ;
1010use cssparser:: Color as CSSColor ;
1111use dom:: bindings:: cell:: DOMRefCell ;
1212use dom:: bindings:: codegen:: Bindings :: CSSStyleDeclarationBinding :: CSSStyleDeclarationMethods ;
@@ -463,7 +463,8 @@ impl CanvasRenderingContext2D {
463463 }
464464
465465 fn parse_color ( & self , string : & str ) -> Result < RGBA , ( ) > {
466- let mut parser = Parser :: new ( & string) ;
466+ let mut input = ParserInput :: new ( string) ;
467+ let mut parser = Parser :: new ( & mut input) ;
467468 let color = CSSColor :: parse ( & mut parser) ;
468469 if parser. is_exhausted ( ) {
469470 match color {
@@ -1314,7 +1315,8 @@ impl Drop for CanvasRenderingContext2D {
13141315}
13151316
13161317pub fn parse_color ( string : & str ) -> Result < RGBA , ( ) > {
1317- let mut parser = Parser :: new ( & string) ;
1318+ let mut input = ParserInput :: new ( string) ;
1319+ let mut parser = Parser :: new ( & mut input) ;
13181320 match CSSColor :: parse ( & mut parser) {
13191321 Ok ( CSSColor :: RGBA ( rgba) ) => {
13201322 if parser. is_exhausted ( ) {
0 commit comments