зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1760880 - Push document resolution in initial cache. r=morgan
Testing this is hard because the point of failure would be if we recieved NotifyOfResolutionChange before the IPC doc is constructed. Differential Revision: https://phabricator.services.mozilla.com/D141904
This commit is contained in:
Родитель
2c0c956707
Коммит
ced0d9770b
|
@ -3366,6 +3366,15 @@ already_AddRefed<AccAttributes> LocalAccessible::BundleFieldsForCache(
|
|||
mStateFlags &= ~eOldFrameHasValidTransformStyle;
|
||||
}
|
||||
}
|
||||
|
||||
if (IsDoc()) {
|
||||
if (PresShell* presShell = AsDoc()->PresShellPtr()) {
|
||||
// Send the initial resolution of the document. When this changes, we
|
||||
// will ne notified via nsAS::NotifyOfResolutionChange
|
||||
float resolution = presShell->GetResolution();
|
||||
fields->SetAttribute(nsGkAtoms::resolution, resolution);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return fields.forget();
|
||||
|
|
|
@ -423,6 +423,7 @@ LayoutDeviceIntRect RemoteAccessibleBase<Derived>::Bounds() const {
|
|||
// be scaled relative to its parent doc.
|
||||
res = remoteAcc->AsDoc()->mCachedFields->GetAttribute<float>(
|
||||
nsGkAtoms::resolution);
|
||||
MOZ_ASSERT(res, "No cached document resolution found.");
|
||||
bounds.ScaleRoundOut(res.valueOr(1.0f));
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче