WebKit Bugzilla
Attachment 361570 Details for
Bug 193305
: Web Inspector: Styles: easier way to select a single line
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for landing
patch.txt (text/plain), 3.70 KB, created by
Nikita Vasilyev
on 2019-02-08 17:25:36 PST
(
hide
)
Description:
Patch for landing
Filename:
MIME Type:
Creator:
Nikita Vasilyev
Created:
2019-02-08 17:25:36 PST
Size:
3.70 KB
patch
obsolete
>diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog >index aae175a9202..2eaac191902 100644 >--- a/Source/WebInspectorUI/ChangeLog >+++ b/Source/WebInspectorUI/ChangeLog >@@ -1,3 +1,19 @@ >+2019-02-08 Nikita Vasilyev <nvasilyev@apple.com> >+ >+ Web Inspector: Styles: easier way to select a single line >+ https://bugs.webkit.org/show_bug.cgi?id=193305 >+ >+ Reviewed by Devin Rousso. >+ >+ Start property selection after mousedown when mouse cursor moves 8px, >+ which is ~1.5 times the width of a text character in the style editor. >+ >+ * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js: >+ (WI.SpreadsheetCSSStyleDeclarationSection): >+ (WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleMouseDown): >+ (WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleWindowMouseMove): Added. >+ (WI.SpreadsheetCSSStyleDeclarationSection.prototype._stopSelection): >+ > 2019-02-08 Nikita Vasilyev <nvasilyev@apple.com> > > Web Inspector: Styles: close unbalanced quotes and parenthesis when editing values >diff --git a/Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js b/Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js >index 6fa142d2a27..4a5e06fcdc5 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js >+++ b/Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js >@@ -45,6 +45,8 @@ WI.SpreadsheetCSSStyleDeclarationSection = class SpreadsheetCSSStyleDeclarationS > > this._isMousePressed = false; > this._mouseDownIndex = NaN; >+ this._mouseDownPoint = null; >+ this._boundHandleWindowMouseMove = null; > } > > // Public >@@ -404,8 +406,13 @@ WI.SpreadsheetCSSStyleDeclarationSection = class SpreadsheetCSSStyleDeclarationS > let propertyIndex = parseInt(propertyElement.dataset.propertyIndex); > if (event.shiftKey && this._propertiesEditor.hasSelectedProperties()) > this._propertiesEditor.extendSelectedProperties(propertyIndex); >- else >+ else { > this._propertiesEditor.deselectProperties(); >+ this._mouseDownPoint = WI.Point.fromEvent(event); >+ if (!this._boundHandleWindowMouseMove) >+ this._boundHandleWindowMouseMove = this._handleWindowMouseMove.bind(this); >+ window.addEventListener("mousemove", this._boundHandleWindowMouseMove); >+ } > > if (propertyElement.parentNode) { > this._mouseDownIndex = propertyIndex; >@@ -423,6 +430,22 @@ WI.SpreadsheetCSSStyleDeclarationSection = class SpreadsheetCSSStyleDeclarationS > this._stopSelection(); > } > >+ _handleWindowMouseMove(event) >+ { >+ console.assert(this._mouseDownPoint); >+ >+ if (this._mouseDownPoint.distance(WI.Point.fromEvent(event)) < 8) >+ return; >+ >+ if (!this._propertiesEditor.hasSelectedProperties()) { >+ console.assert(!isNaN(this._mouseDownIndex)); >+ this._propertiesEditor.selectProperties(this._mouseDownIndex, this._mouseDownIndex); >+ } >+ >+ window.removeEventListener("mousemove", this._boundHandleWindowMouseMove); >+ this._mouseDownPoint = null; >+ } >+ > _handleClick(event) > { > this._stopSelection(); >@@ -457,6 +480,9 @@ WI.SpreadsheetCSSStyleDeclarationSection = class SpreadsheetCSSStyleDeclarationS > this._isMousePressed = false; > this._mouseDownIndex = NaN; > this._element.classList.remove("selecting"); >+ >+ window.removeEventListener("mousemove", this._boundHandleWindowMouseMove, false); >+ this._mouseDownPoint = null; > } > > _highlightNodesWithSelector()
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
nvasilyev
:
commit-queue+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193305
:
358823
|
361542
|
361544
|
361570
|
361571