Changeset 60580 in webkit


Ignore:
Timestamp:
Jun 2, 2010 2:38:51 PM (14 years ago)
Author:
arv@chromium.org
Message:

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

Reviewed by ojan@chromium.org.

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

  • 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-02 Erik Arvidsson <arv@chromium.org>

Reviewed by ojan@chromium.org.

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):
Location:
trunk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r60578 r60580  
     12010-06-02  Erik Arvidsson  <arv@chromium.org>
     2
     3        Reviewed by ojan@chromium.org.
     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/selection/click-in-focusable-link-should-not-clear-selection-expected.txt: Added.
     9        * editing/selection/click-in-focusable-link-should-not-clear-selection.html: Added.
     10        * editing/selection/script-tests/click-in-focusable-link-should-not-clear-selection.js: Added.
     11        (description.getElementCenter):
     12        (doubleClickOnElement):
     13        (mouseDownOnElement):
     14        (selectionShouldBe):
     15
    1162010-06-02  Pavel Feldman  <pfeldman@chromium.org>
    217
  • trunk/WebCore/ChangeLog

    r60574 r60580  
     12010-06-02  Erik Arvidsson  <arv@chromium.org>
     2
     3        Reviewed by ojan@chromium.org.
     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):
     12
    1132010-06-02  David Hyatt  <hyatt@apple.com>
    214
  • trunk/WebCore/page/FocusController.cpp

    r58882 r60580  
    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.