2026-01-11 01:56:52 -06:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2025-2026, Jonathan Gamble <gamblej@gmail.com>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <LibWeb/Layout/TextAreaBox.h>
|
|
|
|
|
|
|
|
|
|
namespace Web::Layout {
|
|
|
|
|
|
2026-06-06 14:03:41 +02:00
|
|
|
TextAreaBox::TextAreaBox(DOM::Document& document, GC::Ptr<DOM::Element> element, CSS::ComputedProperties const& style)
|
|
|
|
|
: BlockContainer(document, element, style)
|
2026-01-11 01:56:52 -06:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CSS::SizeWithAspectRatio TextAreaBox::compute_auto_content_box_size() const
|
|
|
|
|
{
|
|
|
|
|
auto width = CSS::Length(dom_node().cols(), CSS::LengthUnit::Ch).to_px(*this);
|
|
|
|
|
auto height = CSS::Length(dom_node().rows(), CSS::LengthUnit::Lh).to_px(*this);
|
|
|
|
|
|
|
|
|
|
if (this->computed_values().writing_mode() != CSS::WritingMode::HorizontalTb)
|
|
|
|
|
swap(width, height);
|
|
|
|
|
|
|
|
|
|
return { width, height, {} };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|