Bug 1442767 - Rename Box to RectAbsolute (Gecko changes). r=kats

MozReview-Commit-ID: 1wrzwQw8bdx

--HG--
rename : gfx/src/nsCoordBox.h => gfx/src/nsRectAbsolute.h
extra : rebase_source : ec71a9add57c07887cb37f2d105390072e13d98d
This commit is contained in:
Botond Ballo 2018-03-05 18:08:18 -05:00
Родитель 74cd005201
Коммит b4385a3fda
10 изменённых файлов: 50 добавлений и 51 удалений

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

@ -192,8 +192,8 @@ public:
mFixedPositionData->mSides = aSides;
return true;
}
bool SetStickyPositionData(FrameMetrics::ViewID aScrollId, LayerBox aOuter,
LayerBox aInner)
bool SetStickyPositionData(FrameMetrics::ViewID aScrollId,
LayerRectAbsolute aOuter, LayerRectAbsolute aInner)
{
if (mStickyPositionData &&
mStickyPositionData->mOuter.IsEqualEdges(aOuter) &&
@ -290,10 +290,10 @@ public:
FrameMetrics::ViewID StickyScrollContainerId() const {
return mStickyPositionData->mScrollId;
}
const LayerBox& StickyScrollRangeOuter() const {
const LayerRectAbsolute& StickyScrollRangeOuter() const {
return mStickyPositionData->mOuter;
}
const LayerBox& StickyScrollRangeInner() const {
const LayerRectAbsolute& StickyScrollRangeInner() const {
return mStickyPositionData->mInner;
}
@ -337,8 +337,8 @@ private:
struct StickyPositionData {
FrameMetrics::ViewID mScrollId;
LayerBox mOuter;
LayerBox mInner;
LayerRectAbsolute mOuter;
LayerRectAbsolute mInner;
};
Maybe<StickyPositionData> mStickyPositionData;

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

@ -1271,8 +1271,8 @@ public:
* dimension, while that component of the scroll position lies within either
* interval, the layer should not move relative to its scrolling container.
*/
void SetStickyPositionData(FrameMetrics::ViewID aScrollId, LayerBox aOuter,
LayerBox aInner)
void SetStickyPositionData(FrameMetrics::ViewID aScrollId,
LayerRectAbsolute aOuter, LayerRectAbsolute aInner)
{
if (mSimpleAttrs.SetStickyPositionData(aScrollId, aOuter, aInner)) {
MOZ_LAYERS_LOG_IF_SHADOWABLE(this, ("Layer::Mutated(%p) StickyPositionData", this));
@ -1360,8 +1360,8 @@ public:
LayerPoint GetFixedPositionAnchor() { return mSimpleAttrs.FixedPositionAnchor(); }
int32_t GetFixedPositionSides() { return mSimpleAttrs.FixedPositionSides(); }
FrameMetrics::ViewID GetStickyScrollContainerId() { return mSimpleAttrs.StickyScrollContainerId(); }
const LayerBox& GetStickyScrollRangeOuter() { return mSimpleAttrs.StickyScrollRangeOuter(); }
const LayerBox& GetStickyScrollRangeInner() { return mSimpleAttrs.StickyScrollRangeInner(); }
const LayerRectAbsolute& GetStickyScrollRangeOuter() { return mSimpleAttrs.StickyScrollRangeOuter(); }
const LayerRectAbsolute& GetStickyScrollRangeInner() { return mSimpleAttrs.StickyScrollRangeInner(); }
FrameMetrics::ViewID GetScrollbarTargetContainerId() { return mSimpleAttrs.ScrollbarTargetContainerId(); }
const ScrollThumbData& GetScrollThumbData() const { return mSimpleAttrs.ThumbData(); }
bool IsScrollbarContainer() { return mSimpleAttrs.GetScrollbarContainerDirection().isSome(); }

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

@ -532,8 +532,8 @@ AsyncCompositionManager::AlignFixedAndStickyLayers(Layer* aTransformedSubtreeRoo
// the layer should not move relative to the scroll container. To
// accomplish this, we limit each dimension of the |translation| to that
// part of it which overlaps those intervals.
const LayerBox& stickyOuter = layer->GetStickyScrollRangeOuter();
const LayerBox& stickyInner = layer->GetStickyScrollRangeInner();
const LayerRectAbsolute& stickyOuter = layer->GetStickyScrollRangeOuter();
const LayerRectAbsolute& stickyInner = layer->GetStickyScrollRangeInner();
LayerPoint originalTranslation = translation;
translation.y = IntervalOverlap(translation.y, stickyOuter.Y(), stickyOuter.YMost()) -

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

@ -23,7 +23,6 @@ EXPORTS += [
'nsColorNameList.h',
'nsColorNames.h',
'nsCoord.h',
'nsCoordBox.h',
'nsDeviceContext.h',
'nsFont.h',
'nsFontMetrics.h',
@ -32,6 +31,7 @@ EXPORTS += [
'nsMargin.h',
'nsPoint.h',
'nsRect.h',
'nsRectAbsolute.h',
'nsRegion.h',
'nsRegionFwd.h',
'nsSize.h',

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

@ -1,24 +0,0 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef NSCOORDBOX_H
#define NSCOORDBOX_H
#include "mozilla/gfx/Box.h"
#include "nsCoord.h"
#include "nsRect.h"
// Would like to call this nsBox, but can't because nsBox is a frame type.
struct nsCoordBox :
public mozilla::gfx::BaseBox<nscoord, nsCoordBox, nsRect> {
typedef mozilla::gfx::BaseBox<nscoord, nsCoordBox, nsRect> Super;
nsCoordBox() : Super() {}
nsCoordBox(nscoord aX1, nscoord aY1, nscoord aX2, nscoord aY2) :
Super(aX1, aY1, aX2, aY2) {}
};
#endif /* NSCOORDBOX_H */

23
gfx/src/nsRectAbsolute.h Normal file
Просмотреть файл

@ -0,0 +1,23 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef NSRECTABSOLUTE_H
#define NSRECTABSOLUTE_H
#include "mozilla/gfx/RectAbsolute.h"
#include "nsCoord.h"
#include "nsRect.h"
struct nsRectAbsolute :
public mozilla::gfx::BaseRectAbsolute<nscoord, nsRectAbsolute, nsRect> {
typedef mozilla::gfx::BaseRectAbsolute<nscoord, nsRectAbsolute, nsRect> Super;
nsRectAbsolute() : Super() {}
nsRectAbsolute(nscoord aX1, nscoord aY1, nscoord aX2, nscoord aY2) :
Super(aX1, aY1, aX2, aY2) {}
};
#endif /* NSRECTABSOLUTE_H */

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

@ -7,10 +7,10 @@
#ifndef MOZ_UNITS_H_
#define MOZ_UNITS_H_
#include "mozilla/gfx/Box.h"
#include "mozilla/gfx/Coord.h"
#include "mozilla/gfx/Point.h"
#include "mozilla/gfx/Rect.h"
#include "mozilla/gfx/RectAbsolute.h"
#include "mozilla/gfx/ScaleFactor.h"
#include "mozilla/gfx/ScaleFactors2D.h"
#include "nsMargin.h"
@ -75,8 +75,8 @@ typedef gfx::PointTyped<LayerPixel> LayerPoint;
typedef gfx::IntPointTyped<LayerPixel> LayerIntPoint;
typedef gfx::SizeTyped<LayerPixel> LayerSize;
typedef gfx::IntSizeTyped<LayerPixel> LayerIntSize;
typedef gfx::BoxTyped<LayerPixel> LayerBox;
typedef gfx::RectTyped<LayerPixel> LayerRect;
typedef gfx::RectAbsoluteTyped<LayerPixel> LayerRectAbsolute;
typedef gfx::IntRectTyped<LayerPixel> LayerIntRect;
typedef gfx::MarginTyped<LayerPixel> LayerMargin;
typedef gfx::IntMarginTyped<LayerPixel> LayerIntMargin;

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

@ -279,8 +279,8 @@ StickyScrollContainer::ComputePosition(nsIFrame* aFrame) const
}
void
StickyScrollContainer::GetScrollRanges(nsIFrame* aFrame, nsCoordBox* aOuter,
nsCoordBox* aInner) const
StickyScrollContainer::GetScrollRanges(nsIFrame* aFrame, nsRectAbsolute* aOuter,
nsRectAbsolute* aInner) const
{
// We need to use the first in flow; continuation frames should not move
// relative to each other and should get identical scroll ranges.
@ -292,8 +292,8 @@ StickyScrollContainer::GetScrollRanges(nsIFrame* aFrame, nsCoordBox* aOuter,
nsRect containRect;
ComputeStickyLimits(firstCont, &stickRect, &containRect);
nsCoordBox stick = nsCoordBox::FromRect(stickRect);
nsCoordBox contain = nsCoordBox::FromRect(containRect);
nsRectAbsolute stick = nsRectAbsolute::FromRect(stickRect);
nsRectAbsolute contain = nsRectAbsolute::FromRect(containRect);
aOuter->SetBox(gUnboundedNegative, gUnboundedNegative, gUnboundedPositive, gUnboundedPositive);
aInner->SetBox(gUnboundedNegative, gUnboundedNegative, gUnboundedPositive, gUnboundedPositive);

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

@ -12,8 +12,8 @@
#ifndef StickyScrollContainer_h
#define StickyScrollContainer_h
#include "nsCoordBox.h"
#include "nsPoint.h"
#include "nsRectAbsolute.h"
#include "nsTArray.h"
#include "nsIScrollPositionListener.h"
@ -68,7 +68,7 @@ public:
* Compute where a frame should not scroll with the page, represented by the
* difference of two rectangles.
*/
void GetScrollRanges(nsIFrame* aFrame, nsCoordBox* aOuter, nsCoordBox* aInner) const;
void GetScrollRanges(nsIFrame* aFrame, nsRectAbsolute* aOuter, nsRectAbsolute* aInner) const;
/**
* Compute and set the position of a frame and its following continuations.

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

@ -7556,10 +7556,10 @@ nsDisplayStickyPosition::BuildLayer(nsDisplayListBuilder* aBuilder,
stickyScrollContainer->ScrollFrame()->GetScrolledFrame()->GetContent());
float factor = presContext->AppUnitsPerDevPixel();
nsCoordBox outer;
nsCoordBox inner;
nsRectAbsolute outer;
nsRectAbsolute inner;
stickyScrollContainer->GetScrollRanges(mFrame, &outer, &inner);
LayerBox stickyOuter(NSAppUnitsToFloatPixels(outer.X(), factor) *
LayerRectAbsolute stickyOuter(NSAppUnitsToFloatPixels(outer.X(), factor) *
aContainerParameters.mXScale,
NSAppUnitsToFloatPixels(outer.Y(), factor) *
aContainerParameters.mYScale,
@ -7567,7 +7567,7 @@ nsDisplayStickyPosition::BuildLayer(nsDisplayListBuilder* aBuilder,
aContainerParameters.mXScale,
NSAppUnitsToFloatPixels(outer.YMost(), factor) *
aContainerParameters.mYScale);
LayerBox stickyInner(NSAppUnitsToFloatPixels(inner.X(), factor) *
LayerRectAbsolute stickyInner(NSAppUnitsToFloatPixels(inner.X(), factor) *
aContainerParameters.mXScale,
NSAppUnitsToFloatPixels(inner.Y(), factor) *
aContainerParameters.mYScale,
@ -7633,8 +7633,8 @@ nsDisplayStickyPosition::CreateWebRenderCommands(mozilla::wr::DisplayListBuilder
wr::StickyOffsetBounds hBounds = { 0.0, 0.0 };
nsPoint appliedOffset;
nsCoordBox outer;
nsCoordBox inner;
nsRectAbsolute outer;
nsRectAbsolute inner;
stickyScrollContainer->GetScrollRanges(mFrame, &outer, &inner);
nsIFrame* scrollFrame = do_QueryFrame(stickyScrollContainer->ScrollFrame());