Commit graph

15567 commits

Author SHA1 Message Date
Olivier De Cannière 1b7850f511 LibGUI: Add TabWidget::activate_last_tab() 2022-04-02 23:38:32 +02:00
MacDue 04b6a060ca DisplaySettings: Add theme selection and preview 2022-04-02 21:50:41 +02:00
Ben Maxwell 8fa0409ae1 LibGfx: Add list_installed_system_themes() to SystemTheme 2022-04-02 21:50:41 +02:00
Ben Maxwell 3fbefb82ac LibGUI+Applications: Move abstract ThemeEditor preview to LibGUI
This allows most of the theme preview code to be reused by similar
theme preview widgets.
2022-04-02 21:50:41 +02:00
Thomas Symalla 77add584fa Userland: Fix crash when inputting non-tty device into ps
This PR aims to fix #13299 by avoiding assertion failure
while trying to determine the pseudo tty when inputting
any non-tty device device into ps.
2022-04-02 21:49:16 +02:00
Adam Patterson 2ecc608dea 3DFileViewer: Allow escape key to exit fullscreen mode
I went into fullscreen mode, via the View menu, before looking at the
associated key (F11). I had to kill Qemu to be able to escape.

Escape is an intuitive way to exit most fullscreen modes.
2022-04-02 11:07:29 -07:00
Enver Balalic 747f347b75 LibWeb: Implement flex reverse layouts
This builds on the work done by implementing the flex order CSS
property and implements flex reverse layouts by just reversing
the order and the items within each order bucket.
2022-04-02 19:01:14 +02:00
GeekFiftyFive 737f5b26b7 AK+LibHTTP: Ensure plus signs are percent encoded in query string
Adds a new optional parameter 'reserved_chars' to
AK::URL::percent_encode. This new optional parameter allows the caller
to specify custom characters to be percent encoded. This is then used
to percent encode plus signs by HttpRequest::to_raw_request.
2022-04-02 18:43:15 +02:00
Enver Balalic 58398b1e12 LibWeb: Implement the flex order CSS property
Adds support for the flex order property and a test page for it
on the browser welcome page.
2022-04-02 18:40:32 +02:00
Hendiadyoin1 2377344a89 UserspaceEmulator: Implement the SSE extension
This almost fully implements the SSE extension, similar to the x87 and
MMX extensions, using a separate class "SoftVPU".

Currently missing are all shadow and exception checks, as well as the
denormals-are-zero and flush-to-zero flags.
Also missing are some integer-SIMD functions.
2022-04-02 18:37:38 +02:00
Hendiadyoin1 1d2ad9cf61 UserspaceEmulator: Don't mark SoftFPU::mmx_get/set as ALWAYS_INLINE
These are exposed by SoftCPU, and this attribute would cause these not
to create any symbols to link against.
2022-04-02 18:37:38 +02:00
Hendiadyoin1 b7a8cfdde9 LibX86: Correctly name CVTTSS2SI_r32_xmm2m32
This was previously erroneously called CVTTPS2PI_r32_xmm2m32, while
the mnemonic was correctly CVTTSS2SI.
2022-04-02 18:37:38 +02:00
Hendiadyoin1 1432b6ab0a LibX86: Use the correct code for UNPCKLS
We were accidentally using 0x15, which was immediately overridden by
UNPCKHS
2022-04-02 18:37:38 +02:00
Hendiadyoin1 3cae69a6c2 LibX86: Correctly name the first xmm argument
We were accidentally calling it a mm-register
2022-04-02 18:37:38 +02:00
Hendiadyoin1 f951849fd5 LibX86: Don't print repz prefix for SSE instructions 2022-04-02 18:37:38 +02:00
Hendiadyoin1 d03a6cc6c6 LibGfx: Use AK's rsqrt and cast to floats earlier 2022-04-02 18:37:38 +02:00
Sam Atkins b07659d00c Meta+LibWeb: Port PropertyID.h/cpp generators to invoke_generator() 2022-04-02 09:18:07 -04:00
Sam Atkins fc81d6c9f3 Meta+LibWeb: Port ValueID.h/cpp generators to invoke_generator() 2022-04-02 09:18:07 -04:00
Sam Atkins cb406e79f4 Meta+LibWeb: Port MediaFeatureID.h/cpp generators to invoke_generator() 2022-04-02 09:18:07 -04:00
Idan Horowitz 59080f441e LibJS: Normalize NaN values in Sets and Maps
This ensures that different NaN types (e.g. 0/0, 0 * Infinity, etc) are
mapped to the same Set/Map entry.
2022-04-02 14:15:43 +01:00
Idan Horowitz 6f7cab91a7 LibWeb: Use the specification defined types in IntersectionObserverInit 2022-04-02 13:13:37 +03:00
Idan Horowitz 61fc3c31c6 LibWeb: Add the ResizeObserverBoxOptions IDL enum 2022-04-02 13:13:37 +03:00
Idan Horowitz f744c31a6f LibWeb: Use OnErrorEventHandler in WorkerGlobalScope IDL 2022-04-02 12:22:48 +04:30
Idan Horowitz d25bd2dbd8 LibWeb: Add the GlobalEventHandlers IDL mixin 2022-04-02 12:22:48 +04:30
James Mintram 14dbd28033 3DViewer: Add support for dropping files 2022-04-01 21:32:27 -07:00
Stephan Unverwerth 086fcd4e44 3DFileViewer: Do not abort model loading when texture is missing 2022-04-01 23:19:06 +02:00
Idan Horowitz 086969277e Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
Jelle Raaijmakers 7334636933 LibGfx: Return kerning values as a float instead of int
This allows for a more precise rounding of glyph positions.
2022-04-01 12:58:03 +02:00
Jelle Raaijmakers ee9a2e0715 LibGfx: Implement font kerning for Painter::draw_text_run 2022-04-01 12:58:03 +02:00
Enver Balalic 7be57c322e LibWeb: Flex fix minimum main size in min/max violations calculation
While calculating the minimum size for main min/max size violations
we were flooring the min size to 0 if the item doesn't have a min
main size. Instead of that determine the intrinsic min main size
of that element.

