Bug 1158424 - Rename FrameMetrics::mIsRoot to mIsRootContent. r=kats

--HG--
extra : rebase_source : a082680d842dd182d899f637200ce911cc3c480d
extra : source : 8b67f0b8dc96cebe9a58356708b23bebd8532134
This commit is contained in:
Botond Ballo 2015-06-08 16:01:26 -04:00
Родитель 7841b7b822
Коммит 4958aa7c1b
11 изменённых файлов: 30 добавлений и 30 удалений

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

@ -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<nsIPresShell> shell = GetPresShell()) {
// Guard against stale updates (updates meant for a pres shell which
// has since been torn down and destroyed).

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

@ -721,7 +721,7 @@ struct ParamTraits<mozilla::layers::FrameMetrics>
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<mozilla::layers::FrameMetrics>
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) &&

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

@ -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;

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

@ -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;

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

@ -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)

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

@ -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,

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

@ -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();

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

@ -1582,7 +1582,7 @@ already_AddRefed<LayerManager> 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<LayerManager> 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<FrameMetrics>());

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

@ -8169,7 +8169,7 @@ nsLayoutUtils::ComputeFrameMetrics(nsIFrame* aForFrame,
ViewID aScrollParentId,
const nsRect& aViewport,
const Maybe<nsRect>& 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()) {

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

@ -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<nsRect> 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

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

@ -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);