mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +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
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 = {});
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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 = "";
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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 {
|
||||
};
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 {
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 = {});
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue