Commit Graph

33184 Commits

Author SHA1 Message Date
mjz19910
a9fb34ca6f LibCore: Add ErrorOr wrapper for adjtime 2022-01-21 01:52:22 +01:00
Luke Wilde
5ac57db5e9 LibWeb: Don't match the node querySelector(All) was called on
In querySelector(All)'s use of "Match a Selector Against a Tree", it
passes in the node the function was called on as the "optional scoping
root", which causes it and the nodes which aren't descendants of it 
to be excluded from the list of possible nodes to match against.
For us, this is the equivalent of using the non-inclusive variant of
`for_each_in_subtree_of_type`.

This was tripping up the node re-ordering logic of d3 and would cause
it to try and reinsert nodes into their parent, causing an exception
to be thrown.

Note that this should be shadow-including, but we don't currently have
shadow-including tree traversal as per https://dom.spec.whatwg.org/#concept-shadow-including-tree-order

https://drafts.csswg.org/selectors-4/#match-a-selector-against-a-tree
https://dom.spec.whatwg.org/#scope-match-a-selectors-string
2022-01-20 22:18:07 +00:00
Idan Horowitz
29cb7316d0 LibJS: Implement ECMA-402 compliant TypedArray.prototype.toLocaleString 2022-01-20 12:50:37 +00:00
sin-ack
c63feb4f09 Tests: Add should_error_when_connection_fails test to TestLibCoreStream
This test makes sure that Socket classes such as TCPSocket properly
return an error when connection fails rather than crashing or creating
an invalid object.
2022-01-20 10:40:51 +01:00
sin-ack
ab36fb7a23 LibCore: Use Core::System and Error::from_syscall in Stream classes
This makes what caused a failure more obvious.
The use of Core::System additionally allows us to remove a lot of
boilerplate code from Stream classes.
2022-01-20 10:40:51 +01:00
sin-ack
301f4c469f LibCore: Implement Core::System::lseek 2022-01-20 10:40:51 +01:00
sin-ack
4d2e3de94c LibCore: Don't manually close the fd when connection fails in sockets
This is wrong because we have already set the fd in the
PosixSocketHelper, and the destructor of the respective Socket class
will close the fd for us. With the manual closing of the fd, we attempt
to close the same fd twice which results in a crash.

Thanks to stelar7 for noticing this bug.
2022-01-20 10:40:51 +01:00
sin-ack
2d4261df49 Tests: Fix the TestLibCoreStream local_socket_write test
Accidentally regressed this test during the Core::LocalServer refactor,
and didn't catch it since TestLibCoreStream is disabled in the CI right
now. We have to wait for some data to become available, as pending_bytes
will immediately return 0 and a 0-sized read immediately returns.
2022-01-20 10:39:54 +01:00
Mustafa Quraish
ee74aafdca FileSystemAccessClient: Remove old API returning file descriptors :^)
Since all users of the old API are now removed, this commit removes all
the methods that returned raw file descriptors, in favor of returning
`ErrorOr<NonnullRefPtr<Core::File>`.
2022-01-20 10:39:12 +01:00
Mustafa Quraish
bba32de857 SpreadSheet: Use FileSystemAccessClient::try_* APIs 2022-01-20 10:39:12 +01:00
Mustafa Quraish
ca2c7dced5 3DFileViewer: Use FileSystemAccessClient::try_* APIs
This commit also removed the redundant `filename` parameter from
`GLContextWidget::load_file`, since the filename is already stored
within the file itself.
2022-01-20 10:39:12 +01:00
Mustafa Quraish
abb16683c9 ThemeEditor: Use FileSystemAccessClient::try_* APIs 2022-01-20 10:39:12 +01:00
Mustafa Quraish
f674102447 TextEditor: Use FileSystemAccessClient::try_* APIs 2022-01-20 10:39:12 +01:00
Mustafa Quraish
effb19f996 PDFViewer: Use FileSystemAccessClient::try_* APIs 2022-01-20 10:39:12 +01:00
Mustafa Quraish
1c3e93c6e0 PixelPaint: Use FileSystemAccessClient::try_* APIs 2022-01-20 10:39:12 +01:00
Mustafa Quraish
aae96af812 HexEditor: Use FileSystemAccessClient::try_* APIs 2022-01-20 10:39:12 +01:00
Mustafa Quraish
0c98e553e8 FileSystemAccessClient: Add try_* variants returning Core::File
The current implementation is a bit of a hack since we also want to keep
around the previous variants for now, but will be cleaned up later once
all applications have been ported to the new API.
2022-01-20 10:39:12 +01:00
Sam Atkins
94f2508519 CrashReporter: Don't crash when investigating a HackStudio crash
Previously when opening a crash report for HackStudio, the
`unveil("/bin/HackStudio", "rx")` call was failing because of the
earlier `unveil(executable_path.characters(), "r")` call requesting only
"r" permissions for it. This patch handles this specific case, so you
can crash HackStudio to your heart's content. :^)

