Closed Bug 1171011 Opened 7 years ago Closed 7 years ago

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


(Core :: Widget: Gtk, defect)

Not set



Tracking Status
firefox41 --- fixed


(Reporter: acomminos, Assigned: acomminos)




(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.
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.

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
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
You need to log in before you can comment on or make changes to this bug.