Bug 129898

Summary: Web Inspector: convert the dashboard toolbar item to support multiple dashboards
Product: WebKit Reporter: Brian Burg <bburg>
Component: Web InspectorAssignee: Brian Burg <bburg>
Status: RESOLVED FIXED    
Severity: Normal CC: graouts, joepeck, timothy, webkit-bug-importer
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 129913    
Attachments:
Description Flags
the patch
none
revised patch timothy: review+

Description Brian Burg 2014-03-07 12:24:50 PST
And fix weird layering problems. Patch soon!
Comment 1 Brian Burg 2014-03-07 13:59:55 PST
Created attachment 226166 [details]
the patch
Comment 2 Timothy Hatcher 2014-03-07 14:37:44 PST
Comment on attachment 226166 [details]
the patch

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

> Source/WebInspectorUI/UserInterface/Controllers/DashboardManager.js:43
> +        return this._containerView.toolbarItem;

The manager holding the view is a layering violation, but this is much better than before.

Main.js should just make the manager and the view separately.

> Source/WebInspectorUI/UserInterface/Views/DashboardContainerView.js:79
> +        // Iterate over all the known content views for the representedObject (if any) and find one that doesn't
> +        // have a parent container or has this container as its parent.
> +        var dashboardView = null;
> +        for (var i = 0; representedObject.__dashboardViews && i < representedObject.__dashboardViews.length; ++i) {
> +            var currentDashboardView = representedObject.__dashboardViews[i];
> +            if (!currentDashboardView._parentContainer || currentDashboardView._parentContainer === this) {
> +                dashboardView = currentDashboardView;
> +                break;
> +            }
> +        }

This could be simplified. We don't plan to support multiple dashboard container views, do we?

> Source/WebInspectorUI/UserInterface/Views/DashboardContainerView.js:96
> +        // Remember this content view for future calls.
> +        if (!representedObject.__dashboardViews)
> +            representedObject.__dashboardViews = [];
> +        representedObject.__dashboardViews.push(dashboardView);

Ditto.

> Source/WebInspectorUI/UserInterface/Views/DashboardView.js:23
> - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
> - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
> - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
> - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
> - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
> - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
> - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
> - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
> - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
> - * THE POSSIBILITY OF SUCH DAMAGE.
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
> + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
> + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
> + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
> + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
> + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
> + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
> + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

This should use the Apple BSD license.

> Source/WebInspectorUI/UserInterface/Views/DefaultDashboardView.js:23
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
> + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
> + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
> + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
> + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
> + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
> + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
> + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Ditto.

> Source/WebInspectorUI/UserInterface/Views/DefaultDashboardView.js:153
> +        var iVarName = "_" + itemName;
> +        var previousValue = this[iVarName];
> +        this[iVarName] = newValue;

This isn't new, but it is gross!
Comment 3 Joseph Pecoraro 2014-03-07 16:22:31 PST
Comment on attachment 226166 [details]
the patch

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

> Source/WebInspectorUI/UserInterface/Controllers/DashboardManager.js:30
> +    this._defaultDashboard = new WebInspector.DefaultDashboard();

Style: No need for the "()".
Comment 4 Brian Burg 2014-03-09 19:43:17 PDT
Created attachment 226273 [details]
revised patch
Comment 5 Timothy Hatcher 2014-03-10 06:00:49 PDT
Comment on attachment 226273 [details]
revised patch

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

Code looks fine but the licenses need fixed.

> Source/WebInspectorUI/UserInterface/Models/DefaultDashboard.js:13
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS

Should be the Apple version:
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS
etc.

We likely should fix up the other existing files (I see 23 UI files using this version vs 366 using the Apple version). But at minimum, new files should use the Apple version.

> Source/WebInspectorUI/UserInterface/Views/DashboardContainerView.css:13
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS

Ditto.

> Source/WebInspectorUI/UserInterface/Views/DashboardContainerView.js:13
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS

Ditto.

> Source/WebInspectorUI/UserInterface/Views/DashboardView.js:23
> - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
> - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
> - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
> - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
> - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
> - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
> - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
> - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
> - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
> - * THE POSSIBILITY OF SUCH DAMAGE.
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
> + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
> + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
> + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
> + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
> + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
> + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
> + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

This should still be reverted.

> Source/WebInspectorUI/UserInterface/Views/DefaultDashboardView.css:13
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS

Should be the Apple version.

> Source/WebInspectorUI/UserInterface/Views/DefaultDashboardView.js:13
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS

Ditto.
Comment 6 Brian Burg 2014-03-10 10:45:09 PDT
Comment on attachment 226273 [details]
revised patch

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

>> Source/WebInspectorUI/UserInterface/Models/DefaultDashboard.js:13
>> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> 
> Should be the Apple version:
> * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS
> etc.
> 
> We likely should fix up the other existing files (I see 23 UI files using this version vs 366 using the Apple version). But at minimum, new files should use the Apple version.

I wasn't aware there was any difference aside from the apple one having less aesthetically pleasing line breaking. will revert.
Comment 7 Brian Burg 2014-03-10 11:01:35 PDT
Committed r165382: <http://trac.webkit.org/changeset/165382>