summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb
AgeCommit message (Collapse)Author
2023-03-12LibWeb: Stop polluting layout tree dumps with TextNode memory addressesAndreas Kling
I've never actually used this for anything, and it's pretty noisy.
2023-03-11LibWeb: Use from_deprecated_fly_string() instead of from_utf8()Kenneth Myhra
Use FlyString::from_deprecated_fly_string() in these instances instead of FlyString::from_utf8(). As we convert to new FlyString/String we want to be aware of these potential unnecessary allocations.
2023-03-11LibWeb/HTML: Remove redundant namespace qualifiers from Window.{cpp,h}Linus Groh
2023-03-11LibWeb/HTML: Propagate OOM errors from Window::{local,session}_storage()Linus Groh
This requires a bit of error type conversion glue as HashMap::try_ensure expects the callback to return ErrorOr<T> like the function itself does.
2023-03-11LibWeb/HTML: Make Window::m{location,navigator} lazily allocatedLinus Groh
This now matches the other window-owned objects, which already do this: m_crypto, m_performance, m_screen.
2023-03-11LibWeb/HTML: Use CreateMethodProperty for Window namespace propertiesLinus Groh
This makes sure the property attributes are correct (writable and configurable), which they currently aren't for either CSS or WebAssembly.
2023-03-11LibWeb/HTML: Consolidate duplicate public/private sections in Window.hLinus Groh
2023-03-11LibWeb: Establish a stacking context for root elementMathis Wiehl
Until now we were just creating a stacking context for the tree root, which usually is the viewport element. This lead to weird painting behaviour when negative z-index children of the html element that established their own stacking context were drawn below the canvas background. Now we establish a stacking context for both, the root element and the viewport.
2023-03-11WebDriver: Fix crash in async execute script endpointAliaksandr Kalenik
Removal of dummy execution context in 9aca54091a53b5b287096311a6bbcfdd21f42d2f caused a crash in `execute_async_script` because of empty execution contexts stack during `create_resolving_functions` call.
2023-03-11LibWeb: Don't touch flex items after they we've been frozenAndreas Kling
When using the flex shrink factor, the flexible length resolution algorithm was incorrectly ignoring the `frozen` flag on items and would update the same items again, causing overconsumption of the remaining free space on the flex line.
2023-03-11LibWeb: Use FlexItem::outer_hypothetical_main_size() in one more placeAndreas Kling
Better than doing the calculation manually.
2023-03-11LibWeb: Collapse margin-left with space used by left-side floatsAndreas Kling
We had an issue where boxes with margin-left were shifted right by left-side floats twice instead of just once.
2023-03-11LibWeb: Add fast_is<T>() for various types stood out in a profileAndreas Kling
2023-03-11LibWeb: Use static_cast in SVGGeometryBox::dom_node()Andreas Kling
These are only ever constructed with a corresponding SVGGeometryElement, so we know it's safe to static_cast here.
2023-03-11LibWeb: Don't overflow flex containers on margin autoMathis Wiehl
In case flex items had `margin: auto` on the primary flex axis, we were still also distributing remaining space according to `justify-content` rules. This lead to duplicated spacing in various places and overflows. It looks like this issue was observed previously but missidentified because there was logic to ignore margins at the start and end which would partially paper over the root cause. However this created other bugs (like for example not having a margin at beginning and end ;-)) and I can find nothing in the spec or other browser behaviour that indicates that this is something that should be done. Now we skip justify-content space distribution alltogether if it has already been distributed to auto margins.
2023-03-10LibWeb+Base: Fix row-height bug in Grid when there is a column gapTom
This fixes a bug in the CSS Grid when there is a column and/or row gap, as previously it would take the index of the incorrect column when finding the `AvailableSize`. There is a mild complication in the GridFormattingContext as the OccupationGrid does not take into account the gap columns and rows that later appear in the `Vector<TemporaryTrack>` columns and rows. The PositionedBoxes are kind of a connection between the two, and so it's now more explicit whether you would like to refer to a column by its position taking into the gap columns/rows or not.
2023-03-10LibWeb: Make HTMLScript private members private once againAndreas Kling
These were accidentally made public a while ago. Thankfully nobody started poking into script element internals since then. :^)
2023-03-10LibWeb: Implement Range.createContextualFragment()Andreas Kling
2023-03-10LibWeb: Implement Element.setAttributeNode{,NS}()Andreas Kling
2023-03-10LibWeb: Implement Document.createAttribute{,NS}()Andreas Kling
2023-03-10LibWeb: Rewrite FFC "resolve flexible lengths" algorithm from draft specAndreas Kling
The draft CSS-FLEXBOX-1 spec had a more detailed description of this algorithm, so let's use that as our basis for the implementation. Test by Aliaksandr. :^)
2023-03-10LibWeb: Fix bogus min/max-height for box-sizing:border-box flex itemsAndreas Kling
When resolving these constraints to CSS pixel sizes, we have to resolve padding-top and padding-bottom against the flex container's *width*, not its height.
2023-03-10LibWeb: Fix bogus percentage vertical padding with box-sizing:border-boxAndreas Kling
The padding-top and padding-bottom properties are relative to the *width* of the containing block, not the height. It's funny how we keep making this same mistake again and again. :^)
2023-03-10LibWeb: Simplify FFC get_pixel_{width,height} internal helper APIAndreas Kling
These took an Optional<CSS::Size> for some reason, but that was not necessary. Just take a CSS::Size.
2023-03-10LibWeb: Avoid unnecessary work for `box-sizing: content-box` flex itemsAndreas Kling
2023-03-10LibWeb: Use equals_ignoring_ascii_case() in infra helperAndreas Kling
2023-03-10Everywhere: Rename equals_ignoring_case => equals_ignoring_ascii_caseAndreas Kling
Let's make it clear that these functions deal with ASCII case only.
2023-03-09LibWeb: Use shadow_root_internal() when building <input> UA shadow DOMAndreas Kling
2023-03-09LibWeb: Avoid an unnecessary vector copy when generating flex itemsAndreas Kling
2023-03-09LibWeb: Remove FFC hack where we assign flex item box dimensions twiceAndreas Kling
This was necessary in the past, because IFC would set the height of its containing block after inline layout. Now that IFC can properly communicate the automatic size to its parent formatting context, this hack is no longer necessary.
2023-03-09LibWeb: Make CSS rule cache smarter about pseudo elementsAndreas Kling
Instead of putting every rule that matches a pseudo element in the same bucket, let them go in the best ID/class/tag name bucket instead. Then, add a flag to MatchingRule that says whether it contains a pseudo element in the rightmost compound selector. When deciding which selectors to run for an element, we can now simply filter in/out pseudo element selectors as appropriate depending on what we're trying to match. This fixes an issue where pages using Font Awesome had 1700+ rules in the pseudo-element rule cache. (This meant all those rules had to run against every element twice or more while instantiating pseudo elements.)
2023-03-09LibWeb: Rename FFC::specified_axis_size() to inner_axis_size()Andreas Kling
"Specified" means something else in CSS, so let's not use this overloaded word here. These helpers return the inner main/cross size of a given box, so let's say "inner" instead.
2023-03-09LibWeb: Use `FlexItem& item` consistenly in FlexFormattingContextAndreas Kling
There was a pointless mix of `FlexItem*` vs `FlexItem&` as well as `flex_item` vs `item`. Let's pick one and be consistent.
2023-03-09LibWeb: Always include shadow roots in DOM debug dumpsAndreas Kling
2023-03-09AK: Remove infallible version of StringBuilder::to_byte_bufferLinus Groh
Also drop the try_ prefix from the fallible function, as it is no longer needed to distinguish the two.
2023-03-09LibWeb: Use fallible version of StringBuilder::to_byte_bufferKarol Baraniecki
2023-03-08LibWeb: Add FormDataIterator implementationKenneth Myhra
This adds the FormDataIterator implementation so we can iterate over FormData.{keys(),values(),entries()}.
2023-03-08LibWeb: Add `readiness()` getter in DocumentAliaksandr Kalenik
This getter returns the same readiness state of document as `ready_state()` getter that is already present returns but without allocating string.
2023-03-08LibWeb: Implement the CSS rule cache optimization for UA style as wellAndreas Kling
We were already sorting the author style selectors into buckets. Now we do it for the built-in UA style as well. This means less work for the selector engine everywhere :^)
2023-03-08LibWeb: Convert DOM::Element::m_classes to the new AK::FlyStringAndreas Kling
This makes selector matching significantly faster by not forcing us to convert from FlyString to DeprecatedFlyString when matching class selectors. :^)
2023-03-08LibWeb: Do not discard String returned from url_encode() to avoid UAFKenneth Myhra
This caused UAF since the string returned from url_encode() was immediately discarded. Co-authored-by: Luke Wilde <lukew@serenityos.org>
2023-03-07LibWeb/Bindings: Remove now unused REPLACEABLE_PROPERTY_SETTER() macroLinus Groh
2023-03-07LibWeb/HTML: Port Window.queueMicrotask() to IDLLinus Groh
2023-03-07LibWeb/HTML: Port Window.structuredClone() to IDLLinus Groh
2023-03-07LibWeb/HTML: Port Window.sessionStorage to IDLLinus Groh
2023-03-07LibWeb/HTML: Port Window.localStorage to IDLLinus Groh
2023-03-07LibWeb/HTML: Port Window.fetch() to IDLLinus Groh
2023-03-07LibWeb/HTML: Port Window.cancelAnimationFrame() to IDLLinus Groh
2023-03-07LibWeb/HTML: Port Window.requestAnimationFrame() to IDLLinus Groh
2023-03-07LibWeb/HTML: Port Window.cancelIdleCallback() to IDLLinus Groh