Commit Graph
56 Commits
Author SHA1 Message Date
Jan-Niklas Jaeschke 0b2d030087 Bug 2030660 - Remove dom.shadowdom.selection_across_boundary.enabled pref. r=masayuki,webidl
Differential Revision: https://phabricator.services.mozilla.com/D293086
2026-04-10 08:02:43 +00:00
Sylvestre Ledru 9eb1a31a98 Bug 2023419 - Remove Emacs/Vim modelines from dom/ r=emilio,media-playback-reviewers,webidl,padenot
replaced by .editorconfig
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D287843
2026-03-16 21:02:32 +00:00
Norisz Fay a86d829321 Revert "Bug 2012637 - part 9: Add a Firefox Source Docs documentation page for TreeKind and notable issues r=smaug,dom-core" as requested by dev
This reverts commit 88008cd8ca.

Revert "Bug 2012637 - part 8: Make `nsContentUtils::ComparePoints` handle `TreeKind::Flat` and `TreeKind::FlatForSelection` correctly r=smaug,dom-core"

This reverts commit 73e6f6587b.

Revert "Bug 2012637 - part 7: Make `RangeUtils::CompareNodeToRangeBoundaries()` use `nsContentUtils::ComparePoints` with valid point in the tree r=smaug"

This reverts commit 6985d5e80f.

Revert "Bug 2012637 - part 6: Make `nsRange::CutContents()` convert the range boundaries to the ones in the DOM before comparing r=smaug"

This reverts commit 73b585af3d.

Revert "Bug 2012637 - part 5: Delete the default template parameter of `nsContentUtils::ComparePoints` and relatives r=smaug,dom-core"

This reverts commit 1a7f24e5b5.

Revert "Bug 2012637 - part 4: Make `nsContentUtils` use `nsIContent` for taking a child node as a parameter r=smaug"

This reverts commit a6ea8d6824.

Revert "Bug 2012637 - part 3: Add template `nsINode` API which can switch to call API from `TreeKind` r=smaug,dom-core,webidl"

This reverts commit a4211e9df0.

Revert "Bug 2012637 - part 2: Add `TreeKind::FlatForSelection` and change the template parameter of `ChildIteratorBase` to `TreeKind` r=smaug,dom-core"

This reverts commit 0241749ee7.

Revert "Bug 2012637 - part 1: Make `ChildIterBase` template class to re-implement `FlattenedChildIterator` for DOM, Flat and FlatForSelection TreeKind r=smaug,dom-core,layout-reviewers,emilio"

This reverts commit 9e71cb77fb.
2026-03-13 02:52:45 +00:00
Masayuki Nakano 73e6f6587b Bug 2012637 - part 8: Make nsContentUtils::ComparePoints handle TreeKind::Flat and TreeKind::FlatForSelection correctly r=smaug,dom-core
The important point is, `Selection` and `AbstractRange` should not work
with the UA shadow trees such as created by `<details>`, `<video>`,
SVG `<use>`, etc because their children may be slotted into the shadow
tree or may stay as the children as the host, but they can appear as a
range boundaries since the Web API specifies the points in the
non-flattened tree.

This patch makes `nsContentUtils::ComparePoints` and its helpers use
the template APIs added by the previous patches without changing the
current logic in the most cases.

This patch disable the helper methods which compare children and/or
offsets if `TreeKind` is `ShadowIncludingDOM` because the template
APIs do not work with `TreeKind::ShadowIncludingDOM` for avoiding
the unclear behavior around a shadow host and its `ShadowRoot` children.
However, this makes them clearer and simpler, they can now work with
the template methods without any special handlings.

Differential Revision: https://phabricator.services.mozilla.com/D281311
2026-03-12 03:02:01 +00:00
Masayuki Nakano 6985d5e80f Bug 2012637 - part 7: Make RangeUtils::CompareNodeToRangeBoundaries() use nsContentUtils::ComparePoints with valid point in the tree r=smaug
It may call `nsContentUtils::ComparePoints_AllowNegativeOffsets()` and
`nsContentUtils::ComparePointsWithIndices()` within points in different
kind of tree. Therefore, it should use `ConstRawRangeBoundary` and
convert the points to the one in the expected tree.

