[Webkit-unassigned] [Bug 139153] Web Inspector: support live editing of rule selectors

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jul 24 11:15:20 PDT 2015


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

--- Comment #4 from Timothy Hatcher <timothy at apple.com> ---
Comment on attachment 257431
  --> https://bugs.webkit.org/attachment.cgi?id=257431
[Proposed] Patch

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

I like this! We should do this. Historically we did pin the rule you were editing, and it would disappear if you clicked away (if it no longer applied). That way if you mistyped a selector, you could still edit it to make it apply again.

> Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationSection.js:54
> +    this._selectorElement.addEventListener("keyup", this._highlightNodesWithSelector.bind(this));

This is risky. If _highlightNodesWithSelector ever starts taking an argument, it will break because this event listener will send an event object as the first argument and it could cause undefined behavior.

> Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationSection.js:131
> +    this._highlightConfig = {
> +        borderColor: {r: 255, g: 229, b: 153, a: 0.66},
> +        contentColor: {r: 111, g: 168, b: 220, a: 0.66},
> +        marginColor: {r: 246, g: 178, b: 107, a: 0.66},
> +        paddingColor: {r: 147, g: 196, b: 125, a: 0.66},
> +        showInfo: true
> +    };

We should find a central place for this to be shared with other places we have the config. CSSStyleManager should really encapsulate DOMAgent.highlightSelector and DOMAgent.highlightNode, along with the colors used.

-- 
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/20150724/d7ffe904/attachment.html>


More information about the webkit-unassigned mailing list