mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-01 12:07:14 +02: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.
28 lines
595 B
C++
28 lines
595 B
C++
/*
|
|
* Copyright (c) 2022, Andreas Kling <andreas@ladybird.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibWeb/Forward.h>
|
|
#include <LibWeb/Painting/PaintableBox.h>
|
|
|
|
namespace Web::Painting {
|
|
|
|
class CheckBoxPaintable final : public PaintableBox {
|
|
GC_CELL(CheckBoxPaintable, PaintableBox);
|
|
GC_DECLARE_ALLOCATOR(CheckBoxPaintable);
|
|
|
|
public:
|
|
static GC::Ref<CheckBoxPaintable> create(Layout::CheckBox const&);
|
|
|
|
virtual void paint(DisplayListRecordingContext&, PaintPhase) const override;
|
|
|
|
private:
|
|
CheckBoxPaintable(Layout::CheckBox const&);
|
|
};
|
|
|
|
}
|