summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/HTML/HTMLImageElement.h
AgeCommit message (Collapse)Author
2023-05-26LibWeb: Return DOMException instead of crashing when setting attributesPrestonLTaylor
2023-05-21LibWeb: Load external images with image/svg+xml as SVG-as-imageAndreas Kling
2023-05-21LibWeb: Have ImageProvider bitmap getter take optional size argumentAndreas Kling
This allows the painting subsystem to request a bitmap with the exact size needed for painting, instead of being limited to "just give me a bitmap" (which was perfectly enough for raster images, but not for vector graphics).
2023-05-21LibWeb: Make ImageBox ask ImageProvider for intrinsic size and ratioAndreas Kling
This paves the way for ImageProvider to have something vector-based underneath. :^)
2023-05-13LibWeb: Let HTMLImageElement delay the document load event againAndreas Kling
2023-05-13LibWeb: Don't force HTMLImageElement to have a legacy ImageLoaderAndreas Kling
We achieve this by adding a new Layout::ImageProvider class and having both HTMLImageElement and HTMLObjectElement inherit from it. The HTML spec is vague on how object image loading should work, which is why this first pass is focusing on image elements.
2023-05-13LibWeb: Implement enough of "update the image data" to load imagesAndreas Kling
This first pass is enough to get us: - Image loading via fetch - Source selection via srcset and sizes attributes
2023-04-02LibWeb: Make HTMLImageElement loads delay the document load eventAndreas Kling
This is something we're supposed to do according to the HTML spec. Note that image loading is currently completely ad-hoc, and this just adds a simple DocumentLoadEventDelayer to the existing implementation. This will allow us to use images in layout tests, which rely on the document load event firing at a predictable time.
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-27LibWeb: Remove declarations for non-existent methodsSam Atkins
2023-01-10LibWeb: Move setting of Web object prototypes to initialize()Timothy Flynn
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-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-10-20LibWeb: Make the layout tree GC-allocatedAndreas Kling
This removes a set of complex reference cycles between DOM, layout tree and browsing context. It also makes lifetimes much easier to reason about, as the DOM and layout trees are now free to keep each other alive.
2022-10-03LibWeb: Implement HTMLImageElement.completeAndreas Kling
This was fairly straightforward, although a small part had to be ad-hoc since we don't yet load images through Fetch. With this, we can now see annotation labels on deskto.ps :^)
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+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-04-12LibWeb: Bring HTMLImageElement closer to specIgor Pissolati
2022-04-01Everywhere: Run clang-formatIdan Horowitz
2022-03-24LibWeb: Remove inheritance of FormAssociatedElement from HTMLElementTimothy Flynn
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-02-25LibWeb: Implement HTMLImageElement.width and HTMLImageElement.heightAndreas Kling
2022-02-19LibWeb: Move QualifiedName into the Web::DOM namespaceAndreas Kling
2022-02-08LibWeb: Make FormAssociatedElement inherit from HTMLElementLuke Wilde
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-05LibWeb: Compute element style in Layout::TreeBuilderAndreas Kling
Instead of making each Layout::Node compute style for itself, we now compute it in TreeBuilder before even calling create_layout_node(). For non-element DOM nodes, we create the style and layout tree node in TreeBuilder. This allows us to move create_layout_node() from DOM::Node to DOM::Element.
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-02-07LibWeb: Use move semantics for QualifiedName more oftenAndreas Kling
2021-01-12Libraries: Move to Userland/Libraries/Andreas Kling