-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LibWeb: Add inline-size containment for replaced elements #3344
Closed
Psychpsyo
wants to merge
213
commits into
LadybirdBrowser:master
from
Psychpsyo:inline-size-contain-thing
Closed
LibWeb: Add inline-size containment for replaced elements #3344
Psychpsyo
wants to merge
213
commits into
LadybirdBrowser:master
from
Psychpsyo:inline-size-contain-thing
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This corresponds to part of whatwg/html#10818
We'll need to call it from elsewhere. Also add a missing step 5 from where we previously called it.
No code changes.
Previously, the DOM complete time was never being set, as the HTML parser was detached before `DocumentReadyState` was set to complete.
Add a couple of macros to aid error handling with OpenSSL and some RAII classes that manage the lifetime of some OpenSSL objects.
Implement the Ed448 curve for signing and verifying using OpenSSL. The methods could be all made static, but all other curves are not. I think this is material for further refactoring.
Add full support for Ed448 and import relevant tests.
This matches the behavior of other browsers, which always set the dirty checkedness flag when setting checkedness, except when setting the `checked` content attribute.
URL::basic_parse has a subtle bug where the resulting URL is not set to valid when StateOveride is provided and the URL parser early returns a valid URL. This has not surfaced as a problem so far, as the only users of the state override API provide an already valid URL buffer and also ignore the result of basic parsing with a state override. However, this bug surfaces implementing the URL pattern spec, which as part of URL canonicalization: * Provides a dummy URL record * Basic URL parses that URL with state override * Checks the result of the URL parser to validate the URL While we could set URL validity on every early return of the URL parser during state override, it has been a long standing FIXME around the code to try and remove the awkward validity state of the URL class. So this commit makes the first stage of this change by migrating the basic parser API to return Optional, which also happens to make this subtle issue not a problem any more.
This makes it more convenient to use the 'relvant agent' concept, instead of the awkward dynamic casts we needed to do for every call site. mutation_observers is also changed to hold a GC::Root instead of raw GC::Ptr. Somehow this was not causing problems before, but trips up CI after these changes.
Previously, the namespace of the attributes on the cloned element was not being set.
Previously, the build would fail if the CMake source directory contained regex special characters.
The drag-and-drop event names are already included, and the app cache event names no longer exist (and the spec link here 404s).
We added these methods to propagate OOM errors at process startup, but we longer fret about these tiny OOM failures. Requiring that these init methods be called prohibits using these strings in processes that have not set up a MainThreadVM. So let's just remove them and initialize the strings in a sane manner. In doing so, this also standardizes how we initialize strings whose C++ variable name differs from their string value. Instead of special-casing these strings, we just include their string value in the x-macro list.
Now that we can use these string constants, let's avoid the replication.
Not currently needed as it cannot fail, but useful for future commits.
The current default is unsafe, but determining a safe value is not easy. Leave it up to the caller to decide.
Make `encrypt`, `decrypt`, `sign` and `verify` return `ErrorOr` for better error propagation.
Namely: - Perform case-insensitive matching - Return the same extension objects every time - Only enable the extension if it's supported by the current context
This is done by using the combination of format and type to map to the appropriate Skia bitmap type. With this, we then read the SkImage of the TexImageSource into a new SkPixmap with the destination format information and holding an appropriately sized buffer. Once created, readPixels is called to convert and write the image into the buffer.
This is used to put together the list of supported WebGL extensions based on the available extensions, per-extension required extensions and WebGL version.
This is used on figma.com.
This is used on figma.com
This already exists in URL::Host, and used appropriately.
This was all for OOM handling.
The spec intends to pass through a URL record object as it needs to be serialized on removal. This has no functional impact on our implementation other than the double parsing of every URL being revoked. It is also missing an error check for an invalid URL being passed through. This does not impact our implementation currently as we just end up using an empty URL which is not part of the blob entry map. This will cause problems once DOMURL::parse is updated to return an Optional<URL::URL> however.
This ports one more function away from needing to use the awkward valid state of the URL class.
This fixes issue where it was impossible to paste text into inspector console input.
This allows for easy child removal similar to `DOM::Node::remove()`.
The existing `::unite_horizontally()` and `::unite_vertically()` tests did not properly test the edge cases where left/top in the Rect were updated, so they get re-arranged a bit.
Our layout tree requires that all containers either have inline or non-inline children. In order to support the layout of non-inline elements inside inline elements, we need to do a bit of tree restructuring. It effectively simulates temporarily closing all inline nodes, appending the block element, and resumes appending to the last open inline node. The acid1.txt expectation needed to be updated to reflect the fact that we now hoist its <p> elements out of the inline <form> they were in. Visually, the before and after situations for acid1.html are identical.
There are many simpler APIs that we can use here. No functional changes.
Instead of ignoring any paintable immediately when they're invisible to hit-testing, consider every candidate and while the most specific candidate is invisible to hit-testing, traverse up to its parent paintable. This more closely reflects the behavior expected when wrapping block elements inside inline elements, where although the block element might have `pointer-events: none`, it still becomes part of the hit-test body of the inline parent. This makes the following link work as expected: <a href="https://ladybird.org"> <div style="pointer-events: none">Ladybird</div> </a>
Before this change, it was possible for a second GC to get triggered in the middle of a first GC, due to allocations happening in the FinalizationRegistry cleanup host hook. To avoid this causing problems, we add a "post-GC task" mechanism and use that to invoke the host hook once all other GC activity is finished, and we've unset the "collecting garbage" flag. Note that the test included here only fails reliably when running with the -g flag (collect garbage after each allocation). Fixes LadybirdBrowser#3051
Psychpsyo
force-pushed
the
inline-size-contain-thing
branch
from
January 23, 2025 12:40
4b9e574
to
a483cd4
Compare
github-actions
bot
added
the
conflicts
Pull request has merge conflicts that need resolution
label
Jan 23, 2025
Your pull request has conflicts that need to be resolved before it can be reviewed and merged. Make sure to rebase your branch on top of the latest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
NOTE: This can only be merged once my changes in #3296 and #3271 have been merged, as it relies on both of them.I'll probably want to properly test this an import some more WPTs once that has happened though.EDIT: Messed up a rebase, will just reopen this once those other PRs have been merged.