summaryrefslogtreecommitdiff
path: root/Libraries/LibWeb
AgeCommit message (Collapse)Author
2020-04-28LibJS: Implement correct attributes for (almost) all propertiesmattco98
Added the ability to include a u8 attributes parameter with all of the various put methods in the Object class. They can be omitted, in which case it defaults to "Writable | Enumerable | Configurable", just like before this commit. All of the attribute values for each property were gathered from SpiderMonkey in the Firefox console. Some properties (e.g. all of the canvas element properties) have undefined property descriptors... not quite sure what that means. Those were left as the default specified above.
2020-04-26LibWeb: Support loading data: URLs transparently via ResourceLoaderAndreas Kling
This is pretty darn cool! :^)
2020-04-26LibWeb: Run clang-format on ResourceLoader.cppAndreas Kling
2020-04-25LibWeb: Handle .gifs as images and use ImageDecoder to decode themPeter Nelson
2020-04-24LibWeb: Try fetching a favicon when loading a non-file URL in HtmlViewAndreas Kling
If valid and decodable, the favicon will be provided to clients via the on_favicon_change hook. :^)
2020-04-24Browser+LibWeb: Open link in new tab on Ctrl+Click :^)Andreas Kling
2020-04-24LibWeb: Pass link target to HtmlView's on_link_click callbackLinus Groh
2020-04-23LibWeb: Add XMLHttpRequest.readyState and constantsLinus Groh
2020-04-23LibWeb: Use proper length values for CanvasRenderingContext2D functionsEmanuele Torre
2020-04-22LibWeb: support confirm() with no argumentsNick Tiberi
2020-04-22LibWeb: Invalidate the canvas element after put_image_data()Andreas Kling
This makes sure we repaint it right away so we can see the changes.
2020-04-21LibWeb: Add ImageData objects and implement 2D context putImageData()Andreas Kling
An ImageData is a wrapper around a Bitmap wrapper around a JS::Uint8ClampedArray.
2020-04-21LibWeb: Hack requestAnimationFrame() to provide a (very fake) timestampAndreas Kling
2020-04-19LibJS: Add MarkedValueList and use it for argument passingAndreas Kling
A MarkedValueList is basically a Vector<JS::Value> that registers with the Heap and makes sure that the stored values don't get GC'd. Before this change, we were unsafely keeping Vector<JS::Value> in some places, which is out-of-reach for the live reference finding logic since Vector puts its elements on the heap by default. We now pass all the JavaScript tests even when running with "js -g", which does a GC on every heap allocation.
2020-04-18LibWeb: Parse <br/> into a self-closed br elementAndreas Kling
We were parsing "<br/>" as an open tag with the name "br/". This fixes that specific scenario. We also rename is_self_closing_tag() to is_void_element() to better fit the specs.
2020-04-18LibJS: Move builtin prototypes to the global objectAndreas Kling
This moves us towards being able to run JavaScript in different global objects without allocating a separate GC heap.
2020-04-18LibJS+LibWeb: Pass prototype to Object constructorAndreas Kling
Everyone who constructs an Object must now pass a prototype object when applicable. There's still a fair amount of code that passes something fetched from the Interpreter, but this brings us closer to being able to detach prototypes from Interpreter eventually.
2020-04-18LibJS: Make Array constructor take its prototypeAndreas Kling
Let's start moving towards native JS objects taking their prototype as a constructor argument. This will eventually allow us to move prototypes off of Interpreter and into GlobalObject.
2020-04-17LibWeb: Implement JS confirm()Nick Tiberi
2020-04-16LibWeb: Implement CanvasRenderingContext2D::stroke_rect() with linesAndreas Kling
Stroking rects by drawing individual lines gives us line width support without having to extend the Painter::draw_rect() code. :^)
2020-04-16LibWeb: Add some basic path drawing functionality to the canvas elementAndreas Kling
This patch adds the following methods to CanvasRenderingContext2D: - beginPath() - moveTo(x, y) - lineTo(x, y) - closePath() - stroke() We also add the lineWidth property. :^)
2020-04-16LibWeb: Scroll back to the top when a new page is loadedJack Byrne
2020-04-16LibWeb: Support alert() with no argumentsLinus Groh
No idea why someone would use that though.
2020-04-15LibWeb: Use Checked<T> when creating <canvas> bitmap buffersAndreas Kling
2020-04-15LibWeb: Limit the maximum size of <canvas> bitmap buffersAndreas Kling
We will no longer create bitmap buffers for canvases that exceed a total area of (16384 * 16384) pixels. This matches what some other browser do. Thanks to @itamar8910 for finding this! :^)
2020-04-14LibWeb: Add CanvasRenderingContext2D.drawImage(image, x, y)Andreas Kling
This function allows you to draw a loaded <img> element into a canvas.
2020-04-14LibWeb: Add a JavaScript wrapper for HTMLImageElement :^)Andreas Kling
2020-04-14LibWeb: Add is<HTMLImageElement>()Andreas Kling
2020-04-14LibWeb: Dispatch a "load" event on HTMLImageElementAndreas Kling
2020-04-14LibJS: Remove shift, pop, push functions from Array objectLinus Groh
This abstraction isn't really that useful, as we can access the underlying Vector<Value> using elements() and operate on it directly.
2020-04-13LibJS: Do not execute scripts with parse errorsStephan Unverwerth
This adds missing checks in several LibJS consumers.
2020-04-13LibWeb: Use specific error classes when throwing exceptionsLinus Groh
Generally: - interpreter.throw_exception<JS::Error>("TypeError", "Message"); + interpreter.throw_exception<JS::TypeError>("Message");
2020-04-12LibWeb: Use an AffineTransform for CanvasRenderingContext2D :^)Andreas Kling
This will allow us to support complex 2D transforms.
2020-04-12LibWeb: Add port blacklist for ResourceLoader::loadBrendan Coles
`ResourceLoader::load` now rejects URLs which specify a `port` associated with network services known to be vulnerable to inter-protocol exploitation. Fixes #1735
2020-04-11LibWeb: Prevent http:// URLs loading scripts sourced from file:// URLsBrendan Coles
Fixes #1616
2020-04-08LibWeb: Support relative URL's in XMLHttpRequestAndreas Kling
In order to complete a relative URL, we need a Document. Fix this by giving XMLHttpRequest a pointer to its window object. Then we can go from the window to the document, and then we're home free. :^)
2020-04-08LibWeb: Add XMLHttpRequest object :^)Andreas Kling
This patch adds very basic XMLHttpRequest support to LibWeb. Here's an example that currently works: var callback = function() { alert(this.responseText); } var xhr = new XMLHttpRequest(); xhr.addEventListener("load", callback); xhr.open("GET", "http://serenityos.org/~kling/test/example.txt"); xhr.send(); There are many limitations and bugs, but it's pretty dang awesome that we have XHR. :^)
2020-04-08LibWeb: Expose the global object as "window"Andreas Kling
2020-04-08LibWeb: Remove bizarre HashMap leak in StyleProperties copy ctorAndreas Kling
2020-04-08LibWeb: Make CanvasRenderingContext2D use floats instead of intsAndreas Kling
This matches what we already do for the layout tree and things are expected to work this way regardless.
2020-04-08LibWeb: Add canvas.strokeRect(), and fix scale & translateBrian Gianforcaro
Add an implementation of CanvasRenderingContext2DWrapper.strokeRect(). While implementing this I fixed fillRect() and the new strokeRect() to honor the .scale() and .translate() values that had previously been plumbed. Also enhance the canvas.html demo to utilize strokeRect(), scale(), and translate().
2020-04-07LibWeb: Add Origin concept (protocol, host, port tuple)Andreas Kling
Every Document now has an Origin, found via Document::origin(). It's based on the URL of the document. This will be used to implement things like the same-origin policy.
2020-04-07LibCore: Add Core::Timer::create_single_shot()Andreas Kling
This is just a convenience function for creating single-shot timers.
2020-04-07LibWeb: Fix null dereference in HtmlView::mousedown_eventAndreas Kling
Running event handlers in response to a mouse event may cause full layout invalidation, so we can't expect the layout root to be present right after returning from JS. Fixes #1629.
2020-04-06LibJS: Support array holes, encoded as empty JS::ValueAndreas Kling
This patch adds a new kind of JS::Value, the empty value. It's what you get when you do JSValue() (or most commonly, {} in C++.) An empty Value signifies the absence of a value, and should never be visible to JavaScript itself. As of right now, it's used for array holes and as a return value when an exception has been thrown and we just want to unwind. This patch is a bit of a mess as I had to fix a whole bunch of code that was relying on JSValue() being undefined, etc.
2020-04-06Meta: Add missing copyright headersAndreas Kling
2020-04-06AK: Add out() and warn() streams that forward to stdout and stderrAndreas Kling
Our C++ code generator tools have been relying on host-side dbg() being forwarded to stdout until now. Now they use out() instead. Hopefully this will make it easier and more enticing to use streams in userspace programs as well. :^)
2020-04-06LibWeb: Allow window.setTimeout() with no intervalAndreas Kling
If no interval is specified, it will be treated as 0 and the callback function will be called on the next event loop iteration.
2020-04-05AK: Stop allowing implicit downcast with RefPtr and NonnullRefPtrAndreas Kling
We were allowing this dangerous kind of thing: RefPtr<Base> base; RefPtr<Derived> derived = base; This patch changes the {Nonnull,}RefPtr constructors so this is no longer possible. To downcast one of these pointers, there is now static_ptr_cast<T>: RefPtr<Derived> derived = static_ptr_cast<Derived>(base); Fixing this exposed a ton of cowboy-downcasts in various places, which we're now forced to fix. :^)
2020-04-05LibWeb: Add window.setTimeout()Andreas Kling
This also leaks the timer just like setInterval() (FIXME).