Changeset 248991 in webkit
- Timestamp:
- Aug 21, 2019, 7:33:40 PM (7 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 5 edited
-
ChangeLog (modified) (1 diff)
-
UserInterface/Base/Main.js (modified) (1 diff)
-
UserInterface/Views/DOMTreeOutline.css (modified) (8 diffs)
-
UserInterface/Views/DOMTreeOutline.js (modified) (1 diff)
-
UserInterface/Views/TreeOutline.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r248943 r248991 1 2019-08-21 Nikita Vasilyev <nvasilyev@apple.com> 2 3 Web Inspector: RTL: DOM outline in Elements tab should be LTR 4 https://bugs.webkit.org/show_bug.cgi?id=200601 5 6 Reviewed by Timothy Hatcher. 7 8 Make DOM outlines in Console and Elements tab always LTR, 9 and unsure that Left and Right arrow keys continue working correctly. 10 11 * UserInterface/Base/Main.js: 12 (WI.resolveLayoutDirectionForElement): Added. 13 The existing WI.resolvedLayoutDirection function returns the value of the root DOM element. 14 The newly added resolveLayoutDirectionForElement function returns the correct value for any element, 15 including elements with `dir=ltr` inside of `<body dir=rtl>`. 16 17 * UserInterface/Views/DOMTreeOutline.css: 18 (.tree-outline.dom li:matches(.hovered, .selected) + ol.children.expanded): 19 (.tree-outline.dom li:not(.editing)): 20 (.tree-outline.dom li.editing): 21 (.tree-outline.dom li .pseudo-class-indicator): 22 (.tree-outline.dom.single-node li): 23 (.tree-outline.dom li.parent): 24 (.tree-outline.dom li .html-tag.close): 25 (.tree-outline.dom li.parent::before): 26 (.tree-outline.dom li.parent.shadow::after): 27 Remove RTL logic. 28 29 * UserInterface/Views/DOMTreeOutline.js: 30 * UserInterface/Views/TreeOutline.js: 31 (WI.TreeOutline.prototype._treeKeyDown): 32 Make Left and Right arrow keys work correctly for LTR DOM outlines inside of the global RTL. 33 1 34 2019-08-21 Devin Rousso <drousso@apple.com> 2 35 -
trunk/Source/WebInspectorUI/UserInterface/Base/Main.js
r248773 r248991 2710 2710 }; 2711 2711 2712 WI.resolveLayoutDirectionForElement = function(element) 2713 { 2714 let layoutDirection = WI.resolvedLayoutDirection(); 2715 2716 // Global LTR never includes RTL containers. Return early. 2717 if (layoutDirection === WI.LayoutDirection.LTR) 2718 return layoutDirection; 2719 2720 let style = getComputedStyle(element); 2721 return style.direction; 2722 }; 2723 2712 2724 WI.setLayoutDirection = function(value) 2713 2725 { -
trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.css
r248287 r248991 102 102 } 103 103 104 body[dir=ltr].tree-outline.dom li:matches(.hovered, .selected) + ol.children.expanded {104 .tree-outline.dom li:matches(.hovered, .selected) + ol.children.expanded { 105 105 border-left-width: var(--sublist-border-width-start); 106 }107 108 body[dir=rtl] .tree-outline.dom li:matches(.hovered, .selected) + ol.children.expanded {109 border-right-width: var(--sublist-border-width-start);110 106 } 111 107 … … 123 119 124 120 .tree-outline.dom li:not(.editing) { 125 -webkit-padding-start: var(--item-padding-start);126 -webkit-padding-end: var(--item-padding-end);121 padding-left: var(--item-padding-start); 122 padding-right: var(--item-padding-end); 127 123 } 128 124 129 125 .tree-outline.dom li.editing { 130 -webkit-margin-start: var(--item-padding-start);131 -webkit-margin-end: var(--item-padding-end);126 margin-left: var(--item-padding-start); 127 margin-right: var(--item-padding-end); 132 128 } 133 129 … … 143 139 } 144 140 145 body[dir=ltr].tree-outline.dom li .pseudo-class-indicator {141 .tree-outline.dom li .pseudo-class-indicator { 146 142 left: var(--item-pseudo-class-indicator-start); 147 }148 149 body[dir=rtl] .tree-outline.dom li .pseudo-class-indicator {150 right: var(--item-pseudo-class-indicator-start);151 143 } 152 144 … … 156 148 157 149 .tree-outline.dom.single-node li { 158 -webkit-padding-start: 2px;150 padding-left: 2px; 159 151 } 160 152 … … 168 160 169 161 .tree-outline.dom li.parent { 170 -webkit-margin-start: -15px;162 margin-left: -15px; 171 163 line-height: 13px; 172 164 } 173 165 174 166 .tree-outline.dom li .html-tag.close { 175 -webkit-margin-start: calc(-1 * var(--sublist-margin-start) - var(--sublist-border-width-start));167 margin-left: calc(-1 * var(--sublist-margin-start) - var(--sublist-border-width-start)); 176 168 } 177 169 … … 190 182 width: 13px; 191 183 height: 13px; 192 -webkit-padding-end: 2px;184 padding-right: 2px; 193 185 content: ""; 194 186 background-image: url(../Images/DisclosureTriangles.svg#closed-normal); … … 197 189 } 198 190 199 body[dir=ltr].tree-outline.dom li.parent::before {191 .tree-outline.dom li.parent::before { 200 192 float: left; 201 }202 203 body[dir=rtl] .tree-outline.dom li.parent::before {204 float: right;205 transform: scaleX(-1);206 193 } 207 194 … … 239 226 height: 1.2em; 240 227 margin-top: -13px; 241 -webkit-margin-start: -2px;228 margin-left: -2px; 242 229 content: ""; 243 230 background-color: hsla(0, 0%, 90%, 0.5); -
trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.js
r247053 r248991 45 45 46 46 this.element.classList.add("dom", WI.SyntaxHighlightedStyleClassName); 47 this.element.dir = "ltr"; 47 48 48 49 if (showLastSelected) -
trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js
r248537 r248991 599 599 return; 600 600 601 let isRTL = WI.resolve dLayoutDirection() === WI.LayoutDirection.RTL;601 let isRTL = WI.resolveLayoutDirectionForElement(this.element) === WI.LayoutDirection.RTL; 602 602 let expandKeyIdentifier = isRTL ? "Left" : "Right"; 603 603 let collapseKeyIdentifier = isRTL ? "Right" : "Left";
Note:
See TracChangeset
for help on using the changeset viewer.