Age | Commit message (Collapse) | Author |
|
The current implementation felt a bit ad-hoc and notably allowed
textContent to operate on all node types. It also only returned the
child text content of the Node instead of the descendant text content.
|
|
|
|
The root of a node can never be null, as "the root of an object is
itself, if its parent is null, or else it is the root of its parent."
https://dom.spec.whatwg.org/#concept-tree-root
|
|
We maintain a directory of ID -> Node. Nodes add themselves to this
directory when they are created, receiving a random ID. When a Node is
destroyed, it removes itself from this directory. Anyone can request a
Node from the directory by its ID using `Node::from_id()`.
We reserve the `0` ID to mean "none".
These IDs allow different processes to communicate about a given Node
over IPC, for example the DOM Inspector.
|
|
|
|
An svg layout element without a `SVGSVGElement` ancestor caused a failed
assertion before, because the svg context does not exist when `paint()`
is called
|
|
Used by Web Components Polyfills.
|
|
Nodes implementing the adoption steps can modify the passed in
document, for example HTMLTemplateElement does so to adopt it's
contents into the new document.
|
|
This will be used in HTMLTemplateElement later to clone template
contents.
This makes the clone functions non-const in the process, as the cloning
steps can have side effects.
|
|
This is not a full check, it's just enough to prevent script execution
in DOMParser.
|
|
This method builds a JSON object representing the full state of the
DOM tree.
The JSON that is built will be used for building the DOM Inspector
widget for the OutOfProcessWebView.
|
|
The `if (child->parent())` check seems to be redundant, but I'm keeping
it just to match the spec.
|
|
Required by jQuery.
|
|
SPDX License Identifiers are a more compact / standardized
way of representing file license information.
See: https://spdx.dev/resources/use/#identifiers
This was done with the `ambr` search and replace tool.
ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
|
|
With this we can now successfully run a Vue.js 2 hello world! :^)
|
|
This fixes a few FIXMEs mentioned in 5beacf08a2d578d0eb36d6320255d0f4634a1085,
which depended on #6075 being fixed.
|
|
I initially had it in Node just because, but then saw it was part of
ParentNode in the spec.
|
|
While looking into getting Duck Duck Go loading further in the
Browser, I noticed that it was complaining about the missing
method Node.compareDocumentPosition.
This change implements as much of the DOM spec as possible
with the current implementation of the DOM to date. The
implementation is validated by new tests in the Node.js.
|
|
The mutation algorithms now more closely follow the spec and
fixes some assertion failures in tests such as Acid3 and Dromaeo.
The main thing that is missing right now is passing exceptions to the
bindings layer. This is because of issue #6075. I spent a while trying
to work it out and got so frustrated I just left it as a FIXME. Besides
that, the algorithms bail at the appropriate points.
This also makes the adopting steps in the document more spec compliant
as it's needed by the insertion algorithm. While I was at it, I added
the adoptNode IDL binding.
This adds a bunch of ancestor/descendant checks to TreeNode as well.
I moved the "remove_all_children" function to Node as it needs to use
the full remove algorithm instead of simply removing it from
the child list.
|
|
This particularly affects the insertion steps and the removed steps.
The insertion steps no longer take into the parent that the node
was inserted to, as per the spec. Due to this, I have renamed the
function from "inserted_into" to simply "inserted". None of the
users of the insertion steps was using it anyway.
The removed steps now take a pointer to the old parent instead of
a reference. This is because it is optional according to the spec
and old parent is null when running the removal steps for the
descendants of a node that just got removed.
This commit does not affect HTMLScriptElement as there is a bit
more to that, which is better suited for a separate commit.
Also adds in the adopted steps as they will be used later.
|
|
Rather than expecting the first parent to have a 'title' attribute,
search all ancestors.
|
|
|
|
This is useful when you want to traverse across shadow boundaries.
|
|
|
|
b72f067f0daac88ebe66e3f714e517b995b48e7b
|
|
This has been merged with the regular Thread::priority field after
the recent changes to the scheduler.
|
|
Since Web::Bindings::WindowObject inherits from JS::GlobalObject, it
cannot also inherit from Web::Bindings::EventTargetWrapper.
However, that's not actually necessary. Instead, we simply set the
Window object's prototype to the EventTargetPrototype, and add a little
extra branch in the impl_from() function that turns the JS "this" value
into a DOM::EventTarget*.
With this, you can now call window.addEventListener()! Very cool :^)
Fixes #4758.
|
|
The generic is<T>() uses dynamic_cast which is fine in the majority
of cases, but when one of them shows up in profiles, we can make it
faster by answering the is-a question manually.
|
|
|