Meta: Disallow links to single-page HTML spec

This commit is contained in:
Psychpsyo 2025-02-04 13:01:46 +01:00 committed by Andrew Kaster
parent 86c5bde83f
commit 9b8120d8e8
Notes: github-actions[bot] 2025-02-05 23:05:51 +00:00
46 changed files with 88 additions and 65 deletions

View file

@ -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<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.
@ -2987,7 +2987,7 @@ WebIDL::ExceptionOr<String> 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<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.
@ -3006,7 +3006,7 @@ WebIDL::ExceptionOr<void> 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:

View file

@ -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<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;
// https://html.spec.whatwg.org/multipage/dom.html#concept-document-navigation-id

View file

@ -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;

View file

@ -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<String> Element::get_html(GetHTMLOptions const& options) const
{
// 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);
}
// 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)
{
// 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".

View file

@ -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 = {});

View file

@ -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<Element> create_html_element(JS::Realm& realm, Document& document, QualifiedName qualified_name)
{
FlyString tag_name = qualified_name.local_name();

View file

@ -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;

View file

@ -96,7 +96,7 @@ WebIDL::ExceptionOr<void> 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<String> ShadowRoot::get_html(GetHTMLOptions const& options) const
{
// 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);
}
// 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)
{
// 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".

View file

@ -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,

View file

@ -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

View file

@ -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

View file

@ -1,6 +1,6 @@
#import <DOM/Node.idl>
// 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 = {});

View file

@ -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);

View file

@ -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
{
// 1. Let target be this's target element.

View file

@ -1,6 +1,6 @@
#import <DOM/Event.idl>
// 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 = "";

View file

@ -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<GC::Function<void()>> 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())

View file

@ -112,7 +112,7 @@ private:
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 };
Vector<WeakPtr<DOM::Document>> m_documents;

View file

@ -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.

View file

@ -1,6 +1,6 @@
#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)]
interface HTMLAudioElement : HTMLMediaElement {
[HTMLConstructor] constructor();

View file

@ -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()
{
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())

View file

@ -1,6 +1,6 @@
#import <DOM/Document.idl>
// https://html.spec.whatwg.org/#htmldocument
// https://html.spec.whatwg.org/multipage/nav-history-apis.html#htmldocument
[Exposed=Window]
interface HTMLDocument : Document {
};

View file

@ -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<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 };
// https://html.spec.whatwg.org/multipage/interaction.html#click-in-progress-flag

View file

@ -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;

View file

@ -160,7 +160,7 @@ WebIDL::ExceptionOr<void> 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

View file

@ -2,7 +2,7 @@
#import <HTML/HTMLOptionElement.idl>
#import <HTML/HTMLOptGroupElement.idl>
// 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

View file

@ -17,7 +17,7 @@ class HTMLOrSVGElement {
public:
[[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; }
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<DOMStringMap> 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

View file

@ -1,6 +1,6 @@
#import <HTML/DOMStringMap.idl>
// 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]

View file

@ -1,6 +1,6 @@
#import <HTML/Plugin.idl>
// https://html.spec.whatwg.org/#mimetype
// https://html.spec.whatwg.org/multipage/system-state.html#mimetype
[Exposed=Window]
interface MimeType {
readonly attribute DOMString type;

View file

@ -1,6 +1,6 @@
#import <HTML/MimeType.idl>
// 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;

View file

@ -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

View file

@ -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();

View file

@ -1,7 +1,7 @@
#import <HTML/NavigationType.idl>
#import <HTML/NavigationHistoryEntry.idl>
// 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;

View file

@ -1,6 +1,6 @@
#import <HTML/MimeType.idl>
// https://html.spec.whatwg.org/#plugin
// https://html.spec.whatwg.org/multipage/infrastructure.html#plugin
[Exposed=Window, LegacyUnenumerableNamedProperties]
interface Plugin {
readonly attribute DOMString name;

View file

@ -1,6 +1,6 @@
#import <HTML/Plugin.idl>
// https://html.spec.whatwg.org/#pluginarray
// https://html.spec.whatwg.org/multipage/system-state.html#pluginarray
[Exposed=Window, LegacyUnenumerableNamedProperties]
interface PluginArray {
undefined refresh();

View file

@ -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);

View file

@ -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 {

View file

@ -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<CSS::MediaFeatureValue> 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<CustomElementRegistry> 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<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:
@ -1720,7 +1720,7 @@ OrderedHashMap<FlyString, GC::Ref<Navigable>> 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<FlyString> Window::supported_property_names() const
{
// 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();
}
// 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

View file

@ -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<GC::Ref<WebIDL::CallbackType>, String>;
// https://html.spec.whatwg.org/multipage/webappapis.html#windoworworkerglobalscope

View file

@ -6,7 +6,7 @@
#import <HTML/MessagePort.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;
// https://html.spec.whatwg.org/multipage/webappapis.html#windoworworkerglobalscope

View file

@ -4,7 +4,7 @@
#import <HTML/MessagePort.idl>
#import <Fetch/Request.idl>
// 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 = {});

View file

@ -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;

View file

@ -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>([&](Box const& child) {

View file

@ -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.

View file

@ -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)

View file

@ -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)

View file

@ -145,7 +145,7 @@ static Optional<Web::DOM::Element&> container_for_element(Web::DOM::Element& ele
// An elements 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<Web::HTML::HTMLOptionElement>(element) || is<Web::HTML::HTMLOptGroupElement>(element)) {
// The elements 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.