Age | Commit message (Collapse) | Author |
|
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.
|
|
This is pretty darn cool! :^)
|
|
|
|
|
|
If valid and decodable, the favicon will be provided to clients via the
on_favicon_change hook. :^)
|
|
|
|
|
|
|
|
|
|
|
|
This makes sure we repaint it right away so we can see the changes.
|
|
An ImageData is a wrapper around a Bitmap wrapper around a
JS::Uint8ClampedArray.
|
|
|
|
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.
|
|
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.
|
|
This moves us towards being able to run JavaScript in different global
objects without allocating a separate GC heap.
|
|
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.
|
|
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.
|
|
|
|
Stroking rects by drawing individual lines gives us line width support
without having to extend the Painter::draw_rect() code. :^)
|
|
This patch adds the following methods to CanvasRenderingContext2D:
- beginPath()
- moveTo(x, y)
- lineTo(x, y)
- closePath()
- stroke()
We also add the lineWidth property. :^)
|
|
|
|
No idea why someone would use that though.
|
|
|
|
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! :^)
|
|
This function allows you to draw a loaded <img> element into a canvas.
|
|
|
|
|
|
|
|
This abstraction isn't really that useful, as we can access the
underlying Vector<Value> using elements() and operate on it directly.
|
|
This adds missing checks in several LibJS consumers.
|
|
Generally:
- interpreter.throw_exception<JS::Error>("TypeError", "Message");
+ interpreter.throw_exception<JS::TypeError>("Message");
|
|
This will allow us to support complex 2D transforms.
|
|
`ResourceLoader::load` now rejects URLs which specify a `port`
associated with network services known to be vulnerable to
inter-protocol exploitation.
Fixes #1735
|
|
Fixes #1616
|
|
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. :^)
|
|
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. :^)
|
|
|
|
|
|
This matches what we already do for the layout tree and things are
expected to work this way regardless.
|
|
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().
|
|
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.
|
|
This is just a convenience function for creating single-shot timers.
|
|
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.
|
|
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.
|
|
|
|
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. :^)
|
|
If no interval is specified, it will be treated as 0 and the callback
function will be called on the next event loop iteration.
|
|
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. :^)
|
|
This also leaks the timer just like setInterval() (FIXME).
|