Commit Graph

14034 Commits

Author SHA1 Message Date
u9g
0d50ac1657 Spreadsheet: Remove Debug Statement 2022-02-20 20:05:31 +00:00
Andrew Kaster
b92df530d3 LibAudio: Simplify empty Audio::Buffer state to be truly empty
The old FIXME asserting that Core::AnonymousBuffer cannot be invalid
or zero-sized is no longer accurate. Add a default constructor for
Audio::Buffer that has all invalid state instead of going to the OS to
allocate a 1 sample buffer for the "no more samples" states in the WAV
and FLAC plugins.
2022-02-20 19:04:59 +00:00
Linus Groh
bfa4bc6f2d LibJS: Remove unused FunctionNode::set_name() 2022-02-20 15:40:41 +00:00
Linus Groh
93372e0a0d LibJS: Remove unused BoundFunction.h include from FunctionObject.cpp 2022-02-20 15:40:40 +00:00
Liav A
6a998c1a8b HexEditor: Add support for handling PageUp and PageDown key events
In such case, move the cursor up or down the amount of bytes per row,
multiplied by the visible content rectangle height, if possible.
2022-02-20 15:44:36 +01:00
Liav A
c8e691f917 HexEditor: Reduce code duplication when handling key down events
Instead of having the same update block for each event we can use lambda
functions to help updating the cursor when handling key down events.
2022-02-20 15:44:36 +01:00
Karol Kosek
410254dbe2 Spreadsheet: Use the system-wide unsaved changes dialog 2022-02-20 08:40:26 -05:00
Karol Kosek
42d19977b3 HexEditor: Use the system-wide unsaved changes dialog 2022-02-20 08:40:26 -05:00
Karol Kosek
cb332bdd2a Playground: Show last saved time when asked about unsaved changes 2022-02-20 08:40:26 -05:00
Ali Mohammad Pur
97a333608e LibRegex: Make codegen+optimisation for alternatives much faster
Just a little thinking outside the box, and we can now parse and
optimise a million copies of "a|" chained together in just a second :^)
2022-02-20 11:53:59 +01:00
Ali Mohammad Pur
4be7239626 LibRegex: Make parse_disjunction() consume all disjunctions in one frame
This helps us not blow up when too many disjunctions are chained togther
in the regex we're parsing.
Fixes #12615.
2022-02-20 11:53:59 +01:00
Ali Mohammad Pur
627bbee055 LibRegex: Allow quantifiers after quantifiable assertions
While quantifying assertions is very much meaningless, the specification
allows them with annex B's extended grammar for browsers, so read and
apply the quantifiers.
Fixes #12373.
2022-02-20 11:53:59 +01:00
Karol Kosek
6a1ae4c185 LibWeb: Make i, em, address, cite, dfn and var elements italic
Although it is not said that some of the elements need to be italic,
*most* browsers mark them as such to distinguish them from the normal
text, so let's do that too!
2022-02-20 11:50:38 +01:00
Karol Kosek
4e50f8a8b7 LibWeb+Base: Parse font-style CSS property 2022-02-20 11:50:38 +01:00
Luke Wilde
9845164f6a LibWeb: Handle markers when reconstructing active formatting elements
The entry we get from the active formatting elements list during the
Rewind step of "reconstruct the active formatting elements" can be a
marker. Previously we assumed it was not a marker, which can trigger
an assertion failure with certain malformed HTML.

If the entry in this step is a marker, the spec simply ignores it.
This is step 6 of the algorithm.

This also makes the index unsigned, as this algorithm is a no-op if
the list is empty.

Additionally, this also adds spec comments to this algorithm.

Fixes #12668.
2022-02-20 10:59:42 +01:00
Kenneth Myhra
655f054b4f LibWeb: Add default padding around contents of text <input> elements
This patch adds a default padding around the contents of text <input>
elements. It adds these defaults to the existing style attribute in
'HTMLInputElement::create_shadow_tree_if_needed()'.

Use a default padding for text <input> elements:
- padding-top and padding-bottom: 1px
- padding-left and padding-right: 2px

