When writing to /sys/kernel/request_panic it will do a kernel panic.
Trying to truncate the node will result in kernel panic with a slightly
different message.
ASAN was crying way too much when running the LibJS JIT since the old
OFFSET_OF implementation was too wild for its liking.
By turning off the invalid-offsetof warnings, we can use the offsetof
builtin instead. However, I'm leaving this as a wrapper macro, since
we may still want to do something different for other compilers.
These wrappers will make it much easier to do various operations on the
different ArrayBuffer-related classes in LibWeb compared to the current
solution, which is to just accept a Handle<Object> everywhere (and use
"any" in the *.idl files).
Co-Authored-By: Matthew Olsson <mattco@serenityos.org>
This was used to provided base functionality for model-based chromes for
viewing the DOM and accessibility trees. All chromes now use the WebView
inspector model for those trees, thus this class is unused.
This is modeled after a similar implementation for the JS console.
This client takes over an inspector WebView (created by the chrome) to
create the inspector application. Currently, this application includes
the DOM tree and accessibility tree as a first pass. It can later be
extended to included the style tables, the JS console itself, etc.
This is an internal object that must be explicitly enabled by the chrome
before it is added to the Window. The Inspector object will be used by a
special WebView that will replace all chrome-specific inspector windows.
The IDL defines methods that this WebView will need to inform the chrome
of various events, such as the user clicking a DOM node.
Else, outline items that have newlines in them end up with a weird
vertical offset.
(This does affect the outline item's tooltip, which shows the whole
title. But not having a newline there seems alright, arguably
preferable.)
The title of an OutlineItem is already in UTF-8.
This is currently done in LibPDF's Parser::parse_string(). I think
that's not quite the right place (it shouldn't be done for all strings)
and not done quite right (text strings should convert from
PDFDocEncoding to UTF-8 unless prefixed by an UTF-8 BOM), but even if
that changes, I think we'll keep OutlineItem.title in UTF-8.
Implemented by adding the extra 3-value syntax as its own case and only
running it when parsing background-position. I'm sure it could be
implemented in a smarter way but this is still a bunch less code than
before. :^)
This means `object-position` will no longer incorrectly accept the
3-value background-position syntax.
Remove the now-ambiguous and unused `position` enum while we're at it.
(This enum only existed as a hack.)
With this change, we now have ~1200 CellAllocators across both LibJS and
LibWeb in a normal WebContent instance.
This gives us a minimum heap size of 4.7 MiB in the scenario where we
only have one cell allocated per type. Of course, in practice there will
be many more of each type, so the effective overhead is quite a bit
smaller than that in practice.
I left a few types unconverted to this mechanism because I got tired of
doing this. :^)
Whenever the tests produce a `test-dumps` directory, publish the files
in it as an artifact. This lets us peek at the screenshots and see
what's mismatched, instead of just having to guess.
The current implementation fails if a file in the archive is not valid
UTF-8. The CLDR 44.0.1 package unfortunately contains such files (it
errantly has .DS_Store files).
If a unit tests defines a `deps` array, the unit test template would
have tried to overwrite it (and it is actually an error to overwrite
a non-empty list with another non-empty list).
FP contraction is a standard-conforming behavior which allows the
compiler to calculate intermediate results of expressions containing
floating point numbers with a greater precision than the expression type
allows. And in theory, it enables additional optimizations, such as
replacing `a * b + c` with fma(a, b, c).
Unfortunately, it is extremely hard to predict when the contraction will
happen. For example, Clang 17 on x86_64 with the default options will
use FMA only for constant-folded non-constexpr expressions. So, in
practice, FP contraction leads to hard-to-find bugs and inconsistencies
between executables compiled with different toolchains or for different
OSes. And we had two instances of this happening last week.
Since we did not ever used -mfma on x86_64, this patch can only possibly
regress performance on Apple ARM devices, where FMA is enabled by
default. However, this regression will likely be negligible since the
difference would be one additional add instruction, which would be then
likely executed in parallel with something else.
With these changes it is now possible to create OpenGL context on macOS
and run GPU-painter. For now only QT client has a CLI param that turns
it on though.
This is a bit spammy now that we are performing some overload resolution
at build time. The fallback to an interface has generally worked fine on
the types it warns about (BufferSource, Module, etc.) so let's not warn
about it for every build.
Previously, a DNS packet containing an invalid name would be returned
with an empty name. With this change, an error is returned if any error
is encountered during parsing.
Aside from the obvious performance benefits, this will allow us to
properly handle dictionary types. (whose dictionary-ness is only known
at build-time)
Much of the rest of the overload resolution algorithm steps can (and
should) be evaluated at build-time as well, but this is a good first
step.
* Count files that are password-protected
* Use `pdf --json` to groups by missing feature and then by file
instead of by file first, feature second
* Count files that render with issues
* Print number of files without issues last
* Always print all crash stacks
Fix the recursive directory bug in CLion Nova EAP's CMake version in a
way that doesn't also break `./Meta/serenity.sh run lagom ladybird`.
This brings the Lagom minimum required closer to the Serenity minimum
required. Which is still fine, because the serenity.sh script knows how
to build CMake from source if a developer's local copy is too old.
Ran into this with the new EAP for CLion Nova. When using Ladybird as
source directory, we would recursively look in Ladybird --> Lagom -->
Ladybird when exporting components. This seems to be because
ENABLE_LAGOM_LADYBIRD is set to ON by Ladybird's CMakeLists and
something about their build, when invoked from their IDE, has buggy
behavior around the SUBDIRECTORIES directory property.
When wrapping dictionary members, generate_wrap_statement was called
with the pattern "auto {} = ...", where "..." was determined based on
the variable's type. However, in generate_wrap_statement, if a type is
nullable it generates an if statement, so this would end up generating
something along the lines of
if (!retval.member.has_value()) {
auto wrapped_member0_value = JS::js_null();
} else {
auto wrapped_member0_value = JS::Value(...);
}
...which makes the declaration inaccessible. It now generates the same
code, but the "auto" declaration (now an explicit JS::Value declaration)
is outside of the if-statement.
This commit replaces the 5 fuzzers that previously tested LibTextCodec
with a single fuzzer. We now rely on the fuzzer to generate the
encoding and separate it from the encoded data with a magic separator.
This increases the overall coverage of LibTextCodec and eliminates the
possibility of the same error being generated by multiple fuzzers.
When building fuzzers for Oss-Fuzz using `BuildFuzzers.sh --oss-fuzz`,
fuzzer dictionary files are now copied to the `$OUT` directory. This
allows them to be used automatically by the corresponding fuzzer.
LibCore currently cannot depend on LibTimeZone directly. All build-time
code generators depend on LibCore, so there'd be a circular dependency:
LibCore -> LibTimeZone -> GenerateTZData -> LibCore.
So to support parsing time zone names and applying their offsets, add a
couple of weakly-defined helper functions. These work similar to the way
AK::String declares some methods that LibUnicode defines. Any user who
wants to parse time zone names (from outside of LibCore itself) can link
against LibTimeZone to receive full support.
https://cldr.unicode.org/index/downloads/cldr-44
Notable changes that affect us include:
* The Islamic Calendar is now localized as the Hijri Calender (in en-US)
but has not been updated for all locales. So this patch updates tests
where possible and removes a few test cases that currently cannot be
localized.
* The und locale has received more likely subtag data (the und locale is
basically a pseudo-locale meaning "undetermined").
* The exponential symbol in the Arabic number system was changed from
U+0627 to U+0623.
This warning warns about variable-length arrays being a non-standard
extension to the C++ language. We still have a few instances of VLAs, so
let's disable the warning for now.
This does not interfere with `-Wvla`, which we use to completely forbid
this (potentially dangerous) feature in the Kernel and LibCrypto.
The AppKit chrome is now the default, but the Qt chrome may still be
enabled for testing. Let's ensure it can compile in CI, as it has
already broken since the default change.
Previously, some fuzzers were generating an excessive amount of debug
logging. This change explicitly disables debug logging for all fuzzers.
This allows higher test throughput and makes the logs easier to read
when fuzzing locally.
The previous implementation was calling `backtrace()` for every
function call, which is quite slow.
Instead, this implementation provides VM::stack_trace() which unwinds
the native stack, maps it through NativeExecutable::get_source_range
and combines it with source ranges from interpreted call frames.
Previously these handlers duplicated code and used formats that
were different from the one Error.prototype.stack uses.
Now they use the same Error::stack_string function, which accepts
a new parameter for compacting stack traces with repeating frames.
This change introduces a new 2D graphics library that uses OpenGL to
perform painting operations. For now, it has extremely limited
functionality and supports only rectangle painting, but we have to
start somewhere.
Since this library is intended to be used by LibWeb, where the
WebContent process does not have an associated window, painting occurs
in an offscreen buffer created using EGL.
For now it is only possible to compile this library on linux.
Offscreen context creation on SerenityOS and MacOS will have to be
implemented separately in the future.
Co-Authored-By: Andreas Kling <awesomekling@gmail.com>
The current helpers assume that a valid URL is a full URL (i.e. contains
the "://" separator between the scheme and domain). This isn't true, as
"file:" alone is parsed as a valid URL.
We must also avoid simply searching for the parsed public suffix in the
original URL string. For example, "com" is a public suffix. If we search
for that in the URL "com.com", we will think the public suffix starts at
index 0.
This library offers tools to communicate with an ImageDecoder server
through IPC. There is currently no such executable for Lagom but that
shouldn't take long :^)
This was left behind when removing the AST interpreter, and the CI not
being around made it bitrot.
Co-Authored-By: Dan Klishch <danilklishch@gmail.com>
`-serial mon:stdio` passes through all kinds of key combinations,
`-serial stdio` doesn't. This probably isn't something that we want
while running tests or CI, so switch to the non-passing variant.
aarch64 actually failed to run due to this, since it already had
`-serial stdio` in its arguments, causing a conflict. This is why that
entry is now gone entirely.
`-nographic` additionally reconfigures the Terminal, which clears the
previous scrollback and (ocasionally) breaks line wrapping. This is
probably not something that we want, so only ask for the redirection
behavior.
Previously, attempting to update an ext2 inode with a UID or GID
larger than 65535 would overflow. We now write the high bits of UIDs
and GIDs to the same place that Linux does within the `osd2` struct.
* Elide parser offsets to better group parser errors
* Use `backslashreplace` for decoding crash stacks so that we don't
crash when printing crash stacks if the error output isn't valid
utf-8
* Swap last two lines of output, reads a bit better
The rendering happens only in-memory, so this is only useful for
looking at the crash rate and the reports of missing features.
To actually see the output of a file, use
pdf --render out.png --page N path/to/input.pdf
instead.
I would've expected that there's some way to have this work
automatically in an NSDocument-based application, but I haven't
found it yet. So manually implement the delegate for now.
After d2c7e1ea7d, there is now only one
user of LibPublicSuffix - the URL sanitation utility within LibWebView.
Rather than having an entire library for the small Public Suffix data
accessor, merge it into LibWebView.
A bit old but a relatively uncomplicated device capable of outputting
1920x1080 video with 32-bit color. Tested with a Voodoo 3 3000 16MB
PCI card. Resolution switching from DisplaySettings also works.
If the requested mode contains timing information, it is used directly.
Otherwise, display timing values are selected from the EDID. First the
detailed timings are checked, and then standard and established
timings for which there is a matching DMT mode. The driver does not
(yet) read the actual EDID, so the generic EDID in DisplayConnector now
includes a set of common display modes to make this work.
The driver should also be compatible with the Voodoo Banshee, 4 and 5
but I don't have these cards to test this with. The PCI IDs of these
cards are included as a commented line in case someone wants to give it
a try.
That API came from a mistake in the IDL compiler, where reflected
nullable attributes would try to call set_attribute(name, null).
This commit fixes the mistake in the IDL generator, and removes the
meaningless API.
This commit removes DeprecatedString's "null" state, and replaces all
its users with one of the following:
- A normal, empty DeprecatedString
- Optional<DeprecatedString>
Note that null states of DeprecatedFlyString/StringView/etc are *not*
affected by this commit. However, DeprecatedString::empty() is now
considered equal to a null StringView.
When the outline has focus, arrow keys navigate the outline instead
of changing the current page.
Add opt-up and opt-down as a way to move by one page even when the
outline has focus. (This matches Preview.app.)
xib change: Added two menu Previous Page with key equivalent opt-up
and Next Page with key equivalent opt-down to Go menu and bound them to
goToPreviousPage: and goToNextPage: on First Responder.
When the outline has focus, the responder chain is outline ->
window, so also add the actions on the window controller, and
let that forward to the PDF view.
When this feature was finally merged, the serenity_option in
lagom_options.cmake had the unintended side effect of always setting the
cache variable to "" in the initial cache. In order to actually set the
linker to use to be lld or mold, we need to set with the FORCE flag in
the use_linker.cmake file.
Found by checking with the CMake variable_watch() function.
This will stop the build from spamming the "Using LLD to link Lagom"
message all over the place :^)
Do this with INSTALL_INTERFACE genex include directory rules. We should
really standardize where the generated headers *actually* get installed
to though.
This allows the decoder to fail gracefully when reading a partial or
malformed TBSCertificate. We also now ensure that the certificate data
is valid before making a copy of it.
I broke this when moving from a xib file to creating the UI in code.
https://developer.apple.com/documentation/appkit/nsuserinterfaceitemidentification/1396829-identifier
says:
"Identifiers are used during window restoration operations to uniquely
identify the windows of the application. [...] If you create an item in
Interface Builder and do not set a value for this string, a unique value
is created for the item when the nib file is loaded. For
programmatically created views, you typically set this value after
creating the item but before adding it to a window."
Without this, encodeRestorableStateWithCoder: / restoreStateWithCoder:
in MacPDFView weren't getting called.
The documentation is very loud about cell-based things being
deprecated, but it's fairly hidden what to actually do to switch to
the non-deprecated way (implement a certain delegate method).
Session 120 from WWDC 2011 has some notes on this. Apple's official
site no longer seems to have that, but it's e.g. here:
https://docs.huihoo.com/apple/wwdc/2011/session_120__view_based_nstableview.pdf
Just setting headerView to nil removes the header, but also has
the effect of no longer drawing the outline view with a sidebar
background ¯\_(ツ)_/¯.
But also setting drawsBackground to NO on the scroll view restores
the sidebar look, so do that too.
With this, it is no longer necessar to explicitly set style.
The default NSTableViewStyleAutomatic now seems to resolve to
NSTableViewStyleSourceList, so stop explicitly setting it.
(This part has no behavior change.)
Clicking an item in the outline now opens that page.
This requires giving the outline view a delegate, which for some
reason also has th effect of indenting expandable items ¯\_(ツ)_/¯
The vertical alignment of text still looks off, though.
The outline has drawing artifacts, but it is somewhat functional:
You can click on disclosure triangles to open outline items, and
if the outline doesn't fit in the sidebar, it's scrollable.
The outline view has the correct sidebar look: gray with a slightly
transparent glass effect.
Clicking items doesn't have an effect yet.
This Just Works with NSToolbarSidebarTrackingSeparatorItemIdentifier,
as long as your window is has NSWindowStyleMaskFullSizeContentView
in its style mask. If it doesn't, things behave pretty weirdly and
at least in the docs I looked at, this requirement wasn't documented
at all :/
Anyways, switch MacPDFView to use safeAreaRect instead of bounds
now that we use NSWindowStyleMaskFullSizeContentView so that we
don't draw parts of the PDF under the title bar.
Also be careful to invalidate the PDF view if safeAreaRect changes,
so that the page is redrawn when toolbar visibility gets toggled.
- MacPDFWindowController is now the xib file's owner
- _pdfView moves over
- MacPDFWindowController is now the MacPDFViewDelegate and responsible
for updating the window's title
- Due to MacPDFWindowController now being the xib file's owner,
windowControllerDidLoadNib: is no longer called automatically,
so call a custom windowIsReady method manually instead
No behavior change.
I'd like to add a sidebar, and NSSplitViewItem apparently isn't
accessibly in .xib files without contortions. So I want to move
to creating the window in code, and this is a step towards that.
No behavior change.