Revert "Bug 1932150 - Fix build bustage" for causing build bustages.

This reverts commit 0681b181d6.

Revert "Bug 1932150 - Fix lint failure" for causing Build bustage.

This reverts commit 60cc0878d3.

Revert "Bug 1932150 - Add new test cases for selection in flat tree r=smaug"

This reverts commit 3dbe5fc183.

Revert "Bug 1932150 - Make selection code to correctly iterate flattened tree r=smaug"

This reverts commit 6f7a1e4886.

Revert "Bug 1932150 - ContentSubtreeIterator #3: Fix a bug in ContentSubtreeIterator where the end container is in the light DOM of a shadow host r=jjaschke"

This reverts commit 19ce2c5806.

Revert "Bug 1932150 - ContentSubtreeIterator #2: Allow ContentSubtreeIterator to iterate nodes in flattened tree r=jjaschke"

This reverts commit d9d192bc3a.

Revert "Bug 1932150 - ContentSubtreeIterator #1: Make the end container related logic in ContentSubtreeIterator more robust r=jjaschke,smaug,dom-core"

This reverts commit 2fbde5b84d.

Revert "Bug 1932150 - Update ranges to correctly set and update nodes for flattened selection r=jjaschke,smaug,dom-core"

This reverts commit 116d26c37f.

Revert "Bug 1932150 - Allow using flat tree order for point comparing in selection r=jjaschke,smaug,dom-core"

This reverts commit 2ba73e1639.

Revert "Bug 1932150 - Fix some inconsistency about indicating whether the selection is allowed to cross the shadow boundary r=jjaschke,dom-core"

This reverts commit 793c2453f1.
This commit is contained in:
Atila Butkovits
2025-05-07 20:37:37 +03:00
committed by abutkovits@mozilla.com
parent ea2c42902e
commit da71eedf0a
46 changed files with 411 additions and 1319 deletions

View File

@@ -714,9 +714,6 @@ class nsContentUtils {
* 0 if point1 == point2.
* `Nothing` if the two nodes aren't in the same connected subtree.
*/
template <TreeKind aKind = TreeKind::ShadowIncludingDOM,
typename = std::enable_if_t<aKind == TreeKind::ShadowIncludingDOM ||
aKind == TreeKind::Flat>>
static mozilla::Maybe<int32_t> ComparePointsWithIndices(
const nsINode* aParent1, uint32_t aOffset1, const nsINode* aParent2,
uint32_t aOffset2, NodeIndexCache* aIndexCache = nullptr);
@@ -731,10 +728,7 @@ class nsContentUtils {
* 0 if point1 == point2.
* `Nothing` if the two nodes aren't in the same connected subtree.
*/
template <TreeKind aKind = TreeKind::ShadowIncludingDOM, typename PT1,
typename RT1, typename PT2, typename RT2,
typename = std::enable_if_t<aKind == TreeKind::ShadowIncludingDOM ||
aKind == TreeKind::Flat>>
template <typename PT1, typename RT1, typename PT2, typename RT2>
static mozilla::Maybe<int32_t> ComparePoints(
const mozilla::RangeBoundaryBase<PT1, RT1>& aBoundary1,
const mozilla::RangeBoundaryBase<PT2, RT2>& aBoundary2,
@@ -750,9 +744,6 @@ class nsContentUtils {
* traditional behavior. If you want to use this in new code, it means that
* you **should** check the offset values and call `ComparePoints` instead.
*/
template <TreeKind aKind = TreeKind::ShadowIncludingDOM,
typename = std::enable_if_t<aKind == TreeKind::ShadowIncludingDOM ||
aKind == TreeKind::Flat>>
static mozilla::Maybe<int32_t> ComparePoints_AllowNegativeOffsets(
const nsINode* aParent1, int64_t aOffset1, const nsINode* aParent2,
int64_t aOffset2) {
@@ -775,7 +766,7 @@ class nsContentUtils {
}
// Otherwise, aOffset1 nor aOffset2 is referred so that any value is fine
// if negative.
return ComparePointsWithIndices<aKind>(
return ComparePointsWithIndices(
aParent1,
// Avoid warnings.
aOffset1 < 0 ? aParent1->GetChildCount()
@@ -787,8 +778,7 @@ class nsContentUtils {
: std::min(static_cast<uint32_t>(aOffset2),
aParent2->GetChildCount()));
}
return ComparePointsWithIndices<aKind>(aParent1, aOffset1, aParent2,
aOffset2);
return ComparePointsWithIndices(aParent1, aOffset1, aParent2, aOffset2);
}
/**
@@ -3644,9 +3634,6 @@ class nsContentUtils {
* node.
* Return Nothing if aChild1 is a root of the native anonymous subtree.
*/
template <TreeKind aKind,
typename = std::enable_if_t<aKind == TreeKind::ShadowIncludingDOM ||
aKind == TreeKind::Flat>>
static mozilla::Maybe<int32_t> CompareChildNodes(
const nsINode* aChild1, const nsINode* aChild2,
NodeIndexCache* aIndexCache = nullptr);
@@ -3676,12 +3663,8 @@ class nsContentUtils {
* includes odd traditional behavior. Therefore, do not use this method as a
* utility method.
*/
template <TreeKind aKind = TreeKind::ShadowIncludingDOM,
typename = std::enable_if_t<aKind == TreeKind::ShadowIncludingDOM ||
aKind == TreeKind::Flat>>
static mozilla::Maybe<int32_t> CompareClosestCommonAncestorChildren(
const nsINode&, const nsINode*, const nsINode*,
NodeIndexCache* = nullptr);
const nsINode&, const nsINode*, const nsINode*, NodeIndexCache*);
static nsIXPConnect* sXPConnect;