Closed
Bug 1136065
Opened 10 years ago
Closed 10 years ago
GetRangeCount() and RangeCount() do the same thing in Selection.h
Categories
(Core :: DOM: Selection, defect)
Core
DOM: Selection
Tracking
()
RESOLVED
FIXED
mozilla39
| Tracking | Status | |
|---|---|---|
| firefox39 | --- | fixed |
People
(Reporter: TYLin, Assigned: TYLin)
Details
Attachments
(1 file, 2 obsolete files)
|
30.46 KB,
patch
|
TYLin
:
review+
|
Details | Diff | Splinter Review |
We have two identical functions GetRangeCount() [1] and RangeCount() [2] in Selection.h. Besides, we already have another GetRangeCount(int32_t* aRangeCount) [3] which implements nsISelection.idl.
To avoid confusion, I think we should keep RangeCount() and eliminate the zero argument GetRangeCount().
[1] http://hg.mozilla.org/mozilla-central/file/368c62292249/layout/generic/Selection.h#l118
[2] http://hg.mozilla.org/mozilla-central/file/368c62292249/layout/generic/Selection.h#l163
[3] http://hg.mozilla.org/mozilla-central/file/368c62292249/layout/generic/nsSelection.cpp#l4966
Comment 1•10 years ago
|
||
Also, the WebIDL bindings call RangeCount(), if I'm not mistaken.
| Assignee | ||
Comment 2•10 years ago
|
||
We replace GetRangeCount() with the identical function RangeCount() to
avoid any confusion.
Attachment #8568926 -
Flags: review?(ehsan)
| Assignee | ||
Updated•10 years ago
|
Assignee: nobody → tlin
Status: NEW → ASSIGNED
| Assignee | ||
Comment 3•10 years ago
|
||
Comment on attachment 8568926 [details] [diff] [review]
Remove GetRangeCount() in Selection.h
Review of attachment 8568926 [details] [diff] [review]:
-----------------------------------------------------------------
Oops ... uint32_t vs int32_t
https://treeherder.mozilla.org/#/jobs?repo=try&revision=605873342b21
Attachment #8568926 -
Flags: review?(ehsan)
| Assignee | ||
Comment 4•10 years ago
|
||
Fix build error.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=0d6ae2227e2e
Attachment #8568926 -
Attachment is obsolete: true
Attachment #8569204 -
Flags: review?(ehsan)
Comment 5•10 years ago
|
||
Comment on attachment 8569204 [details] [diff] [review]
Remove GetRangeCount() in Selection.h. (v2)
Review of attachment 8569204 [details] [diff] [review]:
-----------------------------------------------------------------
Nice!
Attachment #8569204 -
Flags: review?(ehsan) → review+
| Assignee | ||
Comment 6•10 years ago
|
||
Comment on attachment 8569204 [details] [diff] [review]
Remove GetRangeCount() in Selection.h. (v2)
Review of attachment 8569204 [details] [diff] [review]:
-----------------------------------------------------------------
::: accessible/generic/HyperTextAccessible.cpp
@@ +1501,5 @@
> dom::Selection* domSel = DOMSelection();
> if (!domSel)
> return false;
>
> + if (aSelectionNum < 0 || aSelectionNum >= static_cast<int>(domSel->RangeCount()))
It is better to cast the RangeCount() to int32_t which is the same type as aSelectionNum.
| Assignee | ||
Comment 7•10 years ago
|
||
Attachment #8569204 -
Attachment is obsolete: true
Attachment #8569550 -
Flags: review+
| Assignee | ||
Updated•10 years ago
|
Keywords: checkin-needed
Comment 8•10 years ago
|
||
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
status-firefox39:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
You need to log in
before you can comment on or make changes to this bug.
Description
•