summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/SVG
AgeCommit message (Collapse)Author
2023-04-12Everywhere: Fix a few typosNico Weber
Some even user-visible!
2023-04-12LibWeb: Allow floating point values when parsing SVG viewboxesMacDue
2023-04-12LibWeb: Always use quirks mode when parsing SVG width/height attributesMacDue
This is a bit if a hack, but without this unitless values for these attributes fail to parse with <!DOCTYPE html>.
2023-04-12LibWeb: Apply CSS scaling to SVG elementsMacDue
Not sure why this was not done before, not now it works easily :^)
2023-04-12LibWeb: Parse the `transform` attribute when set on SVGGraphicsElementsMacDue
This uses the new attribute parser functionality, and then resolves the transform list into a single Gfx::AffineTransform. This also adds a .get_transform() function which resolves the final transform, by applying all parent transforms.
2023-04-12LibWeb: Parse and apply `fill-opacity` attribute to SVG pathsMacDue
This is needed to fix the rendering of the Street View directional controls (which have paths with various levels of opacity set by this attribute).
2023-04-12LibWeb: Add SVG transform parsingMacDue
This parses SVG transforms using the syntax from CSS Transforms Module Level 1. Note: This looks very similar to CSS tranforms, but the syntax is not compatible. For example, SVG rotate() is rotate(<a> <x> <y>) where all parameters are unitless numbers whereas CSS rotate() is rotate(<angle> unit) along with separate rotateX/Y/Z(). (At the same time AttributeParser is updated to use GenericLexer which makes for easier string matching). There is work needed for error handling (which AttributeParser does not deal with very gracefully right now).
2023-04-09Everywhere: Remove unused DeprecatedString includesBen Wiederhake
2023-03-25LibWeb: Split PercentageStyleValue out of StyleValue.{h,cpp}Sam Atkins
2023-03-20LibWeb: Move Element.prototype.style to ElementCSSInlineStyle mixinSimon Wanner
Also adds the `PutForwards` extended attribute allowing setting the style property.
2023-03-20LibWeb: Support more length types in SVG width/height attributesMichiel
Previously we were using the HTML parse_dimension_value method for the height and width attributes of an SVG element. These attributes should however be treated as css properties instead and thus also support calc() and absolute units so we use the css parser for this instead.
2023-03-18LibWeb: Initialize static web strings during main-thread VM creationTimothy Flynn
These are currently initialized in a [[gnu::constructor]], which has a weird initialization order. These constructors are invoked before main() and, incidentally, before any user-defined default constructors of the static strings they are initializing. This will become an issue when these strings are ported to FlyString, which has a user-defined default constructor. In that scenario, when the FlyString constructor is executed after the [[gnu::constructor]], the strings will be "reset" to the empty string. Instead of relying on a non-standard compiler extension here, let's just initialize these strings explicitly during main-thread VM creation, as this now happens in WebContent's main().
2023-03-10Everywhere: Rename equals_ignoring_case => equals_ignoring_ascii_caseAndreas Kling
Let's make it clear that these functions deal with ASCII case only.
2023-03-06Everywhere: Stop using NonnullRefPtrVectorAndreas Kling
This class had slightly confusing semantics and the added weirdness doesn't seem worth it just so we can say "." instead of "->" when iterating over a vector of NNRPs. This patch replaces NonnullRefPtrVector<T> with Vector<NNRP<T>>.
2023-02-22LibWeb: Make factory method of Geometry::DOMPoint fallibleKenneth Myhra
2023-02-18LibWeb: Make factory method of SVG::SVGLength fallibleKenneth Myhra
2023-02-18LibWeb: Make factory method of HTML::DOMStringMap fallibleKenneth Myhra
2023-02-18LibWeb: Make factory method of SVG::SVGAnimatedLength fallibleKenneth Myhra
2023-02-10LibGfx+LibWeb: Store radii as FloatSize rather than FloatPointAndreas Kling
Radii are sizes, not points. This becomes important when mapping them through a 2D transform.
2023-02-08Everywhere: Use ReadonlySpan<T> instead of Span<T const>MacDue
2023-01-29LibJS+Everywhere: Propagate Cell::initialize errors from Heap::allocateTimothy Flynn
Callers that are already in a fallible context will now TRY to allocate cells. Callers in infallible contexts get a FIXME.
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-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-10LibWeb: Use correct arguments in WEB_PLATFORM_OBJECT invocationsTimothy Flynn
The base class should be the second argument, and must be the immediate base class (not the grandparent).
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-08AK+Everywhere: Make UTF-8 and UTF-32 to UTF-16 converters fallibleTimothy Flynn
These could fail to allocate the underlying storage needed to store the UTF-16 data. Propagate these errors.
2023-01-05LibWeb: Resolve Lengths to CSSPixelsSam Atkins
2023-01-05LibWeb: Replace all px Length creation with Length::make_px(CSSPixels)Sam Atkins
2022-12-28LibWeb: Use `Optional` for previous SVG path control pointJelle Raaijmakers
Previously, a control point at `(0, 0)` would have been considered absent. USe `Optional<Gfx::FloatPoint>` instead.
2022-12-15LibJS: Convert Heap::allocate{,_without_realm}() to NonnullGCPtrLinus Groh
2022-12-07Meta+Userland: Pass Gfx::Color by valueMacDue
Gfx::Color is always 4 bytes (it's just a wrapper over u32) it's less work just to pass the color directly. This also updates IPCCompiler to prevent from generating Gfx::Color const &, which makes replacement easier.
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-30LibWeb: Factor out SVG path parsing from SVGPathElementAndreas Kling
Converting a Vector<PathInstruction> is now done by a free function so that we can share this code with HTML::Path2D. :^)
2022-11-16LibWeb: Sketch out basic support for SVG <foreignObject> elementsAndreas Kling
This patch adds basic DOM construction and IDL bindings for foreign objects in SVG trees.
2022-11-15LibWeb: Change SVGContext initial fill_color to transparentTorstennator
This patch changes the initialization of the fill_color of an SVGContext to transparent instead of black to not draw a black filling if the elements fill_color is defined as "none".
2022-10-23LibWeb: Make SVG::AttributeParser use the new double parserdavidot
Because the result will be a float anyway get rid of the int parsing. Also the grammar of SVG numbers matches the double parser grammar except it can't have a sign but that should have been checked by the caller.
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-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-09LibWeb: Add Exposed attribute and IDL spec links where missingAndrew Kaster
The intent is to use these to autogenerate prototype declarations for Window and WorkerGlobalScope classes. And the spec links are just nice to have :^)
2022-10-01LibWeb: Cleanup unecessary uses and includes of HTML::WindowAndrew Kaster
The big global refactor left some stragglers behind for atomicity. Clean up the rest, and remove a ton of includes of LibWeb/HTML/Window.h
2022-10-01LibWeb: Remove unecessary dependence on Window from SVG classesAndrew Kaster
These classes only needed Window to get at its realm. Pass a realm directly to construct SCG classes.
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: Make DOMPoint and DOMPointReadOnly GC-allocatedAndreas Kling
2022-09-06LibWeb: Use cached_web_prototype() as much as possibleAndreas Kling
Unlike ensure_web_prototype<T>(), the cached version doesn't require the prototype type to be fully formed, so we can use it without including the FooPrototype.h header. It's also a bit less verbose. :^)
2022-09-06LibWeb: Make SVGLength and SVGAnimatedLength GC-allocatedAndreas Kling
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-12LibWeb: Stub out two functions on SVGGeometryElementAndreas Kling
These two were called by Discord while loading: - float getTotalLength(); - DOMPoint getPointAtLength(float distance);
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.