Note that we implement .elements as a HTMLCollection for now, instead of
the correct HTMLFormControlsCollection subclass. This covers most
use-cases already.
1% progression on ACID3. :^)
This API now follows the spec a bit more closely, with regards to the
event being dispatched. There are still FIXME's but this is already an
improvement.
2% progression on ACID3. :^)
There were two things preventing this from working right:
- UIEvents::UIEvent::create() was actually just DOM::Event::create()
- We didn't return the right JavaScript wrapper type for UIEvent
Previously we were only matching elements with *no* text children.
With this patch, we now also allow any number of empty text children to
be present as well.
1% progression on ACID3. :^)
Use the new Gfx::Font::AllowInexactSizeMatch parameter when doing CSS
font lookups. This fixes a long-standing issue where text with e.g text
with "font-size:12px" would be larger than "font-size:13px" since there
was an exact match for 12, but none for 13 (so we'd fall back to 10).
This allows bitmap font lookup to return the best matching size instead
of failing completely. The previous behavior (exact matches only)
remains the default.
Instead of re-measuring the distance between the left and right edges of
a line box, we now simply adjust the final width based on how much the
rightmost fragment moved during the alignment process.
This shape is for use by the main widget of a frameless window
that still wishes to have proper borders but no title.
Raised Containers were used previously for this pattern but did not
always represent perspective and shadow correctly depending on thread
highlighting and the immediate background color. Containers are
really meant to be used inside other widgets where the background
color can be controlled.
This works a little differently from the other caches - ALL rules
containing a pseudo-element are in this bucket. This lets us only look
at this bucket when finding styles for a pseudo-element, and ignore it
if we're not.
We were painting this in the Foreground phase by mistake. Also, the
`inspected_node() == dom_node()` check returns true for pseudo-elements
(both values are nullptr) so I've added an extra check there. As noted,
once pseudo-elements are inspectable we will need to revisit this.
Since each selector can only have zero or one pseudo-element, we match
against it as a separate step, before matching the rest of the
selector. This should be faster, but mostly I did this because I could
not figure out how else to stop selectors without a pseudo-element from
matching the pseudo-element, eg so `.foo` styles don't affect
`.foo::before`.
This means we can instantiate them for pseudo-elements, which don't have
an associated Element. They all pass it to their parent as a
`Layout::Node*` and handle a lack of `layout_node()` already so this
won't affect any functionality.
For now, we only understand `none`, `normal`, `<image>` and `<string>`.
The various other functions and identifiers can be added later.
We can *almost* use a StyleValueList for this, except it's divided into
two parts - the content, and the optional "alt text". So, I've added a
new StyleValue for it.
This adds a keyboard event for Super+0 to Super+9. Later to be consumed
in the taskbar.
Currently only this keyboard sequence is supported:
- Super key down
- Digit key down
But not this:
- Super key down
- Digit key down
- Digit key up
- Digit key down
Segments inherit from Button and let us add clickable widgets
to status bars. This patch also adds proportional, fixed and
autosized modes for segments and lets the status bar consume
all non-clickable segments for override text.
There were a couple issues here:
1. The line feed should only be appended once, rather than one per
string.
2. The new_strings list of strings was unused (we were creating the new
list, then passing the old list to Document.write).
Fonts now provide their preferred line height based on maximum
height and requested line gap. TTFs provide a preferred line gap
from table metrics while BitmapFonts are hardcoded at the previous
default for now.
Ruler needs to take into account spacing between glyphs for
proportional fonts as line count increases. This also replaces
the less accurate 'x' width estimate for widest character with
a '4'
This is the only dimension type besides `<length>` that is used in any
media queries in levels 4 or 5 right now. Others can be included
if/when they're needed.
This means the units are defined in a single place instead of two.
Also removed the verify that we didn't produce a bogus % dimension token
in the Tokenizer, since this has never happened and the parser is not a
tokenizer test suite. :^)