Age | Commit message (Collapse) | Author |
|
The default equals() does to_string() on both sides which is pretty
silly when they are of the same type.
|
|
Running a StyleInvalidator for every attribute set in a new document
was making it impossible to load larger sites. :^)
|
|
Don't wait until fragment layout to compute width/height of boxes on
the line, just do it while we're splitting into lines.
|
|
|
|
|
|
This way we don't have to look them up in the CSS::StyleProperties
every time we want to paint with them.
|
|
|
|
Also 'text-decoration' is actually a shorthand, so treat it that way.
|
|
This broke since "none" is now always going to be an identifier value.
|
|
This patch adds a simple, naive & inefficient class for document-wide
style invalidation, e.g. after element attribute updates. During
construction it collects a HashMap of a document's elements and their
matching rules, during destruction it does the same and then compares
the results; dirtying all elements that have a different number or order
of matching rules afterwards.
Much room for improvement, but it solves the problem of stale element
styling after attribute updates for now :^)
Fixes #4404.
|
|
|
|
|
|
Let's start moving away from using raw strings for CSS identifiers.
The idea here is to use IdentifierStyleValue with a CSS::ValueID inside
for all CSS identifier values.
|
|
Parse out the font-family, font-size and font-weight values from CSS
and use them to perform a kinda-best-effort lookup against the system
font library.
We also now handle standard font names like "sans-serif", "monospace"
and others.
|
|
And use this to simplify comparing two IdentifierStyleValues.
|
|
Let's just assert that we're detaching from the frame we thought we
were in.. just in case.
|
|
Now that documents are attached to their frame *before* parsing, we can
create the content frame of <iframe> elements right away, instead of
waiting for the host frame attachment.
Fixes #4408.
|
|
We've already converted these to floats, so no need to do it again.
|
|
This patch adds a second style dirty bit that tracks whether a DOM node
has one or more children with dirty style. This allows the style update
to skip over entire subtrees where all nodes are clean.
|
|
This is required for CSS "bottom" to work correctly on absolutely
positioned elements.
|
|
|
|
Undefined length values can default to auto in all length boxes and
we'll get the values we need. This saves us from having to deal with
undefined lengths later on in layout.
At some point we should break the style application process into
a few more formal steps, but this at least simplifies some things.
|
|
There is now only Document::update_layout().
|
|
Now that we attach the document to the frame before parsing, we have
to make sure we set the encoding on the document before parsing, or
things may not turn out well.
|
|
|
|
FrameLoader now begins by constructing a DOM::Document, and then builds
a document tree inside it based on the MIME type. For text/html we pass
control to the HTMLDocumentParser as before.
This gives us access to things like window.alert() during parsing.
Fixes #3973.
|
|
We shouldn't really be creating the document objects inside the parser,
since that makes it hard to hook up e.g JavaScript bindings early on.
|
|
|
|
|
|
Fixes #4403.
|
|
After you mark a node as needing new style, there's no situation in
which we don't want a style update to happen, so just take care of
scheduling it automatically.
|
|
Instead of storing them as CSS::Lengths, we now store the resolved
values for margin/padding/border/offset top/right/bottom/left with
each Layout::NodeWithStyleAndBoxModelMetrics.
This simplifies a lot of code since it's no longer necessary to
resolve values before using them.
|
|
Inline content flows around the entire margin box of floating elements,
not just the content box.
|
|
Instead, just handle them as we go about laying out block-level boxes.
|
|
Just bail when encountering some unexpected character. This makes it
much more tolerable to type a stylesheet into TextEditor with live
HTML preview enabled.
|
|
This is definitely not 100% correct but I tried implementing the basic
algorithms described in CSS 2.2. It's good enough to render the penguin
on @linusg's homepage at the right size. :^)
|
|
BFC::compute_width() has a short-circuit path for replaced elements.
|
|
Replaced elements are now laid out by the current formatting context.
Since the logic is almost identical in BFC and IFC, it's implemented
by static helpers in FormattingContext.
|
|
Undefined width should be treated the same as width:auto;
|
|
This way you can always see the cursor as long (as you can see the text
you are editing.)
|
|
From the Web IDL spec: https://heycam.github.io/webidl/#idl-undefined
[...]
undefined constant values in IDL are represented with the `undefined`
token.
[...]
Note: This value was previously spelled `void`, and more limited in how
it was allowed to be used.
|
|
From the Web IDL spec: https://heycam.github.io/webidl/#prod-Namespace
Namespace ::
namespace identifier { NamespaceMembers } ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|