1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 02:27:35 +00:00
serenity/Userland/Libraries/LibWeb
MacDue 3484db0dc1 LibWeb: Remove SVG sizing hack and fix viewbox scaling
Previously, if you had an SVG with a viewbox and a definite width
and height, then all SVGGeometryBox boxes within that SVG would
have a width and height set to the size of the parent SVG.

This broke hit testing for SVG paths, and didn't make much sense.
It seems like the SVG sizing hack was patching over the incorrect
logic in viewbox_scaling() and the incorrect path sizing (which was
never reached).

Before this change the view box scaling was:
	element_dimension / viewbox_dimension

Which only seemed to work because of the SVG sizing hack that made
all paths the size of the containing SVG.

After this change SVGGeometryBoxes are (in most cases) sized correctly
based on their bounding boxes, which allows hit testing to function,
and the view box scaling is updated now to:
	  containing_SVG_dimension / viewbox_dimension

Which works with one less hack :^)

This now also handles centering the viewbox within the parent SVG
element and applying any tranforms to the bounding box. This still
a bit ad-hoc, but much more closely matches other browsers now.
2023-04-12 07:40:22 +02:00
..
ARIA Everywhere: Rename equals_ignoring_case => equals_ignoring_ascii_case 2023-03-10 13:15:44 +01:00
Bindings Everywhere: Remove unused DeprecatedString includes 2023-04-09 22:00:54 +02:00
Cookie Everywhere: Rename equals_ignoring_case => equals_ignoring_ascii_case 2023-03-10 13:15:44 +01:00
Crypto AK+Everywhere: Change AK::fill_with_random to accept a Bytes object 2023-04-03 15:53:49 +02:00
CSS Everywhere: Remove unused DeprecatedString includes 2023-04-09 22:00:54 +02:00
DOM LibWeb: Handle null values when making args for attributeChangedCallback 2023-04-11 23:42:15 +02:00
DOMParsing LibWeb: Fix a few const-ness issues 2023-03-06 13:05:43 +00:00
Encoding LibWeb/WebIDL: Store SimpleException message as a String{,View} variant 2023-03-03 19:50:36 +00:00
Fetch AK+Everywhere: Use Optional for URLParser::parse's base_url parameter 2023-04-11 16:28:20 +02:00
FileAPI LibWeb: Fix a few const-ness issues 2023-03-06 13:05:43 +00:00
Geometry LibWeb: Remove FIXME for existing [Default] object toJSON()functions 2023-03-23 21:00:43 +00:00
HighResolutionTime LibWeb: Implement performance.mark and performance.clearMarks 2023-03-23 21:00:43 +00:00
HTML LibWeb: Return from "the end" during HTML fragment parsing 2023-04-11 21:32:30 +02:00
Infra LibWeb: Use equals_ignoring_ascii_case() in infra helper 2023-03-10 13:15:44 +01:00
IntersectionObserver LibWeb: Make factory method of IntersectionObserver fallible 2023-02-22 09:55:33 +01:00
Layout LibWeb: Remove SVG sizing hack and fix viewbox scaling 2023-04-12 07:40:22 +02:00
Loader LibWeb: Create a video document for video/ MIME types on navigation 2023-04-12 01:47:58 +02:00
MimeSniff Everywhere: Remove unused DeprecatedString includes 2023-04-09 22:00:54 +02:00
NavigationTiming LibWeb: Add a list of the entry names in the PerformanceTiming interface 2023-03-23 21:00:43 +00:00
Page LibWeb: Port fire_keyboard_event() to new FlyString 2023-04-09 17:27:27 +02:00
Painting LibWeb: Make SC hit testing more closely follow reverse paint order 2023-04-12 07:40:22 +02:00
PerformanceTimeline LibWeb: Introduce Performance Timeline and its Performance functions 2023-03-23 21:00:43 +00:00
Platform LibWeb: Convert Platform::Timer to JS::SafeFunction 2023-03-07 11:51:12 +00:00
ReferrerPolicy LibWeb: Add HTMLAnchorElement.referrerPolicy property 2023-03-31 11:36:41 +01:00
RequestIdleCallback LibWeb/HTML: Port Window.requestIdleCallback() to IDL 2023-03-07 23:33:34 +00:00
ResizeObserver LibWeb: Make factory method of ResizeObserver::ResizeObserver fallible 2023-02-22 09:55:33 +01:00
Scripts LibWeb: Store stylesheet sources as StringViews 2023-02-19 00:51:16 +01:00
SecureContexts Everywhere: Rename to_{string => deprecated_string}() where applicable 2022-12-06 08:54:33 +01:00
Selection LibWeb: Make factory method of Selection::Selection fallible 2023-02-22 09:55:33 +01:00
Streams LibWeb: Add ReadableStreamByteController interface 2023-04-12 01:47:48 +02:00
SVG LibWeb: Parse the transform attribute when set on SVGGraphicsElements 2023-04-12 07:40:22 +02:00
Tests Everywhere: Rename WrapperGenerator to BindingsGenerator 2022-09-21 23:06:08 +01:00
UIEvents LibWeb: Port {Mouse,UI,Wheel,}Event to new String 2023-04-07 22:41:01 +02:00
URL AK: Don't store parts of URLs percent decoded 2023-04-12 07:40:22 +02:00
UserTiming LibWeb: Implement performance.mark and performance.clearMarks 2023-03-23 21:00:43 +00:00
WebAssembly LibWeb+LibWasm: Implement and use the "reset the Memory buffer" steps 2023-03-29 07:16:37 +02:00
WebDriver LibWeb/WebDriver: Wait for more data to arrive if request is incomplete 2023-03-26 17:56:17 +02:00
WebGL LibWeb: Port fire_webgl_context_event() to new FlyString 2023-04-09 17:27:27 +02:00
WebIDL LibWeb: Add missing include to WebIDL::Promise 2023-04-08 22:04:14 +02:00
WebSockets LibWeb: Port {Mouse,UI,Wheel,}Event to new String 2023-04-07 22:41:01 +02:00
XHR LibWeb: Port fire_progress_event() + request_error_steps() to new String 2023-04-09 17:27:27 +02:00
XML LibWeb: Port fire_a_page_transition_event() to new FlyString 2023-04-09 17:27:27 +02:00
CMakeLists.txt LibWeb: Add ReadableStreamByteController interface 2023-04-12 01:47:48 +02:00
Dump.cpp LibWeb: Implement the :defined pseudo class 2023-04-06 11:36:56 +02:00
Dump.h LibWeb+Browser+Ladybird: Add menu action to dump paint tree 2023-03-18 20:23:35 +01:00
FontCache.cpp LibWeb: Scale the font when painting the text on buttons 2023-03-15 23:29:00 +01:00
FontCache.h LibWeb: Scale the font when painting the text on buttons 2023-03-15 23:29:00 +01:00
Forward.h LibWeb: Add ReadableStreamByteController interface 2023-04-12 01:47:48 +02:00
idl_files.cmake LibWeb: Add ReadableStreamByteController interface 2023-04-12 01:47:48 +02:00
Namespace.cpp LibWeb: Initialize static web strings during main-thread VM creation 2023-03-18 19:50:45 +01:00
Namespace.h LibWeb: Initialize static web strings during main-thread VM creation 2023-03-18 19:50:45 +01:00
PixelUnits.h LibWeb: Use type-correct hashing and formatting functions for pixels 2023-01-21 10:36:14 +01:00
TreeNode.h LibJS+LibWeb: Move headers around to allow including Value from Cell 2023-01-29 00:02:45 +00:00