-
-
Notifications
You must be signed in to change notification settings - Fork 1.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 popovertarget buttons
- Loading branch information
Showing
14 changed files
with
192 additions
and
14 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
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
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,27 @@ | ||
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 784x17 children: inline | ||
frag 0 from BlockContainer start: 0, length: 0, rect: [13,19 0x0] baseline: 4 | ||
BlockContainer <button#button> at (13,19) content-size 0x0 inline-block [BFC] children: not-inline | ||
BlockContainer <(anonymous)> at (13,19) content-size 0x0 flex-container(column) [FFC] children: not-inline | ||
BlockContainer <(anonymous)> at (13,19) content-size 0x0 [BFC] children: not-inline | ||
TextNode <#text> | ||
TextNode <#text> | ||
TextNode <#text> | ||
BlockContainer <div#pop> at (358.84375,291.5) content-size 82.3125x17 positioned [BFC] children: inline | ||
TextNode <#text> | ||
InlineNode <span> | ||
frag 0 from TextNode start: 0, length: 10, rect: [358.84375,291.5 82.3125x17] baseline: 13.296875 | ||
"I'm a node" | ||
TextNode <#text> | ||
TextNode <#text> | ||
|
||
ViewportPaintable (Viewport<#document>) [0,0 800x600] | ||
PaintableWithLines (BlockContainer<HTML>) [0,0 800x600] | ||
PaintableWithLines (BlockContainer<BODY>) [8,8 784x17] | ||
PaintableWithLines (BlockContainer<BUTTON>#button) [8,17 10x4] | ||
PaintableWithLines (BlockContainer(anonymous)) [13,19 0x0] | ||
PaintableWithLines (BlockContainer(anonymous)) [13,19 0x0] | ||
PaintableWithLines (BlockContainer<DIV>#pop) [351.84375,284.5 96.3125x31] | ||
PaintableWithLines (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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<button popovertarget="pop" id="button"></button> | ||
<div popover id="pop"> | ||
<span>I'm a node</span> | ||
</div> | ||
|
||
<script> | ||
document.addEventListener("DOMContentLoaded", () => { | ||
let button = document.getElementById('button'); | ||
const rect = button.getBoundingClientRect(); | ||
internals.click(rect.x + rect.width / 2, rect.y + rect.height / 2); | ||
}); | ||
</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,2 @@ | ||
Didn't crash when showing recently hidden popover | ||
Didn't crash when removing visible popover |
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,14 @@ | ||
<!DOCTYPE html> | ||
<script src="include.js"></script> | ||
<div popover id="pop"></div> | ||
<script> | ||
test(() => { | ||
const pop = document.getElementById("pop"); | ||
pop.showPopover(); | ||
pop.hidePopover(); | ||
pop.showPopover(); | ||
println("Didn't crash when showing recently hidden popover"); | ||
pop.remove(); | ||
println("Didn't crash when removing visible popover") | ||
}); | ||
</script> |