Closed
Bug 828138
Opened 13 years ago
Closed 13 years ago
clean up some selection related stuff
Categories
(Core :: DOM: Selection, defect)
Core
DOM: Selection
Tracking
()
RESOLVED
FIXED
mozilla21
People
(Reporter: tbsaunde, Assigned: tbsaunde)
References
Details
Attachments
(4 files)
2.99 KB,
patch
|
ehsan.akhgari
:
review+
|
Details | Diff | Splinter Review |
4.92 KB,
patch
|
ehsan.akhgari
:
review+
|
Details | Diff | Splinter Review |
7.35 KB,
patch
|
ehsan.akhgari
:
review+
|
Details | Diff | Splinter Review |
11.93 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Assignee | ||
Comment 1•13 years ago
|
||
Attachment #699552 -
Flags: review?(ehsan)
Assignee | ||
Comment 2•13 years ago
|
||
Attachment #699553 -
Flags: review?(ehsan)
Assignee | ||
Comment 3•13 years ago
|
||
Attachment #699554 -
Flags: review?(ehsan)
Assignee | ||
Comment 4•13 years ago
|
||
Attachment #699555 -
Flags: review?(bugs)
Comment 6•13 years ago
|
||
Comment on attachment 699552 [details] [diff] [review]
remove nsISelectionPrivate::SetPresShell()
Review of attachment 699552 [details] [diff] [review]:
-----------------------------------------------------------------
Nobody was using this? Huh!
Attachment #699552 -
Flags: review?(ehsan) → review+
Updated•13 years ago
|
Attachment #699553 -
Flags: review?(ehsan) → review+
Comment 7•13 years ago
|
||
Comment on attachment 699554 [details] [diff] [review]
outparamdel Selection::GetPresContext()
Review of attachment 699554 [details] [diff] [review]:
-----------------------------------------------------------------
r=me with the nit below.
::: layout/generic/nsSelection.cpp
@@ +5065,1 @@
> nsIPresShell *shell = mFrameSelection->GetShell();
You could simplify this even further by doing this instead of all of the above:
nsIPresShell *shell = GetPresShell();
Attachment #699554 -
Flags: review?(ehsan) → review+
Comment 8•13 years ago
|
||
Comment on attachment 699555 [details] [diff] [review]
nsIPresShell::GetCurrentSelection() should return Selection*
>
>- virtual nsISelection* GetCurrentSelection(SelectionType aType) = 0;
>+ virtual mozilla::Selection* GetCurrentSelection(SelectionType aType) = 0;
You're changing an interface, so update IID.
I hope no binary addons are using this stuff.
>+ int32_t rangeCount = origSelection->GetRangeCount();
> for (int32_t i = 0; i < rangeCount; ++i) {
>- nsCOMPtr<nsIDOMRange> range;
>- origSelection->GetRangeAt(i, getter_AddRefs(range));
>- if (range) {
>- CloneRangeToSelection(range, aDoc, selection);
>- }
>+ CloneRangeToSelection(origSelection->GetRangeAt(i), aDoc, selection);
So GetRangeAt(i) can't return null? I guess not
Attachment #699555 -
Flags: review?(bugs) → review+
Assignee | ||
Comment 9•13 years ago
|
||
(In reply to Olli Pettay [:smaug] from comment #8)
> Comment on attachment 699555 [details] [diff] [review]
> nsIPresShell::GetCurrentSelection() should return Selection*
>
> >
> >- virtual nsISelection* GetCurrentSelection(SelectionType aType) = 0;
> >+ virtual mozilla::Selection* GetCurrentSelection(SelectionType aType) = 0;
>
> You're changing an interface, so update IID.
> I hope no binary addons are using this stuff.
sure, though I think this might actually be binary compatable.
> >+ int32_t rangeCount = origSelection->GetRangeCount();
> > for (int32_t i = 0; i < rangeCount; ++i) {
> >- nsCOMPtr<nsIDOMRange> range;
> >- origSelection->GetRangeAt(i, getter_AddRefs(range));
> >- if (range) {
> >- CloneRangeToSelection(range, aDoc, selection);
> >- }
> >+ CloneRangeToSelection(origSelection->GetRangeAt(i), aDoc, selection);
> So GetRangeAt(i) can't return null? I guess not
not unless we put null ranges into a selection. Of course it will return null if the index is < 0 or >= # of ranges, but we know that isn't the case here.
Comment 10•13 years ago
|
||
Please check whether it is possible to have null in range array.
Assignee | ||
Comment 11•13 years ago
|
||
(In reply to Olli Pettay [:smaug] from comment #10)
> Please check whether it is possible to have null in range array.
it seems like everyone null checks before adding to the array.
Assignee | ||
Comment 12•13 years ago
|
||
Comment 13•13 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/e5bf5d1a528d
https://hg.mozilla.org/mozilla-central/rev/c112306e4b45
https://hg.mozilla.org/mozilla-central/rev/c8edf6ffbf8a
https://hg.mozilla.org/mozilla-central/rev/fbd618dbf069
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
Depends on: 882815
No longer depends on: 882815
You need to log in
before you can comment on or make changes to this bug.
Description
•