This fixes the flex: 80% 0 4/1/0 test case in the flex.html
test page.

This case was missed in a previous commit that added the
determine_min_main_size_of_child function
2022-03-31 21:09:41 +02:00
Itamar 9cd27d1e15 LanguageServers/Cpp: Add SemanticType::PreprocessorMacro
This adds a new semantic token type, PreprocessorMacro.

Calls to preprocessor macros will now be highlighted when semantic
highlighting is enabled in Hack Studio.
2022-03-31 19:10:15 +02:00
Itamar 597ca68e2d LibCpp: Fix parsing of macro calls
Previously, macro calls with 0 arguments where incorrectly parsed as
calls to a macro with a single argument that doesn't contain any tokens.
2022-03-31 19:10:15 +02:00
Itamar 53c6c36fba LibGUI: Add AutocompleteProvider::TokenInfo::type_to_string() 2022-03-31 19:10:15 +02:00
Andreas Kling 3ab7388754 PixelPaint: Draw layer thumbnails with bilinear filtering
This makes them look a little nicer than basic nearest-neighbor.
2022-03-31 18:25:06 +02:00
Andreas Kling 7047a5ca59 LibJS: Allow JS::make_handle(T*) to be called with nullptr
Instead of asserting, just return an empty Handle.
2022-03-31 18:25:06 +02:00
Ali Mohammad Pur 7ea095feb0 LibJS: Don't assume that for-in/of target is a variable on LHS::Assign
e.g. `for ([foo.bar] in ...)` is actually a binding pattern.
2022-03-31 18:11:08 +02:00
Ali Mohammad Pur 56c0fdc1c4 LibJS: Implement codegen for MemberExpression binding patterns 2022-03-31 18:11:08 +02:00
Ali Mohammad Pur 007ffcd763 LibJS: Implement bytecode generation for all ObjectExpression properties 2022-03-31 18:11:08 +02:00
Matthew Olsson 698fb3957a LibPDF: Fix security-handler-related nullptr regression 2022-03-31 18:10:45 +02:00
Matthew Olsson b69488031b LibPDF: Fix mismatched class/struct declaration 2022-03-31 18:10:45 +02:00
Matthew Olsson 6bed20f456 PDFViewer: Use ArgsParser 2022-03-31 18:10:45 +02:00
Matthew Olsson 468ceb1b48 LibPDF: Rename Command to Operator
This is the correct name, according to the spec
2022-03-31 18:10:45 +02:00
Matthew Olsson 49cb040c27 LibPDF: Fix some base-encoding-related crashes 2022-03-31 18:10:45 +02:00
Matthew Olsson 4d0f74a15c LibPDF: Add Type0 and TrueType fonts 2022-03-31 18:10:45 +02:00
Matthew Olsson e831c374f4 LibPDF: Abstract Type1 font data
TTF font types will use the same data
2022-03-31 18:10:45 +02:00
Matthew Olsson 058cf5f7f7 LibPDF: Accept font size in PDFFont::get_char_width
This will be required for TTF fonts
2022-03-31 18:10:45 +02:00
Matthew Olsson 5f9d35909d LibPDF: Move font files into their own directory 2022-03-31 18:10:45 +02:00
Matthew Olsson d2771eafc5 LibPDF: Use Font /Widths array to derive character widths
This makes the spacing between chars _much_ better!
2022-03-31 18:10:45 +02:00
Matthew Olsson 130846f337 LibPDF: Use AntiAliasingPainter in Renderer when possible 2022-03-31 18:10:45 +02:00
Matthew Olsson 8224ca6150 LibPDF: Fix more bad Renderer text positioning calculations 2022-03-31 18:10:45 +02:00
Matthew Olsson 34efc668d2 LibPDF: Handle SCN and scn operators 2022-03-31 18:10:45 +02:00
Matthew Olsson e1115cfe48 LibPDF: Add basic ICCBased color space handling 2022-03-31 18:10:45 +02:00
Matthew Olsson 1238e65d30 LibPDF: Move color space creation from Renderer to ColorSpace 2022-03-31 18:10:45 +02:00
Linus Groh 8e175b4959 LibJS: Adjust ISO8601 representation for years between 1 BCE and 999 CE
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/39eeecd
2022-03-31 17:09:10 +01:00
Linus Groh cfb04765fa LibJS: Correct PlainYearMonth arithmetic for non-ISO calendars
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/61e8dd0
2022-03-31 17:09:10 +01:00
Linus Groh b020b8eea2 LibJS: Handle Etc/GMT timezones properly in TimeZone{IANA,Bracketed}Name
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/8c73780
2022-03-31 17:09:10 +01:00
Linus Groh b5392f9e39 LibJS: Emit reference information for { calendarName: "always" } option
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/4f7519a
2022-03-31 17:09:10 +01:00
Linus Groh 29aa938fa5 LibJS: Fix Duration.compare() for dates with unusual number of hours
This is a normative change in the Temporal spec.