Differential Revision: https://phabricator.services.mozilla.com/D281310
2026-03-12 03:01:59 +00:00
Masayuki Nakano a4211e9df0 Bug 2012637 - part 3: Add template nsINode API which can switch to call API from TreeKind r=smaug,dom-core,webidl
This will make the main patch simpler. However, some of them do not
support `TreeKind::ShadowIncludingDOM` because it's unclear what
should return as a parent node of a child of `ShadowRoot`, what should
return as a child node of a shadow host. To avoid the developers to use
them on wrong assumptions, this patch makes the users use `DOM`, `Flat`
or `FlatForSelection` explicitly.

Differential Revision: https://phabricator.services.mozilla.com/D281305
2026-03-12 03:01:50 +00:00
Masayuki Nakano 0241749ee7 Bug 2012637 - part 2: Add TreeKind::FlatForSelection and change the template parameter of ChildIteratorBase to TreeKind r=smaug,dom-core
This add `TreeKind::FlatForSelection` which should ignore the UA shadow
trees which are created in `<details>`, `<video>`, SVG `<use>`, etc
because their children are not selectable or slotted and reordered by
the shadow tree so that `Selection` and `AbstractRange` need to work
with their children in the non-flattened tree.

This patch does not change the behavior. It'll be done by a following
patch.

Differential Revision: https://phabricator.services.mozilla.com/D281304
2026-03-12 03:01:48 +00:00
Masayuki Nakano f880cd0ef8 Bug 2010730 - Rewrite RangeBoundaryBase::AsRangeBoundaryInFlatTree() r=jjaschke,smaug,dom-core
Currently, the method may return unset boundary.  However, we need to
map a DOM tree point to a flat tree point.

The wrong point of current implementation is, the method respect the
container and offset. However, that may be wrong if the pointing child
node is moved into a `<slot>` or a `ShadowRoot`. Instead, this patch
computes proper parent from pointing child node if there is.

(I think there should be `nsINode::ComputeFlatTreeIndexOfForSelection`
or something, but I'd like to put off doing that later because it'd
affect to wider scope of our code.)

Differential Revision: https://phabricator.services.mozilla.com/D279308
2026-01-25 23:20:58 +00:00
agoloman 96800d940e Revert "Bug 2010730 - Rewrite RangeBoundaryBase::AsRangeBoundaryInFlatTree() r=jjaschke,smaug,dom-core" for causing wpt failures @setBaseAndExtent-start-or-end-in-anonymous-shadow-container.html.
This reverts commit 34e2538a71.
2026-01-23 06:51:38 +00:00
Masayuki Nakano 34e2538a71 Bug 2010730 - Rewrite RangeBoundaryBase::AsRangeBoundaryInFlatTree() r=jjaschke,smaug,dom-core
Currently, the method may return unset boundary.  However, we need to
map a DOM tree point to a flat tree point.

The wrong point of current implementation is, the method respect the
container and offset. However, that may be wrong if the pointing child
node is moved into a `<slot>` or a `ShadowRoot`. Instead, this patch
computes proper parent from pointing child node if there is.

(I think there should be `nsINode::ComputeFlatTreeIndexOfForSelection`
or something, but I'd like to put off doing that later because it'd
affect to wider scope of our code.)

Differential Revision: https://phabricator.services.mozilla.com/D279308
2026-01-23 05:21:05 +00:00
Masayuki Nakano 2c062eb9c4 Bug 2006963 - part 2: Make AbstractRange::SetStartAndEndInternal check the order of light DOM to set the range in the light DOM r=smaug
Our internal DOM utilities for `Selection` ignore the `<slot>` and
`ShadowRoot` of UI widgets like `<use>` and `<details>`.  However,
the selection range is handled as in the flat tree.  Therefore, the
range in the light DOM (as the result of `Selection.getRangeAt()`)
may store the boundaries in the opposite order if the flat tree changes
the order of the nodes in the light DOM in the UA widget.

Therefore, when we set `nsRange`, we need to compare the position in the
light DOM and set the boundaries in the correct order.

Noe that this means that the range for cross shadow boundaries and the
range in the light DOM may have opposite order even thought the
containers are the same.  However, this patch does not dive into the
hell due to out of scope of the bug.

Differential Revision: https://phabricator.services.mozilla.com/D277403
2026-01-13 05:28:28 +00:00
Masayuki Nakano 5d425341c3 Bug 2006963 - part 1: Make nsContentUtils::ComparePointsWithIndices not compare shadow root of the parent with a child r=smaug
It gets inclusive ancestors of the container nodes with
`CommonAncestors` and `GetParentFuncForComparison<aKind>()`.

