1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-15 17:54:57 +00:00
Commit graph

27 commits

Author SHA1 Message Date
Igor Pissolati
a387b822a0 LibWeb: Add basic constructor/prototype to exotic objects 2022-04-06 11:38:11 +02:00
Lenny Maiorani
c37820b898 Libraries: Use default constructors/destructors in LibWeb
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules

"The compiler is more likely to get the default semantics right and
you cannot implement these functions better than the compiler."
2022-03-17 17:23:49 +00:00
Linus Groh
1422bd45eb LibWeb: Move Window from DOM directory & namespace to HTML
The Window object is part of the HTML spec. :^)
https://html.spec.whatwg.org/multipage/window-object.html
2022-03-08 00:30:30 +01:00
Linus Groh
fe52ee2f8e LibWeb: Implement the remaining LocationObject internal methods 2022-03-06 23:27:39 +01:00
Linus Groh
26d29e9220 LibWeb: Implement LocationObject URL part getters closer to spec
- Perform a typed this check
- Use the 'associated URL' as the source of truth
- Don't append default port number in the host getter
- Don't return default port number in the port getter
- Add empty checks to the hash and search getters instead of returning
  '#' and '?' strings from the string builder
2022-03-05 10:24:53 +01:00
Linus Groh
7fb9f431ea LibWeb: Add LocationObject::url()
https://html.spec.whatwg.org/multipage/history.html#concept-location-url

> A Location object has an associated url, which is this Location
> object's relevant Document's URL, if this Location object's relevant
> Document is non-null, and about:blank otherwise.
2022-03-05 10:24:53 +01:00
Linus Groh
da8525279e LibWeb: Add LocationObject::relevant_document()
https://html.spec.whatwg.org/multipage/history.html#relevant-document

> A Location object has an associated relevant Document, which is this
> Location object's relevant global object's browsing context's active
> document, if this Location object's relevant global object's browsing
> context is non-null, and null otherwise.
2022-03-05 10:24:53 +01:00
Linus Groh
986bd2e271 LibWeb: Add spec comments to LocationObject
This revealed a variety of issues, mostly missing origin checks,
conflating concepts like the 'associated URL', and serialization
(incorrect fallback values, string vs number, etc).

This commit fixes none of these issues, only adds FIXMEs.
2022-03-05 10:24:53 +01:00
Timothy Flynn
585e420707 LibWeb: Convert the Location object to ThrowCompletionOr 2021-10-31 15:48:36 +01:00
Idan Horowitz
40eb3a39d4 LibJS: Rename define_native_function => define_old_native_function
This method will eventually be removed once all native functions are
converted to ThrowCompletionOr
2021-10-20 12:27:19 +01:00
Idan Horowitz
20163c0584 LibJS: Add ThrowCompletionOr versions of the JS native function macros
The old versions were renamed to JS_DECLARE_OLD_NATIVE_FUNCTION and
JS_DEFINE_OLD_NATIVE_FUNCTION, and will be eventually removed once all
native functions were converted to the new format.
2021-10-20 12:27:19 +01:00
Linus Groh
4d8912a92b LibJS: Convert to_string() to ThrowCompletionOr
Also update get_function_name() to use ThrowCompletionOr, but this is
not a standard AO and should be refactored out of existence eventually.
2021-10-13 09:55:10 +01:00
Idan Horowitz
4bd089616e LibWeb: Implement window.location's stringifier
The location IDL interface includes a stringifier on the href
attribute i.e. the object's toString should return the value of the
href attribute.
2021-10-04 18:42:58 +01:00
Linus Groh
0a49a2db60 LibJS: Convert set_immutable_prototype() to ThrowCompletionOr 2021-10-04 09:52:15 +01:00
Andreas Kling
573955be7f LibWeb: Basic support for location.replace(url)
This is not entirely to spec, but gets the basic job done.
2021-10-03 23:36:56 +02:00
Linus Groh
73bae7d779 LibJS: Convert internal_prevent_extensions() to ThrowCompletionOr 2021-09-29 23:49:53 +01:00
Linus Groh
9b4362f10a LibJS: Convert internal_is_extensible() to ThrowCompletionOr 2021-09-29 23:49:53 +01:00
Linus Groh
8c81c84c18 LibJS: Convert internal_set_prototype_of() to ThrowCompletionOr 2021-09-29 23:49:53 +01:00
Andreas Kling
74b88a8156 LibWeb: Implement window.location.port
This returns the port of the current document's URL. :^)
2021-09-18 21:48:44 +02:00
Idan Horowitz
d6cfa34667 AK: Make URL::m_port an Optional<u16>, Expose raw port getter
Our current way of signalling a missing port with m_port == 0 was
lacking, as 0 is a valid port number in URLs.
2021-09-14 00:14:45 +02:00
Luke Wilde
ee5bac0891 LibWeb: Implement some custom JS internal overrides for Location
As required by the spec. Note that this isn't the full suite of
overrides.
2021-09-12 16:07:24 +02:00
Andreas Kling
e1fb8bef09 LibWeb: Rename Document::complete_url() => parse_url()
This better matches the spec nomenclature.
2021-09-09 21:25:10 +02:00
Andreas Kling
90cdeebfb3 LibWeb: Rename DOM::Window::document() => associated_document()
Match the spec nomenclature.
2021-09-09 21:25:10 +02:00
Idan Horowitz
6468a2bf21 LibWeb: Replace usage of native properties with accessors in Location
This is required by the WebIDL specification.
2021-07-05 14:40:49 +01:00
Andreas Kling
c7e9b6d00f LibWeb: Convert StringBuilder::appendf() => AK::Format 2021-05-07 21:12:09 +02:00
Brian Gianforcaro
1682f0b760 Everything: Move to SPDX license identifiers in all files.
SPDX License Identifiers are a more compact / standardized
way of representing file license information.

See: https://spdx.dev/resources/use/#identifiers

This was done with the `ambr` search and replace tool.

 ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-22 11:22:27 +02:00
Andreas Kling
13d7c09125 Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
Renamed from Libraries/LibWeb/Bindings/LocationObject.cpp (Browse further)