[Webkit-unassigned] [Bug 118287] SelectAll on a page does not work if first/last element within the body is contenteditable

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jul 11 21:02:42 PDT 2013


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


Ryosuke Niwa <rniwa at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #206388|review?                     |review-
               Flag|                            |




--- Comment #20 from Ryosuke Niwa <rniwa at webkit.org>  2013-07-11 21:04:43 PST ---
(From update of attachment 206388)
View in context: https://bugs.webkit.org/attachment.cgi?id=206388&action=review

> Source/WebCore/ChangeLog:20
> +        Also, executing selectAll without focusing anywhere on the page
> +        should not set focus on a contenteditable element if it happens to be
> +        the first/last element within the body.

This should be fixed as a separate bug. r- because due to this unrelated change.

> Source/WebCore/editing/VisiblePosition.cpp:557
> +    // If the html element is non-editable and next/previous candidates have editable roots,
> +    // then consider them to be in same editable element
> +    if (!editingRoot && node && node->hasTagName(htmlTag)) {
> +        prevIsInSameEditableElement = prevNode && !prevNode->isRootEditableElement();
> +        nextIsInSameEditableElement = nextNode && !nextNode->isRootEditableElement();
> +    } else {

Why? This is what comment, which is obvious from the code.
We need to explain why we do this. In fact, this doesn't look right.

> Source/WebCore/editing/VisibleSelection.cpp:567
> +    // If selection start & end positions are first & last elements of the body respectively,
> +    // it means the entire page is selected. No adjustments required.

Doesn't. You can make head element visible. You can also insert a random element before/after body and make it editable.
r- because of this wrong assumption as well.

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