summaryrefslogtreecommitdiff
path: root/Libraries/LibWeb
AgeCommit message (Collapse)Author
2020-06-12LibWeb: Include class names in layout tree dumpsAndreas Kling
This makes it a lot easier to see which layout node is which DOM node.
2020-06-11LibJS: Consolidate error messages into ErrorTypes.hMatthew Olsson
Now, exceptions can be thrown with interpreter.throw_exception<T>(ErrorType:TYPE, "format", "args", "here").
2020-06-10LibWeb: Don't try to expand shorthands from non-string CSS valuesAndreas Kling
If something is already e.g a length or a color value, we don't need to try to expand it by stringifying and looking at the parts.
2020-06-10LibWeb: Expand "background: url()" into "background-image: url()"Andreas Kling
This gives us a yellow forehead on ACID2! :^)
2020-06-10LibWeb: Expand 2-part border-width shorthand CSS propertiesAndreas Kling
2020-06-10LibWeb: Apply style rules in order of specificity (kinda)Andreas Kling
We now sort the matched rules by the specificity of the first selector in them. This is not perfect, since a rule can have multiple selectors, but it is a nice chin-related progression on ACID2. :^)
2020-06-10LibWeb: Expand border-{top,right,bottom-left} CSS shorthand propertiesAndreas Kling
This code is pretty rough, but it's something that will also improve with the eventual new CSS parser.
2020-06-10LibWeb: Ignore backslashes (\) in attribute selectorsAndreas Kling
This makes us at least parse selectors like [foo=bar\ baz] correctly. The current solution here is quite hackish but the real fix will come when we implement a spec-compliant CSS parser.
2020-06-10LibWeb: Parse and match basic "contains" attribute selectors (~=)Andreas Kling
2020-06-10LibWeb: Constrain block height by the max-height if specifiedAndreas Kling
2020-06-10LibGfx: Rename Rect,Point,Size => IntRect,IntPoint,IntSizeAndreas Kling
This fits nicer with FloatRect,FloatPoint,FloatSize and gives a much better visual clue about what type of metric is being used.
2020-06-10LibWeb: Rework the layout engine to use relative offsetsAndreas Kling
The box tree and line boxes now all store a relative offset from their containing block, instead of an absolute (document-relative) position. This removes a huge pain point from the layout system which was having to adjust offsets recursively when something moved. It also makes some layout logic significantly simpler. Every box can still find its absolute position by walking its chain of containing blocks and accumulating the translation from the root. This is currently what we do both for rendering and hit testing.
2020-06-10LibWeb: Fix parser interpreting "&quot;" as "&quot"Andreas Kling
There was a logic mistake in the entity parser that chose the shorter matching entity instead of the longer. Fix this and make the entity lists constexpr while we're here.
2020-06-09LibWeb: Add LayoutTableRowGroup to implement display: table-row-groupAndreas Kling
2020-06-09LibWeb: Add some iteration helpers to LayoutNodeAndreas Kling
- for_each_child_of_type<T> - previous_sibling_of_type<T>
2020-06-08LibWeb: Unbreak favicon notifications after Page refactoringAndreas Kling
Favicon updates now get plumbed from FrameLoader to the PageClient.
2020-06-08LibWeb: Remove unnecessary on_foo hooks from FrameAndreas Kling
Frame can just call through the PageClient instead of using hooks.
2020-06-08LibJS: Make more Interpreter functions take a GlobalObject&Andreas Kling
2020-06-08LibJS: Interpreter::this_value() => this_value(GlobalObject&)Andreas Kling
Once the Interpreter has no global object attached to it, we have to provide it everywhere.
2020-06-08LibWeb: Add Page abstraction between PageView and main FrameAndreas Kling
* A PageView is a view onto a Page object. * A Page always has a main Frame (root of Frame tree.) * Page has a PageClient. PageView is a PageClient. The goal here is to allow building another kind of view onto a Page while keeping the rest of LibWeb intact.
2020-06-08LibJS+LibWeb: Remove a bunch of calls to Interpreter::global_object()Andreas Kling
Objects should get the GlobalObject from themselves instead. However, it's not yet available during construction so this only switches code that happens after construction. To support multiple global objects, Interpreter needs to stop holding on to "the" global object and let each object graph own their global.
2020-06-07LibWeb: Use HTML::TagNames globals in the new HTML parserAndreas Kling
2020-06-07LibWeb: Add HTML::TagNames namespace for global tag name FlyStringsAndreas Kling
Instead of "iframe", we can now say HTML::TagNames::iframe and avoid a FlyString lookup.
2020-06-07LibWeb: Add (stub) HTMLTable{,Cell,Row}Element C++ classesAndreas Kling
We'll need a place to implement the various presentational attributes for table parts, and more stuff.
2020-06-07LibWeb: Fix codepoint_from_entity() never returning an errorAndreas Kling
If we don't find a matching entity, return an empty Optional.
2020-06-07LibWeb: Fix tokenizer swallowing an extra token after a named entityAndreas Kling
2020-06-07LibWeb: Unbreak <a title> tooltips in the main frameAndreas Kling
The main frame doesn't have a host element, so we can't go trying to offset things by the host element's layout rect.
2020-06-07LibWeb: Start fleshing out support for relative CSS unitsAndreas Kling
This patch introduces support for more than just "absolute px" units in our Length class. It now also supports "em" and "rem", which are units relative to the font-size of the current layout node and the <html> element's layout node respectively.
2020-06-07LibWeb: Fix broken paint invalidation after subframe changesAndreas Kling
Now that PageView actually respects the invalidation rect provided by the layout system, it turns out we were invalidating too little. Unfortunately, this is not really fixable until the initial containing block starts having the right size (same as viewport), but that will require a bunch of work to make overflow work again. So it's a FIXME for now, and we'll return to this.
2020-06-07LibWeb: Let subframes propagate paint invalidations via host elementAndreas Kling
When a paint invalidation occurs inside a subframe, it bubbles up to Frame::set_needs_display(). From there, we call PageView if this is the main frame, or otherwise invalidate the subframe host element.
2020-06-07LibWeb: Remove unused Document::on_layout_updated hookAndreas Kling
2020-06-07LibWeb: Open subframe links inside the subframe itselfAndreas Kling
We now only delegate to the Web::PageView embedded when clicking links in the main frame. Links in subframes are handled internally.
2020-06-07LibWeb: Add per-Frame EventHandler, handle mouse events recursivelyAndreas Kling
We now handle mouse events by recursing into subframes. This makes links, tooltips, etc, work inside <iframe> content.
2020-06-07LibWeb: Move Frame.{cpp,h} into a new Frame/ directoryAndreas Kling
2020-06-06LibWeb: Whine in debug log instead of asserting on partial layout FIXMEAndreas Kling
We don't support incremental relayout of subtrees (only single nodes) but let's not crash the browser just because this happens. We can keep the browser up and just complain in the debug log instead.
2020-06-06LibWeb: Make Frame::page_view() always go via main_frame()Andreas Kling
When you ask a subframe for its PageView, you'll now always get the main frame's PageView. Subframes don't have a PageView of their own.
2020-06-06LibWeb: Handle EOF tokens during "text" insertionAndreas Kling
2020-06-06LibWeb: Delay sub-Frame construction until host Document is attachedAndreas Kling
While we're parsing a new document, we don't have a Frame to grab at. We now use the Node::document_did_attach_to_frame() notification hook to delay subframe construction. With this, subframes now always have a valid reference to their enclosing main frame.
2020-06-06LibWeb: Add Node notifications for Document<=>Frame attach/detachAndreas Kling
Some DOM nodes will want to do stuff when we attach/detach from a Frame and this seems like a simple enough way to let them know.
2020-06-06LibWeb: Show error page if we can't handle a frame's main resourceAndreas Kling
If we can't figure out how to make a Document for the main resource in a Frame, just show an error page.
2020-06-06LibWeb: Let Resource figure out its own encoding and MIME typeAndreas Kling
Also, if the request URL is a data: URL, use the MIME type from the URL itself if available. This makes it possible to load arbitrary MIME type data: URLs in the browser :^)
2020-06-06LibWeb: Always scroll PageView to top when a new document is setAndreas Kling
2020-06-06LibWeb: Turn FrameLoader into a ResourceClientAndreas Kling
We now use the new resource-based loader for the main resource in each Frame. This gives us access to caching and sharing. :^)
2020-06-06LibWeb: Make Document::url() return URL by valueAndreas Kling
Returning it by reference can lead to unpleasant situations if we use this getter when the document may go away. Better to make the getter return a copy than have to think about this everywhere.
2020-06-06LibWeb: Use FrameLoader to load iframes :^)Andreas Kling
2020-06-06LibWeb: Add a FrameLoader class and move PageView's loading logic thereAndreas Kling
Each Frame now has a FrameLoader which will be responsible for handling loading inside that frame.
2020-06-06LibWeb: Fix location.reload.lengthLuke
This was accidentally being set to JS::Attribute::Enumerable instead of 0.
2020-06-06LibWeb: Fully implement all script tokenizer statesLuke
Also fixes RAWTEXTLessThanSign having a separate emit and reconsume.
2020-06-05LibWeb: Start adding support for the <iframe> element! :^)Andreas Kling
This patch introduces a bunch of things: - Subframes (Web::Frame::create_subframe()) - HTMLIFrameElement (loads and owns the hosted Web::Frame) - LayoutFrame (layout and rendering of the hosted frame) There's still a huge number of things missing, like scrolling, overflow handling, event handling, scripting, etc. But we can make a little iframe in a document and it actually renders another document there. I think that's pretty cool! :^)
2020-06-05LibWeb: Assert that we don't reuse cached resources with wrong typeAndreas Kling