Skip to content

Commit

Permalink
Bug 1924605 [wpt PR 48611] - [reading-flow] display: contents partici…
Browse files Browse the repository at this point in the history
…pate in the flow, a=testonly

Automatic update from web-platform-tests
[reading-flow] display: contents participate in the flow

From CSSWG resolution [1]:
> display:contents focusable element occurs immediately before its first child in visual order

[1] w3c/csswg-drafts#9230 (comment)

Currently, reading flow items in display: contents are ignored and
display: contents elements are visited last in the focus order.
That means we lose that order information.

We update the algorithm so when we loop reading items and find one that
is not in the focus scope, we traverse its parent to find an ancestor
that is. This element can then be added in the reading flow instead.

We update A11Y to behave the same way as focus navigation. Since the
A11Y tree uses LayoutTreeBuilder, we update the algorithm to loop
through each reading flow item's ancestor until its parent is the
LayoutTreeBuilderTraversal::Parent. This element can then be added in
the reading flow instead.

Change-Id: I1c3c3ab3a6548611af9a2cfddecc9d889b0ecb14
Bug: 371024057
Bug: 40932006
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5924454
Commit-Queue: Di Zhang <dizhanggchromium.org>
Reviewed-by: Mason Freed <masonfchromium.org>
Cr-Commit-Position: refs/heads/main{#1368523}

--

wpt-commits: 078000e068347d9558ff63ceb84510aad5953725
wpt-pr: 48611

UltraBlame original commit: 98d9d2eab45c9af3379a7b46c7a407389ce941e3
  • Loading branch information
marco-c committed Oct 22, 2024
1 parent 396d5bf commit 0d1a5df
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -255,17 +255,18 @@
-
-
Since
C
is
B
A
are
inside
a
direct
reading
flow
item
it
is
display
:
contents
they
are
visited
first
together
.
-
-
Expand All @@ -276,17 +277,17 @@
-
Since
B
A
are
inside
a
has
order
1
its
display
:
contents
they
are
parent
is
visited
after
first
.
-
-
Expand All @@ -305,9 +306,9 @@
expect
=
"
C
B
A
C
"
data
-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,9 @@
=
"
order1
order3
order2
order4
order3
"
data
-
Expand All @@ -299,6 +299,17 @@
same
grid
container
and
are
placed
in
the
position
where
their
first
child
resides
.
"
>
Expand Down Expand Up @@ -446,10 +457,10 @@
"
div1B
order1B
order3B
div2B
order2B
order4B
order3B
"
data
-
Expand All @@ -466,18 +477,27 @@
same
grid
container
with
focusable
and
are
placed
in
the
position
where
their
first
child
resides
.
The
display
contents
divs
at
the
end
of
the
focus
sequence
have
tabindex
and
should
be
focusable
.
"
>
Expand Down Expand Up @@ -643,18 +663,18 @@
expect
=
"
A1
A2
A3
B1
B2
B3
C1
C2
C3
D1
D2
D3
B1
B2
B3
A1
A2
A3
"
data
-
Expand All @@ -676,7 +696,7 @@
div
class
=
box
wrapper
>
<
div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -603,15 +603,15 @@
expect
=
"
o1
o3
o5
host3
/
o2
host3
/
o4
o1
o3
o5
"
data
-
Expand Down Expand Up @@ -823,18 +823,18 @@
expect
=
"
host4
/
after
host4
/
before
b4
a4
d42
d41
d43
c4
host4
/
after
host4
/
before
"
data
-
Expand Down Expand Up @@ -1343,14 +1343,14 @@
expect
=
"
b6
a6
host6
/
after
host6
/
before
b6
a6
"
data
-
Expand Down Expand Up @@ -1543,11 +1543,11 @@
expect
=
"
a7
b7
host7
/
after
a7
b7
host7
/
before
Expand Down Expand Up @@ -1615,7 +1615,7 @@
"
order
:
4
5
"
id
=
Expand All @@ -1636,10 +1636,7 @@
display
:
block
"
style
=
"
;
order
:
4
Expand Down

0 comments on commit 0d1a5df

Please sign in to comment.