1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 13:17:44 +00:00

LibWeb: Remove the HTML blink element

Support for this element has been removed from all major engines years
ago already, and it's currently the only reason we have a weird
"visible" flag on Layout::Node (which we toggle on a timer here..)
This commit is contained in:
Andreas Kling 2023-09-18 11:24:57 +02:00
parent 6fd8f9ea51
commit 0a133ccba4
6 changed files with 0 additions and 67 deletions

View file

@ -1,33 +0,0 @@
/*
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibWeb/HTML/HTMLBlinkElement.h>
#include <LibWeb/Layout/Node.h>
#include <LibWeb/Platform/Timer.h>
namespace Web::HTML {
HTMLBlinkElement::HTMLBlinkElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: HTMLElement(document, move(qualified_name))
, m_timer(Platform::Timer::create())
{
m_timer->set_interval(500);
m_timer->on_timeout = [this] { blink(); };
m_timer->start();
}
HTMLBlinkElement::~HTMLBlinkElement() = default;
void HTMLBlinkElement::blink()
{
if (!layout_node())
return;
layout_node()->set_visible(!layout_node()->is_visible());
layout_node()->set_needs_display();
}
}

View file

@ -1,28 +0,0 @@
/*
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibCore/Forward.h>
#include <LibWeb/HTML/HTMLElement.h>
namespace Web::HTML {
class HTMLBlinkElement final : public HTMLElement {
WEB_PLATFORM_OBJECT(HTMLBlinkElement, HTMLElement);
public:
virtual ~HTMLBlinkElement() override;
private:
HTMLBlinkElement(DOM::Document&, DOM::QualifiedName);
void blink();
NonnullRefPtr<Platform::Timer> m_timer;
};
}