ladybird/Libraries/LibWeb/Layout/RangeInputBox.h
Tim Ledbetter 709c10f8ec LibWeb: Let range inputs stretch in grid containers
Previously, the UA stylesheet gave range inputs a definite
`width: 20ch`. This prevented range inputs from filling their grid
track. We now source the default width and height from a new
`RangeInputBox` type. This approach matches the implementation of other
input types.
2026-05-30 12:17:58 +01:00

28 lines
694 B
C++

/*
* Copyright (c) 2026, Tim Ledbetter <timledbetter@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/DOM/Element.h>
#include <LibWeb/Layout/BlockContainer.h>
namespace Web::Layout {
class RangeInputBox final : public BlockContainer {
GC_CELL(RangeInputBox, BlockContainer);
GC_DECLARE_ALLOCATOR(RangeInputBox);
public:
RangeInputBox(DOM::Document&, GC::Ptr<DOM::Element>, GC::Ref<CSS::ComputedProperties>);
virtual ~RangeInputBox() override = default;
private:
virtual CSS::SizeWithAspectRatio compute_auto_content_box_size() const override;
virtual bool has_auto_content_box_size() const override { return true; }
};
}