mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +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:
parent
6fd8f9ea51
commit
0a133ccba4
Notes:
sideshowbarker
2024-07-17 02:29:45 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/0a133ccba4 Pull-request: https://github.com/SerenityOS/serenity/pull/21138 Issue: https://github.com/SerenityOS/serenity/issues/21106
6 changed files with 0 additions and 67 deletions
|
@ -39,7 +39,6 @@ source_set("HTML") {
|
|||
"HTMLAudioElement.cpp",
|
||||
"HTMLBRElement.cpp",
|
||||
"HTMLBaseElement.cpp",
|
||||
"HTMLBlinkElement.cpp",
|
||||
"HTMLBodyElement.cpp",
|
||||
"HTMLButtonElement.cpp",
|
||||
"HTMLCanvasElement.cpp",
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -335,7 +335,6 @@ class HTMLAnchorElement;
|
|||
class HTMLAreaElement;
|
||||
class HTMLAudioElement;
|
||||
class HTMLBaseElement;
|
||||
class HTMLBlinkElement;
|
||||
class HTMLBodyElement;
|
||||
class HTMLBRElement;
|
||||
class HTMLButtonElement;
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
}
|
|
@ -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;
|
||||
};
|
||||
|
||||
}
|
Loading…
Reference in a new issue