Last Comment Bug 989466 - urlbar-back-button-clip-path clips the location bar vertically depending on the font size and implied line height
: urlbar-back-button-clip-path clips the location bar vertically depending on t...
Status: VERIFIED FIXED
[Australis:P1]
: regression, verifyme
Product: Firefox
Classification: Client Software
Component: Theme (show other bugs)
: Trunk
: All All
-- normal (vote)
: Firefox 31
Assigned To: Mike de Boer [:mikedeboer]
:
: Dão Gottwald [:dao]
Mentors:
: 989819 (view as bug list)
Depends on: 989701
Blocks: australis-merge 477948 893661
  Show dependency treegraph
 
Reported: 2014-03-28 12:38 PDT by Cork
Modified: 2014-04-15 09:59 PDT (History)
11 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
verified
verified
verified


Attachments
screenshot (63.00 KB, image/png)
2014-03-28 12:38 PDT, Cork
no flags Details
2014-04-01 (7.05 KB, image/png)
2014-04-01 06:05 PDT, Cork
no flags Details
Patch v1: set a fixed line-height so GTK3 doesn't make it larger than the text size (837 bytes, patch)
2014-04-09 06:41 PDT, Mike de Boer [:mikedeboer]
dao+bmo: review-
Details | Diff | Splinter Review
Patch v2: revert clip-path change (1.58 KB, patch)
2014-04-11 05:37 PDT, Mike de Boer [:mikedeboer]
dao+bmo: review+
sledru: approval‑mozilla‑aurora+
sledru: approval‑mozilla‑beta+
Details | Diff | Splinter Review

Description User image Cork 2014-03-28 12:38:15 PDT
Created attachment 8398701 [details]
screenshot

After the landing of the keyhold back button the awesomebar top border is missing. It looks like the entire field is shifted up one px.
Comment 1 User image Mike de Boer [:mikedeboer] 2014-03-28 14:15:58 PDT
Setting n-i for myself, I'll try to reproduce this first asap. Thanks for reporting!
Comment 2 User image Michael Monreal [:monreal] 2014-03-30 04:57:07 PDT
May be related to bug #989701. I see the same on my system (using GNOME 3.12 default theme) but I noticed the whole box moves down as soon as the the forward button is shown. If that is the case, the top border is drawn.
Comment 3 User image Mike de Boer [:mikedeboer] 2014-04-01 05:21:22 PDT
Cork, since bug 989701 was resolved yesterday, I highly suspect that this has been resolved as well... can you check this for me?

In other words; can you still reproduce this issue with the latest nightly?
Comment 4 User image Cork 2014-04-01 05:24:32 PDT
I've live modified the css to match and I still have problems with the clip-path being too narrow. So i don't think it will solve it, but I'll test when the nightly comes out in ~an hour.

If i moved the margins around i just clip the bottom or the top border.
Comment 5 User image Cork 2014-04-01 06:05:21 PDT
Created attachment 8399971 [details]
2014-04-01

So, yes it is still cropped. clip-path: none !important; fixes the border problem though, so it looks like the svg path is to small.
Comment 6 User image Dão Gottwald [:dao] 2014-04-01 06:06:11 PDT
*** Bug 989819 has been marked as a duplicate of this bug. ***
Comment 7 User image :Gijs 2014-04-08 05:59:26 PDT
*** Bug 989819 has been marked as a duplicate of this bug. ***
Comment 8 User image Mike de Boer [:mikedeboer] 2014-04-09 06:41:22 PDT
Created attachment 8403975 [details] [diff] [review]
Patch v1: set a fixed line-height so GTK3 doesn't make it larger than the text size

Dão, for some reason, some GTK3 themes decide to add pixels to the line-height for text items of size 14.667 (default size, 1em) so it becomes 21px in practice.

Since I can't use `calc()` for `line-height` (bug 594933), I saw only one way out: hard-code the max value for `line-height` for the clip-path.