`GetParentFuncForComparison<aKind>()` returns:

If `aKind` is `TreeKind::Flat` and the node is assigned to a slot:
  If parent has shadow root and  which is assigned to a slot, the slot.
  If parent is in a shadow and a `<slot>`,  the `<slot>` or `nullptr`
  If parent is a shadow root, the shadow host
  Otherwise, the parent node.
Otherwise:
  If the node is a shadow root, the shadow host
  Otherwise, the parent node.

So, `CommonAncestors` will contain `ShadowRoot` only in the last case.
However, `nsContentUtils::ComparePointsWithIndices` checks whether
the shadow root of the parent is the same as the comparing child and
return the special result only in such case. So, the path is not used
if `CommonAncestors` skips the shadow root ancestors.

At the checks, the child node is known as a child or a descendant of
the container. Therefore, it should be enough to check whether the
parent has a shadow root or not.

Differential Revision: https://phabricator.services.mozilla.com/D277402
2026-01-13 05:28:25 +00:00
Emilio Cobos Álvarez 2a3733e687 Bug 2006613 - Optimize front-removal of various tree-ordered-arrays. r=smaug
The previous approach wasn't quite sound, because it makes the frame
constructor receive the WillBeRemoved after the flat tree has already
changed.

Instead, what do you think about something like this? This creates a
very simple wrapper over an array, but special-cases removals from the
front, and uses it for TreeOrderedArray and also AssignedNodes...

It could be polished (in particular there are a few places where an
Span::IndexOf operator could be beneficial and so).

Differential Revision: https://phabricator.services.mozilla.com/D277301
2025-12-22 21:03:58 +00:00
Norisz Fay ac500ea570 Revert "Bug 2006613 - Optimize front-removal of various tree-ordered-arrays. r=smaug" for causing multiple failures and bustages
This reverts commit 4d02f992d0.
2025-12-22 19:45:18 +00:00
Emilio Cobos Álvarez 4d02f992d0 Bug 2006613 - Optimize front-removal of various tree-ordered-arrays. r=smaug
The previous approach wasn't quite sound, because it makes the frame
constructor receive the WillBeRemoved after the flat tree has already
changed.

Instead, what do you think about something like this? This creates a
very simple wrapper over an array, but special-cases removals from the
front, and uses it for TreeOrderedArray and also AssignedNodes...

It could be polished (in particular there are a few places where an
Span::IndexOf operator could be beneficial and so).

Differential Revision: https://phabricator.services.mozilla.com/D277301
2025-12-22 18:35:29 +00:00
Masayuki Nakano ae1d88575c Bug 2000978 - Make ContentIteratorBase::Init() take const AbstractRange* instead of AbstractRange* r=smaug
`ContentIterator` shouldn't modify the range.  Therefore, its users
should be able to initialize its instance with `const AbstractRange*`.

Unfortunately, the range is stored by `ContentSubtreeIterator` and
needs to be managed by the cycle collector.  Therefore, only
`ContentSubtreeIterator` requires non-const range so that it requires to
clone the given range if and only if initialized with a const range.

Differential Revision: https://phabricator.services.mozilla.com/D274093
2025-12-15 07:52:56 +00:00
Emilio Cobos Álvarez 791917d8af Bug 1976665 - Sort headers in dom/. r=dom-core,media-playback-reviewers,webrtc-reviewers,dom-storage-reviewers,padenot,janv,smaug,jesup,jib
Most changes are automated. Relevant bit is dom/.clang-format. I had to
manually disable clang-format in a few places where importing external
files and so on that aren't self-contained, and fix a couple includes /
forward declarations.

Differential Revision: https://phabricator.services.mozilla.com/D256800
2025-08-05 11:47:34 +00:00
Sean Feng 352d49660e Bug 1965846 - Allow RangeBoundary to correctly behave when the boundary is for <slot> r=masayuki,dom-core
Basically this patch introduces some helper methods to correctly
determine the next/previous nodes when a <slot> is the parent and flat tree
is expected to be used.

This patch also added some assertions to nsContentUtils::ComparePoints
(and its variants) to ensure we only compare range boundaries that have
the same type.

