[Webkit-unassigned] [Bug 110641] WebInspector: Switch hide element shortcut in ElementsPanel to use a selector
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Feb 26 10:37:06 PST 2013
https://bugs.webkit.org/show_bug.cgi?id=110641
--- Comment #7 from egraether at chromium.org 2013-02-26 10:39:29 PST ---
(From update of attachment 190161)
View in context: https://bugs.webkit.org/attachment.cgi?id=190161&action=review
>> Source/WebCore/inspector/front-end/ElementsTreeOutline.js:625
>> + this._hideShortcutRule = newRule;
>
> There is an inspector stylesheet per document, you can't store them all in a single variable.
this._hideShortcutRule is only set once per document. When the document changes, the inspector stylesheet is removed and CSSStyleModel::getViaInspectorResourceForRule(this._hideShortcutRule) does not return a valid resource, so a new rule is added, which forces the inspector stylesheet to be created.
>> Source/WebCore/inspector/front-end/ElementsTreeOutline.js:641
>> + WebInspector.cssModel.addRule(node.id, hideShortcutSelector, successCallback.bind(this), failureCallback);
>
> I am still not convinced this will only run once per inspector stylesheet. Here is the scenario for you:
> 1) On a page, press "+" in the styles sidebar to add user-defined style rule.
> 2) Run _toggleHideShortcut
>
> I suspect that resource will be defined and hence you will not add the new rule.
>
> We might want a test for this.
I tested this scenario multiple times now and it works. "+" creates the inspector stylesheet, but this._hideShortcutRule is still undefined so CSSStyleModel::getViaInspectorResourceForRule(null) returns no resource.
I'm not arguing that this is a good solution, if you can point me another direction I'm happy to do so. This is the best way I could find.
I will have a look into writing a test.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list