Commit Graph

14803 Commits

Author SHA1 Message Date
Vrins
4b4ee95cdb LibGUI: Set cursor when using highlighted_search in abstractview
Previously using the highlighted_search would not set the cursor
to the item found by the search. This results in some unfamiliar
behavior such as jumping back up to the previously selected element,
before searching, when using the arrow keys to navigate.
2022-03-15 20:00:09 +01:00
Vrins
044be82567 Browser: Allow jumping to stylenames by typing in the inspector
This adds the default behavior of search and highlighting of
abstractView to the inspectorWidget. Search results are based on
the titles in the first columns.
2022-03-15 20:00:09 +01:00
Andreas Kling
e5e621a63f Browser: Rename "Element" Inspector tab to "Box Model"
This tab shows the box model metrics, so let's call it "Box Model" :^)
2022-03-15 19:48:19 +01:00
Andreas Kling
1afd9467f2 Browser: Use accurate labels for the Inspector's style property tabs
"Styles" => "Computed"
"Computed" => "Resolved"

It'd be nice to show specified values as well, but we don't have great
infrastructure to do that yet.
2022-03-15 19:48:19 +01:00
Andreas Kling
e31fe3eeb8 LibWeb: Rename Element::specified_css_values() => computed_css_values()
Let's make it very clear that these are *computed* values, and not at
all the specified values. The specified values are currently discarded
by the CSS cascade algorithm.
2022-03-15 19:48:19 +01:00
Andreas Kling
43ef813f3d LibWeb: Rename Element::computed_style() to resolved_css_values()
This more accurately reflects what's actually being returned.
2022-03-15 19:48:19 +01:00
Andreas Kling
8aa24c45dd LibWeb: Make BrowsingContext::reset_cursor_blink_cycle() more robust
If the browsing context text cursor has become invalid for whatever
reason, don't try to repaint its associated node.
2022-03-15 19:48:19 +01:00
Andreas Kling
5b8290dfa3 LibWeb: Invalidate document style after Node.insertBefore() 2022-03-15 19:48:19 +01:00
Andreas Kling
cf49e93b04 LibWeb: Invalidate style on media query evaluation change 2022-03-15 19:48:19 +01:00
Andreas Kling
a033dfc885 LibWeb: Actually connect ShadowRoot to its host element
This way we can traverse from inside a shadow root across the boundary
to the outside. :^)
2022-03-15 19:48:19 +01:00
Andreas Kling
759bfbb572 LibWeb: Use StyleComputer::invalidate_rule_cache() directly everywhere
Get rid of the old, roundabout way of invalidating the rule cache by
incrementing the StyleSheetList "generation".

Instead, when something wants to invalidate the rule cache, just have it
directly invalidate the rule cache. This makes it much easier to see
what's happening anyway.
2022-03-15 19:48:19 +01:00
Andreas Kling
72e6bff8b8 LibWeb: Remove unused code for constructing partial layout trees
We only ever build the whole layout tree in one go. Maybe one day we'll
support partial rebuilds, but for now, let's keep things simple.
2022-03-15 19:48:19 +01:00
Andreas Kling
88173648e3 LibWeb: Create HTMLInputElement UA shadow tree when inserted into DOM
Previously, we were creating a user-agent shadow tree when constructing
a layout tree. This meant that we did DOM manipulation (and consequently
style invalidation) during layout tree construction, which made things
very hard to reason about in Layout::TreeBuilder.

Simply everything by simply creating the UA shadow tree when the input
element inserted into a parent node instead.
2022-03-15 19:48:19 +01:00
Andreas Kling
511d4951b0 LibWeb: Don't access layout nodes in StyleComputer
Style computation always happens *before* layout, so we can't rely on
things having (or not having) layout nodes, as that information will
always be one step behind.

