Commit b703e1b0 authored by Yoichi Osato's avatar Yoichi Osato Committed by Commit Bot

Get rid of unused function LayoutBoxModelObject::SetSelectionState()

After we remove LayoutBoxModelObject::SetSelectionState() implementation,
LayoutObject::SetSelectionState() is no longer needed to be virtual
since there are no other calls.
Thus, we can remove |virtual| from LayoutObject::SetSelectionState().

Bug: 739062
Change-Id: I49b1426f9fc89586d1e818b10385c18c5223399e
Reviewed-on: https://chromium-review.googlesource.com/802603
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Reviewed-by: default avataryosin (OOO Dec 11 to Jan 8) <yosin@chromium.org>
Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#522048}
parent 5af8fa7c
...@@ -78,27 +78,6 @@ typedef HashMap<const LayoutBoxModelObject*, LayoutBoxModelObject*> ...@@ -78,27 +78,6 @@ typedef HashMap<const LayoutBoxModelObject*, LayoutBoxModelObject*>
ContinuationMap; ContinuationMap;
static ContinuationMap* g_continuation_map = nullptr; static ContinuationMap* g_continuation_map = nullptr;
void LayoutBoxModelObject::SetSelectionState(SelectionState state) {
if (state == SelectionState::kInside &&
GetSelectionState() != SelectionState::kNone)
return;
if ((state == SelectionState::kStart &&
GetSelectionState() == SelectionState::kEnd) ||
(state == SelectionState::kEnd &&
GetSelectionState() == SelectionState::kStart))
LayoutObject::SetSelectionState(SelectionState::kStartAndEnd);
else
LayoutObject::SetSelectionState(state);
// FIXME: We should consider whether it is OK propagating to ancestor
// LayoutInlines. This is a workaround for http://webkit.org/b/32123
// The containing block can be null in case of an orphaned tree.
LayoutBlock* containing_block = ContainingBlock();
if (containing_block && !containing_block->IsLayoutView())
containing_block->SetSelectionState(state);
}
void LayoutBoxModelObject::ContentChanged(ContentChangeType change_type) { void LayoutBoxModelObject::ContentChanged(ContentChangeType change_type) {
if (!HasLayer()) if (!HasLayer())
return; return;
......
...@@ -418,8 +418,6 @@ class CORE_EXPORT LayoutBoxModelObject : public LayoutObject { ...@@ -418,8 +418,6 @@ class CORE_EXPORT LayoutBoxModelObject : public LayoutObject {
const LayoutBoxModelObject* ancestor_to_stop_at, const LayoutBoxModelObject* ancestor_to_stop_at,
LayoutGeometryMap&) const override; LayoutGeometryMap&) const override;
void SetSelectionState(SelectionState) override;
void ContentChanged(ContentChangeType); void ContentChanged(ContentChangeType);
bool HasAcceleratedCompositing() const; bool HasAcceleratedCompositing() const;
......
...@@ -1484,7 +1484,7 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver, ...@@ -1484,7 +1484,7 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver,
SelectionState GetSelectionState() const { SelectionState GetSelectionState() const {
return bitfields_.GetSelectionState(); return bitfields_.GetSelectionState();
} }
virtual void SetSelectionState(SelectionState state) { void SetSelectionState(SelectionState state) {
bitfields_.SetSelectionState(state); bitfields_.SetSelectionState(state);
} }
bool CanUpdateSelectionOnRootLineBoxes() const; bool CanUpdateSelectionOnRootLineBoxes() const;
......
...@@ -1444,15 +1444,6 @@ float LayoutText::FirstRunY() const { ...@@ -1444,15 +1444,6 @@ float LayoutText::FirstRunY() const {
return first_text_box_ ? first_text_box_->Y().ToFloat() : 0; return first_text_box_ ? first_text_box_->Y().ToFloat() : 0;
} }
void LayoutText::SetSelectionState(SelectionState state) {
LayoutObject::SetSelectionState(state);
// The containing block can be null in case of an orphaned tree.
LayoutBlock* containing_block = ContainingBlock();
if (containing_block && !containing_block->IsLayoutView())
containing_block->SetSelectionState(state);
}
void LayoutText::SetTextWithOffset(scoped_refptr<StringImpl> text, void LayoutText::SetTextWithOffset(scoped_refptr<StringImpl> text,
unsigned offset, unsigned offset,
unsigned len, unsigned len,
......
...@@ -189,7 +189,6 @@ class CORE_EXPORT LayoutText : public LayoutObject { ...@@ -189,7 +189,6 @@ class CORE_EXPORT LayoutText : public LayoutObject {
virtual void TransformText(); virtual void TransformText();
void SetSelectionState(SelectionState) final;
LayoutRect LocalSelectionRect() const final; LayoutRect LocalSelectionRect() const final;
LayoutRect LocalCaretRect( LayoutRect LocalCaretRect(
const InlineBox*, const InlineBox*,
......
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