Allow whitespace around path expressions in xpath (#39410)

Previously servo would allow whitespace in between components of an
xpath expression, but not around it.

Testing: New web platform tests start to pass 
Part of https://github.com/servo/servo/issues/34527

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
Simon Wülker 2025-09-21 00:38:24 +02:00 committed by GitHub
parent 629b7dba3d
commit bbceb0faa4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 8 deletions

View file

@ -512,7 +512,7 @@ fn union_expr(input: &str) -> IResult<&str, Expr> {
} }
fn path_expr(input: &str) -> IResult<&str, Expr> { fn path_expr(input: &str) -> IResult<&str, Expr> {
alt(( ws(alt((
// "//" RelativePathExpr // "//" RelativePathExpr
map( map(
pair(tag("//"), move |i| relative_path_expr(true, i)), pair(tag("//"), move |i| relative_path_expr(true, i)),
@ -545,7 +545,7 @@ fn path_expr(input: &str) -> IResult<&str, Expr> {
), ),
// RelativePathExpr // RelativePathExpr
move |i| relative_path_expr(false, i), move |i| relative_path_expr(false, i),
)) )))
.parse(input) .parse(input)
} }

View file

@ -1,6 +0,0 @@
[lexical-structure.html]
[Literal: Only ' and " should be handled as literal quotes.]
expected: FAIL
[ExprWhitespace: Only #x20 #x9 #xD or #xA must be handled as a whitespace.]
expected: FAIL