Last Comment Bug 693933 - nsFrameSelection::GetSelection() should return nsTypedSelection
: nsFrameSelection::GetSelection() should return nsTypedSelection
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla15
Assigned To: Trevor Saunders (:tbsaunde)
:
Mentors:
Depends on:
Blocks: 762841 590640
  Show dependency treegraph
 
Reported: 2011-10-12 00:55 PDT by alexander :surkov
Modified: 2012-06-08 05:13 PDT (History)
5 users (show)
ryanvm: in‑testsuite-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch (24.95 KB, patch)
2012-04-29 22:03 PDT, Trevor Saunders (:tbsaunde)
bugs: review+
Details | Diff | Splinter Review

Description alexander :surkov 2011-10-12 00:55:41 PDT
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.
Comment 1 Trevor Saunders (:tbsaunde) 2012-04-29 22:03:57 PDT
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.
Comment 2 :Ms2ger (⌚ UTC+1/+2) 2012-04-30 01:50:17 PDT
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
Comment 3 Trevor Saunders (:tbsaunde) 2012-05-01 00:06:54 PDT
(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.
Comment 4 :Aryeh Gregor (working until September 2) 2012-05-10 06:16:37 PDT
Should nsTypedSelection.h include nsRange.h?  When I try to include it elsewhere, I get a compile error until I include nsRange.h too.
Comment 5 alexander :surkov 2012-05-10 06:36:36 PDT
btw, Trevor, are going to land it?
Comment 6 Trevor Saunders (:tbsaunde) 2012-05-15 11:16:56 PDT
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.
Comment 7 :Aryeh Gregor (working until September 2) 2012-05-15 22:27:43 PDT
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
Comment 8 Trevor Saunders (:tbsaunde) 2012-05-15 23:32:22 PDT
ok then, I pushed it as https://hg.mozilla.org/integration/mozilla-inbound/rev/b7b7c790cc5e
Comment 9 Ryan VanderMeulen [:RyanVM] 2012-05-16 19:29:42 PDT
https://hg.mozilla.org/mozilla-central/rev/b7b7c790cc5e

Note You need to log in before you can comment on or make changes to this bug.