See:
- https://github.com/tc39/proposal-temporal/commit/08bcd53
- https://github.com/tc39/proposal-temporal/commit/e962797
2022-03-31 17:09:10 +01:00
Linus Groh 04e40b7aaa Browser+WebContent: Add a Debug menu action to disable scripting :^) 2022-03-31 17:08:38 +02:00
Linus Groh 780e5441b4 WebContent: Add plumbing for 'is scripting enabled' setting 2022-03-31 17:08:38 +02:00
Linus Groh 7bdbac7fd9 LibWeb: Add 'is scripting enabled' concept to EnvironmentSettingsObject
This is now the source of truth for 'user enabled/disabled scripting',
but it has to ask the window's page, which actually stores the setting.

Also use this new functionality in two places where it was previously
marked as a FIXME.
2022-03-31 17:08:38 +02:00
Linus Groh f60a2a1d80 LibWeb: Remove Document::is_scripting_enabled() and use Node's
There's no need to have a custom is_scripting_enabled() for the
Document class, as it (indirectly) inherits from Node.
Also, let's not hardcode false here :^)
2022-03-31 17:08:38 +02:00
Hendiadyoin1 c79e4961f6 LibJS: Add explicit default copy+move constructors to ThrowCompletionOr
This stops clangd from complaining about not being able to determine the
copy-constructibility of ThrowCompletionOr and Completion.
2022-03-31 09:25:17 -04:00
Brian Gianforcaro 7d667b9f69 LibELF: Remove unused m_program_interpreter member from DynamicLoader
While profiling I realized that this member is unused, so the
StringBuilder and String allocation are completely un-necessary.
2022-03-31 10:18:07 +02:00
Brian Gianforcaro 39f924a731 LibELF: Skip DynamicObject::dump() if logging isn't enabled
I noticed that we were populating this StringBuilder and then throwing
away the result while profiling `true` with UserSpace emulator.

Before:

    courage:~ $ time -n 1000 true
    Timing report: 3454 ms
    ==============
    Command:         true
    Average time:    3.45 ms (median: 3, stddev: 3.42, min: 0, max:11)
    Excluding first: 3.45 ms (median: 3, stddev: 3.42, min: 0, max:11)

After:

    courage:~ $ time -n 1000 true
    Timing report: 3308 ms
    ==============
    Command:         true
    Average time:    3.30 ms (median: 3, stddev: 3.28, min: 0, max:12)
    Excluding first: 3.30 ms (median: 3, stddev: 3.29, min: 0, max:12)
2022-03-31 10:18:07 +02:00
Idan Horowitz 1577bac6a5 LibWeb: Add the HTMLOrSVGElement IDL interface mixin 2022-03-31 01:10:47 +02:00
Idan Horowitz 46fa18657c LibWeb: Use a callback function in ResizeObserver IDL 2022-03-31 01:10:47 +02:00
Idan Horowitz b267c4178a LibWeb: Use a callback function in IntersectionObserver IDL 2022-03-31 01:10:47 +02:00
Idan Horowitz f45d361f03 LibWeb: Replace ad-hoc EventHandler type with callback function typedef 2022-03-31 01:10:47 +02:00
Arif Orhun Uzun eb34015748 SpaceAnalyzer: Fix the crash caused by using arrow keys
Previously, SpaceAnalyzer set focus on the selected BreadcrumbButton.
Using arrow keys triggered the keydown_event of the AbstractButton,
which later on caused a Function object to be deleted while it is still
being used.

This change sets the focus on TreeMapWidget and adds an event handler
to TreeMapWidget for keydown events.

Fixes #13254.
2022-03-30 23:04:15 +02:00
sin-ack 51df97e799 LibWeb: Consolidate mouse handling + only trigger event on left click
This commit moves a couple more special cases in mouse event handling to
handle_mouseup. Additionally, it gets rid of the special casing with
should_dispatch_event and only fires a click event to the EventTarget
when the left mouse button is clicked. Finally it restores the link
context menu callback that was lost during 0fc8c65.
2022-03-30 21:17:04 +02:00
Enver Balalic 8b4d09932a LibWeb: Fix sizing of flex child that has flex-basis 0
Before if an element didn't have a main min size we would clamp
it to a literal zero. If that element also had a flex-basis 0
it's width would end up being 0.
This patch adds a determine_min_main_size_of_child function that
will calculate the minimum main size for the box based on the
content of the box.
We use the result of that function now instead of clamping
the element main min size to 0.

This also adds one more box to the flex.html test page, which is
the same flex: 0 0 0 box but with flex-direction: column.
2022-03-30 21:16:47 +02:00
Enver Balalic 74d8e201eb LibWeb: Fix calculating the intrinsic height of a box
For computing height in FormattingContext::calculate_intrinsic_sizes
we were calling into BlockFormattingContext::compute_theoretical_height
which will check if the CSS height property was defined and calculate
the height based on that instead of calculating the intrinsic height

