Bug 98924

Summary: Web Inspector: [CSS Regions] Move the Regions support out of experiments
Product: WebKit Reporter: Mihai Balan <mibalan>
Component: Web Inspector (Deprecated)Assignee: Mihai Balan <mibalan>
Status: RESOLVED FIXED    
Severity: Normal CC: apavlov, burg, bweinstein, joepeck, keishi, loislo, mvujovic, pfeldman, pmuellr, rik, syoichi, WebkitBugTracker, yurys
Priority: P2 Keywords: AdobeTracked
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 90786    

Description Mihai Balan 2012-10-10 10:18:18 PDT
The purpose of this patch is to have the WebInspector features related to regions available outside of the experiments tab.

I don't have an answer yet as to how this should interact with the runtime flag for regions.
Comment 1 Pavel Feldman 2012-10-10 11:34:46 PDT
You can introduce a new command "CSS.supportsRegions" and query it post-load or upon context menu.
Comment 2 Alexander Pavlov (apavlov) 2012-10-11 00:11:10 PDT
(In reply to comment #1)
> You can introduce a new command "CSS.supportsRegions" and query it post-load or upon context menu.

The most common way to do this is through the concept of "capabilities". See:
- Settings.js, var Capabilities = {...} - the default values (yours should be "false")
- inspector.js, WebInspector.doLoadedDone() queries agents for their supported capabilities and initializes their values according to the response. The last one should provide bound WebInspector._doLoadedDoneWithCapabilities as the callback. Your call will most probably look similar to:
CSS.supportsRegions(WebInspector._initializeCapability.bind(WebInspector, "cssRegionsSupported", null)); // not the last capability initializer

Afterwards, you just check:
if (Capabilities.cssRegionsSupported) {
    // do something
}
Comment 3 Alexander Pavlov (apavlov) 2012-10-11 01:56:41 PDT
(In reply to comment #2)
> (In reply to comment #1)
> > You can introduce a new command "CSS.supportsRegions" and query it post-load or upon context menu.
> 
> The most common way to do this is through the concept of "capabilities".

Pavel has rightly pointed out that this approach will add up to the total inspector loading time. So it is better to query the agent when you do need the real value and cache it once received.
Comment 4 Michelangelo De Simone 2013-06-13 20:22:58 PDT
This seems to be a Chromium bug, closing.
Comment 5 Mihai Balan 2013-06-14 06:16:37 PDT
Reopening as the Web Inspector code is still in trunk and usable and the code isn't Chrome-only.