summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/HTML
AgeCommit message (Collapse)Author
2022-03-31LibWeb: Add 'is scripting enabled' concept to EnvironmentSettingsObjectLinus Groh
This is now the source of truth for 'user enabled/disabled scripting', but it has to ask the window's page, which actually stores the setting. Also use this new functionality in two places where it was previously marked as a FIXME.
2022-03-31LibWeb: Add the HTMLOrSVGElement IDL interface mixinIdan Horowitz
2022-03-31LibWeb: Replace ad-hoc EventHandler type with callback function typedefIdan Horowitz
2022-03-30LibWeb: Rename `parse_css()` -> `parse_css_stylesheet()`Sam Atkins
2022-03-29LibWeb: Add HTMLTableCellElement::rowSpanSimon Wanner
2022-03-29LibWeb: Add HTMLTableCellElement::colSpanSimon Wanner
2022-03-28LibWeb: Load X(HT)ML documents and transform them into HTML DOMAli Mohammad Pur
2022-03-28LibWeb: Define HTML::perform_a_microtask_checkpoint()Ali Mohammad Pur
This was declared and not defined.
2022-03-27LibWeb: Use Gfx::Font::pixel_size() when we want pixel metricsAndreas Kling
This gives us consistent results with both bitmap and scalable fonts.
2022-03-26LibWeb: Remove debug spam about not executing empty script elementsAndreas Kling
2022-03-26LibWeb: Make HTML{Button,Select,TextArea}Element focusableLinus Groh
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-26LibWeb: Make any HTMLInputElement with type != hidden focusableLinus Groh
From the HTML spec: Modulo platform conventions, it is suggested that the following elements should be considered as focusable areas and be sequentially focusable: ... - input elements whose type attribute are not in the Hidden state ...
2022-03-26LibWeb: Make HTMLInputElement::TypeAttributeState an enum classLinus Groh
2022-03-26LibWeb: Move HTML dimension value parsing from CSS to HTML namespaceAndreas Kling
These are part of HTML, not CSS, so let's not confuse things.
2022-03-26LibWeb: Treat width/height on td/th elements as non-zero dimension valueAndreas Kling
2022-03-26LibWeb: Treat width/height on table elements as non-zero dimension valueAndreas Kling
2022-03-26LibWeb: Support the hspace and vspace attributes on img elementsAndreas Kling
These map HTML dimension values to CSS margin values.
2022-03-26LibWeb: Treat img width/height attributes as HTML dimension valuesAndreas Kling
2022-03-26LibWeb: Bring handling of anchor elements closer to specsin-ack
This commit moves the regular handling of links to the anchor elements' activation behavior, and implements a few auxiliary algorithms as defined by the HTML specification. Note that certain things such as javascript links, fragments and opening a new tab are still handled directly in EventHandler, but they have been moved to handle_mouseup so that it behaves closer to how it would if it was entirely up-to-spec.
2022-03-24LibWeb: Weakly store a reference to the Window object in timer tasksTimothy Flynn
This prevents a crash when refreshing or navigating away from the Acid3 test page while it is actively running.
2022-03-24LibWeb: Handle XML MIME types in HTMLObjectElementIdan Horowitz
2022-03-24LibWeb: Discard ObjectElement's nested browsing context on image loadIdan Horowitz
2022-03-24LibWeb: Implement getSVGDocument() for BrowsingContextContainerIdan Horowitz
Specifically HTMLIFrameElement and HTMLObjectElement. HTMLEmbedElement will gain it automatically once it's also converted to inherit from BrowsingContextContainer.
2022-03-24LibWeb: Expose contentDocument on HTMLObjectElementIdan Horowitz
2022-03-24LibWeb: Rename PARSER_DEBUG => HTML_PARSER_DEBUGIdan Horowitz
Since this macro was created we gained a couple more parsers in the system :^)
2022-03-24LibWeb: Ignore application objects until we can support themTimothy Flynn
The HTMLObjectElement spec is set up to ignore application/octet-stream MIME types only. For this to work, we need to implement the MIME type sniffing algorithm so that all unknown MIME types become mapped to the application/octet-stream type. Until then, ignore all application/ MIME types as we won't be able to display them anyways.
2022-03-24LibWeb: Discard an object's nested browsing contexts when falling backTimothy Flynn
2022-03-24LibWeb: Implement falling back early to an object's child representationTimothy Flynn
2022-03-24LibWeb: Conditionally update an object's children when its state changesTimothy Flynn
We should only update the object children of an object when the parent's representation changes to/from falling back to its children.
2022-03-24LibWeb: Correctly handle unknown MIME types in HTMLObjectElementTimothy Flynn
We were using the literal string "unknown" as the unknown MIME type, which caused us to treat the object as a nested browsing context (as "unknown" does not start with "image/"). Use an Optional instead to prevent this mishap.
2022-03-24LibWeb: Add missing spec comment in focusing logicNukiloco
2022-03-24LibWeb: Begin supporting non-image HTMLObjectElement data representationTimothy Flynn
We currently only supported loading image data from an HTMLObjectElement node. This adds (some) support for non-image data. A big FIXME is to actually paint that data. We will need to make FrameBox and NestedBrowsingContextPaintable work with HTMLObjectElement for this (they currently only work with HTMLIFrameElement).
2022-03-24LibWeb: Move automatic browsing context creation to HTMLIFrameElementTimothy Flynn
We will soon have two DOM nodes which contain nested browsing contexts: HTMLIFrameElement and HTMLObjectElement. Only HTMLIFrameElement should have its nested context created automatically upon insertion, so move the invocation of that logic to HTMLIFrameElement.
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-03-23LibWeb: Update HTMLObjectElement's children on fallback state changesTimothy Flynn
This is another event upon which the task to determine an object's respresentation must be queued: * one of the element's ancestor object elements changes to or from showing its fallback content For example, on Acid2, the image for the eyes is nested below an object that is designed to fail to load. This ensures the eyes will render as the fallback of the failed parent object.
2022-03-23LibWeb: Move HTMLObjectElement spec link to correct methodTimothy Flynn
2022-03-23LibWeb: Implement HTMLObjectElement's data URL according to the specTimothy Flynn
There are a long list of conditions under which the HTMLObjectElement is to queue an element task to load / determine an object's representation. This handles the case where the data attribute has changed. Much of the spec for determining the object's representation is not implemented here. Namely, anything to do with XML documents or browser plugins are left as FIXMEs.
2022-03-23LibGfx: Implement `Rect::to_rounded<U>()`Jelle Raaijmakers
This replaces the usage of `rounded_int_rect`, whose name did not accurately reflect the rounding operation happening. For example, the position of the rect was not rounded but floored, and the size was pulled through `roundf` before casting to `int` which could result in inadvertent flooring if the resulting floating point could not exactly represent the rounded value.
2022-03-22LibWeb: Convert CRC2D to use TRY for error propagationLinus Groh
2022-03-22LibWeb: Handle input element value setting & getting closer to the specTimothy Flynn
We should not set the 'value' attribute when an input element's value is changed (by the user or programmatically). Instead, we should track the value internally and mark it with a dirty flag when it is changed.
2022-03-22LibWeb: Explicitly ignore [[nodiscard]] values returned from TRY(), pt 2Linus Groh
2022-03-22LibWeb: Convert HTMLOptionsCollection to use TRY for error propagationTimothy Flynn
2022-03-22LibWeb: Implement HTMLSelectElement.add()Timothy Flynn
HTMLSelectElement simply defers to its HTMLOptionsCollection.
2022-03-22LibWeb: Implement HTMLOptionsCollection.add()Timothy Flynn
2022-03-21LibWeb: Implement HTMLTableRowElement.{rowIndex,sectionRowIndex}Andreas Kling
Another point on Acid3. :^)
2022-03-21LibTextCodec: Don't allocate Strings on encoding normalisationHendiadyoin1
This ripples down to LibWeb's HTML and XHR decoders, which therefore become less allocation heavy.
2022-03-21LibWeb: Implement "has element in select scope" per-specSimon Wanner
The HTML Specification is quite tricky in this case. Usually "have a particular element in <x> scope" mentions "consisting of the following element types:", but in this case it's "consisting of all element types except the following:" Thanks to @AtkinsSJ for spotting this difference
2022-03-20LibWeb: Don't crash in BrowsingContextContainer::content_document()Andreas Kling
Instead of choking on the VERIFY(document), let's just return null if there's no active document for now. This is incorrect, but sidesteps a frequent crash that happens on content with iframes. I've left a FIXME about removing the hack once it's no longer needed.
2022-03-20LibWeb: Ignore linked stylesheets with MIME types other than text/cssAndreas Kling
This makes the "Acid3" text on ACID3 not show up in red. :^)
2022-03-20LibWeb: Invalidate style & layout inside iframes when they change sizeAndreas Kling