Commit 3fcca5f0 authored by Ian Kilpatrick's avatar Ian Kilpatrick Committed by Commit Bot

[LayoutNG] Remove useless optional.

This was a mistake when I was initially writing this code.

Bug: 635619
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: Ic67f0dd0364c9a03724c626b61c56632c8fa6605
Reviewed-on: https://chromium-review.googlesource.com/600310Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491996}
parent 5769cefd
......@@ -152,10 +152,9 @@ LayoutUnit ComputeInlineSizeForUnpositionedFloat(
// the cached value.
if (unpositioned_float->layout_result) {
DCHECK(!is_same_writing_mode);
return NGFragment(parent_space->WritingMode(),
unpositioned_float->layout_result.value()
->PhysicalFragment()
.Get())
return NGFragment(
parent_space->WritingMode(),
unpositioned_float->layout_result->PhysicalFragment().Get())
.InlineSize();
}
......@@ -184,7 +183,7 @@ LayoutUnit ComputeInlineSizeForUnpositionedFloat(
unpositioned_float->node.Layout(space.Get());
const NGPhysicalFragment* fragment =
unpositioned_float->layout_result.value()->PhysicalFragment().Get();
unpositioned_float->layout_result->PhysicalFragment().Get();
DCHECK(fragment->BreakToken()->IsFinished());
......@@ -220,7 +219,7 @@ NGPositionedFloat PositionFloat(LayoutUnit origin_block_offset,
#if DCHECK_IS_ON()
DCHECK(!is_same_writing_mode);
#endif
layout_result = unpositioned_float->layout_result.value();
layout_result = unpositioned_float->layout_result;
} else {
#if DCHECK_IS_ON()
DCHECK(is_same_writing_mode);
......
......@@ -11,7 +11,6 @@
#include "core/layout/ng/ng_block_node.h"
#include "core/layout/ng/ng_exclusion.h"
#include "core/style/ComputedStyleConstants.h"
#include "platform/wtf/Optional.h"
#include "platform/wtf/RefPtr.h"
namespace blink {
......@@ -57,7 +56,7 @@ struct CORE_EXPORT NGUnpositionedFloat
// The layout result for this unpositioned float. This is only present if
// it's in a different writing mode than the BFC.
WTF::Optional<RefPtr<NGLayoutResult>> layout_result;
RefPtr<NGLayoutResult> layout_result;
bool IsLeft() const;
bool IsRight() const;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment