nsFrameSelection::GetSelection() should return nsTypedSelection

RESOLVED FIXED in mozilla15

Status

()

Core
DOM
RESOLVED FIXED
6 years ago
5 years ago

People

(Reporter: surkov, Assigned: tbsaunde)

Tracking

(Blocks: 1 bug)

unspecified
mozilla15
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

6 years ago
spun off bug 688126 comment #5:
> 2) Can nsTypedSelection be exposed rather than nsISelection (for example,
> change existing nsFrameSelection::GetSelection or add new method)?
> nsTypedSelection allows to deal with nsIRange directly.
(Assignee)

Comment 1

5 years ago
Created attachment 619487 [details] [diff] [review]
patch

smaug this is about the simplest patch I can write for this I just cut / pasted nsTypedSelection from nsSelection.cpp into a new header of its own and hit things with a hammer a little to make it build.  If you'd like some or a lot of stuff to be cleaned up while working on this I might be able to try although I may not have time for a week or two.
Attachment #619487 - Flags: review?(bugs)
Comment on attachment 619487 [details] [diff] [review]
patch

Review of attachment 619487 [details] [diff] [review]:
-----------------------------------------------------------------

::: layout/generic/nsTypedSelection.h
@@ +3,5 @@
> +/* This Source Code Form is subject to the terms of the Mozilla Public
> + * License, v. 2.0. If a copy of the MPL was not distributed with this file,
> + * You can obtain one at http://mozilla.org/MPL/2.0/. */
> +
> +#ifndef NSTYPEDSELECTION_H_

nsTypedSelection_h
(Assignee)

Comment 3

5 years ago
(In reply to Ms2ger from comment #2)
> Comment on attachment 619487 [details] [diff] [review]
> patch
> 
> Review of attachment 619487 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: layout/generic/nsTypedSelection.h
> @@ +3,5 @@
> > +/* This Source Code Form is subject to the terms of the Mozilla Public
> > + * License, v. 2.0. If a copy of the MPL was not distributed with this file,
> > + * You can obtain one at http://mozilla.org/MPL/2.0/. */
> > +
> > +#ifndef NSTYPEDSELECTION_H_
> 
> nsTypedSelection_h

assuming that's the pattern in layout land fixed locally.

Updated

5 years ago
Attachment #619487 - Flags: review?(bugs) → review+
Should nsTypedSelection.h include nsRange.h?  When I try to include it elsewhere, I get a compile error until I include nsRange.h too.
(Reporter)

Comment 5

5 years ago
btw, Trevor, are going to land it?
Blocks: 590640
(Assignee)

Comment 6

5 years ago
so, I was about to finally land this, but you'll see in this try run https://tbpl.mozilla.org/?tree=Try&rev=70a2a9aa8088  I somehow managed to break a ref test on osx 10.5 only, any ideas?  I'll probably push this to try again and hope its the fault of something else that got backed out or fixed if nobody has a good idea.
Are you sure that's related to this bug?  I've done a bunch of try runs with your patch, and that test passed on them, e.g.:

https://tbpl.mozilla.org/?tree=Try&rev=5b058bd6f2ef
(Assignee)

Comment 8

5 years ago
ok then, I pushed it as https://hg.mozilla.org/integration/mozilla-inbound/rev/b7b7c790cc5e
https://hg.mozilla.org/mozilla-central/rev/b7b7c790cc5e
Assignee: nobody → trev.saunders
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Target Milestone: --- → mozilla15
Blocks: 762841
You need to log in before you can comment on or make changes to this bug.