Commit graph

17881 commits

Author SHA1 Message Date
Andreas Kling
d571159aeb PixelPaint: Move selection from ImageEditor to Image
This is preparation for making selection state undoable.
2022-08-26 01:04:52 +02:00
Andreas Kling
67596d9546 PixelPaint: Move "marching ants" painting logic to ImageEditor
Since this code needs to look at a bunch of ImageEditor state anyway,
it makes more sense for it to live in ImageEditor.
2022-08-26 01:04:52 +02:00
Andreas Kling
e6d860f2fe PixelPaint: Round mouse event coordinates instead of truncating
This makes the rectangle select tool feel a lot better when zoomed in.
2022-08-26 01:04:52 +02:00
Andreas Kling
d32f7112dc LibWeb: Intentionally leak the main thread JS VM
This way we avoid doing an expensive full GC on exit.
2022-08-26 01:04:51 +02:00
Linus Groh
36225c0ae7 LibJS: Allow undefined for calendar in MaybeFormatCalendarAnnotation
This is an editorial change in the Temporal spec.

Now that this is spec'd as either an Object or undefined, we can change
the parameter type from arbitrary JS::Value to JS::Object*.

See: https://github.com/tc39/proposal-temporal/commit/cdfcffd
2022-08-25 23:41:09 +01:00
Linus Groh
741cc08221 LibJS: Use fully spec'd algorithm for ToISOWeekOfYear
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/33b62a3
2022-08-25 23:41:09 +01:00
Linus Groh
b438839fcc LibJS: Reject ambiguous time string even with a calendar
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/5e2afb9
2022-08-25 23:41:09 +01:00
Linus Groh
2cf5f5c278 LibJS: Remove unused nonterminals from the ISO8601 parser
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/fe9ef00
2022-08-25 23:41:09 +01:00
Linus Groh
42452a81a2 LibJS: Simplify TimeSpecWithOptionalTimeZoneNotAmbiguous
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/77b0163
2022-08-25 23:41:09 +01:00
Linus Groh
f29c7cab16 LibJS: Remove exception rule from TimeZoneIANAName production
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/6a758d6
2022-08-25 23:41:09 +01:00
MacDue
965237efb8 LibWeb: Don't return an opaque origin for file:// URLs
The protocol of the origin is used for checking if the a file://
iframe is allowed to be loaded (a document with a file:// origin
can load other files in iframes).

This used to be the case, but was changed in
6e71e400e6, which broke file:// iframes.
2022-08-26 00:21:10 +02:00
MacDue
8d2c2f7c52 LibWeb: Determine the origin when navigating across documents 2022-08-26 00:21:10 +02:00
Luke Wilde
9643a5c63f LibJS: Accept and ignore calendar annotation in Instant strings
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/3cd9669
2022-08-25 23:07:08 +01:00
Luke Wilde
54bb6bf2c0 LibJS: Avoid calling ToString on calendar when calendarName is "never"
This is a normative change in the Temporal spec.

See:
- https://github.com/tc39/proposal-temporal/commit/6122f4e
- https://github.com/tc39/proposal-temporal/commit/cf586bc
2022-08-25 21:11:23 +01:00
Timothy Flynn
6309b8773d LibJS: Guard IntegerIndexedElementSet with receiver check
This is a normative change in the ECMA-262 spec. See:
https://github.com/tc39/ecma262/commit/3620f11
2022-08-25 19:50:04 +01:00
Timothy Flynn
a803d9226f LibJS: Always access RegExp flags by its "flags" property
This is a normative change in the ECMA-262 spec. See:
https://github.com/tc39/ecma262/commit/35b7eb2

Note there is a bit of weirdness between the mainline spec and the set
notation proposal as the latter has not been updated with this change.
For now, this implements what the spec PR and other prototypes indicate
how the proposal will behave.
2022-08-25 16:39:45 +01:00
Timothy Flynn
9a1f55afe5 LibJS: Fix spec steps and links for RegExp set notation proposal 2022-08-25 16:39:45 +01:00
Timothy Flynn
6af9bf1a1e LibUnicode: Fix compilation when ENABLE_UNICODE_DATABASE_DOWNLOAD is OFF 2022-08-25 16:20:22 +01:00
martinfalisse
79a630adef LibWeb: Begin formatting the grid
This is a really starter attempt at formatting the grid. It doesn't yet
take into account the computed_values of grid-template-rows, nor the
values in grid-column-start and like CSS properties.

