Age | Commit message (Collapse) | Author |
|
<!DOCTYPE> by itself is not a valid document type declaration.
|
|
Getting the innerHTML property will recurse through the subtree inside
the element and serialize it into a string as it goes.
Setting it will parse the set value as an HTML fragment. It will then
remove all current children of the element and replace them with all
the children inside the parsed fragment.
Setting element.innerHTML will currently force a complete rebuild of
the document's layout tree.
This is pretty neat! :^)
|
|
This safely removes all children from a Node.
|
|
This function allows you to throw away the entire layout tree if that's
something you want to do.
It's certainly not super cheap to reconstruct, but hey, who am I to
tell you what to do? :^)
|
|
If there's any text left in the parse buffer at the end of HTML parsing
we now commit it as a Text node.
|
|
|
|
|
|
|
|
|
|
This momentarily handles the CSS property "position: absolute;" in
combination with the properties "top" and "left", so that elements can
be placed anywhere on the page independently from their parents.
Statically positioned elements ignore absolute positioned elements when
calculating their position as they don't take up space.
|
|
These functions (rAF and cAF) should eventually stop using raw ID's
from GUI::DisplayLink as their identifiers. That's a FIXME for now. :^)
|
|
We now support rAF, driven by GUI::DisplayLink callbacks. It's a bit
strange how we keep registering new callbacks over and over.
That's something we can definitely optimize.
This allows you to update animations/whatever without doing it more
often than the browser can display.
|
|
|
|
This makes selector matching a lot more efficient, and also reduces the
number of strings on the heap.
|
|
Attribute names occur again and again.
|
|
This makes variable and property lookups a lot faster since comparing
two FlyStrings is O(1).
|
|
FlyString is a flyweight string class that wraps a RefPtr<StringImpl>
known to be unique among the set of FlyStrings. The class is very
unoptimized at the moment.
When to use FlyString:
- When you want O(1) string comparison
- When you want to deduplicate a lot of identical strings
When not to use FlyString:
- For strings that don't need either of the above features
- For strings that are likely to be unique
|
|
|
|
This implementation leaks a Core::Timer whenever you call setInterval()
so it will definitely need some improvements, but it does kinda work!
|
|
|
|
|
|
This patch adds the Event base class, along with a MouseEvent subclass.
We now dispatch MouseEvent objects for mousedown, mouseup and mousemove
and these objects have the .offsetX and .offsetY properties.
Both of those properties are hard-coded at the moment. This will be
fixed in the next patch. :^)
|
|
This is a very naive implementation that doesn't account for where the
mousedown happened.
|
|
|
|
This defers construction of the document wrapper until actually needed.
|
|
These should always pass the arguments in a const Vector<JS::Value>&.
|
|
This makes it possible to write shorter CSS. Instead of writing
.foo {
border-width: 3px;
border-style: solid;
border-color: blue;
}
it is now possible to write
.foo {
border: 3px solid blue;
}
while the order of values is irrelevant.
Currently only the basic values are supported. More values should be
added in the future.
Three more value specific parse functions were added:
parse_line_width, parse_color, and parse_line_style
Additionally a few test cases were added to borders.html.
|
|
The correct height is 150px rather than 300px.
|
|
If we don't hit one of the inline children, we should still report that
we've hit the block itself.
|
|
This patch adds HTMLCanvasElement along with a LayoutCanvas object.
The DOM and layout parts are very similar to <img> elements.
The <canvas> element holds a Gfx::Bitmap which is sized according to
the "width" and "height" attributes on the element.
Calling .getContext("2d") on a <canvas> element gives you a context
object that draws into the underlying Gfx::Bitmap of the <canvas>.
The context weakly points to the <canvas> which allows it to outlive
the canvas element if needed.
This is really quite cool. :^)
|
|
|
|
|
|
|
|
This patch adds the EventTarget class and makes Node inherit from it.
You can register event listeners on an EventTarget, and when you call
dispatch_event() on it, the event listeners will get invoked.
An event listener is basically a wrapper around a JS::Function*.
This is pretty far from how DOM events should eventually work, but it's
a place to start and we'll build more on top of this. :^)
|
|
|
|
Let's try to keep LibJS tidy as it expands. :^)
|
|
Instead of every NativeFunction callback having to ask the Interpreter
for the current "this" value and then converting it to an Object etc,
just pass "this" as an Object* directly.
|
|
|
|
This was pleasantly simple! We don't have an ElementWrapper yet, so it
just returns a NodeWrapper, but it still basically works. :^)
|
|
This patch introduces the Wrapper and Wrappable classes.
Node now inherits from Wrappable, and can be wrapped in a GC-allocated
Bindings::NodeWrapper object. The only property we expose right now is
the very simple nodeName property.
When a Document's JS::Interpreter is first instantiated, we add a
"document" property with a DocumentWrapper object to the global object.
This is pretty cool! :^)
|
|
This patch begins integrating LibJS into LibWeb. Document holds the
JS::Interpreter for now, and it is created on demand when you first
call Document::interpreter().
We also add a simple "alert()" function to the global object.
|
|
|
|
This way we don't refetch the background image every time style is
recomputed (e.g when hovering different elements.)
|
|
Let's rename this to LibWeb since it aims to provide more parts of the
web platform than just HTML. :^)
|