Commit Graph

2308 Commits

Author SHA1 Message Date
Ben Wiederhake
1e857de263 UserspaceEmulator: Support munmap/mprotect with partial mappings
Fixes #5663.
2021-03-08 22:57:36 +01:00
Ben Wiederhake
45443f24ec UserspaceEmulator: Enable splitting regions at arbitrary points
This is not yet useful in and of itself, but enables the feature in the next commit.
2021-03-08 22:57:36 +01:00
Ben Wiederhake
7cc8f20a30 UserspaceEmulator: Convert backing storage from malloc to mmap
This saves a few bytes for each guest-mmaped region, especially since these are likely to be page-aligned.
2021-03-08 22:57:36 +01:00
Andreas Kling
968ad0f8d1 LibWeb: Some improvements to CSS height:auto computation for blocks
Auto block heights are now computed according to something that kinda
resembles the specification.

Blocks with inline children and height:auto have their height computed
based on the top of the first line box and the bottom of the last line
box. Very straightforward.

Blocks with block children and height:auto have their height computed
based on the top of the first in-flow block child's margin box, and the
bottom of the last in-flow block child's margin box.
2021-03-08 22:53:28 +01:00
Brian Gianforcaro
bac0dd5e3d LibGUI: Use AK_ENUM_BITWISE_OPERATORS for the FocusPolicy enum 2021-03-08 18:47:40 +01:00
Andreas Kling
dda6eb0f1f LibWeb: Implement StyleSheet.type
This just returns "text/css" on CSSStyleSheet, nothing exciting.
2021-03-08 16:16:28 +01:00
Andreas Kling
2cff070108 LibWeb: Map all the IDL string types to AK::String for now
DOMString, CSSOMString and USVString can all map to AK::String for now,
until we figure something better out.
2021-03-08 16:14:56 +01:00
Andreas Kling
bc116f3b13 LibWeb: Give CSSLoader a backpointer to its owner element
This allows CSSLoader to set up the style sheet owner node internally,
and avoids an awkward weak link between CSSLoader and Document.
2021-03-08 16:03:14 +01:00
Andreas Kling
d07fcba69b LibWeb: Implement StyleSheet.ownerNode :^) 2021-03-08 16:03:14 +01:00
Andreas Kling
a9830d9a55 LibWeb: Start exposing CSS style sheets to JavaScript :^)
This patch adds bindings for the following objects:

- StyleSheet
- StyleSheetList
- CSSStyleSheet

You can get to a document's style sheets via Document.styleSheets
and iterate through them using StyleSheetList's item() and length().

That's it in terms of functionality at this point, but still neat. :^)
2021-03-08 11:50:36 +01:00
Andreas Kling
0d515dea5d LibWeb: Allow specifying a custom C++ implementation for IDL attributes
The "ImplementedAs" extended attribute can now be specified on IDL
attributes to provide the name of a custom C++ implementation instead
of assuming it will have the same name as the attribute.
2021-03-08 11:50:36 +01:00
Andreas Kling
79bc07e5af LibWeb: Make generated wrapper code cast IDL longs to i32 for now
This makes it possible to use "long" and "unsigned long" in IDL.
2021-03-08 11:50:36 +01:00
Brendan Coles
69b98f7d32 Base: Add sysctl man page 2021-03-08 09:48:34 +01:00
AnotherTest
fb68aa1480 Shell: Don't blindly dereference the result of Parser::parse()
It _may_ return nullptr if there's nothing to return.
Fixes #5691.
2021-03-08 09:28:15 +01:00
Emanuele Torre
1f81bc6879 Everywhere: Remove unnecessary whitespace at the end of some lines. 2021-03-08 09:20:53 +01:00
Mițca Dumitru
5265a2d23e LibC: Remove stdbool.h as it is provided by the compiler 2021-03-08 08:56:15 +01:00
Mițca Dumitru
35829304d6 LibC: Define static_assert in assert.h when it's being used in C 2021-03-08 08:56:15 +01:00
AnotherTest
8cc279ed74 LibCrypto: Fail with overflow when bitfield has too many unused bits
There cannot be more unused bits than the entirety of the input.
Found by OSS-Fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=31706#c1
2021-03-08 08:32:07 +01:00
Jelle Raaijmakers
f9f9cda025 LibCompress: Rename libcompression.so to libcompress.so 2021-03-07 18:14:54 +01:00
Andreas Kling
e6f886677e LibWeb: Fix clang-format issue in CSS/StyleResolver.cpp 2021-03-07 17:53:20 +01:00
Andreas Kling
fefb05f6f3 LibWeb: Split CSS::StyleSheet into StyleSheet and CSSStyleSheet
This is a little convoluted but matches the CSSOM specification.
2021-03-07 17:45:15 +01:00
Andreas Kling
0af4762662 LibWeb: Rename StyleRule => CSSStyleRule
This matches the CSSOM specification.
2021-03-07 17:45:15 +01:00
Linus Groh
3532e1788f open: Fix opening "." (again)
We can't always rely on the initial URL's path(), so use either the
user-specified argument or the URL path for determining the realpath,
depending on whether we got a file:// URL argument.

Fixes #4950.
2021-03-07 17:39:58 +01:00
Ben Wiederhake
8f3bed4671 Tests: Make syscall-fuzzer less brittle 2021-03-07 17:31:25 +01:00
Linus Groh
a0362d827c FileManager: Disable view change actions when directory is unreadable
Closes #3556.
2021-03-07 16:19:36 +01:00
thankyouverycool
1ccf9de6b9 Serendipity: Couple more tips and some clean-up 2021-03-07 15:41:32 +01:00
Andreas Kling
2d7d5f2b55 Serendipity: Make main window a normal window
..instead of a tool window. Tool windows are meant as accessories to
an application's main/primary windows, not to be primary windows
themselves.

Fixes #5667.
2021-03-07 14:19:20 +01:00
Andreas Kling
1375c57c4a Serendipity: Simplify GML and fix button alignment 2021-03-07 14:12:23 +01:00
supercyp
a6f957a36b
Serendipity: Make main window resizable (#5675)
If it is not resizable, the "What's new" page may be hard to read.
2021-03-07 14:04:06 +01:00
Andreas Kling
7f9f916470 LibWeb: Make tiled backgrounds scroll with content
Previously the page background was always draw relative to the viewport
instead of following with the content. This should eventually become
an opt-in mode (via CSS "background-attachment") but for now let's have
the default behavior be that backgrounds scroll with content.

Also take this opportunity to move the background painting code from
the two web views to a shared location in InitialContainingBlockBox.
2021-03-07 13:49:20 +01:00
speles
6c087480cf LaunchServer: Use new FileManager flags instead of two arguments 2021-03-07 11:00:36 +01:00
speles
0071742a5a FileManager: Use ArgsParser, handle more options
This adds 2 more flags, that help with the "select on start" invocation.
-s - makes us open the parent directory of the entry, and select it.
-r - makes FileManager to skip real path resolution for cases when we
     want to select the symlink in parent directory.

Also, if the file path is passed as argument, not it will open parent
with the file selected.
2021-03-07 11:00:36 +01:00
speles
63a846a2ac LibCore: Add String variant for ArgsParser::add_positional_argument
This is basically the same version as const char *, but it's a nice
helper that allows us to handle strings without casting.
2021-03-07 11:00:36 +01:00
speles
d64d2e4d09 LibGUI: Scroll selection into view when the IconView is first laid out
If we set selection before the IconView is laid out, it has no size.
So it can't correctly calculate where to scroll. Forcing scroll after
the first resize fixes that.
2021-03-07 11:00:36 +01:00
speles
6e16a5cdfa Applications: Open folder with pre-selected file where appropriate :^) 2021-03-07 11:00:36 +01:00
AnotherTest
13b65b632a Shell: Add support for enumerating lists in for loops
With some odd syntax to boot:
```sh
$ for index i x in $whatever {}
```
2021-03-07 10:59:51 +01:00
AnotherTest
a45b2ea6fb Shell: Add support for 'immediate' expressions as variable substitutions
This commit adds a few basic variable substitution operations:
- length
    Find the length of a string or a list
- length_across
    Find the lengths of things inside a list
- remove_{suffix,prefix}
    Remove a suffix or a prefix from all the passed values
- regex_replace
    Replace all matches of a given regex with a given template
- split
    Split the given string with the given delimiter (or to its
    code points if the delimiter is empty)
- concat_lists
    concatenates any given lists into one

Closes #4316 (the ancient version of this same feature)
2021-03-07 10:59:51 +01:00
AnotherTest
a303b69caa Shell: Do not parse history events in scripts
That makes no sense!
2021-03-07 10:59:51 +01:00
AnotherTest
cad7865ad1 LibLine: Clear the buffer after invalidating prior written data
Otherwise this would set m_chars_touched_in_the_middle to zero, which is
exactly the wrong thing to do.
2021-03-07 10:59:51 +01:00
AnotherTest
c580348ebd Shell: Add functions to the PATH cache when rebuilding the cache
Otherwise functions would be highlighted as missing.
2021-03-07 10:58:42 +01:00
AnotherTest
4f6bf2931c Shell: Make the 'not' builtin return the correct exit code for functions 2021-03-07 10:58:42 +01:00
AnotherTest
fec8d7d699 Shell: Corrently indent offset newlines when formatting
Previously, formatting the following would incorrectly skip the indents:
```
{
    foo

    bar
}
```
to create:
```
{

foo

bar
}
```
2021-03-07 10:58:42 +01:00
AnotherTest
e1512d5968 Shell: Skip caching PATH and history load/save when not interactive
Non-interactive shells (i.e. when running scripts) do not need this
functionality, so they are a boatload of wasted time.
This significantly reduces the script startup and shutdown times when
there are lots of executables in PATH or lots of entries in the history.
2021-03-07 10:58:42 +01:00
Andreas Kling
48347fb1c7 LibGfx: Make most of Gfx::Color constexpr 2021-03-06 19:57:35 +01:00
Luke
ed139bee7f LibWeb: Add a couple child node operations to Node and add node types 2021-03-06 19:57:12 +01:00
Brendan Coles
4ae3bfa40d WebServer: Serve X-Frame-Options and X-Content-Type-Options HTTP headers 2021-03-06 15:04:16 +01:00
Stephan Unverwerth
87d19273bc LibGfx: Fix draw_triangle() precision issues
This fixes some precision issues in Painter::draw_triangle()
that caused the Cube demo to leave pixels empty between triangles
under certain angles.

Also adds some extra comments for clarity and early returns when
parts of the triangle do not need to be drawn.
2021-03-06 15:03:44 +01:00
Mihai Parparita
c2f3d3afe1 LibWeb: Make CSS background image painting respect destination origin and transparency
It was previously using draw_tiled_bitmap, which always aligns the
tiles with the global origin and does not respect the alpha of the
source. Switch to a new Painter::blit_tiled helper which uses
Painter::blit under the hood, which has more correct behavior.
2021-03-06 14:56:31 +01:00
speles
e97865e982 WebContent: Set correct scroll offset for PageHost painting 2021-03-06 14:54:12 +01:00
Nick Wanninger
c3f417aa1e LibM: optimized (branchless) copysign 2021-03-06 09:42:06 +01:00