Commit graph

19620 commits

Author SHA1 Message Date
Luke Wilde
08750f69e4 LibJS: Add thorough tests for try/finally using continue and break
I wrote these tests a while ago while trying to improve the bytecode,
but didn't end up making them pass and gave up. They work in AST
interpreter mode, so we can have them in now to have them around for
anyone who wants to try and make them pass in bytecode.
2022-11-08 21:10:53 +00:00
Luke Wilde
fd6bb41519 LibWeb: Apply the current transform in CRC2D.stroke()
This makes the Google Docs spelling and grammar squiggles appear in the
correct position.
2022-11-08 18:47:31 +00:00
Nico Weber
d09b5e8484 Everywhere: Clean up "in in" comment typos
Includes fetch editorial update
https://github.com/whatwg/fetch/commit/3cafbdfc39250!
2022-11-08 15:09:08 +00:00
Gunnar Beutner
7442cfb507 LibC: Implement getpwent_r
Refs #15965.
2022-11-08 11:51:19 +01:00
Sergiy Stupar
288d75fdab WindowServer: Cycle through menu items with the same Alt shortcut
If there are multiple items with the same Alt shortcut, cycle through
them with each keypress instead of activating immediately.
2022-11-08 11:48:37 +01:00
Gunnar Beutner
892186d058 LibWeb: Pick the correct DOM node for mouse-move events
This makes hovering over the link in the following HTML snippet work,
i.e. the tooltip is shown and the link target is shown at the bottom
of the browser window:

<html lang="en"><head><style>
.site-link{display:inline-block}
.site-link:before{content:"derp"}
.site-link::after{content:"";display:block}
</style></head><body><a class="site-link" href="#"
title="Tooltip, maybe!"></a>
2022-11-08 11:47:44 +01:00
Mike Akers
7eed3dab5d LibGUI: Fix a typo 2022-11-07 20:43:39 -08:00
Torstennator
a66dbef1ed PixelPaint: Improve brushtool gradient for low hardness
This patch mitigates a rough gradient for the brush tool with a low
hardness. Previously the gradient alpha value was truncated by the type
conversion to int. Now the desired alpha value is scaled up to mitigate
the information loss due to type conversion which results in a much
smoother gradient.
2022-11-07 20:58:02 +00:00
Torstennator
e520b9c3a3 PixelPaint: Relate cursor to brush tool size
This patch changes the cursor for the brush tool to a circle of dynamic
size to indicate the region where the tool will apply color changes.
2022-11-07 20:58:02 +00:00
MacDue
7e21fe61b4 LibWeb: Paint repeating-conic-gradient()s
Shares the same machinery as linear-gradient()s so this is quite easy.
2022-11-07 13:13:22 +00:00
MacDue
2c2b9fb1d7 LibWeb: Parse repeating-conic-gradient()s 2022-11-07 13:13:22 +00:00
Luke Wilde
bee4df7bfb LibWeb: Skip hit testing a line box fragment if it has no container
The container appears to be null for certain elements such as the
"update your browser" box when clicking on the document during certain
parts of loading. Skipping it works fine, but should obviously be
fixed, so it prints a debug output when this happens.
2022-11-07 14:10:41 +01:00
Luke Wilde
11ede565a8 LibWeb: Fire a keypress event after firing a keydown event
In Google Docs with our user agent string, this is the event it listens
for to insert characters into the document.
2022-11-07 14:10:41 +01:00
Luke Wilde
e4688fedd5 LibWeb: Make keyboard events properly fire into a focused iframe
Google Docs focuses a "text event target" iframe using Window.focus on
the iframe's contentWindow. Doing so makes the iframe's document the
focused element we have to fire text events at. However, in the top
level browsing context, the focused element is still the iframe, so we
have to repeat the keyboard event steps but with the iframe's nested
browsing context instead.
2022-11-07 14:10:41 +01:00
Luke Wilde
009f04fa46 LibWeb: Implement HTMLTableRowElement.deleteCell 2022-11-07 14:10:41 +01:00
Luke Wilde
6c9b3fb62e LibWeb: Implement HTMLTableRowElement.insertCell 2022-11-07 14:10:41 +01:00
Luke Wilde
f984c70b20 LibWeb: Implement :lang pseudo class serialization 2022-11-07 14:10:41 +01:00
Luke Wilde
1fbad9caaf LibWeb: Recognise the ::placeholder pseudo element
This doesn't give it any functionality.
2022-11-07 14:10:41 +01:00
Luke Wilde
dfad2d4c13 LibWeb: Check that there's a head element before looking for favicons 2022-11-07 14:10:41 +01:00
Luke Wilde
1d0fe2325c LibWeb: Don't call load_src after process_the_iframe_attributes
process_the_iframe_attributes already causes a navigation, so this
would cause a double navigation and blow away any setup that JS may
have done from events fired in process_the_iframe_attributes.
2022-11-07 14:10:41 +01:00
Luke Wilde
72098d2699 LibWeb: Return after firing the iframe load event for about:blank
This was a missing spec step. This prevents it navigating to
about:blank, which will blow away the document and thus any setup that
was done in the iframe load event.
2022-11-07 14:10:41 +01:00
Luke Wilde
a268026e4e LibWeb: Start implementing the Element scroll attributes
These are required for hit testing the document in Google Docs. If they
aren't defined, the Google Docs hit test code will add undefined to
certain values, causing them to turn into NaN. This causes NaNs to
propagate through their hit test code, which eventually makes it
infinitely loop.
2022-11-07 14:10:41 +01:00
Luke Wilde
6b0152e150 LibWeb: Stub Document.queryCommandSupported 2022-11-07 14:10:41 +01:00
Luke Wilde
d6cfc735ae LibWeb: Expose MouseEvent.{screenX,screenY}
These are currently the same as clientX and clientY, but it works for
now.
2022-11-07 14:10:41 +01:00
Luke Wilde
a569d02b0d LibWeb: Implement Window.focus 2022-11-07 14:10:41 +01:00
Luke Wilde
a10204133a LibWeb: Use the focus steps instead of set_focused_element on user click
This makes clicking properly fire focus/blur events alongside setting
the focused element.
2022-11-07 14:10:41 +01:00
Luke Wilde
547e006a12 LibWeb: Extract the (un)focus steps out of HTMLElement
The (un)focus steps have no dependency on HTMLElement, thus we can
extract them into their own file. This allows them to be called
anywhere.
2022-11-07 14:10:41 +01:00
Luke Wilde
c4ee43c5b4 LibWeb: Implement HTMLSelectElement.type 2022-11-07 14:10:41 +01:00
Luke Wilde
c247fefee7 LibWeb: Implement CSSStyleDeclaration.cssText 2022-11-07 14:10:41 +01:00
Luke Wilde
8066a67da2 LibWeb: Implement Element.getAttributeNode 2022-11-07 14:10:41 +01:00
Luke Wilde
469ef22a22 LibWeb: Add HTMLOrSVGElement.autofocus 2022-11-07 14:10:41 +01:00
Luke Wilde
b8b263d9c3 LibHTTP: Always send Content-Length header in POST requests
Required by Google services, Content-Length should always been sent,
even when there is no body.
2022-11-07 14:10:41 +01:00
Luke Wilde
1473bc9169 LibWeb: Implement HTMLOrSVGElement.tabIndex 2022-11-07 14:10:41 +01:00
Luke Wilde
6c21c72492 LibWeb: Stub XMLHttpRequest.abort 2022-11-07 14:10:41 +01:00
Karol Kosek
9805cdeaf5 ThemeEditor: Warn about unsaved changes on file open 2022-11-07 12:55:46 +00:00
Karol Kosek
6b8d351b40 TextEditor+HexEditor: Warn about unsaved changes after dropping files 2022-11-07 12:55:46 +00:00
Torstennator
65919bcbb5 PixelPaint: Remember visibility for histogram and vectorscope
This patch allows pixelpaint to remember if the histogram or vectorscope
was visible last time the application was used.
2022-11-07 12:39:44 +00:00
Alex Chronopoulos
e86cab00b6 AudioServer: Skip mixing when volume is zero
When volume is zero it is not necessary to go through the mixing loop.
The zero-filled buffer can be written directly to the device, instead,
similar to the muted case. Tested by using the piano app and the main
volume control.
2022-11-07 12:30:57 +00:00
Gunnar Beutner
02186e2ee9 LibWeb: Skip anonymous layout nodes while finding the event target
This makes the links on nitter.net clickable, e.g. "preferences" in the
upper right corner.
2022-11-07 12:19:42 +00:00
Gunnar Beutner
e7a7895114 LibWeb: Move code for finding the parent element into a helper function
This exact same loop is repeated a couple of times.
2022-11-07 12:19:42 +00:00
martinfalisse
188856c5eb LibWeb: Implement gap in CSS Grid 2022-11-07 10:06:07 +01:00
martinfalisse
2b69fa5649 LibWeb: Add some helpers for TemporaryTrack
Add some helpers to the TemporaryTrack struct to assist in making future
commits more legible.
2022-11-07 10:06:07 +01:00
martinfalisse
9e6612c49b LibWeb: Parse CSS gap property
Including the legacy grid-gap, grid-column-gap and grid-row-gap
properties.
2022-11-07 10:06:07 +01:00
Slimey
e00b16460c Base+VideoPlayer: Add an icon for video player
Co-authored-by: TreuKS <ks2225@protonmail.com>
2022-11-06 22:27:22 -08:00
Daniel Bertalan
4296425bd8 Everywhere: Remove redundant inequality comparison operators
C++20 can automatically synthesize `operator!=` from `operator==`, so
there is no point in writing such functions by hand if all they do is
call through to `operator==`.

