Commit Graph

9881 Commits

Author SHA1 Message Date
Brian Gianforcaro
332f96e7ca AK: Add case insensitive String::ends_with support
FileSystemPath::has_extension was jumping through hoops and allocating
memory to do a case insensitive comparison needlessly. Extend the
existing String::ends_with method to allow the caller to specify the
case sensitivity required.
2020-05-26 13:17:19 +02:00
Brian Gianforcaro
8e4b858b3f AK: Move String::ends_with implementation to StringUtils
Centralizing so it can be used by other string implementations
2020-05-26 13:17:19 +02:00
Brian Gianforcaro
d98e743568 Meta: Add github link to the man pages from ReadMe.md
Closes #2039
2020-05-26 13:14:37 +02:00
Luke
f9f7cb4583 LibJS: Add Array.prototype.splice
Adds splice to Array.prototype according to the specification:
https://tc39.es/ecma262/#sec-array.prototype.splice
2020-05-26 12:47:11 +02:00
Angel
6137475c39 Kernel: fix assertion on readlink() syscall
The is_error() check on the KResultOr returned when reading the link
target had a stray ! operator which causes link resolution to crash the
kernel with an assertion error.
2020-05-26 12:45:01 +02:00
Andreas Kling
8ff4ebb589 LibWeb: Add Element.getAttribute() and Element.setAttribute() :^) 2020-05-26 12:27:10 +02:00
Andreas Kling
b5788594f9 PixelPaint: Let Layer track whether it's selected or not
This will simplify a lot of code that keeps getting more confusing.
2020-05-26 10:18:03 +02:00
Andreas Kling
18d68c8c94 PixelPaint: Add selection functionality to the LayerListWidget
Now we can get rid of the old table view and with it the LayerModel.
2020-05-26 10:18:03 +02:00
Andreas Kling
e4b11a23b7 PixelPaint: Allow reordering layer by dragging them in LayerListWidget
This is rather cool! :^)
2020-05-26 10:18:03 +02:00
Andreas Kling
dc3de47b03 PixelPaint: Have layers and images send out notifications on changes
We use this to automatically update the thumbnail in LayerListWidget
when you draw into a layer. We also use it to repaint the ImageEditor
when the image changes somehow. :^)
2020-05-26 10:18:03 +02:00
Andreas Kling
de85cd0907 PixelPaint: Start working on a custom layer list widget
Instead of using a TableView to show the layer stack, let's build a new
custom widget for this purpose and give it some neat features!

This patch also introduces an ImageClient interface for Image to notify
interested parties about things happening. The LayerListWidget is the
first ImageClient and listens for "layer added" and "layer removed"
notifications. :^)
2020-05-26 10:18:03 +02:00
FalseHonesty
d2b493b74e Browser: Add output styles to JS source printed in the console
This patch uses the new JS::MarkupGenerator to stylize all of the
source code and runtime values printed in the console's output panel.
This also does away with the Console's global style sheet, as all
styling is handled by the MarkupGenerator and the System Palette.
2020-05-26 10:17:50 +02:00
FalseHonesty
941b028ca3 LibJS: Create JS to HTML markup generator
The new JS::MarkupGenerator class can convert both a JS source string
and a JS Runtime Value into properly formatted HTML using the new
LibWeb System Palette css color values.

It makes more sense for this JS -> HTML process to occur in LibJS
so that it can be used elsewhere, namely Markdown code block syntax
highlighting. It also means the Browser can worry less about LibJS
implementation details.
2020-05-26 10:17:50 +02:00
FalseHonesty
b352a6b59d LibWeb: Implement vendor specific CSS color style for System Palette
Add "-libweb-palette-foo-bar" CSS color properties to allow CSS to
style itself using the currently selected System Theme.
2020-05-26 10:17:50 +02:00
Brian Gianforcaro
6a74af8063 Kernel: Plumb KResult through FileDescription::read_entire_file() implementation.
Allow file system implementation to return meaningful error codes to
callers of the FileDescription::read_entire_file(). This allows both
Process::sys$readlink() and Process::sys$module_load() to return more
detailed errors to the user.
2020-05-26 10:15:40 +02:00
Brian Gianforcaro
c459e4ecb2 Kernel: Clang format file system in prep for changes. 2020-05-26 10:15:40 +02:00
etaIneLp
82d0352a67 Kernel: Unmap first MB after jumping above 3GB 2020-05-26 09:50:12 +02:00
etaIneLp
826dc94187 Kernel: Create page structures correctly in boot.s 2020-05-26 09:50:12 +02:00
Linus Groh
4e607192c7 LibLine: Don't add empty lines to history 2020-05-26 00:50:49 +02:00
Linus Groh
67b742bf32 LibWeb: Add document.querySelector() 2020-05-26 00:12:20 +02:00
Hüseyin ASLITÜRK
6e505b853e Base: Add more characters to Katica and Csilla
Symbols for Latin-1 Unicode completed for Katica and Csilla Thin fonts.
2020-05-26 00:11:26 +02:00
AnotherTest
42114c5784 Shell: Refuse to be suspended with ^Z
Suspending the shell while interacting with it is pretty weird, so let's
just disallow this behaviour.
2020-05-25 21:36:51 +02:00
AnotherTest
2814b5a918 Terminal: Handle fork error by whining about it 2020-05-25 21:36:51 +02:00
AnotherTest
bc9013f706 LibLine: Change get_line to return a Result<String, Error>
This fixes a bunch of FIXME's in LibLine.
Also handles the case where read() would read zero bytes in vt_dsr() and
effectively block forever by erroring out.

Fixes #2370
2020-05-25 21:36:51 +02:00
Andreas Kling
1e30ef239b LibWeb: Start fleshing out the "in table" parser insertion mode 2020-05-25 20:30:34 +02:00
Andreas Kling
f62a8d3b19 LibWeb: Handle some more parser inputs in the "in head" insertion mode 2020-05-25 20:16:48 +02:00
Andreas Kling
50265858ab LibWeb: Add a PARSE_ERROR() macro to the new HTML parser
Unless otherwise stated, we shouldn't stop parsing just because there's
a parse error, so let's allow ourselves to continue.

With this change, we can now tokenize and parse the ACID1 test. :^)
2020-05-25 20:02:27 +02:00
Andreas Kling
406fd95f32 LibWeb: Flesh out the remaining DOCTYPE related tokenizer states
We can now parse public and system identifiers! Not super useful, but
at least we can do it :^)
2020-05-25 19:51:23 +02:00
Andreas Kling
556a6eea61 LibWeb: Checking for "DOCTYPE" should be case insensitive in tokenizer 2020-05-25 19:51:23 +02:00
Andreas Kling
1df2a3d8ce LibWeb: Use String::is_one_of() a bunch in the HTML parser 2020-05-25 19:51:23 +02:00
Andreas Kling
5e77517e6e AK: Add String::is_one_of(...)
This allows you to compare a string against an arbitrary number of
other strings with a single call.
2020-05-25 19:51:23 +02:00
AnotherTest
21a574f6d2 Eyes: Resize the window based on the number of eyes 2020-05-25 19:06:06 +02:00
AnotherTest
46dacbfb3e Eyes: Correctly calculate the eye bounds for arbitrary number of eyes 2020-05-25 19:06:06 +02:00
Linus Groh
07af2e6b2c LibJS: Implement basic for..in and for..of loops 2020-05-25 18:45:36 +02:00
Linus Groh
c378a1c730 HexEditor: Fix "Selected Bytes" count for backwards selection 2020-05-25 18:14:25 +02:00
Linus Groh
fd7cbb5389 LibWeb: Add navigator.language and navigator.languages
Hardcoded to "en-US" and ["en-US"] respectively.
2020-05-25 15:15:31 +02:00
Sergey Bugaev
c1a26f0b35 WindowServer: Don't crash when minimizing Eyes
Or any other window that globally tracks the mouse cursor.
2020-05-25 12:38:37 +02:00
Sergey Bugaev
431bbde6df Kernel: Fix returning random children from waitid(WNOHANG)
In case WNOHANG was specified, we want to always set should_unblock to
true (which we do since commit 4402207b98), not
wait_finished -- the latter causes us to immediately return this child to our
caller, which is not what we want -- perhaps we should return another child
which has actually exited or stopped, or nobody at all.

To avoid confusion, also rename wait_finished to fits_the_spec.

This fixes service keepalive functionality in SystemServer.
2020-05-25 12:38:37 +02:00
FalseHonesty
2c2ce5be64 Browser: Add output styles to values printed in the console
This patch adds spans around most of the console's output, allowing
for a global document stylesheet to customize the highlighting of
the console's output. It also adds some basic styling for values
like strings, numbers, and arrays using the system Palette.

Note: This patch simply adds support for highlighting output values,
the lines of JS code printed to console are still unformatted.
2020-05-25 11:33:52 +02:00
FalseHonesty
4ad891a078 LibGUI: Add flag to TextDocument's word break locator methods
TextDocument::first_word_break_before was refactored out to be able
to be used in multiple places throughout the project. It turns out
that its behaviour needs to be slightly different depending on
where its called, so it now has a start_at_column_before flag
to decide which letter it "thinks" was clicked.
2020-05-25 11:33:39 +02:00
Andreas Kling
21b1aba03b LibWeb: Add missing copyright header 2020-05-25 00:25:33 +02:00
AnotherTest
b4ca563637 Shell: Warn the user about active jobs on exit
And make sure that the user means to exit and kill current jobs before exiting.
2020-05-25 00:08:32 +02:00
AnotherTest
c23c354779 Shell: Parse and correctly evaluate 'command &' and 'command &&'
This commit adds the InBackground and ShortCircuitOnFailure attributes
to commands, which respectively cause the command to be run in the
background, and abort the command chain with exit status != 0.
2020-05-25 00:08:32 +02:00
AnotherTest
143be7234f Shell: Kill existing jobs when exiting 2020-05-25 00:08:32 +02:00
AnotherTest
0d39418b0b Shell: Add the `disown' shell builtin 2020-05-25 00:08:32 +02:00
Andreas Kling
4cbe202d2c LibWeb: Finally parse enough that we can actually handle welcome.html!
We made it, at last! What a long journey this was. :^)
2020-05-24 23:54:22 +02:00
Andreas Kling
65d8d5e83e LibWeb: Yet more work towards parsing www/welcome.html :^) 2020-05-24 23:54:22 +02:00
Andreas Kling
45da08a1e6 LibWeb: A whole bunch of work towards spec-compliant <script> elements
This is still very unfinished, but there's at least a skeleton of code.
2020-05-24 23:54:22 +02:00
Andreas Kling
3a30180e1e LibWeb: Add HTMLScriptElement to the forwarding header 2020-05-24 23:54:22 +02:00
Andreas Kling
128eaf9295 LibWeb: Add some helpers to the DOM Node class
This patch adds the following things needed by the HTML spec:

- Node::child_text_content()
- Node::is_connected()
- Node::root()
2020-05-24 23:54:22 +02:00