Bug 1018461 - Allow active scrolling inside SVG. Should give a big tscrollx win. r=roc

This commit is contained in:
Markus Stange 2014-06-03 15:55:58 +02:00
parent 32b64d307f
commit c58035b973

View File

@ -1798,22 +1798,9 @@ static void AdjustViews(nsIFrame* aFrame)
}
static bool
CanScrollWithBlitting(nsIFrame* aFrame)
NeedToInvalidateOnScroll(nsIFrame* aFrame)
{
if (aFrame->GetStateBits() & NS_SCROLLFRAME_INVALIDATE_CONTENTS_ON_SCROLL)
return false;
for (nsIFrame* f = aFrame; f;
f = nsLayoutUtils::GetCrossDocParentFrame(f)) {
if (nsSVGIntegrationUtils::UsingEffectsForFrame(f) ||
f->IsFrameOfType(nsIFrame::eSVG) ||
f->GetStateBits() & NS_FRAME_NO_COMPONENT_ALPHA) {
return false;
}
if (nsLayoutUtils::IsPopup(f))
break;
}
return true;
return (aFrame->GetStateBits() & NS_SCROLLFRAME_INVALIDATE_CONTENTS_ON_SCROLL) != 0;
}
bool ScrollFrameHelper::IsIgnoringViewportClipping() const
@ -1900,14 +1887,12 @@ void ScrollFrameHelper::ScrollVisual(nsPoint aOldScrolledFramePos)
AdjustViews(mScrolledFrame);
// We need to call this after fixing up the view positions
// to be consistent with the frame hierarchy.
bool canScrollWithBlitting = CanScrollWithBlitting(mOuter);
bool needToInvalidateOnScroll = NeedToInvalidateOnScroll(mOuter);
mOuter->RemoveStateBits(NS_SCROLLFRAME_INVALIDATE_CONTENTS_ON_SCROLL);
if (IsScrollingActive()) {
if (!canScrollWithBlitting) {
MarkInactive();
}
if (IsScrollingActive() && needToInvalidateOnScroll) {
MarkInactive();
}
if (canScrollWithBlitting) {
if (!needToInvalidateOnScroll) {
MarkActive();
}
@ -2422,7 +2407,7 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder,
if (aBuilder->IsPaintingToWindow()) {
mScrollPosAtLastPaint = GetScrollPosition();
if (IsScrollingActive() && !CanScrollWithBlitting(mOuter)) {
if (IsScrollingActive() && NeedToInvalidateOnScroll(mOuter)) {
MarkInactive();
}
if (IsScrollingActive()) {