These values seems to align with what other browsers do.
2022-02-20 10:57:30 +01:00
Kenneth Myhra
fde9c1bfb2 LibWeb: Add key code 'Esc' to ignored Keydown Events in EventHandler
This filters out the key code 'Esc' so it won't be printed to editable
text nodes, e.g. text <input> elements.
2022-02-20 10:57:30 +01:00
Kenneth Myhra
8a168b2bc0 LibWeb: Add support for navigating text <input> with End key 2022-02-20 10:57:30 +01:00
Kenneth Myhra
939c10b201 LibWeb: Add support for navigating text <input> with Home key 2022-02-20 10:57:30 +01:00
Karol Kosek
f18ae27fe9 HexEditor: Display dirty close icon when the file is changed 2022-02-20 00:06:14 -05:00
Anton Kling
1ad7aa7136 ls: Add option -1 which lists one file per line 2022-02-19 18:18:13 -08:00
Luke Wilde
3479f1c4e8 LibWeb: Add support for the options variant of {add,remove}EventListener
This also adds a variant of {add,remove}_event_listener called
{add,remove}_event_listener_with_options.

This is used internally to perform {add,remove}_event_listener with a
default constructed options struct. It was done like this because
default constructing the Variant with the options struct requires the
struct defintions to be present, which requires us to include
AbortSignal.h, which would cause a circular include as AbortSignal.h
includes EventTarget.h.
2022-02-20 02:03:24 +01:00
Idan Horowitz
60bc5e3b5b LibJS: Trim all types of whitespace characters before parsing numbers 2022-02-19 22:16:30 +00:00
Idan Horowitz
232e830a0a LibJS: Mark %{Async,}IteratorPrototype%[@@iterator] as Configurable
We were accidentally marking it as Enumerable instead.
2022-02-19 22:16:30 +00:00
Peter Ross
5b32b46ebc LibC: Do not write value when scanf assignment value is suppressed
This change has the positive side-effect of causing scanf to *segfault*
when a NULL pointer argument is passed to scanf.
e.g. sscanf(str, "%d", NULL);
2022-02-20 00:13:08 +03:30
Peter Ross
31079a56d7 LibC: Do not include suppressed assignments in scanf return value 2022-02-20 00:13:08 +03:30
Michiel Visser
7dcfb82e16 LibGfx: Fix JPG decoding bug on rare grayscale images
Some grayscale JPG images might have the horizontal and vertical sample
factor set to 2. However, the macroblocks in these images are not
interleaved as they would be in color images.
2022-02-19 21:27:34 +01:00
Luke Wilde
10581cfaeb LibWeb: Use DOMParserSupportedType enum for DOMParser.parseFromString
Previously it would accept any DOMString, as we didn't support enums at
the time. Now it will only accept what's specified in the
DOMParserSupportedType enum.

This also adds spec comments to DOMParser::parse_from_string.
2022-02-19 21:27:08 +01:00
Zack Penn
a65e1fa828 killall: Port to LibMain and LibCore 2022-02-19 19:44:29 +01:00
Zack Penn
681b643093 paste: Port to LibMain and LibCore 2022-02-19 19:44:29 +01:00
Sam Atkins
7880718fa8 LibWeb: Implement @supports selector(.foo)
This is defined in
https://www.w3.org/TR/css-conditional-4/#at-supports-ext which just
became a CR. :^)
2022-02-19 19:33:54 +01:00
Idan Horowitz
29dd9d75ef LibJS: Do not create a prototype property on AsyncFunction instances 2022-02-19 18:06:39 +00:00
Idan Horowitz
08d1ae58b1 LibJS: Initialize {Async,}{Generator,}Function constructors properly
We were previously manually initializing them instead of just calling
GlobalObject::initialize_constructor, which aside from duplicating code
also meant we didn't set the required name property.
2022-02-19 18:06:39 +00:00
Idan Horowitz
de238ff351 LibJS: Use FunctionConstructor as the proto of AsyncFunctionConstructor
We were accidentally using FunctionPrototype instead.
2022-02-19 18:06:39 +00:00
Andreas Kling
a4bc7e2d96 LibWeb: Hack BFC to always remember to handle position:absolute elements
Normally we don't layout position:absolute elements until after the
parent formatting context has assigned dimensions to the current
formatting context's root box.

However, some of our parent contexts (especially FFC) don't do this
reliably, which makes position:absolute children have 0x0 dimensions.

