Commit graph

14741 commits

Author SHA1 Message Date
AnotherTest
59b46a1f51 Shell: Show termination signal if job did not exit cleanly 2020-12-08 23:34:38 +01:00
AnotherTest
48a1f7e55c Shell: Silence TCSETPGRP errors when not interactive 2020-12-08 23:34:38 +01:00
AnotherTest
57728ef29f Shell: Replace all dbg()'s with dbgln() 2020-12-08 23:34:38 +01:00
AnotherTest
602d2ff856 AK: Implement DuplexMemoryStream::offset_of() in terms of memmem()
This fixes the FIXME about missing matches that go across chunk
boundaries.
2020-12-08 23:34:38 +01:00
AnotherTest
036b39cdfd AK: Implement memmem() for iterator haystacks
This uses the KMP algorithm to implement the search.
Also replaces the slow route of the normal memmem() with KMP, which
should be fairly faster (O(n + m) as opposed to O(n * m)) :^)
2020-12-08 23:34:38 +01:00
AnotherTest
f12c98b29f LibRegex: Add a basic Regex<...>::replace() 2020-12-08 23:34:38 +01:00
AnotherTest
c85eaadb48 AK: Forward declare Nonnull{Own,Ref}PtrVector 2020-12-08 23:34:38 +01:00
AnotherTest
5325d6871d Shell: Make <return> go to a new line when the command is incomplete
"incomplete" meaning that it has a syntax error that can be recovered
from by continuing the input.
2020-12-08 23:34:38 +01:00
Andreas Kling
48d2545572 LibJS: Get rid of Argument and ArgumentVector
This was used for a feature where you could pass a vector of arguments
to enter_scope(). Since that way of passing arguments was not GC-aware
(as vectors use C++ heap storage), let's avoid using it and make sure
everything that needs to stay alive is either on the stack or in traced
storage instead.
2020-12-08 18:28:18 +01:00
Andreas Kling
38268f1c53 LibJS: Create lexical scope for "catch" on the spot when throwing 2020-12-08 18:22:47 +01:00
Andreas Kling
fc9e43728b LibJS: Stop creating a redundant lexical scope on function call
We were scoping the arguments twice, first in execute_function_body(),
and then again in enter_scope().
2020-12-08 18:04:54 +01:00
Zac
eb810d14c3
FileManager: Fix TreeView collapsing on file system changes (#4348)
TreeViews using FileSystemModels collapse whenever the file system is
changed in anyway. This includes creating, dragging, deleting or
pasting any files/folders. This commit updates the refresh_tree_view()
lambda, which seems to have stopped working at some point, and calls it
whenever any of the actions mentioned above are activated.
2020-12-08 17:51:53 +01:00
Andreas Kling
6496895b16 LibWeb: <iframe src> same-origin check should be based on host document
We were basing the src attribute's cross-origin check on whatever was
currently loaded in the iframe, instead of the surrounding document.

Fixes #4236.
2020-12-08 17:49:02 +01:00
Andreas Kling
df2a6cb4ab LibJS: Add Math.acos() and Math.asin() 2020-12-08 17:49:02 +01:00
Andreas Kling
231171364d LibJS: Remove some unnecessary null checks
It's okay to add nullptr to the conservative roots set. We'll just
ignore it later on anyway.
2020-12-08 17:49:02 +01:00
Andreas Kling
d2e3e038d6 LibJS: Use IndexedProperties::for_each_value() in update_function_name()
This allows us to get rid of IndexedProperties::values_unordered().
2020-12-08 17:49:02 +01:00
Andreas Kling
6c4b823cef LibJS: Make marking object indexed properties less allocation-heavy
We were building up a vector with all the values in an object's indexed
property storage, and then iterating over the vector to mark values.
Instead of this, simply iterate over the property storage directly. :^)
2020-12-08 17:49:02 +01:00
Andreas Kling
930fae633e LibJS: Make sure GlobalObject marks the Proxy constructor 2020-12-08 17:49:02 +01:00
Andreas Kling
63b748642a LibJS: Add Math.atan() 2020-12-08 17:49:02 +01:00
Sahan Fernando
fe3963f3d4 LibGfx: SIMD optimized alpha blending 2020-12-08 09:39:43 +01:00
Sahan Fernando
893adbb79c LibGfx: Simplify and refactor Gamma.h
Remove ACCURATE_GAMMA_ADJUSTMENT, since it makes the implementation
uglier, isn't guaranteed to make gamma adjustment accurate and is much
slower.  gamma_accurate_blend4 should either be always used or not
exist based on compilation flags, so there is no need to have it in
its own function. Finally, we should use AK/SIMD.h instead of defining
our own f32x4 type.
2020-12-08 09:39:43 +01:00
Sahan Fernando
d50934823a AK: Add header for SIMD vectorized types 2020-12-08 09:39:43 +01:00
Alex Studer
30ee597056 LibM: Add implementation of ldexpf 2020-12-08 09:38:17 +01:00
Ben Wiederhake
809a8ee693 UserspaceEmulator: Implement readlink syscall 2020-12-08 09:37:30 +01:00
Ben Wiederhake
88b090a808 UserspaceEmulator: Handle overflow in virt$realpath 2020-12-08 09:37:30 +01:00
Ben Wiederhake
6c2ea4c4e9 Clipboard: Remove-unused bpp metadata
It's just more attack surface, and can be deduced from the format anyway.
2020-12-08 09:37:30 +01:00
Ben Wiederhake
4427da989f WindowServer: Initial wallpaper must not be NULL
This used to crash 'pape -c' on a fresh image. Note that the special value
is '', the empty string, and *not* NULL, i.e. an unset string. An empty
string implies that the wallpaper is not an image, but rather a solid color.
2020-12-08 09:37:30 +01:00
Andreas Kling
3852168c84 LibWeb: Compute final line box width *after* placing all fragments
We were doing this after every fragment instead of after every line.
2020-12-07 21:48:23 +01:00
Andreas Kling
56ff2c112b LibWeb: When adding inline-block fragment to line, use border box width
We were only using the content box width for inline-block fragments,
which caused them to not to claim the space needed for padding+border.
2020-12-07 21:47:13 +01:00
Andreas Kling
05e1ecb3d0 LibWeb: Uhh, scale back the default padding on <ul> and <ol> a bit
40px is a lot of padding in our small-fonted world. :^)
2020-12-07 21:37:00 +01:00
Andreas Kling
5d685c4643 LibWeb: Add padding-left to the default UA style for <ol> and <ul>
This matches what other engines do.
2020-12-07 21:17:59 +01:00
Andreas Kling
a3acbf1db2 LibWeb: Include padding+border in shrink-to-fit preferred min width 2020-12-07 21:13:41 +01:00
Andreas Kling
5a57f618ad LibWeb: Resolve width in relative length units on inline-block properly
Element-relative width units like em, ex, etc. should be resolved
against the inline block itself, not against its containing block.
2020-12-07 20:55:44 +01:00
Andreas Kling
70de5fd056 LibWeb: Simplify final line box width computation
The width of a line box is the distance from the left edge of the first
fragment to the right edge of the last fragment. We don't have to loop
over all the fragments to figure this out. :^)
2020-12-07 20:48:26 +01:00
Andreas Kling
be18ac36b2 LibWeb: Use CSS::Length::resolved_or_zero() in a few places 2020-12-07 20:46:01 +01:00
Andreas Kling
d65bebd8cf LibWeb: Cache parsed inline style of DOM elements
Instead of invoking the CSS parser every time we compute the style for
an element that has a "style" attribute, we now cache the result of
parsing the inline style whenever the "style" attribute is set.

This is a nice boost to relayout performance since we no longer hit the
CSS parser at all.
2020-12-07 20:00:27 +01:00
Andreas Kling
867faa5d44 Browser: Don't focus bookmarks toolbar buttons when clicking them
They should only receive focus when tabbed to. This matches what we
already do for other toolbar buttons.
2020-12-07 19:49:06 +01:00
Andreas Kling
ab289e183e LibGUI: Expose widget focus policy as a Core::Object property
This makes focus policies show up in the inspector which is helpful.
2020-12-07 19:46:34 +01:00
Andreas Kling
5b0deba49c LibWeb: Make layout tree dumps nicer
This patch removes a bunch of the less generally useful information
from layout tree dumps and puts it behind some optional bool params.
We also show layout units as integers instead of floats for now,
since fractional layout almost never happen anyway (yet) and this makes
it much easier to read.
2020-12-07 19:40:12 +01:00
Andreas Kling
17e25890be WindowServer: Don't crash when pressing return after opening menu
There isn't always a hovered item, so let's not assume things.
2020-12-07 19:40:12 +01:00
Linus Groh
358ec1f1eb LibVT: Add "Copy name" action to terminal link context menu
Similar to "Copy URL" there is now a "Copy name" action in the context
menu specialized for terminal links. I chose to not alter the behaviour
of the existing copy action to prevent surprises when text is selected
and the user happens to place the cursor over a link.

Closes #4187.
2020-12-07 15:55:12 +01:00
Linus Groh
6b7061d00b LibVT: Enable TerminalWidget copy/paste menu actions conditionally
The copy action is now only enabled if there is a selection.
The paste action is now only enabled if the clipboard contains something
the terminal considers pasteable - that is, non-empty data with a text/*
MIME-type. Previously we'd happily paste things like bitmaps into the
terminal, causing it to blow up.
2020-12-07 15:55:12 +01:00
Linus Groh
886fe7e69f LibGUI: Allow GUI::Action to swallow key events when disabled
Sometimes an action should be disabled and the KeyEvent not posted to
the app's event loop nonetheless. In other words the action swallows the
KeyEvent without being activated.

Specific use-case: Terminal's Ctrl+Shift+{C,V}.
2020-12-07 15:55:12 +01:00
Andreas Kling
253aa7aa7d LibWeb: Make document.title accessible from JavaScript :^) 2020-12-06 21:39:36 +01:00
Andreas Kling
d22512a024 LibWeb: Strip and collapse whitespace in document.title
I didn't generalize this into a helper since the HTML spec doesn't
seem to use this particular algorithm for anything else.

This makes the ACID1 test title show up correctly. :^)
2020-12-06 21:22:31 +01:00
Andreas Kling
cb04a5c52c LibWeb: Forget floating boxes once we've gone past them
Once we've generated enough lines to make it past all the floating
boxes on either side, just forget those boxes. This simplifies the
available space computation since we don't have to consider boxes
that can't vertically intersect the current line anyway.
2020-12-06 21:11:28 +01:00
Andreas Kling
9470169317 LibWeb: Floating elements should not stack horizontally after clear
After we've cleared past some floating elements, we should not keep
stacking new floats horizontally.

Instead, new floats after the clear should once again start at the
left or right edge of their containing block.
2020-12-06 21:00:04 +01:00
Andreas Kling
c953e5d98a LibWeb: Paint positioned elements after non-positioned ones
Within the same stacking context, positioned elements must be painted
after non-positioned ones.

I added a Layout::Node::for_each_child_in_paint_order() to help with
this since it's also needed for hit testing.
2020-12-06 20:05:04 +01:00
Andreas Kling
85a1bd6803 LibWeb: Add Layout::Node::is_positioned()
Any node that has a CSS position other than "static" is positioned.
2020-12-06 20:05:04 +01:00
Andreas Kling
59de4adb60 LibWeb: Pass current target box to BFC::run()
The BFC "context box" is now the outer box of the block formatting
context. Previously the context box was always the current target box,
which made it hard to reason about who was really the containing block
of whom in various places.

Note that IFC still has the containing block as its context box, this
change only affects BFC. However, to clarify the situation in IFC,
I've added a containing_block() getter than returns the context_box().
2020-12-06 20:05:04 +01:00