Changeset 28039 in webkit


Ignore:
Timestamp:
Nov 26, 2007 9:17:50 AM (16 years ago)
Author:
timothy@apple.com
Message:

WebCore:

Reviewed by Adam Roben.

Bug 16137: Web Inspector window on Leopard should have a unified toolbar and window title
http://bugs.webkit.org/show_bug.cgi?id=16137

On Leopard the toolbar background will be transparent, to allow the
window background to show through the transparent WebView. The
search results divs needed to move inside the "main" div, so they
would be clipped and not show where the toolbar is.

  • page/InspectorController.cpp: (WebCore::platform): Return a string for which platform we are. (WebCore::InspectorController::windowScriptObjectAvailable): Define the platform function on the JavaScript class.
  • page/inspector/Panel.js: Add panels to the panels div.
  • page/inspector/inspector.css: On the Leopard platform make the toolbar background transparent so the window background shows.
  • page/inspector/inspector.html: Add a panels div and move search result divs inside the main div.
  • page/inspector/inspector.js: Tweak the resize code to acount for the search results divs moving inside the main div.

WebKit/mac:

Reviewed by Adam Roben.

Bug 16137: Web Inspector window on Leopard should have a unified toolbar and window title
http://bugs.webkit.org/show_bug.cgi?id=16137

Create the Web Inspector window with the textured style. Set the content border
thickness for the top of the window or the height of the toolbar. Also make the
window's bottom corners square, since a normal textured window normally has
rounded bottom corners.

  • WebCoreSupport/WebInspectorClient.mm: (-[WebInspectorWindowController window]):

WebKitLibraries:

Reviewed by Adam Roben.

Bug 16137: Web Inspector window on Leopard should have a unified toolbar and window title
http://bugs.webkit.org/show_bug.cgi?id=16137

Add a new function to make bottom window corners square for textured windows.

  • WebKitSystemInterface.h:
  • libWebKitSystemInterfaceTiger.a:
  • libWebKitSystemInterfaceLeopard.a:
