Commit graph

950 commits

Author SHA1 Message Date
Sam Atkins
2db168acc1 LibTextCodec+Everywhere: Port Decoders to new Strings 2023-02-19 17:15:47 +01:00
Sam Atkins
f2a9426885 LibTextCodec+Everywhere: Return Optional<Decoder&> from decoder_for() 2023-02-19 17:15:47 +01:00
Sam Atkins
2026ea557e LibWeb: Use is_ascii_case_insensitive_match() where the spec says to 2023-02-19 00:46:47 +01:00
Luke Wilde
3275d659bf LibWeb: Convert FormData to String and Vector storage
This makes use of the new [UseNewAKString] extended attribute. Using
Vector storage will make it easier to make this interface into an IDL
iterable. It seems the reason it didn't use Vector originally was due
to awkward DeprecatedString -> String conversions.
2023-02-18 01:23:36 +01:00
Kenneth Myhra
bfc8cbcf3b LibWeb: Make factory method of HTML::ModuleScript fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
3e834636a6 LibWeb: Make factory method of HTML::Window fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
b41401bab2 LibWeb: Make factory method of HTML::Storage fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
d7ee378018 LibWeb: Make factory method of HTML::Navigator fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
2f4db60c08 LibWeb: Make factory method of HTML::History fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
3941e64fde LibWeb: Make factory method of HTML::PromiseRejectionEvent fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
193de231e0 LibWeb: Make factory method of HTML::WorkerNavigator fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
86b7f148b9 LibWeb: Make factory method of HTML::Path2D fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
2b391ea622 LibWeb: Make factory method of HTML::HTMLOptionsCollection fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
b604bbaf29 LibWeb: Make factory method of HTML::DOMStringMap fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
809206f50e LibWeb: Make factory method of HTML::SubmitEvent fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
c5de2c3348 LibWeb: Make factory method of HTML::TextMetrics fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
d9845bb24b LibWeb: Make factory method of HTML::PageTransitionEvent fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
97b5aa56da LibWeb: Make factory method of HTML::ErrorEvent fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
2ed7f64c73 LibWeb: Make factory method of HTML::CloseEvent fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
b7c488e51e LibWeb: Make factory method of HTML::CanvasRenderingContext2D fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
2506666991 LibWeb: Make factory methods of HTML::CanvasGradient fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
ff875d353b LibWeb: Make factory method of DOM::HTMLCollection fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
c120c46acc LibWeb: Make factory methods of DOM::Event fallible
Because of interdependencies between DOM::Event and UIEvents::MouseEvent
to template function fire_an_event() in WebDriverConnection.cpp, the
commit: 'LibWeb: Make factory methods of UIEvents::MouseEvent fallible'
have been squashed into this commit.
2023-02-18 00:52:47 +01:00
Kenneth Myhra
0d9076c9f5 LibWeb: Make factory methods of DOM::Document fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
50c5f0d7da LibWeb: Make factory method of DOM::Attr fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
8fbd43cb27 LibWeb: Make factory method of CSS::ResolvedCSSStyleDeclaration fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
6688f89ad3 LibWeb: Make factory method of FileAPI::FileList fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
bc02686ae9 LibWeb: Make factory method of CSS::MediaQueryList fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
471ad7ba01 LibWeb: Make factory method of HTML::MessagePort fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
7ec444047c LibWeb: Make factory methods of HTML::MessageEvent fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
3d79cdf095 LibWeb: Make factory method of HTML::MessageChannel fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
58af8e2021 LibWeb: Make factory method of Crypto::Crypto fallible 2023-02-18 00:52:47 +01:00
Timothy Flynn
88814acbd3 LibJS+Everywhere: Convert JS::Error to String
This includes an Error::create overload to create an Error from a UTF-8
StringView. If creating a String from that view fails, the factory will
return an OOM InternalError instead. VM::throw_completion can also make
use of this overload via its perfect forwarding.
2023-02-17 09:14:23 -05:00
Timothy Flynn
527edb55ad LibWeb: Convert usages of Value::TDSWOSE to Value::TSWOSE 2023-02-16 14:32:22 +01:00
Timothy Flynn
b245300ba1 LibJS+Everywhere: Deprecate Value::to_string_without_side_effects 2023-02-16 14:32:22 +01:00
Sam Atkins
d6075ef5b5 LibTextCodec+Everywhere: Make TextCodec::decoder_for() take a StringView
We don't need a full String/DeprecatedString inside this function, so we
might as well not force users to create one.
2023-02-15 12:48:26 -05:00
Kenneth Myhra
562594c416 LibWeb: Do not assume field element is always a HTMLInputElement
Cast to a HTMLElement instead and retrieve the value attribute from
there instead.
2023-02-13 14:34:37 +00:00
Kenneth Myhra
7d23af49c2 LibWeb: Avoid dereferencing null pointer
Null check was missing and we would crash when dereferencing the
pointer to access the type() member.
2023-02-13 14:34:37 +00:00
Andreas Kling
dadabb58eb LibWeb: Implement location.hash setter
This stops a lot of the whining about uncaught exceptions on the
Speedometer benchmark.
2023-02-12 13:00:33 +01:00
Kenneth Myhra
4d27b9e553 LibWeb: Use 'auto& vm =' once at beginning to reduce noise 2023-02-12 11:53:52 +00:00
Kenneth Myhra
fc886b4556 LibWeb: Implement algorithm 'construct the entry list given a form' 2023-02-12 00:18:09 +00:00
Kenneth Myhra
3bc5fcaccc LibWeb: Add accessor function HTMLFormElement::constructing_entry_list()
Each form element has a constructing entry list boolean, initially
false.
2023-02-12 00:18:09 +00:00
Kenneth Myhra
2363c2a572 LibWeb: Implement HTMLFormElement::get_submittable_elements()
This implements a convenience method on HTMLFormElement to retrieve a
list in tree order of submittable elements associated with the form
element.
2023-02-12 00:18:09 +00:00
Kenneth Myhra
a6cdf6374f LibWeb: Introduce the FormDataEvent interface 2023-02-12 00:18:09 +00:00
Kenneth Myhra
d5b5b94a35 LibWeb: Introduce the FormData interface from the XHR specification 2023-02-12 00:18:09 +00:00
Timothy Flynn
3b4879d29b LibJS+Userland: Port the JS Console object and direct callers to String 2023-02-10 17:26:20 +00:00
Timothy Flynn
c3abb1396c LibJS+LibWeb: Convert string view PrimitiveString instances to String
First, this adds an overload of PrimitiveString::create for StringView.
This overload will throw an OOM completion if creating a String fails.
This is not only a bit more convenient, but it also ensures at compile
time that all PrimitiveString::create(string_view) invocations will be
handled as String and OOM-aware.

Next, this wraps all invocations to PrimitiveString::create(string_view)
with MUST_OR_THROW_OOM.

A small PrimitiveString::create(DeprecatedFlyString) overload also had
to be added to disambiguate between the StringView and DeprecatedString
overloads.
2023-02-09 17:13:33 +00:00
MacDue
f74e2da875 LibWeb: Implement CanvasRenderingContext2D.createPattern()
This is a first pass at implementing CRC2D.createPattern() and the
associated CanvasPattern object. This implementation only works for a
few of the required image sources [like CRC2D.drawImage()], and does
not yet support transforms. Other than that it supports everything
else (which is mainly the various repeat modes).
2023-02-03 20:36:21 +01:00
MacDue
b106fd640b LibWeb: Fix typo and use auto where possible 2023-02-03 20:36:21 +01:00
Karol Kosek
9ed4fe7049 LibWeb: Allow to set a root mode value when constructing a ShadowRoot 2023-02-02 14:43:29 +01:00