mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 1563163 Part 1: Make Flex::Flex gracefully handle frames without FlexContainerInfo structures. r=mats
Differential Revision: https://phabricator.services.mozilla.com/D44283 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
2bdd678c48
commit
9521ad6e9c
@ -29,8 +29,13 @@ Flex::Flex(Element* aParent, nsFlexContainerFrame* aFrame) : mParent(aParent) {
|
||||
// going to keep it around.
|
||||
const ComputedFlexContainerInfo* containerInfo =
|
||||
aFrame->GetFlexContainerInfo();
|
||||
MOZ_ASSERT(containerInfo, "Should only be passed a frame with info.");
|
||||
|
||||
if (!containerInfo) {
|
||||
// It's weird but possible to fail to get a ComputedFlexContainerInfo
|
||||
// structure. Assign sensible default values.
|
||||
mMainAxisDirection = FlexPhysicalDirection::Horizontal_lr;
|
||||
mCrossAxisDirection = FlexPhysicalDirection::Vertical_tb;
|
||||
return;
|
||||
}
|
||||
mLines.SetLength(containerInfo->mLines.Length());
|
||||
uint32_t index = 0;
|
||||
for (auto&& l : containerInfo->mLines) {
|
||||
|
Loading…
Reference in New Issue
Block a user