Commit graph

34522 commits

Author SHA1 Message Date
Adam Hodgen
b9b24cb1c1 Base: Add <input> test page 2022-02-18 01:48:51 +01:00
Adam Hodgen
aa70422b4d LibWeb: Add <input> value sanitiztion algorithm
The value sanitiztion algorithm is defined for some states of the type
attribute, and sanitizes the value of the 'value' attribute
2022-02-18 01:48:51 +01:00
Adam Hodgen
240068a48c LibWeb: Improve display of input elements
* Display input[type=reset] as a button
* Display allother input elements as text entry boxes
* Set overflow: hidden on input elements
2022-02-18 01:48:51 +01:00
Adam Hodgen
8edade071d LibWeb: Reflect only known values for <input> element's type attribute 2022-02-18 01:48:51 +01:00
Marco Cutecchia
a9dbb52deb Kernel: Add 'RegisterState' & 'KString::try_create' stubs for aarch64
The aarch64 build was broken due to missing these two things, this
commit adds two empty stubs for them
2022-02-18 01:48:18 +01:00
Luke Wilde
b717f7065e LibWeb: Send appropriate Accept header for FrameLoader requests
According to Fetch, we must send an Accept header with the value
"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
for document, iframe and frame requests.

https://fetch.spec.whatwg.org/#concept-fetch

Required by uber.com.
2022-02-18 01:46:45 +01:00
Idan Horowitz
ead8ac8972 Kernel: Lock socket Mutex when servicing IPv4Socket ioctls
This prevents a kernel panic found in CI when m_receive_queue's size is
queried and found to be non-zero, then a different thread clears the
queue, and finally the first thread continues into the if block and
calls the queue's first() method, which then fails an assertion that
the queue's size is non-zero.
2022-02-18 02:22:12 +02:00
serenitydev
b5d891ed6a Base+LibWeb: Add test case for Workers on welcome homepage 2022-02-17 22:45:21 +01:00
Ben Abraham
ae346cff6b LibWeb: Add partially functioning Worker API
Add a partial implementation of HTML5 Worker API.
Messages can be sent from the inner context externally.
2022-02-17 22:45:21 +01:00
martinfalisse
b6c3fad078 LibGUI: JsonArrayModel update without invalidating indices
Add function to update a JsonArrayModel without invalidating it. Now,
for example in the SystemMonitor in the Network tab, a selected line
will not be deselected whenever the data is updated.
2022-02-17 20:09:47 +01:00
Sam Atkins
fd24782d85 LibWeb: Only invalidate styles if a @media rule changes match status 2022-02-17 19:56:19 +01:00
Ali Mohammad Pur
144ef3eb9f WrapperGenerator: Don't emit code for imported enumerations 2022-02-17 19:55:27 +01:00
Ali Mohammad Pur
c38163494a WrapperGenerator: Add support for IDL mixin interfaces 2022-02-17 19:55:27 +01:00
Ali Mohammad Pur
e9c76d339b Meta: Split and refactor the WrapperGenerator a bit
The single 4000-line WrapperGenerator.cpp file was proving to be a pain
to hack, and was filled with spaghetti, split it into a bunch of files
to lessen the impact of the spaghetti.
Also refactor the whole parser to use a class instead of a giant
function with a million lambdas.
2022-02-17 19:55:27 +01:00
xSlendiX
7685d53654 LibMarkdown: Add terminal color formatting
This patch adds color formatting to markdown viewed in the terminal.
This also increases readability.
2022-02-17 19:54:47 +01:00
xSlendiX
5d219ad4f7 LibMarkdown: Add additional spacing for terminal rendering
This patch adds spacing to give a sense of structure to markdown
documents viewed in the terminal. This also makes the content easier
to read.
2022-02-17 19:54:47 +01:00
xSlendiX
19b7a5fe0d man: Center "SerenityOS manual" title
This patch calculates how many spaces are needed to center the top
title of "SerenityOS manual".
2022-02-17 19:54:47 +01:00
Andreas Kling
246c31ccf6 LibWeb: Make <input type=checkbox> fire click events when clicked :^)
This makes React react to checkboxes. Apparently they ignore the
"change" event in favor of "click" on checkboxes. This is a
compatibility hack for IE8.
2022-02-17 16:33:55 +01:00
Andreas Kling
2660795bcf LibWeb: Add the HTMLInputElement.type attribute
This makes React react to change events on text <input> elements. :^)
2022-02-17 16:33:55 +01:00
Andreas Kling
5f54b8dd6c LibWeb: Fire "input" and "change" events when editing a text <input>
This isn't entirely on-spec, but will hopefully allow us to make
progress in other areas.
2022-02-17 16:33:54 +01:00
brapru
4cbce0e34c ping: Fix broken count argument error
By storing count as an Optional<size_t>, we can leverage count's empty
state to proceed with pinging indefinitely, and ensure a proper value is
passed when count does have a value.