This fixes a compile error with compilers that implement P2468 (Clang
16 currently). This paper restores the C++17 behavior that if both
`T::operator==(U)` and `T::operator!=(U)` exist, `U == T` won't be
rewritten in reverse to call `T::operator==(U)`. Removing `!=` operators
makes the rewriting possible again.
See https://reviews.llvm.org/D134529#3853062
2022-11-06 10:25:08 -07:00
Gunnar Beutner
2d3567ee92 Meta+LibUnicode: Avoid relocations for static unicode data
Previously the s_decomposition_mappings variable would refer to other
data in s_decomposition_mappings_data. This would cause thousands of
avoidable relocations at load time.

This saves about 128kB RAM for each process which uses LibUnicode.
2022-11-06 17:34:06 +01:00
Slimey
bb95374b49 VideoPlayer: Add quit action and help menu
I also moved the menubar initialization code to VideoPlayerWidget in
order to keep all of the bulk out of main.cpp :)
2022-11-06 16:27:18 +01:00
Slimey
8006bdf6b4 VideoPlayer: Show current open file in the title 2022-11-06 14:49:09 +01:00
martinfalisse
03949296c7 LibWeb: Calculate grid content height using column width
Should use the min_content_height function for calculating the height of
content. Thanks to previous commits, are able to use the width of the
column for this calculation.
2022-11-06 13:23:33 +01:00
martinfalisse
7474827747 LibWeb: Use AvailableSpace when referring to the grid width
Should use AvailableSpace to get the grid width instead of
box_state.content_width().

This change was imposed on me by the compiler as in a future commit I
will remove the only reference to the available_space parameter.
2022-11-06 13:23:33 +01:00