[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
Wed Nov 3 20:41:08 PDT 2010


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





--- Comment #7 from Ryosuke Niwa <rniwa at webkit.org>  2010-11-03 20:41:07 PST ---
(From update of attachment 72830)
View in context: https://bugs.webkit.org/attachment.cgi?id=72830&action=review

> WebCore/ChangeLog:8
> +        Only editable elements are available at RenderTextControl::indexForVisiblePosition. 

I don't get this comment.  Could you elaborate more?

> WebCore/rendering/RenderTextControl.cpp:264
> +    if (node && node->isShadowNode() && (node->shadowParentNode()->hasTagName(inputTag) || node->shadowParentNode()->hasTagName(textareaTag)))

Why do we exclude SVGInputElement here?

> WebCore/rendering/RenderTextControl.cpp:298
> +    if (!indexPosition.node() 
> +        || (indexPosition.node()->rootEditableElement() != m_innerText && !isSelectableElement(indexPosition.node())))

Mn... we still do need to make sure the position is inside the form control though.  what we might want to do is to check node()->contains(pos.node()).

> LayoutTests/fast/forms/selection-start-end-readonly.html:14
> +        test.setSelectionRange(5,7);
> +        
> +        if (test.selectionStart == 5 && test.selectionEnd == 7) {
> +            con.innerText = "PASS"; 
> +        } else {
> +            con.innerText = "FAIL";

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.

-- 
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