Closed Bug 220262 Opened 22 years ago Closed 13 years ago

Implement scrollintoview for range objects

Categories

(Core :: DOM: Core & HTML, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: martijn.martijn, Unassigned)

References

Details

(Keywords: testcase)

Attachments

(1 file)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5b) Gecko/20030917 Firebird/0.6.1+ Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5b) Gecko/20030917 Firebird/0.6.1+ From this comment: http://bugzilla.mozilla.org/show_bug.cgi?id=123075#c5 Let's imagine that we have some (selected) text. But we have no ideas where is it located in textarea. It can be out of the visible part. MSIE has this method for scrolling to this text: tr = document.selection.createRange(); tr.scrollIntoView(false); //for end of selection aligned to end of scrolled area or tr.scrollIntoView(true); //for beginning of selection aligned to top of scrolled area I think this method is necessary for range objects, because it is otherwise very difficult with javascript to scroll to the desired range object. What also would be handy for range objects are the .offsetTop .offsetLeft offsetWidth and offsetHeight properties (for more control of scrolling) Reproducible: Always Steps to Reproduce: 1. 2. 3.
Not that this does not work correctly (well according to MS description) in IE5 (IE6 I do not know), for a selection which is in a div with overflow:scroll or a textarea. If the method's argument is true, it should scroll to the top of the window. If false, it should scroll to the bottom of the window. See MS information: http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/scrollintoview.asp http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/obj_textrange.asp I happened to see already a method called scrollSelectionIntoView in the xpcom reference: http://www.xulplanet.com/references/xpcomref/ifaces/nsISelectionController.html#method_scrollSelectionIntoView
Even if this method appears in the nsIDOMNSHTMLElement interface, it doesn't work as expected (i.e. does nothing at all). IE implements it and makes chat-like windows built on TextArea a span. The same is impossible with Mozilla.
Keywords: testcase
Severity: normal → enhancement
Status: UNCONFIRMED → NEW
Ever confirmed: true
Assignee: anthonyd → nobody
QA Contact: ian → traversal-range
Depends on: 396392
OS: Windows 2000 → All
Hardware: x86 → All
WebKit, Presto and Trident don't support it on actual Ranges, it's not in a spec, and the test case doesn't seem to do anything in IE either.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → INVALID
You have to select something in the testcase, then click on the button to be able to test. This bug can't be invalid, it's a feature request. A spec has to be written for this.
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
Ah, I take that back. IE does indeed do something with the test case. However, we don't implement the range objects this bug is about, and we're not going to implement them. If someone wants to add features to some other API, there are better forums than this one.
Status: REOPENED → RESOLVED
Closed: 13 years ago13 years ago
Resolution: --- → INVALID
Component: DOM: Traversal-Range → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: