forked from SerenityOS/serenity
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LibWeb: Allow inline nodes to establish a stacking context
With this change, a stacking context can be established by any paintable, including inline paintables. The stacking context traversal is updated to remove the assumption that the stacking context root is paintable box.
- Loading branch information
1 parent
1919b61
commit e51f043
Showing
12 changed files
with
243 additions
and
139 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<link rel="match" href="reference/inline-stacking-context-ref.html" /><style> | ||
span { | ||
z-index: 10; | ||
background: orange; | ||
position: relative; | ||
opacity: 0.5; | ||
} | ||
div { | ||
z-index: 5; | ||
width: 50px; | ||
height: 50px; | ||
background: green; | ||
position: relative; | ||
top: -10px; | ||
} | ||
</style><span>hello</span><div></div> |
17 changes: 17 additions & 0 deletions
17
Tests/LibWeb/Ref/reference/inline-stacking-context-ref.html
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,17 @@ | ||
<style> | ||
#text { | ||
z-index: 10; | ||
background: orange; | ||
position: relative; | ||
opacity: 0.5; | ||
width: fit-content; | ||
} | ||
#box { | ||
z-index: 5; | ||
width: 50px; | ||
height: 50px; | ||
background: green; | ||
position: relative; | ||
top: -10px; | ||
} | ||
</style><div id="text">hello</div><div id="box"></div> |
1 change: 1 addition & 0 deletions
1
Tests/LibWeb/Text/expected/hit_testing/inline-stacking-context.txt
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 @@ | ||
hello true |
23 changes: 23 additions & 0 deletions
23
Tests/LibWeb/Text/input/hit_testing/inline-stacking-context.html
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,23 @@ | ||
<style> | ||
span { | ||
z-index: 10; | ||
background: orange; | ||
position: relative; | ||
opacity: 0.5; | ||
font-size: 100px; | ||
} | ||
div { | ||
z-index: 5; | ||
width: 100px; | ||
height: 100px; | ||
background: green; | ||
position: relative; | ||
top: -10px; | ||
} | ||
</style><span id="inline-stacking-context">hello</span><div></div> | ||
<script src="../include.js"></script> | ||
<script> | ||
test(() => { | ||
println(internals.hitTest(50, 50).node.parentNode === document.getElementById("inline-stacking-context")); | ||
}); | ||
</script> |
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
Oops, something went wrong.