mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 04:39:06 +00:00
LibWeb: Implement Document.rootElement (SVG2 extension to Document)
This commit is contained in:
parent
e6f75801b1
commit
879cba762b
Notes:
github-actions[bot]
2025-05-16 18:37:14 +00:00
Author: https://github.com/awesomekling
Commit: 879cba762b
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4775
4 changed files with 16 additions and 3 deletions
|
@ -151,6 +151,7 @@
|
||||||
#include <LibWeb/ResizeObserver/ResizeObserverEntry.h>
|
#include <LibWeb/ResizeObserver/ResizeObserverEntry.h>
|
||||||
#include <LibWeb/SVG/SVGDecodedImageData.h>
|
#include <LibWeb/SVG/SVGDecodedImageData.h>
|
||||||
#include <LibWeb/SVG/SVGElement.h>
|
#include <LibWeb/SVG/SVGElement.h>
|
||||||
|
#include <LibWeb/SVG/SVGSVGElement.h>
|
||||||
#include <LibWeb/SVG/SVGStyleElement.h>
|
#include <LibWeb/SVG/SVGStyleElement.h>
|
||||||
#include <LibWeb/SVG/SVGTitleElement.h>
|
#include <LibWeb/SVG/SVGTitleElement.h>
|
||||||
#include <LibWeb/Selection/Selection.h>
|
#include <LibWeb/Selection/Selection.h>
|
||||||
|
@ -892,6 +893,12 @@ Element const* Document::document_element() const
|
||||||
return first_child_of_type<Element>();
|
return first_child_of_type<Element>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://www.w3.org/TR/SVG2/struct.html#InterfaceDocumentExtensions
|
||||||
|
GC::Ptr<SVG::SVGSVGElement> Document::root_element()
|
||||||
|
{
|
||||||
|
return as_if<SVG::SVGSVGElement>(document_element());
|
||||||
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/dom.html#the-html-element-2
|
// https://html.spec.whatwg.org/multipage/dom.html#the-html-element-2
|
||||||
HTML::HTMLHtmlElement* Document::html_element()
|
HTML::HTMLHtmlElement* Document::html_element()
|
||||||
{
|
{
|
||||||
|
|
|
@ -270,6 +270,9 @@ public:
|
||||||
Element* document_element();
|
Element* document_element();
|
||||||
Element const* document_element() const;
|
Element const* document_element() const;
|
||||||
|
|
||||||
|
// https://www.w3.org/TR/SVG2/struct.html#InterfaceDocumentExtensions
|
||||||
|
GC::Ptr<SVG::SVGSVGElement> root_element();
|
||||||
|
|
||||||
HTML::HTMLHtmlElement* html_element();
|
HTML::HTMLHtmlElement* html_element();
|
||||||
HTML::HTMLHeadElement* head();
|
HTML::HTMLHeadElement* head();
|
||||||
GC::Ptr<HTML::HTMLTitleElement> title_element();
|
GC::Ptr<HTML::HTMLTitleElement> title_element();
|
||||||
|
|
|
@ -156,6 +156,9 @@ interface Document : Node {
|
||||||
// special event handler IDL attributes that only apply to Document objects
|
// special event handler IDL attributes that only apply to Document objects
|
||||||
[LegacyLenientThis] attribute EventHandler onreadystatechange;
|
[LegacyLenientThis] attribute EventHandler onreadystatechange;
|
||||||
attribute EventHandler onvisibilitychange;
|
attribute EventHandler onvisibilitychange;
|
||||||
|
|
||||||
|
// https://www.w3.org/TR/SVG2/struct.html#InterfaceDocumentExtensions
|
||||||
|
readonly attribute SVGSVGElement? rootElement;
|
||||||
};
|
};
|
||||||
|
|
||||||
dictionary ElementCreationOptions {
|
dictionary ElementCreationOptions {
|
||||||
|
|
|
@ -2,8 +2,8 @@ Harness status: OK
|
||||||
|
|
||||||
Found 1781 tests
|
Found 1781 tests
|
||||||
|
|
||||||
873 Pass
|
874 Pass
|
||||||
908 Fail
|
907 Fail
|
||||||
Pass idl_test setup
|
Pass idl_test setup
|
||||||
Pass idl_test validation
|
Pass idl_test validation
|
||||||
Pass Partial interface Document: original interface defined
|
Pass Partial interface Document: original interface defined
|
||||||
|
@ -1784,4 +1784,4 @@ Fail SVGDiscardElement interface object name
|
||||||
Fail SVGDiscardElement interface: existence and properties of interface prototype object
|
Fail SVGDiscardElement interface: existence and properties of interface prototype object
|
||||||
Fail SVGDiscardElement interface: existence and properties of interface prototype object's "constructor" property
|
Fail SVGDiscardElement interface: existence and properties of interface prototype object's "constructor" property
|
||||||
Fail SVGDiscardElement interface: existence and properties of interface prototype object's @@unscopables property
|
Fail SVGDiscardElement interface: existence and properties of interface prototype object's @@unscopables property
|
||||||
Fail Document interface: attribute rootElement
|
Pass Document interface: attribute rootElement
|
Loading…
Add table
Add a link
Reference in a new issue