Also, we were unveiling the executable path twice, once manually and
once implicitly as part of the coredump's libraries, so we now check for
the latter and avoid it.

Thanks to Daniel for noticing what was right in front of me and I didn't
see!

Co-authored-by: Daniel Bertalan <dani@danielbertalan.dev>
2022-01-20 10:38:10 +01:00
Dmitry Petrov
1662213737 Userland: Add horizontal mouse scroll support 2022-01-20 10:37:52 +01:00
Dmitry Petrov
d61cc47055 Kernel: Add horizontal mouse scroll support 2022-01-20 10:37:52 +01:00
electrikmilk
1afb6d5eca Base: Add red theme 2022-01-20 10:36:46 +01:00
electrikmilk
4fd58a8bef Base: Tweak Silver theme
Tweak silver theme to look even more like Mac OS 9
2022-01-20 10:36:21 +01:00
electrikmilk
8ec0b2fa32 Base: Add Olive Green Theme
Add Olive theme
2022-01-20 10:35:35 +01:00
Jelle Raaijmakers
a8655fbf52 LibGL+LibSoftGPU: Clean up some for loops 2022-01-20 10:35:01 +01:00
Jelle Raaijmakers
12d7b4e9ac LibGL: Rename GLMat.cpp to GLMatrix.cpp 2022-01-20 10:35:01 +01:00
Jelle Raaijmakers
08826d60ad LibGL: Transpose matrix in glGetDoublev and glGetFloatv
We were returning row-major matrices when OpenGL clients are expecting
column-major instead.
2022-01-20 10:35:01 +01:00
Jelle Raaijmakers
16255d161e LibGL: Use 4 hex characters for error code constants in gl.h 2022-01-20 10:35:01 +01:00
Jelle Raaijmakers
c846ed0a2c LibGL: Report GL errors to debug console 2022-01-20 10:35:01 +01:00
Jelle Raaijmakers
c5abef86db LibGL: Stub GL_BACK implementation for glPolygonMode
This prevents overwriting the front face mode when providing `GL_BACK`
as a parameter.
2022-01-20 10:35:01 +01:00
Jelle Raaijmakers
453f62c935 LibGL+LibSoftGPU: Implement GL_POLYGON_OFFSET_FILL capability 2022-01-20 10:35:01 +01:00
Jelle Raaijmakers
991cbc56a2 LibGL: Implement glColor4b 2022-01-20 10:35:01 +01:00
Jelle Raaijmakers
29dc17b7b9 LibGL: Correct values for GL_BGR and GL_BGRA 2022-01-20 10:35:01 +01:00
Undefine
9a28ef7aa9 SystemMonitor: Show unknown in PCI devices
In case when the PCI class, device or vendor is unknown, show
that it is unknown instead of just putting the ID
2022-01-19 21:47:40 -08:00
electrikmilk
fa1d07a45d Base: Add C64 theme for Terminal 2022-01-19 21:45:30 -08:00
electrikmilk
357b12f315 Base: Add Github theme for Terminal 2022-01-19 21:45:30 -08:00
Lady Gegga
231cf787d5 Base: Add Hiragana characters to font Katica Regular 10
3041-309F https://www.unicode.org/charts/PDF/U3040.pdf
2022-01-19 23:17:21 +00:00
Lady Gegga
764e33f318 Base: Add Chinese characters to font Katica Regular 10
4E06, 4E07, 524D, 56FA, 56D7-56E0, 6708
https://www.unicode.org/charts/PDF/U4E00.pdf
2022-01-19 23:17:21 +00:00
Sam Atkins
b34950a825 LibWeb: Add Formatters for Length, Percentage and LengthPercentage 2022-01-20 00:04:10 +01:00
Sam Atkins
bfcbab0dcf LibWeb: Remove reference_for_percent parameter from Length::resolved()
Despite looking like it was still needed, it was only used for passing
to other calls to Length::resolved() recursively. This makes the
various `foo.resolved().resolved()` calls a lot less awkward.
(Though, still quite awkward.)