This returns pings expected behavior to send infinite packets when a
count is not specified, stop after sending a specified count, and
disallow any count < 1.

Closes #12524
2022-02-17 09:08:40 -05:00
brapru
24da85d059 ArgsParser: Add support for Optional<size_t> 2022-02-17 09:08:40 -05:00
kleines Filmröllchen
beb29c48cb Base: Link aplay in Audio-subsystem 2022-02-17 14:45:39 +03:30
kleines Filmröllchen
01d056f794 Base: Document /dev/audio devices
This properly documents the fact that /dev/audio contains a bunch of
device's channels now, instead of being a single file.
2022-02-17 14:45:39 +03:30
networkException
3052c0578c LibVT: Properly populate context menu with open actions
We would previously overwrite m_hovered_href with tooltip texts instead
of leaving it as an url as was expected by the context menu event
handler.
2022-02-17 11:56:38 +01:00
Tim Schumacher
17f5eb558c Ports: Set the correct config.sub path for patch 2022-02-17 11:16:38 +01:00
Tim Schumacher
abb9e3e198 Ports: Set the correct config.sub path for mpc 2022-02-17 11:16:38 +01:00
Daniel Bertalan
f3923b4aea LibWeb: Use public inheritance for the RefCounted base class
I forgot about this in the previous commit, which caused a compile
error.
2022-02-17 11:16:18 +01:00
Daniel Bertalan
bf16349c5b LibWeb: Fix -Wmismatched-tags warning from Clang 2022-02-17 09:57:17 +00:00
Isak Holmstrom
41765895a8 LibCore: Make FreeBSD build SerenityOS 2022-02-17 09:26:56 +00:00
Isak Holmstrom
4f716caa33 LibCore: Add FreeBSD as OpenBSD/Apple in System.cpp & System.h 2022-02-17 09:26:56 +00:00
Isak Holmstrom
8ad9f49de3 Documentation: Change/add two pkgs in the FreeBSD instructions 2022-02-17 09:26:56 +00:00
Tim Schumacher
95f33ffbec Ports: Disable socketpair support for curl
This is currently broken in Serenity. Disable it until we figure out
why.
2022-02-16 17:13:56 -08:00
Sam Atkins
e548aab387 LibCore: Migrate ConfigFile to Core::Stream API :^)
As part of this, moved the call to `reparse()` out of the constructor
and into the factory methods, to allow the error to propagate.
2022-02-16 19:49:41 -05:00
Sam Atkins
cd0ffe5460 LibCore+Everywhere: Return ErrorOr from ConfigFile::sync()
Currently this method always succeeds, but that won't be true once we
switch to the Core::Stream API. :^)

Some of these places would ideally show an error message to the user,
since failure to save a file is significant, but let's not get
distracted right now.
2022-02-16 19:49:41 -05:00
Sam Atkins
b90dc408bd LibCore: Create ConfigFiles with an already-open File
This moves the fallible action of opening the file, from the
constructor, into the factory methods which can propagate any errors.

