summaryrefslogtreecommitdiff
path: root/Userland
AgeCommit message (Collapse)Author
2021-09-12LibGUI: Remove Indices with dangling FileSystemModel::Node on deletionItamar
When a file deletion event happens, we now iterate over all views of the FileSystemModel and remove any selection & cursor indices that hold dangling references do the deleted filesystem node. This fixes #9602.
2021-09-12LibWeb: Implement CSSStyleDeclaration.getPropertyValue(property)Andreas Kling
2021-09-12LibWeb: Log a FIXME when unimplemented computed style is requestedAndreas Kling
This will help us know which properties to compute next. :^)
2021-09-12LibWeb: Add ComputedCSSSstyleDeclaration and support 2 properties :^)Andreas Kling
getComputedStyle(element) now returns a ComputedCSSStyleDeclaration object, which is a live view of the computed style of a given element. This works by ComputedCSSStyleDeclaration being a wrapper around an element pointer. When you ask it for a CSS property, it gets the latest computed style values from the element and returns them as a CSS::StyleProperty object. This first cut adds support for computed 'color' and 'display'. In case the element doesn't have a corresponding node in the layout tree, we fall back to using specified style instead. This is achieved by performing an on-the-fly style resolution for the individual element and then grabbing the requested property from that resolved style.
2021-09-12LibWeb: Make CSSStyleDeclaration an abstract classAndreas Kling
This patch moves the CSS property+value storage down to a new subclass of CSSStyleDeclaration called PropertyOwningCSSStyleDeclaration. The JavaScript wrapper for CSSStyleDeclaration now calls virtual functions on the C++ object. This is preparation for supporting computed style CSSStyleDeclaration objects which won't have internal property storage, but rather an internal element pointer. :^)
2021-09-12LibGUI: Make the Open button always active in the OpenFolder modeKarol Kosek
We can just use the current opened directory as a path in that mode. :^)
2021-09-12LibGUI: Enable/Disable the Open button on text change in FilePickerKarol Kosek
Prior this change, the button was updated on user selection change in the file view. This isn't quite right, as you could remove the text from the text box or (even worse) start typing a filename there and the button state wouldn't change.
2021-09-12Assistant: Use ElapsedTimer::start_new()Brian Gianforcaro
2021-09-123DFileViewer: Use ElapsedTimer::start_new()Brian Gianforcaro
2021-09-12Fire: Use ElapsedTimer::start_new()Brian Gianforcaro
2021-09-12Cube: Use ElapsedTimer::start_new()Brian Gianforcaro
2021-09-12LibJS: Use ElapsedTimer::start_new();Brian Gianforcaro
2021-09-12ChessEngine: Use ElapsedTimer::start_new()Brian Gianforcaro
2021-09-12Shell: Use ElapsedTimer::start_new()Brian Gianforcaro
2021-09-12Utilities: Use ElapsedTimer::start_new in allocateBrian Gianforcaro
2021-09-12Utilities: Use ElapsedTimer::start_new() in disk_bechmarkBrian Gianforcaro
2021-09-12LibCore: Add factory to create and start a new ElapsedTimerBrian Gianforcaro
Simplifies one of the main usage patterns of the timer class.
2021-09-12Core/SecretString: Use `memset_s` instead of `explicit_bzero` on MacOSMustafa Quraish
MacOS doesn't have `explicit_bzero`, so this was causing errors when compiling LibCore on the host.
2021-09-12AK+LibCore: Standardize on AK_OS_MACOS instead of __APPLE__Brian Gianforcaro
We use our custom platform definitions in most places, remove the few remaining places we weren't using `AK_OS_MACOS`.
2021-09-12LibWeb: Implement window.matchMedia()Linus Groh
2021-09-12LibWeb: Start implementing the MediaQueryList interfaceLinus Groh
2021-09-12PixelPaint: Let PickerTool optionally sample all layersMustafa Quraish
Previously, only the color from the selected layer would be picked. Now, we allow the user to select if they want to sample the color from all layers.
2021-09-12LibWeb: Parse CSS selectors with no space before a combinatorSam Atkins
Previously selectors like `.foo>.bar` did not parse, because there is no whitespace between `.foo` and `>`. Now we correctly parse these. :^)
2021-09-12PixelPaint: Write changed settings back to config fileMustafa Quraish
In a previous commit we read default values from a commit file, this commit now also writes back any changes to those settings made by the user. Persistent settings always feel good :^)
2021-09-12PixelPaint: Use config to get default values for Guides/Rulers/PixelGridMustafa Quraish
Someone may not want to have these things enabled by default on every startup, but toggle them on manually. So instead of having hard-coded everything to be enabled by default, we now query LibConfig to find out what the preference is. These values can still always be changed from the Menus / with shortcuts. It's not really ideal querying LibConfig twice, but when initializing the menu we may not have an active editor, so we need to get the value for both the menu checkbox as well as the internal property. This shouldn't be too much of a big deal since LibConfig caches the values anyway :^)
2021-09-12PixelPaint: Allow panning when right-clicking with MoveToolMustafa Quraish
The MoveTool now lets you pan if you're dragging with a right click. Previously, right-clicking did not perform any actions at all, so this isn't removing any old functionality.
2021-09-12PixelPaint: Add setter/getter for ImageEditor::m_pan_originMustafa Quraish
This allows us to use tools to change the panned position, since right now this is only accessible internally to the editor.
2021-09-12LibWeb: Log resource loading success, failure, and durationBrian Gianforcaro
When debugging why your website isn't loading in LibWeb the resource loader is a blind spot as we don't have much logging except on certain error paths. This can lead to confusing situations where the browser just appears to hang. This changes attempts to fix that by adding common success and failure logging handlers so all resource loading outcomes can are logged.
2021-09-12LibWeb: Start tracking elapsed time when a resource is loadedBrian Gianforcaro
2021-09-12LibCore: Enable elapsed time as AK::Time on a ElapsedTimerBrian Gianforcaro
2021-09-12LibWeb: Include headers HashMap in the LoadRequest::hash() calculationBrian Gianforcaro
2021-09-12LibCore: Make Account::authenticate take a SecretStringBrian Gianforcaro
To encourage users to use the SecretString API, change the API so that Account::authenticate only accepts a SecretString.
2021-09-12LibCore: Make get_password return SecretString instead of StringBrian Gianforcaro
We shouldn't let secrets sit around in memory, as they could potentially be retrieved by an attacker, or left in memory during a core dump.
2021-09-12LibCore: Add SecretString, a buffer that is zero'd on destructionBrian Gianforcaro
We have a few places where we read secrets into memory, and then do some computation on them. In these cases we should always make sure we zero the allocations before they are free'd. The SecureString wrapper provides this abstraction by wrapping a ByteBuffer and calling explicit_bzero on destruction of the object.
2021-09-12LibCrypto: Use explicit_bzero instead of memset to zero 'secure data'Brian Gianforcaro
PVS-Studio flagged this, as memset can be optimized away by the compiler in some cases. We obviously don't want that to ever happen so make sure to always use `explicit_bzero(..)` which can't be optimized away.
2021-09-12Utilities: Fix incorrect error handling in tracerouteBrian Gianforcaro
The result will be -1 on error, and the error value will be stored in errno. PVS-Studio found this because result it saw result < 0 and new EFAULT is < 0, so this could never be true.
2021-09-12LibWeb: Explicitly zero-initialize WindowObject::m_location_objectAndreas Kling
2021-09-12LibWeb: Remove unused PropertyID parameter to StyleValue parsing methodsSam Atkins
It's no longer used, and awkward to pass around.
2021-09-12LibWeb: Remove "takes integer value" concept from parse_css_value()Sam Atkins
This was only needed when numeric values had to be wrapped as Lengths, and now serves no purpose.
2021-09-12LibWeb: Correctly parse numeric and 'auto' z-index valuesSam Atkins
As with `opacity`, this code expected a Length value, when it is specced to take a Number or `auto`. Now it's correct. :^)
2021-09-12LibWeb: Fix CSS opacity parsingSam Atkins
The StyleProperties code for opacity existed before NumericStyleValue was a thing, and was affected by over-enthusiastic unitless-length parsing, so it assumed everything was a length. Now it matches the Color4 spec instead, accepting either a number, or a percentage. We also get to remove the hack! :^)
2021-09-12LibWeb: Only apply the unitless-length quirk to needed propertiesSam Atkins
Previously, we applied the unitless length quirk to all numbers in quirks mode. Now, we correctly only do so for the set of properties listed in the quirks-mode spec: https://quirks.spec.whatwg.org/#quirky-length-value However, we do not yet prevent this quirk inside CSS expressions (like `calc()`) as the spec directs.
2021-09-12LibWeb: Add current_property_id to CSS ParsingContextSam Atkins
After `parse_css_value(PropertyID, TokenStream)`, we only need to know the current PropertyID when checking for property-specific quirks, which will take place in only 2 places, which happen deep down. Making the current PropertyID part of the context means that those places can check it easily, without us having to pass it to every one of the parsing functions, which otherwise do not care.
2021-09-12LibWeb: Add CSS quirks information to Properties.jsonSam Atkins
Two CSS quirks are specced to only apply to specific properties: - The hashless hex color quirk https://quirks.spec.whatwg.org/#the-hashless-hex-color-quirk - The unitless length quirk https://quirks.spec.whatwg.org/#the-unitless-length-quirk These are now represented in `Properties.json` like so: ```json "property-name-here": { "quirks": [ "hashless-hex-color", "unitless-length" ] } ``` Every property that either of those two quirks applies to is included in `Properties.json` and now has their quirks listed. :^)
2021-09-12Playground: Ask to save file contents on quit actionKarol Kosek
Prior this change, activating the action instantly closed the program.
2021-09-12PixelPaint: Fix zooming to cursorTobias Christiansen
This patch fixes the behavior of zooming. Now the cursor stays over the same spot in the image when zooming.
2021-09-12LibWeb: Don't assert if reconsuming on an empty TokenStreamSam Atkins
This fixes #9978. When a TokenStream is empty, reading its `current_token()` still returns a token (for EOF) so it makes sense to allow users to `reconsume_current_input_token()` that token, so they do not have to handle that themselves. Instead of VERIFY()ing, we can just no-op when reconsuming token 0.
2021-09-12LibWeb: Fix out-of-order DOM tree dumpsAndreas Kling
There were a few calls to the standalone version of dump_tree() inside the recursive version of dump_tree(), which led to the output getting jumbled out of order.
2021-09-12LibWeb: Expose the location object via Document.locationLuke Wilde
Both Window.location and Document.location use the same instance of the Location object. Some sites use it via Window, some via Document.
2021-09-12LibWeb: Implement some custom JS internal overrides for LocationLuke Wilde
As required by the spec. Note that this isn't the full suite of overrides.