[Webkit-unassigned] [Bug 25444] SelectionStart, selectionEnd properties return wrong values when the selection is in a form input

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Nov 4 12:50:57 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=25444





--- Comment #9 from Ryosuke Niwa <rniwa at webkit.org>  2010-11-04 12:50:57 PST ---
(In reply to comment #8)
> Because rootEditableElement() is checked on RenderTextControl::indexForVisiblePosition,
> ReadOnly element is not editable element. So, it can't get correct selection information.
> The INPUT element on this test case has read-only property.

Yes, I understand that.  But I couldn't infer any of this stuff from the original changelog comment.

> Do I need to add SVGInputElement?

Sorry.  I misspoke.  I meant WMLInputElement.  I guess it's okay because WMLInputElement is also an input element.

> In order to check element type, it should check shadow node.
> isSelectableElement() checks shadow node.
> If you look into 'DeleteSelectionCommand::doApply',
> It checks the type like 
>         Node* ancestorNode = startNode ? startNode->shadowAncestorNode() : 0;
>         if (ancestorNode && ancestorNode->hasTagName(inputTag)

Yeah checking the shadow node is okay.  But what I'm saying is that your check won't consider the case where the position is inside another input / textarea element since you just walk the DOM and see if the parent has a shadow node (no equality!). The original code checks equality between rootEditableElement and m_innerText and this prevents us from returning value when the root editable element isn't a descendent of "this" input / textarea element.

> > We probably want more than one case.  At least, selecting all, all but the left end, all but the right end, in the middle, and collapsed caret in the middle, at the left end, and at the right end.
> 
> There is a test case for them already. Refer to 'selection-functions.html'.
> I think this issue is just related to read-only case.
> In spite of it, do I need to add those test cases?

Please do.  Those are very simple cases.  I'm sure there are a lot more edge cases out there.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list