summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/HTML/HTMLElement.h
AgeCommit message (Collapse)Author
2023-05-15LibWeb: Cache state of the contenteditable attribute on HTMLElementAndreas Kling
Instead of recomputing the state whenever someone asks for it, we now cache it when the attribute is added/changed/removed. Before this change, HTMLElement::is_editable() was 6.5% of CPU time when furiously resizing Hacker News. After, it's less than 0.5%. :^)
2023-04-09LibWeb: Port fire_a_synthetic_pointer_event() to new FlySringKenneth Myhra
2023-04-06LibWeb: Port {HTML,UIEvents,XHR}::EventNames to new StringKenneth Myhra
2023-01-29LibWeb: Move ARIA-related code into the Web::ARIA namespaceLinus Groh
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-29LibJS+Everywhere: Allow Cell::initialize overrides to throw OOM errorsTimothy Flynn
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-28LibWeb: Replace ARIA role static FlyStrings with an enumMacDue
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-09AK+Everywhere: Rename FlyString to DeprecatedFlyStringTimothy Flynn
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-07LibWeb: Add Support for the ARIA Element PropertiesJonah
Element now supports getting and setting ARIA properties from JS and HTML.
2022-12-06AK+Everywhere: Rename String to DeprecatedStringLinus Groh
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-11-13LibWeb: Implement bare-bones `HTMLElement.dir`Igor Pissolati
2022-10-10LibWeb: Don't include DOMStringMap.h quite so muchAndreas Kling
This file was being included everywhere via HTMLElement and SVGElement, but we don't actually need to do that.
2022-10-07LibWeb: Add initial implementation of Element.blur()Andrew Kaster
This implementation includes a first cut at run the unfocusing steps from the spec, with many things left unimplemented. The viewport related spec steps in particular don't seem to map to LibWeb concepts, which makes figuring out if things are properly focused much more difficult.
2022-09-25LibWeb: Move ExceptionOr from DOM/ to WebIDL/Linus Groh
This is a concept fully defined in the Web IDL spec and doesn't belong in the DOM directory/namespace - not even DOMException, despite the name :^)
2022-09-21LibWeb: Remove WRAPPER_HACK() macroLinus Groh
We no longer access Bindings::FooWrapper anywhere for a Foo platform object, so these can be removed :^)
2022-09-06LibWeb: Don't allocate DOMStringMap in HTMLElement constructorAndreas Kling
Allocations go in initialize().
2022-09-06LibWeb+LibJS: Make the EventTarget hierarchy (incl. DOM) GC-allocatedAndreas Kling
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-06LibWeb: Make DOMStringMap GC-allocatedAndreas Kling
2022-07-27LibWeb: Add fast_is<HTMLElement>()Andreas Kling
This avoids slow RTTI lookups in selector matching.
2022-06-29LibWeb: Only make certain <body> and <frameset> events apply to WindowLuke Wilde
Previously we forwarded all event handler attributes to Window from these two elements, however, we are only supposed to forward blur, error, focus, load, resize and scroll.
2022-04-01Everywhere: Run clang-formatIdan Horowitz
2022-03-08LibWeb: Move Window from DOM directory & namespace to HTMLLinus Groh
The Window object is part of the HTML spec. :^) https://html.spec.whatwg.org/multipage/window-object.html
2022-03-01LibWeb: Add form associated element categoriesLuke Wilde
2022-02-25LibWeb: Improve HTMLElement.click()Andreas Kling
This API now follows the spec a bit more closely, with regards to the event being dispatched. There are still FIXME's but this is already an improvement. 2% progression on ACID3. :^)
2022-02-19LibWeb: Move QualifiedName into the Web::DOM namespaceAndreas Kling
2022-02-15LibWeb: Implement HTMLElement.click()Andreas Kling
This doesn't send the correct type of click event, but it does send something, so it's already somewhat useful. :^)
2022-02-06LibWeb: Implement (most of) HTMLElement.focus()Andreas Kling
The main deviation from the spec is that we don't have a straightforward representation of the spec's "focusable area" concept. I've left a bunch of FIXME's around for our future selves. :^)
2021-09-30LibWeb: Support HTMLElement.offset{Width,Height}Andreas Kling
2021-09-26LibWeb: Add support for HTMLOrSVGElement.datasetLuke Wilde
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
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-15LibWeb: Expose the HTMLElement::{offsetLeft, offsetTop} attributesIdan Horowitz
These describe the border box of an element relative to their parent.
2021-02-20LibWeb: Use DOMException in HTMLElement::set_content_editable()Linus Groh
2021-02-07LibWeb: Use move semantics for QualifiedName more oftenAndreas Kling
2021-02-03LibWeb: Basic implementation of global event handlers :^)Andreas Kling
Document and HTMLElement now inherit from HTML::GlobalEventHandlers which allows them to support "onfoo" event handler attributes. These are assignable both via IDL attributes and content attributes. Event listeners constructed this way get a special "attribute" flag on them so we know which one to replace if you reassign them. This also allows them to coexist with EventTarget.addEventListener(). This is all a bit sloppy, but it works decently for a first cut. The Window object should also inherit GlobalEventHandlers, but since we don't generate it from IDL, I haven't taken that step here. Also this would be a lot nicer if we supported IDL mixins.
2021-01-12Libraries: Move to Userland/Libraries/Andreas Kling