This patch adds a new function calculate_intrinsic_height, which will
call into compute_auto_height_for_block_level_element for a block
element, or into compute_height_for_replaced_element for a replaced
element.
2022-03-30 21:16:47 +02:00
stelar7 b526a10d76 LibWeb: Add Crypto.randomUUID() 2022-03-30 18:47:53 +02:00
Sam Atkins 9a60b697aa LibWeb: Remove redundant [[nodiscard]] from CSS Parser methods
Optional and smart-pointers are already `[[nodiscard]]` so functions
returning them do not need to be declared as such.
2022-03-30 18:43:07 +02:00
Sam Atkins cd199d9d06 LibWeb: Implement and use parse_a_style_blocks_contents() 2022-03-30 18:43:07 +02:00
Sam Atkins 6a0adbefc7 LibWeb: Tidy up StyleRule API
Constantly accessing private `m_foo` fields feels uncomfortable and
doesn't fit well with our code style.
2022-03-30 18:43:07 +02:00
Sam Atkins 75db8b1f86 LibWeb: Spec-comment consume_a_function() 2022-03-30 18:43:07 +02:00
Sam Atkins 512d1df1c4 LibWeb: Spec-comment consume_a_simple_block() 2022-03-30 18:43:07 +02:00
Sam Atkins 5a23965e93 LibWeb: Comment discrepancy from spec in consume_a_declaration()
We're calling this in a way that is incorrect, and so the algorithm's
assumption that the next token is an `<ident-token>` is wrong, and we
have to handle that failing. Ideally we would just stop calling this
incorrectly, but until then, let's actually document what is happening.
2022-03-30 18:43:07 +02:00
Sam Atkins 999cc51512 LibWeb: Spec-comment consume_a_component_value() 2022-03-30 18:43:07 +02:00
Sam Atkins be86d19529 LIbWeb: Spec-comment consume_a_list_of_declarations() 2022-03-30 18:43:07 +02:00
Sam Atkins e72f42bea1 LibWeb: Spec-comment consume_a_qualified_rule() 2022-03-30 18:43:07 +02:00
Sam Atkins fe86718035 LibWeb: Spec-comment consume_an_at_rule() 2022-03-30 18:43:07 +02:00
Sam Atkins d77de5ccec LibWeb: Spec-comment consume_a_list_of_rules() 2022-03-30 18:43:07 +02:00
Sam Atkins a4f8056828 LibWeb: Spec-comment parse_a_comma_separated_list_of_component_values
The code had to change a bit to match. Previously, we appended an empty
sub-list immediately, but now we append it at the end. The difference
is that if there are no tokens, we now correctly return an empty
list-of-lists, instead of a list containing an empty list.
2022-03-30 18:43:07 +02:00
Sam Atkins 6ec92f5527 LibWeb: Spec-comment parse_a_list_of_component_values() 2022-03-30 18:43:07 +02:00
Sam Atkins 34b3c09462 LibWeb: Spec-comment parse_a_component_value() 2022-03-30 18:43:07 +02:00
Sam Atkins bcf4254331 LibWeb: Spec-comment parse_a_list_of_declarations()
The `parse_as_list_of_declarations()` public method is unused and will
not be used by any user code so has been removed.
2022-03-30 18:43:07 +02:00
Sam Atkins 2aac9f9258 LibWeb: Bring parse_a_declaration() to spec and add comments
User code now calls `parse_as_supports_condition()` which actually does
the conversion to a StyleProperty.
2022-03-30 18:43:07 +02:00
Sam Atkins 239c36a19e LibWeb: Spec-comment parse_a_rule()
We now correctly call convert_to_rule() outside of this function.

As before, I've renamed `parse_as_rule()` -> `parse_as_css_rule()` to
match the free function that calls it.
2022-03-30 18:43:07 +02:00
Sam Atkins 12a787ef8a LibWeb: Use parse_a_list_of_rules() for @media and @supports
From the spec:
> "Parse a list of rules" is intended for the content of at-rules such
> as @media. It differs from "Parse a stylesheet" in the handling of
> <CDO-token> and <CDC-token>.
- https://www.w3.org/TR/css-syntax-3/#ref-for-parse-a-list-of-rules
2022-03-30 18:43:07 +02:00
Sam Atkins 7a225a380c LibWeb: Bring parse_a_list_of_rules() to spec
This is not actually used by anything currently, but it should be used
for `@media` and other at-rules.

Removed the public parse_as_list_of_rules() because public functions
should be things that outside classes actually need to use.
2022-03-30 18:43:07 +02:00
Sam Atkins 85d8c652e9 LibWeb: Implement and use "parse a CSS stylesheet" algorithm
`parse_a_stylesheet()` should not do any conversion on its rules. This
change corrects that. There are other places where we get this wrong,
but one thing at a time. :^)
2022-03-30 18:43:07 +02:00
Sam Atkins fc3d51c59e LibWeb: Use an enum class for the "top-level flag" 2022-03-30 18:43:07 +02:00
Sam Atkins 87b125dcb9 LibWeb: Spec-comment parse_a_stylesheet()
Also introduce a `location` parameter when parsing a CSSStyleSheet. This
is not provided by anyone yet.
2022-03-30 18:43:07 +02:00
Sam Atkins 05bd0ca3ee LibWeb: Rename parse_css() -> parse_css_stylesheet() 2022-03-30 18:43:07 +02:00
Elisée Maurer 34db0dab41 LibWeb: Implement Element.toggleAttribute() 2022-03-30 18:30:29 +02:00
Itamar 1ec3847acd HackStudio: Hide FindWidget on escape key press 2022-03-30 11:26:26 -04:00
Timothy Flynn 4fd463dae0 LibJS: Normalize mathematical references to negative zero
This is an editorial change in the Intl spec. See:
https://github.com/tc39/ecma402/commit/d4be24e
2022-03-30 14:24:32 +01:00