Changeset 253348 in webkit
- Timestamp:
- Dec 10, 2019 3:01:47 PM (4 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r253338 r253348 1 2019-12-10 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: REGRESSION(r251038): Elements: Computed: implicit shorthands are not shown when "Prefer Shorthands" is enabled 4 https://bugs.webkit.org/show_bug.cgi?id=205035 5 <rdar://problem/57773470> 6 7 Reviewed by Brian Burg. 8 9 The computed style treats most shorthand properties as "implicit", meaning that if "Prefer 10 Shorthands" is enabled, we won't show the shorthand properties unless "Show All" is also 11 enabled. The frontend can fix this by checking to see if there are any non-implicit longhand 12 values for each shorthand value, and therefore decide not to hide the "implicit" shorthand. 13 14 * UserInterface/Views/ComputedStyleSection.js: 15 (WI.ComputedStyleSection.prototype.get propertiesToRender): 16 (WI.ComputedStyleSection.prototype.get propertiesToRender.hasNonImplicitLonghand): Added. 17 Drive-by: filter the list of properties to render before sorting them for performance. 18 1 19 2019-12-10 Devin Rousso <drousso@apple.com> 2 20 -
trunk/Source/WebInspectorUI/UserInterface/Views/ComputedStyleSection.js
r251883 r253348 141 141 properties = this._style.properties; 142 142 143 properties.sort((a, b) => a.name.extendedLocaleCompare(b.name)); 143 let propertyNameMap = new Map(properties.map((property) => [property.canonicalName, property])); 144 145 function hasNonImplicitLonghand(property) { 146 if (property.canonicalName === "all") 147 return false; 148 149 let longhandPropertyNames = WI.CSSKeywordCompletions.LonghandNamesForShorthandProperty.get(property.canonicalName); 150 if (!longhandPropertyNames) 151 return false; 152 153 for (let longhandPropertyName of longhandPropertyNames) { 154 let property = propertyNameMap.get(longhandPropertyName); 155 if (property && !property.implicit) 156 return true; 157 } 158 159 return false; 160 } 144 161 145 162 let hideVariables = this._propertyVisibilityMode === ComputedStyleSection.PropertyVisibilityMode.HideVariables; 146 163 let hideNonVariables = this._propertyVisibilityMode === ComputedStyleSection.PropertyVisibilityMode.HideNonVariables; 147 164 148 returnproperties.filter((property) => {165 properties = properties.filter((property) => { 149 166 if (this._alwaysShowPropertyNames.has(property.canonicalName)) 150 167 return true; 151 168 152 if (property.implicit && !this._showsImplicitProperties) 153 return false; 169 if (property.implicit && !this._showsImplicitProperties) { 170 if (!(this._showsShorthandsInsteadOfLonghands && property.isShorthand && hasNonImplicitLonghand(property))) 171 return false; 172 } 154 173 155 174 if (this._showsShorthandsInsteadOfLonghands) { … … 167 186 return true; 168 187 }); 188 189 properties.sort((a, b) => a.name.extendedLocaleCompare(b.name)); 190 return properties; 169 191 } 170 192
Note: See TracChangeset
for help on using the changeset viewer.