Commit graph

26639 commits

Author SHA1 Message Date
Sam Atkins e2c32a6c65 Everywhere: Use my shiny new serenityos.org email :^) 2021-09-03 12:22:36 +02:00
Luke Wilde 01af7d1ae1 Kernel: Don't use {:p} when printing out invalid userspace stack pointer
`userspace_esp` is a virtual address and thus using `{:p}` on it is
invalid and will cause an assertion failure.

I ran into this while testing #9772.
2021-09-03 11:46:40 +02:00
Brian Gianforcaro 2b13c9942d Meta: Fix toolchain caching for Sonar Cloud workflow
The matrix variables were left over from copy/pasting the contents
of the normal CI workflow. We also should always skip saving the
cache, as the normal CI pipeliens will refresh the toolchain and
we should just be reading the cache.
2021-09-03 11:46:15 +02:00
Brian Gianforcaro a746d612ac Meta: Add github actions workflow to run coverity build analysis 2021-09-03 11:46:15 +02:00
Brian Gianforcaro 4c21aa2eed Meta: Remove sonar cloud worklow triggering for PRs
Sonar cloud detects PRs and fails the job at the very end, so there
isn't much use in including this testing feature.
2021-09-03 11:46:15 +02:00
Brian Gianforcaro 0da144322a Meta: Remove sonar cloud pipeline cache
The cache is saving, but by the time we run again, it looks like the
cache has been purged from other jobs consuming the cache.

This causes the cache to fail restore. Given we run nightly and there
is no time bound, we can just run without cache.
2021-09-03 11:46:15 +02:00
Brian Gianforcaro 3ad2b39eef Meta: Add sonar.python.version config to silence sonar cloud warning
All of our python scripts use python3
2021-09-03 11:46:15 +02:00
Mustafa Quraish 4961fa4715 LibSyntax: Fix bug in matching cursor highlighting
Fixes #9760.
2021-09-03 11:45:50 +02:00
Andreas Kling 8a89698ea4 Kernel/VirtIO: Stop leaking VirtIO::ConsolePort objects 2021-09-03 02:36:09 +02:00
Andreas Kling eaf88cc78a AK: Rename create<T> => make_ref_counted<T>
And also try_create<T> => try_make_ref_counted<T>.

A global "create" was a bit much. The new name matches make<T> better,
which we've used for making single-owner objects since forever.
2021-09-03 02:36:09 +02:00
Karol Kosek 43a800a838 LibGUI: Set correct value on click with set jump_to_cursor() in Slider
Prior this change, clicking on a slider with set jump_to_cursor() flag
didn't exactly match the knob to the mouse position, and therefore
the slider values were a bit off in the corners.
The calculation used the whole widget size to set new values, which
isn't correct as the track slider has margins on both ends.

I noticed this while seeking in the Sound Player.
2021-09-03 02:32:43 +02:00
Karol Kosek dabbe4ee27 LibGUI: Add track_margin() to Sliders
Less magic numbers! :^)
2021-09-03 02:32:43 +02:00
Mustafa Quraish 1cbab1c7e6 LibGfx/Color: Add suggested_foreground_color() method
This allows you to ask the color to recommend either white/black
as a contrasting text color if you were using the color as the
background. This uses the previously added luminosity() method.
2021-09-03 01:51:05 +02:00
Mustafa Quraish 882d57326c LibGfx/Color: Use luminosity to compute grayscale value
Issue #9758 discusses this.
2021-09-03 01:51:05 +02:00
Mustafa Quraish ca6c9be94c PixelPaint: Add actions to rotate image left/right
This also required adding a new hook to `ImageClient`, since there
wasn't a way of telling the ImageEditor that the full rect of the
image has changed (as when we rotate).
2021-09-03 01:50:11 +02:00
Mustafa Quraish 6a8c408856 PixelPaint: Add actions to flip image vertically/horizontally 2021-09-03 01:50:11 +02:00
Mustafa Quraish 0c56f06994 PixelPaint: Draw layers from bottom of panel, adjust spacing
If we don't have enough layers to be able to scroll, the layers
are pushed to be at the top of the layer list. This doesn't make
much sense now that we are correctly drawing the layers in the
right order, so now we draw them justified towards the bottom.

