summaryrefslogtreecommitdiff
path: root/Libraries/LibWeb
AgeCommit message (Collapse)Author
2020-12-15LibWeb: Add equals() for LengthStyleValue and ColorStyleValueAndreas Kling
The default equals() does to_string() on both sides which is pretty silly when they are of the same type.
2020-12-15LibWeb: Add hack to disable StyleInvalidator while parsing documentAndreas Kling
Running a StyleInvalidator for every attribute set in a new document was making it impossible to load larger sites. :^)
2020-12-15LibWeb: Dimension inline-block and replaced boxes during splittingAndreas Kling
Don't wait until fragment layout to compute width/height of boxes on the line, just do it while we're splitting into lines.
2020-12-15LibWeb: Remove unused Element::set_attributes()Andreas Kling
2020-12-15LibWeb: Use IdentifierStyleValue for CSS 'list-style-type'Andreas Kling
2020-12-15LibWeb: Put final foreground/background colors in LayoutStyleAndreas Kling
This way we don't have to look them up in the CSS::StyleProperties every time we want to paint with them.
2020-12-15LibWeb: Use IdentifierStyleValue for CSS 'text-transform'Andreas Kling
2020-12-15LibWeb: Use IdentifierStyleValue for CSS 'text-decoration-line'Andreas Kling
Also 'text-decoration' is actually a shorthand, so treat it that way.
2020-12-15LibWeb: Make CSS "background: none" work againAndreas Kling
This broke since "none" is now always going to be an identifier value.
2020-12-14LibWeb: Add a simple StyleInvalidator classLinus Groh
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.
2020-12-14LibWeb: Convert remaining CSS identifiers to use IdentifierStyleValueAndreas Kling
2020-12-14LibWeb: Use IdentifierStyleValue for CSS 'position'Andreas Kling
2020-12-14LibWeb: Use CSS::ValueID for 'text-align' valuesAndreas Kling
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.
2020-12-14LibWeb: Improvements to font lookupAndreas Kling
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.
2020-12-14LibWeb: Virtualize StyleValue equality checkAndreas Kling
And use this to simplify comparing two IdentifierStyleValues.
2020-12-14LibWeb: Add a little assertion in Document::detach_from_frame()Andreas Kling
Let's just assert that we're detaching from the frame we thought we were in.. just in case.
2020-12-14LibWeb: Simplify <iframe> content frame constructionAndreas Kling
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.
2020-12-14LibWeb: Use final box model metrics for absolute 'right' and 'bottom'Andreas Kling
We've already converted these to floats, so no need to do it again.
2020-12-14LibWeb: Limit style update tree traversal to dirty subtreesAndreas Kling
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.
2020-12-14LibWeb: Layout absolutely positioned children *after* computing heightAndreas Kling
This is required for CSS "bottom" to work correctly on absolutely positioned elements.
2020-12-14LibWeb: Don't replace selection on key press in non-editable contentAndreas Kling
2020-12-14LibWeb: Make StyleProperties::length_box() default to auto valuesAndreas Kling
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.
2020-12-14LibWeb: Merge Document::layout() and Document::update_layout()Andreas Kling
There is now only Document::update_layout().
2020-12-13LibWeb: Set the encoding of HTML documentsAndreas Kling
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.
2020-12-13LibWeb: Update stale #includes for HTML/TagNames.* moveAndreas Kling
2020-12-13LibWeb: Attach DOM::Document to its frame before parsingAndreas Kling
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.
2020-12-13LibWeb: Make HTMLDocumentParser take an existing documentAndreas Kling
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.
2020-12-13LibWeb: Move DOM/TagNames.* => HTML/TagNames.*Andreas Kling
2020-12-13LibWeb: Mark element style dirty on style/id attribute change tooAndreas Kling
2020-12-13LibWeb: Mark element style dirty when class attribute changesAndreas Kling
Fixes #4403.
2020-12-13LibWeb: Make DOM::Node::set_needs_style_update() schedule the updateAndreas Kling
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.
2020-12-12LibWeb: Store layout box model metrics as floatsAndreas Kling
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.
2020-12-12LibWeb: Use the margin box of floating elements for flowing aroundAndreas Kling
Inline content flows around the entire margin box of floating elements, not just the content box.
2020-12-12LibWeb: Don't place floating boxes before everything elseAndreas Kling
Instead, just handle them as we go about laying out block-level boxes.
2020-12-12LibWeb: Make the ad-hoc CSS parser a little more tolerantAndreas Kling
Just bail when encountering some unexpected character. This makes it much more tolerable to type a stylesheet into TextEditor with live HTML preview enabled.
2020-12-12LibWeb: Apply 'min-width' and 'max-width' constraints to replaced boxesAndreas Kling
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. :^)
2020-12-11LibWeb: Remove some unnecessary is_replaced() checks in BFCAndreas Kling
BFC::compute_width() has a short-circuit path for replaced elements.
2020-12-11LibWeb: Move replaced element layout out of Layout::ReplacedBoxAndreas Kling
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.
2020-12-11LibWeb: Fix inline-block width computation with no specified widthAndreas Kling
Undefined width should be treated the same as width:auto;
2020-12-10LibWeb: Use the surrounding text color as the caret colorAndreas Kling
This way you can always see the cursor as long (as you can see the text you are editing.)
2020-12-10LibWeb: Replace IDL 'void' return type with 'undefined'Linus Groh
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.
2020-12-10LibWeb: Expect IDL namespace to end with semicolonLinus Groh
From the Web IDL spec: https://heycam.github.io/webidl/#prod-Namespace Namespace :: namespace identifier { NamespaceMembers } ;
2020-12-09LibWeb: Apply suggested fixes.asynts
2020-12-09LibWeb: Expose DOM::Range to JavaScript.asynts
2020-12-09LibWeb: Make DOM::Range more suitable for JS.asynts
2020-12-09LibWeb: Join start and end after deleting selection.asynts
2020-12-09LibWeb: Implement deletion of more complex selections.asynts
2020-12-09LibWeb: Fix many bugs with the editing.asynts
2020-12-09LibWeb: Add support for cursor movement and delete.asynts
2020-12-09LibWeb: Support range delection accross nodes with shared parent.asynts