summaryrefslogtreecommitdiff
path: root/Userland/Libraries
AgeCommit message (Collapse)Author
2023-05-16LibGfx: Make FontDatabase lookups case insensitiveAndreas Kling
This seems mostly harmless and matches what CSS expects from us at the moment. Eventually our CSS font selection will become more sophisticated and stop relying on Gfx::FontDatabase for things like this, but for now it's a simple stopgap that lets websites do "font-family: arial" :^)
2023-05-16LibWeb: Fix for absolutely positioned elements with specified heightAndi Gallo
Use inner height since the paintable adds padding back. Fixes #18842.
2023-05-16LibGUI: Actually set the first allowed file extension list in FilePickerKarol Kosek
Previously, the File Picker didn't activate the pre-selected filter.
2023-05-16LibWeb+WebContent: Add APIs to control video playback stateTimothy Flynn
This allows for the browser process to control the play/pause state, whether we paint user agent controls on the video, and whether the video loops when it finishes playing.
2023-05-16Browser+LibWeb+WebContent: Broadcast video element context menu requestsTimothy Flynn
This just sets up the IPC to notify the browser process of context menu requests on video elements. The IPC contains a few pieces of information about the state of the video element.
2023-05-16LibWeb: Propagate non-primary mouse button clicks on video elementsTimothy Flynn
Otherwise, returning "no" here will disallow the browser process from showing a context menu, as the event handler will bail early.
2023-05-16LibCore: Support the WebM file extension when determining MIME typeTimothy Flynn
This enables, for example, navigating to a file:// URL in Ladybird with a .webm file extension.
2023-05-16LibVT: Correctly wrap text when the scrollbar is hiddennetworkException
2023-05-16LibJS/Bytecode: Implement initial support for super member expressionsLuke Wilde
2023-05-16LibWeb: Implement location.assignLuke Wilde
2023-05-16LibWeb: Skip frozen tracks while distributing space in GFCAliaksandr Kalenik
2023-05-16LibWeb: Reset item_incurred_increase before distributing space in GFCAliaksandr Kalenik
item_incurred_increase should be reset before every next distirbution because otherwise it will accumulate increases from previous distributions which is not supposed to happen.
2023-05-15LibWeb: Basic support for CSS `text-indent: <length-percentage>`Andreas Kling
Note that this simple form of text-indent only affects the first line of formatted content in each block. Percentages are resolved against the width of the block.
2023-05-15LibWeb: Make `processBodyError` take an optional exceptionSam Atkins
Changed here: https://github.com/whatwg/fetch/commit/018ac19838ade92324a1900113636a8bf98f3a1b
2023-05-15LibWeb: Do not layout grid items during grid container intrinsic sizingAliaksandr Kalenik
There is not need to run layout inside grid items for intrinsic sizing of grid container.
2023-05-15LibWeb: Fix specified_size_suggestion to use size of dimensionAliaksandr Kalenik
specified_size_suggestion() should use width or height depending on specified dimension.
2023-05-15LibWeb: Fix UBSAN issue caused by invalid TemporaryTrack pointer in GFCAliaksandr Kalenik
Fixes the issue when if there are enough rows/column to force m_row_gap_tracks or m_column_gap_tracks be resized during gaps initialization then pointers stored in m_grid_columns_and_gaps or m_grid_rows_and_gaps become invalid.
2023-05-15LibGUI: Fix bad title alignment in GroupBoxAndreas Kling
Make a separate rect for the text and use IntRect::centered_within() to sidestep any subpixel jitter. This way it looks good with both bitmap and vector fonts.
2023-05-15LibWeb: Cache state of the contenteditable attribute on HTMLElementAndreas Kling
Instead of recomputing the state whenever someone asks for it, we now cache it when the attribute is added/changed/removed. Before this change, HTMLElement::is_editable() was 6.5% of CPU time when furiously resizing Hacker News. After, it's less than 0.5%. :^)
2023-05-15LibWeb: Fix iframes flickering on window resizeAndreas Kling
After finishing layout, iframe layout boxes (FrameBox) get notified about their new size by LayoutState::commit(). This information is forwarded to the nested browsing context, where it can be used for layout of the nested document. The problem here was that we notified the FrameBox twice. Once when assigning the used offset to its paintable, and once when assigning its size. Because the offset was assigned first, we ended up telling the FrameBox "btw, your size is 0x0". This caused us to throw away all the layout information we had for the nested document. We'd then say "actually, your size is 300x200" (or something) but by then it was already too late, and we had to do a full relayout. This caused iframes to flicker as every time their containing document was laid out, we'd nuke the iframe layout and redo it (on a zero timer). The fix is pleasantly simple: we didn't need to inform the nested document of its offset in the containing document's layout anyway. Only its size is relevant. So we can simply remove the first call, which removes the bogus 0x0 temporary size. Note that iframes may still flicker if they change size in the containing document. That's a separate issue that will require more finesse to solve. However, this fixes a very noticeable common case.
2023-05-15LibGUI: Put a governor on Action activationthankyouverycool
Many actions affect Window modality, so let's put a temporary change governor on activation to stop race conditions. Fixes being able to spam open/close shortcuts and spawn multiple FilePickers, among other things.
2023-05-15LibGUI+FileSystemAccessServer: Avoid using dummy windowsthankyouverycool
Creates two new gatekept helpers for FilePicker and MessageBox to be used by FSAS to replace the "dummy window" approach to centering Dialogs. There was a slight delay in creating two windows, one a transparent intermediary hidden behind the second, to display FSAS Dialogs. Now we only need to make the window we actually see.
2023-05-15LibGUI: Simplify Dialog::ScreenPosition and allow Dialogs to opt outthankyouverycool
These options were created 2 years ago but the only use cases thus far are for Center and CenterWithinParent, so let's chuck the rest for now. Adds a new DoNotPosition option to opt out of automatic centering and a ScreenPosition setter and getter for configuration before exec()
2023-05-15LibGUI: Add Window::constrain_to_desktop() helperthankyouverycool
And a center_within(IntRect const&) overload
2023-05-15LibGfx: Reverse coordinate subtraction in Rect::constrained_to()thankyouverycool
Fixes translating in the wrong direction or not at all in the case of a constraint at (0,0). This doesn't appear to be used anywhere yet but is needed in the upcoming patch.
2023-05-15Ladybird+LibWebView: Move backing store management code to LibWebViewAndreas Kling
This lets us share this code on all platforms, and makes resizing the window much faster on SerenityOS as well. :^)
2023-05-15Ladybird+LibWebView: Remember the size of the last paintAndreas Kling
This will allow us to change the size of the backing store bitmap without conflating the size of the bitmap and the size of the paint.
2023-05-15Userland: Silence or resolve new GCC 13 warningsDaniel Bertalan
GCC 13 produces the following true positive warnings: - `-Wredundant-move` when trying to move `result->tooltip()`, which is a const reference in `Assistant/main.cpp` - `-Wuse-after-free` when freeing an environment variable before removing it from `s_malloced_environment_variables` - `-Wdangling-pointer` when storing an AST node's `this` pointer to the interpreter's node stack in LibJS. This is not actually an issue, as it is popped when the scope ends, but GCC has no way of telling this.
2023-05-15LibCore: Remove DeprecatedFile::read_linkBen Wiederhake
2023-05-15LibGUI+Userland: Store column names in JsonArrayModel as StringKarol Kosek
2023-05-15Userland: Port `Model::column_name()` to StringKarol Kosek
2023-05-15LibGUI: Increase the min width of the vertical opacity sliderMacDue
This prevents the <opacity>% text on the slider being clipped.
2023-05-15LibGUI: Ensure final stop of the opacity slider gradient has 255 alphaMacDue
Otherwise, if you change the opacity in the color picker, the slider's opacity changes.
2023-05-15LibCore: Use StringView in Object::find_{child,descendant}_of_type_namedKarol Kosek
It's unnecessary to allocate a string when we only want to compare it with another string. This change also adds a helper for string literals, so that we won't need to add -sv suffix everywhere. :^)
2023-05-15LibGfx: Stop assuming the target format is always BGRA8888MacDue
...and instead assume it's BGRx8888 or BGRA8888, for now. Always treating the target as BGRA8888 leads to the alpha channel being interpreted incorrectly sometimes (as can be seen with WindowServer overlays). Fixes #18749
2023-05-14LibVideo: Add `PlaybackManager::from_mapped_file`Caoimhe
This allows us to create a PlaybackManager from a file which has already been mapped, instead of passing a file name. This means that anyone who uses `PlaybackManager` can now use LibFSAC :)
2023-05-14LibCore: Remove standard I/O from DeprecatedFileBen Wiederhake
2023-05-14LibWeb: Start implementing sizing for tracks with span > 1 items in GFCAliaksandr Kalenik
Partially implements: - Increase sizes to accommodate spanning items crossing content-sized tracks - Increase sizes to accommodate spanning items crossing flexible tracks from https://www.w3.org/TR/css-grid-2/#algo-content
2023-05-14LibWeb: Separate grid tracks from gaps in GFCAliaksandr Kalenik
This change is supposed to solve the problem that currenty when grid tracks are interleaved with gaps it is impossible to iterate tracks spanned by a specific grid item. There is a pair of functions: gap_adjusted_row() and gap_adjusted_column() but they won't work when it comes to items spanning > 1 track. Separating gaps from tracks is going to make it possible to iterate just tracks or both tracks and gaps when it is required. And now tracks spanned by an item can be accessed by just index without doing any additional math.
2023-05-14LibWeb: Make the dblclick event bubble, cancelable and composedLuke Wilde
2023-05-14LibELF: Only call IFUNC resolvers after populating the PLTDaniel Bertalan
As IFUNC resolvers may call arbitrary functions though the PLT, they can only be called after the PLT has been populated. This is true of the `[[gnu::target_clones]]` attribute, which makes a call to `__cpu_indicator_init`, which is defined in `libgcc_s.so`, through the PLT. `do_plt_relocation` and `do_direct_relocation` are given a parameter that controls whether IFUNCs are immediately resolved. In the first pass, relocations pointing to IFUNCs are put on a worklist, while all other relocations are performed. Only after non-IFUNC relocations are done and the PLT is set up do we deal with these.
2023-05-14LibELF: Split `do_relocation` into `do_{direct,plt}_relocation`Daniel Bertalan
No functional changes intended. This is in preparation of a commit that overhauls how IFUNCs are resolved. This commit lets us move the implementation of PLT patching from `DynamicObject` to `DynamicLoader` where all other relocation code lives. For this, got[2] now stores the loader's address instead of the object's.
2023-05-14LibC+LibELF: Handle the R_AARCH64_IRELATIVE relocation typeDaniel Bertalan
This is the AArch64 equivalent of `R_X86_64_IRELATIVE`, which specifies a symbol whose address is determined by calling a local IFUNC resolver function.
2023-05-14LibWeb: Remove unused line in calculate_min_content_size() in GFCAliaksandr Kalenik
2023-05-14LibWeb: Remove excessive spec referencing in GridFormattingContextAliaksandr Kalenik
Removes unrelated to the code copy paste from spec (sometimes duplicated).
2023-05-14LibWeb: Remove dead code in resolve_intrinsic_track_sizes() in GFCAliaksandr Kalenik
Removes partially implemented algorithm for distributing extra space from spanning item: https://www.w3.org/TR/css-grid-2/#extra-space This algorithm should not be part of resolving track sizing on its own but instead be a subfunction of step 3: https://www.w3.org/TR/css-grid-2/#track-size-max-content-min There are changes in layout tests but those are not regressions.
2023-05-14LibWeb: Change implicit background-size height to autoRimvydas Naktinis
The spec says: "The first value gives the width of the corresponding image, the second value its height. If only one value is given the second is assumed to be auto." Fixes #18782
2023-05-14LibWeb: Protect against dereferencing a null pending image requestAndreas Kling
The spec seems to neglect the potential nullity of an image's pending request in various cases. Let's protect against crashing and mark these cases with a FIXME about figuring out whether they are really spec bugs or not.
2023-05-14LibDebug: Stub out LocListX and remove stub expression evaluatorMacDue
The expression evaluator is dead code that does nothing but crash on all paths, as no opcodes are implemented. Stubbing out the LocListX form fixes a crash while reading DWARF 5 debug data that contains location lists. These are just a new way to store location expressions, and since we never implemented expressions, we can just ignore these too. As far as I can tell this is enough for DWARF 5 to work for us (since we mainly just use the line tables).
2023-05-14LibJS/Bytecode: Restore old environments when an exception is caughtAndreas Kling
Unwind contexts now remember the lexical and variable environments in effect when they were created. If an exception is caught, we revert to those environments in the running execution context.