summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb
AgeCommit message (Collapse)Author
2023-05-26LibWeb: Reset margin collapsing state only if box indeed add clearanceAliaksandr Kalenik
This fixes the issue when margin collapsing state was always reset if a box has clear property not equal to none even if it does not actually introduce clearance.
2023-05-26LibWeb: Avoid nullptr dereference when parsing grid sizesSam Atkins
2023-05-26LibWeb: Consume sign in `SVG::parse_elliptical_arg_argument`Cameron Youell
This was crashing on google.com with the linux chrome user agent, interestingly it seems like this behavior may have been accidental as only two of the three `parse_number()` were changed in f7dbcb6
2023-05-26LibWeb: Get reference height from closest non-anonymous ancestorAndi Gallo
Ignore anonymous block boxes when resolving percentage weights that would refer to them, per the CSS 2 visual formatting model specification. This fixes the case when we create an anonymous block between an image which uses a percentage height relative to a parent which specifies a definite height. Fixes #19052.
2023-05-26LibWeb: Return DOMException instead of crashing when setting attributesPrestonLTaylor
2023-05-25LibWeb: Do the CORS cross-origin workaround to find MIME type for imagesAndreas Kling
This makes cross-origin image loads actually see the MIME type the server tells us. :^)
2023-05-25LibWeb: Make Fetch::Infrastructure::HeaderList::is_empty() publicAndreas Kling
2023-05-25LibWeb: Don't crash on unimplemented CSS display typeAndreas Kling
If some page throws "display: ruby-text" or some such at us, let's just complain and carry on.
2023-05-25LibWeb: Try failed font lookups again without weight and slopeAndreas Kling
If CSS requests a font that we have loaded, but we didn't associate it with a specific weight and/or slope, let's still use it if it matches the family name. This is a hack until we implement proper CSS font selection.
2023-05-25LibWeb: Add CustomIdentStyleValue, along with parsing for itSam Atkins
This corresponds to the `<custom-ident>` type in CSS grammar.
2023-05-25LibWeb: Handle invalid UTF-8 in Fetch's Body#text()0GreenClover0
2023-05-25LibWeb: Make input element placeholders look betterAndreas Kling
We now create a flex container inside the input element's UA shadow tree and add the placeholder and non-placeholder text as flex items (wrapped in elements whose style we can manipulate). This fixes the visual glitch where the placeholder would appear below the bounding box of the input element. It also allows us to align the text vertically inside the input element (like we're supposed to). In order to achieve this, I had to make two small architectural changes to layout tree building: - Elements can now report that they represent a given pseudo element. This allows us to instantiate the ::placeholder pseudo element as an actual DOM element inside the input element's UA shadow tree. - We no longer create a separate layout node for the shadow root itself. Instead, children of the shadow root are treated as if they were children of the DOM element itself for the purpose of layout tree building.
2023-05-25LibWeb: Make HTMLDivElement not "final"Andreas Kling
This is to prepare for making some custom internal divs inside the input element UA shadow tree.
2023-05-25LibWeb: Remove now-unused `parse_css_value(ComponentValue)` methodSam Atkins
:^)
2023-05-25LibWeb: Use new StyleValue parsing for transform-originSam Atkins
2023-05-25LibWeb: Use new StyleValue parsing for text-decorationSam Atkins
2023-05-25LibWeb: Use new StyleValue parsing for text-decoration-lineSam Atkins
2023-05-25LibWeb: Use new StyleValue parsing for overflowSam Atkins
2023-05-25LibWeb: Use new StyleValue parsing for list-styleSam Atkins
2023-05-25LibWeb: Use new StyleValue parsing for contentSam Atkins
2023-05-25LibWeb: Use new StyleValue parsing for font and font-familySam Atkins
2023-05-25LibWeb: Use new StyleValue parsing for flex-flowSam Atkins
2023-05-25LibWeb: Use new StyleValue parsing for border and its sided versionsSam Atkins
2023-05-25LibWeb: Use new StyleValue parsing for flexSam Atkins
To make this work, we also add `none` as a valid identifier for `flex`. (This is correct, we just didn't need it before.)
2023-05-25LibWeb: Use new StyleValue parsing for background-sizeSam Atkins
2023-05-25LibWeb: Use new StyleValue parsing for background-repeatSam Atkins
2023-05-25LibWeb: Use new StyleValue parsing for background-position[-x,-y]Sam Atkins
2023-05-25LibWeb: Use new StyleValue parsing for `background`Sam Atkins
2023-05-25LibWeb: Use new StyleValue parsing for "simple" propertiesSam Atkins
That is, properties that don't have a bespoke parsing function.
2023-05-25LibWeb: Implement smarter CSS StyleValue parsingSam Atkins
We know what types and identifiers a property can accept, so we can use that information to only parse things that can be accepted. This solves some awkward ambiguity problems that we have now or will face in the future, including: - Is `0` a number or a length with no unit? - Is `3.5` a number or a ratio? - Is `bottom` an identifier, or a custom-ident? Two CSS Parser methods are introduced here: `parse_css_value_for_property()` attempts to parse a StyleValue that the property can accept, skipping any types that it doesn't want. `parse_css_value_for_properties()` does the same, but takes multiple PropertyIDs and additionally returns which one the parsed StyleValue is for. This is intended for parsing shorthands, so you can give it a list of longhands you haven't yet parsed. Subsequent commits will actually use these new methods.
2023-05-25LibWeb: Cache initial property values when parsing `background`Sam Atkins
Previously we were looking these up once per background layer. Let's not do that. :^)
2023-05-25LibWeb: Teach the CSS parser about extra color keywordsSam Atkins
All of these identifiers can be treated as a color, so let's make sure the parser understands that.
2023-05-25LibWeb: Make `property_id_from_string()` return OptionalSam Atkins
2023-05-25LibWeb: Make `value_id_from_string()` return OptionalSam Atkins
2023-05-25LibWeb: Fill in some missing property data and bodge extra typesSam Atkins
We don't yet have generic parsing support for `<filter-value-list>` or `<paint>`, so listing them here confuses the new StyleValue parsing code I'm working on. For now, let's skip `<filter-value-list>` since it's only used in one pkace which manually parses it, and list the parts of `<paint>` instead which are taken from here: https://www.w3.org/TR/SVG2/painting.html#SpecifyingPaint
2023-05-25LibWeb: Remove "Invalid" StyleValue typeSam Atkins
We never actually use this, we always initialize StyleValues with a proper type.
2023-05-24Everywhere: Use MonotonicTime instead of Durationkleines Filmröllchen
This is easily identifiable by anyone who uses Duration::now_monotonic, and any downstream users of that data.
2023-05-24Userland: Remove remaining users of Duration::now_realtime()kleines Filmröllchen
This is a clear sign that they want to use a UnixDateTime instead. This also adds support for placing durations and date times into SQL databases via their millisecond offset to UTC.
2023-05-24AK: Rename Time to Durationkleines Filmröllchen
That's what this class really is; in fact that's what the first line of the comment says it is. This commit does not rename the main files, since those will contain other time-related classes in a little bit.
2023-05-24LibWeb: Stop aggressively quantizing font-weight valuesAndreas Kling
Before this change, we were quantizing to either 400, 700 or 900. This caused us to treat 100/200/300 weighted fonts as if they were interchangeable.
2023-05-24LibWeb: Include weight and slope in CSSFontFaceRule debug dumpsAndreas Kling
2023-05-24LibWeb: Include weight and style in CSSFontFaceRule serializationAndreas Kling
2023-05-24LibWeb: Sum horizontal margins to calculate space used by floatsAliaksandr Kalenik
This fixes the issue where max margin is used to find offset of floating box although horizonal margins do not collapse so they need to be summed instead.
2023-05-24LibWeb: Remove `Gfx::Rect<float>` workarounds from BFCJelle Raaijmakers
No longer is the last horizontal line of pixels ignored during layout. This used to be a bug in `Gfx::Rect<float>` that was fixed in f391ccfe53e18395842d0d6b743d08d23b9108e5.
2023-05-24LibWeb: Honor font-weight and font-style when using downloaded fontsAndreas Kling
Instead of keying downloaded @font-face fonts on just the family name, we now key them on a tuple of the family name, weight and slope.
2023-05-24LibWeb: Parse font-weight and font-style inside @font-face rulesAndreas Kling
2023-05-24LibWeb: Move resolution of font weights and slopes to StyleValueAndreas Kling
This isn't exactly ideal factoring (though I'm not sure what is) but this will make it possible to reuse this code in the parser.
2023-05-24LibWeb: Implement scroll_{width, height}stelar7
2023-05-24LibWeb: Make CSSPixels and Length use 64-bit (double) floating pointAndreas Kling
This fixes a plethora of rounding problems on many websites. In the future, we may want to replace this with fixed-point arithmetic (bug #18566) for performance (and consistency with other engines), but in the meantime this makes the web look a bit better. :^) There's a lot more things that could be converted to doubles, which would reduce the amount of casting necessary in this patch. We can do that incrementally, however.
2023-05-24LibWeb: Honor the font-size even if the font-family is not foundAndreas Kling