mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2026-04-18 09:50:27 +00:00
We were conflating elements being the active element and elements being activated. The :active pseudo class is supposed to be based on whether an element will have its activation behavior run upon a button being released. Store whether an element is being activated as a flag that is set/reset by EventHandler. Doing this allows label elements to visually activate their control without doing a weird paintable hack, so the Labelable classes have been yeeted.
27 lines
670 B
C++
27 lines
670 B
C++
/*
|
|
* Copyright (c) 2020, Andreas Kling <andreas@ladybird.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibWeb/Forward.h>
|
|
#include <LibWeb/Layout/ReplacedBox.h>
|
|
|
|
namespace Web::Layout {
|
|
|
|
class CheckBox final : public ReplacedBox {
|
|
GC_CELL(CheckBox, ReplacedBox);
|
|
GC_DECLARE_ALLOCATOR(CheckBox);
|
|
|
|
public:
|
|
CheckBox(DOM::Document&, HTML::HTMLInputElement&, GC::Ref<CSS::ComputedProperties>);
|
|
virtual ~CheckBox() override;
|
|
|
|
private:
|
|
virtual CSS::SizeWithAspectRatio compute_auto_content_box_size() const override { return { 13, 13, {} }; }
|
|
virtual GC::Ptr<Painting::Paintable> create_paintable() const override;
|
|
};
|
|
|
|
}
|