⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 242078 in webkit


Ignore:
Timestamp:
Feb 26, 2019, 12:00:26 AM (8 years ago)
Author:
Devin Rousso
Message:

Web Inspector: Console: dragging a selection outside the selected element clears the selection
​https://bugs.webkit.org/show_bug.cgi?id=194660
<rdar://problem/46719239>

Reviewed by Joseph Pecoraro.

  • UserInterface/Views/LogContentView.js:

(WI.LogContentView.prototype._mousemove):
Don't clear the selection if the target of the "mousemove" is outside of the view.

(WI.LogContentView.prototype._updateMessagesSelection):
Drive-by: clear the saved selected messages when we're just selecting a single message.

Location:
trunk/Source/WebInspectorUI
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r242077 r242078  
     12019-02-26  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: Console: dragging a selection outside the selected element clears the selection
     4        https://bugs.webkit.org/show_bug.cgi?id=194660
     5        <rdar://problem/46719239>
     6
     7        Reviewed by Joseph Pecoraro.
     8
     9        * UserInterface/Views/LogContentView.js:
     10        (WI.LogContentView.prototype._mousemove):
     11        Don't clear the selection if the target of the "mousemove" is outside of the view.
     12
     13        (WI.LogContentView.prototype._updateMessagesSelection):
     14        Drive-by: clear the saved selected messages when we're just selecting a single message.
     15
    1162019-02-25  Joseph Pecoraro  <pecoraro@apple.com>
    217
  • trunk/Source/WebInspectorUI/UserInterface/Views/LogContentView.js

    r242018 r242078  
    533533        if (!wrapper) {
    534534            // No wrapper under the mouse, so look at the selection to try and find one.
    535             if (!selection.isCollapsed) {
    536                 wrapper = selection.focusNode.parentNode.enclosingNodeOrSelfWithClass(WI.LogContentView.ItemWrapperStyleClassName);
     535            if (!selection.isCollapsed)
     536                wrapper = selection.focusNode.enclosingNodeOrSelfWithClass(WI.LogContentView.ItemWrapperStyleClassName);
     537
     538            if (!wrapper) {
    537539                selection.removeAllRanges();
     540                return;
    538541            }
    539 
    540             if (!wrapper)
    541                 return;
    542542        }
    543543
    … …  
    546546
    547547        if (wrapper === this._mouseDownWrapper && !this._mouseMoveIsRowSelection)
     548            return;
     549
     550        // Don't change the selection if the mouse has moved outside of the view (e.g. for faster scrolling).
     551        if (!this.element.contains(event.target))
    548552            return;
    549553
    … …  
    658662            message.classList.add(WI.LogContentView.SelectedStyleClassName);
    659663            this._selectedMessages.push(message);
     664            this._selectionRange = null;
    660665        }
    661666
Note: See TracChangeset for help on using the changeset viewer.