RESOLVED FIXED 129898
Web Inspector: convert the dashboard toolbar item to support multiple dashboards
https://bugs.webkit.org/show_bug.cgi?id=129898
Summary Web Inspector: convert the dashboard toolbar item to support multiple dashboards
Blaze Burg
Reported 2014-03-07 12:24:50 PST
And fix weird layering problems. Patch soon!
Attachments
the patch (64.65 KB, patch)
2014-03-07 13:59 PST, Blaze Burg
no flags
revised patch (71.52 KB, patch)
2014-03-09 19:43 PDT, Blaze Burg
timothy: review+
Blaze Burg
Comment 1 2014-03-07 13:59:55 PST
Created attachment 226166 [details] the patch
Timothy Hatcher
Comment 2 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!
Joseph Pecoraro
Comment 3 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 "()".
Blaze Burg
Comment 4 2014-03-09 19:43:17 PDT
Created attachment 226273 [details] revised patch
Timothy Hatcher
Comment 5 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.
Blaze Burg
Comment 6 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.
Blaze Burg
Comment 7 2014-03-10 11:01:35 PDT
Note You need to log in before you can comment on or make changes to this bug.