Age | Commit message (Collapse) | Author |
|
Rather than printing them to stderr directly the parser now keeps a
Vector<Error>, which allows the "owner" of the parser to consume them
individually after parsing.
The Error struct has a message, line number, column number and a
to_string() helper function to format this information into a meaningful
error message.
The Function() constructor will now include an error message when
throwing a SyntaxError.
|
|
This will allow you us to implement special behavior when Ctrl+clicking
a button.
|
|
|
|
|
|
|
|
Uses a Core::Timer (similar to HTMLBlinkElement) to transition between
frames of an animated image. Also keeps track of the number of animation
loops.
|
|
This implements only one of the two forms of this function,
ctx.fill(winding_rule).
Also tweaks the quadratic curve demo to have a nice looking filled
shape.
|
|
This display type is implemented using a LayoutBlock that is_inline().
Basically it behaves like a block internally, and its children are laid
out in the normal block layout fashion. Externally however, it behaves
like an atomic inline-level box.
Layout of inline-block boxes happens in three stages:
1. The outer dimensions of the block are computed during the recursive
normal layout pass. We skip positioning, but lay out children.
2. Later on, during line layout in the *containing block*, the inline
block now contributes a linebox fragment. When linebox fragments are
positioned, we learn the final position of the inline block. That's
when we set the inline block's position.
3. We re-layout the inline block's children once again. This is done to
make sure they end up in the right position. The layout tree doesn't
use relative offsets, so after we position the inline block in (2),
its children will not have its positions updated. Relayout moves
all children of inline blocks to the right place.
This is a rather naive approach but it does get the basic behavior into
place so we can iterate on it. :^)
|
|
Let's at least try to keep going and see what we can render.
|
|
|
|
that was used to submit the form
|
|
The spec defines the only valid methods to be get, post, and dialog.
Post and dialog are currently unhandled and do nothing, any other value
(or no value specified) is defined by the spec to use the get method.
|
|
Also adds a test, and removes debug spam :tm:
|
|
We now use the size attribute to determine the width of a text input.
|
|
|
|
We now store the response headers in a download object on the protocol
server side and pass it to the client when finishing up a download.
Response headers are passed as an IPC::Dictionary. :^)
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
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. :^)
|
|
|
|
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 adds missing checks in several LibJS consumers.
|
|
This will allow us to support complex 2D transforms.
|
|
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.
|
|
|
|
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).
|
|
These don't do anything for now.
|
|
This patch makes it possible to execute JavaScript by clicking on an
anchor element with href="javascript:your_script_here()".
|
|
Scripts loaded in this way will block the parser until they finish
executing. This means that they see the DOM before the whole document
has been fully parsed. This is all normal, of course.
To make this work, I changed the way we notify DOM nodes about tree
insertion. The inserted_into() callbacks are now incrementally invoked
during parse, as each node is appended to its parent.
To accomodate inline scripts and inline style sheets, we now also have
a children_changed() callback which is invoked on any parent when it
has children added/removed.
|
|
Force Interpreter construction to go via a create() helper that takes
the global object type as a template parameter.
|
|
LibWeb now creates a WindowObject which inherits from GlobalObject.
Allocation of the global object is moved out of the Interpreter ctor
to allow for specialized construction.
The existing Window interfaces are moved to WindowObject with their
implementation code in the new Window class.
|