/* 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/. */
// We only fire visual viewport events and don't want to cause any explicit // reflows here since in general we don't use the up-to-date visual viewport // size for layout. if (auto* window = nsGlobalWindowInner::Cast(mDocument->GetInnerWindow())) {
window->VisualViewport()->PostResizeEvent();
}
}
void GeckoMVMContext::UpdateDisplayPortMargins() {
MOZ_ASSERT(mPresShell); if (ScrollContainerFrame* root = mPresShell->GetRootScrollContainerFrame()) {
nsIContent* content = root->GetContent(); bool hasDisplayPort = DisplayPortUtils::HasNonMinimalDisplayPort(content); bool hasResolution = mPresShell->GetResolution() != 1.0f; if (!hasDisplayPort && !hasResolution) { // We only want to update the displayport if there is one already, or // add one if there's a resolution on the document (see bug 1225508 // comment 1). return;
}
nsRect displayportBase = nsRect(
nsPoint(0, 0), nsLayoutUtils::CalculateCompositionSizeForFrame(root)); // We only create MobileViewportManager for root content documents. If that // ever changes we'd need to limit the size of this displayport base rect // because non-toplevel documents have no limit on their size.
MOZ_ASSERT(
mPresShell->GetPresContext()->IsRootContentDocumentCrossProcess());
DisplayPortUtils::SetDisplayPortBaseIfNotSet(content, displayportBase);
DisplayPortUtils::CalculateAndSetDisplayPortMargins(
root, DisplayPortUtils::RepaintMode::Repaint);
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.