Differential Revision: https://phabricator.services.mozilla.com/D251609
2025-07-03 13:25:15 +00:00
Sean Feng e6a6045ffb Bug 1965664 - Fix some crashes in ContentSubtreeIterator r=jjaschke,dom-core
by skipping the shadow hosts that ShadowDOM selection doesn't
support at the moment.

Differential Revision: https://phabricator.services.mozilla.com/D248917
2025-05-13 00:23:43 +00:00
Sean Feng d3f6c9a968 Bug 1932150 - Update ranges to correctly set and update nodes for flattened selection r=jjaschke,smaug,dom-core
Differential Revision: https://phabricator.services.mozilla.com/D231589
2025-05-09 18:19:04 +00:00
Sean Feng 59893c42dc Bug 1932150 - Allow using flat tree order for point comparing in selection r=jjaschke,smaug,dom-core
Differential Revision: https://phabricator.services.mozilla.com/D231588
2025-05-09 18:19:00 +00:00
Sean Feng 322a5282b6 Bug 1932150 - Fix some inconsistency about indicating whether the selection is allowed to cross the shadow boundary r=jjaschke,dom-core
Differential Revision: https://phabricator.services.mozilla.com/D246949
2025-05-09 18:18:57 +00:00
Serban Stanca 5290701da0 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 f0836d70a7.
2025-05-08 20:00:35 +00:00
Serban Stanca 5691c4beb2 Revert "Bug 1932150 - Allow using flat tree order for point comparing in selection r=jjaschke,smaug,dom-core"
This reverts commit 8d55fdef16.
2025-05-08 20:00:31 +00:00
Serban Stanca 032142893c Revert "Bug 1932150 - Update ranges to correctly set and update nodes for flattened selection r=jjaschke,smaug,dom-core"
This reverts commit 0221ba097e.
2025-05-08 20:00:27 +00:00
Sean Feng 0221ba097e Bug 1932150 - Update ranges to correctly set and update nodes for flattened selection r=jjaschke,smaug,dom-core
Differential Revision: https://phabricator.services.mozilla.com/D231589
2025-05-08 13:40:04 +00:00
Sean Feng 8d55fdef16 Bug 1932150 - Allow using flat tree order for point comparing in selection r=jjaschke,smaug,dom-core
Differential Revision: https://phabricator.services.mozilla.com/D231588
2025-05-08 13:40:01 +00:00
Sean Feng f0836d70a7 Bug 1932150 - Fix some inconsistency about indicating whether the selection is allowed to cross the shadow boundary r=jjaschke,dom-core
Differential Revision: https://phabricator.services.mozilla.com/D246949
2025-05-08 13:39:57 +00:00
Atila Butkovits da71eedf0a 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.
2025-05-07 18:30:42 +00:00
Sean Feng 2ba73e1639 Bug 1932150 - Allow using flat tree order for point comparing in selection r=jjaschke,smaug,dom-core
Differential Revision: https://phabricator.services.mozilla.com/D231588
2025-05-07 15:08:34 +00:00
Sean Feng 793c2453f1 Bug 1932150 - Fix some inconsistency about indicating whether the selection is allowed to cross the shadow boundary r=jjaschke,dom-core
Differential Revision: https://phabricator.services.mozilla.com/D246949
2025-05-07 15:08:30 +00:00
Masayuki Nakano a5637890c7 Bug 1946001 - Fix some points which may cross independent selection boundary r=emilio,jjaschke
This patch fixes multiple points which may cross independent selection
boundaries which is element boundary of the native anonymous `<div>` for
editable content in text controls.  The reason why I don't split this patch is,
fixing one of them leads another assertion failure.  So, I couldn't pass all
tests with separated patches.

1. `nsFrameTraversal` should take `Element` instead of `nsIFrame` for the
limiter because e.g., inline editing host like `<span contenteditable>` may
have multiple frames if it's wrapped.  Therefore, we should make it take
an element as the ancestor limiter, and check it when getting parent frame
or after getting previous or next frame.
2. `nsIFrame::PeekBackwardAndForward` may cross the boundary because it does not
take the anonymous `<div>` element as ancestor limiter of the selection.  It's
currently used only for extending selection.  Therefore, I rename it to make
it clearer.
3. `SelectionMovementUtils::GetPrevNextBidiLevel` to take the ancestor limiter
for calling `nsIFrame::GetFrameFromDirection()`.
4. `nsINode` should have a method to return the `nsFrameSelection` instance
which manages the selection in the node.  This makes the check simpler, and
this is not expensive.  Then, for making it clearer, I rename
`TextControlElement::GetConstFrameSelection()` to
`GetIndependentFrameSelection()`.
5. `nsINode::GetSelectionRootContent()` should have an option to return
independent selection root when the node is its host for
`nsFrameSelection::ConstrainFrameAndPointToAnchorSubtree()`
6. `nsFrameSelection::ConstrainFrameAndPointToAnchorSubtree()` should not
retrieve independent selection root when the given frame is a text control
frame.
7. `RangeUtils` should get parent with checking the independent selection
boundaries.
8. `Selection::Extend` should assert if the destination is managed by its
frame selection to detect a bug.

Differential Revision: https://phabricator.services.mozilla.com/D241587
2025-03-17 12:49:57 +00:00
Masayuki Nakano da4abce2d9 Bug 1945714 - Rename RangeBoundaryBase::Container() to GetContainer() r=jjaschke,dom-core
Usually, we name methods as `GetFoo()` if they may return `nullptr`, on the
other hand, we name methods as `Foo()` if they won't return `nullptr`.

`RangeBoundaryBase::Container()` may return `nullptr`.  So, this name may cause
misleading of some developers.  Let's rename it as `GetContainer()`.

This does not change anything for avoiding merge conflict with the other
landings.

Differential Revision: https://phabricator.services.mozilla.com/D236796
2025-02-10 01:29:40 +00:00
Masayuki Nakano 01bac70fb9 Bug 1945711 - part 4: Rename the aParent/aOffset version of nsContentUtils::ComparePoints to ComparePointsWithIndices r=jjaschke,dom-core
To make it easier to find the callers, we should give different name instead
of overloading.

Differential Revision: https://phabricator.services.mozilla.com/D236794
2025-02-10 01:29:40 +00:00
Sean Feng c9765020e2 Bug 1881095 - Separate IteratorHelpers out for reuse r=jjaschke,dom-core
Differential Revision: https://phabricator.services.mozilla.com/D211576
2024-06-10 18:59:49 +00:00
Sean Feng 4a776dbb51 Bug 1867058 - Part 8: Update Selection to support across shadow dom selection r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D195310
2024-03-25 13:40:59 +00:00
pstanciu bcc6e01718 Backed out 12 changesets (bug 1867058) for causing bustages on AbstractRange.cpp
Backed out changeset 6254c9c51033 (bug 1867058)
Backed out changeset 2ad556d56736 (bug 1867058)
Backed out changeset a8bc41291ab3 (bug 1867058)
Backed out changeset c30869c03a70 (bug 1867058)
Backed out changeset 39c5816dff6b (bug 1867058)
Backed out changeset 42e226158dc9 (bug 1867058)
Backed out changeset 67bb7158a09f (bug 1867058)
Backed out changeset 7b5a689dc7fd (bug 1867058)
Backed out changeset 3cf108eb13a6 (bug 1867058)
Backed out changeset 8efda4cce80c (bug 1867058)
Backed out changeset 0837e15babab (bug 1867058)
Backed out changeset 8ce7972ea4df (bug 1867058)
2024-03-23 02:24:26 +02:00
Sean Feng e71c2c9c02 Bug 1867058 - Part 8: Update Selection to support across shadow dom selection r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D195310
2024-03-22 17:05:51 +00:00
Jan-Niklas Jaeschke f552f01a77 Bug 1828469, part 1: Prepare RangeBoundaryBase to be able to handle non-MutationObserver Range classes. r=masayuki
In order to support `StaticRange`s, which are not `MutationObserver`s, RangeBoundaries need to have an alternative way of ensuring that `mRef` points to the correct node.
This is now done by validating `mRef` every time `Ref()` is called using the parent and offset.
For performance reasons, this is disabled by default and should only be used for `StaticRange`s.

