Commit graph

23779 commits

Author SHA1 Message Date
Sam Atkins
06cd418770 LibWeb: Convert QualifiedStyleRule to a RefPtr type in new Parser 2021-07-11 23:19:56 +02:00
Sam Atkins
f690259a42 LibWeb: Add new CSS attribute match types to new parser 2021-07-11 23:19:56 +02:00
Sam Atkins
7fefe34797 LibWeb: Add remaining CSS AttributeMatchTypes
This adds:
- ContainsString     [att*=val]
- StartsWithSegment  [att|=val]
- StartsWithString   [att^=val]
- EndsWithString     [att$=val]

Renamed AttributeMatchType::Contains to ::ContainsWord for clarity.
2021-07-11 23:19:56 +02:00
Sam Atkins
29d78bba4b LibWeb: Use StyleComponentValueRules for StyleBlockRule's values
Noticed while doing this that attribute selectors have two different
ways of saying "starts with", and so AttributeMatchType::StartsWith
needs a better name. But I'll change that when I add the missing
types.

These class names are a mouthful to fit in a commit message. :^)
2021-07-11 23:19:56 +02:00
Sam Atkins
89bfde29dc LibWeb: Convert some CSS parser *Rule classes to using pointers
Previously these were all passed around by value, but some of them
(StyleComponentValueRule and StyleBlockRule) want to include each
other as fields, so this had to change.
2021-07-11 23:19:56 +02:00
Sam Atkins
a558916e1f LibWeb: Make CSS selector parsing use StyleComponentValueRules
Also added some pseudo-classes that were handled in the deprecated
parser:
- :disabled
- :enabled
- :checked
- :nth-child
- :nth-last-child
- :not
2021-07-11 23:19:56 +02:00
Sam Atkins
f7c79de0c5 LibWeb: Add convenience methods to CSS::Parser::Token
Some of these will be removed later, when we move to using is()
exclusively.
2021-07-11 23:19:56 +02:00
Sam Atkins
d6b4022b58 LibWeb: Make CSS::QualifiedStyleRule's prelude StyleComponentValueRule 2021-07-11 23:19:56 +02:00
Linus Groh
54e1180f61 LibJS: Uncomment Number.isInteger() tests that now pass :^) 2021-07-11 22:03:04 +01:00
Linus Groh
1856400547 LibJS: Uncomment Object.{freeze,seal}() tests that now pass :^) 2021-07-11 21:58:14 +01:00
Ali Mohammad Pur
dfb7e716f7 LibJS: Use expected() instead of syntax_error("Expected ...") 2021-07-11 21:41:54 +01:00
Ali Mohammad Pur
049e210cfa LibJS: Rework Identifier parsing to match the spec more closely 2021-07-11 21:41:54 +01:00
Ali Mohammad Pur
77a5144264 LibJS: Add support for binding patterns in catch clauses
`try { ... } catch({a=foo}) {}` is valid, and now we parse and evaluate
it correctly :^)
2021-07-11 21:41:54 +01:00
Ali Mohammad Pur
1a9518ebe3 LibJS: Implement parsing and evaluation for AssignmentPatterns
e.g. `[...foo] = bar` can now be evaluated :^)
2021-07-11 21:41:54 +01:00
Ali Mohammad Pur
7fc6cd6b20 LibJS: Allow 'name = value' in object literals as the spec does
Currently, these are _always_ a syntax error, future commits will make
it valid in certain contexts.
2021-07-11 21:41:54 +01:00
Ali Mohammad Pur
7dae25eceb LibJS: Fix computed property ending token in binding pattern parsing
The syntax is supposed to be '[expression]', not '[expression['.
2021-07-11 21:41:54 +01:00
Ali Mohammad Pur
b5b84029ab LibJS: Treat default parameter values as being in function context
e.g. `new.target` should be permitted in
`function foo(x = new.target) {}`.
2021-07-11 21:41:54 +01:00
Jelle Raaijmakers
0f35912bd7 TableView: Do not select input on keydown
In the Spreadsheet app, selecting a cell and typing something (like
"1") would create an empty editing delegate, set "1" as its value and
immediately select the entire contents of the text box. If your goal
was to type "123", that "1" was selected and will be replaced by "23".

