Bug 105258 - Web Inspector: Implement the "disabled" attribute toggling for CSS stylesheets
Summary: Web Inspector: Implement the "disabled" attribute toggling for CSS stylesheets
Status: RESOLVED LATER
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Alexander Pavlov (apavlov)
URL:
Keywords:
Depends on: 105828
Blocks: 116924
  Show dependency treegraph
 
Reported: 2012-12-17 23:40 PST by Alexander Pavlov (apavlov)
Modified: 2014-04-10 07:50 PDT (History)
11 users (show)

See Also:


Attachments
Patch (29.44 KB, patch)
2012-12-18 01:19 PST, Alexander Pavlov (apavlov)
no flags Details | Formatted Diff | Diff
Patch (39.88 KB, patch)
2012-12-28 03:59 PST, Alexander Pavlov (apavlov)
pfeldman: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Pavlov (apavlov) 2012-12-17 23:40:57 PST
Upstreaming https://code.google.com/p/chromium/issues/detail?id=155476.

Patch to follow.
Comment 1 Alexander Pavlov (apavlov) 2012-12-18 01:19:01 PST
Created attachment 179899 [details]
Patch
Comment 2 Build Bot 2012-12-18 13:16:55 PST
Comment on attachment 179899 [details]
Patch

Attachment 179899 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/15402334

New failing tests:
http/tests/inspector/resource-har-pages.html
Comment 3 Alexander Pavlov (apavlov) 2012-12-28 03:59:15 PST
Created attachment 180861 [details]
Patch
Comment 4 Pavel Feldman 2012-12-28 04:49:56 PST
Comment on attachment 180861 [details]
Patch

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

> Source/WebCore/inspector/CodeGeneratorInspector.py:1071
> +                            return "%s%s" % (helper.full_name_prefix_for_use, fixed_type_name.class_name)

Why did this change? What is the diff between the old generated and new generated code?

> Source/WebCore/inspector/Inspector.json:2364
> +                    { "name": "header", "$ref": "CSSStyleSheetHeader", "description": "Updated stylesheet header." }

Why do we need this?

> Source/WebCore/inspector/Inspector.json:2482
> +                "name": "activeStyleSheetsUpdated",

I think you should have styleSheetAdded / styleSheetRemoved notifications instead.

> Source/WebCore/inspector/InspectorCSSAgent.cpp:360
> +    SetStyleSheetDisabledAction(InspectorStyleSheet* styleSheet, bool disabled)

I think you should split stylesheet disable and stylesheet tracking changes.

> Source/WebCore/inspector/InspectorCSSAgent.cpp:618
> +    if (m_styleSheetHeadersRequested && m_state->getBoolean(CSSAgentState::cssAgentEnabled)) {

m_styleSheetHeadersRequested can't be true without m_state->getBoolean(CSSAgentState::cssAgentEnabled) being true.

> Source/WebCore/inspector/InspectorCSSAgent.cpp:724
> +            removedSheets.remove(newCSSSheet);

i.e. just dispatch them here.

> Source/WebCore/inspector/front-end/CSSStyleModel.js:377
> +            this._resourceBinding._styleSheetIdToHeader[styleSheetId] = newHeader;

just patch it here.

> Source/WebCore/inspector/front-end/StylesSourceMapping.js:242
> +        setText.call(this);

You should not make content setting asynchronous.
Comment 5 Alexander Pavlov (apavlov) 2012-12-28 05:18:44 PST
Comment on attachment 180861 [details]
Patch

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

>> Source/WebCore/inspector/CodeGeneratorInspector.py:1071
>> +                            return "%s%s" % (helper.full_name_prefix_for_use, fixed_type_name.class_name)
> 
> Why did this change? What is the diff between the old generated and new generated code?

<         void activeStyleSheetsUpdated(PassRefPtr<TypeBuilder::Array<const TypeBuilder::CSS::StyleSheetId&> > removed, PassRefPtr<TypeBuilder::Array<TypeBuilder::CSS::CSSStyleSheetHeader> > added);
---
>         void activeStyleSheetsUpdated(PassRefPtr<TypeBuilder::Array<TypeBuilder::CSS::StyleSheetId> > removed, PassRefPtr<TypeBuilder::Array<TypeBuilder::CSS::CSSStyleSheetHeader> > added);

The former is clearly wrong.

>> Source/WebCore/inspector/Inspector.json:2364
>> +                    { "name": "header", "$ref": "CSSStyleSheetHeader", "description": "Updated stylesheet header." }
> 
> Why do we need this?

Will move into the styleSheetChanged event data

>> Source/WebCore/inspector/Inspector.json:2482
>> +                "name": "activeStyleSheetsUpdated",
> 
> I think you should have styleSheetAdded / styleSheetRemoved notifications instead.

OK

>> Source/WebCore/inspector/InspectorCSSAgent.cpp:360
>> +    SetStyleSheetDisabledAction(InspectorStyleSheet* styleSheet, bool disabled)
> 
> I think you should split stylesheet disable and stylesheet tracking changes.

OK

>> Source/WebCore/inspector/InspectorCSSAgent.cpp:618
>> +    if (m_styleSheetHeadersRequested && m_state->getBoolean(CSSAgentState::cssAgentEnabled)) {
> 
> m_styleSheetHeadersRequested can't be true without m_state->getBoolean(CSSAgentState::cssAgentEnabled) being true.

Agreed on sending styleSheetAdded() for all active stylesheets in enable()

>> Source/WebCore/inspector/InspectorCSSAgent.cpp:724
>> +            removedSheets.remove(newCSSSheet);
> 
> i.e. just dispatch them here.

OK

>> Source/WebCore/inspector/front-end/CSSStyleModel.js:377
>> +            this._resourceBinding._styleSheetIdToHeader[styleSheetId] = newHeader;
> 
> just patch it here.

We'll patch it on styleSheetChanged, which will provide us with a CSSStyleSheetHeader

>> Source/WebCore/inspector/front-end/StylesSourceMapping.js:242
>> +        setText.call(this);
> 
> You should not make content setting asynchronous.

OK
Comment 6 Brian Burg 2014-04-10 07:50:14 PDT
Not sure we want this feature, closing for now.