-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
www.virustotal.com - The hover tooltip appears offset from it's location #53295
Comments
Thanks for the report @wesinator. I was indeed able to reproduce the issue. The tooltip was not displayed next to the corresponding field. Tested with: This is the web page displayed in Firefox Nightly: And this is the web page displayed in Chrome: Moving the issue to needsdiagnosis. |
Position of the tooltip is being calculated in this function: n.prototype.updatePosition = function () {
if (this._target && this.offsetParent) {
var t,
n,
e = this.offset,
i = this.offsetParent.getBoundingClientRect(),
o = this._target.getBoundingClientRect(),
r = this.getBoundingClientRect(),
a = (o.width - r.width) / 2,
s = (o.height - r.height) / 2,
c = o.left - i.left,
l = o.top - i.top;
switch (this.position) {
case 'top':
t = c + a,
n = l - r.height - e;
break;
case 'bottom':
t = c + a,
n = l + o.height + e;
break;
case 'left':
t = c - r.width - e,
n = l + s;
break;
case 'right':
t = c + o.width + e,
n = l + s
}
this.fitToVisibleBounds ? (i.left + t + r.width > window.innerWidth ? (this.style.right = '0px', this.style.left = 'auto') : (this.style.left = Math.max(0, t) + 'px', this.style.right = 'auto'), i.top + n + r.height > window.innerHeight ? (this.style.bottom = i.height + 'px', this.style.top = 'auto') : (this.style.top = Math.max( - i.top, n) + 'px', this.style.bottom = 'auto')) : (this.style.left = t + 'px', this.style.top = n + 'px')
}
}, The difference between Firefox and Chrome seems to be that I think that Firefox behaviour is correct, since offsetParent shouldn't leak a node inside a shadow tree, according to w3c/csswg-drafts#159. Safari behaves the same as Firefox here. There is a bug open to align Blink's behaviour https://bugs.chromium.org/p/chromium/issues/detail?id=920069 to match Gecko and Webkit, so I think we can close this as a duplicate |
Thanks - so the Chrome behaviour is unexpected for the browser, then isn't the site code wrong ?! Anyway |
Good point @wesinator. Yeah, the site is relying on Chrome's behaviour here, which technically isn't correct according to the spec. I'll try to contact the site as eventually when https://bugs.chromium.org/p/chromium/issues/detail?id=920069 gets fixed, the tooltip will be displayed in the wrong position in Chrome as well |
Reached out through the contact form here https://www.virustotal.com/gui/contact-us |
The issue seems to be fixed. The tooltip is positioned correctly now. Tested with: @wesinator can you still reproduce it? |
URL: https://www.virustotal.com/gui/file/04d91d62c7ff6e1c1fcd0e9c534184df72925539dbd58322046f5dff61e75ea3/detection
Browser / Version: Firefox 76.0
Operating System: Mac OS X 10.14
Tested Another Browser: Yes Chrome
Problem type: Something else
Description: Hover tooltip appears offset from location in Firefox
Steps to Reproduce:
Hover mouse over a red AV detection entry, such as
The custom hover tooltip in Chrome is displayed next to the entry, in Firefox it displays further down the page, disconnected from the entry.
View the screenshot
Browser Configuration
From webcompat.com with ❤️
The text was updated successfully, but these errors were encountered: