Skip to content

Commit

Permalink
Bug 1856682 [wpt PR 42315] - Fix :dir() selector and updates for dir=…
Browse files Browse the repository at this point in the history
…auto and descendant directionality to consider non-HTML elements., a=testonly

Automatic update from web-platform-tests
Fix :dir() selector and updates for dir=auto and descendant directionality to consider non-HTML elements.

This changes behavior only when the CSSPseudoDir flag is enabled.

This is based on the proposed behavior described in:
whatwg/html#3699 (comment)
which is in the process of being specified in:
whatwg/html#9554
whatwg/html#9796
and on the behavior specified in:
https://drafts.csswg.org/selectors-4/#the-dir-pseudo

Bug: 576815
Change-Id: I57323aeda8850f382756cd36b3717d34e8911f5e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4908695
Commit-Queue: David Baron <dbaronchromium.org>
Reviewed-by: Di Zhang <dizhanggchromium.org>
Cr-Commit-Position: refs/heads/main{#1204886}

--

wpt-commits: 9c46bae54706a175a99a9f127a4a8065704c2cc2
wpt-pr: 42315

UltraBlame original commit: 28cd492bf06128adefbd727f510e3773c4c531ab
  • Loading branch information
marco-c committed Oct 30, 2023
1 parent a17385e commit b893f61
Show file tree
Hide file tree
Showing 2 changed files with 1,206 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,36 @@ rtl
)
)
;
ele
.
dir
=
"
ltr
"
;
assert_true
(
ele2
.
matches
(
"
:
dir
(
ltr
)
"
)
"
direction
after
dynamic
change
"
)
;
}
"
Element
Expand Down Expand Up @@ -274,6 +304,36 @@ rtl
)
)
;
ele
.
dir
=
"
ltr
"
;
assert_true
(
ele2
.
matches
(
"
:
dir
(
ltr
)
"
)
"
direction
after
dynamic
change
"
)
;
}
"
Non
Expand Down Expand Up @@ -443,3 +503,189 @@ document
"
)
;
test
(
(
)
=
>
{
const
ele
=
document
.
createElement
(
"
foobar
"
)
;
ele
.
dir
=
"
auto
"
;
const
ele2
=
document
.
createElementNS
(
"
foobar
"
"
foobar
"
)
;
ele
.
append
(
ele2
)
;
const
text
=
document
.
createTextNode
(
"
\
u05D0
\
u05D1
\
u05D2
"
)
;
ele2
.
append
(
text
)
;
assert_true
(
ele
.
matches
(
"
:
dir
(
rtl
)
"
)
"
is
RTL
before
change
"
)
;
assert_true
(
ele2
.
matches
(
"
:
dir
(
rtl
)
"
)
"
child
is
RTL
before
change
"
)
;
text
.
data
=
"
ABC
"
;
assert_true
(
ele
.
matches
(
"
:
dir
(
ltr
)
"
)
"
is
LTR
after
change
"
)
;
assert_true
(
ele2
.
matches
(
"
:
dir
(
ltr
)
"
)
"
child
is
LTR
after
change
"
)
;
}
"
Non
-
HTML
element
text
contents
influence
dir
=
auto
"
)
;
Loading

0 comments on commit b893f61

Please sign in to comment.