Commit 9063939e authored by Kent Tamura's avatar Kent Tamura Committed by Commit Bot

TextControl NG: Add skeletons of LayoutNGTextControl* classes

This CL adds Layout NG classes corresponding to
blink::LayoutTextControlInnerEditor, blink::LayoutTextControlMultiLine,
and blink::LayoutTextControlSingleLine.

- LayoutNGTextControlInnerEditor doesn't need IsOfType().
- LayoutNGTextControl*Line should create new formatting context.

This CL has no behavior changes.  The new classes are not used yet.

Bug: 1040826
Change-Id: If7d30d07ab7cf66bfa4e207b8ce99a4ba4cc3662
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2440228
Auto-Submit: Kent Tamura <tkent@chromium.org>
Commit-Queue: Koji Ishii <kojii@chromium.org>
Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#812540}
parent e8aea662
...@@ -437,6 +437,11 @@ blink_core_sources("layout") { ...@@ -437,6 +437,11 @@ blink_core_sources("layout") {
"ng/layout_ng_ruby_run.h", "ng/layout_ng_ruby_run.h",
"ng/layout_ng_ruby_text.cc", "ng/layout_ng_ruby_text.cc",
"ng/layout_ng_ruby_text.h", "ng/layout_ng_ruby_text.h",
"ng/layout_ng_text_control_inner_editor.h",
"ng/layout_ng_text_control_multi_line.cc",
"ng/layout_ng_text_control_multi_line.h",
"ng/layout_ng_text_control_single_line.cc",
"ng/layout_ng_text_control_single_line.h",
"ng/legacy_layout_tree_walking.h", "ng/legacy_layout_tree_walking.h",
"ng/list/layout_ng_inside_list_marker.cc", "ng/list/layout_ng_inside_list_marker.cc",
"ng/list/layout_ng_inside_list_marker.h", "ng/list/layout_ng_inside_list_marker.h",
......
...@@ -3279,6 +3279,8 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver, ...@@ -3279,6 +3279,8 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver,
kLayoutObjectNGOutsideListMarker, kLayoutObjectNGOutsideListMarker,
kLayoutObjectNGProgress, kLayoutObjectNGProgress,
kLayoutObjectNGText, kLayoutObjectNGText,
kLayoutObjectNGTextControlMultiLine,
kLayoutObjectNGTextControlSingleLine,
kLayoutObjectOutsideListMarker, kLayoutObjectOutsideListMarker,
kLayoutObjectProgress, kLayoutObjectProgress,
kLayoutObjectQuote, kLayoutObjectQuote,
......
// Copyright 2020 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.
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_LAYOUT_NG_TEXT_CONTROL_INNER_EDITOR_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_LAYOUT_NG_TEXT_CONTROL_INNER_EDITOR_H_
#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h"
namespace blink {
// LayoutNGTextControlInnerEditor is a LayoutObject for 'InnerEditor' elements
// in <input> and <textarea>.
class LayoutNGTextControlInnerEditor final : public LayoutNGBlockFlow {
public:
explicit LayoutNGTextControlInnerEditor(Element* element)
: LayoutNGBlockFlow(element) {}
const char* GetName() const override {
NOT_DESTROYED();
return "LayoutNGTextControlInnerEditor";
}
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_LAYOUT_NG_TEXT_CONTROL_INNER_EDITOR_H_
// Copyright 2020 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/layout_ng_text_control_multi_line.h"
namespace blink {
LayoutNGTextControlMultiLine::LayoutNGTextControlMultiLine(Element* element)
: LayoutNGBlockFlow(element) {}
bool LayoutNGTextControlMultiLine::IsOfType(LayoutObjectType type) const {
return type == kLayoutObjectNGTextControlMultiLine ||
LayoutNGBlockFlow::IsOfType(type);
}
} // namespace blink
// Copyright 2020 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.
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_LAYOUT_NG_TEXT_CONTROL_MULTI_LINE_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_LAYOUT_NG_TEXT_CONTROL_MULTI_LINE_H_
#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h"
namespace blink {
// LayoutNGTextControlSingleLine is a LayoutObject for <textarea>.
class LayoutNGTextControlMultiLine final : public LayoutNGBlockFlow {
public:
explicit LayoutNGTextControlMultiLine(Element* element);
private:
bool IsOfType(LayoutObjectType) const override;
const char* GetName() const override {
NOT_DESTROYED();
return "LayoutNGTextControlMultiLine";
}
bool CreatesNewFormattingContext() const override {
NOT_DESTROYED();
return true;
}
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_LAYOUT_NG_TEXT_CONTROL_MULTI_LINE_H_
// Copyright 2020 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/layout_ng_text_control_single_line.h"
namespace blink {
LayoutNGTextControlSingleLine::LayoutNGTextControlSingleLine(Element* element)
: LayoutNGBlockFlow(element) {}
bool LayoutNGTextControlSingleLine::IsOfType(LayoutObjectType type) const {
return type == kLayoutObjectNGTextControlSingleLine ||
LayoutNGBlockFlow::IsOfType(type);
}
} // namespace blink
// Copyright 2020 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.
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_LAYOUT_NG_TEXT_CONTROL_SINGLE_LINE_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_LAYOUT_NG_TEXT_CONTROL_SINGLE_LINE_H_
#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h"
namespace blink {
// LayoutNGTextControlSingleLine is a LayoutObject for textfield <input>.
class LayoutNGTextControlSingleLine final : public LayoutNGBlockFlow {
public:
explicit LayoutNGTextControlSingleLine(Element* element);
private:
bool IsOfType(LayoutObjectType) const override;
const char* GetName() const override {
NOT_DESTROYED();
return "LayoutNGTextControlSingleLine";
}
bool CreatesNewFormattingContext() const override {
NOT_DESTROYED();
return true;
}
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_LAYOUT_NG_TEXT_CONTROL_SINGLE_LINE_H_
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