[Webkit-unassigned] [Bug 38548] REGRESSION: Weird focus behavior affects quoting on University of Washington message board system

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri May 7 10:39:07 PDT 2010


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





--- Comment #21 from Beth Dakin <bdakin at apple.com>  2010-05-07 10:39:05 PST ---
(From update of attachment 55333)
> -    if (Node* mousePressNode = newFocusedFrame->eventHandler()->mousePressNode())
> -        if (mousePressNode->renderer() && !mousePressNode->canStartSelection())
> -            if (Node* root = s->rootEditableElement())
> -                if (Node* shadowAncestorNode = root->shadowAncestorNode())
> +    if (Node* mousePressNode = newFocusedFrame->eventHandler()->mousePressNode()) {
> +        if (mousePressNode->renderer() && !mousePressNode->canStartSelection()) {
> +            // In case selection was in an input or textarea we need to clear the selection. See bug 38696.
> +            if (Node* root = s->rootEditableElement()) {
> +                if (Node* shadowAncestorNode = root->shadowAncestorNode()) {
>                      // Don't do this for textareas and text fields, when they lose focus their selections should be cleared
>                      // and then restored when they regain focus, to match other browsers.
>                      if (!shadowAncestorNode->hasTagName(inputTag) && !shadowAncestorNode->hasTagName(textareaTag))
>                          return;
> +                }
> +            } else {
> +              return;
> +            }
> +        }
> +    }
>      
>      s->clear();
>  }

I have a few questions about this patch. First, the comment that you added is
"In case selection was in an input or textarea we need to clear the selection.
See bug 38696." But isn't the opposite true? Isn't it that we do NOT want to
clear the selection in the case of an input or textarea? 

Also, are you certain that adding an else to the (Node* root =
s->rootEditableElement()) case is correct? Can you be certain that this will
only apply to inputs and textareas like your comment implies?

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