Commit 5a2a07e4 authored by Koji Ishii's avatar Koji Ishii Committed by Commit Bot

[LayoutNG] Mark LayoutNGMixin functions as final when possible

Some override functions in LayoutNGMixin are not to be
overridden further. This patch marks them as 'final' so that
calling them from inside of LayoutNGMixin or its subclasses
can make non-virtual calls.

No behavior changes.

Bug: 635619
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng
Change-Id: I97e65d70cbe34b6757ab129c62e37bdaddcda72e
Reviewed-on: https://chromium-review.googlesource.com/1258664Reviewed-by: default avatarYoshifumi Inoue <yosin@chromium.org>
Reviewed-by: default avatarMorten Stenshorne <mstensho@chromium.org>
Commit-Queue: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596285}
parent 7a27c0fc
......@@ -35,47 +35,42 @@ class LayoutNGMixin : public Base {
explicit LayoutNGMixin(Element* element);
~LayoutNGMixin() override;
bool IsLayoutNGObject() const override { return true; }
bool IsLayoutNGObject() const final { return true; }
NGInlineNodeData* TakeNGInlineNodeData() override;
NGInlineNodeData* GetNGInlineNodeData() const override;
void ResetNGInlineNodeData() override;
bool HasNGInlineNodeData() const override {
return ng_inline_node_data_.get();
}
NGInlineNodeData* TakeNGInlineNodeData() final;
NGInlineNodeData* GetNGInlineNodeData() const final;
void ResetNGInlineNodeData() final;
bool HasNGInlineNodeData() const final { return ng_inline_node_data_.get(); }
LayoutUnit FirstLineBoxBaseline() const override;
LayoutUnit InlineBlockBaseline(LineDirectionMode) const override;
LayoutUnit FirstLineBoxBaseline() const final;
LayoutUnit InlineBlockBaseline(LineDirectionMode) const final;
void InvalidateDisplayItemClients(PaintInvalidationReason) const override;
void InvalidateDisplayItemClients(PaintInvalidationReason) const final;
void Paint(const PaintInfo&) const override;
void Paint(const PaintInfo&) const final;
bool NodeAtPoint(HitTestResult&,
const HitTestLocation& location_in_container,
const LayoutPoint& accumulated_offset,
HitTestAction) override;
HitTestAction) final;
PositionWithAffinity PositionForPoint(const LayoutPoint&) const override;
PositionWithAffinity PositionForPoint(const LayoutPoint&) const final;
// Returns the last layout result for this block flow with the given
// constraint space and break token, or null if it is not up-to-date or
// otherwise unavailable.
scoped_refptr<NGLayoutResult> CachedLayoutResult(
const NGConstraintSpace&,
NGBreakToken*) const override;
scoped_refptr<NGLayoutResult> CachedLayoutResult(const NGConstraintSpace&,
NGBreakToken*) const final;
void SetCachedLayoutResult(const NGConstraintSpace&,
const NGBreakToken*,
const NGLayoutResult&) override;
void ClearCachedLayoutResult() override;
const NGLayoutResult&) final;
void ClearCachedLayoutResult() final;
// For testing only.
scoped_refptr<const NGLayoutResult> CachedLayoutResultForTesting() override;
scoped_refptr<const NGLayoutResult> CachedLayoutResultForTesting() final;
NGPaintFragment* PaintFragment() const override {
return paint_fragment_.get();
}
NGPaintFragment* PaintFragment() const final { return paint_fragment_.get(); }
void SetPaintFragment(const NGBreakToken*,
scoped_refptr<const NGPhysicalFragment>,
NGPhysicalOffset) final;
......@@ -87,7 +82,7 @@ class LayoutNGMixin : public Base {
protected:
bool IsOfType(LayoutObject::LayoutObjectType) const override;
void AddOverflowFromChildren() override;
void AddOverflowFromChildren() final;
private:
void AddScrollingOverflowFromChildren();
......@@ -98,14 +93,14 @@ class LayoutNGMixin : public Base {
protected:
void AddOutlineRects(Vector<LayoutRect>&,
const LayoutPoint& additional_offset,
NGOutlineType) const override;
NGOutlineType) const final;
const NGPhysicalBoxFragment* CurrentFragment() const override;
const NGPhysicalBoxFragment* CurrentFragment() const final;
const NGBaseline* FragmentBaseline(NGBaselineAlgorithmType) const;
void DirtyLinesFromChangedChild(LayoutObject* child,
MarkingBehavior marking_behavior) override;
MarkingBehavior marking_behavior) final;
std::unique_ptr<NGInlineNodeData> ng_inline_node_data_;
......
......@@ -26,7 +26,6 @@ class CORE_EXPORT LayoutNGListItem final : public LayoutNGBlockFlow {
return StyleRef().ListStyleImage() &&
!StyleRef().ListStyleImage()->ErrorOccurred();
}
bool IsLayoutNGObject() const override { return true; }
void UpdateMarkerTextIfNeeded() {
if (marker_ && !is_marker_text_updated_ && !IsMarkerImage())
......
......@@ -33,8 +33,6 @@ class CORE_EXPORT LayoutNGListMarker final
bool IsContentImage() const;
bool IsLayoutNGObject() const override { return true; }
LayoutObject* SymbolMarkerLayoutText() const;
// Marker text with suffix, e.g. "1. ", for use in accessibility.
......
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