[webkit-reviews] review granted: [Bug 185930] Web Inspector: Styles: overridden CSS property should have go-to button to jump to effective property : [Attachment 363938] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Mar 7 15:44:34 PST 2019
Matt Baker <mattbaker at apple.com> has granted Nikita Vasilyev
<nvasilyev at apple.com>'s request for review:
Bug 185930: Web Inspector: Styles: overridden CSS property should have go-to
button to jump to effective property
https://bugs.webkit.org/show_bug.cgi?id=185930
Attachment 363938: Patch
https://bugs.webkit.org/attachment.cgi?id=363938&action=review
--- Comment #22 from Matt Baker <mattbaker at apple.com> ---
Comment on attachment 363938
--> https://bugs.webkit.org/attachment.cgi?id=363938
Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=363938&action=review
r=me, with some suggestions.
> Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js:915
> +localizedStrings["Show Jump to Effective Property Buttons"] = "Show Jump to
Effective Property Buttons";
This should be singular: "Show Jump to Effective Property Button".
> Source/WebInspectorUI/UserInterface/Models/CSSProperty.js:299
> + if (!WI.settings.experimentalEnableStylesJumpToEffective.value)
Should we be performing this check? I think we should always track the
effective property, but only show the UI when the setting is enabled.
> Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js:921
> + property.overridingProperty = effectiveProperty;
You could eliminate some of the syncing of these two properties by doing this:
class CSSProperty
{
set overridingProperty(property = null)
{
if (this._overridingProperty === property)
return;
this._overridingProperty = property;
this._overridden = !!this._overridingProperty
}
}
Unless it's possible that `overridden === true && overridingProperty === null`.
Just a thought. If it doesn't simplify things, please disregard.
>
Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.
css:226
> + /* .select-effective-property has inverted colors. Invert the text
color again to make it readable. */
Suggestion: ".select-effective-property has inverted colors. Invert the
pseudo-element again to restore the original text color."
> Source/WebInspectorUI/UserInterface/Views/SpreadsheetStyleProperty.js:42
> + this._jumpToEffectiveButton = null;
this._jumpToEffectivePropertyButton
> Source/WebInspectorUI/UserInterface/Views/SpreadsheetStyleProperty.js:264
> if (this._property.overridden) {
If it is not possible that `overridden && !overridingProperty`, I'd test
this._overridingProperty instead. Then you can eliminate the assert and test
below.
More information about the webkit-reviews
mailing list