зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1865995 p5. Rename GetContentViewerSize to match nsIDocumentViewer's new name. r=emilio,geckoview-reviewers,owlish
Includes the methods on: - nsIDOMWindowUtils - nsLayoutUtils - MVMContext Differential Revision: https://phabricator.services.mozilla.com/D194339
This commit is contained in:
Родитель
86414765b1
Коммит
90bd3e3cec
|
@ -410,12 +410,12 @@ nsDOMWindowUtils::UpdateLayerTree() {
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMWindowUtils::GetContentViewerSize(uint32_t* aDisplayWidth,
|
||||
uint32_t* aDisplayHeight) {
|
||||
nsDOMWindowUtils::GetDocumentViewerSize(uint32_t* aDisplayWidth,
|
||||
uint32_t* aDisplayHeight) {
|
||||
PresShell* presShell = GetPresShell();
|
||||
LayoutDeviceIntSize displaySize;
|
||||
|
||||
if (!presShell || !nsLayoutUtils::GetContentViewerSize(
|
||||
if (!presShell || !nsLayoutUtils::GetDocumentViewerSize(
|
||||
presShell->GetPresContext(), displaySize)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
|
|
@ -132,7 +132,7 @@ interface nsIDOMWindowUtils : nsISupports {
|
|||
/**
|
||||
* Information about the window size in device pixels.
|
||||
*/
|
||||
void getContentViewerSize(out uint32_t aDisplayWidth, out uint32_t aDisplayHeight);
|
||||
void getDocumentViewerSize(out uint32_t aDisplayWidth, out uint32_t aDisplayHeight);
|
||||
|
||||
/**
|
||||
* For any scrollable element, this allows you to override the default
|
||||
|
|
|
@ -72,7 +72,7 @@ class MockMVMContext : public MVMContext {
|
|||
LayoutDeviceMargin ScrollbarAreaToExcludeFromCompositionBounds() const {
|
||||
return LayoutDeviceMargin();
|
||||
}
|
||||
Maybe<LayoutDeviceIntSize> GetContentViewerSize() const {
|
||||
Maybe<LayoutDeviceIntSize> GetDocumentViewerSize() const {
|
||||
return Some(mDisplaySize);
|
||||
}
|
||||
bool AllowZoomingForDocument() const { return true; }
|
||||
|
|
|
@ -113,11 +113,11 @@ GeckoMVMContext::ScrollbarAreaToExcludeFromCompositionBounds() const {
|
|||
mPresShell->GetPresContext()->AppUnitsPerDevPixel());
|
||||
}
|
||||
|
||||
Maybe<LayoutDeviceIntSize> GeckoMVMContext::GetContentViewerSize() const {
|
||||
Maybe<LayoutDeviceIntSize> GeckoMVMContext::GetDocumentViewerSize() const {
|
||||
MOZ_ASSERT(mPresShell);
|
||||
LayoutDeviceIntSize result;
|
||||
if (nsLayoutUtils::GetContentViewerSize(mPresShell->GetPresContext(),
|
||||
result)) {
|
||||
if (nsLayoutUtils::GetDocumentViewerSize(mPresShell->GetPresContext(),
|
||||
result)) {
|
||||
return Some(result);
|
||||
}
|
||||
return Nothing();
|
||||
|
|
|
@ -45,7 +45,7 @@ class GeckoMVMContext final : public MVMContext {
|
|||
bool IsResolutionUpdatedByApz() const override;
|
||||
LayoutDeviceMargin ScrollbarAreaToExcludeFromCompositionBounds()
|
||||
const override;
|
||||
Maybe<LayoutDeviceIntSize> GetContentViewerSize() const override;
|
||||
Maybe<LayoutDeviceIntSize> GetDocumentViewerSize() const override;
|
||||
bool AllowZoomingForDocument() const override;
|
||||
bool IsInReaderMode() const override;
|
||||
bool IsDocumentLoading() const override;
|
||||
|
|
|
@ -49,7 +49,7 @@ class MVMContext {
|
|||
virtual bool IsResolutionUpdatedByApz() const = 0;
|
||||
virtual LayoutDeviceMargin ScrollbarAreaToExcludeFromCompositionBounds()
|
||||
const = 0;
|
||||
virtual Maybe<LayoutDeviceIntSize> GetContentViewerSize() const = 0;
|
||||
virtual Maybe<LayoutDeviceIntSize> GetDocumentViewerSize() const = 0;
|
||||
virtual bool AllowZoomingForDocument() const = 0;
|
||||
virtual bool IsInReaderMode() const = 0;
|
||||
virtual bool IsDocumentLoading() const = 0;
|
||||
|
|
|
@ -575,7 +575,7 @@ void MobileViewportManager::RefreshVisualViewportSize() {
|
|||
|
||||
void MobileViewportManager::UpdateSizesBeforeReflow() {
|
||||
if (Maybe<LayoutDeviceIntSize> newDisplaySize =
|
||||
mContext->GetContentViewerSize()) {
|
||||
mContext->GetDocumentViewerSize()) {
|
||||
mDisplaySize = *newDisplaySize;
|
||||
MVM_LOG("%p: Reflow starting, display size updated to %s\n", this,
|
||||
ToString(mDisplaySize).c_str());
|
||||
|
@ -615,7 +615,7 @@ void MobileViewportManager::RefreshViewportSize(bool aForceAdjustResolution) {
|
|||
|
||||
Maybe<float> displayWidthChangeRatio;
|
||||
if (Maybe<LayoutDeviceIntSize> newDisplaySize =
|
||||
mContext->GetContentViewerSize()) {
|
||||
mContext->GetDocumentViewerSize()) {
|
||||
// See the comment in UpdateResolutionForViewportSizeChange for why we're
|
||||
// doing this.
|
||||
if (mDisplaySize.width > 0) {
|
||||
|
|
|
@ -11449,7 +11449,7 @@ bool PresShell::DetermineFontSizeInflationState() {
|
|||
nsPresContext* topContext =
|
||||
mPresContext->GetInProcessRootContentDocumentPresContext();
|
||||
LayoutDeviceIntSize result;
|
||||
if (!nsLayoutUtils::GetContentViewerSize(topContext, result)) {
|
||||
if (!nsLayoutUtils::GetDocumentViewerSize(topContext, result)) {
|
||||
return false;
|
||||
}
|
||||
displaySize = Some(result);
|
||||
|
|
|
@ -213,8 +213,8 @@ void ZoomConstraintsClient::RefreshZoomConstraints() {
|
|||
}
|
||||
|
||||
LayoutDeviceIntSize screenSize;
|
||||
if (!nsLayoutUtils::GetContentViewerSize(mPresShell->GetPresContext(),
|
||||
screenSize)) {
|
||||
if (!nsLayoutUtils::GetDocumentViewerSize(mPresShell->GetPresContext(),
|
||||
screenSize)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -8321,7 +8321,7 @@ nsRect nsLayoutUtils::GetBoxShadowRectForFrame(nsIFrame* aFrame,
|
|||
}
|
||||
|
||||
/* static */
|
||||
bool nsLayoutUtils::GetContentViewerSize(
|
||||
bool nsLayoutUtils::GetDocumentViewerSize(
|
||||
const nsPresContext* aPresContext, LayoutDeviceIntSize& aOutSize,
|
||||
SubtractDynamicToolbar aSubtractDynamicToolbar) {
|
||||
nsCOMPtr<nsIDocShell> docShell = aPresContext->GetDocShell();
|
||||
|
@ -8391,8 +8391,8 @@ bool nsLayoutUtils::UpdateCompositionBoundsForRCDRSF(
|
|||
}
|
||||
|
||||
LayoutDeviceIntSize contentSize;
|
||||
if (!GetContentViewerSize(aPresContext, contentSize,
|
||||
shouldSubtractDynamicToolbar)) {
|
||||
if (!GetDocumentViewerSize(aPresContext, contentSize,
|
||||
shouldSubtractDynamicToolbar)) {
|
||||
return false;
|
||||
}
|
||||
aCompBounds.SizeTo(ViewAs<ParentLayerPixel>(
|
||||
|
@ -10082,7 +10082,7 @@ template <typename SizeType>
|
|||
if (RefPtr<MobileViewportManager> MVM =
|
||||
aPresContext->PresShell()->GetMobileViewportManager()) {
|
||||
displaySize = MVM->DisplaySize();
|
||||
} else if (!nsLayoutUtils::GetContentViewerSize(aPresContext, displaySize)) {
|
||||
} else if (!nsLayoutUtils::GetDocumentViewerSize(aPresContext, displaySize)) {
|
||||
return aSize;
|
||||
}
|
||||
|
||||
|
|
|
@ -2645,7 +2645,7 @@ class nsLayoutUtils {
|
|||
* otherwise.
|
||||
*/
|
||||
enum class SubtractDynamicToolbar { No, Yes };
|
||||
static bool GetContentViewerSize(
|
||||
static bool GetDocumentViewerSize(
|
||||
const nsPresContext* aPresContext, LayoutDeviceIntSize& aOutSize,
|
||||
SubtractDynamicToolbar = SubtractDynamicToolbar::Yes);
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ export class GeckoViewContentChild extends GeckoViewActorChild {
|
|||
const displaySize = {};
|
||||
const width = {},
|
||||
height = {};
|
||||
domWindowUtils.getContentViewerSize(width, height);
|
||||
domWindowUtils.getDocumentViewerSize(width, height);
|
||||
|
||||
displaySize.width = width.value;
|
||||
displaySize.height = height.value;
|
||||
|
|
|
@ -315,7 +315,7 @@ class ScrollPositionListener extends Handler {
|
|||
const displaySize = {};
|
||||
const width = {},
|
||||
height = {};
|
||||
domWindowUtils.getContentViewerSize(width, height);
|
||||
domWindowUtils.getDocumentViewerSize(width, height);
|
||||
|
||||
displaySize.width = width.value;
|
||||
displaySize.height = height.value;
|
||||
|
|
|
@ -203,8 +203,8 @@ static void GetZoom(BrowsingContext* aBrowsingContext,
|
|||
|
||||
LayoutDeviceIntSize displaySize;
|
||||
|
||||
if (!nsLayoutUtils::GetContentViewerSize(presShell->GetPresContext(),
|
||||
displaySize)) {
|
||||
if (!nsLayoutUtils::GetDocumentViewerSize(presShell->GetPresContext(),
|
||||
displaySize)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче