-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LibWeb: Implement :modal pseudo class
Adds the :modal pseudo class which matches dialogs opened with showModal(). (cherry picked from commit 63a5ff70e5f3bee10839415885a158e304719fec)
- Loading branch information
1 parent
0979766
commit 85b5be0
Showing
8 changed files
with
82 additions
and
5 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,20 @@ | ||
Viewport <#document> at (0,0) content-size 800x600 children: not-inline | ||
BlockContainer <html> at (0,0) content-size 800x600 [BFC] children: not-inline | ||
BlockContainer <body> at (8,8) content-size 784x0 children: inline | ||
TextNode <#text> | ||
Box <dialog#modal> at (358.84375,19) content-size 82.3125x562 positioned flex-container(row) [FFC] children: not-inline | ||
BlockContainer <(anonymous)> (not painted) [BFC] children: inline | ||
TextNode <#text> | ||
BlockContainer <span> at (358.84375,19) content-size 82.3125x562 flex-item [BFC] children: inline | ||
frag 0 from TextNode start: 0, length: 10, rect: [358.84375,19 82.3125x17] baseline: 13.296875 | ||
"I'm a node" | ||
TextNode <#text> | ||
BlockContainer <(anonymous)> (not painted) [BFC] children: inline | ||
TextNode <#text> | ||
|
||
ViewportPaintable (Viewport<#document>) [0,0 800x600] | ||
PaintableWithLines (BlockContainer<HTML>) [0,0 800x600] | ||
PaintableWithLines (BlockContainer<BODY>) [8,8 784x0] | ||
PaintableBox (Box<DIALOG>#modal) [339.84375,0 120.3125x600] | ||
PaintableWithLines (BlockContainer<SPAN>) [358.84375,19 82.3125x562] | ||
TextPaintable (TextNode<#text>) |
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,18 @@ | ||
Viewport <#document> at (0,0) content-size 800x600 children: not-inline | ||
BlockContainer <html> at (0,0) content-size 800x600 [BFC] children: not-inline | ||
BlockContainer <body> at (8,8) content-size 784x0 children: inline | ||
BlockContainer <dialog> at (358.84375,27) content-size 82.3125x17 positioned [BFC] children: inline | ||
TextNode <#text> | ||
InlineNode <span> | ||
frag 0 from TextNode start: 0, length: 10, rect: [358.84375,27 82.3125x17] baseline: 13.296875 | ||
"I'm a node" | ||
TextNode <#text> | ||
TextNode <#text> | ||
TextNode <#text> | ||
|
||
ViewportPaintable (Viewport<#document>) [0,0 800x600] | ||
PaintableWithLines (BlockContainer<HTML>) [0,0 800x600] | ||
PaintableWithLines (BlockContainer<BODY>) [8,8 784x0] | ||
PaintableWithLines (BlockContainer<DIALOG>) [339.84375,8 120.3125x55] | ||
InlinePaintable (InlineNode<SPAN>) | ||
TextPaintable (TextNode<#text>) |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<style> | ||
:modal { | ||
display: flex; | ||
} | ||
</style> | ||
|
||
<dialog id="modal"> | ||
<span>I'm a node</span> | ||
</dialog> | ||
|
||
<script> | ||
document.addEventListener("DOMContentLoaded", () => { | ||
let modal = document.getElementById('modal'); | ||
modal.showModal(); | ||
}); | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<style> | ||
:modal { | ||
display: flex; | ||
} | ||
</style> | ||
|
||
<dialog open> | ||
<span>I'm a node</span> | ||
</dialog> |
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 |
---|---|---|
|
@@ -71,6 +71,9 @@ | |
"local-link": { | ||
"argument": "" | ||
}, | ||
"modal": { | ||
"argument": "" | ||
}, | ||
"muted": { | ||
"argument": "" | ||
}, | ||
|
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