mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:37:35 +00:00
LibWeb: Rename URL platform object to DOMURL
Along with putting functions in the URL namespace into a DOMURL namespace. This is done as LibWeb is in an awkward situation where it needs two URL classes. AK::URL is the general purpose URL class which is all that is needed in 95% of cases. URL in the Web namespace is needed predominantly for interfacing with the javascript interfaces. Because of two URLs in the same namespace, AK::URL has had to be used throughout LibWeb. If we move AK::URL into a URL namespace, this becomes more painful - where ::URL::URL is required to specify the constructor (and something like ::URL::create_with_url_or_path in other places). To fix this problem - rename the class in LibWeb implementing the URL IDL interface to DOMURL, along with moving the other Web URL related classes into this DOMURL folder. One could argue that this name also makes the situation a little more clear in LibWeb for why these two URL classes need be used in the first place.
This commit is contained in:
parent
1b6346ee1c
commit
f9e5b43b7a
30 changed files with 125 additions and 125 deletions
28
Userland/Libraries/LibWeb/DOMURL/DOMURL.idl
Normal file
28
Userland/Libraries/LibWeb/DOMURL/DOMURL.idl
Normal file
|
@ -0,0 +1,28 @@
|
|||
#import <FileAPI/Blob.idl>
|
||||
#import <DOMURL/URLSearchParams.idl>
|
||||
|
||||
// https://url.spec.whatwg.org/#url
|
||||
[Exposed=*, LegacyWindowAlias=webkitURL, ImplementedAs=DOMURL]
|
||||
interface URL {
|
||||
constructor(USVString url, optional USVString base);
|
||||
|
||||
static boolean canParse(USVString url, optional USVString base);
|
||||
|
||||
stringifier attribute USVString href;
|
||||
readonly attribute USVString origin;
|
||||
attribute USVString protocol;
|
||||
attribute USVString username;
|
||||
attribute USVString password;
|
||||
attribute USVString host;
|
||||
attribute USVString hostname;
|
||||
attribute USVString port;
|
||||
attribute USVString pathname;
|
||||
attribute USVString search;
|
||||
[SameObject] readonly attribute URLSearchParams searchParams;
|
||||
attribute USVString hash;
|
||||
|
||||
USVString toJSON();
|
||||
|
||||
static DOMString createObjectURL(Blob obj); // FIXME: Should be (Blob or MediaSource).
|
||||
static undefined revokeObjectURL(DOMString url);
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue