Commit Graph

4608 Commits

Author SHA1 Message Date
Jean-Baptiste Boric
295e89af04 LibC: Fix sigsetjmp on x86_64
Registers were clobbered, offset values into __jmp_buf were wrong...
2021-08-26 00:54:23 +02:00
Jean-Baptiste Boric
c87aa6d908 LibC: Fix sigsetjmp on i686
Calling sigprocmask() through the PLT requires setting the ebx register
to the address of the global offset table, otherwise chaos ensues. Also
the value of the ecx register was assumed to be preserved across that
function call despite the fact that it is caller-saved in the x86
calling convention.
2021-08-26 00:54:23 +02:00
Ali Mohammad Pur
04e3965b09 LibWasm: Use Operators::BitShiftRight for i64.shru
Using a left-shift operator for a right shift operation is not exactly
the most correct action :P
2021-08-26 00:51:30 +02:00
Jesse Buhagiar
924d890bfe LibGL: Implement fog effect in Software Rasterizer
We support three of the possible fog modes, EXP, EXP2 and LINEAR.
2021-08-25 23:50:54 +04:30
Jesse Buhagiar
d73cc3d0eb LibGL: Implement glFogi 2021-08-25 23:50:54 +04:30
Jesse Buhagiar
f55d2a22af LibGL: Implement glFogf 2021-08-25 23:50:54 +04:30
Jesse Buhagiar
7f1cd54b80 LibGL: Implement glFogfv
This currently just sets the fog colour in the rasterizer.
2021-08-25 23:50:54 +04:30
Karol Kosek
ffa7da0ca5 LibWeb: Handle CSS "ch" length unit (mostly)
This isn't 100% spec complaint, as it should use glyph_height()
depending on what the value of the writing-mode is, but we haven't
implemented it yet, so I think it'll be good enough for now.

This can be tested in https://wpt.live/css/css-values/ch-unit-008.html
Other css-unit tests fail as:
- 001 shows an issue related to a renderer (looks to me like you can't
  pass a width and height property to a span -- adding `display: block`
  to it passes the test),
- 002-004 and 009-012 use mentioned writing-mode,
- 016-017 loads custom fonts, which we also don't support (yet).
2021-08-25 17:55:53 +02:00
Sam Atkins
b92a6d6542 LibWeb: Implement CSS unset builtin value
This is equivalent to `initial` or `inherit`, depending on if the
property is inherited by default.
2021-08-25 12:14:34 +02:00
Sam Atkins
3296fd70b3 LibWeb: Intercept CSS initial/inherit values in StyleProperties
When property() previously would have returned an InitialStyleValue, we
now look up what the initial value would be, and return that instead.

We also intercep 'inherit', but inheritance is not implemented yet so we
just return nothing.

This does cause a regression on Acid2: The eyes no longer appear, and I
am not sure why. :^(
2021-08-25 12:14:34 +02:00
Sam Atkins
8995839e3f LibWeb: Generate property_initial_value() function from Properties.json
Since we have initial-value data in Properties.json already, it makes
sense to use that instead of needing to duplicate the same information
in ComputedValues.h

However, converting a StyleValue to the kind of types used in
InitialValues is non-trivial. So this may or may not actually be useful.
2021-08-25 12:14:34 +02:00
Sam Atkins
38ee69adfa LibWeb: Add StyleValue to Forward.h 2021-08-25 12:14:34 +02:00
Sam Atkins
543550d1df LibWeb: Quote all initial values in Properties.json
This is in preparation for parsing these into StyleValues automatically.
Having them all be Strings makes the generation code simpler.
2021-08-25 12:14:34 +02:00
Sam Atkins
6d39f4342d LibWeb: Use single shared instance of Inherit/InitialStyleValue
These are always the same, so we can avoid allocating them repeatedly
and just use a single instance of each. :^)
2021-08-25 12:14:34 +02:00
Sam Atkins
d2342caf42 LibWeb: Parse CSS builtins before other values
These are straightforward to parse, so doing them first saves
potentially expensive calculations inside parse_foo_value() functions.
2021-08-25 12:14:34 +02:00
Brian Gianforcaro
77d8a65498 LibJS: Fix incorrect Lexer VERIFY when parsing Unicode characters
This bug was discovered via OSS fuzz, it's possible to fall through
to this assert with a char_size == 1, so we need to account for that
in the VERIFY(..).

Repro test case can be found in the OSS fuzz bug:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=37296
2021-08-25 09:21:23 +01:00
Ralf Donau
a501b903b5 LibCore: Set file offset in ConfigFile::sync 2021-08-24 18:17:09 +02:00
Andreas Kling
fd922cf92f LibWeb+WebContent: Add a simple API for running arbitrary JavaScript
This patch adds OutOfProcessWebView::run_javascript(StringView).
This can be used by the OOPWV embedder to execute arbitrary JavaScript
in the top-level browsing context on the WebContent process side.
2021-08-24 16:56:42 +02:00
Andreas Kling
dfa9dcca98 LibWeb+Browser: Remove unnecessary InProcessWebView.h includes 2021-08-24 16:37:28 +02:00
davidot
c108c8ff24 LibJS: Disallow yield expression correctly in formal parameters
And add ZERO WIDTH NO BREAK SPACE to valid whitespace.
2021-08-24 07:42:37 +01:00
davidot
7bcffd1b6a LibJS: Fix some small remaining issues with parsing unicode escapes
Added a test to ensure the behavior stays the same.
We now throw on a direct usage of an escaped keywords with a specific
error to make it more clear to the user.
2021-08-24 07:42:37 +01:00
Linus Groh
6ce05026b4 LibJS: Implement Temporal.ZonedDateTime.prototype.toPlainMonthDay() 2021-08-24 01:53:30 +02:00
Linus Groh
ef581be4ec LibJS: Implement Temporal.ZonedDateTime.prototype.toPlainYearMonth() 2021-08-24 01:53:30 +02:00
Linus Groh
fc58f93734 LibJS: Implement Temporal.PlainDateTime.prototype.toPlainMonthDay() 2021-08-24 01:53:30 +02:00
Linus Groh
5573efa3bd LibJS: Implement Temporal.PlainDateTime.prototype.toPlainYearMonth() 2021-08-24 01:53:30 +02:00
Linus Groh
ad427f85ca LibJS: Implement Temporal.PlainDateTime.from() 2021-08-23 20:54:52 +01:00
Linus Groh
573587b83a LibJS: Fix logic error in RegulateISODate 2021-08-23 20:54:52 +01:00
Sam Atkins
226fe4b57d LibWeb: Paint inspection outline for InlineNodes :^)
This iterates the fragments of the containing block, and paints their
outlines if they are descendants of the InlineNode.

If multiple fragments are adjacent, eg:

```html
<span><b>Well</b> hello <i>friends!</i></span>
```

...then we get a double-thick outline between "Well", " hello " and
"friends!", but we can come back to this after we implement
non-rectangular outlines for the `outline` CSS property.
2021-08-23 15:59:29 +02:00
Sam Atkins
8eef509c1b LibWeb: Add DOMTreeModel::index_for_node()
This is needed for telling the DOM Inspector to select a given Node.
2021-08-23 15:59:29 +02:00
Maciej Zygmanowski
3597b6eb9d WindowServer+LibGfx: Move CursorParams to LibGfx
They will be used by MouseSettings in the next commit.
2021-08-23 01:41:53 +02:00
Timothy Flynn
4f186a9a1f LibJS: Implement Promise.race on the Promise constructor 2021-08-23 00:01:46 +01:00
Timothy Flynn
949f294444 LibJS: Implement Promise.allSettled on the Promise constructor 2021-08-23 00:01:46 +01:00
Timothy Flynn
4dffa40a8d LibJS: Implement Promise.any on the Promise constructor 2021-08-23 00:01:46 +01:00
Timothy Flynn
98d8a858cd LibJS: Set the function names for the resolve, reject, and executor
These should all have a name with an empty string. Not only does test262
verify this, but it also verifies that (for the executor) the name
property is defined after the length property.
2021-08-23 00:01:46 +01:00
Timothy Flynn
5b303721e0 LibJS: Generalize PerformPromiseAll common functionality
PerformPromiseAll, PerformPromiseAny, PerformPromiseAllSettled, etc, all
have very similar iteration loops. To avoid duplicating this rather
large block of code, extract the common functionality into a separate
method.
2021-08-23 00:01:46 +01:00
Timothy Flynn
417523507e LibJS: Generalize PromiseAllResolveElementFunction common functionality
The element-resolving functions on the Promise constructor are all very
similar. To prepare for more of these functions to be implemented, break
out common parts into a base class.
2021-08-23 00:01:46 +01:00
Andreas Kling
bcd2025311 Everywhere: Core dump => Coredump
We all know what a coredump is, and it feels more natural to refer to
it as a coredump (most code already does), so let's be consistent.
2021-08-23 00:02:09 +02:00
Linus Groh
969aee2022 LibJS: Add missing builtin calendar check to ParseTemporalCalendarString
See: https://github.com/tc39/proposal-temporal/commit/48b11d6
2021-08-22 21:20:00 +01:00
Andrew January
9a4c1c019a LibGUI: Make Ctrl+Shift+Right select text
Ctrl+Shift+Left would add the word before the cursor to the selection,
but for some reason Ctrl+Shift+Right didn't add the word after the
cursor to the selection.
2021-08-22 15:31:27 +02:00
Maciej Zygmanowski
7237972022 LibC: Support getsignalbyname() with full signal name
This allows e.g. to use `kill` with names like -SIGKILL, not only -KILL.
2021-08-22 15:23:25 +02:00
Karol Kosek
219206725b LibGUI: Always resize the mapping rows when sorting
Prior this change, creating a file or directory
on Desktop crashed the desktop instance of FileManager.

Closes: #9560
2021-08-22 10:29:17 +02:00
Peter Elliott
ee0c6e1b6d LibC: Add <sys/poll.h> as an alias for <poll.h>
<poll.h> was originally <sys/poll.h> and some old software like X11
still uses the old path.
2021-08-22 10:29:06 +02:00
Peter Elliott
39a77559f1 Kernel+LibC: Implement FIONREAD ioctl
FIONREAD gets the number of bytes availible to read from a file
descriptor without blocking. I only implemented it for regular files and
sockets
2021-08-22 10:29:06 +02:00
Peter Elliott
db92e66902 LibC: Make <netinet/in.h> more POSIX compliant
1. Move htonl() etc. from <arpa/inet.h> to <netinet/in.h> (which
   <arpa/inet.h> includes).

   The htonl(), htons(), ntohl(), and ntohs() functions shall be
   available as described in <arpa/inet.h>.  Inclusion of the
   <netinet/in.h> header may also make visible all symbols from
   <arpa/inet.h>.

   - POSIX

2. Define IN6_IS_ADDR_LOOPBACK() and IN6_IS_ADDR_V4MAPPED()
2021-08-22 10:29:06 +02:00
Peter Elliott
f16aba405f LibC: Add LINK_MAX and _PC_LINK_MAX
LINK_MAX was set arbitrarily to 4096, this is not an actual system
limit.
2021-08-22 10:29:06 +02:00
Peter Elliott
d9ecb3ecfa LibC: Modify fd_set to be compatible with X/OPEN
For some reason X/OPEN requires that fd_set has a field fds_bits. Xproto
requires either fds_bits or _fds_bits to be present, so the field 'bits'
was renamed 'fds_bits'
2021-08-22 10:29:06 +02:00
networkException
acde7d12b0 Everywhere: Rename get in ConfigFile::get_for_{lib,app,system} to open
This patch brings the ConfigFile helpers for opening lib, app and system
configs more inline with the regular ConfigFile::open functions.
2021-08-22 01:32:25 +02:00
networkException
938051feb8 Everywhere: Use Core::ConfigFile::AllowWriting::Yes to allow writing 2021-08-22 01:32:25 +02:00
networkException
54bbe52b51 LibCore: Convert ConfigFile to east const 2021-08-22 01:32:25 +02:00
networkException
2ea2d026c2 LibCore: Support using a file descriptor for opening ConfigFile
This patch adds support for opening a ConfigFile using a file
descriptor rather than trying to open a the file by name directly.

In contrast to the previous implementation, ConfigFile now always keeps
a reference to an open File and does not reopen it for writing.

This requires providing an additional argument to open functions if a
file gets opened based on its name and the user of the api intends to
write to the file in the future.
2021-08-22 01:32:25 +02:00