Commit graph

839 commits

Author SHA1 Message Date
Jonah
29d724d95c LibWeb: Serialize Accessible Name and Description for Accessibility Tree
These will get displayed in the DOM inspector.
2023-02-19 15:58:20 +01:00
Jonah
da5c9189b2 LibWeb: Implement Accessible Name and Description Calculation
This is an initial implementation of the accname standard. There is
still some of the algorithm left unimplemented that we will need
to implement in the future. However, as is, this implementation is
sufficient for basic pages.
2023-02-19 15:58:20 +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
Kenneth Myhra
3e834636a6 LibWeb: Make factory method of HTML::Window 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
200d22c650 LibWeb: Make factory method of DOM::Text fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
2411dadc35 LibWeb: Make factory method of DOM::StaticNodeList fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
d94b59263e LibWeb: Make factory method of DOM::NodeIterator fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
0791195843 LibWeb: Make factory methods of DOM::Range fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
e3e281addd LibWeb: Make factory method of DOM::NamedNodeMap fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
ce18dfc417 LibWeb: Make factory method of DOM::MutationRecord fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
7852915dd3 LibWeb: Make factory method of DOM::MutationObserver fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
24d7e688fc LibWeb: Make factory method of DOM::LiveNodeList 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
552663a2ba LibWeb: Make factory method of DOM::TreeWalker fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
251c063897 LibWeb: Make factory method of DOM::DOMTokenList fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
1e03aa0ece LibWeb: Make factory method of DOM::AccessibilityTreeNode fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
2c8a689390 LibWeb: Make factory methods of DOM::CustomEvent fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
5ef9e02658 LibWeb: Make factory method of DOM::Comment 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
b9c5828fe6 LibWeb: Make factory method of DOM::DOMImplementation fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
a5ad8b2959 LibWeb: Make factory method of DOM::AbortSignal fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
c4d559bd37 LibWeb: Make factory method of DOM::DocumentType fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
5f552ddc5c LibWeb: Make factory method of DOM::AbortController fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
491c18a346 LibWeb: Make factory method of DOM::DocumentFragment 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
719839b882 LibWeb: Make factory method of CSS::StyleSheetList fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
c950d1904a LibWeb: Make factory methods of CSS::CSSStyleDeclaration 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
fb3294863e LibWeb: Return JS::NonnullGCPtr<StaticRange> instead of StaticRange* 2023-02-18 00:52:47 +01:00
Kenneth Myhra
6516329867 LibWeb: Propagate error in factory method of DOM::StaticRange 2023-02-18 00:52:47 +01:00
Sam Atkins
dca19b764b LibWeb: Port CSS::Display to new Strings 2023-02-15 12:48:26 -05:00
Karol Kosek
4311fd2774 LibWeb: Implement Element.attachShadow and Element.shadowRoot :^) 2023-02-02 14:43:29 +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
Karol Kosek
01e2cc5330 LibWeb: Add a helper function for checking if element is a shadow host 2023-02-02 14:43:29 +01:00
Karol Kosek
2cc108a15e LibWeb: Rename DOM::shadow_root() to shadow_root_internal()
The shadowRoot property getter that will be added in subsequent commits
has an additional check that checks whether the shadow root is opened.
I didn't update the function logic to match with the IDL interface,
because it's very likely we don't want that check in the existing code,
so that for example closed shadow root elements can still be updated.
2023-02-02 14:43:29 +01:00
Karol Kosek
9a7f786262 LibWeb: Make ShadowRoot.mode return ShadowRootMode instead of String 2023-02-02 14:43:29 +01:00
Karol Kosek
34913c48d3 LibWeb: Actually initialize ShadowRoot bindings
`mode` and `host` attributes were always undefined.
2023-02-02 14:43:29 +01:00
Linus Groh
8556d47240 LibWeb: Move ARIA-related code into the Web::ARIA namespace
ARIA has its own spec and is not part of the DOM spec, which is what the
Web::DOM namespace is for (https://www.w3.org/TR/wai-aria-1.2/).

This allows us to stay closer to the spec with function names and don't
have to add the word "ARIA" to identifiers constantly - the namespace
now provides that clarity.
2023-01-29 00:02:55 +00:00
Timothy Flynn
b75b7f0c0d LibJS+Everywhere: Propagate Cell::initialize errors from Heap::allocate
Callers that are already in a fallible context will now TRY to allocate
cells. Callers in infallible contexts get a FIXME.
2023-01-29 00:02:45 +00:00
Timothy Flynn
2692db8699 LibJS+Everywhere: Allow Cell::initialize overrides to throw OOM errors
Note that as of this commit, there aren't any such throwers, and the
call site in Heap::allocate will drop exceptions on the floor. This
commit only serves to change the declaration of the overrides, make sure
they return an empty value, and to propagate OOM errors frm their base
initialize invocations.
2023-01-29 00:02:45 +00:00
MacDue
890b4d7980 LibWeb: Replace ARIA role static FlyStrings with an enum
This replaces the FlyStrings for ARIA roles that were constructed in
a [[gnu::constructor]] with a single enum. I came across this as the
DOM inspector was crashing due to a null FlyString for an ARIA role.

After fixing that, I was confused as to why these roles were not an
enum. Looking at the spec there's a fixed list of roles and switching
from references to static strings to an enum was pretty much an
exercise in find and replace :).

No functional changes (outside of fixing the mentioned crash).
2023-01-28 22:09:18 +00:00
Linus Groh
6e7459322d AK: Remove StringBuilder::build() in favor of to_deprecated_string()
Having an alias function that only wraps another one is silly, and
keeping the more obvious name should flush out more uses of deprecated
strings.
No behavior change.
2023-01-27 20:38:49 +00:00
Sam Atkins
7891ad2a28 LibWeb: Remove declarations for non-existent methods 2023-01-27 20:33:18 +00:00
Sam Atkins
27d4912f12 LibWeb: Make NodeFilter::Result an enum class 2023-01-27 17:30:46 +00:00
Sam Atkins
a078fad787 LibWeb: Expose the NodeFilter's whatToShow values to C++
These are required if we want to use the NodeIterator or TreeWalker APIs
from C++, which we do for WebDriver.
2023-01-27 17:30:46 +00:00
Sam Atkins
609a89cfb0 LibWeb: Correct logic in TreeWalker::next_node()
We were creating a new `result` variable here, when we should have been
assigning to the original one.
2023-01-27 15:20:41 +01:00
Andreas Kling
3dd006f719 LibWeb: Move scroll state from Layout::BlockContainer to Layout::Box
Let's allow any box to be scrollable, not just block containers.
2023-01-24 11:44:03 +01:00