From 9b8120d8e8f2b02dc9a953d8dfedcc1771f0e43c Mon Sep 17 00:00:00 2001 From: Psychpsyo Date: Tue, 4 Feb 2025 13:01:46 +0100 Subject: [PATCH] Meta: Disallow links to single-page HTML spec --- Libraries/LibWeb/DOM/Document.cpp | 8 ++++---- Libraries/LibWeb/DOM/Document.h | 6 +++--- Libraries/LibWeb/DOM/Document.idl | 2 +- Libraries/LibWeb/DOM/Element.cpp | 4 ++-- Libraries/LibWeb/DOM/Element.idl | 2 +- Libraries/LibWeb/DOM/ElementFactory.cpp | 2 +- Libraries/LibWeb/DOM/EventHandler.idl | 4 ++-- Libraries/LibWeb/DOM/ShadowRoot.cpp | 4 ++-- Libraries/LibWeb/HTML/AttributeNames.cpp | 2 +- Libraries/LibWeb/HTML/CanvasGradient.idl | 2 +- Libraries/LibWeb/HTML/CanvasPattern.idl | 2 +- .../HTML/CustomElements/CustomElementRegistry.idl | 2 +- Libraries/LibWeb/HTML/DOMStringMap.idl | 2 +- Libraries/LibWeb/HTML/ElementInternals.cpp | 2 +- Libraries/LibWeb/HTML/ErrorEvent.idl | 4 ++-- Libraries/LibWeb/HTML/EventLoop/EventLoop.cpp | 6 +++--- Libraries/LibWeb/HTML/EventLoop/EventLoop.h | 2 +- Libraries/LibWeb/HTML/EventLoop/Task.cpp | 2 +- Libraries/LibWeb/HTML/HTMLAudioElement.idl | 2 +- Libraries/LibWeb/HTML/HTMLDetailsElement.cpp | 4 ++-- Libraries/LibWeb/HTML/HTMLDocument.idl | 2 +- Libraries/LibWeb/HTML/HTMLElement.h | 4 ++-- Libraries/LibWeb/HTML/HTMLElement.idl | 4 ++-- Libraries/LibWeb/HTML/HTMLOptionsCollection.cpp | 4 ++-- Libraries/LibWeb/HTML/HTMLOptionsCollection.idl | 2 +- Libraries/LibWeb/HTML/HTMLOrSVGElement.h | 4 ++-- Libraries/LibWeb/HTML/HTMLOrSVGElement.idl | 2 +- Libraries/LibWeb/HTML/MimeType.idl | 2 +- Libraries/LibWeb/HTML/MimeTypeArray.idl | 2 +- Libraries/LibWeb/HTML/Navigable.cpp | 2 +- Libraries/LibWeb/HTML/Navigable.h | 2 +- Libraries/LibWeb/HTML/NavigationTransition.idl | 2 +- Libraries/LibWeb/HTML/Plugin.idl | 2 +- Libraries/LibWeb/HTML/PluginArray.idl | 2 +- .../LibWeb/HTML/Scripting/ExceptionReporter.cpp | 2 +- Libraries/LibWeb/HTML/Storage.idl | 2 +- Libraries/LibWeb/HTML/Window.cpp | 12 ++++++------ Libraries/LibWeb/HTML/WindowOrWorkerGlobalScope.h | 2 +- Libraries/LibWeb/HTML/WindowOrWorkerGlobalScope.idl | 2 +- Libraries/LibWeb/HTML/Worker.idl | 2 +- Libraries/LibWeb/HTML/WorkerLocation.idl | 2 +- Libraries/LibWeb/Layout/FieldSetBox.cpp | 2 +- Libraries/LibWeb/Layout/FormattingContext.cpp | 2 +- Meta/check-idl-files.py | 11 +++++++++++ Meta/check-style.py | 12 ++++++++++++ Services/WebContent/WebDriverConnection.cpp | 2 +- 46 files changed, 88 insertions(+), 65 deletions(-) diff --git a/Libraries/LibWeb/DOM/Document.cpp b/Libraries/LibWeb/DOM/Document.cpp index 3a715745fe5..6c82c158464 100644 --- a/Libraries/LibWeb/DOM/Document.cpp +++ b/Libraries/LibWeb/DOM/Document.cpp @@ -2923,7 +2923,7 @@ EventTarget* Document::get_parent(Event const& event) 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 { 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 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. @@ -2987,7 +2987,7 @@ WebIDL::ExceptionOr Document::cookie(Cookie::Source 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 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. @@ -3006,7 +3006,7 @@ WebIDL::ExceptionOr Document::set_cookie(StringView cookie_string, Cookie: 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 { // A Document object that falls into one of the following conditions is a cookie-averse Document object: diff --git a/Libraries/LibWeb/DOM/Document.h b/Libraries/LibWeb/DOM/Document.h index ad9d701b501..017cb78c9e1 100644 --- a/Libraries/LibWeb/DOM/Document.h +++ b/Libraries/LibWeb/DOM/Document.h @@ -537,7 +537,7 @@ public: auto& pending_scroll_event_targets() { return m_pending_scroll_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; // 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 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 }; // Used by run_the_resize_steps(). @@ -993,7 +993,7 @@ private: // https://drafts.csswg.org/css-font-loading/#font-source GC::Ptr m_fonts; - // https://html.spec.whatwg.org/#completely-loaded-time + // https://html.spec.whatwg.org/multipage/document-lifecycle.html#completely-loaded-time Optional m_completely_loaded_time; // https://html.spec.whatwg.org/multipage/dom.html#concept-document-navigation-id diff --git a/Libraries/LibWeb/DOM/Document.idl b/Libraries/LibWeb/DOM/Document.idl index ebae6091d04..e4089951c82 100644 --- a/Libraries/LibWeb/DOM/Document.idl +++ b/Libraries/LibWeb/DOM/Document.idl @@ -61,7 +61,7 @@ interface Document : Node { 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 linkColor; [CEReactions, LegacyNullToEmptyString] attribute DOMString vlinkColor; diff --git a/Libraries/LibWeb/DOM/Element.cpp b/Libraries/LibWeb/DOM/Element.cpp index 05a595243cf..d85ada15443 100644 --- a/Libraries/LibWeb/DOM/Element.cpp +++ b/Libraries/LibWeb/DOM/Element.cpp @@ -3313,7 +3313,7 @@ CSS::StyleSheetList& Element::document_or_shadow_root_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 Element::get_html(GetHTMLOptions const& options) const { // Element's getHTML(options) method steps are to return the result @@ -3325,7 +3325,7 @@ WebIDL::ExceptionOr Element::get_html(GetHTMLOptions const& options) con 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 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". diff --git a/Libraries/LibWeb/DOM/Element.idl b/Libraries/LibWeb/DOM/Element.idl index 1e9a8769a60..392eee78096 100644 --- a/Libraries/LibWeb/DOM/Element.idl +++ b/Libraries/LibWeb/DOM/Element.idl @@ -102,7 +102,7 @@ interface Element : Node { readonly attribute long clientHeight; 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); [CEReactions] undefined setHTMLUnsafe(DOMString html); DOMString getHTML(optional GetHTMLOptions options = {}); diff --git a/Libraries/LibWeb/DOM/ElementFactory.cpp b/Libraries/LibWeb/DOM/ElementFactory.cpp index c74795ef748..3763c10cbb6 100644 --- a/Libraries/LibWeb/DOM/ElementFactory.cpp +++ b/Libraries/LibWeb/DOM/ElementFactory.cpp @@ -288,7 +288,7 @@ bool is_unknown_html_element(FlyString const& tag_name) 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 create_html_element(JS::Realm& realm, Document& document, QualifiedName qualified_name) { FlyString tag_name = qualified_name.local_name(); diff --git a/Libraries/LibWeb/DOM/EventHandler.idl b/Libraries/LibWeb/DOM/EventHandler.idl index eb5d60bfabf..d737a9fa3a6 100644 --- a/Libraries/LibWeb/DOM/EventHandler.idl +++ b/Libraries/LibWeb/DOM/EventHandler.idl @@ -12,7 +12,7 @@ typedef OnErrorEventHandlerNonNull? OnErrorEventHandler; callback OnBeforeUnloadEventHandlerNonNull = DOMString? (Event event); typedef OnBeforeUnloadEventHandlerNonNull? OnBeforeUnloadEventHandler; -// https://html.spec.whatwg.org/#globaleventhandlers +// https://html.spec.whatwg.org/multipage/webappapis.html#globaleventhandlers interface mixin GlobalEventHandlers { attribute EventHandler onabort; attribute EventHandler onauxclick; @@ -107,7 +107,7 @@ interface mixin GlobalEventHandlers { attribute EventHandler onlostpointercapture; }; -// https://html.spec.whatwg.org/#windoweventhandlers +// https://html.spec.whatwg.org/multipage/webappapis.html#windoweventhandlers interface mixin WindowEventHandlers { attribute EventHandler onafterprint; attribute EventHandler onbeforeprint; diff --git a/Libraries/LibWeb/DOM/ShadowRoot.cpp b/Libraries/LibWeb/DOM/ShadowRoot.cpp index 102e72956a6..e9acb7716bc 100644 --- a/Libraries/LibWeb/DOM/ShadowRoot.cpp +++ b/Libraries/LibWeb/DOM/ShadowRoot.cpp @@ -96,7 +96,7 @@ WebIDL::ExceptionOr ShadowRoot::set_inner_html(StringView value) return {}; } -// https://html.spec.whatwg.org/#dom-element-gethtml +// https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-element-gethtml WebIDL::ExceptionOr ShadowRoot::get_html(GetHTMLOptions const& options) const { // ShadowRoot's getHTML(options) method steps are to return the result @@ -108,7 +108,7 @@ WebIDL::ExceptionOr ShadowRoot::get_html(GetHTMLOptions const& options) 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 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". diff --git a/Libraries/LibWeb/HTML/AttributeNames.cpp b/Libraries/LibWeb/HTML/AttributeNames.cpp index 32f1c0cc1bf..e8abb863ee2 100644 --- a/Libraries/LibWeb/HTML/AttributeNames.cpp +++ b/Libraries/LibWeb/HTML/AttributeNames.cpp @@ -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) { // NOTE: For web compatibility, this matches the list of attributes which Chromium considers to be booleans, diff --git a/Libraries/LibWeb/HTML/CanvasGradient.idl b/Libraries/LibWeb/HTML/CanvasGradient.idl index f28bef841ce..fb26d9691ec 100644 --- a/Libraries/LibWeb/HTML/CanvasGradient.idl +++ b/Libraries/LibWeb/HTML/CanvasGradient.idl @@ -1,4 +1,4 @@ -// https://html.spec.whatwg.org/#canvasgradient +// https://html.spec.whatwg.org/multipage/canvas.html#canvasgradient [Exposed=(Window,Worker)] interface CanvasGradient { // opaque object diff --git a/Libraries/LibWeb/HTML/CanvasPattern.idl b/Libraries/LibWeb/HTML/CanvasPattern.idl index 70fa79f2ebd..98d828e2626 100644 --- a/Libraries/LibWeb/HTML/CanvasPattern.idl +++ b/Libraries/LibWeb/HTML/CanvasPattern.idl @@ -1,4 +1,4 @@ -// https://html.spec.whatwg.org/#canvaspattern +// https://html.spec.whatwg.org/multipage/canvas.html#canvaspattern [Exposed=(Window,Worker)] interface CanvasPattern { // opaque object diff --git a/Libraries/LibWeb/HTML/CustomElements/CustomElementRegistry.idl b/Libraries/LibWeb/HTML/CustomElements/CustomElementRegistry.idl index ce862ab7dec..912975db8f1 100644 --- a/Libraries/LibWeb/HTML/CustomElements/CustomElementRegistry.idl +++ b/Libraries/LibWeb/HTML/CustomElements/CustomElementRegistry.idl @@ -1,6 +1,6 @@ #import -// https://html.spec.whatwg.org/#customelementregistry +// https://html.spec.whatwg.org/multipage/custom-elements.html#customelementregistry [Exposed=Window] interface CustomElementRegistry { [CEReactions] undefined define(DOMString name, CustomElementConstructor constructor, optional ElementDefinitionOptions options = {}); diff --git a/Libraries/LibWeb/HTML/DOMStringMap.idl b/Libraries/LibWeb/HTML/DOMStringMap.idl index 2c3ae696a34..d6dbeeab7c5 100644 --- a/Libraries/LibWeb/HTML/DOMStringMap.idl +++ b/Libraries/LibWeb/HTML/DOMStringMap.idl @@ -1,4 +1,4 @@ -// https://html.spec.whatwg.org/#domstringmap +// https://html.spec.whatwg.org/multipage/dom.html#domstringmap [Exposed=Window, LegacyOverrideBuiltIns] interface DOMStringMap { getter DOMString (DOMString name); diff --git a/Libraries/LibWeb/HTML/ElementInternals.cpp b/Libraries/LibWeb/HTML/ElementInternals.cpp index 78281d3b13d..81c64698e53 100644 --- a/Libraries/LibWeb/HTML/ElementInternals.cpp +++ b/Libraries/LibWeb/HTML/ElementInternals.cpp @@ -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 ElementInternals::shadow_root() const { // 1. Let target be this's target element. diff --git a/Libraries/LibWeb/HTML/ErrorEvent.idl b/Libraries/LibWeb/HTML/ErrorEvent.idl index 38d758c0d96..9eba69b5673 100644 --- a/Libraries/LibWeb/HTML/ErrorEvent.idl +++ b/Libraries/LibWeb/HTML/ErrorEvent.idl @@ -1,6 +1,6 @@ #import -// https://html.spec.whatwg.org/#errorevent +// https://html.spec.whatwg.org/multipage/webappapis.html#errorevent [Exposed=(Window,Worker)] interface ErrorEvent : Event { constructor(DOMString type, optional ErrorEventInit eventInitDict = {}); @@ -12,7 +12,7 @@ interface ErrorEvent : Event { readonly attribute any error; }; -// https://html.spec.whatwg.org/#erroreventinit +// https://html.spec.whatwg.org/multipage/webappapis.html#erroreventinit dictionary ErrorEventInit : EventInit { DOMString message = ""; USVString filename = ""; diff --git a/Libraries/LibWeb/HTML/EventLoop/EventLoop.cpp b/Libraries/LibWeb/HTML/EventLoop/EventLoop.cpp index f5f4fdabe36..9a20403ff87 100644 --- a/Libraries/LibWeb/HTML/EventLoop/EventLoop.cpp +++ b/Libraries/LibWeb/HTML/EventLoop/EventLoop.cpp @@ -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() { 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); } -// 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> steps) { // 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(); } -// 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() { if (execution_paused()) diff --git a/Libraries/LibWeb/HTML/EventLoop/EventLoop.h b/Libraries/LibWeb/HTML/EventLoop/EventLoop.h index f1a627af855..28b6bf35cd8 100644 --- a/Libraries/LibWeb/HTML/EventLoop/EventLoop.h +++ b/Libraries/LibWeb/HTML/EventLoop/EventLoop.h @@ -112,7 +112,7 @@ private: GC::Ptr 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 }; Vector> m_documents; diff --git a/Libraries/LibWeb/HTML/EventLoop/Task.cpp b/Libraries/LibWeb/HTML/EventLoop/Task.cpp index c7b0dc7c700..e71c2c81b46 100644 --- a/Libraries/LibWeb/HTML/EventLoop/Task.cpp +++ b/Libraries/LibWeb/HTML/EventLoop/Task.cpp @@ -47,7 +47,7 @@ void Task::execute() 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 { // A task is runnable if its document is either null or fully active. diff --git a/Libraries/LibWeb/HTML/HTMLAudioElement.idl b/Libraries/LibWeb/HTML/HTMLAudioElement.idl index 41f0ac2dd27..130fa1bda9d 100644 --- a/Libraries/LibWeb/HTML/HTMLAudioElement.idl +++ b/Libraries/LibWeb/HTML/HTMLAudioElement.idl @@ -1,6 +1,6 @@ #import -// https://html.spec.whatwg.org/#htmlaudioelement +// https://html.spec.whatwg.org/multipage/media.html#htmlaudioelement [Exposed=Window, LegacyFactoryFunction=Audio(optional DOMString src)] interface HTMLAudioElement : HTMLMediaElement { [HTMLConstructor] constructor(); diff --git a/Libraries/LibWeb/HTML/HTMLDetailsElement.cpp b/Libraries/LibWeb/HTML/HTMLDetailsElement.cpp index 1e7178ecd57..c585bbf01a2 100644 --- a/Libraries/LibWeb/HTML/HTMLDetailsElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLDetailsElement.cpp @@ -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 HTMLDetailsElement::create_shadow_tree_if_needed() { if (shadow_root()) @@ -298,7 +298,7 @@ void HTMLDetailsElement::update_shadow_tree_slots() 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() { if (!shadow_root()) diff --git a/Libraries/LibWeb/HTML/HTMLDocument.idl b/Libraries/LibWeb/HTML/HTMLDocument.idl index 2e2aa8a68a7..9a99f7a125d 100644 --- a/Libraries/LibWeb/HTML/HTMLDocument.idl +++ b/Libraries/LibWeb/HTML/HTMLDocument.idl @@ -1,6 +1,6 @@ #import -// https://html.spec.whatwg.org/#htmldocument +// https://html.spec.whatwg.org/multipage/nav-history-apis.html#htmldocument [Exposed=Window] interface HTMLDocument : Document { }; diff --git a/Libraries/LibWeb/HTML/HTMLElement.h b/Libraries/LibWeb/HTML/HTMLElement.h index e36c3290076..7043c9e870d 100644 --- a/Libraries/LibWeb/HTML/HTMLElement.h +++ b/Libraries/LibWeb/HTML/HTMLElement.h @@ -22,7 +22,7 @@ namespace Web::HTML { __ENUMERATE_HTML_ELEMENT_DIR_ATTRIBUTE(rtl) \ __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 { True, False, @@ -182,7 +182,7 @@ private: // https://html.spec.whatwg.org/multipage/custom-elements.html#attached-internals GC::Ptr 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 }; // https://html.spec.whatwg.org/multipage/interaction.html#click-in-progress-flag diff --git a/Libraries/LibWeb/HTML/HTMLElement.idl b/Libraries/LibWeb/HTML/HTMLElement.idl index 3c539fb4975..7b4892f09ce 100644 --- a/Libraries/LibWeb/HTML/HTMLElement.idl +++ b/Libraries/LibWeb/HTML/HTMLElement.idl @@ -73,7 +73,7 @@ enum EnterKeyHint { "send" }; -// https://html.spec.whatwg.org/#attr-inputmode +// https://html.spec.whatwg.org/multipage/interaction.html#attr-inputmode enum InputMode { "none", "text", @@ -85,7 +85,7 @@ enum InputMode { "search" }; -// https://html.spec.whatwg.org/#elementcontenteditable +// https://html.spec.whatwg.org/multipage/interaction.html#elementcontenteditable interface mixin ElementContentEditable { [CEReactions] attribute DOMString contentEditable; [Reflect=enterkeyhint, Enumerated=EnterKeyHint, CEReactions] attribute DOMString enterKeyHint; diff --git a/Libraries/LibWeb/HTML/HTMLOptionsCollection.cpp b/Libraries/LibWeb/HTML/HTMLOptionsCollection.cpp index 26d63cafa98..d129ffcf8fd 100644 --- a/Libraries/LibWeb/HTML/HTMLOptionsCollection.cpp +++ b/Libraries/LibWeb/HTML/HTMLOptionsCollection.cpp @@ -160,7 +160,7 @@ WebIDL::ExceptionOr HTMLOptionsCollection::add(HTMLOptionOrOptGroupElement 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) { // 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(); } -// 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 { // The selectedIndex IDL attribute must act like the identically named attribute diff --git a/Libraries/LibWeb/HTML/HTMLOptionsCollection.idl b/Libraries/LibWeb/HTML/HTMLOptionsCollection.idl index ce09654e2a4..2bc788e9bb3 100644 --- a/Libraries/LibWeb/HTML/HTMLOptionsCollection.idl +++ b/Libraries/LibWeb/HTML/HTMLOptionsCollection.idl @@ -2,7 +2,7 @@ #import #import -// https://html.spec.whatwg.org/#htmloptionscollection +// https://html.spec.whatwg.org/multipage/common-dom-interfaces.html#htmloptionscollection [Exposed=Window] interface HTMLOptionsCollection : HTMLCollection { [CEReactions] attribute unsigned long length; // shadows inherited length diff --git a/Libraries/LibWeb/HTML/HTMLOrSVGElement.h b/Libraries/LibWeb/HTML/HTMLOrSVGElement.h index 8051a5ddfcc..316fd7fa6d6 100644 --- a/Libraries/LibWeb/HTML/HTMLOrSVGElement.h +++ b/Libraries/LibWeb/HTML/HTMLOrSVGElement.h @@ -17,7 +17,7 @@ class HTMLOrSVGElement { public: [[nodiscard]] GC::Ref 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; } 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 GC::Ptr m_dataset; - // https://html.spec.whatwg.org/#cryptographicnonce + // https://html.spec.whatwg.org/multipage/urls-and-fetching.html#cryptographicnonce String m_cryptographic_nonce; // https://html.spec.whatwg.org/multipage/interaction.html#locked-for-focus diff --git a/Libraries/LibWeb/HTML/HTMLOrSVGElement.idl b/Libraries/LibWeb/HTML/HTMLOrSVGElement.idl index 3f7641e4c65..22ddb6ffccc 100644 --- a/Libraries/LibWeb/HTML/HTMLOrSVGElement.idl +++ b/Libraries/LibWeb/HTML/HTMLOrSVGElement.idl @@ -1,6 +1,6 @@ #import -// https://html.spec.whatwg.org/#htmlorsvgelement +// https://html.spec.whatwg.org/multipage/dom.html#htmlorsvgelement interface mixin HTMLOrSVGElement { [SameObject] readonly attribute DOMStringMap dataset; attribute DOMString nonce; // intentionally no [CEReactions] diff --git a/Libraries/LibWeb/HTML/MimeType.idl b/Libraries/LibWeb/HTML/MimeType.idl index 5c368ab9c56..cb9937a78ad 100644 --- a/Libraries/LibWeb/HTML/MimeType.idl +++ b/Libraries/LibWeb/HTML/MimeType.idl @@ -1,6 +1,6 @@ #import -// https://html.spec.whatwg.org/#mimetype +// https://html.spec.whatwg.org/multipage/system-state.html#mimetype [Exposed=Window] interface MimeType { readonly attribute DOMString type; diff --git a/Libraries/LibWeb/HTML/MimeTypeArray.idl b/Libraries/LibWeb/HTML/MimeTypeArray.idl index 42fe737e7d4..bd94db47501 100644 --- a/Libraries/LibWeb/HTML/MimeTypeArray.idl +++ b/Libraries/LibWeb/HTML/MimeTypeArray.idl @@ -1,6 +1,6 @@ #import -// https://html.spec.whatwg.org/#mimetypearray +// https://html.spec.whatwg.org/multipage/system-state.html#mimetypearray [Exposed=Window, LegacyUnenumerableNamedProperties] interface MimeTypeArray { readonly attribute unsigned long length; diff --git a/Libraries/LibWeb/HTML/Navigable.cpp b/Libraries/LibWeb/HTML/Navigable.cpp index fa42639b6b1..2093454a4a1 100644 --- a/Libraries/LibWeb/HTML/Navigable.cpp +++ b/Libraries/LibWeb/HTML/Navigable.cpp @@ -2202,7 +2202,7 @@ void Navigable::perform_scroll_of_viewport(CSSPixelPoint new_position) 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 { // A navigable has a rendering opportunity if the user agent is currently able to present diff --git a/Libraries/LibWeb/HTML/Navigable.h b/Libraries/LibWeb/HTML/Navigable.h index 3fef494ce22..001fa5222ce 100644 --- a/Libraries/LibWeb/HTML/Navigable.h +++ b/Libraries/LibWeb/HTML/Navigable.h @@ -174,7 +174,7 @@ public: virtual void set_viewport_size(CSSPixelSize); 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]] TargetSnapshotParams snapshot_target_snapshot_params(); diff --git a/Libraries/LibWeb/HTML/NavigationTransition.idl b/Libraries/LibWeb/HTML/NavigationTransition.idl index b35b3e4abe4..0ac252cc946 100644 --- a/Libraries/LibWeb/HTML/NavigationTransition.idl +++ b/Libraries/LibWeb/HTML/NavigationTransition.idl @@ -1,7 +1,7 @@ #import #import -// https://html.spec.whatwg.org/#navigationtransition +// https://html.spec.whatwg.org/multipage/nav-history-apis.html#navigationtransition [Exposed=Window] interface NavigationTransition { readonly attribute NavigationType navigationType; diff --git a/Libraries/LibWeb/HTML/Plugin.idl b/Libraries/LibWeb/HTML/Plugin.idl index 9bd6c496982..090aa47a830 100644 --- a/Libraries/LibWeb/HTML/Plugin.idl +++ b/Libraries/LibWeb/HTML/Plugin.idl @@ -1,6 +1,6 @@ #import -// https://html.spec.whatwg.org/#plugin +// https://html.spec.whatwg.org/multipage/infrastructure.html#plugin [Exposed=Window, LegacyUnenumerableNamedProperties] interface Plugin { readonly attribute DOMString name; diff --git a/Libraries/LibWeb/HTML/PluginArray.idl b/Libraries/LibWeb/HTML/PluginArray.idl index 805417a6be6..ccdcb21c6f9 100644 --- a/Libraries/LibWeb/HTML/PluginArray.idl +++ b/Libraries/LibWeb/HTML/PluginArray.idl @@ -1,6 +1,6 @@ #import -// https://html.spec.whatwg.org/#pluginarray +// https://html.spec.whatwg.org/multipage/system-state.html#pluginarray [Exposed=Window, LegacyUnenumerableNamedProperties] interface PluginArray { undefined refresh(); diff --git a/Libraries/LibWeb/HTML/Scripting/ExceptionReporter.cpp b/Libraries/LibWeb/HTML/Scripting/ExceptionReporter.cpp index b366ff77d1f..34fdb49a4d1 100644 --- a/Libraries/LibWeb/HTML/Scripting/ExceptionReporter.cpp +++ b/Libraries/LibWeb/HTML/Scripting/ExceptionReporter.cpp @@ -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); } -// 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) { VERIFY(throw_completion.type() == JS::Completion::Type::Throw); diff --git a/Libraries/LibWeb/HTML/Storage.idl b/Libraries/LibWeb/HTML/Storage.idl index f43ed78748d..9bae30af5b9 100644 --- a/Libraries/LibWeb/HTML/Storage.idl +++ b/Libraries/LibWeb/HTML/Storage.idl @@ -1,4 +1,4 @@ -// https://html.spec.whatwg.org/#storage-2 +// https://html.spec.whatwg.org/multipage/webstorage.html#storage-2 [Exposed=Window] interface Storage { diff --git a/Libraries/LibWeb/HTML/Window.cpp b/Libraries/LibWeb/HTML/Window.cpp index 4b216266da7..e5973e553c6 100644 --- a/Libraries/LibWeb/HTML/Window.cpp +++ b/Libraries/LibWeb/HTML/Window.cpp @@ -74,7 +74,7 @@ namespace Web::HTML { 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) { // FIXME: Bring this closer to the spec. @@ -422,7 +422,7 @@ Optional Window::query_media_feature(CSS::MediaFeatureID 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) { // To fire a page transition event named eventName at a Window window with a boolean persisted, @@ -1678,7 +1678,7 @@ GC::Ref Window::custom_elements() 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> 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: @@ -1720,7 +1720,7 @@ OrderedHashMap> Window::document_tree_child_naviga 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 Window::supported_property_names() const { // FIXME: Make the const-correctness of the methods this method calls less cowboy. @@ -1754,7 +1754,7 @@ Vector Window::supported_property_names() const 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 { // 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) { // NOTE: Since the Window interface has the [Global] extended attribute, its named properties diff --git a/Libraries/LibWeb/HTML/WindowOrWorkerGlobalScope.h b/Libraries/LibWeb/HTML/WindowOrWorkerGlobalScope.h index 8ae9f2cb994..a36f5ca57fd 100644 --- a/Libraries/LibWeb/HTML/WindowOrWorkerGlobalScope.h +++ b/Libraries/LibWeb/HTML/WindowOrWorkerGlobalScope.h @@ -21,7 +21,7 @@ namespace Web::HTML { -// https://html.spec.whatwg.org/#timerhandler +// https://html.spec.whatwg.org/multipage/webappapis.html#timerhandler using TimerHandler = Variant, String>; // https://html.spec.whatwg.org/multipage/webappapis.html#windoworworkerglobalscope diff --git a/Libraries/LibWeb/HTML/WindowOrWorkerGlobalScope.idl b/Libraries/LibWeb/HTML/WindowOrWorkerGlobalScope.idl index 33e54718faa..85ba3dbb3d3 100644 --- a/Libraries/LibWeb/HTML/WindowOrWorkerGlobalScope.idl +++ b/Libraries/LibWeb/HTML/WindowOrWorkerGlobalScope.idl @@ -6,7 +6,7 @@ #import #import -// https://html.spec.whatwg.org/#timerhandler +// https://html.spec.whatwg.org/multipage/webappapis.html#timerhandler typedef (DOMString or Function) TimerHandler; // https://html.spec.whatwg.org/multipage/webappapis.html#windoworworkerglobalscope diff --git a/Libraries/LibWeb/HTML/Worker.idl b/Libraries/LibWeb/HTML/Worker.idl index c7ef2855e10..e5fa3b17b58 100644 --- a/Libraries/LibWeb/HTML/Worker.idl +++ b/Libraries/LibWeb/HTML/Worker.idl @@ -4,7 +4,7 @@ #import #import -// https://html.spec.whatwg.org/#worker +// https://html.spec.whatwg.org/multipage/workers.html#worker [Exposed=(Window,DedicatedWorker,SharedWorker)] interface Worker : EventTarget { constructor(DOMString scriptURL, optional WorkerOptions options = {}); diff --git a/Libraries/LibWeb/HTML/WorkerLocation.idl b/Libraries/LibWeb/HTML/WorkerLocation.idl index 9f6af2fd883..a301daa77fc 100644 --- a/Libraries/LibWeb/HTML/WorkerLocation.idl +++ b/Libraries/LibWeb/HTML/WorkerLocation.idl @@ -1,4 +1,4 @@ -// https://html.spec.whatwg.org/#workerlocation +// https://html.spec.whatwg.org/multipage/workers.html#workerlocation [Exposed=Worker] interface WorkerLocation { stringifier readonly attribute USVString href; diff --git a/Libraries/LibWeb/Layout/FieldSetBox.cpp b/Libraries/LibWeb/Layout/FieldSetBox.cpp index f12f6e232c2..b78c5f8decc 100644 --- a/Libraries/LibWeb/Layout/FieldSetBox.cpp +++ b/Libraries/LibWeb/Layout/FieldSetBox.cpp @@ -23,7 +23,7 @@ FieldSetBox::~FieldSetBox() = default; 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; if (has_children()) { for_each_child_of_type([&](Box const& child) { diff --git a/Libraries/LibWeb/Layout/FormattingContext.cpp b/Libraries/LibWeb/Layout/FormattingContext.cpp index c09a7aca0fb..d9e1bea4ff9 100644 --- a/Libraries/LibWeb/Layout/FormattingContext.cpp +++ b/Libraries/LibWeb/Layout/FormattingContext.cpp @@ -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). - // 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()) // 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. diff --git a/Meta/check-idl-files.py b/Meta/check-idl-files.py index 58ee4ac66b3..7b0cfde9f91 100755 --- a/Meta/check-idl-files.py +++ b/Meta/check-idl-files.py @@ -19,6 +19,8 @@ parser.add_argument("--overwrite-inplace", action=argparse.BooleanOptionalAction parser.add_argument('filenames', nargs='*') args = parser.parse_args() +SINGLE_PAGE_HTML_SPEC_LINK = re.compile('//.*https://html\\.spec\\.whatwg\\.org/#') + def find_files_here_or_argv(): if args.filenames: @@ -32,11 +34,15 @@ def find_files_here_or_argv(): def run(): """Lint WebIDL files checked into git for four leading spaces on each line.""" 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 for filename in find_files_here_or_argv(): lines = [] with open(filename, "r") as f: 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): lines.append(line) continue @@ -60,6 +66,11 @@ def run(): if not args.overwrite_inplace: print( 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: sys.exit(1) diff --git a/Meta/check-style.py b/Meta/check-style.py index 02d82218135..ba08b56bf8b 100755 --- a/Meta/check-style.py +++ b/Meta/check-style.py @@ -54,6 +54,9 @@ LOCAL_INCLUDE_SUFFIX_EXCLUDES = [ '.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): if not filename.endswith('.cpp') and not filename.endswith('.h'): @@ -93,6 +96,7 @@ def run(): errors_include_weird_format = [] errors_include_missing_local = [] errors_include_bad_complex = [] + errors_single_page_html_spec = [] for filename in find_files_here_or_argv(): with open(filename, "r") as f: @@ -140,6 +144,8 @@ def run(): print(f"In {filename}: Cannot find {referenced_file}") if filename not in errors_include_missing_local: 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 if errors_license: @@ -175,6 +181,12 @@ def run(): " ".join(errors_include_bad_complex), ) 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: sys.exit(1) diff --git a/Services/WebContent/WebDriverConnection.cpp b/Services/WebContent/WebDriverConnection.cpp index a31a73cb230..9df439f5b54 100644 --- a/Services/WebContent/WebDriverConnection.cpp +++ b/Services/WebContent/WebDriverConnection.cpp @@ -145,7 +145,7 @@ static Optional container_for_element(Web::DOM::Element& ele // An element’s container is: // -> option 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(element) || is(element)) { // 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.