[Webkit-unassigned] [Bug 120640] Web Inspector: Jump from a computed style to the rule it came from

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu May 28 16:06:49 PDT 2015


https://bugs.webkit.org/show_bug.cgi?id=120640

--- Comment #12 from Timothy Hatcher <timothy at apple.com> ---
Comment on attachment 253869
  --> https://bugs.webkit.org/attachment.cgi?id=253869
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=253869&action=review

Almost there!

> Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js:214
> +                this._codeMirror.setSelection(selection.from, selection.to);

You might want to do this which we use in TextEditor to scroll:

    _scrollIntoViewCentered(position)
    {
        var scrollInfo = this._codeMirror.getScrollInfo();
        var lineHeight = Math.ceil(this._codeMirror.defaultTextHeight());
        var margin = Math.floor((scrollInfo.clientHeight - lineHeight) / 2);
        this._codeMirror.scrollIntoView(position, margin);
    }

Might not need to make it as complex, it would be good to share that code. Maybe in CodeMirrorAdditions.js?

You can remove the scrollIntoView from CSSStyleDeclarationSection then.

> Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js:482
> +                && !property.implicit
> +                && typeof this._delegate.cssStyleDeclarationTextEditorShowProperty === "function") {

I'd put these on the same line.

> Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js:491
> +            var arrowMarker = this._codeMirror.setUniqueBookmark(to, arrowElement);

You never use arrowMarker, you can drop the var.

> Source/WebInspectorUI/UserInterface/Views/CSSStyleDetailsSidebarPanel.js:146
> +        this._navigationBar.updateLayout();

Why is this needed? It should happen automatically.

> Source/WebInspectorUI/UserInterface/Views/RulesStyleDetailsPanel.js:298
> +            delete this._propertyToSelectAndHighlight;

We are trying to avoid delete for performance reasons. This can just be:

this._propertyToSelectAndHighlight = null;

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150528/b04eb224/attachment.html>


More information about the webkit-unassigned mailing list