But these changes are a start and make it so the examples in
display-grid.html work.

To be fleshed out further..
2022-08-25 13:47:48 +02:00
martinfalisse
7bb3a8d646 LibWeb: Parse grid-column and grid-row CSS values 2022-08-25 13:47:48 +02:00
martinfalisse
44d08b81b7 LibWeb: Parse grid-column-start and related CSS properties
Parse grid-column-start, end, and the equivalent for rows.
2022-08-25 13:47:48 +02:00
martinfalisse
92a00648b1 LibWeb: Parse grid-template-columns and grid-template-rows
Add functionality to begin parsing grid-template-columns and
grid-template-rows. There are still things to be added, like parsing
functions, but I would say a couple of the major points are already
adressed like length, percentage, and flexible-length.
2022-08-25 13:47:48 +02:00
martinfalisse
c40dd9ee78 LibWeb: Add GridTrackPlacementShorthandStyleValue
Add GridTrackPlacementShorthandStyleValue for the use of grid-column and
grid-row.
2022-08-25 13:47:48 +02:00
martinfalisse
08b832eb69 LibWeb: Add GridTrackPlacementStyleValue
Add GridTrackPlacementStyleValue for the use of CSS properties
grid-column-start, grid-column-end, grid-row-start, grid-row-end.
2022-08-25 13:47:48 +02:00
martinfalisse
0148260b5f LibWeb: Add GridTrackSizeStyleValue
Add GridTrackSizeStyleValue for the use of CSS properties
grid-template-columns, grid-template-rows.
2022-08-25 13:47:48 +02:00
martinfalisse
ca286fc220 LibWeb: Add GridTrackPlacement for grid-[column/row]-[start/end]
Add GridTrackPlacement to use with grid-column-start and related CSS
properties.
2022-08-25 13:47:48 +02:00
martinfalisse
fc36970973 LibWeb: Add GridTrackSize class for grid-template-*
Add GridTrackSize to be used with grid-template-column and
grid-template-row.
2022-08-25 13:47:48 +02:00
martinfalisse
e4c5799026 LibWeb: Add GridFormattingContext 2022-08-25 13:47:48 +02:00
martinfalisse
e4541d83d3 LibWeb: Parse grid display value 2022-08-25 13:47:48 +02:00
MacDue
b609dd7348 Eyes: Add an option to show/hide the window frame
This works the same as in the Cube demo, and now allows enjoying
the eyes without any obstructions :^)

The window frame can now be disabled with the -h/--hide-window
command-line option, or via toggle in the GUI.
2022-08-25 13:42:17 +02:00
faxe1008
21358d8a5f PixelPaint: Reduce verbosity of crop to content feature
This patch reduces the repetitiveness of the crop to content feature
implementation.
2022-08-25 13:38:31 +02:00
thankyouverycool
d5de9bcc51 Applications: Use modeless windows in some apps
Browser, Spreadsheet and Charactermap now open child windows
modelessly.
2022-08-25 13:28:50 +02:00
thankyouverycool
35a230f974 LibGUI+Taskbar+WindowServer: Remove mode and parent methods from Taskbar
Taskbar only needs a modeless parent and the activity state of the
modal chain to update buttons.
2022-08-25 13:28:50 +02:00
thankyouverycool
d54dc22362 WindowServer: Default to Desktop when picking a new active window 2022-08-25 13:28:50 +02:00
thankyouverycool
af706d081c WindowServer: Invalidate new and previous active input window frames
Fixes shared active title bar theming not updating for capturing
modals.
2022-08-25 13:28:50 +02:00
thankyouverycool
6f316d59f4 WindowServer: Restore modal chains from the Taskbar and Switcher
And only show modeless windows in WindowSwitcher.
2022-08-25 13:28:50 +02:00
thankyouverycool
5a0472d8d2 WindowServer: Use nearest modeless window for modal Taskbar rects
Modeless windows are guaranteed Taskbar buttons which lets us
simplify getting the proper taskbar rect for modals.
2022-08-25 13:28:50 +02:00
thankyouverycool
df2f479810 WindowServer: Don't move child windows in unison with their parents
This was a cludge for ComboBox ListView windows when they were first
implemented. The behavior is no longer needed and not very ergonomic
when moving Normal windows around.
2022-08-25 13:28:50 +02:00
thankyouverycool
2b2c317c2d WindowServer: Don't let modals minimize themselves
But do allow them to remain minimizable by a parent. This is a nice
ergonomics fix to allow a parent window to quickly minimize and
restore all its modal children.
2022-08-25 13:28:50 +02:00
thankyouverycool
788b16cbf8 WindowServer: Replace modal stacks with modal chains
And apply modal effects on move_to_front_and_make_active()

Instead of building a vector of windows every time we want to
loop over a group of related modals, simply recurse through
their ancestory. This lineage is now called a modal chain. Modal
chains begin at the first modeless parent, and a new chain
starts at every modeless child. This lets apps spawn child windows
independent of the main window's modal effects, restore state,
and workspace, yet still remain descendants.

Looping through a modal chain is recursive and includes the
modeless window which begins it.
2022-08-25 13:28:50 +02:00
thankyouverycool
4c7f95e2f8 LibGUI+WindowServer+Apps: Replace Accessory Windows
with the CaptureInput WindowMode. This mode will serve the same
function as accessories: redirecting input while allowing parent
windows to remain active.
2022-08-25 13:28:50 +02:00
thankyouverycool
0d4fd4e2a6 LibGfx+LibGUI+WindowServer+Apps+Demos: Replace ToolWindows
with the RenderAbove WindowMode. This mode will ensure child
windows always draw above their parents, even when focus is lost.
RenderAbove modals are automatically themed the same as the old
ToolWindows. Fixes ToolWindows rendering above ALL normal windows,
regardless of parent. We can't rely on WindowType to create these
sort of effects because of WindowManager's strict display hierarchy.
2022-08-25 13:28:50 +02:00
thankyouverycool
589572cfa4 LibGUI+WindowServer: Introduce WindowModes
Previously, Windows only understood blocking modality: Windows were
either modal, i.e., in a blocking state, or not. Windows could also
be set as Accessories or ToolWindows, attributes which technically
applied modes to their parents but were implemented ad hoc. This patch
redefines these modal effects as WindowModes and sets up some helpers.
This will let us simplify a lot of modal logic in the upcoming patches
and make it easier to build new modal effects in the future.

Windows can now set 1 of 5 modes before reification:
-Modeless:	No modal effect; begins a new modal chain
-Passive:	Window joins its modal chain but has no effect
-RenderAbove:	Window renders above its parent
-CaptureInput:	Window captures the active input role from its parent
-Blocking:	Window blocks all interaction with its modal chain

States like fullscreen and tiling are dynamic and don't alter behavior
in modal chains, so they aren't included.
2022-08-25 13:28:50 +02:00
thankyouverycool
609391b46e WindowServer: Add modeless_ancestor() helper 2022-08-25 13:28:50 +02:00
thankyouverycool
ab517aa21d WindowServer: Remove m_unmaximized_rect from Window
Superceded by m_floating_rect
2022-08-25 13:28:50 +02:00
thankyouverycool
68570e897d LibGfx+WindowServer: Remove set_size_around() from Rect and Window
Superceded by to_floating_cursor_position() as a more accurate way
to reposition windows on untile. Effectively made set_size_around()
dead code, so the remnants can be removed.
2022-08-25 13:28:50 +02:00
thankyouverycool
a1dceb5b97 WindowServer: Remove nudge_into_desktop() from Window
Positioning windows outside visible coordinates is valid if sometimes
curious behavior, but it shouldn't be considered misbehavior by default.
There are multiple ways to recover windows with obscured title bars,
and this function papers over actual resize bugs and is no longer
needed to normalize window size, so let's remove it for now.
2022-08-25 13:28:50 +02:00
thankyouverycool
b180132c87 WindowServer: Fix typo 'reminder' -> 'remainder' in WindowManager 2022-08-25 13:28:50 +02:00
thankyouverycool
24b8301a0e WindowServer: Get taskbar height from TaskbarWindow directly
Fixes incorrect hardcoded heights and a failure to get taskbar
height when tiling on new workspaces.
2022-08-25 13:28:50 +02:00
thankyouverycool
c5dd72ac71 LibGUI: Remember size and position of hidden Windows
And don't reset windowless rects on resize events. Fixes child
windows reappearing at [0,0] and with the wrong dimensions after
being hidden.
2022-08-25 13:28:50 +02:00