Bug 1009679 - Layerize the scrollbar thumb on desktop, too. r=roc

This commit is contained in:
Markus Stange 2014-05-14 14:33:52 +02:00
Родитель 4612689b18
Коммит 3ec8e6b5ec
6 изменённых файлов: 17 добавлений и 8 удалений

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

@ -1561,12 +1561,10 @@ GetAnimatedGeometryRootForFrame(nsIFrame* aFrame,
if (!parent)
break;
nsIAtom* parentType = parent->GetType();
#ifdef ANDROID
// Treat the slider thumb as being as an active scrolled root
// on mobile so that it can move without repainting.
// so that it can move without repainting.
if (parentType == nsGkAtoms::sliderFrame)
break;
#endif
// Sticky frames are active if their nearest scrollable frame
// is also active, just keep a record of sticky frames that we
// encounter for now.

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

@ -845,7 +845,7 @@ skip-if(B2G&&browserIsRemote) == 401946-1.xul about:blank # bug 974780
== 402567-1.html 402567-1-ref.html
== 402567-2.html 402567-2-ref.html
== 402567-3.html 402567-3-ref.html
skip-if(B2G) == 402567-4.html 402567-4-ref.html
skip-if(B2G) fuzzy-if(gtk2Widget,2,40) == 402567-4.html 402567-4-ref.html
== 402629-1.html 402629-1-ref.html
== 402629-2.html 402629-2-ref.html
== 402629-3.html 402629-3-ref.html

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

@ -17,7 +17,7 @@ random-if(d2d) == element-paint-transform-02.html element-paint-transform-02-ref
== element-paint-background-size-02.html element-paint-background-size-02-ref.html
== element-paint-transform-repeated.html element-paint-transform-repeated-ref.html
fuzzy-if(d2d,255,24) == element-paint-transform-03.html element-paint-transform-03-ref.html
== element-paint-native-widget.html element-paint-native-widget-ref.html
fuzzy-if(gtk2Widget,1,32) == element-paint-native-widget.html element-paint-native-widget-ref.html
== element-paint-subimage-sampling-restriction.html about:blank
== element-paint-clippath.html element-paint-clippath-ref.html
== element-paint-sharpness-01a.html element-paint-sharpness-01b.html

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

@ -3,7 +3,7 @@ skip-if(B2G) == ellipsis-font-fallback.html ellipsis-font-fallback-ref.html
skip-if(B2G) HTTP(..) == marker-basic.html marker-basic-ref.html
skip-if(B2G) HTTP(..) == marker-string.html marker-string-ref.html
skip-if(Android||B2G) HTTP(..) == bidi-simple.html bidi-simple-ref.html # Fails on Android due to anti-aliasing
skip-if(!gtk2Widget) HTTP(..) == bidi-simple-scrolled.html bidi-simple-scrolled-ref.html # Fails on Windows and OSX due to anti-aliasing
skip-if(!gtk2Widget) fuzzy-if(gtk2Widget,1,104) HTTP(..) == bidi-simple-scrolled.html bidi-simple-scrolled-ref.html # Fails on Windows and OSX due to anti-aliasing
skip-if(B2G) fuzzy-if(Android&&AndroidVersion<15,9,2545) fuzzy-if(Android&&AndroidVersion>=15,24,4000) HTTP(..) == scroll-rounding.html scroll-rounding-ref.html # bug 760264
fuzzy-if(OSX==10.8,1,1) HTTP(..) == anonymous-block.html anonymous-block-ref.html
skip-if(B2G) HTTP(..) == false-marker-overlap.html false-marker-overlap-ref.html

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

@ -664,11 +664,10 @@ nsSliderFrame::CurrentPositionChanged()
else
newThumbRect.y = clientRect.y + NSToCoordRound(pos * mRatio);
#ifdef MOZ_WIDGET_GONK
// avoid putting the scroll thumb at subpixel positions which cause needless invalidations
nscoord appUnitsPerPixel = PresContext()->AppUnitsPerDevPixel();
newThumbRect = newThumbRect.ToNearestPixels(appUnitsPerPixel).ToAppUnits(appUnitsPerPixel);
#endif
// set the rect
thumbFrame->SetRect(newThumbRect);

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

@ -3232,6 +3232,18 @@ nsNativeThemeCocoa::WidgetStateChanged(nsIFrame* aFrame, uint8_t aWidgetType,
aAttribute == nsGkAtoms::open ||
aAttribute == nsGkAtoms::hover)
*aShouldRepaint = true;
if ((aWidgetType == NS_THEME_SCROLLBAR ||
aWidgetType == NS_THEME_SCROLLBAR_SMALL) &&
!nsLookAndFeel::UseOverlayScrollbars() &&
(aAttribute == nsGkAtoms::curpos ||
aAttribute == nsGkAtoms::minpos ||
aAttribute == nsGkAtoms::maxpos ||
aAttribute == nsGkAtoms::pageincrement)) {
// Non-overlay scrollbars paint the thumb as part of the scrollbar,
// so we need to invalidate the scrollbar when the thumb moves.
*aShouldRepaint = true;
}
}
return NS_OK;