Commit graph

575 commits

Author SHA1 Message Date
Sam Atkins
c2f0b20d6b LibWeb: Port FontFace to new Strings 2023-02-19 00:51:16 +01:00
Sam Atkins
33e9c4e1b2 LibWeb: Port GeneralEnclosed to new Strings 2023-02-19 00:51:16 +01:00
Sam Atkins
2026ea557e LibWeb: Use is_ascii_case_insensitive_match() where the spec says to 2023-02-19 00:46:47 +01:00
Kenneth Myhra
64e4d3fd94 LibWeb: Make factory method of CSS::CSSSupportsRule fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
5d9bc378c3 LibWeb: Make factory method of CSS::MediaList fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
a49ea467ad LibWeb: Make factory method of CSS::CSSStyleSheet fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
4f4a908e5f LibWeb: Make factory method of CSS::CSSStyleRule fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
c950d1904a LibWeb: Make factory methods of CSS::CSSStyleDeclaration fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
48872cd190 LibWeb: Make factory methods of CSS::CSSRuleList fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
5601f439f9 LibWeb: Make factory method of CSS::CSSMediaRule fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
d53d8cacec LibWeb: Make factory method of CSS::CSSImportRule fallible 2023-02-18 00:52:47 +01:00
Kenneth Myhra
ff8495de35 LibWeb: Make factory method of CSS::CSSFontFaceRule fallible 2023-02-18 00:52:47 +01:00
Sam Atkins
a381ce9519 LibWeb: Port CSS::Supports to new Strings 2023-02-15 12:48:26 -05:00
Sam Atkins
41c4cc95e4 LibWeb: Port CSS::Parser::Rule to new Strings
`Rule::to_deprecated_string()` and
`DeclarationOrAtRule::to_deprecated_string()` are not used anywhere, so
we can just delete them.
2023-02-15 12:48:26 -05:00
Sam Atkins
bee32b6cd2 LibWeb: Port CSS::Parser::Declaration to new Strings 2023-02-15 12:48:26 -05:00
Sam Atkins
a168cda4a7 LibWeb: Port CSS::Parser::ComponentValue to new Strings 2023-02-15 12:48:26 -05:00
Sam Atkins
05c1b09621 LibWeb: Port CSS::Parser::Function to new Strings 2023-02-15 12:48:26 -05:00
Sam Atkins
abc01cc9fe AK+Tests+LibWeb: Make URL::complete_url() take a StringView
All it does is pass this to `URLParser::parse()` which takes a
StringView, so we might as well take one here too.
2023-02-15 12:48:26 -05:00
Sam Atkins
8af65108e4 LibWeb: Construct CSS Tokenizer and Parser with a StringView encoding
This doesn't need to be a full (Deprecated)String, so let's not force it
to be.
2023-02-15 12:48:26 -05:00
Sam Atkins
476ec563bc LibWeb: Convert CSS Token::to_debug_string() to ::to_string() :^)
Using from_utf8_short_string() for all cases that are <= 3 bytes long.
Which is almost all of the static ones.
2023-02-13 14:35:40 +00:00
Aliaksandr Kalenik
ab99e95549 LibWeb: Parse font-stretch CSS property 2023-02-03 12:49:13 +00:00
martinfalisse
9bc001f410 LibWeb: Parse grid-area CSS property 2023-01-21 14:35:00 +01:00
martinfalisse
a6548c4d80 LibWeb: Parse grid-template-areas CSS property 2023-01-21 14:35:00 +01:00
martinfalisse
0448547553 LibWeb: Parse min and max-content
Parse min and max-content as well as use its values in the GridTrackSize
class.
2023-01-21 14:35:00 +01:00
martinfalisse
9d99bd8258 LibWeb: Use String class in certain CSS Grid classes
Converts the remaining instances of DeprecatedString to String in the
CSS Grid classes.
2023-01-21 14:35:00 +01:00
Timothy Flynn
f3db548a3d AK+Everywhere: Rename FlyString to DeprecatedFlyString
DeprecatedFlyString relies heavily on DeprecatedString's StringImpl, so
let's rename it to A) match the name of DeprecatedString, B) write a new
FlyString class that is tied to String.
2023-01-09 23:00:24 +00:00
martinfalisse
ce0f41b9fb LibWeb+WebContent: Use new String class in CSS::StyleValue
Converts uses of DeprecatedString to String in StyleValue, and patches
surrounding files that depend on these functions.
2023-01-09 11:09:31 +01:00
Sam Atkins
7d40e3eb0d LibWeb: Replace all px Length creation with Length::make_px(CSSPixels) 2023-01-05 17:42:31 +01:00
MacDue
d3588a9a2b LibWeb: Support calc() values in background-position 2022-12-11 22:09:24 +01:00
Linus Groh
57dc179b1f Everywhere: Rename to_{string => deprecated_string}() where applicable
This will make it easier to support both string types at the same time
while we convert code, and tracking down remaining uses.

One big exception is Value::to_string() in LibJS, where the name is
dictated by the ToString AO.
2022-12-06 08:54:33 +01:00
Linus Groh
6e19ab2bbc AK+Everywhere: Rename String to DeprecatedString
We have a new, improved string type coming up in AK (OOM aware, no null
state), and while it's going to use UTF-8, the name UTF8String is a
mouthful - so let's free up the String name by renaming the existing
class.
Making the old one have an annoying name will hopefully also help with
quick adoption :^)
2022-12-06 08:54:33 +01:00
MacDue
28028be2fc LibWeb: Support repeating-radial-gradient()s 2022-12-03 09:06:51 -05:00
MacDue
22a7611e1c LibWeb: Parse radial-gradient()s 2022-11-30 14:24:04 +00:00
MacDue
f1f1977e2d LibWeb: Move color stop list parsing to standalone functions
This makes these slightly less clunky to use for other gradient types.
2022-11-30 14:24:04 +00:00
MacDue
c02163c31f LibWeb: Allow optional values to be missing when parsing <position>s 2022-11-30 14:24:04 +00:00
martinfalisse
513a123728 LibWeb: Handle multiple line names in the CSS Grid
Prevent crashing when multiple line names are declared in the
grid-template-* CSS properties by skipping over the character separating
each line name.
2022-11-21 21:48:25 +00:00
Aliaksandr Kalenik
2675b9390b LibWeb: Parse unknown media type in media queries
Prevent media query parser from falling back into
MediaQuery::create_not_all() for queries with unknown media type.
With this change following test works correctly:
http://wpt.live/css/css-conditional/at-media-001.html
2022-11-14 16:08:35 +00:00
Aliaksandr Kalenik
93238edf8f LibWeb: Respect media attribute of style tag 2022-11-14 14:47:37 +00:00
MacDue
2c2b9fb1d7 LibWeb: Parse repeating-conic-gradient()s 2022-11-07 13:13:22 +00:00
MacDue
51cd37110a LibWeb: Fix parsing conic-gradient()s with only at <position>
This fixes parsing conic-gradient()s like:

  conic-gradient(at 60% 45%, red, yellow, green)

Where you have a center position but no starting angle.
2022-11-06 01:42:55 +00:00
Andreas Kling
8869dec5fd LibWeb: Add CSS::Parser helper for parsing a standalone "calc()" value 2022-11-02 22:42:48 +01:00
Aliaksandr Kalenik
e4db71c88b LibWeb: Support translate3d 2022-11-02 11:04:23 +00:00
Aliaksandr Kalenik
f099e2aa12 LibWeb: Use more verbose input in CSS transform function generator 2022-11-02 11:04:23 +00:00
MacDue
49497044de LibWeb: Parse conic-gradient()s
This parses conic-gradient()s while also attempting to share the bulk
of the parsing code with linear-gradient()s. This is done by extracting
the <color-stop-list> parsing to a "fill in the blacks" generic
function. This is a little awkward but cuts down on a lot of copy
pasting of code.
2022-11-01 23:07:05 +00:00
MacDue
ee72dcd523 LibWeb: Parse CSS <position>s
This parses <position> according to the following grammer:

<position> = [
  [ left | center | right ] || [ top | center | bottom ]
|
  [ left | center | right | <length-percentage> ]
  [ top | center | bottom | <length-percentage> ]?
|
  [ [ left | right ] <length-percentage> ] &&
  [ [ top | bottom ] <length-percentage> ]
]

The code is a little hairy and simply tries each alternative in turn,
manually checking the possible orders. There may be a better way to
represent this.
2022-11-01 23:07:05 +00:00
martinfalisse
829f56572d LibWeb: Parse line names in grid track position properties
Parse line names when passed to the grid-column/row-start/end CSS
properties.
2022-11-01 11:19:41 +01:00
martinfalisse
78a573d678 LibWeb: Parse line names in grid track size declarations
Parse line names in the grid-template-* CSS properties.
2022-11-01 11:19:41 +01:00
martinfalisse
b2b677e984 LibWeb: Refactor GridTrackSize classes
Refactor various classes in the GridTrackSize file for the incoming
named_tracks feature.

Previously the ExplicitTrackSizing had mixed responsiblities with the
newly-named GridRepeat class. This made it so it was not possible to
have multiple repeats within a single 'GridTrackSizeList' definition.

The MetaGridTrackSize class had both the responsibilities of being a
container for minmax values as well as for simple GridSizes. By uniting
the different possible values (repeat, minmax, default) into the
ExplicitGridTrack class are able to be more expressive as to the
different grid size modalities.

The GridTrackSizeList will be useful as compared to a
Vector<ExplicitGridTrack> since this way can keep track of the declared
line names. These same line names are able to be declared within the
values of a repeat function, hence the presence of a GridTrackSizeList
inside the GridRepeat class.
2022-11-01 11:19:41 +01:00
martinfalisse
e227e8027f LibWeb: Parse minmax() value
Parse the minmax() function when passed to the grid-template-columns or
grid-template-rows CSS property.
2022-10-15 16:04:01 +02:00
martinfalisse
a5f042b424 LibWeb: Parse auto-fill and auto-fit attributes
Parse auto-fill and auto-fit attributes for the CSS Grid.
2022-10-15 16:04:01 +02:00