Commit Graph

50702 Commits

Author SHA1 Message Date
Aliaksandr Kalenik
6891676fce LibGfx: Fix glyph render to create implied points in start/end of path
Implied point = point created by two subsequent "off curve" points.

Fixes following issues in function that builds glyph path from points:
- If first point is "off curve" it was wrongly treated as "on curve"
  which caused wrong first point position in the path.
- If both first and last points in the path are "off curve" implied
  point was not created between them which caused wrong path shape in
  the end of the path.
2023-05-26 05:21:08 +02:00
sec05
6a886e4aac Browser: Download Widget file and directory text changes
fixes #18678

This is because the "From:" URL regularly overflows the line, leading
to an unreadable mess. Make sure that the labels for the widget
don't wrap as well, as the widget is fixed height and width.
2023-05-25 17:45:16 -06:00
Andreas Kling
624f43c12b LibWeb: Do the CORS cross-origin workaround to find MIME type for images
This makes cross-origin image loads actually see the MIME type the
server tells us. :^)
2023-05-25 12:53:41 -07:00
Andreas Kling
aeffa0d988 LibWeb: Make Fetch::Infrastructure::HeaderList::is_empty() public 2023-05-25 12:53:41 -07:00
Daniel Bertalan
906abbdf53 Kernel/aarch64: Fix build after #17842 2023-05-25 08:26:07 -07:00
Andreas Kling
475bac89e1 LibWeb: Don't crash on unimplemented CSS display type
If some page throws "display: ruby-text" or some such at us, let's just
complain and carry on.
2023-05-25 16:49:34 +02:00
Andreas Kling
9c8da4374d LibWeb: Try failed font lookups again without weight and slope
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-25 16:49:34 +02:00
Sam Atkins
f6fae315e3 LibWeb: Add CustomIdentStyleValue, along with parsing for it
This corresponds to the `<custom-ident>` type in CSS grammar.
2023-05-25 15:31:20 +01:00
Jelle Raaijmakers
b76219f702 Meta: Add myself to CODEOWNERS for LibSQL 2023-05-25 06:19:16 -07:00
Jelle Raaijmakers
69e09fed39 LibSQL: Free heap storage when deleting rows 2023-05-25 06:19:16 -07:00
Jelle Raaijmakers
c58c87d7ef LibSQL: Implement freeing heap storage
This allows us to free entire chains of blocks in one go.
2023-05-25 06:19:16 -07:00
Jelle Raaijmakers
d7bbb8d64a LibSQL: Find free blocks when opening a database file
The free block list now gets populated on opening a database file.
Ideally we persist this list inside the heap itself, but for now this
prevents excessive heap growth.
2023-05-25 06:19:16 -07:00
Jelle Raaijmakers
a6abc1697f LibSQL: Keep track of free heap blocks when trimming storage
When overwriting existing heap storage that requires fewer blocks, make
sure to free all remaining blocks so they can be reused in the future.
2023-05-25 06:19:16 -07:00
Jelle Raaijmakers
c5ebc4bb40 LibSQL: Reuse heap blocks when overwriting storage
Previously, only the first block in a chain of blocks would be
overwritten while all subsequent blocks would be appended to the heap.
Now we make sure to reuse all existing blocks in the chain.
2023-05-25 06:19:16 -07:00
Jelle Raaijmakers
2d2911e1a3 LibSQL: Test SQL::Heap separately
Move the long storage test from TestSqlStatementExecution into a new
test unit called TestSqlHeap. Split it up into a flushed and non-flushed
variant so we test the write-ahead log as well.
2023-05-25 06:19:16 -07:00
Jelle Raaijmakers
d5df832318 LibSQL: Clean up TestSqlDatabase
Missing imports, make methods static. No functional changes.
2023-05-25 06:19:16 -07:00
0GreenClover0
b4c6cddd96 LibWeb: Handle invalid UTF-8 in Fetch's Body#text() 2023-05-25 06:03:40 -07:00
Andreas Kling
7d24c13d8b LibWeb: Make input element placeholders look better
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-25 14:42:24 +02:00
Andreas Kling
6fb661e781 LibWeb: Make HTMLDivElement not "final"
This is to prepare for making some custom internal divs inside the input
element UA shadow tree.
2023-05-25 14:42:24 +02:00
kuchikuu
ce764c340a Documentation: Add Qt6 SVG module to Ladybird build deps on Arch
Qt6 SVG is required to successfully compile Ladybird.

Without this package, a compilation error occurs:
Failed to find required Qt component "Svg".
2023-05-25 04:52:36 -06:00
Xexxa
8f16d37f00 Ladybird: Add shortcut to "Close Current Tab" 2023-05-25 09:04:11 +01:00
Xexxa
850b713889 Ladybird: Move "Settings" from "File" to "Edit" 2023-05-25 09:04:11 +01:00
Xexxa
689954dfc1 Ladybird: Add missing icons 2023-05-25 09:04:11 +01:00
Sam Atkins
6b8f484114 LibWeb: Stop generating now-unused property_accepts_value() function 2023-05-25 06:36:10 +02:00
Sam Atkins
c0e61f92c0 LibWeb: Remove now-unused parse_css_value(ComponentValue) method
:^)
2023-05-25 06:36:10 +02:00
Sam Atkins
7e8ed996c9 LibWeb: Use new StyleValue parsing for transform-origin 2023-05-25 06:36:10 +02:00
Sam Atkins
f759a16087 LibWeb: Use new StyleValue parsing for text-decoration 2023-05-25 06:36:10 +02:00
Sam Atkins
a473f6074d LibWeb: Use new StyleValue parsing for text-decoration-line 2023-05-25 06:36:10 +02:00
Sam Atkins
a7a61c4cd9 LibWeb: Use new StyleValue parsing for overflow 2023-05-25 06:36:10 +02:00
Sam Atkins
2da15f987f LibWeb: Use new StyleValue parsing for list-style 2023-05-25 06:36:10 +02:00
Sam Atkins
7386ed7cfb LibWeb: Use new StyleValue parsing for content 2023-05-25 06:36:10 +02:00
Sam Atkins
c8626f2294 LibWeb: Use new StyleValue parsing for font and font-family 2023-05-25 06:36:10 +02:00
Sam Atkins
100adffdfb LibWeb: Use new StyleValue parsing for flex-flow 2023-05-25 06:36:10 +02:00
Sam Atkins
5d8b01ad04 LibWeb: Use new StyleValue parsing for border and its sided versions 2023-05-25 06:36:10 +02:00
Sam Atkins
91c9d10a78 LibWeb: Use new StyleValue parsing for flex
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-25 06:36:10 +02:00
Sam Atkins
021fd15434 LibWeb: Use new StyleValue parsing for background-size 2023-05-25 06:36:10 +02:00
Sam Atkins
8e34bdc123 LibWeb: Use new StyleValue parsing for background-repeat 2023-05-25 06:36:10 +02:00
Sam Atkins
a0ec05ef81 LibWeb: Use new StyleValue parsing for background-position[-x,-y] 2023-05-25 06:36:10 +02:00
Sam Atkins
b0fe07cba3 LibWeb: Use new StyleValue parsing for background 2023-05-25 06:36:10 +02:00
Sam Atkins
d90ad19201 LibWeb: Use new StyleValue parsing for "simple" properties
That is, properties that don't have a bespoke parsing function.
2023-05-25 06:36:10 +02:00
Sam Atkins
bcacc2357e LibWeb: Implement smarter CSS StyleValue parsing
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-25 06:36:10 +02:00
Sam Atkins
da4b2d9ca3 LibWeb: Cache initial property values when parsing background
Previously we were looking these up once per background layer. Let's not
do that. :^)
2023-05-25 06:36:10 +02:00
Sam Atkins
aad2f0963f LibWeb: Teach the CSS parser about extra color keywords
All of these identifiers can be treated as a color, so let's make sure
the parser understands that.
2023-05-25 06:36:10 +02:00
Sam Atkins
465ecf37c2 LibWeb: Make property_id_from_string() return Optional 2023-05-25 06:36:10 +02:00
Sam Atkins
03613dc14d LibWeb: Make value_id_from_string() return Optional 2023-05-25 06:36:10 +02:00
Sam Atkins
9b61f79eae LibWeb: Generate property_accepts_[identifier/type]() functions
These will be used to parse StyleValues more intelligently.
2023-05-25 06:36:10 +02:00
Sam Atkins
6f3e48db57 LibWeb: Fill in some missing property data and bodge extra types
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-25 06:36:10 +02:00
Sam Atkins
5533413061 LibWeb: Remove "Invalid" StyleValue type
We never actually use this, we always initialize StyleValues with a
proper type.
2023-05-25 06:36:10 +02:00
kleines Filmröllchen
3c212c8535 AK: Remove Duration::now_monotonic
This is the end of absolute time support in Duration. :^)
2023-05-24 23:18:07 +02:00
kleines Filmröllchen
fc5cab5c21 Everywhere: Use MonotonicTime instead of Duration
This is easily identifiable by anyone who uses Duration::now_monotonic,
and any downstream users of that data.
2023-05-24 23:18:07 +02:00