From a5c7e03dbdc754996c76a32a9c7d157bd5c938de Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Sun, 26 Jul 2020 01:17:00 +0100 Subject: fix(gerrit): fix hovercards under Firefox Firefox doesn't implement the IE6 fromElement/toElement, and it's not in the MouseEvent spec (at the moment). Replace with the worse-named but better-specified target and relatedTarget attributes instead. Upstream change: https://gerrit-review.googlesource.com/q/I9eeb26c032a38de9d7185749373c7982c796acb2 Change-Id: I9f9a1eb9342bc80b91b5b364a04cc5fa9a7ccaeb Reviewed-on: https://cl.tvl.fyi/c/depot/+/1442 Tested-by: BuildkiteCI Reviewed-by: glittershark --- ...7-Fix-gr-hovercard-behavior-under-Firefox.patch | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 third_party/gerrit/0007-Fix-gr-hovercard-behavior-under-Firefox.patch (limited to 'third_party/gerrit/0007-Fix-gr-hovercard-behavior-under-Firefox.patch') diff --git a/third_party/gerrit/0007-Fix-gr-hovercard-behavior-under-Firefox.patch b/third_party/gerrit/0007-Fix-gr-hovercard-behavior-under-Firefox.patch new file mode 100644 index 0000000000..715c70d701 --- /dev/null +++ b/third_party/gerrit/0007-Fix-gr-hovercard-behavior-under-Firefox.patch @@ -0,0 +1,35 @@ +From 460d4806feef7fdddc8e3b63dec4fa1854fd2561 Mon Sep 17 00:00:00 2001 +From: Luke Granger-Brown +Date: Sat, 25 Jul 2020 23:54:18 +0000 +Subject: [PATCH 7/7] Fix gr-hovercard-behavior under Firefox + +Firefox doesn't implement toElement/fromElement (they're not in the +spec, and were implemented by Chrome apparently for compatibility with +IE), but does implement target and relatedTarget, which are part of +the UI Events spec +(https://w3c.github.io/uievents/#interface-mouseevent). + +Bug: Issue 13175 +Change-Id: I9eeb26c032a38de9d7185749373c7982c796acb2 +--- + .../app/elements/shared/gr-hovercard/gr-hovercard-behavior.js | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/polygerrit-ui/app/elements/shared/gr-hovercard/gr-hovercard-behavior.js b/polygerrit-ui/app/elements/shared/gr-hovercard/gr-hovercard-behavior.js +index 04c3166dd5..3d5937b1fa 100644 +--- a/polygerrit-ui/app/elements/shared/gr-hovercard/gr-hovercard-behavior.js ++++ b/polygerrit-ui/app/elements/shared/gr-hovercard/gr-hovercard-behavior.js +@@ -209,8 +209,8 @@ export const hovercardBehaviorMixin = superClass => class extends superClass { + // from the hovercard but now hovering over the target (to stop an annoying + // flicker effect), just return. + if (opt_e) { +- if (opt_e.toElement === this || +- (opt_e.fromElement === this && opt_e.toElement === this._target)) { ++ if (opt_e.relatedTarget === this || ++ (opt_e.target === this && opt_e.relatedTarget === this._target)) { + return; + } + } +-- +2.27.0 + -- cgit 1.4.1