Closed Bug 1171011 Opened 9 years ago Closed 9 years ago

Some widget reftests don't account for differences in padding between HTML and XUL on GTK3

Categories

(Core :: Widget: Gtk, defect)

All
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla41
Tracking Status
firefox41 --- fixed

People

(Reporter: acomminos, Assigned: acomminos)

References

Details

Attachments

(1 file)

Many of the reftests in editor/reftests/xul/ fail due to the GTK3 drawing code avoiding padding on widgets when drawn in HTML vs. XUL.
In gtk3drawing.c we skip adding the GTK style padding to the widget border if a text entry field (MOZ_GTK_ENTRY) is in HTML. We don't do this in GTK2- but the GTK3 padding is probably more significant.

Thoughts, Karl? If the padding causes usability issues then we may want to just skip the tests on GTK3.
Status: NEW → ASSIGNED
Flags: needinfo?(karlt)
I think the reason why we didn't include padding in HTML is that it would be added to the document padding because forms.css sets 1 pixel padding on input elements and GetWidgetPadding() currently returns false.
https://bugzilla.mozilla.org/show_bug.cgi?id=1073117#c45

We can choose whether to use document padding or GTK theme padding, but we should not include both.  GTK theme padding may give a more consistent look.  Document padding gives the document more control but that is limited anyway because there is still the border.

I'd be inclined to look at making GetWidgetPadding return true for these widgets and include the padding from the GTK theme (through GetWidgetBorder).

Even if we want to use document padding in HTML, I'm not sure that XUL needs to be different.  Perhaps check the padding involved in the Show All Bookmarks window.

If you decide that XUL and HTML should be different, then please mark the tests failing instead of skipping them.  Then we'll notice that we have tests to re-enable if we later make XUL and HTML behave similarly.
Flags: needinfo?(karlt)
For now, it might be best to remove the double padding being applied in XUL (gtk padding + XUL document padding). This patch simply avoids adding GTK padding entirely for entry widgets, similar to the GTK2 implementation.
Attachment #8620493 - Flags: review?(karlt)
Comment on attachment 8620493 [details] [diff] [review]
Use only document padding for MOZ_GTK_ENTRY in XUL.

Fine with me.  Just check that Martin is happy with the change.

The bookmarks search field does add extra padding, so this seems sensible.
Attachment #8620493 - Flags: review?(stransky)
Attachment #8620493 - Flags: review?(karlt)
Attachment #8620493 - Flags: review+
Comment on attachment 8620493 [details] [diff] [review]
Use only document padding for MOZ_GTK_ENTRY in XUL.

Looks okay.
Attachment #8620493 - Flags: review?(stransky) → review+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/4a14c2cb4d1a
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: