This throws off layout since all the text gets shifted down by 1px for focus rings that will never be drawn.
Chrome Version : 59.0.3047.0
>> 2. Less related to line-spacing specifically, but the text_bounds are not aligned to the "content_bounds"...from what I can tell. That ultimately increases what should be 8pt between title and body text to ~10px. Is this to be expected or is this related to the font-size and/or leading offset tables?
<quote>
I haven't dived in completely, but here's what I *think* is happening: That text is rendered with views::StyledLabel, which makes a views::Label for each line and a separate views::Link for each clickable link. views::Link is focusable, so it needs to draw a focus ring (except in Harmony, when it doesn't have one -- it gets an underline instead). That old-style focus ring causes views::Link to say "I need 1px more space", at
gfx::Insets Label::GetInsets() const {
gfx::Insets insets = View::GetInsets();
if (focus_behavior() != FocusBehavior::NEVER) {
insets += gfx::Insets(kFocusBorderPadding, kFocusBorderPadding,
kFocusBorderPadding, kFocusBorderPadding);
}
return insets;
}
kFocusBorderPadding is 1 DIP.
Then StyledLabel::CalculateAndDoLayout() notices that one of the rows needs more space, and makes room for it. I'm pretty sure this accounts for ay least some of the discrepancy - maybe all of it.
The fix should be straightforward. Since views::Label does not get a focus ring under Harmony, we just need to update Label::GetInsets() to account for that properly.
</quote>
"fix should be straightforward". He laughs. This is a bit of a rats nest..
I've made a start - https://codereview.chromium.org/2810403002
|
Deleted:
popup_view.png
18.6 KB
|
|
Deleted:
bookmark_signin_promo.png
18.0 KB
|
Comment 1 by bugdroid1@chromium.org
, Apr 21 2017