From 4958aa7c1b23ccee1c80effc9af88d04b1c40d0a Mon Sep 17 00:00:00 2001 From: Botond Ballo Date: Mon, 8 Jun 2015 16:01:26 -0400 Subject: [PATCH] Bug 1158424 - Rename FrameMetrics::mIsRoot to mIsRootContent. r=kats --HG-- extra : rebase_source : a082680d842dd182d899f637200ce911cc3c480d extra : source : 8b67f0b8dc96cebe9a58356708b23bebd8532134 --- dom/ipc/TabChild.cpp | 2 +- gfx/ipc/GfxMessageUtils.h | 4 ++-- gfx/layers/FrameMetrics.h | 16 ++++++++-------- gfx/layers/apz/public/GeckoContentController.h | 2 +- gfx/layers/apz/src/AsyncPanZoomController.cpp | 8 ++++---- gfx/layers/apz/util/ChromeProcessController.h | 2 +- gfx/tests/gtest/TestAsyncPanZoomController.cpp | 4 ++-- layout/base/nsDisplayList.cpp | 4 ++-- layout/base/nsLayoutUtils.cpp | 4 ++-- layout/generic/nsGfxScrollFrame.cpp | 8 ++++---- layout/ipc/RenderFrameParent.cpp | 6 +++--- 11 files changed, 30 insertions(+), 30 deletions(-) diff --git a/dom/ipc/TabChild.cpp b/dom/ipc/TabChild.cpp index b17208f8c154..838ba2fc42e4 100644 --- a/dom/ipc/TabChild.cpp +++ b/dom/ipc/TabChild.cpp @@ -545,7 +545,7 @@ TabChildBase::UpdateFrameHandler(const FrameMetrics& aFrameMetrics) { MOZ_ASSERT(aFrameMetrics.GetScrollId() != FrameMetrics::NULL_SCROLL_ID); - if (aFrameMetrics.GetIsRoot()) { + if (aFrameMetrics.IsRootContent()) { if (nsCOMPtr shell = GetPresShell()) { // Guard against stale updates (updates meant for a pres shell which // has since been torn down and destroyed). diff --git a/gfx/ipc/GfxMessageUtils.h b/gfx/ipc/GfxMessageUtils.h index 4704fa2f7c0b..d83dac7abda0 100644 --- a/gfx/ipc/GfxMessageUtils.h +++ b/gfx/ipc/GfxMessageUtils.h @@ -721,7 +721,7 @@ struct ParamTraits WriteParam(aMsg, aParam.mZoom); WriteParam(aMsg, aParam.mDevPixelsPerCSSPixel); WriteParam(aMsg, aParam.mPresShellId); - WriteParam(aMsg, aParam.mIsRoot); + WriteParam(aMsg, aParam.mIsRootContent); WriteParam(aMsg, aParam.mHasScrollgrab); WriteParam(aMsg, aParam.mUpdateScrollOffset); WriteParam(aMsg, aParam.mScrollGeneration); @@ -766,7 +766,7 @@ struct ParamTraits ReadParam(aMsg, aIter, &aResult->mZoom) && ReadParam(aMsg, aIter, &aResult->mDevPixelsPerCSSPixel) && ReadParam(aMsg, aIter, &aResult->mPresShellId) && - ReadParam(aMsg, aIter, &aResult->mIsRoot) && + ReadParam(aMsg, aIter, &aResult->mIsRootContent) && ReadParam(aMsg, aIter, &aResult->mHasScrollgrab) && ReadParam(aMsg, aIter, &aResult->mUpdateScrollOffset) && ReadParam(aMsg, aIter, &aResult->mScrollGeneration) && diff --git a/gfx/layers/FrameMetrics.h b/gfx/layers/FrameMetrics.h index f31c4adde318..b9dc4d6d8320 100644 --- a/gfx/layers/FrameMetrics.h +++ b/gfx/layers/FrameMetrics.h @@ -48,7 +48,7 @@ public: , mScrollableRect(0, 0, 0, 0) , mCumulativeResolution() , mDevPixelsPerCSSPixel(1) - , mIsRoot(false) + , mIsRootContent(false) , mHasScrollgrab(false) , mScrollId(NULL_SCROLL_ID) , mScrollParentId(NULL_SCROLL_ID) @@ -89,7 +89,7 @@ public: mCumulativeResolution == aOther.mCumulativeResolution && mDevPixelsPerCSSPixel == aOther.mDevPixelsPerCSSPixel && mPresShellId == aOther.mPresShellId && - mIsRoot == aOther.mIsRoot && + mIsRootContent == aOther.mIsRootContent && mScrollId == aOther.mScrollId && mScrollParentId == aOther.mScrollParentId && mScrollOffset == aOther.mScrollOffset && @@ -122,7 +122,7 @@ public: bool IsRootScrollable() const { - return mIsRoot; + return mIsRootContent; } bool IsScrollable() const @@ -298,14 +298,14 @@ public: return mDevPixelsPerCSSPixel; } - void SetIsRoot(bool aIsRoot) + void SetIsRootContent(bool aIsRootContent) { - mIsRoot = aIsRoot; + mIsRootContent = aIsRootContent; } - bool GetIsRoot() const + bool IsRootContent() const { - return mIsRoot; + return mIsRootContent; } void SetHasScrollgrab(bool aHasScrollgrab) @@ -626,7 +626,7 @@ private: CSSToLayoutDeviceScale mDevPixelsPerCSSPixel; // Whether or not this is the root scroll frame for the root content document. - bool mIsRoot; + bool mIsRootContent; // Whether or not this frame is for an element marked 'scrollgrab'. bool mHasScrollgrab; diff --git a/gfx/layers/apz/public/GeckoContentController.h b/gfx/layers/apz/public/GeckoContentController.h index 9756f8e95294..79db6c805d10 100644 --- a/gfx/layers/apz/public/GeckoContentController.h +++ b/gfx/layers/apz/public/GeckoContentController.h @@ -79,7 +79,7 @@ public: * |aContentRect| is in CSS pixels, relative to the current cssPage. * |aScrollableSize| is the current content width/height in CSS pixels. */ - virtual void SendAsyncScrollDOMEvent(bool aIsRoot, + virtual void SendAsyncScrollDOMEvent(bool aIsRootContent, const CSSRect &aContentRect, const CSSSize &aScrollableSize) = 0; diff --git a/gfx/layers/apz/src/AsyncPanZoomController.cpp b/gfx/layers/apz/src/AsyncPanZoomController.cpp index b8b3db877446..6ad33be4512a 100644 --- a/gfx/layers/apz/src/AsyncPanZoomController.cpp +++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp @@ -1433,7 +1433,7 @@ AsyncPanZoomController::GetScrollWheelDelta(const ScrollWheelInput& aEvent) cons MOZ_ASSERT_UNREACHABLE("unexpected scroll delta type"); } - if (mFrameMetrics.GetIsRoot() && gfxPrefs::MouseWheelHasRootScrollDeltaOverride()) { + if (mFrameMetrics.IsRootContent() && gfxPrefs::MouseWheelHasRootScrollDeltaOverride()) { // Only apply delta multipliers if we're increasing the delta. double hfactor = double(gfxPrefs::MouseWheelRootHScrollDeltaFactor()) / 100; double vfactor = double(gfxPrefs::MouseWheelRootVScrollDeltaFactor()) / 100; @@ -3190,19 +3190,19 @@ void AsyncPanZoomController::SendAsyncScrollEvent() { return; } - bool isRoot; + bool isRootContent; CSSRect contentRect; CSSSize scrollableSize; { ReentrantMonitorAutoEnter lock(mMonitor); - isRoot = mFrameMetrics.GetIsRoot(); + isRootContent = mFrameMetrics.IsRootContent(); scrollableSize = mFrameMetrics.GetScrollableRect().Size(); contentRect = mFrameMetrics.CalculateCompositedRectInCssPixels(); contentRect.MoveTo(mCurrentAsyncScrollOffset); } - controller->SendAsyncScrollDOMEvent(isRoot, contentRect, scrollableSize); + controller->SendAsyncScrollDOMEvent(isRootContent, contentRect, scrollableSize); } bool AsyncPanZoomController::Matches(const ScrollableLayerGuid& aGuid) diff --git a/gfx/layers/apz/util/ChromeProcessController.h b/gfx/layers/apz/util/ChromeProcessController.h index 19e301d1f3e9..500162ac698f 100644 --- a/gfx/layers/apz/util/ChromeProcessController.h +++ b/gfx/layers/apz/util/ChromeProcessController.h @@ -49,7 +49,7 @@ public: virtual void HandleLongTap(const mozilla::CSSPoint& aPoint, Modifiers aModifiers, const ScrollableLayerGuid& aGuid, uint64_t aInputBlockId) override; - virtual void SendAsyncScrollDOMEvent(bool aIsRoot, const mozilla::CSSRect &aContentRect, + virtual void SendAsyncScrollDOMEvent(bool aIsRootContent, const mozilla::CSSRect &aContentRect, const mozilla::CSSSize &aScrollableSize) override {} virtual void NotifyAPZStateChange(const ScrollableLayerGuid& aGuid, APZStateChange aChange, diff --git a/gfx/tests/gtest/TestAsyncPanZoomController.cpp b/gfx/tests/gtest/TestAsyncPanZoomController.cpp index b8e8aae3f351..8051f4cfe5a4 100644 --- a/gfx/tests/gtest/TestAsyncPanZoomController.cpp +++ b/gfx/tests/gtest/TestAsyncPanZoomController.cpp @@ -780,7 +780,7 @@ protected: fm.SetScrollOffset(CSSPoint(300, 300)); fm.SetZoom(CSSToParentLayerScale2D(2.0, 2.0)); // APZC only allows zooming on the root scrollable frame. - fm.SetIsRoot(true); + fm.SetIsRootContent(true); // the visible area of the document in CSS pixels is x=300 y=300 w=50 h=100 return fm; } @@ -921,7 +921,7 @@ TEST_F(APZCBasicTester, Overzoom) { fm.SetScrollableRect(CSSRect(0, 0, 125, 150)); fm.SetScrollOffset(CSSPoint(10, 0)); fm.SetZoom(CSSToParentLayerScale2D(1.0, 1.0)); - fm.SetIsRoot(true); + fm.SetIsRootContent(true); apzc->SetFrameMetrics(fm); MakeApzcZoomable(); diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index 4852f5884bae..2e65f85febd4 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -1582,7 +1582,7 @@ already_AddRefed nsDisplayList::PaintRoot(nsDisplayListBuilder* aB } if (addMetrics || ensureMetricsForRootId) { - bool isRoot = presContext->IsRootContentDocument(); + bool isRootContent = presContext->IsRootContentDocument(); nsRect viewport(aBuilder->ToReferenceFrame(frame), frame->GetSize()); @@ -1591,7 +1591,7 @@ already_AddRefed nsDisplayList::PaintRoot(nsDisplayListBuilder* aB rootScrollFrame, content, aBuilder->FindReferenceFrameFor(frame), root, FrameMetrics::NULL_SCROLL_ID, viewport, Nothing(), - isRoot, containerParameters)); + isRootContent, containerParameters)); } else { // Set empty metrics to clear any metrics that might be on a recycled layer. root->SetFrameMetrics(nsTArray()); diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp index fc550dc932e7..71ab13c3827e 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -8169,7 +8169,7 @@ nsLayoutUtils::ComputeFrameMetrics(nsIFrame* aForFrame, ViewID aScrollParentId, const nsRect& aViewport, const Maybe& aClipRect, - bool aIsRoot, + bool aIsRootContent, const ContainerLayerParameters& aContainerParameters) { nsPresContext* presContext = aForFrame->PresContext(); @@ -8248,7 +8248,7 @@ nsLayoutUtils::ComputeFrameMetrics(nsIFrame* aForFrame, // overscroll handoff chain. MOZ_ASSERT(aScrollParentId == FrameMetrics::NULL_SCROLL_ID || scrollId != aScrollParentId); metrics.SetScrollId(scrollId); - metrics.SetIsRoot(aIsRoot); + metrics.SetIsRootContent(aIsRootContent); metrics.SetScrollParentId(aScrollParentId); if (scrollId != FrameMetrics::NULL_SCROLL_ID && !presContext->GetParentPresContext()) { diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index 4f1856bd0661..04fa0cdbf955 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -3066,13 +3066,13 @@ ScrollFrameHelper::ComputeFrameMetrics(Layer* aLayer, } nsPoint toReferenceFrame = mOuter->GetOffsetToCrossDoc(aContainerReferenceFrame); - bool isRoot = mIsRoot && mOuter->PresContext()->IsRootContentDocument(); + bool isRootContent = mIsRoot && mOuter->PresContext()->IsRootContentDocument(); Maybe parentLayerClip; if (needsParentLayerClip) { nsRect clip = nsRect(mScrollPort.TopLeft() + toReferenceFrame, nsLayoutUtils::CalculateCompositionSizeForFrame(mOuter)); - if (isRoot) { + if (isRootContent) { double res = mOuter->PresContext()->PresShell()->GetResolution(); clip.width = NSToCoordRound(clip.width / res); clip.height = NSToCoordRound(clip.height / res); @@ -3089,7 +3089,7 @@ ScrollFrameHelper::ComputeFrameMetrics(Layer* aLayer, #if defined(MOZ_WIDGET_ANDROID) && !defined(MOZ_ANDROID_APZ) // Android without apzc (aka the java pan zoom code) only uses async scrolling // for the root scroll frame of the root content document. - if (!isRoot) { + if (!isRootContent) { thisScrollFrameUsesAsyncScrolling = false; } #endif @@ -3124,7 +3124,7 @@ ScrollFrameHelper::ComputeFrameMetrics(Layer* aLayer, nsLayoutUtils::ComputeFrameMetrics( mScrolledFrame, mOuter, mOuter->GetContent(), aContainerReferenceFrame, aLayer, mScrollParentID, - scrollport, parentLayerClip, isRoot, aParameters); + scrollport, parentLayerClip, isRootContent, aParameters); } bool diff --git a/layout/ipc/RenderFrameParent.cpp b/layout/ipc/RenderFrameParent.cpp index 4e47526d3e49..c15e64e53758 100644 --- a/layout/ipc/RenderFrameParent.cpp +++ b/layout/ipc/RenderFrameParent.cpp @@ -198,7 +198,7 @@ public: void ClearRenderFrame() { mRenderFrame = nullptr; } - virtual void SendAsyncScrollDOMEvent(bool aIsRoot, + virtual void SendAsyncScrollDOMEvent(bool aIsRootContent, const CSSRect& aContentRect, const CSSSize& aContentSize) override { @@ -207,10 +207,10 @@ public: FROM_HERE, NewRunnableMethod(this, &RemoteContentController::SendAsyncScrollDOMEvent, - aIsRoot, aContentRect, aContentSize)); + aIsRootContent, aContentRect, aContentSize)); return; } - if (mRenderFrame && aIsRoot) { + if (mRenderFrame && aIsRootContent) { TabParent* browser = TabParent::GetFrom(mRenderFrame->Manager()); BrowserElementParent::DispatchAsyncScrollEvent(browser, aContentRect, aContentSize);