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 = [
7
7
" match_token"
8
8
]
9
9
10
+ resolver = " 2"
11
+
10
12
[workspace .dependencies ]
11
13
match_token = { path = " match_token" }
12
14
13
- resolver = " 2"
Original file line number Diff line number Diff line change @@ -1392,11 +1392,12 @@ where
1392
1392
// template start tag's shadowrootmode is not in the none state
1393
1393
let is_shadow_root_mode = tag. attrs . iter ( ) . any ( |attr| {
1394
1394
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" )
1396
1396
} ) ;
1397
1397
1398
1398
// 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) ;
1400
1401
1401
1402
// the adjusted current node is not the topmost element in the stack of open elements
1402
1403
let adjusted_current_node_not_topmost = match self . open_elems . borrow ( ) . first ( ) {
@@ -1412,11 +1413,12 @@ where
1412
1413
None => true ,
1413
1414
} ;
1414
1415
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
1416
1417
}
1417
1418
1418
1419
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 ( ) )
1420
1422
}
1421
1423
1422
1424
fn create_formatting_element_for ( & self , tag : Tag ) -> Handle {
Original file line number Diff line number Diff line change @@ -160,7 +160,7 @@ where
160
160
self . template_modes. borrow_mut( ) . push( InTemplate ) ;
161
161
162
162
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 ( ) {
164
164
// TODO:
165
165
// insert at the adjusted insertion location
166
166
// 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 ] = [
2
2
( "Á" , 193 , 0 ) ,
3
3
( "Á" , 193 , 0 ) ,
4
4
( "á" , 225 , 0 ) ,
Original file line number Diff line number Diff line change @@ -262,7 +262,7 @@ pub trait TreeSink {
262
262
}
263
263
264
264
fn allow_declarative_shadow_roots ( & self , _intended_parent : & Self :: Handle ) -> bool {
265
- return true ;
265
+ true
266
266
}
267
267
268
268
/// Attach declarative shadow
@@ -271,7 +271,9 @@ pub trait TreeSink {
271
271
_location : & Self :: Handle ,
272
272
_attrs : Vec < Attribute > ,
273
273
) -> Result < ( ) , String > {
274
- Err ( String :: from ( "No implementation for attach_declarative_shadow" ) )
274
+ Err ( String :: from (
275
+ "No implementation for attach_declarative_shadow" ,
276
+ ) )
275
277
}
276
278
}
277
279
Original file line number Diff line number Diff line change @@ -4,9 +4,9 @@ version = "0.1.0"
4
4
edition = " 2021"
5
5
6
6
[dependencies ]
7
- syn = " 2"
7
+ syn = { version = " 2" , features = [ " full " ] }
8
8
quote = " 1"
9
9
proc-macro2 = " 1"
10
10
11
11
[lib ]
12
- proc-macro = true
12
+ proc-macro = true
You can’t perform that action at this time.
0 commit comments