Hack this for now by making ~BFC() pretend that the parent assigned
dimensions if it hadn't done it already.
2022-02-19 16:42:02 +01:00
Andreas Kling
c8051f8b5b LibWeb: Add Layout::Node::debug_description()
This returns a String with this format:

- LayoutNodeClassName<TAG_NAME>#id.class1.class2.class3

I've rewritten this function 10+ times at this point, so I'm just gonna
add it to the repository for future debugging needs. :^)
2022-02-19 16:39:32 +01:00
Andreas Kling
cf5eeb9f4b LibWeb: Share QualifiedName data between identical instances
Adopt the same pattern as AK::FlyString, reducing sizeof(QualifiedName)
to the size of a pointer.

This reduces the size of DOM::Element by 24 bytes.
2022-02-19 14:45:59 +01:00
Andreas Kling
25504f6a1b LibWeb: Use Vector::clear_with_capacity() in HTMLTokenizer
This avoids constantly reallocating the Vector<HTMLToken>.
2022-02-19 14:45:59 +01:00
Andreas Kling
1b6ed558bb LibWeb: Move QualifiedName into the Web::DOM namespace 2022-02-19 14:45:59 +01:00
Andreas Kling
cdd1a9f128 LibWeb: Move QualifiedName.h into LibWeb/DOM/ 2022-02-19 14:45:59 +01:00
Andreas Kling
a97586c24a LibWeb: Shrink DOM::EventTarget by 80 bytes
Do this by converting two Function members into virtual functions:
- legacy_pre_activation_behavior
- legacy_cancelled_activation_behavior
2022-02-19 14:45:59 +01:00
Andreas Kling
bfe69e9d0d LibWeb: Cache and reuse some very common StyleValue objects
Length values: auto, 0px, 1px
Color values: black, white, transparent
2022-02-19 14:45:59 +01:00
Andreas Kling
141b01d3e3 LibWeb: Turn StyleProperties::m_property_values into an Array
After style computation, every StyleProperties has a value for every
PropertyID. Given this, it's simpler, faster and less memory-heavy to
use an Array instead of a HashMap. :^)
2022-02-19 14:45:59 +01:00
Vrins
12d75b10f3 LibWeb: Inspector content_size tooltip in document view
This adds a small tooltip in the browser showing the size of the
element that currently selected in the inspector view. This allows
for easier debugging since you dont have to dump the layout tree :^).
2022-02-19 11:39:41 +01:00
Maciej
3e1c1c0b16 LibWeb: Add support for CSS image-rendering property
Currently only "auto" and "pixelated" values are supported.
2022-02-19 11:38:46 +01:00
Itamar
246b42b635 LibGUI: Guard against use-after-free in Clipboard::the()
We now make sure that a VERIFY will fail if Clipboard::the() is called
after the destruction of its static-local variables.
2022-02-19 11:38:29 +01:00
Itamar
4d2357f8f3 HackStudio: Don't store a global RefPtr to the HackStudioWidget
Previously, we stored a RefPtr to the HackStudioWidget in the
global scope.

This led to a destruction-order related use-after-free bug, where the
global HackStudioWidget instance destructed after the static-local
GUI::Clipboard instance.
When HackStudioWidget destructs it attempts to use the global Clipboard
instance, which had already been freed.

This caused the Hack Studio process to spin endlessly on exit because
it attempted to access the HashTable of the freed Clipboard object.

We now store a global WeakPtr to the HackStudioWidget instead, and
limit the lifetime of the object to the main function scope.
2022-02-19 11:38:29 +01:00
Jakub Berkop
895a050e04 Kernel: Fixed argument passing for profiling_enable syscall
Arguments larger than 32bit need to be passed as a pointer on a 32bit
architectures. sys$profiling_enable has u64 event_mask argument,
which means that it needs to be passed as an pointer. Previously upper
32bits were filled by garbage.
2022-02-19 11:37:02 +01:00
Simon Danner
0787571192 Filemanager: Only enable rename if available 2022-02-19 11:35:53 +01:00
kperdlich
ad722a9f06 Shell: Use an opaque default color for BarewordLiteral
Use an opaque default color for BarewordLiteral in
Syntax Highlighter to avoid transparent barewords.
2022-02-19 11:33:28 +01:00