Title: [226392] trunk/Source/WebInspectorUI
- Revision
- 226392
- Author
- [email protected]
- Date
- 2018-01-03 21:57:23 -0800 (Wed, 03 Jan 2018)
Log Message
Web Inspector: RTL - DOM Tree Element selection doesn't work
https://bugs.webkit.org/show_bug.cgi?id=181275
<rdar://problem/36290450>
Patch by Joseph Pecoraro <[email protected]> on 2018-01-03
Reviewed by Devin Rousso.
* UserInterface/Views/TreeOutline.js:
(WI.TreeOutline.prototype.treeElementFromEvent):
Provide a better explanation for why we are making the `x` adjustment here,
to detect the inner most tree element along the horizontal. Fix the algorithm
for RTL, since the intent is to adjust to the trailing edge of the container
which is on the opposite side in RTL.
Modified Paths
Diff
Modified: trunk/Source/WebInspectorUI/ChangeLog (226391 => 226392)
--- trunk/Source/WebInspectorUI/ChangeLog 2018-01-04 05:23:54 UTC (rev 226391)
+++ trunk/Source/WebInspectorUI/ChangeLog 2018-01-04 05:57:23 UTC (rev 226392)
@@ -1,5 +1,20 @@
2018-01-03 Joseph Pecoraro <[email protected]>
+ Web Inspector: RTL - DOM Tree Element selection doesn't work
+ https://bugs.webkit.org/show_bug.cgi?id=181275
+ <rdar://problem/36290450>
+
+ Reviewed by Devin Rousso.
+
+ * UserInterface/Views/TreeOutline.js:
+ (WI.TreeOutline.prototype.treeElementFromEvent):
+ Provide a better explanation for why we are making the `x` adjustment here,
+ to detect the inner most tree element along the horizontal. Fix the algorithm
+ for RTL, since the intent is to adjust to the trailing edge of the container
+ which is on the opposite side in RTL.
+
+2018-01-03 Joseph Pecoraro <[email protected]>
+
Web Inspector: Find banner sometimes does not work (when already populated and shown for first time on resource)
https://bugs.webkit.org/show_bug.cgi?id=181255
<rdar://problem/36248855>
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js (226391 => 226392)
--- trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js 2018-01-04 05:23:54 UTC (rev 226391)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js 2018-01-04 05:57:23 UTC (rev 226392)
@@ -740,10 +740,20 @@
let scrollContainer = this.element.parentElement;
// We choose this X coordinate based on the knowledge that our list
- // items extend at least to the right edge of the outer <ol> container.
+ // items extend at least to the trailing edge of the outer <ol> container.
// In the no-word-wrap mode the outer <ol> may be wider than the tree container
- // (and partially hidden), in which case we are left to use only its right boundary.
- let x = scrollContainer.totalOffsetLeft + scrollContainer.offsetWidth - 36;
+ // (and partially hidden), in which case we are left to use only its trailing boundary.
+ // This adjustment is useful in order to find the inner-most tree element that
+ // lines up horizontally with the location of the event. If the mouse event
+ // happened in the space preceding a nested tree element (in the leading indentated
+ // space) we use this adjustment to get the nested tree element and not a tree element
+ // from a parent / outer tree outline / tree element.
+ //
+ // NOTE: This can fail if there is floating content over the trailing edge of
+ // the <li> content, since the element from point could hit that.
+ let isRTL = WI.resolvedLayoutDirection() === WI.LayoutDirection.RTL;
+ let trailingEdgeOffset = isRTL ? 36 : (scrollContainer.offsetWidth - 36);
+ let x = scrollContainer.totalOffsetLeft + trailingEdgeOffset;
let y = event.pageY;
// Our list items have 1-pixel cracks between them vertically. We avoid
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes