Commit Graph

18 Commits

Author SHA1 Message Date
Timothy Flynn
834202aeb9 LibWeb: Move setting of Web object prototypes to initialize()
This needs to happen before prototype/constructor intitialization can be
made lazy. Otherwise, GC could run during the C++ constructor and try to
collect the object currently being created.
2023-01-10 16:08:14 +01:00
Timothy Flynn
f3db548a3d AK+Everywhere: Rename FlyString to DeprecatedFlyString
DeprecatedFlyString relies heavily on DeprecatedString's StringImpl, so
let's rename it to A) match the name of DeprecatedString, B) write a new
FlyString class that is tied to String.
2023-01-09 23:00:24 +00:00
Jonah
e63d9d4925 LibWeb: Add Support for the ARIA Element Properties
Element now supports getting and setting ARIA properties from
JS and HTML.
2023-01-07 10:51:53 +00:00
Srikavin Ramkumar
119e58a8c1 LibWeb: Add stub reset algorithm for HTMLTextAreaElement 2023-01-03 18:09:40 +01:00
Linus Groh
6e19ab2bbc AK+Everywhere: Rename String to DeprecatedString
We have a new, improved string type coming up in AK (OOM aware, no null
state), and while it's going to use UTF-8, the name UTF8String is a
mouthful - so let's free up the String name by renaming the existing
class.
Making the old one have an annoying name will hopefully also help with
quick adoption :^)
2022-12-06 08:54:33 +01:00
Luke Wilde
1473bc9169 LibWeb: Implement HTMLOrSVGElement.tabIndex 2022-11-07 14:10:41 +01:00
Linus Groh
4270ede7c4 LibWeb: Remove WRAPPER_HACK() macro
We no longer access Bindings::FooWrapper anywhere for a Foo platform
object, so these can be removed :^)
2022-09-21 21:12:24 +01:00
Andreas Kling
6f433c8656 LibWeb+LibJS: Make the EventTarget hierarchy (incl. DOM) GC-allocated
This is a monster patch that turns all EventTargets into GC-allocated
PlatformObjects. Their C++ wrapper classes are removed, and the LibJS
garbage collector is now responsible for their lifetimes.

There's a fair amount of hacks and band-aids in this patch, and we'll
have a lot of cleanup to do after this.
2022-09-06 00:27:09 +02:00
Idan Horowitz
086969277e Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
Linus Groh
de53eb825a LibWeb: Make HTML{Button,Select,TextArea}Element focusable
From the HTML spec:

    Modulo platform conventions, it is suggested that the following
    elements should be considered as focusable areas and be sequentially
    focusable:

      ...
    - button elements
    - select elements
    - textarea elements
      ...

Also add a spec link to the existing HTMLAnchorElement::is_focusable().

Note that this still doesn't allow triggering keyboard-focused buttons,
checkboxes, or radio buttons - we don't seem to run the expected
activation behavior for any of them.
2022-03-26 19:42:58 +01:00
Timothy Flynn
5608bc4eaf LibWeb: Remove inheritance of FormAssociatedElement from HTMLElement
HTMLObjectElement will need to be both a FormAssociatedElement and a
BrowsingContextContainer. Currently, both of these classes inherit from
HTMLElement. This can work in C++, but is generally frowned upon, and
doesn't play particularly well with the rest of LibWeb.

Instead, we can essentially revert commit 3bb5c62 to remove HTMLElement
from FormAssociatedElement's hierarchy. This means that objects such as
HTMLObjectElement individually inherit from FormAssociatedElement and
HTMLElement now.

Some caveats are:

* FormAssociatedElement still needs to know when the HTMLElement is
  inserted into and removed from the DOM. This hook is automatically
  injected via a macro now, while still allowing classes like
  HTMLInputElement to also know when the element is inserted.

* Casting from a DOM::Element to a FormAssociatedElement is now a
  sideways cast, rather than directly following an inheritance chain.
  This means static_cast cannot be used here; but we can safely use
  dynamic_cast since the only 2 instances of this already use RTTI to
  verify the cast.
2022-03-24 03:35:11 +01:00
Luke Wilde
432d496ed6 LibWeb: Add form associated element categories 2022-03-01 23:19:41 +01:00
Andreas Kling
1b6ed558bb LibWeb: Move QualifiedName into the Web::DOM namespace 2022-02-19 14:45:59 +01:00
Luke Wilde
3bb5c6207f LibWeb: Make FormAssociatedElement inherit from HTMLElement
The new event target implementation requires us to downcast an
EventTarget to a FormAssociatedElement to check if the current Element
EventTarget has a form owner to setup a with scope for the form owner.

This also makes all form associated elements inherit from
FormAssociatedElement where it was previously missing.

https://html.spec.whatwg.org/#form-associated-element
2022-02-08 17:47:44 +00:00
Linus Groh
649d2faeab Everywhere: Use "the SerenityOS developers." in copyright headers
We had some inconsistencies before:

- Sometimes "The", sometimes "the"
- Sometimes trailing ".", sometimes no trailing "."

I picked the most common one (lowecase "the", trailing ".") and applied
it to all copyright headers.

By using the exact same string everywhere we can ensure nothing gets
missed during a global search (and replace), and that these
inconsistencies are not spread any further (as copyright headers are
commonly copied to new files).
2021-04-29 00:59:26 +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
330c3fcb59 LibWeb: Use move semantics for QualifiedName more often 2021-02-07 11:20:15 +01:00
Andreas Kling
13d7c09125 Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00