RenderBoxModelObject.h defines overridingContainingBlockContentWidth() and overridingContainingBlockContentHeight(). Both of them return an Optional<LayoutUnit> apparently to deal with the case of not having an overriding size in the containing block. However the very same file also defines hasOverridingContainingBlockContentWidth() and hasOverridingContainingBlockContentHeight(). This means that there are multiple occurrences of: if (hasOverridingContainingBlockContentWidth()) if (auto width = overridingContainingBlockContentWidth()) return width.value(); duplicating the checks. We should figure out why that was done like this and remove the extra check if needed. Note that RenderBox.h replicates the same pattern with hasOverridingContainingBlockContentLogical{Height|Width}()
<rdar://problem/70823764>
This is probably not possible. The code wants to distinguish between nullopt as in "there is nothing set" and "there is something set but it is not a number": if (logicalHeight.isPercentOrCalculated() && hasOverridingContainingBlockContentLogicalHeight()) return overridingContainingBlockContentLogicalHeight() == WTF::nullopt; It may be possible to set some magic value not nullopt for "there is something set but it is not a number" but I don't think it is worth it personally.