Changeset 192724 in webkit
- Timestamp:
- Nov 21, 2015 9:00:00 AM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r192723 r192724 1 2015-11-21 Michael Catanzaro <mcatanzaro@igalia.com> 2 3 [GTK] Off-by-one error in getStyleContext() 4 https://bugs.webkit.org/show_bug.cgi?id=151524 5 6 Reviewed by Carlos Garcia Campos. 7 8 GtkWidgetPath* path = gtk_widget_path_new(); 9 gtk_widget_path_append_type(path, widgetType); 10 // ... 11 gtk_widget_path_iter_add_class(path, 0, GTK_STYLE_CLASS_BUTTON); 12 gtk_widget_path_iter_add_class(path, 1, "text-button"); 13 14 Only one widget type was appended to the widget path, so the maximum valid index is 0. This 15 code means to add both style classes to the first widget type in the widget path, so the 16 second call should use index 0 rather than index 1. 17 18 This caused no bug in practice, because when the index is invalid, 19 gtk_widget_path_iter_add_class() automatically changes the index to the last valid position 20 in the widget path -- in this case, 0. This is routinely done with -1 as a convention for 21 specifying the last position in the widget path. 22 23 * rendering/RenderThemeGtk.cpp: 24 (WebCore::getStyleContext): 25 1 26 2015-11-21 Michael Catanzaro <mcatanzaro@igalia.com> 2 27 -
trunk/Source/WebCore/rendering/RenderThemeGtk.cpp
r192723 r192724 176 176 else if (widgetType == GTK_TYPE_BUTTON) { 177 177 gtk_widget_path_iter_add_class(path, 0, GTK_STYLE_CLASS_BUTTON); 178 gtk_widget_path_iter_add_class(path, 1, "text-button");178 gtk_widget_path_iter_add_class(path, 0, "text-button"); 179 179 } else if (widgetType == GTK_TYPE_SCALE) 180 180 gtk_widget_path_iter_add_class(path, 0, GTK_STYLE_CLASS_SCALE);
Note: See TracChangeset
for help on using the changeset viewer.