input/textarea.selectionStart/selectionEnd/selectionDirection should not require the presence of a frame

RESOLVED FIXED in mozilla8

Status

()

Core
DOM: Core & HTML
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: Ehsan, Assigned: Ehsan)

Tracking

({html5})

Trunk
mozilla8
html5
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Assignee)

Description

6 years ago
"All elements to which this API applies have either a selection or a text entry cursor position at all times (even for elements that are not being rendered). User agents should follow platform conventions to determine their initial state."

We currently rely on frames to get these values.  We should start caching them on the content node instead.
Bug 674484?
Seems indeed to be a dup of bug 674484.
OS: Mac OS X → All
Hardware: x86 → All
(Assignee)

Comment 3

6 years ago
No, not at all.  The selection is still retrieved from layout, and in order not to depend on the layout, we need to cache the offsets when we don't have a frame (I have a patch for that).

Bug 674484 is about moving the code around.  That would make things cleaner, but shouldn't have any behavioral effects.
(Assignee)

Comment 4

6 years ago
Created attachment 549475 [details] [diff] [review]
Patch (v1)
Assignee: nobody → ehsan
Status: NEW → ASSIGNED
Attachment #549475 - Flags: review?(bzbarsky)
Comment on attachment 549475 [details] [diff] [review]
Patch (v1)

r=me, but maybe we should look into a common superclass for input and textarea?  They're duplicating more and more logic....
Attachment #549475 - Flags: review?(bzbarsky) → review+
(Assignee)

Comment 6

6 years ago
(In reply to comment #5)
> Comment on attachment 549475 [details] [diff] [review] [diff] [details] [review]
> Patch (v1)
> 
> r=me, but maybe we should look into a common superclass for input and
> textarea?  They're duplicating more and more logic....

The thing which kind of disgusts me about nsHTMLInputElement is that it has to deal with both text and non-text input types, but yes, I think we should do that.  Filed bug 676519.
http://hg.mozilla.org/mozilla-central/rev/2112b458c8c7
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla8
You need to log in before you can comment on or make changes to this bug.