Instead, we have to use the DOM to find all the information we need.
2022-03-15 19:48:19 +01:00
Andreas Kling
cf69cc7f7d LibWeb: Invalidate style when a browsing context's viewport is resized
Anything with viewport-relative CSS lengths (vw/vh/vmin/vmax) needs to
have its style recomputed if the viewport size changes.
2022-03-15 19:48:19 +01:00
Andreas Kling
2be4064ca8 LibWeb: Add fast_is<ParentNode>() 2022-03-15 19:48:19 +01:00
Andreas Kling
32dd4bf1b9 LibWeb: Recurse into shadow trees when updating style
The style update mechanism was happily ignoring shadow subtrees.
Fix this by checking if an element has a shadow root, and recursing into
it if needed.
2022-03-15 19:48:19 +01:00
Andreas Kling
5d941ddf3a LibWeb: Make style invalidation cross shadow boundaries
Before this change, style invalidation didn't propagate upwards across
shadow boundaries, so our shadow trees were sitting there with invalid
style, never actually getting updated.
2022-03-15 19:48:19 +01:00
Andreas Kling
fdb647c097 LibWeb: Use a WeakPtr for DocumentFragment's "host" field
We had a reference cycle between fragments and their hosts.
2022-03-15 19:48:19 +01:00
Andreas Kling
7a82a6dfe8 LibWeb: Add equals() override to a bunch of StyleValue subclasses
The less we fall back to string-based equality testing, the better.
2022-03-15 19:48:19 +01:00
Linus Groh
fb60ada6ce LibJS: Handle non-Error this object in Error.prototype.stack getter
This is taken from the abandoned error stacks proposal, which
already serves as the source of truth for the setter. It only requires
the this value to be an object - if it's not an Error object, the getter
returns undefined.
I have not compared this behavior to the non-standard implementations of
the stack property in other engines, but presumably the spec authors
already did that work.

This change gets the Sentry browser SDK working to a point where it can
actually send uncaught exceptions via the API :^)
2022-03-15 17:32:48 +01:00
Linus Groh
37e988675f LibJS/Tests: Consolidate Error.prototype.stack tests
We don't usually separate tests for the getter and setter of a property,
and that error-stack.js (getter) test belongs in builtins/.
2022-03-15 17:32:48 +01:00
Linus Groh
ecba29c158 LibJS: Set internal function name of NativeError constructors
By using the same NativeFunction constructor as plain ErrorConstructor
and passing the name, TypeError & co. will now include their name in
backtraces and such.
Eventually we should probably rely on [[InitialName]] for this, but for
now that's how it works.
2022-03-15 17:32:48 +01:00
Timothy Flynn
04bb17ca94 LibJS: Reorganize spec steps for Intl.RelativeTimeFormat
This is an editorial change in the Intl spec:
https://github.com/tc39/ecma402/commit/a3ae343
2022-03-15 17:30:58 +01:00
Timothy Flynn
8941d0b49e LibJS: Reorganize spec steps for Intl.PluralRules
This is an editorial change in the Intl spec:
https://github.com/tc39/ecma402/commit/d7c7157
2022-03-15 17:30:58 +01:00
Timothy Flynn
812d3a7ef8 LibJS: Reorganize spec steps for Intl.NumberFormat
This is an editorial change in the Intl spec:
https://github.com/tc39/ecma402/commit/110cb1f
2022-03-15 17:30:58 +01:00
Timothy Flynn
d6868d1e9d LibJS: Reorganize spec steps for Intl.Locale
This is an editorial change in the Intl spec:
https://github.com/tc39/ecma402/commit/31f6003
2022-03-15 17:30:58 +01:00
Timothy Flynn
6677e03a52 LibJS: Reorganize spec steps for Intl.ListFormat
This is an editorial change in the Intl spec:
https://github.com/tc39/ecma402/commit/61bc370
2022-03-15 17:30:58 +01:00
Timothy Flynn
72462bed2f LibJS: Reorganize spec steps for Intl.DisplayNames
This is an editorial change in the Intl spec:
https://github.com/tc39/ecma402/commit/5b51804
2022-03-15 17:30:58 +01:00
Timothy Flynn
1f9c5c186f LibJS: Reorganize spec steps for Intl.DateTimeFormat
This is an editorial change in the Intl spec:
https://github.com/tc39/ecma402/commit/97e1ecc
2022-03-15 17:30:58 +01:00
Timothy Flynn
194ca06f78 LibJS: Reorganize spec steps for Intl.Collator
This is an editorial change in the Intl spec:
https://github.com/tc39/ecma402/commit/7c13db4

This also normalizes the spelling of the "Internal slots" heading in
Intl.Collator, which is another editorial change in the Intl spec:
https://github.com/tc39/ecma402/commit/ec064bd
2022-03-15 17:30:58 +01:00
Undefine
004e045adc Utilities: Add an lscpu utility 2022-03-15 15:44:17 +00:00
Hendiadyoin1
cd21e03225 AK+Everywhere: Add sincos and use it in some places
Calculating sin and cos at once is quite a bit cheaper than calculating
them individually.
x87 has even a dedicated instruction for it: `fsincos`.
2022-03-15 11:39:42 +01:00
Hendiadyoin1
47fe911196 UserspaceEmulator: Clear c0 on x87 constant load instructions 2022-03-15 11:39:42 +01:00
Hendiadyoin1
3f581c77d9 UserspaceEmulator: Make error checks in FYL2XP1 and FYL2X a bit closer
...to the manual