I think we'd need to separate calculated lengths out to properly tidy
these calls up, but one yak at a time. :^)
2022-01-20 00:04:10 +01:00
Sam Atkins
cff44831a8 LibWeb: Remove Length::Type::Percentage :^)
All `<percentage>`s in the CSS grammar are now represented by the
`Percentage` class, and `<length-percentage>` by `LengthPercentage`.
2022-01-20 00:04:10 +01:00
Sam Atkins
5e9a6302e5 LibWeb: Convert opacity property from Length to Percentage 2022-01-20 00:04:10 +01:00
Sam Atkins
dc681913e8 LibWeb: Convert width/height and min-/max- versions to LengthPercentage
A lot of this is quite ugly, but it should only be so until I remove
Length::Type::Percentage entirely. (Which should happen later in this
PR, otherwise, yell at me!) For now, a lot of things have to be
resolved twice, first from a LengthPercentage to a Length, and then
from a Length to a pixel one.
2022-01-20 00:04:10 +01:00
Sam Atkins
cb0cce5cdc LibWeb: Convert flex-basis to LengthPercentage
The flexbox logic confuses me so regressions are possible, though our
test page looks the same as before so it should be fine.

Renamed FlexBasis::Length -> LengthPercentage too, for clarity.
2022-01-20 00:04:10 +01:00
Sam Atkins
784ba2ec42 LibWeb: Convert background-position to LengthPercentage
Not much needed changing this time, hurrah! :^)
2022-01-20 00:04:10 +01:00
Sam Atkins
0162ca912b LibWeb: Handle percentage font sizes 2022-01-20 00:04:10 +01:00
Sam Atkins
c8409cd58d LibWeb: Remove Node::m_font_size
This was only ever used in order to set the m_font_size for another
Node, so it can just go. :^)
2022-01-20 00:04:10 +01:00
Sam Atkins
e60d51b8eb LibWeb: Handle percentage and number line-heights
This does undo the changes in 88c32836d8,
which accounted for our bitmap fonts being a different size than the
`font-size` property requests. I think this would be better handled
inside Length::to_px(), which would then apply to all font-size-relative
lengths (eg, em and rem) instead of only for the line-height property.
2022-01-20 00:04:10 +01:00
Sam Atkins
1f8cd029a5 LibWeb: Add missing "auto" identifiers for min-width/height
Both of these have "auto" as their initial value, so the only reason
they work currently is that "auto" is implicitly a Length.
2022-01-20 00:04:10 +01:00
Sam Atkins
f602249ae9 LibWeb: Convert background-size from Length to LengthPercentage
Checking these for `auto` is awkward, but separating that will come
later. :^)
2022-01-20 00:04:10 +01:00
Sam Atkins
f75e796909 LibWeb: Convert border-radii from Length to LengthPercentage :^)
The visit_lengths() code is a bit awkward but we'll clean that up later.
2022-01-20 00:04:10 +01:00