Make `nsTextFragment::CharAt` should take `uint32_t` rather than `int32_t`
Categories
(Core :: DOM: Core & HTML, task, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox95 | --- | fixed |
People
(Reporter: masayuki, Assigned: masayuki)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
I know it's never larger than NS_MAX_TEXT_FRAGMENT_LENGTH, so it has no problem actually.
However, child offset in DOM nodes is uint32_t. So without explicit conversion, we get this waning in Fabricator.
WARNING: narrowing conversion from 'uint32_t' (aka 'unsigned int') to signed type 'int32_t' (aka 'int') is implementation-defined
So I think that it should take uint32_t for avoiding unnecessary casting.
| Assignee | ||
Comment 1•4 years ago
|
||
nsTextFragment is a storage of data node and DOM offset is uint32_t, but
some methods of nsTextFragment takes int32_t for the offset/length in
its text. Therefore, callers need to cast from uint32_t to int32_t if
the offset value is offset in a DOM node. Therefore, all methods of it should
take uint32_t values as offset/length in its text.
Depends on D127612
Updated•4 years ago
|
Comment 3•4 years ago
|
||
| bugherder | ||
Description
•