This removes the non complete NaN checks and fixes a bounds check in
FYL2X.
2022-03-15 11:39:42 +01:00
Hendiadyoin1
60cb5b8dfa UserspaceEmulator: Add more FIXMES to SoftFPU
This also includes an exception check for sqrt and two
pow(2,...) -> exp2(...) changes.
2022-03-15 11:39:42 +01:00
Karol Kosek
62668ebd81 Spreadsheet: Move tab widget actions to the main widget constructor
There's no need to reassign these functions when we add a new tab.
Nothing changes inside them and they don't depend on anything in the
function.
2022-03-15 12:01:27 +03:30
Karol Kosek
c0c9825f67 Spreadsheet: Get the active sheet via TabWidget::active_widget()
We don't have to track the active widget ourselves anymore -- less
possible boogs!
2022-03-15 12:01:27 +03:30
Karol Kosek
dcd3d7fe22 Spreadsheet: Set tab functions for every tab on setup
Previously, we were setting tab actions only for the active tab on a tab
change, and the same actions for the previous tab were removed.

Unfortunately, this also happened when making a new tab, which meant
that you could trick the cell editor to jump to the new sheet and start
writing there.

To fix this, every view will always have on_selection_changed
and on_selection_dropped assigned.  I haven't seen much difference in
the memory usage, so I guess it'll be fine :)
2022-03-15 12:01:27 +03:30
Luke Wilde
db1236b336 LibJS/Bytecode: Fix typo in object binding an entry with no alias
In object binding, we would attempt to get NonnullRefPtr<Identifier>
from alias on the alias.has<Empty>() code path. In this case, we need
to get it from name instead.
2022-03-15 11:57:51 +03:30
Luke Wilde
515f3e0b85 LibJS/Bytecode: End for's variable scope after update block generation
The update block can generate bytecode that refers to the lexical
environment, so we have to end the scope after it has been generated.
Previously the Jump to the update block would terminate the block,
causing us to leave the lexical environment just before jumping to the
update block.
2022-03-15 11:57:51 +03:30
Luke Wilde
1fc6bbcdc3 LibJS: Stop generating switch case statements on block termination
After we terminate a block (e.g. break, continue), we cannot generate
anymore bytecode for the block. This caused us to crash with this
example code:
```
a = 0;
switch (a) {
    case 0:
        break;
        console.log("hello world");
}
```
Anything after a block terminating instruction is considered
unreachable code, so we can safely skip any statements after it.
2022-03-15 11:57:51 +03:30
Lucas CHOLLET
6f29ccaa5a HackStudio: Remove Terminal widget when the bound shell process dies
This feature allows the terminal widget to be automatically closed when
typing `exit` inside the shell.
2022-03-14 23:43:36 +01:00
Samu698
a39c921421 HexEditor: Selection follows cursor while pressing shift
This patch makes the HexEditor behaviour similar to the one of the
text editor, this can be seen by pressing shift and the arrow keys
2022-03-14 22:48:16 +01:00
Samu698
61b8834b1a HexEditor: Disable selection dependent actions when no selection is made
This applies for the "copy as hex", "copy as text", "copy as C code",
"fill selection" actions
2022-03-14 22:48:16 +01:00
Samu698
d694af8be0 HexEditor: Offset segment in status bar opens goto offset dialog 2022-03-14 22:48:16 +01:00
Samu698
a562518ad7 HexEditor: Fill selection sets only bytes inside selection
Before this patch the fill selection command would set the selection
and one byte after it
2022-03-14 22:48:16 +01:00
Samu698
7bf4ed98d7 HexEditor: Copy as C code doesn't add trailing spaces 2022-03-14 22:48:16 +01:00
kleines Filmröllchen
79deb7d6c7 AudioServer: Decrease sample headroom to 5%
This might still be too much, but it's better than what we had before.
2022-03-14 22:46:46 +01:00
kleines Filmröllchen
1088c2c716 Piano: Decrease sample headroom
Multiplying all samples by 0.1 was kind of silly. This also requires
adjusting the wave visualizer so that the waves still fit.
2022-03-14 22:46:46 +01:00