Commit graph

4011 commits

Author SHA1 Message Date
Egor Ananyin
f567414f65 LibWeb: Draw elements with opacity in a separate stacking context 2021-07-24 22:02:28 +04:30
Egor Ananyin
0e6ba6e1d3 LibWeb: Parse and store the opacity property 2021-07-24 22:02:28 +04:30
Egor Ananyin
495f69b76b LibWeb: Don't paint children stacking contexts inside the current one 2021-07-24 22:02:28 +04:30
Ali Mohammad Pur
faef523567 LibRegex: Make unclosed-at-eof brace quantifiers an error
Otherwise we'd just loop trying to parse it over and over again, for
instance in `/a{/` or `/a{1,/`.
Unless we're parsing in Annex B mode, which allows `{` as a normal
ExtendedSourceCharacter.
2021-07-24 20:52:43 +04:30
Ali Mohammad Pur
1dd1378159 LibRegex: Preserve the type of the match when clearing capture groups
Even though the contents are supposed to be reset, the type should stay
unchanged, as that's an assumption the engine is making.
2021-07-24 20:52:43 +04:30
Luke
e80f8746b1 LibIMAP: Use try_parse_number instead of parse_number when parsing parts
This makes it so we can use Optional instead of relying on an error
number.
2021-07-24 20:11:28 +04:30
Luke
2c793d5935 LibIMAP: Make Section::parts unsigned 2021-07-24 20:11:28 +04:30
Luke
27644785f1 LibIMAP: Add method to get data out of BodyStructure 2021-07-24 20:11:28 +04:30
Luke
c63913b633 LibIMAP: Add quoted printable decoder
This is a very common encoding for e-mail. Gmail seems to encode all
HTML e-mail in it.
imap qp clang
2021-07-24 20:11:28 +04:30
Tobias Christiansen
9c65c10245 LibWeb: Add calc() resolution to CSS::Length
This patch finally adds the actual calculation that goes into calc()
expressions. When the resolution of a Length that is a calculated value
the parsed CalculatedStyleValue gets traversed and appropriate values
get calculated.
2021-07-24 03:02:07 +04:30
Tobias Christiansen
20667dfff5 LibWeb: Plumb calculated StyleValues into CSS::Length
This is a bit hackish, but this way the existance of the calc()
becomes transparent to the user who just wants a Length and doesn't
care where it came from.
2021-07-24 03:02:07 +04:30
Tobias Christiansen
328afa32c6 LibWeb: Add the parsing to the calc() handling
This patch adds the parsing of previously tokenized calc() expressions
into the CSS-Parser. The tokens are processed into a complete
CalculatedStyleValue.
2021-07-24 03:02:07 +04:30
Tobias Christiansen
e3b68039bf LibWeb: Move type derivation of CSS::Length into seperate function
That way this can (and will) be used in other places.
2021-07-24 03:02:07 +04:30
Tobias Christiansen
7a4c8e0b76 LibWeb: Add tokenization of calc expression
Here the first step in understanding a calc() expression is taken:
Finding the start of an expression  and tokenizong it.
2021-07-24 03:02:07 +04:30
Tobias Christiansen
f8bf6ae911 LibWeb: Add CalculatedStyleValue to the CSS StyleValues
This adds the CalculatedStyleValue and all the structs needed to work
with the calc() expressions.
2021-07-24 03:02:07 +04:30
Tobias Christiansen
14640692b7 LibWeb: Use Length::resolved() in FlexFormattingContext
It brew it's own tea resolving undefined and percentages. Let's use the
API already in place rather to keep it flexible.
2021-07-24 03:02:07 +04:30
Timothy Flynn
8c2b8fd001 LibJS: Remove UTF-8 RegExpExec and AdvanceStringIndex overrides
All interested parties are now UTF-16 capable, so these are unused.
2021-07-23 23:06:57 +01:00
Timothy Flynn
5a8f870594 LibJS: Implement RegExp.prototype [ @@replace ] with UTF-16 code units
This also converts the GetSubstitution abstract operation take its input
strings as UTF-16 now that all callers are UTF-16 capable. This means
String.prototype.replace (and replaceAll) no longer needs UTF-8 and
UTF-16 copies of these strings.
2021-07-23 23:06:57 +01:00
Timothy Flynn
ee7b04f7bb LibJS: Implement RegExp.prototype [ @@split ] with UTF-16 code units 2021-07-23 23:06:57 +01:00
Timothy Flynn
66c31a0c07 LibJS: Implement RegExp.prototype [ @@search ] with UTF-16 code units 2021-07-23 23:06:57 +01:00
Timothy Flynn
2c023157e9 LibJS: Implement RegExp.prototype [ @@match ] with UTF-16 code units 2021-07-23 23:06:57 +01:00
Timothy Flynn
b1ea9c20b0 LibJS: Implement RegExp.prototype.{exec,test} with UTF-16 code units
This converts RegExpExec to perform matching with UTF-16 strings. As a
very temporary stop-gap, this adds overloads to RegExpExec and friends
for both UTF-8 and UTF-16 strings. This is only needed until the rest
of RegExp.prototype is UTF-16 capable.

This also addresses a FIXME regarding code point index correction in
RegExpExec when the Unicode flag is set.
2021-07-23 23:06:57 +01:00
Timothy Flynn
a0c19deb80 LibJS: Implement RegExpCreate/RegExpInitialize closer to the spec
RegExpInitialize specifies how the pattern string should be created
before passing it to [[RegExpMatcher]]. Rather than passing it as-is,
the string should be converted to code points and back to a "List" (if
the Unicode flag is present), or as a "List" of UTF-16 code units.
Further. the spec requires that we keep both the original pattern string
and this parsed string in the RegExp object.

The caveat is that the LibRegex parser further requires any multi-byte
code units to be escaped (as "\unnnn"). Otherwise, the code unit is
recognized as individual UTF-8 bytes.
2021-07-23 23:06:57 +01:00
Timothy Flynn
345ef6abba LibRegex: Support ECMA-262 Unicode escapes of the form "\u{code_point}"
When the Unicode flag is set, regular expressions may escape code points
by surrounding the hexadecimal code point with curly braces, e.g. \u{41}
is the character "A".

When the Unicode flag is not set, this should be considered a repetition
symbol - \u{41} is the character "u" repeated 41 times. This is left as
a TODO for now.
2021-07-23 23:06:57 +01:00
Timothy Flynn
0e6375558d AK+LibRegex: Partially implement case insensitive UTF-16 comparison
This will work for ASCII code points. Unicode case folding will be
needed for non-ASCII.
2021-07-23 23:06:57 +01:00
Timothy Flynn
47f6bb38a1 LibRegex: Support UTF-16 RegexStringView and improve Unicode matching
When the Unicode option is not set, regular expressions should match
based on code units; when it is set, they should match based on code
points. To do so, the regex parser must combine surrogate pairs when
the Unicode option is set. Further, RegexStringView needs to know if
the flag is set in order to return code point vs. code unit based
string lengths and substrings.
2021-07-23 23:06:57 +01:00
Idan Horowitz
1d76be97f5 LibJS: Implement Temporal.PlainDate.prototype.inLeapYear 2021-07-23 22:00:23 +01:00
Idan Horowitz
c9ae7e1af1 LibJS: Implement Temporal.Calendar.prototype.inLeapYear 2021-07-23 22:00:23 +01:00
Idan Horowitz
dd15fc471c LibJS: Implement Temporal.PlainDate.prototype.monthsInYear 2021-07-23 22:00:23 +01:00
Idan Horowitz
342172da37 LibJS: Implement Temporal.Calendar.prototype.monthsInYear 2021-07-23 22:00:23 +01:00
Idan Horowitz
b1dd09840b LibJS: Implement Temporal.PlainDate.prototype.daysInYear 2021-07-23 22:00:23 +01:00
Idan Horowitz
7f27035342 LibJS: Implement Temporal.Calendar.prototype.daysInYear 2021-07-23 22:00:23 +01:00
Idan Horowitz
3160540d0e LibJS: Implement Temporal.PlainDate.prototype.daysInMonth 2021-07-23 22:00:23 +01:00
Idan Horowitz
69c8b8e8bd LibJS: Implement Temporal.Calendar.prototype.daysInMonth 2021-07-23 22:00:23 +01:00
Idan Horowitz
2150f5b374 LibJS: Implement Temporal.PlainDate.prototype.daysInWeek 2021-07-23 22:00:23 +01:00
Idan Horowitz
623df361e6 LibJS: Implement Temporal.Calendar.prototype.daysInWeek 2021-07-23 22:00:23 +01:00
Idan Horowitz
2cf582436f LibJS: Implement Temporal.PlainDate.prototype.weekOfYear 2021-07-23 22:00:23 +01:00
Idan Horowitz
d22fe25643 LibJS: Implement Temporal.Calendar.prototype.weekOfYear 2021-07-23 22:00:23 +01:00
Idan Horowitz
d561535ac9 LibJS: Implement Temporal.PlainDate.prototype.dayOfYear 2021-07-23 22:00:23 +01:00
Idan Horowitz
c0e7761758 LibJS: Implement Temporal.Calendar.prototype.dayOfYear 2021-07-23 22:00:23 +01:00
Idan Horowitz
bcbfd5b280 LibJS: Implement Temporal.PlainDate.prototype.dayOfWeek 2021-07-23 22:00:23 +01:00
Idan Horowitz
339b0a17e8 LibJS: Implement Temporal.Calendar.prototype.dayOfWeek 2021-07-23 22:00:23 +01:00
Idan Horowitz
59dc0e8421 LibJS: Implement Temporal.PlainDate.prototype.day 2021-07-23 22:00:23 +01:00
Idan Horowitz
8a20f258f0 LibJS: Implement Temporal.Calendar.prototype.day 2021-07-23 22:00:23 +01:00
Idan Horowitz
d9414e465a LibJS: Implement Temporal.PlainDate.prototype.monthCode 2021-07-23 22:00:23 +01:00
Idan Horowitz
9d9ba29cae LibJS: Implement Temporal.Calendar.prototype.monthCode 2021-07-23 22:00:23 +01:00
Idan Horowitz
a0af9b11fb LibJS: Implement Temporal.PlainDate.prototype.month 2021-07-23 22:00:23 +01:00
Idan Horowitz
3bec18432a LibJS: Implement Temporal.Calendar.prototype.month 2021-07-23 22:00:23 +01:00
Idan Horowitz
8434ca6c4b LibJS: Implement Temporal.PlainDate.prototype.year 2021-07-23 22:00:23 +01:00
Idan Horowitz
3895a8354d LibJS: Implement Temporal.Calendar.prototype.year 2021-07-23 22:00:23 +01:00