summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/TreeNode.h
AgeCommit message (Collapse)Author
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
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 *
2021-04-20LibWeb: Add capabilities to find the index of a child in its parent.Tobias Christiansen
For Elements depending on the index they are inside their parent. Most notably the <ol> element. Also added a typed version to only count children of a certain type. This patch is work towards #2059
2021-04-10AK+Everywhere: Make StdLibExtras templates less wrapper-yAnotherTest
This commit makes the user-facing StdLibExtras templates and utilities arguably more nice-looking by removing the need to reach into the wrapper structs generated by them to get the value/type needed. The C++ standard library had to invent `_v` and `_t` variants (likely because of backwards compat), but we don't need to cater to any codebase except our own, so might as well have good things for free. :^)
2021-04-06LibWeb: Make the node mutation algorithms more spec compliantLuke
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.
2021-04-06LibWeb: Add non-inclusive variants of subtree traversalLuke
2021-04-06LibWeb: Rename "for_each_in_subtree(_of_type)" to ↵Luke
"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.
2021-04-06LibWeb: Strip out the mutation event logic from TreeNodeLuke
This will instead be done by Node, as they need to occur at precise steps of the mutation algorithms. Additionally, some of the events may need to be run multiple times. For example, the removal steps is run for all the shadow-including descendants of the node that just got removed.
2021-04-06LibWeb: Sever parent/child connections in ~TreeNode()Andreas Kling
Also make sure to unref the children if there are any. Without this it was very easy to leak TreeNodes.
2021-04-06LibWeb: Remove duplicated code in TreeNode::remove_child()Andreas Kling
We were assigning to m_first_child twice.
2021-02-23Everywhere: Rename ASSERT => VERIFYAndreas Kling
(...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.
2021-01-12Libraries: Move to Userland/Libraries/Andreas Kling