What do you think? Do you know of an alternative route we can take?
Comment 9 User image Mike de Boer [:mikedeboer] 2014-04-09 06:44:02 PDT
BTW, the Fedora GTK theme _does_ show this problem, with font 'Cantarell' (if that matters), but the Ubuntu GTK theme doesn't!
Comment 10 User image Dão Gottwald [:dao] 2014-04-10 01:20:05 PDT
Comment on attachment 8403975 [details] [diff] [review]
Patch v1: set a fixed line-height so GTK3 doesn't make it larger than the text size

This doesn't seem right at all, i.e. it won't handle different text sizes properly.

It seems that the clip path is wrong in assuming that the text field has a certain height...? I don't recall having seen this on Windows. Might be a recent regression from bug 893661?
Comment 11 User image Mike de Boer [:mikedeboer] 2014-04-10 01:24:46 PDT
(In reply to Dão Gottwald [:dao] from comment #10)
> It seems that the clip path is wrong in assuming that the text field has a
> certain height...? I don't recall having seen this on Windows. Might be a
> recent regression from bug 893661?

Yes, indeed, it very much seems like that. I thought this might've been a good 'hack' to get the keyhole landed sooner rather than later :/

I'll spend today on getting the clip-path back to its non-fixed size self.
Comment 12 User image Mike de Boer [:mikedeboer] 2014-04-10 03:37:58 PDT
What I feared kinda happened: http://i.imgur.com/XGuOF8i.png

So a growing urlbar text input makes the urlbar itself grow as well, which makes it larger than the forward button. This is not what we want, presumably, but I'm afraid I don't have a great idea on how to fix this... Do you, Dão?
Comment 13 User image Mike de Boer [:mikedeboer] 2014-04-10 04:03:08 PDT
I _could_ use a max-height instead of fiddling with the line-height as I did in my previous patch. Not sure if that would alleviate your concerns...
Comment 14 User image Mike de Boer [:mikedeboer] 2014-04-10 04:21:09 PDT
Scratch comment 13, this doesn't work - makes the whole navbar layout go bonkers. So, back to option 1: set line-height and live with that for now.
Comment 15 User image Dão Gottwald [:dao] 2014-04-10 04:58:53 PDT
(In reply to Mike de Boer [:mikedeboer] from comment #12)
> What I feared kinda happened: http://i.imgur.com/XGuOF8i.png
> 
> So a growing urlbar text input makes the urlbar itself grow as well, which
> makes it larger than the forward button. This is not what we want,
> presumably, but I'm afraid I don't have a great idea on how to fix this...
> Do you, Dão?

The forward button should grow to match the location bar, but that seems off-topic for this bug.
Comment 16 User image Mike de Boer [:mikedeboer] 2014-04-10 05:57:21 PDT
(In reply to Dão Gottwald [:dao] from comment #15)
> The forward button should grow to match the location bar, but that seems
> off-topic for this bug.

I'd like to reach something actionable here, so what do you suggest we do for this bug? I'd be happy to file a bug re. a growing forward button - but do bear in mind that it's not the `em` value that's different.

On Ubuntu and Fedora (Gnome3 default theme on both), the font-sizes are exactly the same - 1em = 14.667px - but they each use a different sans-serif font-family. "Ubuntu" on Ubuntu - quel surprise! - and "Cantarell" on Fedora (the default Gnome3 font).
It appears that Cantarell occupies more vertical space than strictly necessary - it's a font strictly optimized for small screen legibility - thus increasing the line-height more than the Ubuntu font.

I'm not a font expert enough to say that Cantarell is violating the sans-serif/ font-size vs. line-height rules for GUIs, but to me this does seem to be the case.

Alternatively, setting a fixed line-height of 1.3em also gets the job done, but that's not a whole lot different from 20px.
Comment 17 User image Dão Gottwald [:dao] 2014-04-10 06:43:09 PDT
(In reply to Mike de Boer [:mikedeboer] from comment #16)
> (In reply to Dão Gottwald [:dao] from comment #15)
> > The forward button should grow to match the location bar, but that seems
> > off-topic for this bug.
> 
> I'd like to reach something actionable here, so what do you suggest we do
> for this bug?

Fix up the clip path (undo the regression from bug 893661).

> On Ubuntu and Fedora (Gnome3 default theme on both), the font-sizes are
> exactly the same - 1em = 14.667px - but they each use a different sans-serif
> font-family. "Ubuntu" on Ubuntu - quel surprise! - and "Cantarell" on Fedora
> (the default Gnome3 font).
> It appears that Cantarell occupies more vertical space than strictly
> necessary - it's a font strictly optimized for small screen legibility -
> thus increasing the line-height more than the Ubuntu font.

This is a perfectly fine thing to do for a font.

> I'm not a font expert enough to say that Cantarell is violating the
> sans-serif/ font-size vs. line-height rules for GUIs, but to me this does
> seem to be the case.

There's no such rule that I know of.
Comment 18 User image Mike de Boer [:mikedeboer] 2014-04-10 06:49:09 PDT
Alright, on it.
Comment 19 User image Mike de Boer [:mikedeboer] 2014-04-10 07:24:51 PDT
(In reply to Dão Gottwald [:dao] from comment #17)
> Fix up the clip path (undo the regression from bug 893661).

*sigh*. When I 'fix' the clip-path, I can't work-around the bug I illustrated in the screenshot I made earlier http://i.imgur.com/XGuOF8i.png. The forward-button will always be one pixel too small re. height on Fedora.
Also, note that input fields on the navbar (urlbar and searchbar) are both 1px larger than the toolbarbuttons on Fedora (stock Gnome3), thus not aligning nicely.

This is has little to do with the clip-path anymore and I can't put up a patch that results in the screenshot above.

I'm tempted to move away from this bug as I'm out of ideas/ options.
Comment 20 User image Dão Gottwald [:dao] 2014-04-10 07:30:47 PDT
(In reply to Mike de Boer [:mikedeboer] from comment #19)
> This is has little to do with the clip-path anymore and I can't put up a
> patch that results in the screenshot above.

Yes, you can ;)
The border being cut off and the forward button being too short are separate bugs. The former just hides the latter at the moment and your patch will make it visible again.
Comment 21 User image Mike de Boer [:mikedeboer] 2014-04-10 08:28:20 PDT
(In reply to Dão Gottwald [:dao] from comment #20)
> Yes, you can ;)

Heh, ok... :)

> The border being cut off and the forward button being too short are separate
> bugs. The former just hides the latter at the moment and your patch will
> make it visible again.

I'm not convinced about that. How do you explain things looking a-ok on Ubuntu? And how do you explain that ALL buttons (not just the forward button) are 1px shorter (see quote below) than the URL bar AND search bar?

(In reply to Mike de Boer [:mikedeboer] from comment #19)
> Also, note that input fields on the navbar (urlbar and searchbar) are both
> 1px larger than the toolbarbuttons on Fedora (stock Gnome3), thus not
> aligning nicely.

Sorry for the spam... It's just that I don't understand things (apparently) and I get the feeling that we're talking past each other... let's fix that!
Comment 22 User image Dão Gottwald [:dao] 2014-04-10 08:34:35 PDT
(In reply to Mike de Boer [:mikedeboer] from comment #21)
> > The border being cut off and the forward button being too short are separate
> > bugs. The former just hides the latter at the moment and your patch will
> > make it visible again.
> 
> I'm not convinced about that. How do you explain things looking a-ok on
> Ubuntu?

It uses a font that occupies less space, as you discovered. The location bar is supposed to grow with larger fonts. It always did that. It still does it today, except that the clip-path is cutting it off as of bug 893661 (which means that this bug affects Windows too if you configure it to use a larger font size).

> And how do you explain that ALL buttons (not just the forward
> button) are 1px shorter (see quote below) than the URL bar AND search bar?

I haven't investigated this -- it seems even more off-topic than the forward button.
Comment 23 User image :Gijs 2014-04-10 16:25:38 PDT
(In reply to Dão Gottwald [:dao] from comment #22)
> (In reply to Mike de Boer [:mikedeboer] from comment #21)
> > > The border being cut off and the forward button being too short are separate
> > > bugs. The former just hides the latter at the moment and your patch will
> > > make it visible again.
> > 
> > I'm not convinced about that. How do you explain things looking a-ok on
> > Ubuntu?
> 
> It uses a font that occupies less space, as you discovered. The location bar
> is supposed to grow with larger fonts. It always did that. It still does it
> today, except that the clip-path is cutting it off as of bug 893661 (which
> means that this bug affects Windows too if you configure it to use a larger
> font size).

If this is really the case, do we need to back out bug 893661, at least on beta and/or aurora (or find a way to fix the clip path to not do this)?
Comment 24 User image Mike de Boer [:mikedeboer] 2014-04-11 01:35:31 PDT
(In reply to :Gijs Kruitbosch from comment #23)
> If this is really the case, do we need to back out bug 893661, at least on
> beta and/or aurora (or find a way to fix the clip path to not do this)?

That is a possibility. Yesterday I sent this email to Stephen:

> It appears that in bug 893661[2], Brandon changed your version of
> 'windows-urlbar-back-button-clip-path’ to something else without any reason
> (I checked and checked again, but no change. And I’m wearing glasses, even).
> However, your pièce de résistance, 'windows-keyhole-forward-clip-path’ did
> require some modification and so he did. But it doesn’t work on Linux anymore.
> 
> On top of that, both clip-paths break the url bar when you set a different
> font-size on both Windows and Linux.
> 
> My question to you: can you redo your 'windows-keyhole-forward-clip-path’,
> which looked like...
> 
> `m 0,0 c .3,.25 .3,.75, 0,1 l 1,0 0,-1 z`
> 
> … so that also scales nicely again?
>
> I’ll be restoring 'windows-urlbar-back-button-clip-path’ to its former glory.

As you can see, I'm asking him to update the `keyhole-forward-clip-path` to be scalable again and I found that the previous `back-button-clip-path` - also authored by Stephen during the previous Toronto workweek - can be restored without any regression.

After the SVG work is done, we're left with the forward button being 1px too small, vertically, and will look like http://i.imgur.com/XGuOF8i.png. The same goes for the other nav-bar buttons, but that's less problematic as the forward button is sealed against the urlbar, thus resulting in a very bad visual glitch.

My gut tells me that this'll end up being a platform/ core bug - a rounding error in font measurements of some sorts. Henceforth, my gut also tells me that due to time-pressure we'll end up using `line-height: 1.3em` for the urlbar and searchbar element.

Or we back-out the Linux keyhole, of course.

Either way, we need to sort all of this out ASAP.
Comment 25 User image Dão Gottwald [:dao] 2014-04-11 02:12:46 PDT
(In reply to :Gijs Kruitbosch from comment #23)
> If this is really the case, do we need to back out bug 893661, at least on
> beta and/or aurora (or find a way to fix the clip path to not do this)?

I think for now we can probably do a partial back out of just the clip path change. If this causes some sort of minor visual regression, that can be dealt with separately as a followup to bug 893661.

(In reply to Mike de Boer [:mikedeboer] from comment #24)
> My gut tells me that this'll end up being a platform/ core bug - a rounding
> error in font measurements of some sorts.

No, different fonts can come with different line heights. We just need to deal with that. This should be a no-brainer since we need to deal with different font sizes anyway (but currently don't, due to bug 893661).

> Henceforth, my gut also tells me
> that due to time-pressure we'll end up using `line-height: 1.3em` for the
> urlbar and searchbar element.

That's not going to take care of varying font-sizes.

> Or we back-out the Linux keyhole, of course.

That's not going to take care of the regression on Windows.
Comment 26 User image Mike de Boer [:mikedeboer] 2014-04-11 05:37:23 PDT
Created attachment 8405337 [details] [diff] [review]
Patch v2: revert clip-path change
Comment 27 User image Dão Gottwald [:dao] 2014-04-11 07:15:56 PDT
Comment on attachment 8405337 [details] [diff] [review]
Patch v2: revert clip-path change

Did you see a problem with keyhole-forward-clip-path? Reverting urlbar-back-button-clip-path should be sufficient for this bug, right? Though if it's similarly unclear why keyhole-forward-clip-path was changed in the first place, maybe it's best to revert that as well.
Comment 28 User image :Gijs 2014-04-11 07:43:14 PDT
I'm not sure this can safely be partially backed out, because the original patch also changed paddings on the icon, ie the size of the back/fwd buttons. Reverting only the clip path would, I presume, make the clip path and the size of the icon (including padding etc.) mismatch. It's possible this isn't the case, but it'd surprise me.
Comment 29 User image Mike de Boer [:mikedeboer] 2014-04-11 08:14:16 PDT
(In reply to Dão Gottwald [:dao] from comment #27)
> Did you see a problem with keyhole-forward-clip-path? Reverting
> urlbar-back-button-clip-path should be sufficient for this bug, right?
> Though if it's similarly unclear why keyhole-forward-clip-path was changed
> in the first place, maybe it's best to revert that as well.

I saw a problem with both clip paths, unfortunately, also on Windows with larger font settings.
Comment 30 User image Mike de Boer [:mikedeboer] 2014-04-11 08:28:55 PDT
Thanks gents!

https://hg.mozilla.org/integration/fx-team/rev/4ea7310a26ee
Comment 31 User image Dão Gottwald [:dao] 2014-04-11 10:06:02 PDT
Filed bug 995300 on the forward button.
Comment 32 User image Ryan VanderMeulen [:RyanVM] 2014-04-11 13:21:39 PDT
https://hg.mozilla.org/mozilla-central/rev/4ea7310a26ee
Comment 33 User image Mike de Boer [:mikedeboer] 2014-04-11 15:55:57 PDT
Comment on attachment 8405337 [details] [diff] [review]
Patch v2: revert clip-path change

[Approval Request Comment]
Bug caused by (feature/regressing bug #): bug 893661 and brought to light by bug 477948
User impact if declined:

User will not see the bottom border of the urlbar on certain Gnome 3 themes, because it gets clipped by an SVG clip-path. This patch reverts the clip-paths to what they were before 893661.

Testing completed (on m-c, etc.): landed on m-c.
Risk to taking this patch (and alternatives if risky):

there will be a slight visual glitch on Windows, because one clip-path still needs adjustment.

String or IDL/UUID changes made by this patch: n/a.
Comment 35 User image Cork 2014-04-15 09:20:47 PDT
Verified fixed in (linux):
https://hg.mozilla.org/mozilla-central/rev/5b6e82e7bbbf
https://hg.mozilla.org/releases/mozilla-aurora/rev/f14047fa8d63

ff29 doesn't have the new button layout in linux so can't test there. (leaving verify me for windows)
Comment 36 User image :Gijs 2014-04-15 09:23:05 PDT
(In reply to Cork from comment #35)
> Verified fixed in (linux):
> https://hg.mozilla.org/mozilla-central/rev/5b6e82e7bbbf
> https://hg.mozilla.org/releases/mozilla-aurora/rev/f14047fa8d63
> 
> ff29 doesn't have the new button layout in linux so can't test there.
> (leaving verify me for windows)

Can you try the beta 8 build from https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/29.0b8/ ? This should have the new button layout, AIUI...
Comment 37 User image Cork 2014-04-15 09:25:37 PDT
Verified fixed in (linux):
https://hg.mozilla.org/releases/mozilla-beta/rev/3a4f085a6398

Note You need to log in before you can comment on or make changes to this bug.