Commit 0261c677 authored by Kent Tamura's avatar Kent Tamura Committed by Commit Bot

Layout: Make enum item names of LayoutObjectType consistent

- 'Layout' in some items were redundant

- Remove unused kLayoutObjectLayoutInline and
  kLayoutObjectLayoutEmbeddedContent

- kLayoutObjectTextArea and kLayoutObjectTextField were not matched
  to C++ class names.

This CL has no behavior changes.

Change-Id: Iff8c84234cd264340074d474ba069f605b3e657a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2444670
Commit-Queue: Kent Tamura <tkent@chromium.org>
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
Auto-Submit: Kent Tamura <tkent@chromium.org>
Reviewed-by: default avatarIan Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#813064}
parent 278d3e9a
...@@ -42,8 +42,7 @@ class LayoutButton final : public LayoutFlexibleBox { ...@@ -42,8 +42,7 @@ class LayoutButton final : public LayoutFlexibleBox {
} }
bool IsOfType(LayoutObjectType type) const override { bool IsOfType(LayoutObjectType type) const override {
NOT_DESTROYED(); NOT_DESTROYED();
return type == kLayoutObjectLayoutButton || return type == kLayoutObjectButton || LayoutFlexibleBox::IsOfType(type);
LayoutFlexibleBox::IsOfType(type);
} }
void AddChild(LayoutObject* new_child, void AddChild(LayoutObject* new_child,
......
...@@ -71,7 +71,7 @@ class CORE_EXPORT LayoutCustomScrollbarPart final : public LayoutReplaced { ...@@ -71,7 +71,7 @@ class CORE_EXPORT LayoutCustomScrollbarPart final : public LayoutReplaced {
bool IsOfType(LayoutObjectType type) const override { bool IsOfType(LayoutObjectType type) const override {
NOT_DESTROYED(); NOT_DESTROYED();
return type == kLayoutObjectLayoutCustomScrollbarPart || return type == kLayoutObjectCustomScrollbarPart ||
LayoutReplaced::IsOfType(type); LayoutReplaced::IsOfType(type);
} }
ScrollableArea* GetScrollableArea() const { ScrollableArea* GetScrollableArea() const {
......
...@@ -146,7 +146,7 @@ class LayoutGrid final : public LayoutBlock { ...@@ -146,7 +146,7 @@ class LayoutGrid final : public LayoutBlock {
private: private:
bool IsOfType(LayoutObjectType type) const override { bool IsOfType(LayoutObjectType type) const override {
NOT_DESTROYED(); NOT_DESTROYED();
return type == kLayoutObjectLayoutGrid || LayoutBlock::IsOfType(type); return type == kLayoutObjectGrid || LayoutBlock::IsOfType(type);
} }
MinMaxSizes ComputeIntrinsicLogicalWidths() const override; MinMaxSizes ComputeIntrinsicLogicalWidths() const override;
......
...@@ -47,8 +47,7 @@ class LayoutIFrame final : public LayoutEmbeddedContent { ...@@ -47,8 +47,7 @@ class LayoutIFrame final : public LayoutEmbeddedContent {
bool IsOfType(LayoutObjectType type) const override { bool IsOfType(LayoutObjectType type) const override {
NOT_DESTROYED(); NOT_DESTROYED();
return type == kLayoutObjectLayoutIFrame || return type == kLayoutObjectIFrame || LayoutEmbeddedContent::IsOfType(type);
LayoutEmbeddedContent::IsOfType(type);
} }
PaintLayerType LayerTypeRequired() const override; PaintLayerType LayerTypeRequired() const override;
......
...@@ -117,7 +117,7 @@ class CORE_EXPORT LayoutImage : public LayoutReplaced { ...@@ -117,7 +117,7 @@ class CORE_EXPORT LayoutImage : public LayoutReplaced {
bool IsOfType(LayoutObjectType type) const override { bool IsOfType(LayoutObjectType type) const override {
NOT_DESTROYED(); NOT_DESTROYED();
return type == kLayoutObjectLayoutImage || LayoutReplaced::IsOfType(type); return type == kLayoutObjectImage || LayoutReplaced::IsOfType(type);
} }
void WillBeDestroyed() override; void WillBeDestroyed() override;
......
...@@ -102,7 +102,7 @@ class CORE_EXPORT LayoutMultiColumnSet final : public LayoutBlockFlow { ...@@ -102,7 +102,7 @@ class CORE_EXPORT LayoutMultiColumnSet final : public LayoutBlockFlow {
bool IsOfType(LayoutObjectType type) const override { bool IsOfType(LayoutObjectType type) const override {
NOT_DESTROYED(); NOT_DESTROYED();
return type == kLayoutObjectLayoutMultiColumnSet || return type == kLayoutObjectMultiColumnSet ||
LayoutBlockFlow::IsOfType(type); LayoutBlockFlow::IsOfType(type);
} }
bool CanHaveChildren() const final { bool CanHaveChildren() const final {
......
...@@ -19,7 +19,7 @@ class LayoutMultiColumnSpannerPlaceholder final : public LayoutBox { ...@@ -19,7 +19,7 @@ class LayoutMultiColumnSpannerPlaceholder final : public LayoutBox {
public: public:
bool IsOfType(LayoutObjectType type) const override { bool IsOfType(LayoutObjectType type) const override {
NOT_DESTROYED(); NOT_DESTROYED();
return type == kLayoutObjectLayoutMultiColumnSpannerPlaceholder || return type == kLayoutObjectMultiColumnSpannerPlaceholder ||
LayoutBox::IsOfType(type); LayoutBox::IsOfType(type);
} }
......
...@@ -838,11 +838,11 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver, ...@@ -838,11 +838,11 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver,
} }
bool IsLayoutTableCol() const { bool IsLayoutTableCol() const {
NOT_DESTROYED(); NOT_DESTROYED();
return IsOfType(kLayoutObjectLayoutTableCol); return IsOfType(kLayoutObjectTableCol);
} }
bool IsLayoutNGTableCol() const { bool IsLayoutNGTableCol() const {
NOT_DESTROYED(); NOT_DESTROYED();
return IsOfType(kLayoutObjectLayoutNGTableCol); return IsOfType(kLayoutObjectNGTableCol);
} }
bool IsListItem() const { bool IsListItem() const {
NOT_DESTROYED(); NOT_DESTROYED();
...@@ -882,8 +882,7 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver, ...@@ -882,8 +882,7 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver,
} }
bool IsButtonIncludingNG() const { bool IsButtonIncludingNG() const {
NOT_DESTROYED(); NOT_DESTROYED();
return IsOfType(kLayoutObjectLayoutButton) || return IsOfType(kLayoutObjectButton) || IsOfType(kLayoutObjectNGButton);
IsOfType(kLayoutObjectNGButton);
} }
bool IsLayoutNGButton() const { bool IsLayoutNGButton() const {
NOT_DESTROYED(); NOT_DESTROYED();
...@@ -891,39 +890,39 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver, ...@@ -891,39 +890,39 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver,
} }
bool IsLayoutNGCustom() const { bool IsLayoutNGCustom() const {
NOT_DESTROYED(); NOT_DESTROYED();
return IsOfType(kLayoutObjectLayoutNGCustom); return IsOfType(kLayoutObjectNGCustom);
} }
bool IsLayoutGrid() const { bool IsLayoutGrid() const {
NOT_DESTROYED(); NOT_DESTROYED();
return IsOfType(kLayoutObjectLayoutGrid); return IsOfType(kLayoutObjectGrid);
} }
bool IsLayoutIFrame() const { bool IsLayoutIFrame() const {
NOT_DESTROYED(); NOT_DESTROYED();
return IsOfType(kLayoutObjectLayoutIFrame); return IsOfType(kLayoutObjectIFrame);
} }
bool IsLayoutImage() const { bool IsLayoutImage() const {
NOT_DESTROYED(); NOT_DESTROYED();
return IsOfType(kLayoutObjectLayoutImage); return IsOfType(kLayoutObjectImage);
} }
bool IsLayoutMultiColumnSet() const { bool IsLayoutMultiColumnSet() const {
NOT_DESTROYED(); NOT_DESTROYED();
return IsOfType(kLayoutObjectLayoutMultiColumnSet); return IsOfType(kLayoutObjectMultiColumnSet);
} }
bool IsLayoutMultiColumnSpannerPlaceholder() const { bool IsLayoutMultiColumnSpannerPlaceholder() const {
NOT_DESTROYED(); NOT_DESTROYED();
return IsOfType(kLayoutObjectLayoutMultiColumnSpannerPlaceholder); return IsOfType(kLayoutObjectMultiColumnSpannerPlaceholder);
} }
bool IsLayoutReplaced() const { bool IsLayoutReplaced() const {
NOT_DESTROYED(); NOT_DESTROYED();
return IsOfType(kLayoutObjectLayoutReplaced); return IsOfType(kLayoutObjectReplaced);
} }
bool IsLayoutCustomScrollbarPart() const { bool IsLayoutCustomScrollbarPart() const {
NOT_DESTROYED(); NOT_DESTROYED();
return IsOfType(kLayoutObjectLayoutCustomScrollbarPart); return IsOfType(kLayoutObjectCustomScrollbarPart);
} }
bool IsLayoutView() const { bool IsLayoutView() const {
NOT_DESTROYED(); NOT_DESTROYED();
return IsOfType(kLayoutObjectLayoutView); return IsOfType(kLayoutObjectView);
} }
bool IsRuby() const { bool IsRuby() const {
NOT_DESTROYED(); NOT_DESTROYED();
...@@ -967,7 +966,7 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver, ...@@ -967,7 +966,7 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver,
} }
bool IsTextAreaIncludingNG() const { bool IsTextAreaIncludingNG() const {
NOT_DESTROYED(); NOT_DESTROYED();
return IsOfType(kLayoutObjectTextArea) || return IsOfType(kLayoutObjectTextControlMultiLine) ||
IsOfType(kLayoutObjectNGTextControlMultiLine); IsOfType(kLayoutObjectNGTextControlMultiLine);
} }
bool IsTextControlIncludingNG() const { bool IsTextControlIncludingNG() const {
...@@ -978,7 +977,7 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver, ...@@ -978,7 +977,7 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver,
} }
bool IsTextFieldIncludingNG() const { bool IsTextFieldIncludingNG() const {
NOT_DESTROYED(); NOT_DESTROYED();
return IsOfType(kLayoutObjectTextField) || return IsOfType(kLayoutObjectTextControlSingleLine) ||
IsOfType(kLayoutObjectNGTextControlSingleLine); IsOfType(kLayoutObjectNGTextControlSingleLine);
} }
bool IsVideo() const { bool IsVideo() const {
...@@ -3273,6 +3272,8 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver, ...@@ -3273,6 +3272,8 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver,
} }
protected: protected:
// Identifiers for each of LayoutObject subclasses.
// The identifier name for blink::LayoutFoo should be kLayoutObjectFoo.
enum LayoutObjectType { enum LayoutObjectType {
kLayoutObjectBr, kLayoutObjectBr,
kLayoutObjectCanvas, kLayoutObjectCanvas,
...@@ -3284,8 +3285,8 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver, ...@@ -3284,8 +3285,8 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver,
kLayoutObjectFrame, kLayoutObjectFrame,
kLayoutObjectFrameSet, kLayoutObjectFrameSet,
kLayoutObjectInsideListMarker, kLayoutObjectInsideListMarker,
kLayoutObjectLayoutTableCol, kLayoutObjectTableCol,
kLayoutObjectLayoutNGTableCol, kLayoutObjectNGTableCol,
kLayoutObjectListItem, kLayoutObjectListItem,
kLayoutObjectListMarker, kLayoutObjectListMarker,
kLayoutObjectListMarkerImage, kLayoutObjectListMarkerImage,
...@@ -3308,19 +3309,16 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver, ...@@ -3308,19 +3309,16 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver,
kLayoutObjectOutsideListMarker, kLayoutObjectOutsideListMarker,
kLayoutObjectProgress, kLayoutObjectProgress,
kLayoutObjectQuote, kLayoutObjectQuote,
kLayoutObjectLayoutButton, kLayoutObjectButton,
kLayoutObjectLayoutNGCustom, kLayoutObjectNGCustom,
kLayoutObjectLayoutFlowThread, kLayoutObjectGrid,
kLayoutObjectLayoutGrid, kLayoutObjectIFrame,
kLayoutObjectLayoutIFrame, kLayoutObjectImage,
kLayoutObjectLayoutImage, kLayoutObjectMultiColumnSet,
kLayoutObjectLayoutInline, kLayoutObjectMultiColumnSpannerPlaceholder,
kLayoutObjectLayoutMultiColumnSet, kLayoutObjectReplaced,
kLayoutObjectLayoutMultiColumnSpannerPlaceholder, kLayoutObjectCustomScrollbarPart,
kLayoutObjectLayoutEmbeddedContent, kLayoutObjectView,
kLayoutObjectLayoutReplaced,
kLayoutObjectLayoutCustomScrollbarPart,
kLayoutObjectLayoutView,
kLayoutObjectRuby, kLayoutObjectRuby,
kLayoutObjectRubyBase, kLayoutObjectRubyBase,
kLayoutObjectRubyRun, kLayoutObjectRubyRun,
...@@ -3331,9 +3329,9 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver, ...@@ -3331,9 +3329,9 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver,
kLayoutObjectTableCellLegacy, kLayoutObjectTableCellLegacy,
kLayoutObjectTableRow, kLayoutObjectTableRow,
kLayoutObjectTableSection, kLayoutObjectTableSection,
kLayoutObjectTextArea, kLayoutObjectTextControlMultiLine,
kLayoutObjectTextControl, kLayoutObjectTextControl,
kLayoutObjectTextField, kLayoutObjectTextControlSingleLine,
kLayoutObjectVideo, kLayoutObjectVideo,
kLayoutObjectWidget, kLayoutObjectWidget,
......
...@@ -169,7 +169,7 @@ class CORE_EXPORT LayoutReplaced : public LayoutBox { ...@@ -169,7 +169,7 @@ class CORE_EXPORT LayoutReplaced : public LayoutBox {
bool IsOfType(LayoutObjectType type) const override { bool IsOfType(LayoutObjectType type) const override {
NOT_DESTROYED(); NOT_DESTROYED();
return type == kLayoutObjectLayoutReplaced || LayoutBox::IsOfType(type); return type == kLayoutObjectReplaced || LayoutBox::IsOfType(type);
} }
private: private:
......
...@@ -95,7 +95,7 @@ class LayoutTableCol final : public LayoutTableBoxComponent { ...@@ -95,7 +95,7 @@ class LayoutTableCol final : public LayoutTableBoxComponent {
private: private:
bool IsOfType(LayoutObjectType type) const override { bool IsOfType(LayoutObjectType type) const override {
NOT_DESTROYED(); NOT_DESTROYED();
return type == kLayoutObjectLayoutTableCol || LayoutBox::IsOfType(type); return type == kLayoutObjectTableCol || LayoutBox::IsOfType(type);
} }
void UpdateFromElement() override; void UpdateFromElement() override;
......
...@@ -35,7 +35,8 @@ class LayoutTextControlMultiLine final : public LayoutTextControl { ...@@ -35,7 +35,8 @@ class LayoutTextControlMultiLine final : public LayoutTextControl {
private: private:
bool IsOfType(LayoutObjectType type) const override { bool IsOfType(LayoutObjectType type) const override {
NOT_DESTROYED(); NOT_DESTROYED();
return type == kLayoutObjectTextArea || LayoutTextControl::IsOfType(type); return type == kLayoutObjectTextControlMultiLine ||
LayoutTextControl::IsOfType(type);
} }
bool NodeAtPoint(HitTestResult&, bool NodeAtPoint(HitTestResult&,
......
...@@ -47,7 +47,8 @@ class LayoutTextControlSingleLine : public LayoutTextControl { ...@@ -47,7 +47,8 @@ class LayoutTextControlSingleLine : public LayoutTextControl {
private: private:
bool IsOfType(LayoutObjectType type) const override { bool IsOfType(LayoutObjectType type) const override {
NOT_DESTROYED(); NOT_DESTROYED();
return type == kLayoutObjectTextField || LayoutTextControl::IsOfType(type); return type == kLayoutObjectTextControlSingleLine ||
LayoutTextControl::IsOfType(type);
} }
void Paint(const PaintInfo&) const override; void Paint(const PaintInfo&) const override;
......
...@@ -94,7 +94,7 @@ class CORE_EXPORT LayoutView final : public LayoutBlockFlow { ...@@ -94,7 +94,7 @@ class CORE_EXPORT LayoutView final : public LayoutBlockFlow {
bool IsOfType(LayoutObjectType type) const override { bool IsOfType(LayoutObjectType type) const override {
NOT_DESTROYED(); NOT_DESTROYED();
return type == kLayoutObjectLayoutView || LayoutBlockFlow::IsOfType(type); return type == kLayoutObjectView || LayoutBlockFlow::IsOfType(type);
} }
PaintLayerType LayerTypeRequired() const override { PaintLayerType LayerTypeRequired() const override {
......
...@@ -37,8 +37,7 @@ class LayoutNGCustom final : public LayoutNGBlockFlow { ...@@ -37,8 +37,7 @@ class LayoutNGCustom final : public LayoutNGBlockFlow {
private: private:
bool IsOfType(LayoutObjectType type) const override { bool IsOfType(LayoutObjectType type) const override {
return type == kLayoutObjectLayoutNGCustom || return type == kLayoutObjectNGCustom || LayoutNGBlockFlow::IsOfType(type);
LayoutNGBlockFlow::IsOfType(type);
} }
LayoutNGCustomState state_; LayoutNGCustomState state_;
......
...@@ -67,7 +67,7 @@ class CORE_EXPORT LayoutNGTableColumn : public LayoutBox { ...@@ -67,7 +67,7 @@ class CORE_EXPORT LayoutNGTableColumn : public LayoutBox {
bool IsOfType(LayoutObjectType type) const override { bool IsOfType(LayoutObjectType type) const override {
NOT_DESTROYED(); NOT_DESTROYED();
return type == kLayoutObjectLayoutTableCol || LayoutBox::IsOfType(type); return type == kLayoutObjectTableCol || LayoutBox::IsOfType(type);
} }
private: private:
......
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