Commit a436be19 authored by Kent Tamura's avatar Kent Tamura Committed by Commit Bot

Remove LayoutTextControlInnerContainer and TextControlInnerContainer

After crrev.com/735492, LayoutTextControlInnerContainer is unnecessary.
TextControlInnerContainer exists only to apply
LayoutTextControlInnerContainer, so we can remove
TextControlInnerContainer too.

This CL should have no behavior changes.

Bug: 1040828
Change-Id: I091de82bc35f9c0e481edd06cf348205558aa378
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2024127Reviewed-by: default avatarIan Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#735699}
parent 788824c5
...@@ -39,19 +39,6 @@ ...@@ -39,19 +39,6 @@
namespace blink { namespace blink {
TextControlInnerContainer::TextControlInnerContainer(Document& document)
: HTMLDivElement(document) {
setAttribute(html_names::kIdAttr, shadow_element_names::TextFieldContainer());
}
LayoutObject* TextControlInnerContainer::CreateLayoutObject(
const ComputedStyle&,
LegacyLayout) {
return new LayoutTextControlInnerContainer(this);
}
// ---------------------------
EditingViewPortElement::EditingViewPortElement(Document& document) EditingViewPortElement::EditingViewPortElement(Document& document)
: HTMLDivElement(document) { : HTMLDivElement(document) {
SetHasCustomStyleCallbacks(); SetHasCustomStyleCallbacks();
......
...@@ -32,15 +32,6 @@ ...@@ -32,15 +32,6 @@
namespace blink { namespace blink {
class TextControlInnerContainer final : public HTMLDivElement {
public:
explicit TextControlInnerContainer(Document&);
protected:
LayoutObject* CreateLayoutObject(const ComputedStyle&, LegacyLayout) override;
bool TypeShouldForceLegacyLayout() const final { return true; }
};
class EditingViewPortElement final : public HTMLDivElement { class EditingViewPortElement final : public HTMLDivElement {
public: public:
explicit EditingViewPortElement(Document&); explicit EditingViewPortElement(Document&);
......
...@@ -300,7 +300,8 @@ void TextFieldInputType::CreateShadowSubtree() { ...@@ -300,7 +300,8 @@ void TextFieldInputType::CreateShadowSubtree() {
return; return;
} }
auto* container = MakeGarbageCollected<TextControlInnerContainer>(document); auto* container = MakeGarbageCollected<HTMLDivElement>(document);
container->SetIdAttribute(shadow_element_names::TextFieldContainer());
container->SetShadowPseudoId( container->SetShadowPseudoId(
AtomicString("-webkit-textfield-decoration-container")); AtomicString("-webkit-textfield-decoration-container"));
shadow_root->AppendChild(container); shadow_root->AppendChild(container);
...@@ -358,8 +359,8 @@ void TextFieldInputType::ListAttributeTargetChanged() { ...@@ -358,8 +359,8 @@ void TextFieldInputType::ListAttributeTargetChanged() {
// FIXME: The following code is similar to createShadowSubtree(), // FIXME: The following code is similar to createShadowSubtree(),
// but they are different. We should simplify the code by making // but they are different. We should simplify the code by making
// containerElement mandatory. // containerElement mandatory.
auto* rp_container = auto* rp_container = MakeGarbageCollected<HTMLDivElement>(document);
MakeGarbageCollected<TextControlInnerContainer>(document); rp_container->SetIdAttribute(shadow_element_names::TextFieldContainer());
rp_container->SetShadowPseudoId( rp_container->SetShadowPseudoId(
AtomicString("-webkit-textfield-decoration-container")); AtomicString("-webkit-textfield-decoration-container"));
Element* inner_editor = GetElement().InnerEditorElement(); Element* inner_editor = GetElement().InnerEditorElement();
......
...@@ -102,34 +102,6 @@ class CORE_EXPORT LayoutTextControl : public LayoutBlockFlow { ...@@ -102,34 +102,6 @@ class CORE_EXPORT LayoutTextControl : public LayoutBlockFlow {
DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutTextControl, IsTextControl()); DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutTextControl, IsTextControl());
// LayoutObject for our inner container, for <search> and others.
// We can't use LayoutFlexibleBox directly, because flexboxes have a different
// baseline definition, and then inputs of different types wouldn't line up
// anymore.
//
// TODO(crbug.com/1040828): Remove this class. The baseline adjustment is not
// necessary any longer.
class LayoutTextControlInnerContainer final : public LayoutFlexibleBox {
public:
explicit LayoutTextControlInnerContainer(Element* element)
: LayoutFlexibleBox(element) {}
~LayoutTextControlInnerContainer() override = default;
LayoutUnit BaselinePosition(FontBaseline baseline,
bool first_line,
LineDirectionMode direction,
LinePositionMode position) const override {
return LayoutBlock::BaselinePosition(baseline, first_line, direction,
position);
}
LayoutUnit FirstLineBoxBaseline() const override {
return LayoutBlock::FirstLineBoxBaseline();
}
LayoutUnit InlineBlockBaseline(LineDirectionMode direction) const override {
return LayoutBlock::InlineBlockBaseline(direction);
}
};
} // namespace blink } // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_LAYOUT_TEXT_CONTROL_H_ #endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_LAYOUT_TEXT_CONTROL_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