Closed
Bug 312642
Opened 19 years ago
Closed 19 years ago
expose clickSelectsAll property in textbox.xml
Categories
(Toolkit :: UI Widgets, defect, P2)
Tracking
()
VERIFIED
FIXED
mozilla1.8.1
People
(Reporter: Gavin, Assigned: Gavin)
References
Details
(Keywords: verified1.8.1)
Attachments
(4 files, 3 obsolete files)
842 bytes,
application/vnd.mozilla.xul+xml
|
Details | |
9.87 KB,
patch
|
Details | Diff | Splinter Review | |
1.28 KB,
patch
|
neil
:
first-review+
|
Details | Diff | Splinter Review |
9.75 KB,
patch
|
neil
:
approval-branch-1.8.1+
|
Details | Diff | Splinter Review |
Currently, Firefox (search bar, location bar) and Help viewer implement the clickSelectsAll behavior on their own. I propose implementing the clickSelectsAll behavior in the textbox widget, controlled by a property, off by default. This way anyone who wants to check a pref can just set the property on the textbox instead of implementing their own by overriding focus, onclick, onmouseup, etc.
Assignee | ||
Updated•19 years ago
|
Status: NEW → ASSIGNED
Priority: -- → P4
Target Milestone: --- → mozilla1.9alpha1
Assignee | ||
Updated•19 years ago
|
Priority: P4 → P2
Assignee | ||
Comment 1•19 years ago
|
||
I think this works, but I haven't tested extensively.
Assignee | ||
Comment 2•19 years ago
|
||
Attachment #202864 -
Attachment is obsolete: true
Attachment #203686 -
Flags: second-review?(neil.parkwaycc.co.uk)
Attachment #203686 -
Flags: first-review?(bugs.mano)
Assignee | ||
Updated•19 years ago
|
Whiteboard: [patch-r?]
Comment 3•19 years ago
|
||
Comment on attachment 203686 [details] [diff] [review] patch >+ onset="if (val) this.setAttribute('clickSelectsAll', 'true'); >+ else this.removeAttribute('clickSelectsAll'); return !!val;" /> You should just return val here. >+ if (this.mIgnoreFocus) >+ this.mIgnoreFocus = false; The problem here is that this handler is a capturing handler so may see two focus events if the textbox is scriptably focused. Putting this block in the else of the focusedElement test might solve that, but I haven't tried it. >+ if (this.mIgnoreClick) { I think this should be if (!this.mIgnoreClick)
Assignee | ||
Comment 4•19 years ago
|
||
(In reply to comment #3) Ok, I'll return val. I figured !!val would be more useful, but I guess it doesn't need to be explicitly boolean. > >+ if (this.mIgnoreFocus) > >+ this.mIgnoreFocus = false; > The problem here is that this handler is a capturing handler so may see two > focus events if the textbox is scriptably focused. Putting this block in the > else of the focusedElement test might solve that, but I haven't tried it. Hmm, I'll look into this further. > >+ if (this.mIgnoreClick) { > I think this should be if (!this.mIgnoreClick) I could change this to this.hasAttribute("focused"), to be clearer, I guess? I make the assignment to ignoreclick right above that.
Assignee | ||
Updated•19 years ago
|
Attachment #203686 -
Attachment is obsolete: true
Attachment #203686 -
Flags: second-review?(neil.parkwaycc.co.uk)
Attachment #203686 -
Flags: first-review?(bugs.mano)
Assignee | ||
Comment 5•19 years ago
|
||
(In reply to comment #3) > >+ if (this.mIgnoreClick) { > I think this should be if (!this.mIgnoreClick) Oops, you're right.
Assignee | ||
Comment 6•19 years ago
|
||
Assignee | ||
Comment 7•19 years ago
|
||
Attachment #203732 -
Flags: first-review?(neil.parkwaycc.co.uk)
Comment 8•19 years ago
|
||
Comment on attachment 203732 [details] [diff] [review] patch v2 >+ onget="return (this.getAttribute('clickSelectsAll') == 'true');" Nit: return doesn't require brackets. > <method name="setSelectionRange"> Nit: you added the clickSelectsAll property between the selection properties and method. Maybe put it with the other mapped attribute properties? >+ } else { >+ if (this.mIgnoreFocus) >+ this.mIgnoreFocus = false; >+ else if (this.clickSelectsAll) >+ this.inputField.select(); >+ } Nit: braces unnecessary for a single statement (both then and else cases, now that I notice). >+ <handler event="mousedown" phase="capturing"> ... >+ <handler event="click" phase="capturing"> Nit: These might not actually need to be capturing (focus is special). I noticed that on certain existing textboxes e.g. the address book search that as well as the click to select behaviour it also selects when you press the return key - do you think that's something to consider adding too?
Attachment #203732 -
Flags: first-review?(neil.parkwaycc.co.uk) → first-review+
Assignee | ||
Comment 9•19 years ago
|
||
Attachment #203732 -
Attachment is obsolete: true
Assignee | ||
Updated•19 years ago
|
Whiteboard: [patch-r?]
Assignee | ||
Comment 10•19 years ago
|
||
mozilla/toolkit/content/widgets/textbox.xml new revision: 1.22; previous revision: 1.21 mozilla/xpfe/global/resources/content/bindings/textbox.xml new revision: 1.33; previous revision: 1.32
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 11•19 years ago
|
||
(In reply to comment #8) > >+ <handler event="mousedown" phase="capturing"> > ... > >+ <handler event="click" phase="capturing"> > Nit: These might not actually need to be capturing (focus is special). I didn't address this nit, but I think I should. It makes dealing with child nodes in the address bar a lot easier.
Assignee | ||
Comment 12•19 years ago
|
||
Change to match the change made to the toolkit version in bug 317369.
Attachment #210480 -
Flags: first-review?(neil)
Assignee | ||
Comment 13•19 years ago
|
||
Includes the xpfe handler phase changes from bug 312642.
Comment 14•19 years ago
|
||
Comment on attachment 210480 [details] [diff] [review] change the mousedown and click handlers to bubbling phase r+sr+b+whatever ;-)
Attachment #210480 -
Flags: first-review?(neil) → first-review+
Assignee | ||
Updated•19 years ago
|
Attachment #210491 -
Flags: branch-1.8.1?(neil)
Assignee | ||
Comment 15•19 years ago
|
||
Comment on attachment 210480 [details] [diff] [review] change the mousedown and click handlers to bubbling phase Checked in on the trunk. mozilla/xpfe/global/resources/content/bindings/textbox.xml; 1.36;
Assignee | ||
Updated•19 years ago
|
Target Milestone: mozilla1.9alpha1 → mozilla1.8.1
Version: Trunk → 1.8 Branch
Assignee | ||
Comment 16•19 years ago
|
||
(In reply to comment #13) > Created an attachment (id=210491) [edit] > branch patch xpfe/toolkit are now synced on the trunk, this mirrors that to the branch (I'll fix the addition of the fields in the toolkit version to group them with the other field when checking in).
Updated•19 years ago
|
Attachment #210491 -
Flags: branch-1.8.1?(neil) → branch-1.8.1+
Assignee | ||
Comment 17•19 years ago
|
||
Oops, I accidentally landed the toolkit part already. :( I fixed some whitespace nits and corrected the log to show the right approval, though, and landed the xpfe version. mozilla/toolkit/content/widgets/textbox.xml; 1.21.4.3; mozilla/xpfe/global/resources/content/bindings/textbox.xml; 1.32.4.2;
Keywords: fixed1.8.1
Assignee | ||
Comment 18•18 years ago
|
||
VERIFIED fixed using: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20060822 Minefield/3.0a1 Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1b2) Gecko/20060822 BonEcho/2.0b2
Status: RESOLVED → VERIFIED
Keywords: fixed1.8.1 → verified1.8.1
You need to log in
before you can comment on or make changes to this bug.
Description
•