`nsINode::ComputeIndexOf` should return `uint32_t`
Categories
(Core :: DOM: Core & HTML, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox97 | --- | fixed |
People
(Reporter: masayuki, Assigned: masayuki)
References
Details
Attachments
(11 files)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
Assignee | ||
Comment 1•1 year ago
|
||
(Submitted unexpectedly while writing using autocomplete of the cc field... Sorry for the bug spam)
Perhaps, Maybe<uint32_t>
or Result<uint32_t, bool>
. I think that the former is better because of consistency with the othe APIs.
Assignee | ||
Updated•1 year ago
|
Assignee | ||
Updated•1 year ago
|
Assignee | ||
Comment 2•1 year ago
|
||
We need too big patches for completely fixing this bug, but only fixing simple cases is not so hard.
Assignee | ||
Comment 3•1 year ago
|
||
It's hard to fix some callers. Therefore, in this bug, we should fix only
simple cases. Therefore, we should rename existing API first.
Depends on D131111
Assignee | ||
Comment 4•1 year ago
|
||
Offset in a node is declared as "unsigned long" by the standards and we don't
limit node can have less than INT32_MAX
. So it should return uint32_t
, but
it also needs to represent the case of "not found". For consistency with some
other APIs like nsContentUtils::ComparePoints
, using Maybe
must be a good
style rather than Result<uint32_t, bool>
.
This patch fixes the callers in assertions for example.
Depends on D131334
Assignee | ||
Comment 5•1 year ago
|
||
This patch fixes only the cases if the result of ComputeIndexOf_Deprecated()
is used as unsigned integer with implicit or explicit cast.
Depends on D131335
Assignee | ||
Comment 6•1 year ago
|
||
Some callers of nsINode::ComputeIndexOf()
do not use its parent node except
calling it. These tiny methods make such callers simpler.
Depends on D131336
Assignee | ||
Comment 7•1 year ago
|
||
Depends on D131337
Assignee | ||
Comment 8•1 year ago
|
||
Depends on D131338
Assignee | ||
Comment 9•1 year ago
|
||
Depends on D131339
Assignee | ||
Comment 10•1 year ago
|
||
Depends on D131340
Assignee | ||
Comment 11•1 year ago
|
||
Depends on D131341
Assignee | ||
Comment 12•1 year ago
|
||
Depends on D131342
Assignee | ||
Updated•1 year ago
|
Assignee | ||
Comment 13•1 year ago
|
||
Depends on D131344
Assignee | ||
Updated•1 year ago
|
Comment 14•1 year ago
|
||
Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/b644587bf3fd part 1: Rename `nsINode::ComputeIndexOf` to `ComputeIndexOf_Deprecated` r=smaug
Comment 15•1 year ago
|
||
Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/ee5f49423ff5 part 2: Re-implement `nsINode::ComputeIndexOf` as returning `Maybe<uint32_t>` rather than `int32_t` r=smaug
Comment 16•1 year ago
|
||
Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/5fce50b4cf88 part 3: Make users of `nsINode::ComputeIndexOf_Deprecated()` use `nsINode::ComputeIndexOf()` if the result is not set to `int32_t` nor return as `int32_t` r=smaug
Comment 17•1 year ago
|
||
Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/4aa928849867 part 4: Add `nsINode::ComputeIndexInParentNode()` and `nsINode::ComputeIndexInParentContent()` r=smaug
Comment 18•1 year ago
|
||
Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/1eebd7413964 part 5: Make `nsINode::CompareDocumentPosition()` and `nsContentUtils::PositionIsBefore()` treat offset in DOM node with `Maybe<uint32_t>` r=smaug
Comment 19•1 year ago
|
||
Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/8353ad6df753 part 6: Make `nsContentUtils::GetInclusiveAncestorsAndOffsets()` return array of `Maybe<uint32_t>` as offsets in DOM nodes r=smaug
Comment 20•1 year ago
|
||
Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/c39bc3629e9c part 7: Make `AdjustRangeForSelection()` in `ContentEventHandler.cpp` use `Maybe<uint32_t>` for treating offset in a DOM node r=smaug
Comment 21•1 year ago
|
||
Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/3e82a69a2edc part 8: Make `TextTrackManager` treat offset in DOM node with `Maybe<uint32_t>` r=smaug
Comment 22•1 year ago
|
||
Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/4212569de1be part 9: Make `nsLayoutUtils::DoCompareTreePosition()` stop using `nsINode::ComputeIndexOf_Deprecated()` r=smaug
Comment 23•1 year ago
|
||
bugherder |
Comment 24•1 year ago
|
||
Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/4a88e5e7aaaa part 10: Make `nsIFrame::ContentIndexInContainer()` return `Maybe<uint32_t>` for index of a DOM node r=smaug
Comment 25•1 year ago
|
||
Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/20af5ad7b7cf part 11: Make `ContentEventHandler` use `nsINode::ComputeIndexOf()` r=smaug
Assignee | ||
Updated•1 year ago
|
Comment 26•1 year ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/8353ad6df753
https://hg.mozilla.org/mozilla-central/rev/c39bc3629e9c
https://hg.mozilla.org/mozilla-central/rev/3e82a69a2edc
https://hg.mozilla.org/mozilla-central/rev/4212569de1be
https://hg.mozilla.org/mozilla-central/rev/4a88e5e7aaaa
https://hg.mozilla.org/mozilla-central/rev/20af5ad7b7cf
Description
•