Absolute paths in man page links such as
```
[some link](/foo/bar)
```
Were being interpreted as relative paths when rendered in HTML. This
issue was observed in #20889 and #20041.
The fix is to make sure we don't leave any absolute paths when parsing
links. Instead we check if a directory is absolute (by checking for `/`)
and add `file://` accordingly. This turns the above link into:
```
[some link](file:///foo/bar)
```
Which does get interpreted correctly when rendered as HTML.
- fixes#20889
- fixes#20041
Before this patch, opening the Help application would raise an error.
Now all the pictures in the man pages render correctly.
This should allow us to add a Element::attribute which returns an
Optional<String>. Eventually all callers should be ported to switch from
the DeprecatedString version, but in the meantime, this should allow us
to port some more IDL interfaces away from DeprecatedString.
This PR introduces the ability to save calendar event times
and adds functionality for displaying saved times in the calendar.
Additionally, it addresses the issue where changes to the time
value in the dropdown were not being saved.
Previously, the code assumed that in dividing up the space in the
affected tracks there would never be an overshoot. Instead, we can
check for each track how much extra space is left and never consume any
extra.
In the same way, we can ensure that all extra space is consumed by
distributing all remaining extra space starting from the first track.
Thus, if there is no growth limit, the space distribution should always
consume all the extra space.
The spec says that the sum of affected size + item-incurred increase
should reach the limit, rather than just the item-incurred increase.
This seems to improve layout on the testcase `row-span-2-with-gaps`.
The extra line of space at the bottom of the left div
(`div.grid-item.item-span-two`) is not present anymore, matching other
browsers' layout much more closely.
Support the optional `<attr-type>` parameter to the `attr()` function,
which allows parsing the attribute's value as a variety of types,
instead of always as a string.
Resolving typed `attr()` functions is going to involve using more
internal Parser methods, so this is the simplest solution for that.
Also... resolving these is basically parsing them, so it makes more
sense for that process to live here.
This is just moving code, with minimal changes so it still works.
The final used values for these properties is stored in the layout node,
so we need to make sure they are propagated there as well when doing
table box fixup.
When formatting a currency style pattern with compact notation, we were
(trying to) doubly insert the currency symbol into the formatted string.
We would first look up the currency pattern in GetNumberFormatPattern
(for the en locale, this is "¤#,##0.00", which our generator transforms
to "{currency}{number}").
When we hit the "{number}" field, NumberFormat will do a second lookup
for the compact pattern to use for the number being formatted. By using
the currency compact patterns, we receive a second pattern that also has
the currency symbol (for the en locale, if formatting the number 1000,
this is "¤0K", which our generator transforms to
"{currency}{number}{compactIdentifier:0}". This second lookup is not
supposed to have currency symbols (or any other symbols), thus we hit a
VERIFY_NOT_REACHED().
Instead, we are meant to use the decimal compact pattern, and allow the
currency symbol to be handled by only the outer currency pattern.
Some replaced elements can have intrinsic aspect ratios but no
intrinsic size. In these cases, the tentative sizes are undefined, and
can therefore sometimes be zero. However, when resolving the size
constraints, we are already guaranteed to have an intrinsic aspect
ratio, so let's use that instead to calculate the resolved sizes.
Previously, we would run through all the constraints in the spec one by
one, but if we check and resolve each constraint in the order they are
defined in the spec, only the first four will ever match.
This leads me to believe that these constraints are meant to be
mutually exclusive instead, meaning that we must check the most
specific constraints first and return upon the first resolution that
matches.
This allows us to retain perfect precision for aspect ratios derived
from either the intrinsic sizes of replaced elements, or the
`aspect-ratio` CSS property.
Instead of allocating a DeprecatedString just so we can call strtoull()
on it, we now collect the relevant token characters in a vector and add
a null terminator manually.
2% speed-up on Kraken/imaging-darkroom.js :^)
We should not GC allocate in the constructors of GC-allocated objects
because a new allocation might trigger garbage collection, which in
turn might access not fully initialized objects.
There's a particularly awkward case where the static position of an
abspos child of a flex container is dependent on its height. This can
happen when `align-items: center` is in effect, as we have to adjust
the abspos child's Y position by half of its height.
This patch solves the issue by reordering operations in the abspos
height resolution algorithm, to make sure that height is resolved
before the static position is calculated.
It is unlikely this is needed anymore, and as pointed out things should
now safely return OOM if the bitmap is too large to allocate.
Also, no recently added decoders respected this limit anyway.
Fixes#20872
Using flex layout inside button solves the issue with wrongly calculated
height when it has: pseudo element and whitespaces inside.
Also using flex instead of a table layout allows for the same vertical
alignment but with fewer layout nodes: a flex container and anonymous
wrapper for content instead of a table wrapper, table, row, and cell.
All supported targets use an LP64 ABI, where both `long` and `long long`
are 64 bits wide. We set `LONG_WIDTH` to 32, which caused an error when
compiling gnulib's `vasnprintf` routine.
We might consider using built-in macros to avoid such issues in the
future.
We would start the timer to send playback time updates to the element
before playback had started, so in cases where the `HTMLMediaElement`
(incorrectly) creates both an `AudioTrack` and `VideoTrack`, it will
not cause the seek bar to flicker between the current video position
and zero.
Which for now will just call the DeprecatedString version of this
function. This is intended to be used in porting code over to using the
new String equivalent with the end goal of removing the DeprecatedString
version of this function.
This allows us to port a whole heap of IDL interfaces from
DeprecatedString to String.
NewAKString is effectively the default for any new IDL interface, so
let's mark this as the default behavior. It also makes it much easier to
figure out whatever interfaces are still left to port over to new AK
String.
Currently, every public DOM::Element method which changes an attribute
fires this handler itself. This was missed in commit 720f7ba, so any
user of that API would not fire the internal handler.
To fix this, and prevent any missing invocations in the future, invoke
the handler from from Attr::handle_attribute_changes. This method is
reached for all attribute changes, including adding/removing attributes.
This ensures the handler will always be fired, and reduces the footprint
of this ad-hoc behavior.
Note that our ad-hoc handler is not the "attribute change steps" noted
by the spec. Those are overridden only by a couple of specific elements,
e.g. HTMLSlotElement. However, we could easily make our ad-hoc handler
hook into those steps in the future.
Instead of trying to keep a live reference to the bytecode interpreter's
current instruction stream iterator, we now simply copy the current
iterator whenever pushing to the ExecutionContext stack.
This fixes a stack-use-after-return issue reported by ASAN.
The arguments are passed on registers, so if we pass only 3 defined
arguments then the fourth argument for the prctl syscall could have
garbage value within it.
To avoid possible bugs, always pass 3 arguments to a raw syscall prctl
call in addition to the prctl sub-option (the first argument).
Before, when looking in /bin in File Manager, the About application's
icon was missing. Now it is a serenity_app instead of serenity_bin the
icon is visible!
This works by adding source start/end offset to every bytecode
instruction. In the future we can make this more efficient by keeping
a map of bytecode ranges to source ranges in the Executable instead,
but let's just get traces working first.
Co-Authored-By: Andrew Kaster <akaster@serenityos.org>