mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-07 01:56:38 +00:00
LibWeb: Add methods to Document that must do nothing
This change adds the `clear()`, `captureEvents()` and `releaseEvents()` methods to the document object. These methods are obsolete, but are still included in the HTML specification, which says they must do nothing.
This commit is contained in:
parent
2b905cc482
commit
0564e06f10
Notes:
sideshowbarker
2024-07-18 05:37:06 +09:00
Author: https://github.com/tcl3
Commit: 0564e06f10
Pull-request: https://github.com/SerenityOS/serenity/pull/23959
5 changed files with 38 additions and 0 deletions
|
@ -0,0 +1,3 @@
|
||||||
|
document.clear() returns undefined: true
|
||||||
|
document.captureEvents() returns undefined: true
|
||||||
|
document.releaseEvents() returns undefined: true
|
|
@ -0,0 +1,9 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<script src="../include.js"></script>
|
||||||
|
<script>
|
||||||
|
test(() => {
|
||||||
|
println(`document.clear() returns undefined: ${document.clear() === undefined}`);
|
||||||
|
println(`document.captureEvents() returns undefined: ${document.captureEvents() === undefined}`);
|
||||||
|
println(`document.releaseEvents() returns undefined: ${document.releaseEvents() === undefined}`);
|
||||||
|
});
|
||||||
|
</script>
|
|
@ -1472,6 +1472,24 @@ JS::NonnullGCPtr<HTML::HTMLAllCollection> Document::all()
|
||||||
return *m_all;
|
return *m_all;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://html.spec.whatwg.org/multipage/obsolete.html#dom-document-clear
|
||||||
|
void Document::clear()
|
||||||
|
{
|
||||||
|
// Do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
// https://html.spec.whatwg.org/multipage/obsolete.html#dom-document-captureevents
|
||||||
|
void Document::capture_events()
|
||||||
|
{
|
||||||
|
// Do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
// https://html.spec.whatwg.org/multipage/obsolete.html#dom-document-releaseevents
|
||||||
|
void Document::release_events()
|
||||||
|
{
|
||||||
|
// Do nothing
|
||||||
|
}
|
||||||
|
|
||||||
Color Document::link_color() const
|
Color Document::link_color() const
|
||||||
{
|
{
|
||||||
if (m_link_color.has_value())
|
if (m_link_color.has_value())
|
||||||
|
|
|
@ -243,6 +243,10 @@ public:
|
||||||
JS::NonnullGCPtr<HTMLCollection> scripts();
|
JS::NonnullGCPtr<HTMLCollection> scripts();
|
||||||
JS::NonnullGCPtr<HTML::HTMLAllCollection> all();
|
JS::NonnullGCPtr<HTML::HTMLAllCollection> all();
|
||||||
|
|
||||||
|
void clear();
|
||||||
|
void capture_events();
|
||||||
|
void release_events();
|
||||||
|
|
||||||
String const& source() const { return m_source; }
|
String const& source() const { return m_source; }
|
||||||
void set_source(String source) { m_source = move(source); }
|
void set_source(String source) { m_source = move(source); }
|
||||||
|
|
||||||
|
|
|
@ -78,6 +78,10 @@ interface Document : Node {
|
||||||
|
|
||||||
readonly attribute HTMLAllCollection all;
|
readonly attribute HTMLAllCollection all;
|
||||||
|
|
||||||
|
undefined clear();
|
||||||
|
undefined captureEvents();
|
||||||
|
undefined releaseEvents();
|
||||||
|
|
||||||
[CEReactions, NewObject] Element createElement(DOMString tagName, optional (DOMString or ElementCreationOptions) options = {});
|
[CEReactions, NewObject] Element createElement(DOMString tagName, optional (DOMString or ElementCreationOptions) options = {});
|
||||||
[CEReactions, NewObject] Element createElementNS([FlyString] DOMString? namespace, DOMString qualifiedName, optional (DOMString or ElementCreationOptions) options = {});
|
[CEReactions, NewObject] Element createElementNS([FlyString] DOMString? namespace, DOMString qualifiedName, optional (DOMString or ElementCreationOptions) options = {});
|
||||||
DocumentFragment createDocumentFragment();
|
DocumentFragment createDocumentFragment();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue