bug 1272194 explicitly invalidate after change style contexts belonging to widgets r=stransky+263117

This fixes menu item rendering during hover.

MozReview-Commit-ID: CEa6aorqBZM

--HG--
extra : rebase_source : 19b1d4f26541b8b5a435252552352592791c080d
This commit is contained in:
Karl Tomlinson 2016-05-17 18:15:12 +12:00
Родитель 5fe070aa8f
Коммит 49d29c5bf9
2 изменённых файлов: 23 добавлений и 2 удалений

Просмотреть файл

@ -280,13 +280,32 @@ GtkStyleContext*
ClaimStyleContext(WidgetNodeType aNodeType, GtkTextDirection aDirection,
GtkStateFlags aStateFlags, StyleFlags aFlags)
{
MOZ_ASSERT(!sStyleContextNeedsRestore);
GtkStyleContext* style = GetStyleInternal(aNodeType);
#ifdef DEBUG
MOZ_ASSERT(!sCurrentStyleContext);
sCurrentStyleContext = style;
#endif
gtk_style_context_set_state(style, aStateFlags);
gtk_style_context_set_direction(style, aDirection);
GtkStateFlags oldState = gtk_style_context_get_state(style);
GtkTextDirection oldDirection = gtk_style_context_get_direction(style);
if (oldState != aStateFlags || oldDirection != aDirection) {
// From GTK 3.8, set_state() will overwrite the direction, so set
// direction after state.
gtk_style_context_set_state(style, aStateFlags);
gtk_style_context_set_direction(style, aDirection);
// This invalidate is necessary for unsaved style contexts from GtkWidgets
// in pre-3.18 GTK, because automatic invalidation of such contexts
// was delayed until a resize event runs.
//
// https://bugzilla.mozilla.org/show_bug.cgi?id=1272194#c7
//
// Avoid calling invalidate on saved contexts to avoid performing
// build_properties() (in 3.16 stylecontext.c) unnecessarily early.
if (!sStyleContextNeedsRestore) {
gtk_style_context_invalidate(style);
}
}
return style;
}

Просмотреть файл

@ -548,6 +548,7 @@ STUB(gtk_style_context_get_background_color)
STUB(gtk_style_context_get_border)
STUB(gtk_style_context_get_border_color)
STUB(gtk_style_context_get_color)
STUB(gtk_style_context_get_direction)
STUB(gtk_style_context_get_margin)
STUB(gtk_style_context_get_padding)
STUB(gtk_style_context_get_path)
@ -555,6 +556,7 @@ STUB(gtk_style_context_get_property)
STUB(gtk_style_context_get_state)
STUB(gtk_style_context_get_style)
STUB(gtk_style_context_has_class)
STUB(gtk_style_context_invalidate)
STUB(gtk_style_context_new)
STUB(gtk_style_context_remove_class)
STUB(gtk_style_context_remove_region)