Closed Bug 1277207 Opened 10 years ago Closed 9 years ago

HTML Tooltip arrow is mis-positioned when using RTL direction

Categories

(DevTools :: Framework, defect, P1)

defect

Tracking

(firefox49 unaffected, firefox50 verified)

VERIFIED FIXED
Firefox 50
Iteration:
50.2 - Jul 4
Tracking Status
firefox49 --- unaffected
firefox50 --- verified

People

(Reporter: jdescottes, Assigned: bgrins)

References

Details

(Whiteboard: [devtools-html])

Attachments

(2 files)

The HTML Tooltip arrow is not correctly aligned with its anchor when using the RTL direction (tested with the forceRTL addon: https://addons.mozilla.org/en-US/firefox/addon/force-rtl/) STRs: - enable Tools "Force RTL direction" - go to https://www.mozilla.org/en-US/ - open inspector - hover an img tag in the markup view - wait for the image preview tooltip to be displayed ER: The tooltip arrow should be visible and should match the anchor AR: The tooltip arrow is sometimes hidden, and when visible, it is not aligned with the tooltip's anchor
Whiteboard: [devtools-html]
Whiteboard: [devtools-html] → [devtools-html] [triage]
Priority: -- → P3
Whiteboard: [devtools-html] [triage] → [devtools-html]
Priority: P3 → P2
Flags: qe-verify?
Priority: P2 → P1
Flags: qe-verify? → qe-verify+
QA Contact: alexandra.lucinet
Assignee: nobody → bgrinstead
Status: NEW → ASSIGNED
Iteration: --- → 50.2
I don't fully understand why this is needed, position:absolute flex children seem to behave a little oddly. I saw this post recently and wonder if it's related https://developers.google.com/web/updates/2016/06/absolute-positioned-children: "A previous version of the CSS Flexible Box Layout specification set the static position of absolute-positioned children as though they were a 0x0 flex item. The latest version of the spec takes them fully out of flow and sets the static position based on align and justify properties. At the time of this writing, Edge and Opera 39 for desktop and Android already support this."
(In reply to Brian Grinstead [:bgrins] from comment #3) > I don't fully understand why this is needed, position:absolute flex children > seem to behave a little oddly. I think this is because by default items are aligned to "flex-start", which is the "right" edge in RTL. To position the arrow a "left" offset is applied on the element. In RTL, this just pushes the arrow further outside of the container. With your patch the arrow element is aligned to the left even in RTL, so using a left offset works. Alternatively, we could align the tooltips to the right edge of the anchor in RTL and then we could offset the arrow element using margin-inline-start instead of left. (FWIW, today our XUL based tooltips are aligned to the left in LTR and RTL directions). I think your solution is the best for now because of the low footprint, given that the HTML tooltip implementation is still changing.
Comment on attachment 8764446 [details] Bug 1277207 - Show tooltip arrow in rtl locales; https://reviewboard.mozilla.org/r/60336/#review57212 Looks good to me, thanks! ::: devtools/client/themes/tooltips.css:163 (Diff revision 1) > overflow: hidden; > pointer-events: all; > flex-shrink: 0; > } > > +.tooltip-arrow:-moz-locale-dir(rtl) { (if you agree with my analysis in my previous comment) we could add a comment here to explain this is to compensate for the fact that we position the arrow using "left" which does not respect the orientation.
Attachment #8764446 - Flags: review?(jdescottes) → review+
(In reply to Julian Descottes [:jdescottes] from comment #5) > Comment on attachment 8764446 [details] > Bug 1277207 - Show tooltip arrow in rtl locales; > > https://reviewboard.mozilla.org/r/60336/#review57212 > > Looks good to me, thanks! > > ::: devtools/client/themes/tooltips.css:163 > (Diff revision 1) > > overflow: hidden; > > pointer-events: all; > > flex-shrink: 0; > > } > > > > +.tooltip-arrow:-moz-locale-dir(rtl) { > > (if you agree with my analysis in my previous comment) we could add a > comment here to explain this is to compensate for the fact that we position > the arrow using "left" which does not respect the orientation. Yeah, that sounds right. Added a comment in the patch
Pushed by cbook@mozilla.com: https://hg.mozilla.org/integration/fx-team/rev/b3a0f1a9ede7 Show tooltip arrow in rtl locales. r=jdescottes
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 50
It turns out FF49 was not affected. The markup containing the arrow changed at the beginning of FF50, when migrating the event details tooltip. This made the RTL fix necessary.
Confirming that everything looks as intended with latest Nightly 50.0a1, across platforms [1]. Although, logged bug 1285540 - Windows specific and present only on RTL builds. Marking here accordingly. [1] Windows 10 64-bit, Mac OS X 10.9.5, Ubuntu 14.04 x86
Status: RESOLVED → VERIFIED
Flags: qe-verify+
QA Whiteboard: [qe-dthtml]
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: