Commit Graph

28347 Commits

Author SHA1 Message Date
Aliaksandr Kalenik
ce9af96f78 LibWeb: Use document from DocumentState in navigation
New navigables spec assumes that document pointer is located in
DocumentState instead of SessionHistoryEntry like it was in the
old navigation spec.
2023-09-16 16:53:32 +02:00
Aliaksandr Kalenik
ee50d9b2b5 LibWeb: Update Page to use navigables 2023-09-16 16:53:32 +02:00
Andreas Kling
f91b34ef2e LibWeb: Update "obtain a BC to use for a navigation response"
This no longer calls "discard" on the browsing context, since discarding
is going away.
2023-09-16 16:53:32 +02:00
Andreas Kling
39f16ecd41 LibWeb: Don't break for atomic inline elements in white-space: nowrap 2023-09-16 15:21:16 +02:00
Ali Mohammad Pur
17087ac4a2 LibJS: Unescape incorrectly escaped code units in regex patterns
We were translating the pattern [\⪾-\⫀] to [\\u2abe-\\u2ac0], which
is a very different pattern; as a code unit converted to the \uhhh
format has no meaning when escaped, this commit makes us simply skip
escaping it when translating the pattern.
2023-09-16 15:21:09 +02:00
Andreas Kling
35ff38aaea LibWeb: Visit Document::m_visual_viewport
Another day, another missing visit_edges() :^(
2023-09-16 14:46:38 +02:00
Shannon Booth
e74031a396 LibWeb: Port Document interface from DeprecatedString to String 2023-09-16 11:17:19 +02:00
Shannon Booth
9d88e14f20 LibWeb: Add String variants of get_element_by_{} in ParentNode
These are required for porting over Document from DeprecatedString to
String. We unfortunately can't port this completely over yet as
ParentNode is included by the Element IDL interface, which has not yet
been ported over from DeprecatedString.
2023-09-16 11:17:19 +02:00
Tim Ledbetter
81f5b3e66d FileOperation: Don't preserve ownership when copying files 2023-09-16 11:14:40 +02:00
Tim Ledbetter
f15a896324 FileOperation: Set umask to 0 when creating new files or directories
This ensures that file permissions are correctly preserved.
2023-09-16 11:14:40 +02:00
Tim Ledbetter
1beadba0bb 3DFileViewer: Remove DeprecatedString usage in object loader
This change also improves error handling if the given .obj file
contains malformed floating point numbers.
2023-09-16 11:07:44 +02:00
Tim Ledbetter
4eb52351b4 less: Add -N option to show line numbers
Co-authored-by: Liav A <liavalb@gmail.com>
2023-09-16 11:07:17 +02:00
Tim Ledbetter
499f459f0b HackStudio+LibGUI: Make fallible TabWidget::add_tab() non-fallible 2023-09-16 11:06:50 +02:00
Tim Ledbetter
dc71ac4d2f LibGUI: Remove TabWidget::try_add_tab() 2023-09-16 11:06:50 +02:00
Tim Ledbetter
ffda0785c0 Applications: Make creation of tabs non-fallible 2023-09-16 11:06:50 +02:00
Tim Ledbetter
3c9dee5d5a GameOfLife: Use the same play/pause action in the menu and toolbar
This prevents the menu and toolbar action state getting out of sync,
which could happen previously. The menu item also now shows the
appropriate icon rather than a checkbox.
2023-09-16 11:06:33 +02:00
Tim Ledbetter
ccab5ddf9b LibGUI+Applications: Use String in make_about_action() 2023-09-16 11:05:49 +02:00
Andrew Kaster
bd131c0bf8 LibWeb: Use "Android" as the OS string on Android 2023-09-15 14:18:52 -06:00
Andrew Kaster
0c5a546dca AK: Send dbgln/outln/warnln to the NDK logger on Android
The embedding application is responsible for setting the android log
tag. If it doesn't a default of "Serenity" will be used for any Lagom
code.
2023-09-15 14:18:52 -06:00
Bastiaan van der Plaat
e267f8e68f LibWeb: Add modifier keys to MouseEvent 2023-09-15 22:12:56 +02:00
Bastiaan van der Plaat
836a7b00dd Ladybird+LibWeb: Add MouseEvent screenX and screenY support 2023-09-15 22:12:56 +02:00
Bastiaan van der Plaat
e584189b8f LibWeb: Reorder MouseEvent items to follow spec more 2023-09-15 22:12:56 +02:00
Kemal Zebari
824c54acaf LibWeb/URL: Add strip_trailing_spaces_from_an_opaque_path()
Also remove 2 FIXMEs by including this function.
2023-09-15 11:15:43 -06:00
Kemal Zebari
ce549eb92a LibWeb/URL: Don't have URL::pathname() perform percent decode
Since the spec expects us to use AK::URL::serialize_path() without
doing any percent decoding.
2023-09-15 11:15:43 -06:00
Liav A
50429d3b22 LibC+Kernel: Move GPU-related API methods to a LibC header file
The Kernel/API directory in general shouldn't include userspace code,
but structure definitions that both are shared between the Kernel and
userspace.

All users of the ioctl API obviously use LibC so LibC is the most common
and shared library for the affected programs.
2023-09-15 11:05:25 -06:00
Liav A
8fe74c7d57 LibC+Kernel: Move device-files related methods to a LibC header file
The Kernel/API directory in general shouldn't include userspace code,
but structure definitions that both are shared between the Kernel and
userspace.

LibC is the most appropriate place for these methods as they're already
included in the sys/sysmacros.h file to create a set of convenient
macros for these methods.
2023-09-15 11:05:25 -06:00
Timothy Flynn
139c575cc9 LibUnicode: Update to Unicode version 15.1.0
https://unicode.org/versions/Unicode15.1.0/

This update includes a new set of code point properties, Indic Conjunct
Break. These may have the values Consonant, Linker, or Extend. These are
used in text segmentation to prevent breaking on some extended grapheme
cluster sequences.
2023-09-15 18:30:26 +02:00
Andrew Kaster
ae15b68b79 LibWeb: Call page_did_start_loading from navigate()
This fixes a crash in Browser on Serenity
2023-09-15 18:27:17 +02:00
Aliaksandr Kalenik
6522fa8933 LibWeb: Use DocumentLoadEventDelayer to delay load event in Navigable
Use a delayer object that actually delays load event for child
navigables instead of boolean flag that does nothing.
2023-09-15 18:27:17 +02:00
Aliaksandr Kalenik
b398d6a35c LibWeb: Determine origin while populating navigation params from srcdoc
Address the FIXMEs by implementing the missing parts of the procedure
from the specification.
2023-09-15 18:27:17 +02:00
Aliaksandr Kalenik
7ad2dd2693 LibWeb: Exit navigation process if navigation id has changed
Change of navigation id means that it has been aborted, and we should
return early.
2023-09-15 18:27:17 +02:00
Aliaksandr Kalenik
b7c93cae7f LibWeb: Set document content type in load_document()
Fixes regression in `load_document()` compared to FrameLoader.
2023-09-15 18:27:17 +02:00
Aliaksandr Kalenik
c437f16cc1 LibWeb: Early return navigation process if navigable has been destroyed
If a navigable has been destroyed during a navigation process, we
should early return from it. The introduced checks are not in
the spec because, as explained in
https://github.com/whatwg/html/issues/9690 the spec is not written
with such a level of detail.
2023-09-15 18:27:17 +02:00
Aliaksandr Kalenik
c20123378d LibWeb: Add unloading of child navigables in "apply the history step"
Implements missing step from the spec.
2023-09-15 18:27:17 +02:00
Aliaksandr Kalenik
2445205e9d LibWeb: Align session history step application code with latest spec
Replaces direct "apply the history step" calls with new functions from
the spec:
- "update for navigable creation/destruction"
- "apply the push/replace history step"
- "apply the reload history step"
2023-09-15 18:27:17 +02:00
Aliaksandr Kalenik
d3d2e56a68 LibWeb: Call set_ongoing_navigation() on navigable instead of this
This fixes incorrectly implemented spec when `set_ongoing_navigation()`
is called on `this` (=traversable) instead of `navigable` variable.
2023-09-15 18:27:17 +02:00
Aliaksandr Kalenik
799b465fac LibWeb: Compare urls excluding fragments in Navigable::navigate() 2023-09-15 18:27:17 +02:00
Aliaksandr Kalenik
fbc95440a4 LibWeb: Only return initialized navigables from child_navigables()
Fixes a crash in `get_session_history_entries()` that happens when
it attempts to find entries for a navigable that hasn't been fully
initialized and therefore doesn't have a nested history entry yet.
2023-09-15 18:27:17 +02:00
Aliaksandr Kalenik
15d265da65 LibWeb: Fix "stack-use-after-return" in navigate_to_a_fragmement()
Callback running on the session history queue should capture necessary
pointers by value instead of reference, because navigate_to_a_fragment
stack will have been destroyed by the time it will be executed.
2023-09-15 18:27:17 +02:00
Andreas Kling
23569f8690 LibWeb: Allow fractional font sizes in CSS
Fixes an issue where relative font sizes would "snap" to integer sizes
in an unpleasant-looking way while resizing on some websites.
2023-09-15 18:26:37 +02:00
Ali Mohammad Pur
4d71f4edc4 LibRegex: Don't add the Repeat instruction size to its jump target
This was causing the calculated jump target to become invalid, leading
to possibly invalid optimisations and (more likely) crashes.
Fixes #21047.
2023-09-15 18:07:23 +03:30
Andreas Kling
9220c68408 LibJS: Avoid pointless HashTable copying during GC mark phase
for_each_cell_among_possible_pointers() was taking HashTable by value
instead of by const reference for no reason.

The copying was soaking up ~4% of CPU time while loading https://x.com/
2023-09-15 12:12:54 +02:00
Luke Wilde
56f0b10d14 LibWeb: Fix setTimeout() when there's no active script
Implements https://github.com/whatwg/html/pull/9712
Fixes https://github.com/SerenityOS/serenity/issues/20970
2023-09-15 08:53:21 +02:00
Luke Wilde
9335524f15 LibWeb: Default ScriptFetchOptions parser metadata to NotParserInserted
See: https://html.spec.whatwg.org/multipage/webappapis.html#default-classic-script-fetch-options
2023-09-15 08:53:21 +02:00
Aliaksandr Kalenik
6f8be44c0e LibWeb+WebContent+headless-browser: Support async text tests
Previously, we used `on_load_finish` to determine when the text test
was completed. This method did not allow testing of async functions
because there was no way to indicate that the runner should wait for
the async call to end.

This change introduces a function in the `internals` object that is
intended to be called when the text test execution is completed. The
text test runner will now ignore `on_load_finish` which means a test
will timeout if this new function is never called.

`test(f)` function in `include.js` has been modified to automatically
terminate a test once `load` event is fired on `window`.
new `asyncTest(f)` function has been introduces. `f` receives function
that will terminate a test as a first argument.

Every test is expected to call either `test()` or `asyncTest()` to
complete. If not, it will remain hanging until a timeout occurs.
2023-09-15 08:52:25 +02:00
Tim Ledbetter
c74f7e5f2a Userland: Don't use String::from_utf8() for literal strings 2023-09-15 08:44:52 +02:00
Zaggy1024
4cc3c41269 LibWeb: Allow calculated values for background-size dimensions
This fixes the sizing of the arrow icons displayed to the left of
parent sections on a table of contents on Wikipedia articles, which
are sized using the equation `calc(max(0.75em, 12px))`. Now, the icon
will not expand past the edges of the box they are within, avoiding
clipping the edges of the arrows.
2023-09-15 08:40:10 +02:00
Bastiaan van der Plaat
222cc29c5c LibWeb: Add XMLHttpRequest Document response type 2023-09-14 22:58:42 +02:00
Nicolas Ramz
b8f8b22aa5 LibGfx/ILBM: Add support for uncompressed files 2023-09-14 21:00:54 +01:00
Andreas Kling
80a78c4deb LibWeb: Don't generate ::before/::after for BR elements
We shouldn't be putting generated pseudo elements inside elements that
can't have children in the first place.

This patch fixes two issues:
- We stop generating pseudo elements for layout nodes that can't have
  children anyway.
- We mark Layout::BreakNode as not being able to have children.
2023-09-14 21:46:28 +02:00
Andreas Kling
a7c1af08ca LibJS: Store bytecode instruction length in instruction itself
Instead of running a big switch statement on the opcode when checking
how long an instruction is, we now simply store that in a member
variable at construction time for instant access.

This yields a 10.2% speed-up on Kraken/ai-astar :^)
2023-09-14 16:11:14 +02:00
Shannon Booth
d7c1cc0276 LibWeb: Fix missing 'get an output encoding' step in HTMLFormElement
This could mean that the picked encoding was not being set to UTF-8 if
the documents encoding was 'replacement', 'utf-16le' or 'utf-16be'.
2023-09-14 06:49:57 -04:00
implicitfield
63d09f6daf Browser+Ladybird: Let the list of user agent strings be shared 2023-09-13 19:33:07 -04:00
Bastiaan van der Plaat
d63fb8fa61 Maps: Add show SerenityOS users feature 2023-09-13 21:41:37 +02:00
Bastiaan van der Plaat
dfb54083ee Maps: Add markers to map widget 2023-09-13 21:41:37 +02:00
Bastiaan van der Plaat
599a37aa0c Maps: Add panels to map widget 2023-09-13 21:41:37 +02:00
Bastiaan van der Plaat
048e8d7744 Maps: Add toolbar and frame border to map widget 2023-09-13 21:41:37 +02:00
Bastiaan van der Plaat
b5f91e3365 Maps: Remember last window position and size 2023-09-13 21:41:37 +02:00
Aliaksandr Kalenik
84139a10d2 LibWeb: Implement navigation to javascript: URLs for navigables
Implements following algorithms from the specification:
https://html.spec.whatwg.org/multipage/browsing-the-web.html#navigate-to-a-javascript:-url
https://html.spec.whatwg.org/multipage/browsing-the-web.html#evaluate-a-javascript:-url
2023-09-13 21:35:52 +02:00
Aliaksandr Kalenik
09013583f2 LibWeb: Add Navigable::set_ongoing_navigation() 2023-09-13 21:35:52 +02:00
Aliaksandr Kalenik
aa0d254fa3 LibWeb: Start fleshing out "URL and history update steps" 2023-09-13 21:35:52 +02:00
Sam Atkins
6bf107fc16 LibWeb: Implement the :open and :closed pseudo-classes
These apply to any elements that have some kind of open/closed state.
The spec suggests `<details>`, `<dialog>`, and `<select>`, so that's
what I've supported here. Only `<details>` is fleshed out right now,
but once the others are, these pseudo-classes should work
automatically. :^)
2023-09-13 19:55:22 +02:00
Sam Atkins
29bb0f0ae6 LibWeb: Stub out an "open" state on <select> elements
The CSS Selectors-4 spec suggests that `:open` and `:closed` should
apply to `<select>` elements, so let's add a way of storing and
exposing that state. We don't yet actually generate any layout for
`<select>` elements, so they will always report that they are closed.
2023-09-13 19:55:22 +02:00
Timothy Flynn
b1632c58bf LibWeb: Create a shadow tree for details elements with manual slots
The spec requires that details elements be assigned a shadow tree with
two slots. The first slot is assigned the first summary child element of
the details element. The second slot is assigned all other children.
2023-09-13 13:45:47 +02:00
Timothy Flynn
bdf2323b3f LibWeb: Perform layout of a slot's assigned nodes 2023-09-13 13:45:47 +02:00
Timothy Flynn
e4d3a9aa68 LibWeb: Ensure DOM events on slottables are properly propagated
Most events on a slottable are composed, meaning they propagate from the
slottable and through its shadow tree before bubbling up to the parent
of the slottable.
2023-09-13 13:45:47 +02:00
Timothy Flynn
d67d93f870 LibWeb: Handle reassigning slottables on node insertion and removal 2023-09-13 13:45:47 +02:00
Timothy Flynn
683ce8e615 LibWeb: Implement (most of) the assigned slot/slottable lookup APIs
This implements looking up a slottable's assigned slot, and a slot's
list of assigned slottables. For the latter, only unflattened lookups
are implemented so far.
2023-09-13 13:45:47 +02:00
Timothy Flynn
b602ee7ddd LibWeb: Implement automatic slottable assignment
This implements automatic slottable assignment by way of hooking into
the element attribute change steps. When the `name` attribute of a slot
or the `slot` attribute of a slottable changes, assignment is performed.
2023-09-13 13:45:47 +02:00
Timothy Flynn
e9da74ebe0 LibWeb: Implement manual slottable assignment
This implements manual slottable assignment by way of HTMLSlotElement's
`assign` API. This includes all of the slottable-related AOs needed to
perform the assignment.
2023-09-13 13:45:47 +02:00
Timothy Flynn
7870f10aa8 LibWeb: Introduce the slot concept for HTML slot elements
A slot is an HTMLSlotElement. It may have any number of slottable nodes
assigned to it.
2023-09-13 13:45:47 +02:00
Timothy Flynn
45b36bd08a LibWeb: Introduce the slottable concept for DOM elements and text nodes
A slottable is either a DOM element or a DOM text node. They may be
assigned to slots (HTMLSlotElement) either automatically or manually.
Automatic assignment occurs by matching a slot's `name` attribute to
a slottable's `slot` attribute. Manual assignment occurs by using the
slot's (not yet implemented) `assign` API.

This commit does not perform the above assignments. It just sets up the
slottable concept via IDL and hooks the slottable mixin into the element
and text nodes.
2023-09-13 13:45:47 +02:00
Timothy Flynn
b85a252753 LibWeb: Implement the attribute-change-steps extension
This is similar to the run activation behavior in that elements may
define these steps themselves. HTMLSlotElement is one such element. The
existing (ad-hoc) Element::attribute_changed() method is not sufficient
there as the steps require knowledge of the attribute's old value and
its namespace, which this extension provides.

Unlike the run activation behavior, we store these steps in a list. An
element may end up defining multiple attribute change steps. For example
all DOM elements must define steps to handle the "slot" attribute, and
HTMLSlotElement must define steps to handle the "name" attribute.
2023-09-13 13:45:47 +02:00
Timothy Flynn
54b5a431a3 LibWeb: Implement element slot-related attributes and settings
This implements the element's slot attribute itself, and setting the
slot assignment on the element's shadow root.
2023-09-13 13:45:47 +02:00
Timothy Flynn
4e32f0d39f LibWeb: Remove virtual specifier from Element::set/remove_attribute()
Only HTMLDetailsElement was overriding these methods, which has been
updated to use Element::attribute_changed() instead.
2023-09-13 13:45:47 +02:00
Timothy Flynn
8bb5652835 LibWeb: Implement HTMLDetailsElement's open attribute closer to the spec
The spec now has a "toggle task tracker" to coalesce rapid changes to
this attribute. It also now has an explicit ToggleEvent to encapsulate
the old and new state of the element.