Previously we were also clipping the bottom gadget slightly when
there were enough layers to scroll. Now, I'm adding some offset to
the total height to account for this and give equivalent spacing
from the top and bottom layers.
2021-09-03 01:49:32 +02:00
Mustafa Quraish 339f0d5bca PixelPaint: Add Merge Active Layer Down action
This allows you to merge the active layer with the one below it.
2021-09-03 01:49:32 +02:00
Mustafa Quraish 97cc34c034 PixelPaint: Fix the displayed order of layers in LayerListWidget
Previously the background layer was shown at the top, and layers
in front of it were shown below it. This was really unintuitive.

This patch fixes LayerListWidget to now properly differentiate
between the index of a gadget, and the index of a layer, since they
are essentially mirrored. I chose not to modify the order in which
layers are stored since back-to-front makes it really convenient
there.
2021-09-03 01:49:32 +02:00
Musab Kılıç 432839c2e9 FileManager: Kindly ask the user if they want to delete a file 2021-09-02 23:52:29 +02:00
Luke Wilde b275b8c87a LibWeb: Check target's root instead of target itself in EventDispatcher
This was accidentally missing ".root()": "or parent is a node and
target’s _root_ is a shadow-including inclusive ancestor of parent"

https://dom.spec.whatwg.org/#concept-event-dispatch Step 5.9.6
2021-09-02 22:53:19 +02:00
Luke Wilde f7f37eaa0f LibWeb: Make Node::root return a reference
The root of a node can never be null, as "the root of an object is
itself, if its parent is null, or else it is the root of its parent."

https://dom.spec.whatwg.org/#concept-tree-root
2021-09-02 22:53:19 +02:00
Musab Kılıç 7f46022e66 LibVT: Execute DragOperation after resetting active hyperlink 2021-09-02 22:48:10 +02:00
Sam Atkins 724f45c784 Browser: Reload the DOM Inspector's JSON data when loading a new page
Of course, there are other reasons the DOM might change, but one thing
at a time. :^)
2021-09-02 22:16:41 +02:00
Sam Atkins 73c95bcd5f Browser: Reset the DOM Inspector's state when re-opening it
This resets the DOM Inspector to a default state when re-opening it,
instead of it displaying the previous selection and properties, which
may be outdated. This is closer to how Chrome and Firefox behave.
Eventually, it probably makes sense to copy their behavior of selecting
the `<body>` element by default.
2021-09-02 22:16:41 +02:00
Sam Atkins 97379ace25 Browser: Implement "Inspect Element" context menu action
This is finally working for OOPWV! :^)
2021-09-02 22:16:41 +02:00
Sam Atkins 1ccf10789e LibWeb+WebContent: Add query for hovered DOM node to OOPWV
This is needed for the "Inspect Element" context menu action.
2021-09-02 22:16:41 +02:00
Sam Atkins 3b07f49d48 LibWeb+WebContent: Implement asynchronous DOM Node properties call
This lets us "push" a new style-properties list to the DOM Inspector,
for example when JS changes the style of the inspected node.
2021-09-02 22:16:41 +02:00
Sam Atkins 1da07734bb Browser: Display style properties in DOM Inspector
This makes use of the new `inspect_dom_node()` IPC call.
2021-09-02 22:16:41 +02:00
Sam Atkins f381f8d63e LibWeb+WebContent: Add inspect_dom_node() IPC call
This is the IPC version of `Document::set_inspected_node()`, using a
node ID.

We return the inspected node's style properties as JSON, so that the DOM
Inspector can immediately display them.
2021-09-02 22:16:41 +02:00
Sam Atkins e824454ab4 LibWeb: Implement DOMTreeModel::index_for_node()
This will be used to find the index to select when the DOM Inspector is
told to inspect a specific node.
2021-09-02 22:16:41 +02:00
Sam Atkins fe820f6d5a LibWeb: Replace unused DOMTreeModel with DOMTreeJSONModel
The direct-Document-access DOMTreeModel is no longer used, since the DOM
Inspector has to access the Document remotely over IPC. This commit
removes it, and renames DOMTreeJSONModel to take its place, since it no
longer has to differentiate itself from the non-JSON one.

