summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/HTML
AgeCommit message (Collapse)Author
2022-07-14LibWeb: Add a stub PolicyContainer structLinus Groh
2022-07-14LibWeb: Move Origin into the HTML namespaceLinus Groh
Origin is defined in the HTML Standard, and therefore belongs into the HTML directory and namespace in LibWeb. https://html.spec.whatwg.org/multipage/origin.html#origin
2022-07-12Everywhere: Replace single-char StringView op. arguments with charssin-ack
This prevents us from needing a sv suffix, and potentially reduces the need to run generic code for a single character (as contains, starts_with, ends_with etc. for a char will be just a length and equality check). No functional changes.
2022-07-12Everywhere: Add sv suffix to strings relying on StringView(char const*)sin-ack
Each of these strings would previously rely on StringView's char const* constructor overload, which would call __builtin_strlen on the string. Since we now have operator ""sv, we can replace these with much simpler versions. This opens the door to being able to remove StringView(char const*). No functional changes.
2022-07-11LibWeb: Store MessageEvent::m_data in a JS::HandleLuke Wilde
This protects it from GC.
2022-07-05LibWeb: Implement XMLSerializerLuke Wilde
The main thing that is missing is validating certain pieces of data against XML productions in well-formed mode, but nothing uses well-formed mode right now. Required by Closure Library for sanitising HTML. https://github.com/google/closure-library/blob/e687b3d8ab014787b9f10b08b3f597b637392480/closure/goog/html/sanitizer/safedomtreeprocessor.js#L117
2022-07-04LibWeb: Add the type field to DOM::DocumentnetworkException
This patch adds the document type concept to documents and sets it in various places.
2022-06-29LibWeb: Print unhandled rejections the same way as unhandled exceptionsLuke Wilde
2022-06-29LibWeb: Store PromiseRejectionEvent::m_reason in a JS::HandleLuke Wilde
2022-06-29LibWeb: Move ClassicScript::m_settings_object into the Script baseLuke Wilde
All Scripts have an associated settings object. https://html.spec.whatwg.org/multipage/webappapis.html#settings-object
2022-06-29LibWeb: Implement WindowEventHandlersLuke Wilde
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-06-27LibWeb: Forward CRC2D's ref count to HTMLCanvasElementLuke Wilde
This allows HTMLCanvasElement and CRC2D to share their lifetime, as JS allows them to arbitrarily access them at any time and CRC2D.canvas expects a non-null return value.
2022-06-19LibWeb: Implement HTMLBaseElement.hrefLuke Wilde
2022-06-19LibWeb: Add support for the <base> element changing the base URLLuke Wilde
Used by Google seemingly almost all around account sign in and management. The modern sign in page has this near the beginning: ```html <base href="https://accounts.google.com"> ``` All of the XHRs performed by sign in are relative URLs to this base URL. Previously we ignored this and did it relative to the current URL, causing the XHRs to 404 and sign in to fall apart. I presume they do this because you can access the sign in page from multiple endpoints, such as `/ServiceLogin` and `/o/oauth2/auth/identifier`
2022-06-16LibWeb: Disable unused error on temporarily unused variable from specFrHun
2022-06-13LibWeb: Add the ability to retrieve a WebGL context from getContextLuke Wilde
2022-06-03LibWeb: Fix Array OOBs in the HTMLTokenizerstelar7
Accessing last() if there are no elements makes WebContent crash :^)
2022-05-29Everywhere: Fix a bunch of typosLinus Groh
2022-05-15LibWeb: Abstract the image decoding via Web::ImageDecoding::DecoderDexesTTP
After this change, LibWeb now expects Web::ImageDecoding::Decoder to be pre-initialized with a concrete implementation before using the webpage. The previous implementation, based on the ImageDecoder service, has been provided directly through an adapter in LibWebClient, and is now used as the default value by WebContent.
2022-05-13LibWeb: Stop inactive requestAnimationFrame() callbacks from runningMacDue
Previously requestAnimationFrame() callbacks were registered with a static global RequestAnimationFrameDriver shared between all windows. This led to callbacks still running after navigating away from a page (This could be seen with the WASM GoL demo). This commit moves the RequestAnimationFrameDriver (now AnimationFrameCallbackDriver) to be a member of the HTML::Window object, then uses the 'active document' parameter of run_animation_frame_callbacks() to run only the active callbacks.
2022-05-07LibJS: Convert Console to use MarkedVector<Value>Luke Wilde
Using a Vector<Value> is unsafe as GC cannot see the stored values. This is then vended to outside users of ConsoleClient, e.g. LibWeb and WebContent, which is then outside of LibJS's control. An example issue is if the client stores it for later use and forgets to visit the stored values, meaning they can be destroyed at any time. We can save the client from this by vending a MarkedVector<Value> to them.
2022-05-06LibWeb: Remove unneeded LibGUI include in Window.cppDexesTTP
2022-04-20LibWeb: Fix various spec comment inconsistenciesLinus Groh
- Don't add multiple numbers to nested steps, just the innermost one (as rendered in the HTML document) - "Otherwise" comments go before the else, not after it - "FIXME:" goes before step number, not between it and the comment text - Always add a period between number and comment text The majority of these were introduced in #13756, but some unrelated ones have been updated as well.
2022-04-17LibWeb: Dont abort when parsing data- properties that contain dashesstelar7
2022-04-14LibWeb: Stop including StyleValue.h in a few placesSam Atkins
I don't know how much this will actually help compile times, but it's something!
2022-04-13LibWeb: Use Vector::in_reverse() in HTML::StackOfOpenElementsAndreas Kling
2022-04-13LibWeb: Map <pre wrap> presentational hint to CSS white-space:pre-wrapAndreas Kling
2022-04-12LibWeb: Move CSS Parser into new Web::CSS::Parser namespaceSam Atkins
The goal here is to move the parser-internal classes into this namespace so they can have more convenient names without causing collisions. The Parser itself won't collide, and would be more convenient to just remain `CSS::Parser`, but having a namespace and a class with the same name makes C++ unhappy.
2022-04-12LibWeb: Bring HTMLOptionElement closer to specIgor Pissolati
2022-04-12LibWeb: Improve HTMLImageElement::{width,height}()Igor Pissolati
With this change, it will correctly return the width/height when the image element has an assigned width/height attribute.
2022-04-12LibWeb: Bring HTMLImageElement closer to specIgor Pissolati
2022-04-11LibWeb: Reset canvas elements when their width/height attribute are setAndreas Kling
2022-04-11LibWeb: Add fast path for CRC2D.drawImage() with simple transformAndreas Kling
If the transform is a simple translation, we don't need to run the big and slow transform rasterizer.
2022-04-11LibWeb: Honor "display:block" on IMG elementsAndreas Kling
Previously we forced all image elements to be inline-level. Now they can participate in block layout if they prefer. :^)
2022-04-10LibWeb: Update layout in HTMLElement.offset{Width,Height}Andreas Kling
If we don't do this, we may be returning stale values.
2022-04-10LibWeb: Stub CanvasRenderingContext2D.clipLuke Wilde
This is primarily required by Google Maps Street View, but the map view works without this.
2022-04-10LibWeb: Implement CanvasRenderingContext2D.resetTransformLuke Wilde
2022-04-10LibWeb: Implement CanvasRenderingContext2D.setTransformLuke Wilde
2022-04-10LibWeb: Implement CanvasRenderingContext2D.transformLuke Wilde
2022-04-10LibWeb: Update displayed favicon when a favicon is loadedAnthony Van de Gejuchte
When a favicon has been loaded, trigger a favicon update on document level. Of all the link tags in the header, the last favicon that is load should be shown. When the favicon could not be loaded, load the next icon in reverse tree order.
2022-04-10LibWeb: Add icon as possible resource type on the link tagAnthony Van de Gejuchte
2022-04-09LibWeb: Bring MouseEvent a bit closer to specIgor Pissolati
2022-04-07LibWeb: Fix logic mistake in CRC2D's default_source_size()Andreas Kling
If the source has a bitmap, we should indeed use the bitmap's size instead of always using the source's own size.
2022-04-07LibWeb: Support CRC2D.drawImage() with affine transformAndreas Kling
Previously, we only remapped the destination rect through the context's affine transform, but didn't actually paint through it. This patch fixes that by implementing a very inefficient algorithm for rasterizing a transformed bitmap. When the context has a plain identity transform, we bypass this algorithm in favor of calling Gfx::Painter directly as we did before. This makes the player character in "Biolab Disaster" able to turn left!
2022-04-06LibWeb: Make BrowsingContext ask PageClient when it wants to be scrolledAndreas Kling
BrowsingContext shouldn't be scrolling itself, instead it has to update the layout (to ensure that we have current document metrics, and then ask the PageClient nicely to scroll it. This fixes an issue where BrowsingContext sometimes believed itself to be scrolled, but OOPWV had a different idea.
2022-04-06LibWeb: Remove unused HTML::parse_html_document()Andreas Kling
2022-04-04LibWeb: Add legacy Option factory functionIgor Pissolati
2022-04-03LibWeb: Handle failed browsing context creation in HTMLObjectElementSimon Wanner
If the document is not attached to a browsing context we can't create a new nested browsing context. This can happen when the resource load for the <object> finishes after the user navigated away from the current document, for example by reloading ACID 3 while it's running.
2022-04-03LibWeb: Add a null-check for page() in ESO::is_scripting_enabled()Simon Wanner
This could lead to a crash when spamming reload on a page with a <script> element.