Location:
trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r28029 r28039  
     12007-11-26  Timothy Hatcher  <timothy@apple.com>
     2
     3        Reviewed by Adam Roben.
     4
     5        Bug 16137: Web Inspector window on Leopard should have a unified toolbar and window title
     6        http://bugs.webkit.org/show_bug.cgi?id=16137
     7
     8        On Leopard the toolbar background will be transparent, to allow the
     9        window background to show through the transparent WebView. The
     10        search results divs needed to move inside the "main" div, so they
     11        would be clipped and not show where the toolbar is.
     12
     13        * page/InspectorController.cpp:
     14        (WebCore::platform): Return a string for which platform we are.
     15        (WebCore::InspectorController::windowScriptObjectAvailable):
     16        Define the platform function on the JavaScript class.
     17        * page/inspector/Panel.js: Add panels to the panels div.
     18        * page/inspector/inspector.css: On the Leopard platform make
     19        the toolbar background transparent so the window background shows.
     20        * page/inspector/inspector.html: Add a panels div and move search
     21        result divs inside the main div.
     22        * page/inspector/inspector.js: Tweak the resize code to acount for
     23        the search results divs moving inside the main div.
     24
    1252007-11-25  Rodney Dawes  <dobey@wayofthemonkey.com>
    226
  • trunk/WebCore/page/InspectorController.cpp

    r27937 r28039  
    6262#include <JavaScriptCore/APICast.h>
    6363#include <JavaScriptCore/JSLock.h>
     64#include <JavaScriptCore/JSRetainPtr.h>
    6465#include <JavaScriptCore/JSStringRef.h>
    6566
     
    544545}
    545546
     547static JSValueRef platform(JSContextRef ctx, JSObjectRef /*function*/, JSObjectRef thisObject, size_t /*argumentCount*/, const JSValueRef[] /*arguments[]*/, JSValueRef* /*exception*/)
     548{
     549#if PLATFORM(MAC)
     550#ifdef BUILDING_ON_TIGER
     551    static const String platform = "mac-tiger";
     552#else
     553    static const String platform = "mac-leopard";
     554#endif
     555#elif PLATFORM(WIN_OS)
     556    static const String platform = "windows";
     557#elif PLATFORM(QT)
     558    static const String platform = "qt";
     559#elif PLATFORM(GTK)
     560    static const String platform = "gtk";
     561#elif PLATFORM(WX)
     562    static const String platform = "wx";
     563#else
     564    static const String platform = "unknown";
     565#endif
     566
     567    JSRetainPtr<JSStringRef> platformString(Adopt, JSStringCreateWithCharacters(platform.characters(), platform.length()));
     568    JSValueRef platformValue = JSValueMakeString(ctx, platformString.get());
     569
     570    return platformValue;
     571}
     572
    546573InspectorController::InspectorController(Page* page, InspectorClient* client)
    547574    : m_inspectedPage(page)
     
    735762        { "inspectedWindow", inspectedWindow, kJSPropertyAttributeNone },
    736763        { "localizedStringsURL", localizedStrings, kJSPropertyAttributeNone },
     764        { "platform", platform, kJSPropertyAttributeNone },
    737765        { 0, 0, 0 }
    738766    };
  • trunk/WebCore/page/inspector/Panel.js

    r27893 r28039  
    117117    attach: function()
    118118    {
    119         document.getElementById("main").appendChild(this.element);
     119        document.getElementById("panels").appendChild(this.element);
    120120    },
    121121
  • trunk/WebCore/page/inspector/inspector.css

    r27979 r28039  
    5959    right: 0;
    6060    height: 28px;
    61     background: rgb(245, 245, 250);
     61    background-color: rgb(245, 245, 250);
    6262    background-image: url(Images/toolbarBackground.png);
    6363    background-repeat: repeat-x;
     
    6767    -webkit-box-sizing: border-box;
    6868    -webkit-background-size: auto 135%;
     69}
     70
     71.platform-mac-leopard #toolbar {
     72    background: transparent !important;
    6973}
    7074
     
    238242#searchResults {
    239243    position: absolute;
    240     top: -73px;
    241     left: 200px;
     244    top: -100px;
     245    left: 0;
    242246    right: 0;
    243247    height: 100px;
     
    247251    overflow-y: auto;
    248252    overflow-x: hidden;
     253    -webkit-box-sizing: border-box;
    249254}
    250255
     
    669674}
    670675
     676#panels {
     677    position: absolute;
     678    top: 0;
     679    left: 0;
     680    right: 0;
     681    bottom: 0;
     682    overflow: hidden;
     683    z-index: -100;
     684}
     685
    671686.panel {
    672687    display: none;
     
    20002015    position: absolute;
    20012016    height: 5px;
    2002     left: 200px;
     2017    left: 0;
    20032018    right: 0;
    20042019    cursor: row-resize;
  • trunk/WebCore/page/inspector/inspector.html

    r28002 r28039  
    6767        <div id="sidebarResizer" class="sidebar-resizer-vertical sidebar-resizer-vertical-left"></div>
    6868    </div>
    69     <div id="searchResults" class="focusable"></div>
    70     <div id="searchResultsResizer" style="display: none"></div>
    71     <div id="main" class="focusable blurred"></div>
     69    <div id="main" class="focusable blurred">
     70        <div id="searchResults" class="focusable hidden"></div>
     71        <div id="searchResultsResizer" class="hidden"></div>
     72        <div id="panels"></div>
     73    </div>
    7274</body>
    7375</html>
  • trunk/WebCore/page/inspector/inspector.js

    r28004 r28039  
    3434    maxTextSearchResultLength: 80,
    3535    showInheritedComputedStyleProperties: false,
    36     showMissingLocalizedStrings: false,
    37     toolbarHeight: 28
     36    showMissingLocalizedStrings: false
    3837}
    3938
     
    192191
    193192        if (x) {
    194             searchResultsResizer.style.display = null;
     193            resultsContainer.removeStyleClass("hidden");
     194            searchResultsResizer.removeStyleClass("hidden");
     195
    195196            var animations = [
    196                 {element: resultsContainer, end: {top: Preferences.toolbarHeight}},
    197                 {element: searchResultsResizer, end: {top: WebInspector.searchResultsHeight + Preferences.toolbarHeight - 2}},
    198                 {element: document.getElementById("main"), end: {top: WebInspector.searchResultsHeight + Preferences.toolbarHeight + 1}}
     197                {element: resultsContainer, end: {top: 0}},
     198                {element: searchResultsResizer, end: {top: WebInspector.searchResultsHeight - 3}},
     199                {element: document.getElementById("panels"), end: {top: WebInspector.searchResultsHeight}}
    199200            ];
     201
    200202            WebInspector.animateStyle(animations, 250);
    201203        } else {
    202             searchResultsResizer.style.display = "none";
     204            searchResultsResizer.addStyleClass("hidden");
     205
    203206            var animations = [
    204                 {element: resultsContainer, end: {top: Preferences.toolbarHeight - WebInspector.searchResultsHeight - 1}},
     207                {element: resultsContainer, end: {top: -WebInspector.searchResultsHeight}},
    205208                {element: searchResultsResizer, end: {top: 0}},
    206                 {element: document.getElementById("main"), end: {top: Preferences.toolbarHeight}}
     209                {element: document.getElementById("panels"), end: {top: 0}}
    207210            ];
    208             WebInspector.animateStyle(animations, 250, function() { resultsContainer.removeChildren(); delete this.searchResultsTree; });
     211
     212            var animationFinished = function()
     213            {
     214                resultsContainer.addStyleClass("hidden");
     215                resultsContainer.removeChildren();
     216                delete this.searchResultsTree;
     217            };
     218
     219            WebInspector.animateStyle(animations, 250, animationFinished);
    209220        }
    210221    }
     
    213224WebInspector.loaded = function()
    214225{
     226    document.body.addStyleClass("platform-" + InspectorController.platform());
     227
    215228    this.fileOutline = new TreeOutline(document.getElementById("list"));
    216229    this.fileOutline.expandTreeElementsWhenArrowing = true;
     
    555568        document.getElementById("main").style.left = newWidth + "px";
    556569        document.getElementById("toolbarButtons").style.left = newWidth + "px";
    557         document.getElementById("searchResults").style.left = newWidth + "px";
    558         document.getElementById("searchResultsResizer").style.left = newWidth + "px";
    559570
    560571        if (WebInspector.currentPanel && WebInspector.currentPanel.resize)
     
    579590    var searchResults = document.getElementById("searchResults");
    580591    if (searchResults.dragging == true) {
    581         var y = event.clientY;
     592        var y = event.clientY - document.getElementById("main").offsetTop;
    582593        var newHeight = Number.constrain(y, 100, window.innerHeight - 100);
    583594
     
    585596            searchResults.dragLastY = y;
    586597
    587         WebInspector.searchResultsHeight = newHeight - Preferences.toolbarHeight;
     598        WebInspector.searchResultsHeight = newHeight;
    588599        searchResults.style.height = WebInspector.searchResultsHeight + "px";
    589         document.getElementById("main").style.top = (newHeight + 1) + "px";
    590         document.getElementById("searchResultsResizer").style.top = (newHeight - 2) + "px";
     600        document.getElementById("panels").style.top = newHeight + "px";
     601        document.getElementById("searchResultsResizer").style.top = (newHeight - 3) + "px";
    591602        event.preventDefault();
    592603    }
  • trunk/WebKit/mac/ChangeLog

    r28007 r28039  
     12007-11-26  Timothy Hatcher  <timothy@apple.com>
     2
     3        Reviewed by Adam Roben.
     4
     5        Bug 16137: Web Inspector window on Leopard should have a unified toolbar and window title
     6        http://bugs.webkit.org/show_bug.cgi?id=16137
     7
     8        Create the Web Inspector window with the textured style. Set the content border
     9        thickness for the top of the window or the height of the toolbar. Also make the
     10        window's bottom corners square, since a normal textured window normally has
     11        rounded bottom corners.
     12
     13        * WebCoreSupport/WebInspectorClient.mm:
     14        (-[WebInspectorWindowController window]):
     15
    1162007-11-24  Mark Rowe  <mrowe@apple.com>
    217
  • trunk/WebKit/mac/WebCoreSupport/WebInspectorClient.mm

    r27883 r28039  
    3434#import "WebNodeHighlight.h"
    3535#import "WebPreferences.h"
     36#import "WebTypesInternal.h"
    3637#import "WebView.h"
    3738#import "WebViewInternal.h"
     
    4546#import <WebKit/DOMCore.h>
    4647#import <WebKit/DOMExtensions.h>
     48
     49#import <WebKitSystemInterface.h>
    4750
    4851using namespace WebCore;
     
    219222        return window;
    220223
    221     window = [[NSWindow alloc] initWithContentRect:NSMakeRect(60.0, 200.0, 750.0, 650.0)
    222         styleMask:(NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask) backing:NSBackingStoreBuffered defer:YES];
     224    NSUInteger styleMask = (NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask);
     225
     226#ifndef BUILDING_ON_TIGER
     227    styleMask |= NSTexturedBackgroundWindowMask;
     228#endif
     229
     230    window = [[NSWindow alloc] initWithContentRect:NSMakeRect(60.0, 200.0, 750.0, 650.0) styleMask:styleMask backing:NSBackingStoreBuffered defer:YES];
    223231    [window setDelegate:self];
    224232    [window setMinSize:NSMakeSize(400.0, 400.0)];
     233
     234#ifndef BUILDING_ON_TIGER
     235    [window setAutorecalculatesContentBorderThickness:NO forEdge:NSMaxYEdge];
     236    [window setContentBorderThickness:40. forEdge:NSMaxYEdge];
     237
     238    WKNSWindowMakeBottomCornersSquare(window);
     239#endif
    225240
    226241    [self setWindow:window];
  • trunk/WebKitLibraries/ChangeLog

    r28005 r28039  
     12007-11-26  Timothy Hatcher  <timothy@apple.com>
     2
     3        Reviewed by Adam Roben.
     4
     5        Bug 16137: Web Inspector window on Leopard should have a unified toolbar and window title
     6        http://bugs.webkit.org/show_bug.cgi?id=16137
     7
     8        Add a new function to make bottom window corners square for textured windows.
     9
     10        * WebKitSystemInterface.h:
     11        * libWebKitSystemInterfaceTiger.a:
     12        * libWebKitSystemInterfaceLeopard.a:
     13
    1142007-11-23  Adam Roben  <aroben@apple.com>
    215
  • trunk/WebKitLibraries/WebKitSystemInterface.h

    r27386 r28039  
    149149void WKNSWindowRestoreCGContext(NSWindow *, CGContextRef);
    150150
     151void WKNSWindowMakeBottomCornersSquare(NSWindow *);
     152
    151153BOOL WKSupportsMultipartXMixedReplace(NSMutableURLRequest *request);
    152154NSString* WKPathFromFont(NSFont *font);
Note: See TracChangeset for help on using the changeset viewer.