-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix inert mechanism for overlays (#2986)
Closes #2969
- Loading branch information
1 parent
7c8a690
commit 92992d2
Showing
21 changed files
with
600 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from './controllers/connected-abort-controller.js'; | ||
export * from './controllers/inert-controller.js'; | ||
export * from './controllers/language-controller.js'; | ||
export * from './controllers/slot-state-controller.js'; |
267 changes: 267 additions & 0 deletions
267
src/elements/core/controllers/__snapshots__/inert-controller.spec.snap.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,267 @@ | ||
/* @web/test-runner snapshot v1 */ | ||
export const snapshots = {}; | ||
|
||
snapshots["inert light DOM should mark inert"] = | ||
`<div> | ||
<div | ||
aria-hidden="true" | ||
data-sbb-aria-hidden="" | ||
data-sbb-inert="" | ||
inert="" | ||
> | ||
</div> | ||
<div | ||
aria-hidden="true" | ||
data-sbb-aria-hidden="" | ||
inert="" | ||
> | ||
</div> | ||
<div | ||
aria-hidden="true" | ||
data-sbb-inert="" | ||
inert="" | ||
> | ||
</div> | ||
<div id="overlay"> | ||
</div> | ||
<div | ||
aria-hidden="true" | ||
data-sbb-aria-hidden="" | ||
data-sbb-inert="" | ||
inert="" | ||
> | ||
<div id="overlay2"> | ||
</div> | ||
</div> | ||
</div> | ||
`; | ||
/* end snapshot inert light DOM should mark inert */ | ||
|
||
snapshots["inert light DOM should remove inert"] = | ||
`<div> | ||
<div> | ||
</div> | ||
<div inert=""> | ||
</div> | ||
<div aria-hidden="true"> | ||
</div> | ||
<div id="overlay"> | ||
</div> | ||
<div> | ||
<div id="overlay2"> | ||
</div> | ||
</div> | ||
</div> | ||
`; | ||
/* end snapshot inert light DOM should remove inert */ | ||
|
||
snapshots["inert light DOM stacked should mark inert"] = | ||
`<div> | ||
<div | ||
aria-hidden="true" | ||
data-sbb-aria-hidden="" | ||
data-sbb-inert="" | ||
inert="" | ||
> | ||
</div> | ||
<div | ||
aria-hidden="true" | ||
data-sbb-aria-hidden="" | ||
inert="" | ||
> | ||
</div> | ||
<div | ||
aria-hidden="true" | ||
data-sbb-inert="" | ||
inert="" | ||
> | ||
</div> | ||
<div | ||
aria-hidden="true" | ||
data-sbb-aria-hidden="" | ||
data-sbb-inert="" | ||
id="overlay" | ||
inert="" | ||
> | ||
</div> | ||
<div> | ||
<div id="overlay2"> | ||
</div> | ||
</div> | ||
</div> | ||
`; | ||
/* end snapshot inert light DOM stacked should mark inert */ | ||
|
||
snapshots["inert light DOM stacked should remove inert level 2"] = | ||
`<div> | ||
<div | ||
aria-hidden="true" | ||
data-sbb-aria-hidden="" | ||
data-sbb-inert="" | ||
inert="" | ||
> | ||
</div> | ||
<div | ||
aria-hidden="true" | ||
data-sbb-aria-hidden="" | ||
inert="" | ||
> | ||
</div> | ||
<div | ||
aria-hidden="true" | ||
data-sbb-inert="" | ||
inert="" | ||
> | ||
</div> | ||
<div id="overlay"> | ||
</div> | ||
<div | ||
aria-hidden="true" | ||
data-sbb-aria-hidden="" | ||
data-sbb-inert="" | ||
inert="" | ||
> | ||
<div id="overlay2"> | ||
</div> | ||
</div> | ||
</div> | ||
`; | ||
/* end snapshot inert light DOM stacked should remove inert level 2 */ | ||
|
||
snapshots["inert light DOM stacked should remove inert level 1"] = | ||
`<div> | ||
<div> | ||
</div> | ||
<div inert=""> | ||
</div> | ||
<div aria-hidden="true"> | ||
</div> | ||
<div id="overlay"> | ||
</div> | ||
<div> | ||
<div id="overlay2"> | ||
</div> | ||
</div> | ||
</div> | ||
`; | ||
/* end snapshot inert light DOM stacked should remove inert level 1 */ | ||
|
||
snapshots["inert light DOM stacked should handle level skip removal"] = | ||
`<div> | ||
<div> | ||
</div> | ||
<div inert=""> | ||
</div> | ||
<div aria-hidden="true"> | ||
</div> | ||
<div id="overlay"> | ||
</div> | ||
<div> | ||
<div id="overlay2"> | ||
</div> | ||
</div> | ||
</div> | ||
`; | ||
/* end snapshot inert light DOM stacked should handle level skip removal */ | ||
|
||
snapshots["inert with shadow DOM should mark inert DOM"] = | ||
`<div> | ||
<div | ||
aria-hidden="true" | ||
data-sbb-aria-hidden="" | ||
data-sbb-inert="" | ||
inert="" | ||
> | ||
</div> | ||
<div | ||
aria-hidden="true" | ||
data-sbb-aria-hidden="" | ||
inert="" | ||
> | ||
</div> | ||
<div | ||
aria-hidden="true" | ||
data-sbb-inert="" | ||
inert="" | ||
> | ||
</div> | ||
<shadow-element> | ||
</shadow-element> | ||
<div | ||
aria-hidden="true" | ||
data-sbb-aria-hidden="" | ||
data-sbb-inert="" | ||
inert="" | ||
> | ||
<div> | ||
</div> | ||
</div> | ||
</div> | ||
`; | ||
/* end snapshot inert with shadow DOM should mark inert DOM */ | ||
|
||
snapshots["inert with shadow DOM should mark inert Shadow DOM"] = | ||
`<div | ||
aria-hidden="true" | ||
data-sbb-aria-hidden="" | ||
data-sbb-inert="" | ||
inert="" | ||
> | ||
</div> | ||
<div> | ||
<div | ||
aria-hidden="true" | ||
data-sbb-aria-hidden="" | ||
data-sbb-inert="" | ||
inert="" | ||
> | ||
Sibling | ||
</div> | ||
<div id="overlay"> | ||
</div> | ||
<span | ||
aria-hidden="true" | ||
data-sbb-aria-hidden="" | ||
data-sbb-inert="" | ||
inert="" | ||
> | ||
Another sibling | ||
</span> | ||
</div> | ||
`; | ||
/* end snapshot inert with shadow DOM should mark inert Shadow DOM */ | ||
|
||
snapshots["inert with shadow DOM should remove inert DOM"] = | ||
`<div> | ||
<div> | ||
</div> | ||
<div inert=""> | ||
</div> | ||
<div aria-hidden="true"> | ||
</div> | ||
<shadow-element> | ||
</shadow-element> | ||
<div> | ||
<div> | ||
</div> | ||
</div> | ||
</div> | ||
`; | ||
/* end snapshot inert with shadow DOM should remove inert DOM */ | ||
|
||
snapshots["inert with shadow DOM should remove inert Shadow DOM"] = | ||
`<div> | ||
</div> | ||
<div> | ||
<div> | ||
Sibling | ||
</div> | ||
<div id="overlay"> | ||
</div> | ||
<span> | ||
Another sibling | ||
</span> | ||
</div> | ||
`; | ||
/* end snapshot inert with shadow DOM should remove inert Shadow DOM */ | ||
|
Oops, something went wrong.