The wrinkle here is that failure to open a ConfigFile in read-only mode
is allowed (and expected, since the file may not exist), and treated as
if an empty file was successfully opened.
2022-02-16 19:49:41 -05:00
Sam Atkins
8260135d4d LibCore+Everywhere: Return ErrorOr from ConfigFile factory methods
I've attempted to handle the errors gracefully where it was clear how to
do so, and simple, but a lot of this was just adding
`release_value_but_fixme_should_propagate_errors()` in places.
2022-02-16 19:49:41 -05:00
Sam Atkins
1a4dd47d5f AK: VERIFY inside release_value_but_fixme_should_propagate_errors()
While the code did already VERIFY that the ErrorOr holds a value, this
was done by Variant, so the error message was just that `has<T>()` is
false. This is less helpful than I would like, especially if backtraces
are not working and this is all you have to go on. Adding this extra
VERIFY means the assertion message (`!is_error()`) is easier to
understand.
2022-02-16 19:49:41 -05:00
Sam Atkins
decdd6b61a LibGUI: Add missing LibCore/File include
This was previously included via ConfigFile.h
2022-02-16 19:49:41 -05:00
Sam Atkins
2caaebcf41 Profiler: Add missing LibCore/File include
This was previously included via ConfigFile.h
2022-02-16 19:49:41 -05:00
Sam Atkins
4d5080388a LibCore+Tests: Add SeekableStream::truncate() 2022-02-16 19:49:41 -05:00
Sam Atkins
d9fb1b8c2e LibCore: Make ConfigFile parsing work for non-null-terminated strings
This is necessary for converting it to Core::Stream.
2022-02-16 19:49:41 -05:00
Linus Groh
c7f8c20f8b LibWeb: Omit origin check for content document in FrameBox::paint()
Once we paint, it's way too late for this check to happen anyway.

Additionally, the spec's steps for retrieving the content document
assume that both the browsing context's active document and the
container's node document are non-null, which evidently isn't always the
case here, as seen by crashes on the SerenityOS 2nd and 3rd birthday
pages (I'm not sure about the details though).

Fixes #12565.
2022-02-16 22:51:25 +00:00
Lenny Maiorani
27c30ca063 Games: Use default constructors/destructors
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules

"The compiler is more likely to get the default semantics right and
you cannot implement these functions better than the compiler."
2022-02-16 22:08:55 +00:00
Andreas Kling
9521f71944 LibWeb: Support "useCapture" parameter to add/removeEventListener
This is not a complete implementation of API, since we're also supposed
to accept an options dictionary as the third argument. However, a lot of
web content uses the boolean variant, and it's trivial to support.
2022-02-16 22:21:45 +01:00
Andreas Kling
e76e8e22b5 LibWeb: Separate "event listener" from "EventListener"
I can't imagine how this happened, but it seems we've managed to
conflate the "event listener" and "EventListener" concepts from the DOM
specification in some parts of the code.

We previously had two things:

    - DOM::EventListener
    - DOM::EventTarget::EventListenerRegistration

DOM::EventListener was roughly the "EventListener" IDL type,
and DOM::EventTarget::EventListenerRegistration was roughly the "event
listener" concept. However, they were used interchangeably (and
incorrectly!) in many places.

After this patch, we now have:

    - DOM::IDLEventListener
    - DOM::DOMEventListener

DOM::IDLEventListener is the "EventListener" IDL type,
and DOM::DOMEventListener is the "event listener" concept.

This patch also updates the addEventListener() and removeEventListener()
functions to follow the spec more closely, along with the "inner invoke"
function in our EventDispatcher.
2022-02-16 22:21:45 +01:00
Andreas Kling
0e2cd5540a LibWeb: Follow HTTP 3xx redirections when loading images
This basically copies some logic from FrameLoader to ImageLoader.
Ideally we'd share this code, but for now let's just get redirected
images to show up. :^)
2022-02-16 22:21:45 +01:00
Idan Horowitz
df1670415d Kernel: Stop compiling AK::String and friends into the Kernel
Now that these are not used in the Kernel anymore, we can finally
remove them :^)
2022-02-16 22:21:37 +01:00
Idan Horowitz
cec669a89a AK: Exclude StringUtils String APIs from the Kernel
These APIs are only used by userland, and String is OOM-infallible,
so let's just ifdef it out of the Kernel.
2022-02-16 22:21:37 +01:00
Idan Horowitz
4c6a1f4db2 AK: Exclude StringView String APIs from the Kernel
These APIs are only used by userland, and String is OOM-infallible,
so let's just ifdef it out of the Kernel.
2022-02-16 22:21:37 +01:00