mirror of
https://github.com/akvorado/akvorado.git
synced 2025-12-11 22:14:02 +01:00
Some checks failed
CI / 🤖 Check dependabot status (push) Has been cancelled
CI / 🐧 Test on Linux (${{ github.ref_type == 'tag' }}, misc) (push) Has been cancelled
CI / 🐧 Test on Linux (coverage) (push) Has been cancelled
CI / 🐧 Test on Linux (regular) (push) Has been cancelled
CI / ❄️ Build on Nix (push) Has been cancelled
CI / 🍏 Build and test on macOS (push) Has been cancelled
CI / 🧪 End-to-end testing (push) Has been cancelled
CI / 🔍 Upload code coverage (push) Has been cancelled
CI / 🔬 Test only Go (push) Has been cancelled
CI / 🔬 Test only JS (${{ needs.dependabot.outputs.package-ecosystem }}, 20) (push) Has been cancelled
CI / 🔬 Test only JS (${{ needs.dependabot.outputs.package-ecosystem }}, 22) (push) Has been cancelled
CI / 🔬 Test only JS (${{ needs.dependabot.outputs.package-ecosystem }}, 24) (push) Has been cancelled
CI / ⚖️ Check licenses (push) Has been cancelled
CI / 🐋 Build Docker images (push) Has been cancelled
CI / 🐋 Tag Docker images (push) Has been cancelled
CI / 🚀 Publish release (push) Has been cancelled
See https://github.com/codemirror/view/pull/74
65 lines
3.6 KiB
Diff
65 lines
3.6 KiB
Diff
diff --git a/dist/index.cjs b/dist/index.cjs
|
|
index e9ca104998a1db31cc19c797d1e8a450a5807073..2c7462a21d4e55c5b867c0d00d32a933d605b0c4 100644
|
|
--- a/dist/index.cjs
|
|
+++ b/dist/index.cjs
|
|
@@ -10033,17 +10033,16 @@ const tooltipPlugin = ViewPlugin.fromClass(class {
|
|
let scaleX = 1, scaleY = 1, makeAbsolute = false;
|
|
if (this.position == "fixed" && this.manager.tooltipViews.length) {
|
|
let { dom } = this.manager.tooltipViews[0];
|
|
- if (browser.gecko) {
|
|
- // Firefox sets the element's `offsetParent` to the
|
|
- // transformed element when a transform interferes with fixed
|
|
- // positioning.
|
|
- makeAbsolute = dom.offsetParent != this.container.ownerDocument.body;
|
|
- }
|
|
- else if (dom.style.top == Outside && dom.style.left == "0px") {
|
|
- // On other browsers, we have to awkwardly try and use other
|
|
- // information to detect a transform.
|
|
- let rect = dom.getBoundingClientRect();
|
|
- makeAbsolute = Math.abs(rect.top + 10000) > 1 || Math.abs(rect.left) > 1;
|
|
+ if (browser.safari) {
|
|
+ // Safari always sets offsetParent to null, even if a fixed
|
|
+ // element is positioned relative to a transformed parent. So
|
|
+ // we use this kludge to try and detect this.
|
|
+ let rect = dom.getBoundingClientRect()
|
|
+ makeAbsolute = Math.abs(rect.top + 10000) > 1 || Math.abs(rect.left) > 1
|
|
+ } else {
|
|
+ // More conforming browsers will set offsetParent to the
|
|
+ // transformed element.
|
|
+ makeAbsolute = !!dom.offsetParent && dom.offsetParent != this.container.ownerDocument.body
|
|
}
|
|
}
|
|
if (makeAbsolute || this.position == "absolute") {
|
|
diff --git a/dist/index.js b/dist/index.js
|
|
index 7915cd285c08b6bf3f221872ff98006bef30fc66..d386d5519add1def97668014fec28891ee75f849 100644
|
|
--- a/dist/index.js
|
|
+++ b/dist/index.js
|
|
@@ -10028,17 +10028,16 @@ const tooltipPlugin = /*@__PURE__*/ViewPlugin.fromClass(class {
|
|
let scaleX = 1, scaleY = 1, makeAbsolute = false;
|
|
if (this.position == "fixed" && this.manager.tooltipViews.length) {
|
|
let { dom } = this.manager.tooltipViews[0];
|
|
- if (browser.gecko) {
|
|
- // Firefox sets the element's `offsetParent` to the
|
|
- // transformed element when a transform interferes with fixed
|
|
- // positioning.
|
|
- makeAbsolute = dom.offsetParent != this.container.ownerDocument.body;
|
|
- }
|
|
- else if (dom.style.top == Outside && dom.style.left == "0px") {
|
|
- // On other browsers, we have to awkwardly try and use other
|
|
- // information to detect a transform.
|
|
- let rect = dom.getBoundingClientRect();
|
|
- makeAbsolute = Math.abs(rect.top + 10000) > 1 || Math.abs(rect.left) > 1;
|
|
+ if (browser.safari) {
|
|
+ // Safari always sets offsetParent to null, even if a fixed
|
|
+ // element is positioned relative to a transformed parent. So
|
|
+ // we use this kludge to try and detect this.
|
|
+ let rect = dom.getBoundingClientRect()
|
|
+ makeAbsolute = Math.abs(rect.top + 10000) > 1 || Math.abs(rect.left) > 1
|
|
+ } else {
|
|
+ // More conforming browsers will set offsetParent to the
|
|
+ // transformed element.
|
|
+ makeAbsolute = !!dom.offsetParent && dom.offsetParent != this.container.ownerDocument.body
|
|
}
|
|
}
|
|
if (makeAbsolute || this.position == "absolute") {
|