Age | Commit message (Collapse) | Author |
|
The "Box" suffix added nothing here.
|
|
This also does some east-const changes in TreeNode.
|
|
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
|
|
This will be used in the DOM Inspector to communicate which node is
being inspected.
|
|
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.
|
|
This is unrelated to the PR I'm working on, but keeps getting
reformatted because clang-format wants comments to start with a space.
|
|
|
|
Used by Web Components Polyfills.
|
|
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.
|
|
It was directly creating a new Element object instead of creating the
appropriate element.
For example, document.body.cloneNode(true) would return an Element
instead of an HTMLBodyElement.
|
|
Used by Web Components Polyfills.
|
|
This is not a full check, it's just enough to prevent script execution
in DOMParser.
|
|
This is now unused.
|
|
|
|
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 WebIDL spec specifies a few "simple" exception types in addition to
the DOMException type, let's support all of those.
This allows functions returning ExceptionOr<T> to throw regular
javascript exceptions (as limited by the webidl spec) by returning a
`DOM::SimpleException { DOM::SimpleExceptionType::T, "error message" }`
which is pretty damn cool :^)
|
|
This makes it much clearer what this cast actually does: it will
VERIFY that the thing we're casting is a T (using is<T>()).
|
|
The `if (child->parent())` check seems to be redundant, but I'm keeping
it just to match the spec.
|
|
It was using the passed in node instead of the node from the vector.
Fixes a crash I found while testing jQuery.
|
|
Required by jQuery.
|
|
This makes it more symmetrical with adopt_own() (which is used to
create a NonnullOwnPtr from the result of a naked new.)
|
|
|
|
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.
|
|
"for_each_in_inclusive_subtree(_of_type)"
This is because it includes the initial node that the function was
called on, which makes it "inclusive" as according to the spec.
This is important as there are non-inclusive variants, particularly
used in the node mutation algorithms.
|
|
|
|
Rather than expecting the first parent to have a 'title' attribute,
search all ancestors.
|
|
|
|
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED)
Since all of these checks are done in release builds as well,
let's rename them to VERIFY to prevent confusion, as everyone is
used to assertions being compiled out in release.
We can introduce a new ASSERT macro that is specifically for debug
checks, but I'm doing this wholesale conversion first since we've
accumulated thousands of these already, and it's not immediately
obvious which ones are suitable for ASSERT.
|
|
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.
|
|
It would be tempting to uncomment these statements, but that won't work
with the new changes.
This was done with the following commands:
find . \( -name '*.cpp' -o -name '*.h' -o -name '*.in' \) -not -path './Toolchain/*' -not -path './Build/*' -exec awk -i inplace '$0 !~ /\/\/#define/ { if (!toggle) { print; } else { toggle = !toggle } } ; $0 ~/\/\/#define/ { toggle = 1 }' {} \;
find . \( -name '*.cpp' -o -name '*.h' -o -name '*.in' \) -not -path './Toolchain/*' -not -path './Build/*' -exec awk -i inplace '$0 !~ /\/\/ #define/ { if (!toggle) { print; } else { toggle = !toggle } } ; $0 ~/\/\/ #define/ { toggle = 1 }' {} \;
|
|
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.
|
|
|