1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 02:47:35 +00:00
serenity/Userland/Libraries/LibWeb
Anonymous 745b998774 LibJS: Get rid of unnecessary work from canonical_numeric_index_string
The spec version of canonical_numeric_index_string is absurdly complex,
and ends up converting from a string to a number, and then back again
which is both slow and also requires a few allocations and a string
compare.

Instead this patch moves away from using Values to represent canonical
a canonical index. In most cases all we need to know is whether a
PropertyKey is an integer between 0 and 2^^32-2, which we already
compute when we construct a PropertyKey so the existing is_number()
check is sufficient.

The more expensive case is handling strings containing numbers that
don't roundtrip through string conversion. In most cases these turn
into regular string properties, but for TypedArray access these
property names are not treated as normal named properties.
TypedArrays treat these numeric properties as magic indexes that are
ignored on read and are not stored (but are evaluated) on assignment.

For that reason there's now a mode flag on canonical_numeric_index_string
so that only TypedArrays take the cost of the ToString round trip test.
In order to improve the performance of this path this patch includes
some early returns to avoid conversion in cases where we can quickly
know whether a property can round trip.
2022-02-14 21:06:49 +00:00
..
Bindings LibJS: Get rid of unnecessary work from canonical_numeric_index_string 2022-02-14 21:06:49 +00:00
Cookie Everywhere: Update copyrights with my new serenityos.org e-mail :^) 2022-01-31 18:23:22 +00:00
Crypto Everywhere: Convert ByteBuffer factory methods from Optional -> ErrorOr 2022-01-24 22:36:09 +01:00
CSS LibWeb: Don't crash on unknown CSS display types, fall back to inline 2022-02-13 01:03:49 +01:00
DOM LibWeb: Don't crash on unknown CSS display types, fall back to inline 2022-02-13 01:03:49 +01:00
DOMParsing LibWeb: Clean up static function in header 2021-10-06 23:52:40 +01:00
DumpLayoutTree Everywhere: Remove unused ArgsParser header 2021-11-01 21:12:58 +01:00
Encoding LibJS: Convert ArrayBuffer construction to ThrowCompletionOr 2022-02-08 09:12:42 +00:00
Fetch LibWeb: Implement spec-compliant MIME type struct and parser 2022-02-12 12:53:28 +01:00
Geometry LibWeb: Implement Geometry::DOMRectList 2022-02-12 22:43:10 +01:00
HighResolutionTime LibWeb: Rewrite EventTarget to more closely match the spec 2022-02-08 17:47:44 +00:00
HTML LibWeb: Don't emit current token on EOF in HTML Tokenizer 2022-02-14 12:50:44 +03:30
IntersectionObserver Everywhere: Update copyrights with my new serenityos.org e-mail :^) 2022-01-31 18:23:22 +00:00
Layout LibWeb: Add stacking contexts to Node::for_each_child_in_paint_order 2022-02-14 21:33:05 +01:00
Loader LibWeb: Set response header cookies on redirects 2022-02-12 16:15:56 +00:00
MimeSniff LibWeb: Fix comparing current position to quote in Mime Type quote parse 2022-02-12 17:13:14 +00:00
NavigationTiming LibWeb: Use RefCountForwarder for NavigationTiming::PerformanceTiming 2021-12-09 21:28:52 +01:00
Page LibWeb: Implement EventHandler::focus_previous_element() 2022-02-08 22:15:10 +00:00
Painting LibWeb: Paint inline-level and replaced elements on top of floats 2022-02-14 18:39:20 +01:00
RequestIdleCallback LibWeb: Add the IdleDeadline interface from the RequestIdleCallback spec 2021-09-17 13:20:18 +02:00
ResizeObserver LibWeb: Stub out a basic ResizeObserver interface 2021-10-11 00:54:01 +02:00
Scripts Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
Selection LibWeb: Stub out a basic Selection interface 2021-10-11 00:32:19 +02:00
SVG LibWeb: Clear the path of a SVGPathElement if the attribute changes 2022-02-11 21:38:27 +01:00
Tests LibWeb: Capture <script> element's node document on execution 2021-12-21 13:50:00 -08:00
UIEvents LibWeb: Add MouseEvent.x and MouseEvent.y 2022-02-07 13:28:59 +01:00
URL LibWeb: Add support for the record variant of URLSearchParams 2022-02-14 11:32:17 +01:00
WebAssembly LibJS: Replace uses of MarkedValueList with MarkedVector<Value> 2022-02-09 12:25:27 +00:00
XHR LibWeb: Decode XHR text with the specified charset in the MIME type 2022-02-12 12:53:28 +01:00
CMakeLists.txt LibWeb: Don't crash on unknown CSS display types, fall back to inline 2022-02-13 01:03:49 +01:00
DOMTreeModel.cpp Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00
DOMTreeModel.h AK: Make JSON parser return ErrorOr<JsonValue> (instead of Optional) 2021-11-17 00:21:10 +01:00
Dump.cpp LibWeb: Add an enum for !important 2022-02-12 16:13:27 +00:00
Dump.h LibWeb: Implement @supports rule :^) 2021-10-08 23:02:57 +02:00
FontCache.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
FontCache.h Everywhere: Fully qualify font names by including their slope 2022-02-01 10:06:26 +01:00
Forward.h LibWeb: Implement Geometry::DOMRectList 2022-02-12 22:43:10 +01:00
ImageDecoding.cpp LibCore+LibIPC+Everywhere: Return Stream::LocalSocket from LocalServer 2022-01-15 13:29:48 +03:30
ImageDecoding.h LibWeb: Move ImageDecoder client connection singleton to its own file 2021-11-20 10:56:31 +01:00
InProcessWebView.cpp LibWeb: Rename Layout::Box::size() to content_size() 2022-02-06 01:07:47 +01:00
InProcessWebView.h Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00
Namespace.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Namespace.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Origin.h LibWeb: Allow using Origin as a HashMap key 2022-02-08 21:53:20 +01:00
OutOfProcessWebView.cpp LibWeb: Plumb OOPWV focus state across the IPC boundary 2022-02-06 22:13:13 +01:00
OutOfProcessWebView.h LibWeb: Plumb OOPWV focus state across the IPC boundary 2022-02-06 22:13:13 +01:00
QualifiedName.h LibWeb: Use HTML-uppercased qualified name for the Element node name 2021-05-04 23:24:03 +01:00
StylePropertiesModel.cpp Everywhere: Use my shiny new serenityos.org email :^) 2021-09-03 12:22:36 +02:00
StylePropertiesModel.h AK: Make JSON parser return ErrorOr<JsonValue> (instead of Optional) 2021-11-17 00:21:10 +01:00
TreeNode.h LibWeb: Add TreeNode<T>::next_in_pre_order(T* stay_within) variant 2022-01-23 01:22:41 +01:00
WebContentClient.cpp LibCore+LibIPC+Everywhere: Return Stream::LocalSocket from LocalServer 2022-01-15 13:29:48 +03:30
WebContentClient.h LibCore+LibIPC+Everywhere: Return Stream::LocalSocket from LocalServer 2022-01-15 13:29:48 +03:30
WebViewHooks.h Browser+LibWeb+WebContent: Add variables display to Inspector 2021-12-10 06:52:17 +01:00