mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 12:49:19 +00:00
LibWeb: Add PopOverInvokerElement and use it in HTMLButtonElement
The popoverTargetElement seems to be one of the only cases of a reflected Element? attribute in the HTML spec, the behaviour of which is specified in section 2.6.1. Buttons can't actually toggle popovers yet because showing/hiding popovers is not implemented yet.
This commit is contained in:
parent
158acabd21
commit
a276cf2d5e
Notes:
github-actions[bot]
2024-12-12 17:12:26 +00:00
Author: https://github.com/nbvdkamp
Commit: a276cf2d5e
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2542
Reviewed-by: https://github.com/tcl3 ✅
9 changed files with 97 additions and 2 deletions
29
Tests/LibWeb/Text/input/HTML/popover-invoker-attributes.html
Normal file
29
Tests/LibWeb/Text/input/HTML/popover-invoker-attributes.html
Normal file
|
@ -0,0 +1,29 @@
|
|||
<!DOCTYPE html>
|
||||
<button id="toggleButton" popovertarget="mypopover" popovertargetaction="toggle">Toggle the popover</button>
|
||||
<div id="mypopover" popover>Popover content</div>
|
||||
<script src="../include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
const button = document.getElementById("toggleButton");
|
||||
const div = document.getElementById("mypopover");
|
||||
|
||||
if (button.popoverTargetElement === div)
|
||||
println("PASS");
|
||||
|
||||
button.popoverTargetElement = null;
|
||||
if (button.popoverTargetElement === null)
|
||||
println("PASS");
|
||||
button.popoverTargetElement = div;
|
||||
if (button.popoverTargetElement === div)
|
||||
println("PASS");
|
||||
|
||||
|
||||
if (button.popoverTargetAction === "toggle")
|
||||
println("PASS");
|
||||
|
||||
button.popoverTargetAction = "invalid_value";
|
||||
|
||||
if (button.popoverTargetAction === "toggle")
|
||||
println("PASS");
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue