diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
commit | 6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch) | |
tree | a68f146d7fa01f0134297619fbe7e33db084e0aa /comm/mail/base/test/browser/files/paneSplitter.xhtml | |
parent | Initial commit. (diff) | |
download | thunderbird-upstream.tar.xz thunderbird-upstream.zip |
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | comm/mail/base/test/browser/files/paneSplitter.xhtml | 122 |
1 files changed, 122 insertions, 0 deletions
diff --git a/comm/mail/base/test/browser/files/paneSplitter.xhtml b/comm/mail/base/test/browser/files/paneSplitter.xhtml new file mode 100644 index 0000000000..7d25e5596e --- /dev/null +++ b/comm/mail/base/test/browser/files/paneSplitter.xhtml @@ -0,0 +1,122 @@ +<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> + <meta charset="utf-8" /> + <title>Test for the pane-splitter custom element</title> + <style> + hr[is="pane-splitter"] { + margin: 0 -3px; + border: none; + z-index: 1; + cursor: ew-resize; + opacity: .4; + background-color: red; + } + + #splitter3, + #splitter4 { + margin: -3px 0; + cursor: ns-resize; + } + + #horizontal-before { + display: grid; + grid-template-columns: minmax(auto, var(--splitter1-width)) 0 auto; + width: 500px; + height: 100px; + --splitter1-width: 200px; + margin: 1em; + } + + #horizontal-after { + display: grid; + grid-template-columns: auto 0 minmax(auto, var(--splitter2-width)); + width: 500px; + height: 100px; + --splitter2-width: 200px; + margin: 1em; + } + + #vertical-before { + display: inline-grid; + grid-template-rows: minmax(auto, var(--splitter3-height)) 0 auto; + width: 100px; + height: 500px; + --splitter3-height: 200px; + margin: 1em; + } + + #vertical-after { + display: inline-grid; + grid-template-rows: auto 0 minmax(auto, var(--splitter4-height)); + width: 100px; + height: 500px; + --splitter4-height: 200px; + margin: 1em; + } + + .resized { + background-color: lightblue; + } + + .fill { + background-color: lightslategrey; + } + </style> + <!-- This path is used for the automated test. --> + <script src="chrome://messenger/content/pane-splitter.js"></script> + <!-- This path is used when this file is loaded in a browser. --> + <script src="../../../content/widgets/pane-splitter.js"></script> + <script> + function moveMarker(event) { + let markerX = document.getElementById("markerX"); + markerX.style.left = `${event.clientX + window.scrollX}px`; + markerX.textContent = `${event.type} event here`; + + let markerY = document.getElementById("markerY"); + markerY.style.top = `${event.clientY + window.scrollY}px`; + markerY.textContent = `${event.type} event here`; + } + + document.addEventListener("mousedown", moveMarker); + document.addEventListener("mousemove", moveMarker); + document.addEventListener("mouseup", moveMarker); + + window.addEventListener("load", () => { + for (let splitter of document.querySelectorAll('hr[is="pane-splitter"]')) { + splitter.resizeElement = splitter.parentNode.querySelector(".resized"); + } + }); + </script> +</head> +<body> + <div id="horizontal-before"> + <div id="splitter1-before" class="resized"></div> + <hr is="pane-splitter" id="splitter1" resize-direction="horizontal" /> + <div id="splitter1-after" class="fill"></div> + </div> + + <div id="horizontal-after"> + <div id="splitter2-before" class="fill"></div> + <hr is="pane-splitter" id="splitter2" resize="next" resize-direction="horizontal" /> + <div id="splitter2-after" class="resized"></div> + </div> + + <div style="display: flex;"> + <div id="vertical-before"> + <div id="splitter3-before" class="resized"></div> + <hr is="pane-splitter" id="splitter3" /> + <div id="splitter3-after" class="fill"></div> + </div> + + <div id="vertical-after"> + <div id="splitter4-before" class="fill"></div> + <hr is="pane-splitter" id="splitter4" resize="next" /> + <div id="splitter4-after" class="resized"></div> + </div> + </div> + + <div id="markerX" style="position: absolute; top: 0px; border-left: 1px red solid;"></div> + <div id="markerY" style="position: absolute; left: 550px; border-top: 1px red solid;"></div> +</body> +</html> |