summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb
AgeCommit message (Collapse)Author
2022-10-06Base+LibWeb: Stub out negative spansmartinfalisse
Ensure that when a grid item is passed with a span and a fixed end position, that if the resulting start of this item is less than 0 then it won't throw. This is a temporary measure until the correct functionality is implemented.
2022-10-06LibWeb: Factor out OccupationGrid functionsmartinfalisse
Clean up the code by using an OccupationGrid class. This was a neat idea proposed by MacDue.
2022-10-06LibWeb: Truncate oversized grid spansmartinfalisse
If a span makes a CSS Grid item overflow vertically, then it should be truncated as done on other web engines.
2022-10-06LibWeb: Fix bug in placing row-constrained grid itemsmartinfalisse
For row-constrained items (with a row position defined in the CSS), should be checking for an available position in that row and not in another..
2022-10-06LibWeb: Use span values for auto-positioned grid itemsmartinfalisse
Auto-positioned items should also take into account the span attributes passed to them.
2022-10-06LibWeb: Handle different span properties for GridTrackPlacement parsingmartinfalisse
These changes improve the parsing of the span property, including handling negative values for the span (defaults to 1), as well as when no number is passed (also defaults to 1).
2022-10-06LibWeb: Use ident instead of to_string in parsermartinfalisse
Use the ident() function instead of to_string() for parsing. Fix this up in the rect parser as well.
2022-10-06LibWeb: Fix bug in spec implementation auto_placement_cursormartinfalisse
2022-10-06LibWeb: Fix implementation bugs of grid track is_span()martinfalisse
After having corrected the tracking of span variables in the GridTrackPlacement class, now can fix some small bugs for its correct implementation in the GridFormattingContext class.
2022-10-06LibWeb: Make it easier to check if grid track is auto positionedmartinfalisse
Add some helper functions for checking if a grid-track is auto-positioned. I think this makes the code more legible.
2022-10-06LibWeb+Base: Re-implement grid track spanmartinfalisse
Implement span correctly when indicated in the grid-column-start, grid-row-start, etc. CSS properties. Previously it had been implemented as if span was something that went alongside the position property, but actually it seems like if you do 'span 3' in the grid-column-start property, for example, this means it literally spans 3 blocks, and the 3 has nothing to do with position.
2022-10-06LibWeb: Fix bug in checking if GridTrackPlacement is auto-positionedmartinfalisse
This fixes something I thought I had already fixed everywhere, where previously there wasn't the possibility to have an Auto GridTrackPlacement and so the Auto "implementation" was simply checking if the position of the track was 0.
2022-10-06LibWeb: Make TreeBuilder treat inline-flex's children correctlyAndreas Kling
We were skipping over inline flex containers when looking for an insertion parent. This made us not generate flex items in those cases. This commit changes the behavior, so that non-inline-level items can get inserted into an inline-outside parent, as long as the parent isn't just flow-inside.
2022-10-06LibWeb: Use text node's own display value when inserting CSS `content`Andreas Kling
This ensures that the pseudo element wrapper is transformed into a block container with inline children if needed.
2022-10-06LibWeb: Only consider inline-outside flag when choosing insertion typeAndreas Kling
Now that we don't have to deal with the ad-hoc "inline" flag on layout nodes anymore, we're free to simply obey the inline-outside flag from the CSS display value when choosing whether to insert as an inline-level node or not.
2022-10-06LibWeb: Use correct cache key for pseudo elementsAndreas Kling
We were incorrectly caching both ::before and ::after pseudo elements with the ::before key. This regressed in 1ab7a8e0dbb5ee5195ab67c7c3f81c7f9f5f3f02.
2022-10-06LibWeb: Generate a BlockContainer box for display:inline-flexAndreas Kling
We were previously generating an InlineNode, which is not a Box. We need some type of Box to do flex layout, so let's just make a BlockContainer.
2022-10-06LibWeb: Make IFC happy to layout anything as long as it's inline outsideAndreas Kling
Before this, whenever encountering something other than dumb text content in an inline flow, we assumed it had to be either a replaced element, or an inline-block. This removes the special-casing of inline-block so that IFC can size and layout anything as long as it's inline on the outside.
2022-10-06LibWeb: Fix unsafe capture in fetch_external_module_script_graph()Andreas Kling
We can't be capturing the AK::URL by reference here, since on_complete may be called later, after the value is no longer alive.
2022-10-06LibWeb: Don't try to layout inside of replaced elements in BFCAndreas Kling
2022-10-06LibWeb: Make sure replaced elements never create a BFCAndreas Kling
2022-10-06LibWeb: Remove unnecessary verify_cast in greatest_child_width()Andreas Kling
2022-10-06LibWeb: Remove bogus verify_cast when dimensioning inline-blocksAndreas Kling
There's no need to make the assumption that any inline-block box will be represented by a BlockContainer. Nothing we do with the box here requires that specific type anyway.
2022-10-06LibWeb: Tidy up FormattingContext::creates_block_formatting_context()Andreas Kling
We use comments from MDN here, since the rules for creating a BFC are inconsistently spread across many different specifications.
2022-10-06LibWeb: Push the realm execution context before linking modulesnetworkException
This patch adds a non standard step pushing the realm execution context of fetching client's settings object onto the execution context stack before linking a module script. Without the realm execution context there is no current settings object, leading to a crash in HostResolveImportedModule.
2022-10-06LibWeb: Add support for type module in HTMLScriptElementnetworkException
This patch adds support for script elements with the type attribute set to "module". As a first cut the changes are mainly focused around inline scripts. Co-authored-by: davidot <davidot@serenityos.org>
2022-10-06LibWeb: Implement two module related host hooksnetworkException
This patch adds support for the HostGetSupportedImportAssertions and HostResolveImportedModule host hooks. Co-authored-by: davidot <davidot@serenityos.org>
2022-10-06LibWeb: Implement fetching module scriptsnetworkException
This patch adds various algorithms required to fetch and link module scripts. Some parts such as actually creating a request and error handling are not implemented or use temporary non spec compliant code to get us further. Co-authored-by: davidot <davidot@serenityos.org>
2022-10-06LibWeb: Implement ModuleScript and JavaScriptModuleScriptnetworkException
This patchs adds the Web::HTML::Script subclass ModuleScript and JavaScriptModuleScript as a type of ModuleScript as well as various algorithms related to JavaScript module scripts. Co-authored-by: davidot <davidot@serenityos.org>
2022-10-06LibWeb: Implement ModuleMap and expose it on EnvironmentSettingsObjectnetworkException
This patch adds the ModuleMap class used to keep track of the type and url of a module as well as the fetching state associated. Each environment settings object now also has a module map.
2022-10-06LibWeb: Allow all Script types to be used as [[HostDefined]] valuesnetworkException
This patch adds support for all child classes of Web::HTML::Script to be used in the [[HostDefined]] field of JS::Modules and JS::Scripts.
2022-10-06LibWeb: Implement module type allowednetworkException
This patch adds the module type allowed steps given a module type string and an environment settings object.
2022-10-06LibWeb: Implement more close to spec javascript mime type checkingnetworkException
Previously we would simply check the an input string against a list of mime type essences, ignoring that the input might not be a valid mime type or contain parameters. This patch moves the helpers into the MimeSniff namespace and properly parses an input string before comparing the essence.
2022-10-06LibWeb: Use CSS::Display::is_flow_inside() in InlineLevelIteratorAndreas Kling
This is a more correct check than !is_inline_block(), as it now enters all elements that have inline behavior on the outside and flow behavior on the inside.
2022-10-06LibWeb: Use Layout::Node::display() everywhereAndreas Kling
2022-10-06LibWeb: Add Layout::Node::display()Andreas Kling
This will return something sensible for style-less nodes as well.
2022-10-06LibWeb: Remove Layout::Node::set_inline()Andreas Kling
Now that this flag is no longer used, we can stop setting it.
2022-10-06LibWeb: Make labels be `display: inline-block` in the default UA styleAndreas Kling
This is weird, but matches the behavior we've had so far. Leaving a FIXME about how this doesn't seem right.
2022-10-06LibWeb: Remove ad-hoc <hr> element rule from default UA styleAndreas Kling
This element is already covered by spec rules. :^)
2022-10-06LibWeb: Add a little header to the top of the default UA stylesheetAndreas Kling
Since all the spec sections are annotated with comments already, let's also have a comment mentioning that the file starts with ad-hoc rules.
2022-10-06LibWeb: Honor CSS display value in is_inline() and is_inline_block()Andreas Kling
These were totally ad-hoc before, is_inline() was based on a boolean flag on Layout::Node that we set in various situations. Meanwhile, is_inline_block() was a combination on is_inline() plus a type check to see if the layout node inherited from BlockContainer. This patch replaces the above mess with simple lookups of the CSS display value. Note that layout nodes without their own style (i.e text nodes) are automatically assumed to be inline and non-blocks. This has to be special-cased since layout nodes without style will consult the style of their parent, so without short-circuiting this would break.
2022-10-06LibWeb: Base Layout::TreeBuilder decisions on CSS display propertyAndreas Kling
This is one of many small steps towards being able to remove the ad-hoc Layout::Node::is_inline() in favor of honoring the CSS display value everywhere instead.
2022-10-06LibWeb: Simplify construction of :before and :after pseudo elementsAndreas Kling
Let create_pseudo_element_if_needed() take care of inserting the pseudo elements into the layout tree as well.
2022-10-06LibWeb: Split out helper functions in TreeBuilder::create_layout_tree()Andreas Kling
Let's make this function a little easier to understand by splitting out helpers into separate functions.
2022-10-06LibWeb: Make the initial containing block style have `display:block`Andreas Kling
We always create a Layout::InitialContainingBlock for the ICB, but in a future where we always honor the CSS::Display everywhere, we need to make sure everyone has the right display values.
2022-10-05LibWeb: Make Fetch::Infrastructure::{Request,Response} ref-countedLinus Groh
With the addition of the 'fetch params' struct, the single ownership model we had so far falls apart completely. Additionally, this works nicely for FilteredResponse's internal response instead of risking a dangling reference. Replacing the public constructor with a create() function also found a few instances of a Request being stack-allocated!
2022-10-05LibWeb: Add missing Request::policy_container() getter and setterLinus Groh
2022-10-05LibWeb: Make Fetch::Infrastructure::Request::set_client() take a pointerLinus Groh
2022-10-05LibWeb: Add missing link to Fetch::Infrastructure::Response memberLinus Groh
2022-10-05LibWeb: Add missing links to Fetch::Infrastructure::Request membersLinus Groh