This changes the behavior of TableView to not select the editing
delegate's contents if its creation was a result of a keydown event.
2021-07-11 22:07:57 +02:00
Gunnar Beutner
bc5d50e78b Meta: Use gl=off for QEMU by default 2021-07-11 22:07:47 +02:00
Gunnar Beutner
8e4978fe04 Meta: Use the SDL backend for QEMU on Windows 2021-07-11 22:07:47 +02:00
Andreas Kling
2dfdaafb23 Kernel: Use "new (nothrow)" for SharedInodeVMObject 2021-07-11 21:56:26 +02:00
Brian Gianforcaro
425195e93f Kernel: Standardize the header include style to 'include <Kernel/...>'
This is the overwhelming standard in the project, but there were some
cases in the kernel which were not following it, lets fix those cases!
2021-07-11 21:37:38 +02:00
Brian Gianforcaro
6f408e7f0d Kernel: Remove unused header includes in root kernel tree 2021-07-11 21:37:38 +02:00
Brian Gianforcaro
28cf9ffe90 Kernel: Remove unused header includes in Bus subtree 2021-07-11 21:37:38 +02:00
Brian Gianforcaro
187a8f6896 Kernel: Remove unused header includes in ACPI subtree 2021-07-11 21:37:38 +02:00
Brian Gianforcaro
661809408e Kernel: Remove unused header includes in Heap subtree 2021-07-11 21:37:38 +02:00
Brian Gianforcaro
abe72ede7a Kernel: Remove unused header includes in Graphics subtree 2021-07-11 21:37:38 +02:00
Brian Gianforcaro
9814082b5e Kernel: Remove unused header includes in Interrupts subtree 2021-07-11 21:37:38 +02:00
Brian Gianforcaro
8211aee4b5 Kernel: Remove unused header includes in TTY subtree 2021-07-11 21:37:38 +02:00
Brian Gianforcaro
e18be7f5c7 Kernel: Remove unused header includes in Storage subtree 2021-07-11 21:37:38 +02:00
Brian Gianforcaro
da665077ce Kernel: Remove unused header includes in Arch subtree 2021-07-11 21:37:38 +02:00
Brian Gianforcaro
1c43836990 Kernel: Remove unused header includes in FileSystem subtree 2021-07-11 21:37:38 +02:00
Brian Gianforcaro
5743561d32 Kernel: Remove unused header includes in Net subtree 2021-07-11 21:37:38 +02:00
Brian Gianforcaro
ea238e7ac3 Kernel: Remove unused header includes in Devices subtree 2021-07-11 21:37:38 +02:00
Brian Gianforcaro
b1740e410b Kernel: Remove unused header includes in Time subtree 2021-07-11 21:37:38 +02:00
Brian Gianforcaro
9044e21ed4 Kernel: Remove unused header includes in VM subtree 2021-07-11 21:37:38 +02:00
x-yl
642aa65310 Meta: Only try to use SDL when there are multiple displays
SDL brings with it an annoying issue whereby trying to resize the window
before Serenity starts up prevents it from automatically resizing to fit
the screen.

This patch makes the previous behavior (i.e using the GTK backend) the
default unless SERENITY_SCREENS is greater than 1.
2021-07-11 21:16:56 +02:00
Liav A
a8c35b6a93 Kernel: Fix condition on whether to initialize a display adapter or not 2021-07-11 21:16:33 +02:00
Liav A
b882e5ff6b Kernel/Graphics: Move Intel graphics related code to a separate folder 2021-07-11 21:16:33 +02:00
Karol Kosek
9d36369c58 SoundPlayer: Show the context menu right under the cursor
The context menu used the mouse position by window,
which resulted in a pop-up menu in the upper left corner of the screen.
2021-07-11 21:15:56 +02:00
Andrew Kaster
da0095855e Kernel: Print end-inclusive ranges in MemoryManager initialization
This brings the physical and virtual addresses printed to dmesg more in
line with inclusive ranges printed elsewhere in the project.
2021-07-11 19:42:00 +02:00
Andrew Kaster
2ca1193d9a Userland+Tests: Convert test_io to be LibTest based
Add a few extra tests as well, to make sure we don't have any future
TmpFs regressions.
2021-07-11 19:42:00 +02:00
Andrew Kaster
3f0dcd63dc Kernel: Fix TmpFS resize behavior around INT32_MAX for 32-bit systems
We need some overflow checks due to the implementation of TmpFS.
When size_t is 32 bits and off_t is 64 bits, we might overflow our
KBuffer max size and confuse the KBuffer set_size code, causing a VERIFY
failure. Make sure that resulting offset + size will fit in a size_t.
Another constraint, we make sure that the resulting offset + size will
be less than half of the maximum value of a size_t, because we double
the KBuffer size each time we resize it.
2021-07-11 19:42:00 +02:00
Andrew Kaster
4cc75501d7 Utilities+Tests: Convert test_efault to be LibTest based
This test exposed a kernel panic in is_user_range calculations, so let's
convert it to be a LibTest test so we can prevent regressions in mmap,
the page allocator, and the memory manager.
2021-07-11 19:42:00 +02:00
Andrew Kaster
578d45b480 Kernel: Create and use USER_RANGE_CEILING
We had an inconsistency in valid user addresses. is_user_range() was
checking against the kernel base address, but previous changes caused
the maximum valid user addressable range to be 32 MiB below that.

This patch stops mmap(MAP_FIXED) of a range between these two bounds
from panic-ing the kernel in RangeAllocator::allocate_specific.
2021-07-11 19:42:00 +02:00
Andrew Kaster
ab196b484a Kernel: Add formatter for Kernel::Range
This is very useful when debugging memory allocation in the kernel
2021-07-11 19:42:00 +02:00
Andreas Kling
f244a25f71 Kernel: Rename VMObject::clone() => try_clone()
And fix an unsafe dereference in SharedInodeVMObject::try_clone()
to make it OOM-safe.
2021-07-11 19:09:02 +02:00
Andreas Kling
d85bce57b3 Kernel: Rename Region::create_kernel_only() => try_create_kernel_only() 2021-07-11 18:59:41 +02:00
Andreas Kling
cd7a49b90d Kernel: Make Region splitting OOM-safe
Region allocation failures during splitting are now propagated all the
way out to where we can return ENOMEM for them.
2021-07-11 18:52:27 +02:00
Andreas Kling
cac557eee0 Kernel: Make Region::try_create_user_accessible() OOM-safe
Previously we would simply assume that Region allocation always
succeeded. There is still one such assumption when splitting user
regions inside a Space. That will be dealt with in a separate commit.
2021-07-11 18:11:31 +02:00