Age | Commit message (Collapse) | Author |
|
Note that there is currently no way to display them as we can't
currently clone nodes.
Adds special case for templates for dumping to console.
Doesn't add it to the DOM inspector as I'm not sure how to do it.
|
|
Reading the property has a few warts (see FIXMEs in the included
tests), but with this the timestamps on http://45.33.8.238/
get localized :^)
Since the Date() constructor currently ignores all arguments,
they don't get localized correctly but are all set to the current
time, but hey, it's still progress from a certain point of view.
|
|
|
|
Also adds a TypeScript definition file for the test runner object.
|
|
...{All} to ParentNode. Exposes createDocumentFragment and
createComment on Document. Stubs out the document.body setter.
Also adds ParentNode back :^).
|
|
This requires moving remove_all_children() from ParentNode to
Node, which makes ParentNode.cpp empty, so remove it.
It also co-opts the existing Node::text_content() method and
tweaks it slightly to fit the semantics of Node.textContent.
|
|
|
|
You can now cycle through focusable elements (currently only hyperlinks
are focusable) with the Tab key.
The focus outline is rendered in a new FocusOutline paint phase.
|
|
This is handy for traversing only the elements in a document.
|
|
Decorated Interpreter::call() with [[nodiscard]] to provoke thinking
about the returned value at each call site. This is definitely not
perfect and we should really start thinking about slimming down the
public-facing LibJS interpreter API.
Fixes #3136.
|
|
This file has been moved from DOM/ to HTML/ in
a784090b91139776b26fbac2a8426de3abdea308.
|
|
|
|
|
|
We don't want to carry over exceptions across multiple
Document::run_javascript() calls as Interpreter::run() and every of its
exception checks will get confused - in this case there would be an
exception, but not because a certain action failed.
Real-life example:
<script>var a = {}; a.test()</script>
<script>alert("It worked!")</script>
The above HTML will invoke Document::run_javascript() twice, the first
call will result in a TypeError, which is still stored during the second
call. The interpreter will eventually call the following functions (in
order) for the alert() invocation:
- Identifier::execute()
- Interpreter::get_variable()
- Object::get() (on the global object)
That last Object::get() call has an exception check which is triggered
as we still carry around the exception from earlier - and eventually
returns an empty value.
Long story short, the second script will wrongly fail with
"ReferenceError, 'alert' is not defined".
Fixes #3091.
|
|
Since these are generally useful in our trees, let's just keep them
in TreeNode instead of duplicating the helpers in subclasses.
|
|
This is mostly to get the grunt work of the way. This is split up into
multiple commits to hopefully make it more manageable to review.
Note that these are not full implementations, and the bindings mostly
get the low hanging fruit.
Also implements some attributes that I kept out because they had
dashes in them. Therefore, this closes #2905.
|
|
Now that document element returns a generic DOM element, we need to
make sure head and body get a html element.
The spec just says to check if the document element is a html element,
so let's do that.
|
|
|
|
|
|
Here's another CRTP mixin since that's the best we can do with C++.
This prepares exposing these via IDL on Element and CharacterData.
|
|
Also change DOM::Document::document_element() to return an Element*
and not an HTML::HTMLHtmlElement since that's not the only kind of
documentElement we might encounter.
|
|
HTMLElement is the only interface that includes ElementContentEditable
in the HTML specification. This makes sense, as Element is also a base
class for elements in other specifications such as SVG,
which definitely shouldn't be editable.
Also adds a test for the attribute based on what Andreas did in the
video that added it.
|
|
|
|
We now respect the contenteditable HTML attribute and only let you
edit content inside explicitly editable elements.
|
|
This works everywhere right now, but it's obviously not going to stay
that way forever. :^)
Note that this does not advance the cursor correctly for whitespace
since the cursor is DOM-based and doesn't take whitespace collapsing
into account yet.
|
|
This will be used for editable content. :^)
|
|
|
|
|
|
|
|
|
|
|
|
Named after the UIEvents specification that houses MouseEvent.
|
|
Note that these aren't full implementations of the bindings. This
mostly implements the low hanging fruit (namely, basic reflections)
There are some attributes that should be USVString instead of
DOMString. However, USVString is a slightly different definition
of DOMString, so it should suffice for now.
|
|
|
|
LibWeb keeps growing and the Web namespace is filling up fast.
Let's put DOM stuff into Web::DOM, just like we already started doing
with SVG stuff in Web::SVG.
|
|
|
|
|
|
Take a hint from SVG and more all the HTML classes into HTML instead of
mixing them with the DOM classes.
|
|
|
|
|
|
Adds some conversion constructors, as well as the missing arithmetic
operations.
|
|
|
|
This commit starts adding a basic SVG element. Currently, svg elements
have support for the width and height properties, as well as the stroke,
stroke-width, and fill properties. The only child element supported
is the path element, as most other graphical elements are just shorthand
for paths.
|
|
|
|
|
|
These are reflecting attributes! :^)
|
|
To prepare for fully qualified tag names, let's call this local_name.
Note that we still keep an Element::tag_name() around since that's what
the JS bindings end up calling into for the Element.tagName property.
|
|
These are HTML lengths that map to CSS width and height respectively.
|
|
Presentation attribute lengths (width, height, etc.) can always be
unit-less (e.g "400") so going via the normal CSS parsing path only
works when the document is in quirks mode.
Add a separate parse_html_length() that always allows unit-less values.
|
|
This allows us to determine which mode to render the page in.
Exposes "doctype" and "compatMode" on Document.
Exposes "name", "publicId" and "systemId" on DocumentType.
|