[layout] Always reserve 64 bits for frame property value

This ensures frame property values can always be stored even in edge cases
on 32-bit machines (where a void ptr is half the width).
This commit is contained in:
Moonchild 2025-02-18 21:42:59 +01:00 committed by roytam1
commit cc8e336172
2 changed files with 45 additions and 59 deletions

View file

@ -225,7 +225,7 @@ nsContainerFrame::DestroyFrom(nsIFrame* aDestructRoot)
if (MOZ_UNLIKELY(!mProperties.IsEmpty())) {
using T = mozilla::FrameProperties::UntypedDescriptor;
bool hasO = false, hasOC = false, hasEOC = false, hasBackdrop = false;
mProperties.ForEach([&] (const T& aProp, void*) {
mProperties.ForEach([&] (const T& aProp, uint64_t) {
if (aProp == OverflowProperty()) {
hasO = true;
} else if (aProp == OverflowContainersProperty()) {
@ -306,20 +306,20 @@ nsContainerFrame::GetChildLists(nsTArray<ChildList>* aLists) const
{
mFrames.AppendIfNonempty(aLists, kPrincipalList);
using T = mozilla::FrameProperties::UntypedDescriptor;
mProperties.ForEach([this, aLists] (const T& aProp, void* aValue) {
mProperties.ForEach([this, aLists] (const T& aProp, uint64_t aValue) {
typedef const nsFrameList* L;
if (aProp == OverflowProperty()) {
L(aValue)->AppendIfNonempty(aLists, kOverflowList);
reinterpret_cast<L>(aValue)->AppendIfNonempty(aLists, kOverflowList);
} else if (aProp == OverflowContainersProperty()) {
MOZ_ASSERT(IsFrameOfType(nsIFrame::eCanContainOverflowContainers),
"found unexpected OverflowContainersProperty");
L(aValue)->AppendIfNonempty(aLists, kOverflowContainersList);
reinterpret_cast<L>(aValue)->AppendIfNonempty(aLists, kOverflowContainersList);
} else if (aProp == ExcessOverflowContainersProperty()) {
MOZ_ASSERT(IsFrameOfType(nsIFrame::eCanContainOverflowContainers),
"found unexpected ExcessOverflowContainersProperty");
L(aValue)->AppendIfNonempty(aLists, kExcessOverflowContainersList);
reinterpret_cast<L>(aValue)->AppendIfNonempty(aLists, kExcessOverflowContainersList);
} else if (aProp == BackdropProperty()) {
L(aValue)->AppendIfNonempty(aLists, kBackdropList);
reinterpret_cast<L>(aValue)->AppendIfNonempty(aLists, kBackdropList);
}
return true;
});