This further handles the attribute being added/removed using a override
of Element::attribute_changed(), rather than being the only element to
instead override Element::set/remove__attribute().
2023-09-13 13:45:47 +02:00
Timothy Flynn
153ae93f9c LibWeb: Implement ToggleEvent for HTMLDetailsElement 2023-09-13 13:45:47 +02:00
Timothy Flynn
f598a357ad LibWeb: Assign a unique ID to each HTML task
And return that ID when queueing an element task. This is required for
some task tracking - specifically, the HTML ToggleTaskTracker struct.
2023-09-13 13:45:47 +02:00
Andrew Kaster
5ae9b2fdaf LibWeb: Add {de}serialization steps for TypedArrayBuffers and DataViews 2023-09-13 08:49:09 +02:00
Andrew Kaster
bddf3fbf2d LibWeb: Make StructuredSerialize/Deserialize friendlier to recursion
Make the internal calls take objects by reference, and take writable
spans into data rather than const& to the underlying vector type.
2023-09-13 08:49:09 +02:00
Sam Atkins
e0fe77d012 LibWeb+headless-browser: Replace ref-test manifest with link tags
Each ref test now links to its reference page with a link tag, in the
same format as WPT:

`<link rel="match" href="reference-page.html" />`

The reference pages have all been moved into a separate `reference/` dir
so that we can just treat every file in `ref/` as a test. There's no
filter to only look at .html files, because we also have a .svg file in
there, and there may be other formats we want to use too. But it's not
too hard to add one if we need it.
2023-09-13 08:48:19 +02:00
Sam Atkins
f3add3dd72 WebContent: Add "load-reference-page" debug request
This attempts to load the URL of the first `<link rel="match" href=""/>`
it finds. If that tag is missing, we load an error page to make sure
the ref-test fails. (And to provide some feedback if someone looks at
the screenshot somehow.) Wrong URLs will instead end up loading the
default 404 error page.
2023-09-13 08:48:19 +02:00
Sam Atkins
7ba686dcb3 LibWeb: Run on_load_start/finish callbacks when loading HTML directly
I need this for the upcoming "load-reference-page" debug request. But it
generally seems like the correct thing to do. :^)
2023-09-13 08:48:19 +02:00
Sam Atkins
cb8c4cd2e6 WebContent: Return once debug_request is handled
The request can only be one string, so once we've matched it, stop
checking all the other possible values. :^)
2023-09-13 08:48:19 +02:00
Tim Ledbetter
9a6927c575 GameOfLife: Ensure BoardWidget can always contain the board
Previously, when there were more rows or columns than the BoardWidget
could contain, nothing was displayed. The BoardWidget minimum size is
now set whenever the number of rows or columns changes.
2023-09-13 07:45:49 +01:00
Tim Ledbetter
871f5ba431 2048: Disable the undo and redo actions when unavailable
This change also ensures that the redo stack is cleared when a move is
made, so that it isn't possible to redo a previous move after having
made a new one.
2023-09-13 07:27:01 +02:00
Shannon Booth
c3e6077cfc LibWeb: Make Document::{visibility,read}_state return a StringView
Also using the visibility state enum to change strcmp to a simple
enum state check :^)
2023-09-13 07:26:35 +02:00
Shannon Booth
49eb3bfb1d LibWeb: Make Document::run_the_document_write_steps take a StringView
Which flows on down into HTMLTokenizer::insert_input_at_insertion_point.
2023-09-13 07:26:35 +02:00
Shannon Booth
827170f6e6 LibWeb: Take a StringView in Document::get_elements_by_class_name
We only ever use the view of the DeprecatedFlyString anyway, so let's
just use a StringView.
2023-09-13 07:26:35 +02:00
Shannon Booth
ec39a5a41a LibWeb: Const qualify Document::number_of_things_delaying_the_load_event 2023-09-13 07:26:35 +02:00
Shannon Booth
e42bda5f19 LibWeb: Make Document::open functions take a StringView
One of these functions doesn't make any use of the arguments at all, and
the other defers to an open helper which already takes a StringView.
2023-09-13 07:26:35 +02:00
Shannon Booth
8ad05fff4a LibWeb: Make Document::set_cookie take a StringView
Enabled by also making the same change to ParsedCookie::parse_cookie :^)
2023-09-13 07:26:35 +02:00
Andrew Kaster
642802d339 LibWeb: Add {de}serialization steps for ArrayBuffers 2023-09-12 22:14:39 +02:00
Andrew Kaster
a527f55768 LibWeb: Create StructuredSerialize helpers for Bytes
Call them from the helpers for strings. We'll have other object classes
soon that need to serialize ByteBuffers, so let's take advantage of the
encoding scheme we are already using for Strings.
2023-09-12 22:14:39 +02:00
Andrew Kaster
56d0a0ac0f LibJS: Make CreateDataByteBlock AO publicly available
At the same time, make CopyDataBlockBytes const-correct.
2023-09-12 22:14:39 +02:00
Andrew Kaster
267074cd81 LibWeb: Add {de}serialization steps for RegExpObjects
We skip serializing any of the internal state of the Regex<ECMA262>
object, because that state is all computable from the input pattern
and flags. If it turns out that this is really, really slow, we can add
some optimizations to serialize more of the regex parse result.
2023-09-12 22:14:39 +02:00
Andrew Kaster
3a74bd2509 LibWeb: Don't try to deserialize past length of strings
If we serialize a string followed by some other object, the deserialize
helper would just happily keep appending bytes to the string until the
end of the serialization buffer. Avoid doing that by checking the string
length for figuring out when the string actually ends.
2023-09-12 22:14:39 +02:00
Aliaksandr Kalenik
63939445b1 LibWeb: Use fit-content width if button's computed width is "auto"
Implements following line from the spec:
"If the computed value of 'inline-size' is 'auto', then the used value
is the fit-content inline size."
2023-09-12 17:26:30 +02:00
Aliaksandr Kalenik
7eee3f6952 LibWeb: Add mutable_computed_values() for NodeWithStyle
This fixes the issue that we previously had to use a gross static_cast
whenever we wanted to mutate computed values outside of the Node
methods.
2023-09-12 17:26:30 +02:00
Andreas Kling
44b2735b9e LibJS: Make line-and-column resolution fast for large minified JS
Instead of caching start-of-line offsets, we now cache byte offsets
at regular intervals. This fixes an issue where we had terrible
performance on large minified JS, since that often means one very,
VERY long line (with no line endings to cache).

My machine was spending ~35ms per stack frame when throwing errors
on some heavy minified websites, and after this patch, we now spend
<1ms per stack frame.
2023-09-12 17:21:42 +02:00