Closed
Bug 674558
Opened 14 years ago
Closed 14 years ago
Implement the HTML5 selectionDirection property for text controls (input and textarea)
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla8
People
(Reporter: ehsan.akhgari, Assigned: ehsan.akhgari)
References
()
Details
(Keywords: dev-doc-complete, html5)
Attachments
(1 file, 2 obsolete files)
34.63 KB,
patch
|
Details | Diff | Splinter Review |
This is a new property for text controls which specifies the direction of the selection for text inputs and textareas.
Assignee | ||
Updated•14 years ago
|
Assignee: nobody → ehsan
See Also: → https://bugs.webkit.org/show_bug.cgi?id=60403
Assignee | ||
Updated•14 years ago
|
Keywords: dev-doc-needed
Assignee | ||
Comment 1•14 years ago
|
||
Attachment #549027 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 2•14 years ago
|
||
Fixed a bug, and also added a couple of more tests.
Attachment #549027 -
Attachment is obsolete: true
Attachment #549027 -
Flags: review?(bzbarsky)
Attachment #549127 -
Flags: review?(bzbarsky)
Comment 3•14 years ago
|
||
Comment on attachment 549127 [details] [diff] [review]
Patch (v2)
>--- a/content/html/content/src/nsHTMLInputElement.cpp
>+++ b/content/html/content/src/nsHTMLInputElement.cpp
>+ if (aDirection == NS_LITERAL_STRING("backward")) {
>--- a/content/html/content/src/nsHTMLTextAreaElement.cpp
>+++ b/content/html/content/src/nsHTMLTextAreaElement.cpp
>+ if (aDirection == NS_LITERAL_STRING("backward")) {
That's I signature you don't see often. How about EqualsListeral?
>--- a/toolkit/components/satchel/nsFormFillController.cpp
>+++ b/toolkit/components/satchel/nsFormFillController.cpp
>- mFocusedInput->SetSelectionRange(aStartIndex, aEndIndex);
>+ mFocusedInput->SetSelectionRange(aStartIndex, aEndIndex, NS_LITERAL_STRING(""));
EmptyString()?
Comment 4•14 years ago
|
||
Comment on attachment 549127 [details] [diff] [review]
Patch (v2)
>+++ b/content/base/public/nsISelectionPrivate.idl
>+ * (The return value is an nsDirection, and should be casted back to one
s/casted/cast/
That said, I think something like this would work cleaner:
native nsDirection(nsDirection);
up front in the IDL and then
[noscript, notxpcom] nsDirection getSelectionDirection();
[noscript, notxpcom] void setSelectionDirection(nsDirection aDirection);
for the actual declaration. That will give your C++ the function signature:
nsDirection GetSelectionDirection();
I believe.
r=me with that.
Attachment #549127 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 5•14 years ago
|
||
I filed http://www.w3.org/Bugs/Public/show_bug.cgi?id=13411 to fix the wording of the selectionEnd setting part in the spec.
Assignee | ||
Updated•14 years ago
|
Assignee | ||
Comment 6•14 years ago
|
||
Review comments addressed.
Attachment #549127 -
Attachment is obsolete: true
Comment 7•14 years ago
|
||
Comment on attachment 549144 [details] [diff] [review]
Patch (v3)
Review of attachment 549144 [details] [diff] [review]:
-----------------------------------------------------------------
::: js/src/xpconnect/src/dom_quickstubs.qsconf
@@ +257,5 @@
> 'nsIDOMHTMLInputElement.files',
> 'nsIDOMHTMLInputElement.textLength',
> 'nsIDOMHTMLInputElement.selectionStart',
> 'nsIDOMHTMLInputElement.selectionEnd',
> + 'nsIDOMHTMLInputElement.selectionDirection',
Can't we have nsIDOMHTMLInputElement.*
@@ +317,5 @@
> 'nsIDOMHTMLTextAreaElement.select',
> 'nsIDOMHTMLTextAreaElement.setSelectionRange',
> 'nsIDOMHTMLTextAreaElement.selectionStart',
> 'nsIDOMHTMLTextAreaElement.selectionEnd',
> + 'nsIDOMHTMLTextAreaElement.selectionDirection',
Same for nsIDOMHTMLTextAreaElement.
Updated•14 years ago
|
OS: Mac OS X → All
Hardware: x86 → All
Comment 8•14 years ago
|
||
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla8
Comment 9•13 years ago
|
||
Documentation updated:
https://developer.mozilla.org/en/HTML/Element/input
https://developer.mozilla.org/en/DOM/HTMLTextAreaElement
https://developer.mozilla.org/en/DOM/HTMLInputElement
https://developer.mozilla.org/en/DOM/Input.setSelectionRange
https://developer.mozilla.org/en/HTML/Element/textarea
And listed on Firefox 8 for developers.
Keywords: dev-doc-needed → dev-doc-complete
Assignee | ||
Comment 10•13 years ago
|
||
(In reply to Mounir Lamouri (:volkmar) from comment #7)
> Comment on attachment 549144 [details] [diff] [review]
> Patch (v3)
>
> Review of attachment 549144 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: js/src/xpconnect/src/dom_quickstubs.qsconf
> @@ +257,5 @@
> > 'nsIDOMHTMLInputElement.files',
> > 'nsIDOMHTMLInputElement.textLength',
> > 'nsIDOMHTMLInputElement.selectionStart',
> > 'nsIDOMHTMLInputElement.selectionEnd',
> > + 'nsIDOMHTMLInputElement.selectionDirection',
>
> Can't we have nsIDOMHTMLInputElement.*
>
> @@ +317,5 @@
> > 'nsIDOMHTMLTextAreaElement.select',
> > 'nsIDOMHTMLTextAreaElement.setSelectionRange',
> > 'nsIDOMHTMLTextAreaElement.selectionStart',
> > 'nsIDOMHTMLTextAreaElement.selectionEnd',
> > + 'nsIDOMHTMLTextAreaElement.selectionDirection',
>
> Same for nsIDOMHTMLTextAreaElement.
I don't see why we can't. Would you mind filing a bug for that?
You need to log in
before you can comment on or make changes to this bug.
Description
•