Changeset 24334 in webkit


Ignore:
Timestamp:
Jul 16, 2007, 3:31:10 PM (17 years ago)
Author:
justing
Message:

LayoutTests:

Reviewed by Adele.


<rdar://problem/5240265> REGRESSION: Clicking a <button> clears the selection in contenteditable areas

  • editing/selection/5240265-expected.checksum: Added.
  • editing/selection/5240265-expected.png: Added.
  • editing/selection/5240265-expected.txt: Added.
  • editing/selection/5240265.html: Added.

WebCore:

Reviewed by Adele.

<rdar://problem/5240265>
REGRESSION: Clicking a <button> clears the selection in contenteditable areas

  • page/FocusController.cpp: (WebCore::clearSelectionIfNeeded): Don't clear the selection if the mouse press that caused the focus shift occurred in a -webkit-user-select: ignore region.
Location:
trunk
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r24327 r24334  
     12007-07-16  Justin Garcia  <justin.garcia@apple.com>
     2
     3        Reviewed by Adele.
     4       
     5        <rdar://problem/5240265> REGRESSION: Clicking a <button> clears the selection in contenteditable areas
     6
     7        * editing/selection/5240265-expected.checksum: Added.
     8        * editing/selection/5240265-expected.png: Added.
     9        * editing/selection/5240265-expected.txt: Added.
     10        * editing/selection/5240265.html: Added.
     11
    1122007-07-16  Adele Peterson  <adele@apple.com>
    213
  • trunk/WebCore/ChangeLog

    r24332 r24334  
     12007-07-16  Justin Garcia  <justin.garcia@apple.com>
     2
     3        Reviewed by Adele.
     4
     5        <rdar://problem/5240265>
     6        REGRESSION: Clicking a <button> clears the selection in contenteditable areas
     7
     8        * page/FocusController.cpp:
     9        (WebCore::clearSelectionIfNeeded): Don't clear the selection if
     10        the mouse press that caused the focus shift occurred in
     11        a -webkit-user-select: ignore region.
     12
    1132007-07-16  Adam Roben  <aroben@apple.com>
    214
  • trunk/WebCore/page/FocusController.cpp

    r21642 r24334  
    236236    if (selectionStartNode == newFocusedNode || selectionStartNode->isDescendantOf(newFocusedNode) || selectionStartNode->shadowAncestorNode() == newFocusedNode)
    237237        return;
     238       
     239    if (Node* mousePressNode = newFocusedFrame->eventHandler()->mousePressNode())
     240        if (mousePressNode->renderer() && mousePressNode->renderer()->style()->userSelect() == SELECT_IGNORE)
     241            // Don't do this for textareas and text fields, when they lose focus their selections should be cleared
     242            // and then restored when they regain focus, to match other browsers.
     243            if (!s->rootEditableElement()->shadowAncestorNode())
     244                return;
    238245   
    239246    s->clear();
Note: See TracChangeset for help on using the changeset viewer.