mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
Meta: Disallow links to single-page HTML spec
This commit is contained in:
parent
86c5bde83f
commit
9b8120d8e8
Notes:
github-actions[bot]
2025-02-05 23:05:51 +00:00
Author: https://github.com/Psychpsyo
Commit: 9b8120d8e8
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3454
Reviewed-by: https://github.com/tcl3 ✅
46 changed files with 88 additions and 65 deletions
|
@ -2923,7 +2923,7 @@ EventTarget* Document::get_parent(Event const& event)
|
||||||
return m_window;
|
return m_window;
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#completely-loaded
|
// https://html.spec.whatwg.org/multipage/document-lifecycle.html#completely-loaded
|
||||||
bool Document::is_completely_loaded() const
|
bool Document::is_completely_loaded() const
|
||||||
{
|
{
|
||||||
return m_completely_loaded_time.has_value();
|
return m_completely_loaded_time.has_value();
|
||||||
|
@ -2971,7 +2971,7 @@ void Document::completely_finish_loading()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#dom-document-cookie
|
// https://html.spec.whatwg.org/multipage/dom.html#dom-document-cookie
|
||||||
WebIDL::ExceptionOr<String> Document::cookie(Cookie::Source source)
|
WebIDL::ExceptionOr<String> Document::cookie(Cookie::Source source)
|
||||||
{
|
{
|
||||||
// On getting, if the document is a cookie-averse Document object, then the user agent must return the empty string.
|
// On getting, if the document is a cookie-averse Document object, then the user agent must return the empty string.
|
||||||
|
@ -2987,7 +2987,7 @@ WebIDL::ExceptionOr<String> Document::cookie(Cookie::Source source)
|
||||||
return page().client().page_did_request_cookie(m_url, source);
|
return page().client().page_did_request_cookie(m_url, source);
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#dom-document-cookie
|
// https://html.spec.whatwg.org/multipage/dom.html#dom-document-cookie
|
||||||
WebIDL::ExceptionOr<void> Document::set_cookie(StringView cookie_string, Cookie::Source source)
|
WebIDL::ExceptionOr<void> Document::set_cookie(StringView cookie_string, Cookie::Source source)
|
||||||
{
|
{
|
||||||
// On setting, if the document is a cookie-averse Document object, then the user agent must do nothing.
|
// On setting, if the document is a cookie-averse Document object, then the user agent must do nothing.
|
||||||
|
@ -3006,7 +3006,7 @@ WebIDL::ExceptionOr<void> Document::set_cookie(StringView cookie_string, Cookie:
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#cookie-averse-document-object
|
// https://html.spec.whatwg.org/multipage/dom.html#cookie-averse-document-object
|
||||||
bool Document::is_cookie_averse() const
|
bool Document::is_cookie_averse() const
|
||||||
{
|
{
|
||||||
// A Document object that falls into one of the following conditions is a cookie-averse Document object:
|
// A Document object that falls into one of the following conditions is a cookie-averse Document object:
|
||||||
|
|
|
@ -537,7 +537,7 @@ public:
|
||||||
auto& pending_scroll_event_targets() { return m_pending_scroll_event_targets; }
|
auto& pending_scroll_event_targets() { return m_pending_scroll_event_targets; }
|
||||||
auto& pending_scrollend_event_targets() { return m_pending_scrollend_event_targets; }
|
auto& pending_scrollend_event_targets() { return m_pending_scrollend_event_targets; }
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#completely-loaded
|
// https://html.spec.whatwg.org/multipage/document-lifecycle.html#completely-loaded
|
||||||
bool is_completely_loaded() const;
|
bool is_completely_loaded() const;
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/dom.html#concept-document-navigation-id
|
// https://html.spec.whatwg.org/multipage/dom.html#concept-document-navigation-id
|
||||||
|
@ -936,7 +936,7 @@ private:
|
||||||
// https://html.spec.whatwg.org/multipage/browsing-the-web.html#concept-document-salvageable
|
// https://html.spec.whatwg.org/multipage/browsing-the-web.html#concept-document-salvageable
|
||||||
bool m_salvageable { true };
|
bool m_salvageable { true };
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#page-showing
|
// https://html.spec.whatwg.org/multipage/document-lifecycle.html#page-showing
|
||||||
bool m_page_showing { false };
|
bool m_page_showing { false };
|
||||||
|
|
||||||
// Used by run_the_resize_steps().
|
// Used by run_the_resize_steps().
|
||||||
|
@ -993,7 +993,7 @@ private:
|
||||||
// https://drafts.csswg.org/css-font-loading/#font-source
|
// https://drafts.csswg.org/css-font-loading/#font-source
|
||||||
GC::Ptr<CSS::FontFaceSet> m_fonts;
|
GC::Ptr<CSS::FontFaceSet> m_fonts;
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#completely-loaded-time
|
// https://html.spec.whatwg.org/multipage/document-lifecycle.html#completely-loaded-time
|
||||||
Optional<AK::UnixDateTime> m_completely_loaded_time;
|
Optional<AK::UnixDateTime> m_completely_loaded_time;
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/dom.html#concept-document-navigation-id
|
// https://html.spec.whatwg.org/multipage/dom.html#concept-document-navigation-id
|
||||||
|
|
|
@ -61,7 +61,7 @@ interface Document : Node {
|
||||||
|
|
||||||
attribute DOMString cookie;
|
attribute DOMString cookie;
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#Document-partial
|
// https://html.spec.whatwg.org/multipage/obsolete.html#Document-partial
|
||||||
[CEReactions, LegacyNullToEmptyString] attribute DOMString fgColor;
|
[CEReactions, LegacyNullToEmptyString] attribute DOMString fgColor;
|
||||||
[CEReactions, LegacyNullToEmptyString] attribute DOMString linkColor;
|
[CEReactions, LegacyNullToEmptyString] attribute DOMString linkColor;
|
||||||
[CEReactions, LegacyNullToEmptyString] attribute DOMString vlinkColor;
|
[CEReactions, LegacyNullToEmptyString] attribute DOMString vlinkColor;
|
||||||
|
|
|
@ -3313,7 +3313,7 @@ CSS::StyleSheetList& Element::document_or_shadow_root_style_sheets()
|
||||||
return document().style_sheets();
|
return document().style_sheets();
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#dom-element-gethtml
|
// https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-element-gethtml
|
||||||
WebIDL::ExceptionOr<String> Element::get_html(GetHTMLOptions const& options) const
|
WebIDL::ExceptionOr<String> Element::get_html(GetHTMLOptions const& options) const
|
||||||
{
|
{
|
||||||
// Element's getHTML(options) method steps are to return the result
|
// Element's getHTML(options) method steps are to return the result
|
||||||
|
@ -3325,7 +3325,7 @@ WebIDL::ExceptionOr<String> Element::get_html(GetHTMLOptions const& options) con
|
||||||
options.shadow_roots);
|
options.shadow_roots);
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#dom-element-sethtmlunsafe
|
// https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-element-sethtmlunsafe
|
||||||
WebIDL::ExceptionOr<void> Element::set_html_unsafe(StringView html)
|
WebIDL::ExceptionOr<void> Element::set_html_unsafe(StringView html)
|
||||||
{
|
{
|
||||||
// FIXME: 1. Let compliantHTML be the result of invoking the Get Trusted Type compliant string algorithm with TrustedHTML, this's relevant global object, html, "Element setHTMLUnsafe", and "script".
|
// FIXME: 1. Let compliantHTML be the result of invoking the Get Trusted Type compliant string algorithm with TrustedHTML, this's relevant global object, html, "Element setHTMLUnsafe", and "script".
|
||||||
|
|
|
@ -102,7 +102,7 @@ interface Element : Node {
|
||||||
readonly attribute long clientHeight;
|
readonly attribute long clientHeight;
|
||||||
readonly attribute double currentCSSZoom;
|
readonly attribute double currentCSSZoom;
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#dom-parsing-and-serialization
|
// https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-parsing-and-serialization
|
||||||
// FIXME: [CEReactions] undefined setHTMLUnsafe((TrustedHTML or DOMString) html);
|
// FIXME: [CEReactions] undefined setHTMLUnsafe((TrustedHTML or DOMString) html);
|
||||||
[CEReactions] undefined setHTMLUnsafe(DOMString html);
|
[CEReactions] undefined setHTMLUnsafe(DOMString html);
|
||||||
DOMString getHTML(optional GetHTMLOptions options = {});
|
DOMString getHTML(optional GetHTMLOptions options = {});
|
||||||
|
|
|
@ -288,7 +288,7 @@ bool is_unknown_html_element(FlyString const& tag_name)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#elements-in-the-dom:element-interface
|
// https://html.spec.whatwg.org/multipage/dom.html#elements-in-the-dom%3Aelement-interface
|
||||||
static GC::Ref<Element> create_html_element(JS::Realm& realm, Document& document, QualifiedName qualified_name)
|
static GC::Ref<Element> create_html_element(JS::Realm& realm, Document& document, QualifiedName qualified_name)
|
||||||
{
|
{
|
||||||
FlyString tag_name = qualified_name.local_name();
|
FlyString tag_name = qualified_name.local_name();
|
||||||
|
|
|
@ -12,7 +12,7 @@ typedef OnErrorEventHandlerNonNull? OnErrorEventHandler;
|
||||||
callback OnBeforeUnloadEventHandlerNonNull = DOMString? (Event event);
|
callback OnBeforeUnloadEventHandlerNonNull = DOMString? (Event event);
|
||||||
typedef OnBeforeUnloadEventHandlerNonNull? OnBeforeUnloadEventHandler;
|
typedef OnBeforeUnloadEventHandlerNonNull? OnBeforeUnloadEventHandler;
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#globaleventhandlers
|
// https://html.spec.whatwg.org/multipage/webappapis.html#globaleventhandlers
|
||||||
interface mixin GlobalEventHandlers {
|
interface mixin GlobalEventHandlers {
|
||||||
attribute EventHandler onabort;
|
attribute EventHandler onabort;
|
||||||
attribute EventHandler onauxclick;
|
attribute EventHandler onauxclick;
|
||||||
|
@ -107,7 +107,7 @@ interface mixin GlobalEventHandlers {
|
||||||
attribute EventHandler onlostpointercapture;
|
attribute EventHandler onlostpointercapture;
|
||||||
};
|
};
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#windoweventhandlers
|
// https://html.spec.whatwg.org/multipage/webappapis.html#windoweventhandlers
|
||||||
interface mixin WindowEventHandlers {
|
interface mixin WindowEventHandlers {
|
||||||
attribute EventHandler onafterprint;
|
attribute EventHandler onafterprint;
|
||||||
attribute EventHandler onbeforeprint;
|
attribute EventHandler onbeforeprint;
|
||||||
|
|
|
@ -96,7 +96,7 @@ WebIDL::ExceptionOr<void> ShadowRoot::set_inner_html(StringView value)
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#dom-element-gethtml
|
// https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-element-gethtml
|
||||||
WebIDL::ExceptionOr<String> ShadowRoot::get_html(GetHTMLOptions const& options) const
|
WebIDL::ExceptionOr<String> ShadowRoot::get_html(GetHTMLOptions const& options) const
|
||||||
{
|
{
|
||||||
// ShadowRoot's getHTML(options) method steps are to return the result
|
// ShadowRoot's getHTML(options) method steps are to return the result
|
||||||
|
@ -108,7 +108,7 @@ WebIDL::ExceptionOr<String> ShadowRoot::get_html(GetHTMLOptions const& options)
|
||||||
options.shadow_roots);
|
options.shadow_roots);
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#dom-shadowroot-sethtmlunsafe
|
// https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-shadowroot-sethtmlunsafe
|
||||||
WebIDL::ExceptionOr<void> ShadowRoot::set_html_unsafe(StringView html)
|
WebIDL::ExceptionOr<void> ShadowRoot::set_html_unsafe(StringView html)
|
||||||
{
|
{
|
||||||
// FIXME: 1. Let compliantHTML be the result of invoking the Get Trusted Type compliant string algorithm with TrustedHTML, this's relevant global object, html, "ShadowRoot setHTMLUnsafe", and "script".
|
// FIXME: 1. Let compliantHTML be the result of invoking the Get Trusted Type compliant string algorithm with TrustedHTML, this's relevant global object, html, "ShadowRoot setHTMLUnsafe", and "script".
|
||||||
|
|
|
@ -16,7 +16,7 @@ ENUMERATE_HTML_ATTRIBUTES
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#boolean-attribute
|
// https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#boolean-attribute
|
||||||
bool is_boolean_attribute(FlyString const& attribute)
|
bool is_boolean_attribute(FlyString const& attribute)
|
||||||
{
|
{
|
||||||
// NOTE: For web compatibility, this matches the list of attributes which Chromium considers to be booleans,
|
// NOTE: For web compatibility, this matches the list of attributes which Chromium considers to be booleans,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// https://html.spec.whatwg.org/#canvasgradient
|
// https://html.spec.whatwg.org/multipage/canvas.html#canvasgradient
|
||||||
[Exposed=(Window,Worker)]
|
[Exposed=(Window,Worker)]
|
||||||
interface CanvasGradient {
|
interface CanvasGradient {
|
||||||
// opaque object
|
// opaque object
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// https://html.spec.whatwg.org/#canvaspattern
|
// https://html.spec.whatwg.org/multipage/canvas.html#canvaspattern
|
||||||
[Exposed=(Window,Worker)]
|
[Exposed=(Window,Worker)]
|
||||||
interface CanvasPattern {
|
interface CanvasPattern {
|
||||||
// opaque object
|
// opaque object
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#import <DOM/Node.idl>
|
#import <DOM/Node.idl>
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#customelementregistry
|
// https://html.spec.whatwg.org/multipage/custom-elements.html#customelementregistry
|
||||||
[Exposed=Window]
|
[Exposed=Window]
|
||||||
interface CustomElementRegistry {
|
interface CustomElementRegistry {
|
||||||
[CEReactions] undefined define(DOMString name, CustomElementConstructor constructor, optional ElementDefinitionOptions options = {});
|
[CEReactions] undefined define(DOMString name, CustomElementConstructor constructor, optional ElementDefinitionOptions options = {});
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// https://html.spec.whatwg.org/#domstringmap
|
// https://html.spec.whatwg.org/multipage/dom.html#domstringmap
|
||||||
[Exposed=Window, LegacyOverrideBuiltIns]
|
[Exposed=Window, LegacyOverrideBuiltIns]
|
||||||
interface DOMStringMap {
|
interface DOMStringMap {
|
||||||
getter DOMString (DOMString name);
|
getter DOMString (DOMString name);
|
||||||
|
|
|
@ -25,7 +25,7 @@ ElementInternals::ElementInternals(JS::Realm& realm, HTMLElement& target_element
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#dom-elementinternals-shadowroot
|
// https://html.spec.whatwg.org/multipage/custom-elements.html#dom-elementinternals-shadowroot
|
||||||
GC::Ptr<DOM::ShadowRoot> ElementInternals::shadow_root() const
|
GC::Ptr<DOM::ShadowRoot> ElementInternals::shadow_root() const
|
||||||
{
|
{
|
||||||
// 1. Let target be this's target element.
|
// 1. Let target be this's target element.
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#import <DOM/Event.idl>
|
#import <DOM/Event.idl>
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#errorevent
|
// https://html.spec.whatwg.org/multipage/webappapis.html#errorevent
|
||||||
[Exposed=(Window,Worker)]
|
[Exposed=(Window,Worker)]
|
||||||
interface ErrorEvent : Event {
|
interface ErrorEvent : Event {
|
||||||
constructor(DOMString type, optional ErrorEventInit eventInitDict = {});
|
constructor(DOMString type, optional ErrorEventInit eventInitDict = {});
|
||||||
|
@ -12,7 +12,7 @@ interface ErrorEvent : Event {
|
||||||
readonly attribute any error;
|
readonly attribute any error;
|
||||||
};
|
};
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#erroreventinit
|
// https://html.spec.whatwg.org/multipage/webappapis.html#erroreventinit
|
||||||
dictionary ErrorEventInit : EventInit {
|
dictionary ErrorEventInit : EventInit {
|
||||||
DOMString message = "";
|
DOMString message = "";
|
||||||
USVString filename = "";
|
USVString filename = "";
|
||||||
|
|
|
@ -252,7 +252,7 @@ void EventLoop::queue_task_to_update_the_rendering()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#update-the-rendering
|
// https://html.spec.whatwg.org/multipage/webappapis.html#update-the-rendering
|
||||||
void EventLoop::update_the_rendering()
|
void EventLoop::update_the_rendering()
|
||||||
{
|
{
|
||||||
VERIFY(!m_is_running_rendering_task);
|
VERIFY(!m_is_running_rendering_task);
|
||||||
|
@ -479,7 +479,7 @@ TaskID queue_global_task(HTML::Task::Source source, JS::Object& global_object, G
|
||||||
return queue_a_task(source, *event_loop, document, steps);
|
return queue_a_task(source, *event_loop, document, steps);
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#queue-a-microtask
|
// https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-microtask
|
||||||
void queue_a_microtask(DOM::Document const* document, GC::Ref<GC::Function<void()>> steps)
|
void queue_a_microtask(DOM::Document const* document, GC::Ref<GC::Function<void()>> steps)
|
||||||
{
|
{
|
||||||
// 1. If event loop was not given, set event loop to the implied event loop.
|
// 1. If event loop was not given, set event loop to the implied event loop.
|
||||||
|
@ -505,7 +505,7 @@ void perform_a_microtask_checkpoint()
|
||||||
main_thread_event_loop().perform_a_microtask_checkpoint();
|
main_thread_event_loop().perform_a_microtask_checkpoint();
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#perform-a-microtask-checkpoint
|
// https://html.spec.whatwg.org/multipage/webappapis.html#perform-a-microtask-checkpoint
|
||||||
void EventLoop::perform_a_microtask_checkpoint()
|
void EventLoop::perform_a_microtask_checkpoint()
|
||||||
{
|
{
|
||||||
if (execution_paused())
|
if (execution_paused())
|
||||||
|
|
|
@ -112,7 +112,7 @@ private:
|
||||||
|
|
||||||
GC::Ptr<Platform::Timer> m_system_event_loop_timer;
|
GC::Ptr<Platform::Timer> m_system_event_loop_timer;
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#performing-a-microtask-checkpoint
|
// https://html.spec.whatwg.org/multipage/webappapis.html#performing-a-microtask-checkpoint
|
||||||
bool m_performing_a_microtask_checkpoint { false };
|
bool m_performing_a_microtask_checkpoint { false };
|
||||||
|
|
||||||
Vector<WeakPtr<DOM::Document>> m_documents;
|
Vector<WeakPtr<DOM::Document>> m_documents;
|
||||||
|
|
|
@ -47,7 +47,7 @@ void Task::execute()
|
||||||
m_steps->function()();
|
m_steps->function()();
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#concept-task-runnable
|
// https://html.spec.whatwg.org/multipage/webappapis.html#concept-task-runnable
|
||||||
bool Task::is_runnable() const
|
bool Task::is_runnable() const
|
||||||
{
|
{
|
||||||
// A task is runnable if its document is either null or fully active.
|
// A task is runnable if its document is either null or fully active.
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#import <HTML/HTMLMediaElement.idl>
|
#import <HTML/HTMLMediaElement.idl>
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#htmlaudioelement
|
// https://html.spec.whatwg.org/multipage/media.html#htmlaudioelement
|
||||||
[Exposed=Window, LegacyFactoryFunction=Audio(optional DOMString src)]
|
[Exposed=Window, LegacyFactoryFunction=Audio(optional DOMString src)]
|
||||||
interface HTMLAudioElement : HTMLMediaElement {
|
interface HTMLAudioElement : HTMLMediaElement {
|
||||||
[HTMLConstructor] constructor();
|
[HTMLConstructor] constructor();
|
||||||
|
|
|
@ -225,7 +225,7 @@ void HTMLDetailsElement::ensure_details_exclusivity_by_closing_the_given_element
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#the-details-and-summary-elements
|
// https://html.spec.whatwg.org/multipage/rendering.html#the-details-and-summary-elements
|
||||||
WebIDL::ExceptionOr<void> HTMLDetailsElement::create_shadow_tree_if_needed()
|
WebIDL::ExceptionOr<void> HTMLDetailsElement::create_shadow_tree_if_needed()
|
||||||
{
|
{
|
||||||
if (shadow_root())
|
if (shadow_root())
|
||||||
|
@ -298,7 +298,7 @@ void HTMLDetailsElement::update_shadow_tree_slots()
|
||||||
update_shadow_tree_style();
|
update_shadow_tree_style();
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#the-details-and-summary-elements:the-details-element-6
|
// https://html.spec.whatwg.org/multipage/rendering.html#the-details-and-summary-elements%3Athe-details-element-6
|
||||||
void HTMLDetailsElement::update_shadow_tree_style()
|
void HTMLDetailsElement::update_shadow_tree_style()
|
||||||
{
|
{
|
||||||
if (!shadow_root())
|
if (!shadow_root())
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#import <DOM/Document.idl>
|
#import <DOM/Document.idl>
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#htmldocument
|
// https://html.spec.whatwg.org/multipage/nav-history-apis.html#htmldocument
|
||||||
[Exposed=Window]
|
[Exposed=Window]
|
||||||
interface HTMLDocument : Document {
|
interface HTMLDocument : Document {
|
||||||
};
|
};
|
||||||
|
|
|
@ -22,7 +22,7 @@ namespace Web::HTML {
|
||||||
__ENUMERATE_HTML_ELEMENT_DIR_ATTRIBUTE(rtl) \
|
__ENUMERATE_HTML_ELEMENT_DIR_ATTRIBUTE(rtl) \
|
||||||
__ENUMERATE_HTML_ELEMENT_DIR_ATTRIBUTE(auto)
|
__ENUMERATE_HTML_ELEMENT_DIR_ATTRIBUTE(auto)
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#attr-contenteditable
|
// https://html.spec.whatwg.org/multipage/interaction.html#attr-contenteditable
|
||||||
enum class ContentEditableState {
|
enum class ContentEditableState {
|
||||||
True,
|
True,
|
||||||
False,
|
False,
|
||||||
|
@ -182,7 +182,7 @@ private:
|
||||||
// https://html.spec.whatwg.org/multipage/custom-elements.html#attached-internals
|
// https://html.spec.whatwg.org/multipage/custom-elements.html#attached-internals
|
||||||
GC::Ptr<ElementInternals> m_attached_internals;
|
GC::Ptr<ElementInternals> m_attached_internals;
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#attr-contenteditable
|
// https://html.spec.whatwg.org/multipage/interaction.html#attr-contenteditable
|
||||||
ContentEditableState m_content_editable_state { ContentEditableState::Inherit };
|
ContentEditableState m_content_editable_state { ContentEditableState::Inherit };
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/interaction.html#click-in-progress-flag
|
// https://html.spec.whatwg.org/multipage/interaction.html#click-in-progress-flag
|
||||||
|
|
|
@ -73,7 +73,7 @@ enum EnterKeyHint {
|
||||||
"send"
|
"send"
|
||||||
};
|
};
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#attr-inputmode
|
// https://html.spec.whatwg.org/multipage/interaction.html#attr-inputmode
|
||||||
enum InputMode {
|
enum InputMode {
|
||||||
"none",
|
"none",
|
||||||
"text",
|
"text",
|
||||||
|
@ -85,7 +85,7 @@ enum InputMode {
|
||||||
"search"
|
"search"
|
||||||
};
|
};
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#elementcontenteditable
|
// https://html.spec.whatwg.org/multipage/interaction.html#elementcontenteditable
|
||||||
interface mixin ElementContentEditable {
|
interface mixin ElementContentEditable {
|
||||||
[CEReactions] attribute DOMString contentEditable;
|
[CEReactions] attribute DOMString contentEditable;
|
||||||
[Reflect=enterkeyhint, Enumerated=EnterKeyHint, CEReactions] attribute DOMString enterKeyHint;
|
[Reflect=enterkeyhint, Enumerated=EnterKeyHint, CEReactions] attribute DOMString enterKeyHint;
|
||||||
|
|
|
@ -160,7 +160,7 @@ WebIDL::ExceptionOr<void> HTMLOptionsCollection::add(HTMLOptionOrOptGroupElement
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#dom-htmloptionscollection-remove
|
// https://html.spec.whatwg.org/multipage/common-dom-interfaces.html#dom-htmloptionscollection-remove
|
||||||
void HTMLOptionsCollection::remove(WebIDL::Long index)
|
void HTMLOptionsCollection::remove(WebIDL::Long index)
|
||||||
{
|
{
|
||||||
// 1. If the number of nodes represented by the collection is zero, return.
|
// 1. If the number of nodes represented by the collection is zero, return.
|
||||||
|
@ -178,7 +178,7 @@ void HTMLOptionsCollection::remove(WebIDL::Long index)
|
||||||
element->remove();
|
element->remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#dom-htmloptionscollection-selectedindex
|
// https://html.spec.whatwg.org/multipage/common-dom-interfaces.html#dom-htmloptionscollection-selectedindex
|
||||||
WebIDL::Long HTMLOptionsCollection::selected_index() const
|
WebIDL::Long HTMLOptionsCollection::selected_index() const
|
||||||
{
|
{
|
||||||
// The selectedIndex IDL attribute must act like the identically named attribute
|
// The selectedIndex IDL attribute must act like the identically named attribute
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#import <HTML/HTMLOptionElement.idl>
|
#import <HTML/HTMLOptionElement.idl>
|
||||||
#import <HTML/HTMLOptGroupElement.idl>
|
#import <HTML/HTMLOptGroupElement.idl>
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#htmloptionscollection
|
// https://html.spec.whatwg.org/multipage/common-dom-interfaces.html#htmloptionscollection
|
||||||
[Exposed=Window]
|
[Exposed=Window]
|
||||||
interface HTMLOptionsCollection : HTMLCollection {
|
interface HTMLOptionsCollection : HTMLCollection {
|
||||||
[CEReactions] attribute unsigned long length; // shadows inherited length
|
[CEReactions] attribute unsigned long length; // shadows inherited length
|
||||||
|
|
|
@ -17,7 +17,7 @@ class HTMLOrSVGElement {
|
||||||
public:
|
public:
|
||||||
[[nodiscard]] GC::Ref<DOMStringMap> dataset();
|
[[nodiscard]] GC::Ref<DOMStringMap> dataset();
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#dom-noncedelement-nonce
|
// https://html.spec.whatwg.org/multipage/urls-and-fetching.html#dom-noncedelement-nonce
|
||||||
String const& nonce() { return m_cryptographic_nonce; }
|
String const& nonce() { return m_cryptographic_nonce; }
|
||||||
void set_nonce(String const& nonce) { m_cryptographic_nonce = nonce; }
|
void set_nonce(String const& nonce) { m_cryptographic_nonce = nonce; }
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ protected:
|
||||||
// https://html.spec.whatwg.org/multipage/dom.html#dom-dataset-dev
|
// https://html.spec.whatwg.org/multipage/dom.html#dom-dataset-dev
|
||||||
GC::Ptr<DOMStringMap> m_dataset;
|
GC::Ptr<DOMStringMap> m_dataset;
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#cryptographicnonce
|
// https://html.spec.whatwg.org/multipage/urls-and-fetching.html#cryptographicnonce
|
||||||
String m_cryptographic_nonce;
|
String m_cryptographic_nonce;
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/interaction.html#locked-for-focus
|
// https://html.spec.whatwg.org/multipage/interaction.html#locked-for-focus
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#import <HTML/DOMStringMap.idl>
|
#import <HTML/DOMStringMap.idl>
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#htmlorsvgelement
|
// https://html.spec.whatwg.org/multipage/dom.html#htmlorsvgelement
|
||||||
interface mixin HTMLOrSVGElement {
|
interface mixin HTMLOrSVGElement {
|
||||||
[SameObject] readonly attribute DOMStringMap dataset;
|
[SameObject] readonly attribute DOMStringMap dataset;
|
||||||
attribute DOMString nonce; // intentionally no [CEReactions]
|
attribute DOMString nonce; // intentionally no [CEReactions]
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#import <HTML/Plugin.idl>
|
#import <HTML/Plugin.idl>
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#mimetype
|
// https://html.spec.whatwg.org/multipage/system-state.html#mimetype
|
||||||
[Exposed=Window]
|
[Exposed=Window]
|
||||||
interface MimeType {
|
interface MimeType {
|
||||||
readonly attribute DOMString type;
|
readonly attribute DOMString type;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#import <HTML/MimeType.idl>
|
#import <HTML/MimeType.idl>
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#mimetypearray
|
// https://html.spec.whatwg.org/multipage/system-state.html#mimetypearray
|
||||||
[Exposed=Window, LegacyUnenumerableNamedProperties]
|
[Exposed=Window, LegacyUnenumerableNamedProperties]
|
||||||
interface MimeTypeArray {
|
interface MimeTypeArray {
|
||||||
readonly attribute unsigned long length;
|
readonly attribute unsigned long length;
|
||||||
|
|
|
@ -2202,7 +2202,7 @@ void Navigable::perform_scroll_of_viewport(CSSPixelPoint new_position)
|
||||||
HTML::main_thread_event_loop().schedule();
|
HTML::main_thread_event_loop().schedule();
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#rendering-opportunity
|
// https://html.spec.whatwg.org/multipage/webappapis.html#rendering-opportunity
|
||||||
bool Navigable::has_a_rendering_opportunity() const
|
bool Navigable::has_a_rendering_opportunity() const
|
||||||
{
|
{
|
||||||
// A navigable has a rendering opportunity if the user agent is currently able to present
|
// A navigable has a rendering opportunity if the user agent is currently able to present
|
||||||
|
|
|
@ -174,7 +174,7 @@ public:
|
||||||
virtual void set_viewport_size(CSSPixelSize);
|
virtual void set_viewport_size(CSSPixelSize);
|
||||||
void perform_scroll_of_viewport(CSSPixelPoint position);
|
void perform_scroll_of_viewport(CSSPixelPoint position);
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#rendering-opportunity
|
// https://html.spec.whatwg.org/multipage/webappapis.html#rendering-opportunity
|
||||||
[[nodiscard]] bool has_a_rendering_opportunity() const;
|
[[nodiscard]] bool has_a_rendering_opportunity() const;
|
||||||
|
|
||||||
[[nodiscard]] TargetSnapshotParams snapshot_target_snapshot_params();
|
[[nodiscard]] TargetSnapshotParams snapshot_target_snapshot_params();
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#import <HTML/NavigationType.idl>
|
#import <HTML/NavigationType.idl>
|
||||||
#import <HTML/NavigationHistoryEntry.idl>
|
#import <HTML/NavigationHistoryEntry.idl>
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#navigationtransition
|
// https://html.spec.whatwg.org/multipage/nav-history-apis.html#navigationtransition
|
||||||
[Exposed=Window]
|
[Exposed=Window]
|
||||||
interface NavigationTransition {
|
interface NavigationTransition {
|
||||||
readonly attribute NavigationType navigationType;
|
readonly attribute NavigationType navigationType;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#import <HTML/MimeType.idl>
|
#import <HTML/MimeType.idl>
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#plugin
|
// https://html.spec.whatwg.org/multipage/infrastructure.html#plugin
|
||||||
[Exposed=Window, LegacyUnenumerableNamedProperties]
|
[Exposed=Window, LegacyUnenumerableNamedProperties]
|
||||||
interface Plugin {
|
interface Plugin {
|
||||||
readonly attribute DOMString name;
|
readonly attribute DOMString name;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#import <HTML/Plugin.idl>
|
#import <HTML/Plugin.idl>
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#pluginarray
|
// https://html.spec.whatwg.org/multipage/system-state.html#pluginarray
|
||||||
[Exposed=Window, LegacyUnenumerableNamedProperties]
|
[Exposed=Window, LegacyUnenumerableNamedProperties]
|
||||||
interface PluginArray {
|
interface PluginArray {
|
||||||
undefined refresh();
|
undefined refresh();
|
||||||
|
|
|
@ -52,7 +52,7 @@ void report_exception_to_console(JS::Value value, JS::Realm& realm, ErrorInPromi
|
||||||
console.report_exception(*JS::Error::create(realm, value.to_string_without_side_effects()), error_in_promise == ErrorInPromise::Yes);
|
console.report_exception(*JS::Error::create(realm, value.to_string_without_side_effects()), error_in_promise == ErrorInPromise::Yes);
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#report-the-exception
|
// https://html.spec.whatwg.org/multipage/webappapis.html#report-the-exception
|
||||||
void report_exception(JS::Completion const& throw_completion, JS::Realm& realm)
|
void report_exception(JS::Completion const& throw_completion, JS::Realm& realm)
|
||||||
{
|
{
|
||||||
VERIFY(throw_completion.type() == JS::Completion::Type::Throw);
|
VERIFY(throw_completion.type() == JS::Completion::Type::Throw);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// https://html.spec.whatwg.org/#storage-2
|
// https://html.spec.whatwg.org/multipage/webstorage.html#storage-2
|
||||||
[Exposed=Window]
|
[Exposed=Window]
|
||||||
interface Storage {
|
interface Storage {
|
||||||
|
|
||||||
|
|
|
@ -74,7 +74,7 @@ namespace Web::HTML {
|
||||||
|
|
||||||
GC_DEFINE_ALLOCATOR(Window);
|
GC_DEFINE_ALLOCATOR(Window);
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#run-the-animation-frame-callbacks
|
// https://html.spec.whatwg.org/multipage/imagebitmap-and-animations.html#run-the-animation-frame-callbacks
|
||||||
void run_animation_frame_callbacks(DOM::Document& document, double now)
|
void run_animation_frame_callbacks(DOM::Document& document, double now)
|
||||||
{
|
{
|
||||||
// FIXME: Bring this closer to the spec.
|
// FIXME: Bring this closer to the spec.
|
||||||
|
@ -422,7 +422,7 @@ Optional<CSS::MediaFeatureValue> Window::query_media_feature(CSS::MediaFeatureID
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#fire-a-page-transition-event
|
// https://html.spec.whatwg.org/multipage/nav-history-apis.html#fire-a-page-transition-event
|
||||||
void Window::fire_a_page_transition_event(FlyString const& event_name, bool persisted)
|
void Window::fire_a_page_transition_event(FlyString const& event_name, bool persisted)
|
||||||
{
|
{
|
||||||
// To fire a page transition event named eventName at a Window window with a boolean persisted,
|
// To fire a page transition event named eventName at a Window window with a boolean persisted,
|
||||||
|
@ -1678,7 +1678,7 @@ GC::Ref<CustomElementRegistry> Window::custom_elements()
|
||||||
return GC::Ref { *m_custom_element_registry };
|
return GC::Ref { *m_custom_element_registry };
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#document-tree-child-navigable-target-name-property-set
|
// https://html.spec.whatwg.org/multipage/nav-history-apis.html#document-tree-child-navigable-target-name-property-set
|
||||||
OrderedHashMap<FlyString, GC::Ref<Navigable>> Window::document_tree_child_navigable_target_name_property_set()
|
OrderedHashMap<FlyString, GC::Ref<Navigable>> Window::document_tree_child_navigable_target_name_property_set()
|
||||||
{
|
{
|
||||||
// The document-tree child navigable target name property set of a Window object window is the return value of running these steps:
|
// The document-tree child navigable target name property set of a Window object window is the return value of running these steps:
|
||||||
|
@ -1720,7 +1720,7 @@ OrderedHashMap<FlyString, GC::Ref<Navigable>> Window::document_tree_child_naviga
|
||||||
return names;
|
return names;
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#named-access-on-the-window-object
|
// https://html.spec.whatwg.org/multipage/nav-history-apis.html#named-access-on-the-window-object
|
||||||
Vector<FlyString> Window::supported_property_names() const
|
Vector<FlyString> Window::supported_property_names() const
|
||||||
{
|
{
|
||||||
// FIXME: Make the const-correctness of the methods this method calls less cowboy.
|
// FIXME: Make the const-correctness of the methods this method calls less cowboy.
|
||||||
|
@ -1754,7 +1754,7 @@ Vector<FlyString> Window::supported_property_names() const
|
||||||
return property_names.values();
|
return property_names.values();
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#named-access-on-the-window-object
|
// https://html.spec.whatwg.org/multipage/nav-history-apis.html#named-access-on-the-window-object
|
||||||
JS::Value Window::named_item_value(FlyString const& name) const
|
JS::Value Window::named_item_value(FlyString const& name) const
|
||||||
{
|
{
|
||||||
// FIXME: Make the const-correctness of the methods this method calls less cowboy.
|
// FIXME: Make the const-correctness of the methods this method calls less cowboy.
|
||||||
|
@ -1798,7 +1798,7 @@ JS::Value Window::named_item_value(FlyString const& name) const
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#dom-window-nameditem-filter
|
// https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-window-nameditem-filter
|
||||||
Window::NamedObjects Window::named_objects(StringView name)
|
Window::NamedObjects Window::named_objects(StringView name)
|
||||||
{
|
{
|
||||||
// NOTE: Since the Window interface has the [Global] extended attribute, its named properties
|
// NOTE: Since the Window interface has the [Global] extended attribute, its named properties
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
namespace Web::HTML {
|
namespace Web::HTML {
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#timerhandler
|
// https://html.spec.whatwg.org/multipage/webappapis.html#timerhandler
|
||||||
using TimerHandler = Variant<GC::Ref<WebIDL::CallbackType>, String>;
|
using TimerHandler = Variant<GC::Ref<WebIDL::CallbackType>, String>;
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/webappapis.html#windoworworkerglobalscope
|
// https://html.spec.whatwg.org/multipage/webappapis.html#windoworworkerglobalscope
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
#import <HTML/MessagePort.idl>
|
#import <HTML/MessagePort.idl>
|
||||||
#import <IndexedDB/IDBFactory.idl>
|
#import <IndexedDB/IDBFactory.idl>
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#timerhandler
|
// https://html.spec.whatwg.org/multipage/webappapis.html#timerhandler
|
||||||
typedef (DOMString or Function) TimerHandler;
|
typedef (DOMString or Function) TimerHandler;
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/webappapis.html#windoworworkerglobalscope
|
// https://html.spec.whatwg.org/multipage/webappapis.html#windoworworkerglobalscope
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#import <HTML/MessagePort.idl>
|
#import <HTML/MessagePort.idl>
|
||||||
#import <Fetch/Request.idl>
|
#import <Fetch/Request.idl>
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#worker
|
// https://html.spec.whatwg.org/multipage/workers.html#worker
|
||||||
[Exposed=(Window,DedicatedWorker,SharedWorker)]
|
[Exposed=(Window,DedicatedWorker,SharedWorker)]
|
||||||
interface Worker : EventTarget {
|
interface Worker : EventTarget {
|
||||||
constructor(DOMString scriptURL, optional WorkerOptions options = {});
|
constructor(DOMString scriptURL, optional WorkerOptions options = {});
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// https://html.spec.whatwg.org/#workerlocation
|
// https://html.spec.whatwg.org/multipage/workers.html#workerlocation
|
||||||
[Exposed=Worker]
|
[Exposed=Worker]
|
||||||
interface WorkerLocation {
|
interface WorkerLocation {
|
||||||
stringifier readonly attribute USVString href;
|
stringifier readonly attribute USVString href;
|
||||||
|
|
|
@ -23,7 +23,7 @@ FieldSetBox::~FieldSetBox() = default;
|
||||||
|
|
||||||
bool FieldSetBox::has_rendered_legend() const
|
bool FieldSetBox::has_rendered_legend() const
|
||||||
{
|
{
|
||||||
// https://html.spec.whatwg.org/#rendered-legend
|
// https://html.spec.whatwg.org/multipage/rendering.html#rendered-legend
|
||||||
bool has_rendered_legend = false;
|
bool has_rendered_legend = false;
|
||||||
if (has_children()) {
|
if (has_children()) {
|
||||||
for_each_child_of_type<Box>([&](Box const& child) {
|
for_each_child_of_type<Box>([&](Box const& child) {
|
||||||
|
|
|
@ -118,7 +118,7 @@ bool FormattingContext::creates_block_formatting_context(Box const& box)
|
||||||
|
|
||||||
// FIXME: column-span: all should always create a new formatting context, even when the column-span: all element isn't contained by a multicol container (Spec change, Chrome bug).
|
// FIXME: column-span: all should always create a new formatting context, even when the column-span: all element isn't contained by a multicol container (Spec change, Chrome bug).
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#the-fieldset-and-legend-elements
|
// https://html.spec.whatwg.org/multipage/rendering.html#the-fieldset-and-legend-elements
|
||||||
if (box.is_fieldset_box())
|
if (box.is_fieldset_box())
|
||||||
// The fieldset element, when it generates a CSS box, is expected to act as follows:
|
// The fieldset element, when it generates a CSS box, is expected to act as follows:
|
||||||
// The element is expected to establish a new block formatting context.
|
// The element is expected to establish a new block formatting context.
|
||||||
|
|
|
@ -19,6 +19,8 @@ parser.add_argument("--overwrite-inplace", action=argparse.BooleanOptionalAction
|
||||||
parser.add_argument('filenames', nargs='*')
|
parser.add_argument('filenames', nargs='*')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
SINGLE_PAGE_HTML_SPEC_LINK = re.compile('//.*https://html\\.spec\\.whatwg\\.org/#')
|
||||||
|
|
||||||
|
|
||||||
def find_files_here_or_argv():
|
def find_files_here_or_argv():
|
||||||
if args.filenames:
|
if args.filenames:
|
||||||
|
@ -32,11 +34,15 @@ def find_files_here_or_argv():
|
||||||
def run():
|
def run():
|
||||||
"""Lint WebIDL files checked into git for four leading spaces on each line."""
|
"""Lint WebIDL files checked into git for four leading spaces on each line."""
|
||||||
files_without_four_leading_spaces = set()
|
files_without_four_leading_spaces = set()
|
||||||
|
"""Also lint for them not containing any links to the single-page HTML spec."""
|
||||||
|
files_with_single_page_html_spec_link = set()
|
||||||
did_fail = False
|
did_fail = False
|
||||||
for filename in find_files_here_or_argv():
|
for filename in find_files_here_or_argv():
|
||||||
lines = []
|
lines = []
|
||||||
with open(filename, "r") as f:
|
with open(filename, "r") as f:
|
||||||
for line_number, line in enumerate(f, start=1):
|
for line_number, line in enumerate(f, start=1):
|
||||||
|
if SINGLE_PAGE_HTML_SPEC_LINK.search(line):
|
||||||
|
files_with_single_page_html_spec_link.add(filename)
|
||||||
if lines_to_skip.match(line):
|
if lines_to_skip.match(line):
|
||||||
lines.append(line)
|
lines.append(line)
|
||||||
continue
|
continue
|
||||||
|
@ -60,6 +66,11 @@ def run():
|
||||||
if not args.overwrite_inplace:
|
if not args.overwrite_inplace:
|
||||||
print(
|
print(
|
||||||
f"\nTo fix the WebIDL files in place, run: ./Meta/{script_name} --overwrite-inplace")
|
f"\nTo fix the WebIDL files in place, run: ./Meta/{script_name} --overwrite-inplace")
|
||||||
|
|
||||||
|
if files_with_single_page_html_spec_link:
|
||||||
|
print("\nWebIDL files that have links to the single-page HTML spec:",
|
||||||
|
" ".join(files_with_single_page_html_spec_link))
|
||||||
|
|
||||||
if did_fail:
|
if did_fail:
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,9 @@ LOCAL_INCLUDE_SUFFIX_EXCLUDES = [
|
||||||
'.moc',
|
'.moc',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# We check for and disallow any comments linking to the single-page HTML spec because it takes a long time to load.
|
||||||
|
SINGLE_PAGE_HTML_SPEC_LINK = re.compile('//.*https://html\\.spec\\.whatwg\\.org/#')
|
||||||
|
|
||||||
|
|
||||||
def should_check_file(filename):
|
def should_check_file(filename):
|
||||||
if not filename.endswith('.cpp') and not filename.endswith('.h'):
|
if not filename.endswith('.cpp') and not filename.endswith('.h'):
|
||||||
|
@ -93,6 +96,7 @@ def run():
|
||||||
errors_include_weird_format = []
|
errors_include_weird_format = []
|
||||||
errors_include_missing_local = []
|
errors_include_missing_local = []
|
||||||
errors_include_bad_complex = []
|
errors_include_bad_complex = []
|
||||||
|
errors_single_page_html_spec = []
|
||||||
|
|
||||||
for filename in find_files_here_or_argv():
|
for filename in find_files_here_or_argv():
|
||||||
with open(filename, "r") as f:
|
with open(filename, "r") as f:
|
||||||
|
@ -140,6 +144,8 @@ def run():
|
||||||
print(f"In {filename}: Cannot find {referenced_file}")
|
print(f"In {filename}: Cannot find {referenced_file}")
|
||||||
if filename not in errors_include_missing_local:
|
if filename not in errors_include_missing_local:
|
||||||
errors_include_missing_local.append(filename)
|
errors_include_missing_local.append(filename)
|
||||||
|
if SINGLE_PAGE_HTML_SPEC_LINK.search(file_content):
|
||||||
|
errors_single_page_html_spec.append(filename)
|
||||||
|
|
||||||
have_errors = False
|
have_errors = False
|
||||||
if errors_license:
|
if errors_license:
|
||||||
|
@ -175,6 +181,12 @@ def run():
|
||||||
" ".join(errors_include_bad_complex),
|
" ".join(errors_include_bad_complex),
|
||||||
)
|
)
|
||||||
have_errors = True
|
have_errors = True
|
||||||
|
if errors_single_page_html_spec:
|
||||||
|
print(
|
||||||
|
"Files with links to the single-page HTML spec:",
|
||||||
|
" ".join(errors_single_page_html_spec)
|
||||||
|
)
|
||||||
|
have_errors = True
|
||||||
|
|
||||||
if have_errors:
|
if have_errors:
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
|
@ -145,7 +145,7 @@ static Optional<Web::DOM::Element&> container_for_element(Web::DOM::Element& ele
|
||||||
// An element’s container is:
|
// An element’s container is:
|
||||||
// -> option element in a valid element context
|
// -> option element in a valid element context
|
||||||
// -> optgroup element in a valid element context
|
// -> optgroup element in a valid element context
|
||||||
// FIXME: Determine if the element is in a valid element context. (https://html.spec.whatwg.org/#concept-element-contexts)
|
// FIXME: Determine if the element is in a valid element context. (https://html.spec.whatwg.org/multipage/dom.html#concept-element-contexts)
|
||||||
if (is<Web::HTML::HTMLOptionElement>(element) || is<Web::HTML::HTMLOptGroupElement>(element)) {
|
if (is<Web::HTML::HTMLOptionElement>(element) || is<Web::HTML::HTMLOptGroupElement>(element)) {
|
||||||
// The element’s element context, which is determined by:
|
// The element’s element context, which is determined by:
|
||||||
// 1. Let datalist parent be the first datalist element reached by traversing the tree in reverse order from element, or undefined if the root of the tree is reached.
|
// 1. Let datalist parent be the first datalist element reached by traversing the tree in reverse order from element, or undefined if the root of the tree is reached.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue