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
Notes: sideshowbarker 2024-07-17 02:29:45 +09:00
6 changed files with 0 additions and 67 deletions

View file

@ -39,7 +39,6 @@ source_set("HTML") {
"HTMLAudioElement.cpp",
"HTMLBRElement.cpp",
"HTMLBaseElement.cpp",
"HTMLBlinkElement.cpp",
"HTMLBodyElement.cpp",
"HTMLButtonElement.cpp",
"HTMLCanvasElement.cpp",

View file

@ -272,7 +272,6 @@ set(SOURCES
HTML/HTMLAudioElement.cpp
HTML/HTMLBRElement.cpp
HTML/HTMLBaseElement.cpp
HTML/HTMLBlinkElement.cpp
HTML/HTMLBodyElement.cpp
HTML/HTMLButtonElement.cpp
HTML/HTMLCanvasElement.cpp

View file

@ -14,7 +14,6 @@
#include <LibWeb/HTML/HTMLAudioElement.h>
#include <LibWeb/HTML/HTMLBRElement.h>
#include <LibWeb/HTML/HTMLBaseElement.h>
#include <LibWeb/HTML/HTMLBlinkElement.h>
#include <LibWeb/HTML/HTMLBodyElement.h>
#include <LibWeb/HTML/HTMLButtonElement.h>
#include <LibWeb/HTML/HTMLCanvasElement.h>
@ -282,8 +281,6 @@ static JS::NonnullGCPtr<Element> create_html_element(JS::Realm& realm, Document&
return realm.heap().allocate<HTML::HTMLAudioElement>(realm, document, move(qualified_name));
if (lowercase_tag_name == HTML::TagNames::base)
return realm.heap().allocate<HTML::HTMLBaseElement>(realm, document, move(qualified_name));
if (lowercase_tag_name == HTML::TagNames::blink)
return realm.heap().allocate<HTML::HTMLBlinkElement>(realm, document, move(qualified_name));
if (lowercase_tag_name == HTML::TagNames::body)
return realm.heap().allocate<HTML::HTMLBodyElement>(realm, document, move(qualified_name));
if (lowercase_tag_name == HTML::TagNames::br)

View file

@ -335,7 +335,6 @@ class HTMLAnchorElement;
class HTMLAreaElement;
class HTMLAudioElement;
class HTMLBaseElement;
class HTMLBlinkElement;
class HTMLBodyElement;
class HTMLBRElement;
class HTMLButtonElement;

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;
};
}