diff options
Diffstat (limited to 'chromium/third_party/blink/renderer/core/layout/ng/list/layout_ng_outside_list_marker.cc')
-rw-r--r-- | chromium/third_party/blink/renderer/core/layout/ng/list/layout_ng_outside_list_marker.cc | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/chromium/third_party/blink/renderer/core/layout/ng/list/layout_ng_outside_list_marker.cc b/chromium/third_party/blink/renderer/core/layout/ng/list/layout_ng_outside_list_marker.cc new file mode 100644 index 00000000000..4507904c341 --- /dev/null +++ b/chromium/third_party/blink/renderer/core/layout/ng/list/layout_ng_outside_list_marker.cc @@ -0,0 +1,41 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "third_party/blink/renderer/core/layout/ng/list/layout_ng_outside_list_marker.h" + +#include "third_party/blink/renderer/core/layout/layout_text.h" + +namespace blink { + +LayoutNGOutsideListMarker::LayoutNGOutsideListMarker(Element* element) + : LayoutNGBlockFlowMixin<LayoutBlockFlow>(element) {} + +bool LayoutNGOutsideListMarker::IsOfType(LayoutObjectType type) const { + return type == kLayoutObjectNGOutsideListMarker || + LayoutNGMixin<LayoutBlockFlow>::IsOfType(type); +} + +void LayoutNGOutsideListMarker::WillCollectInlines() { + list_marker_.UpdateMarkerTextIfNeeded(*this); +} + +bool LayoutNGOutsideListMarker::NeedsOccupyWholeLine() const { + if (!GetDocument().InQuirksMode()) + return false; + + LayoutObject* next_sibling = NextSibling(); + if (next_sibling && next_sibling->GetNode() && + (IsA<HTMLUListElement>(*next_sibling->GetNode()) || + IsA<HTMLOListElement>(*next_sibling->GetNode()))) + return true; + + return false; +} + +PositionWithAffinity LayoutNGOutsideListMarker::PositionForPoint( + const PhysicalOffset&) const { + return CreatePositionWithAffinity(0); +} + +} // namespace blink |