Differential Revision: https://phabricator.services.mozilla.com/D177892
2023-05-31 08:23:45 +00:00
Noemi Erli 9a6edab85a Backed out 3 changesets (bug 1828469) for causing assertion in RangeBoundary.h
Backed out changeset ab92a12ba6ea (bug 1828469)
Backed out changeset 217801294c41 (bug 1828469)
Backed out changeset c78c717e4ec9 (bug 1828469)
2023-05-23 12:10:12 +03:00
Jan-Niklas Jaeschke 67e9d1e491 Bug 1828469, part 1: Prepare RangeBoundaryBase to be able to handle non-MutationObserver Range classes. r=masayuki
In order to support `StaticRange`s, which are not `MutationObserver`s, RangeBoundaries need to have an alternative way of ensuring that `mRef` points to the correct node.
This is now done by validating `mRef` every time `Ref()` is called using the parent and offset.
For performance reasons, this is disabled by default and should only be used for `StaticRange`s.

Differential Revision: https://phabricator.services.mozilla.com/D177892
2023-05-23 06:53:32 +00:00
Emilio Cobos Álvarez c195031050 Bug 1825825 - Simplify NAC setup. r=smaug
Make all UA widgets also NAC.

Keep the UA widget flag but break at anonymous subtree boundaries, so
that only nodes inside the UA widget directly (and not NAC from those)
get the flag.

This is important because two callers depend on this difference:

 * The style system, since we still want to match content rules from
   stylesheets in the UA widget. We also match user rules, which is a
   bit sketchy, but that was the previous behavior, will file a
   follow-up for that.

 * The reflector code, since we want the scope for UA widgets to not
   include the NAC nodes inside that UA widget. nsINode::IsInUAWidget
   got it wrong.

After this patch, ChromeOnlyAccess is equivalent to
IsInNativeAnonymousSubtree, so we should probably unify the naming.
That's left for a follow-up patch because I don't have a strong
preference.

Differential Revision: https://phabricator.services.mozilla.com/D174310
2023-04-05 09:19:15 +00:00
Masayuki Nakano f0a61e93ec Bug 1740853 - part 3: Redesign nsContentUtils::ComparePoints_Fix*() as taking int64_t for the offset r=smaug
For reducing the legacy behavior emulator of `nsContentUtils::ComparePoints`
and make it simpler, this patch makes it take `int64_t` as the offset.
Additionally, it's named "ComparePoints_AllowNegativeOffsets`.

Differential Revision: https://phabricator.services.mozilla.com/D132549
2021-12-09 17:06:18 +00:00
Masayuki Nakano 41d6e516dc Bug 1741148 - part 1: Rename nsINode::ComputeIndexOf to ComputeIndexOf_Deprecated r=smaug
It's hard to fix some callers.  Therefore, in this bug, we should fix only
simple cases.  Therefore, we should rename existing API first.

Differential Revision: https://phabricator.services.mozilla.com/D131334
2021-12-09 08:32:30 +00:00
Masayuki Nakano 3af58be69c Bug 1740853 - part 1: Make nsContentUtils::ComparePoints take uint32_t for offset in DOM nodes r=smaug
They are defined as "unsigned long" by the standards.  So we should use
`uint32_t` rather than `int32_t` with the methods.  However, layout code
uses `int32_t` a lot for representing the offset.  Therefore, this patch
adds `*_FixOffset1` etc for the cases which cannot fix easily in this patch.

Differential Revision: https://phabricator.services.mozilla.com/D131110
2021-12-09 07:51:45 +00:00
Simon Giesecke 46908cfb51 Bug 1660470 - Add missing include directives/forward declarations. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D87865
2020-11-23 16:21:38 +00:00
Mirko Brodesser fe7ba3a7aa Bug 1649121: part 73) Factor IsNodeContainedInRange out. r=masayuki
Removes code duplication, abstracts details away.

Differential Revision: https://phabricator.services.mozilla.com/D86703
2020-08-12 11:10:06 +00:00
Mirko Brodesser 1fa7ad3de4 Bug 1600267: part 7) Call ComparePoints instead of ComparePoints_Deprecated in RangeUtils. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D55301
2019-12-19 13:28:50 +00:00
Mirko Brodesser 9317c60217 Bug 1600267: part 1) Rename nsContentUtils::ComparePoints to ComparePoints_Deprecated. r=smaug
In a follow-up commit a new `ComparePoints` method with cleaner
arguments and return value will be added.

Differential Revision: https://phabricator.services.mozilla.com/D55295
2019-12-19 13:27:08 +00:00
Mirko Brodesser 40af6be192 Bug 1587433: part 7.5) Adapt callers of RangeBoundaryBase::Offset(). r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D54495
2019-12-16 11:31:46 +00:00