Changeset 60873 in webkit


Ignore:
Timestamp:
Jun 8, 2010 5:29:13 PM (14 years ago)
Author:
eric@webkit.org
Message:

2010-06-08 Erik Arvidsson <arv@chromium.org>

Reviewed by Ojan Vafai.

REGRESSION: Weird focus behavior affects quoting on University of Washington message board system
https://bugs.webkit.org/show_bug.cgi?id=38548

  • editing/pasteboard/drop-link-expected.txt: Mouse down on an element where canStartSelection returns

false no longer clears the selection so we get one less
notification from the editing delegate.

  • editing/selection/click-in-focusable-link-should-not-clear-selection-expected.txt: Added.
  • editing/selection/click-in-focusable-link-should-not-clear-selection.html: Added.
  • editing/selection/script-tests/click-in-focusable-link-should-not-clear-selection.js: Added. (description.getElementCenter): (doubleClickOnElement): (mouseDownOnElement): (selectionShouldBe):

2010-06-08 Erik Arvidsson <arv@chromium.org>

Reviewed by Ojan Vafai.

REGRESSION: Weird focus behavior affects quoting on University of Washington message board system
https://bugs.webkit.org/show_bug.cgi?id=38548

Test: editing/selection/click-in-focusable-link-should-not-clear-selection.html

  • page/FocusController.cpp: (WebCore::clearSelectionIfNeeded): Make sure we do not clear selection when canStartSelection

returns false.

Location:
trunk
Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r60870 r60873  
     12010-06-08  Erik Arvidsson  <arv@chromium.org>
     2
     3        Reviewed by Ojan Vafai.
     4
     5        REGRESSION: Weird focus behavior affects quoting on University of Washington message board system
     6        https://bugs.webkit.org/show_bug.cgi?id=38548
     7
     8        * editing/pasteboard/drop-link-expected.txt: Mouse down on an element where canStartSelection returns
     9                                                     false no longer clears the selection so we get one less
     10                                                     notification from the editing delegate.
     11        * editing/selection/click-in-focusable-link-should-not-clear-selection-expected.txt: Added.
     12        * editing/selection/click-in-focusable-link-should-not-clear-selection.html: Added.
     13        * editing/selection/script-tests/click-in-focusable-link-should-not-clear-selection.js: Added.
     14        (description.getElementCenter):
     15        (doubleClickOnElement):
     16        (mouseDownOnElement):
     17        (selectionShouldBe):
     18
    1192010-06-08  Stephen White  <senorblanco@chromium.org>
    220
  • trunk/LayoutTests/editing/pasteboard/drop-link-expected.txt

    r60867 r60873  
    99EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    1010EDITING DELEGATE: shouldEndEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 2 of DIV > BODY > HTML > #document
    11 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    1211EDITING DELEGATE: webViewDidEndEditing:WebViewDidEndEditingNotification
    1312EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 7 of #text > DIV > BODY > HTML > #document to 7 of #text > DIV > BODY > HTML > #document givenAction:WebViewInsertActionDropped
  • trunk/WebCore/ChangeLog

    r60869 r60873  
     12010-06-08  Erik Arvidsson  <arv@chromium.org>
     2
     3        Reviewed by Ojan Vafai.
     4
     5        REGRESSION: Weird focus behavior affects quoting on University of Washington message board system
     6        https://bugs.webkit.org/show_bug.cgi?id=38548
     7
     8        Test: editing/selection/click-in-focusable-link-should-not-clear-selection.html
     9
     10        * page/FocusController.cpp:
     11        (WebCore::clearSelectionIfNeeded): Make sure we do not clear selection when canStartSelection
     12                                           returns false.
     13
    1142010-06-08  Enrico Ros  <eros@codeaurora.org>
    215
  • trunk/WebCore/page/FocusController.cpp

    r60867 r60873  
    512512        return;
    513513       
    514     if (Node* mousePressNode = newFocusedFrame->eventHandler()->mousePressNode())
    515         if (mousePressNode->renderer() && !mousePressNode->canStartSelection())
    516             if (Node* root = s->rootEditableElement())
    517                 if (Node* shadowAncestorNode = root->shadowAncestorNode())
    518                     // Don't do this for textareas and text fields, when they lose focus their selections should be cleared
    519                     // and then restored when they regain focus, to match other browsers.
    520                     if (!shadowAncestorNode->hasTagName(inputTag) && !shadowAncestorNode->hasTagName(textareaTag))
    521                         return;
     514    if (Node* mousePressNode = newFocusedFrame->eventHandler()->mousePressNode()) {
     515        if (mousePressNode->renderer() && !mousePressNode->canStartSelection()) {
     516            // Don't clear the selection for contentEditable elements, but do clear it for input and textarea. See bug 38696.
     517            Node * root = s->rootEditableElement();
     518            if (!root)
     519                return;
     520
     521            if (Node* shadowAncestorNode = root->shadowAncestorNode()) {
     522                if (!shadowAncestorNode->hasTagName(inputTag) && !shadowAncestorNode->hasTagName(textareaTag))
     523                    return;
     524            }
     525        }
     526    }
    522527   
    523528    s->clear();
Note: See TracChangeset for help on using the changeset viewer.