This patch begins the support for the 'view-box' attribute that can be
attached to <svg>'s.
The FormattingContext determines the size of the Element according to
the specified 'width' and 'height' or if they are not given by the
'viewbox' or by the bounding box of the path if nothing is specified.
When we try to paint a SVG Path that belongs to a <svg> that has the
'view-box' and a specified 'height'/'width', all the parts of the path
get scaled/moved accordingly.
There probably are many edge cases and bugs still to be found, but this
is a nice start. :^)
Previously we used a native ui button to draw the buttons.
These buttons can however not be styled with css.
To allow these to be styled with css, we create a button with
the UA stylesheet that resembles the system ui button.
Instead of making a full copy of every NodeState when cloning a
FormattingState, we make NodeState ref-counted and implement a basic
copy-on-write mechanism.
FormattingState::get_mutable() now makes a deep copy of the NodeState
when first accessed *if* it is shared with other FormattingStates.
We'll have to do something more proper to support this scenario
eventually, but for now let's at least not crash just because somebody
put an SVG <path> inside an HTML element.
Let's have one function that determines the type of transformation
needed, and another to actually perform the transformation.
This makes it much easier to read, and we don't have to duplicate the
logic for doing the transformation.
We now consider a layout box as having definite size in these cases:
- The size is a <length>.
- The size is a <percentage> and the containing block has definite size.
This is not complete, but a bit more accurate than what we had before.
Previously we were computing the bottom edge of a line box by finding
the bottommost fragment on the line.
That method didn't give correct results for line boxes with no fragments
(which is exactly what you get when inserting a bunch of <br> elements.)
To cover all situations, we now keep track of the bottommost edge in the
LineBox object itself.
Using WeakPtr to remember which LineBoxFragment owns which Box was
imposing some annoying constraints on the layout code. Importantly, it
was forcing us to heap-allocate fragments, which makes it much harder to
clone a FormattingState.
This patch replaces the WeakPtr with a coordinate system instead.
Fragments are referred to by their line box index + fragment index
within the line box.
Two different man pages for TelnetServer could be found in sections
1 and 8 of Serenity's manual. This patch combines both and places
the page in section 8.
Pre-patch, the man page encased the name of the program in quotes,
which is inconsistent with other man pages, unnecessarily
repeated "Shell" in the gist, and included "the" in the gist,
which is also inconsistent with other man pages.
The last commit fixes a bug, but also exposes the fact that trailing
space highlighting isn't really supported on multiple lines. This patch
correct the wrong behavior by adding an offset to adjust rectangle's
position.
Before this patch the highlighted rectangle wasn't placed on the right
spot. Now the red highlighting is correctly placed at the end of the
line. This was due to a function called with a wrong argument.
If the underlying parameter is logarithmic, the slider respects that and
switches to a logarithmic display. Currently, the used base is e, and
we'll have to see in practice if 2 or 10 might be better. The parameters
that make use of this, as can be seen in the previous commit, are all of
the time dependent parameters such as the synth envelope parameters, as
with these, usually fine-grained control at small time scales and
coarser control at large time scales is desired.
This was a good opportunity to refactor the slider step count into a
constant.
This doesn't affect the parameter's own behavior but is part of the
parameter meta-data, just as the name. If a parameter is logarithmic,
UI elements should represent it with an interface that scales
logarithmically.
Function-local `static constexpr` variables can be `constexpr`. This
can reduce memory consumption, binary size, and offer additional
compiler optimizations.
Previously we didn't set the end position for the return type node of
function FunctionType nodes.
This caused a VERIFY failure crash when dumping an AST that contains
such nodes.