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", "HTMLAudioElement.cpp",
"HTMLBRElement.cpp", "HTMLBRElement.cpp",
"HTMLBaseElement.cpp", "HTMLBaseElement.cpp",
"HTMLBlinkElement.cpp",
"HTMLBodyElement.cpp", "HTMLBodyElement.cpp",
"HTMLButtonElement.cpp", "HTMLButtonElement.cpp",
"HTMLCanvasElement.cpp", "HTMLCanvasElement.cpp",

View File

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

View File

@ -14,7 +14,6 @@
#include <LibWeb/HTML/HTMLAudioElement.h> #include <LibWeb/HTML/HTMLAudioElement.h>
#include <LibWeb/HTML/HTMLBRElement.h> #include <LibWeb/HTML/HTMLBRElement.h>
#include <LibWeb/HTML/HTMLBaseElement.h> #include <LibWeb/HTML/HTMLBaseElement.h>
#include <LibWeb/HTML/HTMLBlinkElement.h>
#include <LibWeb/HTML/HTMLBodyElement.h> #include <LibWeb/HTML/HTMLBodyElement.h>
#include <LibWeb/HTML/HTMLButtonElement.h> #include <LibWeb/HTML/HTMLButtonElement.h>
#include <LibWeb/HTML/HTMLCanvasElement.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)); return realm.heap().allocate<HTML::HTMLAudioElement>(realm, document, move(qualified_name));
if (lowercase_tag_name == HTML::TagNames::base) if (lowercase_tag_name == HTML::TagNames::base)
return realm.heap().allocate<HTML::HTMLBaseElement>(realm, document, move(qualified_name)); 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) if (lowercase_tag_name == HTML::TagNames::body)
return realm.heap().allocate<HTML::HTMLBodyElement>(realm, document, move(qualified_name)); return realm.heap().allocate<HTML::HTMLBodyElement>(realm, document, move(qualified_name));
if (lowercase_tag_name == HTML::TagNames::br) if (lowercase_tag_name == HTML::TagNames::br)

View File

@ -335,7 +335,6 @@ class HTMLAnchorElement;
class HTMLAreaElement; class HTMLAreaElement;
class HTMLAudioElement; class HTMLAudioElement;
class HTMLBaseElement; class HTMLBaseElement;
class HTMLBlinkElement;
class HTMLBodyElement; class HTMLBodyElement;
class HTMLBRElement; class HTMLBRElement;
class HTMLButtonElement; 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;
};
}