File tree Expand file tree Collapse file tree 6 files changed +16
-11
lines changed
html5ever/src/tree_builder Expand file tree Collapse file tree 6 files changed +16
-11
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,8 @@ members = [
77 " match_token"
88]
99
10+ resolver = " 2"
11+
1012[workspace .dependencies ]
1113match_token = { path = " match_token" }
1214
13- resolver = " 2"
Original file line number Diff line number Diff line change @@ -1392,11 +1392,12 @@ where
13921392 // template start tag's shadowrootmode is not in the none state
13931393 let is_shadow_root_mode = tag. attrs . iter ( ) . any ( |attr| {
13941394 attr. name . local == local_name ! ( "shadowrootmode" )
1395- && ( attr. value . to_string ( ) == String :: from ( "open" ) || attr. value . to_string ( ) == String :: from ( "close" ) )
1395+ && ( attr. value . to_string ( ) == * "open" || attr. value . to_string ( ) == * "close" )
13961396 } ) ;
13971397
13981398 // Check if intended_parent's document allows declarative shadow roots
1399- let allow_declarative_shadow_roots = self . sink . allow_declarative_shadow_roots ( & intended_parent) ;
1399+ let allow_declarative_shadow_roots =
1400+ self . sink . allow_declarative_shadow_roots ( & intended_parent) ;
14001401
14011402 // the adjusted current node is not the topmost element in the stack of open elements
14021403 let adjusted_current_node_not_topmost = match self . open_elems . borrow ( ) . first ( ) {
@@ -1412,11 +1413,12 @@ where
14121413 None => true ,
14131414 } ;
14141415
1415- return is_shadow_root_mode && allow_declarative_shadow_roots && adjusted_current_node_not_topmost;
1416+ is_shadow_root_mode && allow_declarative_shadow_roots && adjusted_current_node_not_topmost
14161417 }
14171418
14181419 fn attach_declarative_shadow ( & self , tag : & Tag ) -> Result < ( ) , String > {
1419- self . sink . attach_declarative_shadow ( self . open_elems . borrow ( ) . last ( ) . unwrap ( ) , tag. attrs . clone ( ) )
1420+ self . sink
1421+ . attach_declarative_shadow ( self . open_elems . borrow ( ) . last ( ) . unwrap ( ) , tag. attrs . clone ( ) )
14201422 }
14211423
14221424 fn create_formatting_element_for ( & self , tag : Tag ) -> Handle {
Original file line number Diff line number Diff line change @@ -160,7 +160,7 @@ where
160160 self . template_modes. borrow_mut( ) . push( InTemplate ) ;
161161
162162 if ( self . should_attach_declarative_shadow( & tag) ) {
163- if let Err ( _ ) = self . attach_declarative_shadow( & tag) {
163+ if self . attach_declarative_shadow( & tag) . is_err ( ) {
164164 // TODO:
165165 // insert at the adjusted insertion location
166166 // with the result of insert a foreign element for template tag
Original file line number Diff line number Diff line change 1- pub const NAMED_ENTITIES : [ ( & str , u32 , u32 ) ; 2231 ] = [
1+ pub static NAMED_ENTITIES : [ ( & str , u32 , u32 ) ; 2231 ] = [
22 ( "Á" , 193 , 0 ) ,
33 ( "Á" , 193 , 0 ) ,
44 ( "á" , 225 , 0 ) ,
Original file line number Diff line number Diff line change @@ -262,7 +262,7 @@ pub trait TreeSink {
262262 }
263263
264264 fn allow_declarative_shadow_roots ( & self , _intended_parent : & Self :: Handle ) -> bool {
265- return true ;
265+ true
266266 }
267267
268268 /// Attach declarative shadow
@@ -271,7 +271,9 @@ pub trait TreeSink {
271271 _location : & Self :: Handle ,
272272 _attrs : Vec < Attribute > ,
273273 ) -> Result < ( ) , String > {
274- Err ( String :: from ( "No implementation for attach_declarative_shadow" ) )
274+ Err ( String :: from (
275+ "No implementation for attach_declarative_shadow" ,
276+ ) )
275277 }
276278}
277279
Original file line number Diff line number Diff line change @@ -4,9 +4,9 @@ version = "0.1.0"
44edition = " 2021"
55
66[dependencies ]
7- syn = " 2"
7+ syn = { version = " 2" , features = [ " full " ] }
88quote = " 1"
99proc-macro2 = " 1"
1010
1111[lib ]
12- proc-macro = true
12+ proc-macro = true
You can’t perform that action at this time.
0 commit comments