Closed Bug 948807 Opened 9 years ago Closed 9 years ago

UITour: Fix highlight position and clipping when a dimension is smaller than the minimum


(Firefox :: General, defect, P1)




Firefox 29


(Reporter: MattN, Assigned: MattN)



(Keywords: regression)


(2 files, 1 obsolete file)

This fixes two problems related to the min-height/width:
A) The min-height of the html:div isn't taken into effect for the panel's instrinsic size. => Switch to <xul:box>.
** There was a reason why I didn't switch to a XUL box before but I couldn't remember or find notes on why. It seems to be working fine now.

B) When the target of a highlight is smaller than the minimum size (32x32px), the highlight won't be centered because the "overlap" position for panels anchors from the top-left which isn't right when the highlight is larger than the target. In this case, I offset the panel by half of the difference between it's minimum size and the target size (only when the highlight is smaller than the minimum).
Attached patch v.1 Fix A and B (obsolete) — Splinter Review
Attachment #8345705 - Flags: review?(bmcbride)
Comment on attachment 8345705 [details] [diff] [review]
v.1 Fix A and B

Review of attachment 8345705 [details] [diff] [review]:

::: browser/modules/UITour.jsm
@@ +465,4 @@
>           for the wobble animation */
> +      let highlightStyle = aTargetEl.ownerDocument.defaultView.getComputedStyle(highlighter);
> +      let offsetX = -4 - (Math.max(0, parseFloat(highlightStyle.minWidth) - targetRect.width) / 2);
> +      let offsetY = -4 - (Math.max(0, parseFloat(highlightStyle.minHeight) - targetRect.height) / 2);

Nit: The -4 should be a const.
Attachment #8345705 - Flags: review?(bmcbride) → review+
(In reply to Blair McBride [:Unfocused] from comment #2)
> Nit: The -4 should be a const.

As discussed and reviewed on IRC, I made it calculate live with getComputedStyle like the other changes.
Attachment #8345705 - Attachment is obsolete: true
Attachment #8345723 - Flags: review+
Closed: 9 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 29
Duplicate of this bug: 943748
You need to log in before you can comment on or make changes to this bug.