Move ComputedProperties and CascadedProperties out of the GC. They no longer contain strong references to GC-managed data. Keep computed styles alive from DOM elements and animation updates with RefPtr. Pass style into layout constructors by reference, since layout only copies the values it needs while building nodes. Use GC::Weak for cascade source links, so entries no longer keep the style declaration or shadow root alive.
31 lines
937 B
C++
31 lines
937 B
C++
/*
|
|
* Copyright (c) 2025-2026, Jonathan Gamble <gamblej@gmail.com>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibWeb/HTML/HTMLInputElement.h>
|
|
#include <LibWeb/Layout/BlockContainer.h>
|
|
|
|
namespace Web::Layout {
|
|
|
|
class TextInputBox : public BlockContainer {
|
|
GC_CELL(TextInputBox, BlockContainer);
|
|
GC_DECLARE_ALLOCATOR(TextInputBox);
|
|
|
|
public:
|
|
TextInputBox(DOM::Document&, GC::Ptr<DOM::Element>, CSS::ComputedProperties const&);
|
|
|
|
HTML::HTMLInputElement const& dom_node() const { return static_cast<HTML::HTMLInputElement const&>(*Box::dom_node()); }
|
|
static CSS::SizeWithAspectRatio auto_content_box_size_for_text_control(HTML::HTMLInputElement const&, Box const&);
|
|
|
|
virtual ~TextInputBox() override = default;
|
|
|
|
private:
|
|
virtual CSS::SizeWithAspectRatio compute_auto_content_box_size() const override;
|
|
virtual bool has_auto_content_box_size() const override { return true; }
|
|
};
|
|
|
|
}
|