Title: [234021] trunk/Source/WebInspectorUI
- Revision
- 234021
- Author
- ross.kirsl...@sony.com
- Date
- 2018-07-19 21:29:21 -0700 (Thu, 19 Jul 2018)
Log Message
Web Inspector: Layers visualization shouldn't select on mousedown
https://bugs.webkit.org/show_bug.cgi?id=187488
Reviewed by Matt Baker.
* UserInterface/Views/Layers3DContentView.js:
(WI.Layers3DContentView):
(WI.Layers3DContentView.prototype.initialLayout):
(WI.Layers3DContentView.prototype._canvasMouseDown):
(WI.Layers3DContentView.prototype._canvasMouseUp):
Don't update selection on mousedown, update on mouseup!
Specifically, only update when mousedown & mouseup targets are the same and mousemove hasn't been triggered.
Modified Paths
Diff
Modified: trunk/Source/WebInspectorUI/ChangeLog (234020 => 234021)
--- trunk/Source/WebInspectorUI/ChangeLog 2018-07-20 03:44:58 UTC (rev 234020)
+++ trunk/Source/WebInspectorUI/ChangeLog 2018-07-20 04:29:21 UTC (rev 234021)
@@ -1,3 +1,18 @@
+2018-07-19 Ross Kirsling <ross.kirsl...@sony.com>
+
+ Web Inspector: Layers visualization shouldn't select on mousedown
+ https://bugs.webkit.org/show_bug.cgi?id=187488
+
+ Reviewed by Matt Baker.
+
+ * UserInterface/Views/Layers3DContentView.js:
+ (WI.Layers3DContentView):
+ (WI.Layers3DContentView.prototype.initialLayout):
+ (WI.Layers3DContentView.prototype._canvasMouseDown):
+ (WI.Layers3DContentView.prototype._canvasMouseUp):
+ Don't update selection on mousedown, update on mouseup!
+ Specifically, only update when mousedown & mouseup targets are the same and mousemove hasn't been triggered.
+
2018-07-19 Nikita Vasilyev <nvasil...@apple.com>
Web Inspector: Dark Mode: poor contrast for Search Tab's "the page's content has changed" message
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/Layers3DContentView.js (234020 => 234021)
--- trunk/Source/WebInspectorUI/UserInterface/Views/Layers3DContentView.js 2018-07-20 03:44:58 UTC (rev 234020)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/Layers3DContentView.js 2018-07-20 04:29:21 UTC (rev 234021)
@@ -45,6 +45,7 @@
this._layers = [];
this._layerGroupsById = new Map;
this._selectedLayerGroup = null;
+ this._candidateSelection = null;
this._nodeToSelect = null;
this._renderer = null;
@@ -53,7 +54,6 @@
this._scene = null;
this._boundingBox = null;
this._raycaster = null;
- this._mouse = null;
this._animationFrameRequestId = null;
this._documentNode = null;
@@ -164,8 +164,8 @@
this._boundingBox = new THREE.Box3;
this._raycaster = new THREE.Raycaster;
- this._mouse = new THREE.Vector2;
this._renderer.domElement.addEventListener("mousedown", this._canvasMouseDown.bind(this));
+ this._renderer.domElement.addEventListener("mouseup", this._canvasMouseUp.bind(this));
this.element.appendChild(this._renderer.domElement);
@@ -310,13 +310,29 @@
_canvasMouseDown(event)
{
- this._mouse.x = (event.offsetX / event.target.width) * 2 - 1;
- this._mouse.y = -(event.offsetY / event.target.height) * 2 + 1;
- this._raycaster.setFromCamera(this._mouse, this._camera);
+ let x = (event.offsetX / event.target.offsetWidth) * 2 - 1;
+ let y = -(event.offsetY / event.target.offsetHeight) * 2 + 1;
+ this._raycaster.setFromCamera(new THREE.Vector2(x, y), this._camera);
const recursive = true;
let intersects = this._raycaster.intersectObjects(this._scene.children, recursive);
- let selection = intersects.length ? intersects[0].object.parent : null;
+ let layerGroup = intersects.length ? intersects[0].object.parent : null;
+ this._candidateSelection = {layerGroup};
+
+ let canvasMouseMove = (event) => {
+ this._candidateSelection = null;
+ this._renderer.domElement.removeEventListener("mousemove", canvasMouseMove);
+ };
+
+ this._renderer.domElement.addEventListener("mousemove", canvasMouseMove);
+ }
+
+ _canvasMouseUp(event)
+ {
+ if (!this._candidateSelection)
+ return;
+
+ let selection = this._candidateSelection.layerGroup;
if (selection && selection === this._selectedLayerGroup) {
if (!event.metaKey)
return;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes