People seem to easily miss the "Setting up build tools" section, so I
have moved that step above the filesystem information and linked
directly to BuildInstructions.md to hopefully make it harder to skip.
Also, added mention of `\\wsl$` since that regularly comes up in
Discord.
When parsing the libraries of the debugee process, we previously
assumed that the region that's called `<library name>: .text` was also
the base of the ELF file.
However, since we started linking with `-z separate-code`, this is no
longer the case - our executables have a read-only segment before the
.text segment, and that segment is actually at the base of the ELF.
This broke inserting breakpoints with the debugger since they were
inserted at a wrong offset.
To fix that, we now use the address of the first segment in the memory
map for the ELF's base address (The memory map is sorted by address).
This was a mistake in the move away from KBuffer-as-a-value type.
We need to check `packet` here, not `packet->data`.
Regressed in b300f9aa2f.
Fixes#9888.
Any browsing context that doesn't have a parent browsing context is now
considered a top-level browsing context. This matches the HTML spec.
This means we no longer keep a pointer to the top-level context, since
we can simply walk the parent chain until we find the topmost ancestor.
This is a bit of a lie as the Value(Object const*) ctor will const_cast
them in invoke(), but at least it ensures that nothing else in the
function relies on getting non-const Objects.
Perhaps we can have an actual Object const* Value in the future as well.
There's no need for these to be non-const. Suggested by @IdanHo in
https://github.com/SerenityOS/serenity/pull/9904#discussion_r704960184.
Perhaps we can make more internal slots of these and other objects const
references as well, but that's a bit more involved as they are used by
various functions expecting non-const references.
Previously, the modification tag in the editor file label was unset only
after a file was saved.
This commit will also unset the tag if you undo the stack (for example
by hitting Ctrl+Z) to the last saved state.
Before this patch, HTMLScriptElement would cache the full script source
text in a String member, and parse that just-in-time via Document's
run_javascript() helpers.
We now follow the spec more closely and turn the incoming source text
into a ClassicScript object ("the script's script" in the spec.)
This prevents GCC and Clang from deleting null pointer checks for
optimization purposes. I think we're strictly better off crashing
in those cases instead of the compiler hiding errors from us.
Let's err on the side of caution and use a WeakPtr instead of a
DOM::Document&. Even if the object lifetimes involved here should be
well-defined, they are fairly complicated.
This patch converts all the usage of AK::String around sys$execve() to
using KString instead, allowing us to catch and propagate OOM errors.
It also required changing the kernel CommandLine helper class to return
a vector of KString for the userspace init program arguments.
This is a feature I missed from Photoshop: it sets the scale and
position so that the image fits (it's longest dimension) into
the editor view. There's a 5% border left around the image to
provide context. This is just arbitrary seemed like the right
amount after some trial and error.
Previously EraseTool would only let you have hard lines, similar
to PenTool. After inheriting from BrushTool in previous commits,
making the eraser (optionally) behave like a brush is much easier.
We only need to change how the colors are handled for the hardness,
which is why the `draw_point()` call is a bit more involved. Just
blending the colors doesn't work here since we actually want to
replace the previous color, unlike in BrushTool where we are just
layering the color on top.
This removes all the code to handle events that was essentially
duplicated from BrushTool anyway :^)
I've also renamed "thickness"->"size" to have consistent
terminology.
Most of the logic implemented in PenTool was the same as BrushTool
anyway, with the only difference being how the actual lines were
drawn at the end. We now just override the `draw_line()` and
`draw_point()` methods instead.
We don't strictly need to override `draw_line()` here, but that
would just result in repeated calls to `draw_point()`, which is
wasteful.
Also renamed "thickness"->"size" to have consistent terminology.
The BrushTool is very cool, but it doesn't allow us to re-use any
of the code in other classes. Many of the other tools have duplicated
code for handling mouse events / keeping track of previous location,
etc.
This commit sets up BrushTool so that other tools can inherit from
it and override some virtual functions to allow similar behavior
without re-writing the code to keep track of mouse positions, etc.
In particular, we add public setters/getters for `size` and
`hardness` properties, and make `draw_point()` and `draw_line()`
virtual so that derived classes can override them.
Note: We still pass in `color` as a parameter for `draw_line()` and
`draw_point()` instead of using `color_for()` directly because it
doesn't really make sense to be constantly asking the ImageEditor
for the color when it's not really changing (for instance along all
the points of a line)
Sometimes you want to draw a straight line between 2 points, but
using the nice-looking brush we have instead of the hard line we
would get using the LineTool.
This patch adds the ability to click somewhere with the brush, and
then Shift+click somewhere else to draw a line between the two
points using the brush stroke. Seems like an obvious addition
considering we already have a helper function to draw lines :^)
The BFS implementation for BucketTool's flood-fill had sitations
which could result in infinite loop, causing OOM crashes due to
the queue growing unbounded. The way to fix this is to keep track
of the pixels we have already visited in the flood-fill algorithm
and ignore those if we ever encounter them again.
This also fixes the crashing issue from #9003. We still need a
better way to account for transparency, but that is beyond the scope
of this commit, and this issue still exists without any transparent
pixels.