In case that didn't make sense:
- Delete DOMTreeModel
- Rename DOMTreeJSONModel -> DOMTreeModel
2021-09-02 22:16:41 +02:00
Sam Atkins 57ee7b3d56 LibWeb: Modify StylePropertiesModel to work with JSON
Now that the DOM Inspector communicates remotely with the web content,
we can't read the `StyleProperties` object from a `Node` directly, but
will receive JSON over IPC. This updates the model to match.
2021-09-02 22:16:41 +02:00
Sam Atkins 08aa7b77a7 Browser: Remove residual InProcessWebView code from DOM Inspector
This is no longer useful, and has to go before I can change how the
Models work.
2021-09-02 22:16:41 +02:00
Sam Atkins 1159eefff3 LibWeb: Include DOM Node ID in serialized JSON
This will be used in the DOM Inspector to communicate which node is
being inspected.
2021-09-02 22:16:41 +02:00
Sam Atkins 2d6a02f03b Browser: Prevent opening multiple DOM Inspectors for the same Tab
Also simplify the logic by removing `Tab::view_dom_tree()`, and making
the Tab keep a pointer to the InspectorWidget instead of its Window,
since that's more often what we want to access.
2021-09-02 22:16:41 +02:00
Sam Atkins d7485df928 LibWeb: Give each Node a unique ID
We maintain a directory of ID -> Node. Nodes add themselves to this
directory when they are created, receiving a random ID. When a Node is
destroyed, it removes itself from this directory. Anyone can request a
Node from the directory by its ID using `Node::from_id()`.

We reserve the `0` ID to mean "none".

These IDs allow different processes to communicate about a given Node
over IPC, for example the DOM Inspector.
2021-09-02 22:16:41 +02:00
Sam Atkins 48a2239f60 LibWeb: Remove commented-out dbgln
This is unrelated to the PR I'm working on, but keeps getting
reformatted because clang-format wants comments to start with a space.
2021-09-02 22:16:41 +02:00
Linus Groh 3492fbf9cf LibJS: Account for negative numbers in ToTemporalDurationRecord
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/fa9d547
2021-09-02 20:16:44 +01:00
Linus Groh 0e6d503317 LibJS: Throw RangeError for non-integral values in ToPartialDuration
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/895c8e5
2021-09-02 20:16:44 +01:00
Linus Groh 7acd174c85 LibJS: Reflect normative changes in ParseTemporalInstantString
Most of it doesn't affect us yet as the parsing code and additional AOs
are not implemented yet.

See: https://github.com/tc39/proposal-temporal/commit/f6ac475
2021-09-02 20:16:44 +01:00
Luke Wilde c20669328d LibJS: Handle +Infinity, -Infinity, +0 and -0 in modulo operator
Fixes 11 test262 cases.
2021-09-02 18:26:42 +01:00
Timothy Flynn 32825107de LibJS: Implement Intl.Locale.prototype.region 2021-09-02 17:56:42 +01:00
Timothy Flynn 349fd06b86 LibJS: Implement Intl.Locale.prototype.script 2021-09-02 17:56:42 +01:00
Timothy Flynn c3b6f43641 LibJS: Implement Intl.Locale.prototype.language 2021-09-02 17:56:42 +01:00
Timothy Flynn bdf36575c8 LibJS: Implement Intl.Locale.prototype.numeric 2021-09-02 17:56:42 +01:00
Timothy Flynn d7825f3680 LibJS: Implement most Intl.Locale.Prototype.<<keyword>> properties
The keyword accessors all have the same function body in the spec,
except for the Intl.Locale method they invoke. This generates those
properties in the same manner as RegExp.prototype.

    Intl.Locale.prototype.calendar
    Intl.Locale.prototype.caseFirst
    Intl.Locale.prototype.collation
    Intl.Locale.prototype.hourCycle
    Intl.Locale.prototype.numberingSystem

The exception is Intl.Locale.prototype.numeric, which will be defined
separately because it is a boolean value.
2021-09-02 17:56:42 +01:00
Timothy Flynn 21b3c5edba LibJS: Implement Intl.Locale.prototype.baseName 2021-09-02 17:56:42 +01:00
Timothy Flynn 27fc3cfe75 LibJS: Handle existing Intl.Locale objects in CanonicalizeLocaleList 2021-09-02 17:56:42 +01:00
Timothy Flynn 4de05faa8a LibJS: Add test cases for Intl.Locale.prototype.toString
Intl.Locale.prototype.toString wasn't testable before the constructor
was implemented.
2021-09-02 17:56:42 +01:00