summaryrefslogtreecommitdiff
path: root/Libraries
AgeCommit message (Collapse)Author
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-06LibJS: Add Proxy objectsMatthew Olsson
Includes all traps except the following: [[Call]], [[Construct]], [[OwnPropertyKeys]]. An important implication of this commit is that any call to any virtual Object method has the potential to throw an exception. These methods were not checked in this commit -- a future commit will have to protect these various method calls throughout the codebase.
2020-06-06LibJS: Value.in uses has_property instead of get().is_empty()Matthew Olsson
2020-06-06LibJS: Object.setPrototypeOf throws error on too few argumentsMatthew Olsson
2020-06-06LibJS: Add PropertyDescriptor objectMatthew Olsson
This new struct is now returned from get_own_property_descriptor. To preserve the old functionality of returning an object, there is now a get_own_property_descriptor_object method, for use in {Object,Reflect}.getOwnPropertyDescriptor(). This change will be useful for the implementation of Proxies, which do a lot of descriptor checks. We want to avoid as many object gets and puts as possible.
2020-06-06LibJS: Distinguish between omitted descriptor attributes and false onesMatthew Olsson
When calling Object.defineProperty, there is now a difference between omitting a descriptor attribute and specifying that it is false. For example, "{}" and "{ configurable: false }" will have different attribute values.
2020-06-06LibGUI: Fix TextEditor painting glitch after add_clip_rect() changeAndreas Kling
2020-06-06LibGfx: Make Painter::add_clip_rect() use logical coordinatesAndreas Kling
It was really confusing that add_clip_rect() didn't apply transforms to the new clip rect, but instead interpreted it as an absolute rect. This makes web pages with <iframe> render correctly when scrolled. Something might break from this, but we'll find it soon enough. :^)
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-06LibJS: Fix rest-params test to take function hoisting into accountMarcin Gasperowicz
2020-06-06LibJS: Hoist function declarationsMarcin Gasperowicz
This patch adds function declaration hoisting. The mechanism is similar to var hoisting. Hoisted function declarations are to be put before the hoisted var declarations, hence they have to be treated separately.
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
2020-06-05LibWeb: Fix mismatching Resource subclass typesAndreas Kling
This was a confusing bug: ImageStyleValue loaded its image resource as a Generic resource, while HTMLImageElement loaded as Image. This patch fixes the issue and adds an assertion to verify that we only share resources that have the same C++ client class type.
2020-06-05LibWeb: Parse param/source/track start tags during "in body" insertionAndreas Kling
2020-06-05LibWeb: Simplify LayoutWidget layoutAndreas Kling
Set the intrinsic size up front and let LayoutReplaced do the work.
2020-06-05LibWeb: Don't assign style to LayoutWidgetsAndreas Kling
The only CSS property we care about for widgets is "display:none". For everything else, we ignore it and use a native look & feel. :^)
2020-06-05LibWeb: Make <canvas> use the generic replaced layout algorithmAndreas Kling
LayoutCanvas now communicates intrinsic size to LayoutReplaced so it can use the normal replaced algorithm.
2020-06-05LibWeb: Start implementing proper layout of replaced elementsAndreas Kling
LayoutReplaced now has intrinsic width, height and ratio. Only some of the values may be present. The layout algorithm takes the various configurations into account per the CSS specification. This is still pretty immature but at least we're moving forward. :^)
2020-06-05LibWeb: Improve computation of a layout node's containing blockAndreas Kling
In particular, we now compute the containing block of boxes with position:absolute and position:fixed (more) correctly.
2020-06-05LibWeb: Don't create a layout node for <noscript> when scripting enabledAndreas Kling
This makes stuff inside <noscript> correctly not show up since we run with scripting enabled. In the future, we can add a way to disable scripting, but for now, Document::is_scripting_enabled() just returns true.
2020-06-05LibCrypto: Add a simple SignedBigIntegerAnotherTest
This patchset adds a simple SignedBigInteger that is entirely defined in terms of UnsignedBigInteger. It also adds a NumberTheory::Power function, which is terribly inefficient, but since the use of exponentiation is very much discouraged for large inputs, no particular attempts were made to make it more performant.
2020-06-05LibWeb: Fix parsing of "<textarea></textarea>"Andreas Kling
When handling a "textarea" start tag, we have to ignore the next token if it's an LF ('\n'). However, we were not switching the tokenizer state before fetching the lookahead token, and this caused us to force the tokenizer into the RCDATA state too late, effectively getting it stuck in that state for way longer than it should be. Fixes #2508.
2020-06-05LibWeb: Fix missing tokenizer state change in RCDATALessThanSignAndreas Kling
We can't RECONSUME_IN after we've used EMIT_CHARACTER since we'll have returned from the function.
2020-06-04LibWeb: Unbreak character reference and DOCTYPE parsing post-UTF-8Andreas Kling
Oops, these were still using the byte-offset cursor. My goodness is it unergonomic to index into UTF-8 strings, but Dr. Bugaev says it's good. There is lots of room for improvement here. Just like the rest of the tokenizer and parser. We'll have to do a few optimization passes over them once they mature.
2020-06-04LibWeb: Make the new HTML parser parse input as UTF-8Andreas Kling
We already convert the input to UTF-8 before starting the tokenizer, so all this patch had to do was switch the tokenizer to use an Utf8View for its input (and to emit 32-bit codepoints.)
2020-06-04LibWeb: Fix incorrectly consumed characters after reference tokensAndreas Kling
The NumericCharacterReferenceEnd tokenizer state should not advance the input stream.
2020-06-04LibWeb: Process style sheets in document orderAndreas Kling
Until now we would simply apply stylesheets in the order they finished loading. This patch adds a StyleSheetList object that hangs off of each Document and contains all the style sheets in document order. There's still a lot of work to do for a proper cascade, but at least this makes us consistently wrong every time. :^)
2020-06-04LibWeb: Fix <body> and <img> elements not parsing their class attributeAndreas Kling
Subclasses that override Element::parse_attribute() must always call to base class since otherwise we might forget to parse some attributes. This makes class selectors work on <body> and <img> elements. :^)
2020-06-04LibGUI: Fix bad KeyEvent::m_key initializer to unbreak SDL2 portAndreas Kling
2020-06-04LibTLS: Simplify record padding logic and ASSERT more assumptionsAnotherTest
2020-06-04LibCrypto: Correctly pad blocks with FinalBlockSize < size < BlockSizeAnotherTest
This fixes #2488