Closed Bug 852088 Opened 8 years ago Closed 8 years ago

Add drag caret to select text support

Categories

(Firefox for Metro Graveyard :: Input, defect)

x86_64
Windows 8.1
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 22

People

(Reporter: jimm, Assigned: jimm)

References

Details

(Whiteboard: [selection])

Attachments

(1 file, 2 obsolete files)

todo:

add support for dragging to select text input.

See http://msdn.microsoft.com/en-us/library/windows/apps/hh465334.aspx
Attached patch drag selection (wip) (obsolete) — Splinter Review
Assignee: nobody → jmathies
Attached patch caret drag selection v.1 (obsolete) — Splinter Review
This depends on the patch in bug 852087.
Attachment #726718 - Attachment is obsolete: true
Attachment #726820 - Flags: review?(fyan)
Blocks: 852619
No longer blocks: caret-sel
Depends on: 852087
Depends on: 852967
Blocks: 852967
No longer depends on: 852967
fyan - ping
Updated per changes to the css in the parent bug.
Attachment #726820 - Attachment is obsolete: true
Attachment #726820 - Flags: review?(fyan)
Attachment #727629 - Flags: review?(fyan)
Comment on attachment 727629 [details] [diff] [review]
caret drag selection v.2

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

Also read through bug 852087's patch to try to understand the context a bit more.

::: browser/metro/base/content/helperui/SelectionHelperUI.js
@@ +234,4 @@
>  
>    get startMark() {
>      if (this._startMark == null) {
> +      this._startMark = new Marker(this, "start", this._selectionMarkIds.pop(), 0, 0);

Using an array for these, instead of hard-coding them, doesn't seem to add any flexibility, because we still have to guarantee that the number of items in the array is greater than or equal to the number of mark getters that will call pop() on it. Are you anticipating more selection marks or mark getters in future pieces of the implementation?
Attachment #727629 - Flags: review?(fyan) → review+
(In reply to Frank Yan (:fryn) from comment #5)
> Comment on attachment 727629 [details] [diff] [review]
> caret drag selection v.2
> 
> Review of attachment 727629 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> Also read through bug 852087's patch to try to understand the context a bit
> more.
> 
> ::: browser/metro/base/content/helperui/SelectionHelperUI.js
> @@ +234,4 @@
> >  
> >    get startMark() {
> >      if (this._startMark == null) {
> > +      this._startMark = new Marker(this, "start", this._selectionMarkIds.pop(), 0, 0);
> 
> Using an array for these, instead of hard-coding them, doesn't seem to add
> any flexibility, because we still have to guarantee that the number of items
> in the array is greater than or equal to the number of mark getters that
> will call pop() on it. Are you anticipating more selection marks or mark
> getters in future pieces of the implementation?

The array makes it easy to swap the caret image out for either start or end marker (depending on the drag direction) without having to worry about matching the opposite marker to an id.

so for example:

caret=mark3
drag left, swap
left=mark3
right=mark2

caret=mark3
drag right, swap
left=mark1
right=mark3

tap-hold select:
left=mark1
right=mark2

I just swap and push whatever spare id I have and let the getters take care of the rest.
https://hg.mozilla.org/mozilla-central/rev/3025def19eb9
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 22
OS: Windows 8 Metro → Windows 8.1
You need to log in before you can comment on or make changes to this bug.