Land the new Inspector.
authoraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Jun 2007 01:37:24 +0000 (01:37 +0000)
committeraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Jun 2007 01:37:24 +0000 (01:37 +0000)
WebCore:

        Land the new Inspector.

        Co-written with Tim Hatcher.

        Reviewed by Anders, Adele, Hyatt, and Sam.

        No regression tests possible.

        Add a new InspectorController that is in charge of the Inspector. It
        has an InspectorClient that controls the Inspector's window and node
        highlight.

        * page/InspectorClient.h: Added.
        (WebCore::InspectorClient::~InspectorClient):
        * page/InspectorController.cpp: Added.
        (WebCore::ConsoleMessage::ConsoleMessage):
        (WebCore::InspectorResource::): Represents a single resource that the
        Inspector knows about.
        (WebCore::InspectorResource::InspectorResource):
        (WebCore::InspectorResource::~InspectorResource):
        (WebCore::InspectorResource::type):
        (WebCore::InspectorResource::setScriptObject):
        (WebCore::addSourceToFrame): Callback available from JS.
        (WebCore::getResourceDocumentNode): Ditto.
        (WebCore::highlightDOMNode): Ditto.
        (WebCore::hideDOMNodeHighlight): Ditto.
        (WebCore::loaded): Ditto.
        (WebCore::unloading): Ditto.
        (WebCore::attach): Ditto.
        (WebCore::detach): Ditto.
        (WebCore::log): Ditto.
        (WebCore::search): Ditto.
        (WebCore::inspectedWindow): Ditto.
        (WebCore::InspectorController::InspectorController):
        (WebCore::InspectorController::~InspectorController):
        (WebCore::InspectorController::inspect): Called by
        ContextMenuController to inspect a node.
        (WebCore::InspectorController::focusNode):
        (WebCore::InspectorController::highlight):
        (WebCore::InspectorController::hideHighlight):
        (WebCore::InspectorController::windowVisible):
        (WebCore::InspectorController::setWindowVisible):
        (WebCore::InspectorController::addMessageToConsole):
        (WebCore::InspectorController::attachWindow):
        (WebCore::InspectorController::detachWindow):
        (WebCore::InspectorController::windowScriptObjectAvailable):
        (WebCore::InspectorController::scriptObjectReady):
        (WebCore::InspectorController::windowUnloading):
        (WebCore::addHeaders): Static helper function.
        (WebCore::objectForRequest): Ditto.
        (WebCore::objectForResponse): Ditto.
        (WebCore::InspectorController::addScriptResource):
        (WebCore::InspectorController::addAndUpdateScriptResource):
        (WebCore::InspectorController::removeScriptResource):
        (WebCore::InspectorController::updateScriptResource):
        (WebCore::InspectorController::populateScriptResources):
        (WebCore::InspectorController::addScriptConsoleMessage):
        (WebCore::callClearFunction): Static helper function.
        (WebCore::InspectorController::clearScriptResources):
        (WebCore::InspectorController::clearScriptConsoleMessages):
        (WebCore::InspectorController::clearNetworkTimeline):
        (WebCore::InspectorController::pruneResources):
        (WebCore::InspectorController::didCommitLoad): Callback from
        FrameLoader.
        (WebCore::InspectorController::frameDetachedFromParent): Ditto.
        (WebCore::InspectorController::addResource): Ditto.
        (WebCore::InspectorController::removeResource): Ditto.
        (WebCore::InspectorController::didLoadResourceFromMemoryCache): Ditto.
        (WebCore::InspectorController::identifierForInitialRequest): Ditto.
        (WebCore::InspectorController::willSendRequest): Ditto.
        (WebCore::InspectorController::didReceiveResponse): Ditto.
        (WebCore::InspectorController::didReceiveContentLength): Ditto.
        (WebCore::InspectorController::didFinishLoading): Ditto.
        (WebCore::InspectorController::didFailLoading): Ditto.
        * page/InspectorController.h: Added.
        (WebCore::InspectorController::inspectedPage):
        (WebCore::InspectorController::scriptContext):
        (WebCore::InspectorController::setScriptContext):
        (WebCore::InspectorController::resources):
        (WebCore::InspectorController::removeAllResources):

        Add the JavaScript that defines most of the behavior of the Inspector.

        * page/inspector/ConsolePanel.js: Added.
        * page/inspector/NetworkPanel.js: Added.
        * page/inspector/Resource.js: Added.
        * page/inspector/ResourceCategory.js: Added.
        * page/inspector/ResourcePanel.js: Added.
        * page/inspector/inspector.js: Added.
        * page/inspector/treeoutline.js: Renamed from WebKit/WebInspector/webInspector/treeoutline.js.
        * page/inspector/utilities.js: Added.

        Add the Inspector's CSS and HTML.

        * page/inspector/inspector.css: Added.
        * page/inspector/inspector.html: Added.

        Hang the InspectorController off of Page. We only create an
        InspectorController if an InspectorClient is given to the Page.

        * page/Page.cpp:
        (WebCore::Page::Page):
        * page/Page.h:
        (WebCore::Page::inspectorController):

        Use FrameLoader to notify the InspectorController of resource loads.

        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::begin):
        (WebCore::FrameLoader::transitionToCommitted):
        (WebCore::FrameLoader::continueLoadAfterWillSubmitForm):
        (WebCore::FrameLoader::detachFromParent):
        (WebCore::FrameLoader::assignIdentifierToInitialRequest):
        (WebCore::FrameLoader::willSendRequest):
        (WebCore::FrameLoader::didReceiveResponse):
        (WebCore::FrameLoader::didReceiveData):
        (WebCore::FrameLoader::sendRemainingDelegateMessages):
        (WebCore::FrameLoader::requestFromDelegate):
        (WebCore::FrameLoader::didFinishLoad):
        (WebCore::FrameLoader::dispatchWindowObjectAvailable):
        (WebCore::FrameLoader::dispatchDidCommitLoad):
        (WebCore::FrameLoader::dispatchAssignIdentifierToInitialRequest):
        (WebCore::FrameLoader::dispatchWillSendRequest):
        (WebCore::FrameLoader::dispatchDidReceiveResponse):
        (WebCore::FrameLoader::dispatchDidReceiveContentLength):
        (WebCore::FrameLoader::dispatchDidFinishLoading):
        (WebCore::FrameLoader::dispatchDidLoadResourceFromMemoryCache):
        * loader/FrameLoader.h:

        Send console messages to the InspectorController.

        * page/Chrome.cpp:
        (WebCore::Chrome::addMessageToConsole): Send all console messages to
        the InspectorController.
        * page/Chrome.h: Add a new MessageLevel and MessageSource that are
        used in the Inspector JS.

        Report HTML errors when the Inspector window is open.
        We don't report errors when the window is closed because we don't want
        to slow down the HTMLTokenizer.

        * html/HTMLDocument.cpp:
        (WebCore::HTMLDocument::createTokenizer):
        * html/HTMLParser.cpp:
        (WebCore::HTMLParser::HTMLParser):
        * html/HTMLParser.h:
        * html/HTMLTokenizer.cpp:
        (WebCore::HTMLTokenizer::HTMLTokenizer):
        * html/HTMLTokenizer.h:

        Append the "Inspect Element" context menu item after passing the
        context menu to the ContextMenuClient. This work used to be done in
        WebKit.

        * page/ContextMenuClient.h:
        * page/ContextMenuController.cpp:
        (WebCore::ContextMenuController::handleContextMenuEvent): Add the
        "Inspect Element" item.
        (WebCore::ContextMenuController::contextMenuItemSelected): Handle the
        "Inspect Element" item.
        * platform/ContextMenu.cpp:
        (WebCore::ContextMenu::addInspectElementItem):
        (WebCore::ContextMenu::checkOrEnableIfNeeded): Updated for "Inspect
        Element" item.
        * platform/ContextMenu.h:
        * platform/ContextMenuItem.h:
        (WebCore::): Add ContextMenuItemTagInspectElement.
        * platform/graphics/svg/SVGImageEmptyClients.h:
        * page/mac/WebCoreViewFactory.h: Add the "Inspect Element" localized
        string.
        * platform/LocalizedStrings.h: Ditto.
        * platform/mac/LocalizedStringsMac.mm:
        (WebCore::contextMenuItemTagInspectElement): Ditto.

        Miscellaneous changes:

        * css/view-source.css: Add message bubble styles.
        * loader/DocumentLoader.h: Add a frame getter.
        * platform/win/ScrollViewWin.cpp:
        (WebCore::ScrollView::updateScrollbars): Respect
        Frame::prohibitsScrolling.

        Add new images needed for the Inspector.

        * page/inspector/Images/attachedShadow.png: Added.
        * page/inspector/Images/bottomShadow.png: Added.
        * page/inspector/Images/breadcrumbBackground.png: Added.
        * page/inspector/Images/checker.png: Added.
        * page/inspector/Images/console.png: Added.
        * page/inspector/Images/darkShadow.png: Added.
        * page/inspector/Images/disclosureDownPressed.png: Added.
        * page/inspector/Images/disclosureRightDown.png: Added.
        * page/inspector/Images/disclosureRightPressed.png: Added.
        * page/inspector/Images/document.png: Added.
        * page/inspector/Images/domViewButton.png: Added.
        * page/inspector/Images/domViewButtonSelected.png: Added.
        * page/inspector/Images/downTriangle.png: Added.
        * page/inspector/Images/errorIcon.png: Added.
        * page/inspector/Images/errorMediumIcon.png: Added.
        * page/inspector/Images/folder.png: Added.
        * page/inspector/Images/goArrow.png: Added.
        * page/inspector/Images/gradient.png: Added.
        * page/inspector/Images/gradientHighlight.png: Added.
        * page/inspector/Images/gradientHighlightBottom.png: Added.
        * page/inspector/Images/hideStatusWidget.png: Added.
        * page/inspector/Images/hideStatusWidgetPressed.png: Added.
        * page/inspector/Images/network.png: Added.
        * page/inspector/Images/paneBottomGrow.png: Added.
        * page/inspector/Images/paneBottomGrowActive.png: Added.
        * page/inspector/Images/paneGrowHandleLine.png: Added.
        * page/inspector/Images/paneHeader.png: Added.
        * page/inspector/Images/paneHeaderActive.png: Added.
        * page/inspector/Images/plainDocument.png: Added.
        * page/inspector/Images/popupArrows.png: Added.
        * page/inspector/Images/rightTriangle.png: Added.
        * page/inspector/Images/segment.png: Added.
        * page/inspector/Images/segmentEnd.png: Added.
        * page/inspector/Images/segmentHover.png: Added.
        * page/inspector/Images/segmentHoverEnd.png: Added.
        * page/inspector/Images/segmentSelected.png: Added.
        * page/inspector/Images/segmentSelectedEnd.png: Added.
        * page/inspector/Images/showStatusWidget.png: Added.
        * page/inspector/Images/showStatusWidgetPressed.png: Added.
        * page/inspector/Images/sidbarItemBackground.png: Added.
        * page/inspector/Images/sidebarActionWidget.png: Added.
        * page/inspector/Images/sidebarActionWidgetPressed.png: Added.
        * page/inspector/Images/sidebarAttachWidget.png: Added.
        * page/inspector/Images/sidebarAttachWidgetPressed.png: Added.
        * page/inspector/Images/sidebarDetachWidget.png: Added.
        * page/inspector/Images/sidebarDetachWidgetPressed.png: Added.
        * page/inspector/Images/sidebarResizeWidget.png: Added.
        * page/inspector/Images/sidebarSelection.png: Added.
        * page/inspector/Images/sidebarSelectionBlurred.png: Added.
        * page/inspector/Images/sidebarSelectionBlurredTall.png: Added.
        * page/inspector/Images/sidebarSelectionGray.png: Added.
        * page/inspector/Images/sidebarSelectionGrayTall.png: Added.
        * page/inspector/Images/sidebarSelectionTall.png: Added.
        * page/inspector/Images/sidebarStatusAreaBackground.png: Added.
        * page/inspector/Images/sourceViewButton.png: Added.
        * page/inspector/Images/sourceViewButtonSelected.png: Added.
        * page/inspector/Images/splitviewDimple.png: Added.
        * page/inspector/Images/splitviewDividerBackground.png: Added.
        * page/inspector/Images/tab.png: Added.
        * page/inspector/Images/tabSelected.png: Added.
        * page/inspector/Images/timelinePillBlue.png: Added.
        * page/inspector/Images/timelinePillGray.png: Added.
        * page/inspector/Images/timelinePillGreen.png: Added.
        * page/inspector/Images/timelinePillOrange.png: Added.
        * page/inspector/Images/timelinePillPurple.png: Added.
        * page/inspector/Images/timelinePillRed.png: Added.
        * page/inspector/Images/timelinePillYellow.png: Added.
        * page/inspector/Images/tipBalloon.png: Added.
        * page/inspector/Images/tipBalloonBottom.png: Added.
        * page/inspector/Images/tipIcon.png: Added.
        * page/inspector/Images/tipIconPressed.png: Added.
        * page/inspector/Images/toggleDown.png: Added.
        * page/inspector/Images/toggleUp.png: Added.
        * page/inspector/Images/toolbarBackground.png: Added.
        * page/inspector/Images/toolbarBackgroundInactive.png: Added.
        * page/inspector/Images/toolbarButton.png: Added.
        * page/inspector/Images/toolbarButtonInactive.png: Added.
        * page/inspector/Images/toolbarButtonPressed.png: Added.
        * page/inspector/Images/toolbarButtonPressedInactive.png: Added.
        * page/inspector/Images/toolbarSplitButtonDivider.png: Added.
        * page/inspector/Images/toolbarSplitButtonDividerInactive.png: Added.
        * page/inspector/Images/treeDownTriangleBlack.png: Added.
        * page/inspector/Images/treeDownTriangleWhite.png: Added.
        * page/inspector/Images/treeLeftTriangleBlack.png: Added.
        * page/inspector/Images/treeRightTriangleBlack.png: Added.
        * page/inspector/Images/treeRightTriangleWhite.png: Added.
        * page/inspector/Images/warningIcon.png: Added.
        * page/inspector/Images/warningMediumIcon.png: Added.
        * page/inspector/Images/warningsErrors.png: Added.

        Build-fu:

        * WebCore.exp: Added new symbols.
        * WebCore.xcodeproj/project.pbxproj: Added new source files and
        resources.
        * WebCore.vcproj/WebCore.vcproj: Ditto, and copy the resources to
        $WebKitOutputDir.

        Windows build fixes:

        * history/HistoryItem.h: ResourceRequest is a struct.
        * loader/FrameLoaderClient.h: Ditto.

WebKit:

        Land the new Inspector.

        Co-written with Tim Hatcher.

        Reviewed by Anders, Adele, Hyatt, and Sam.

        Implement the InspectorClient interface.

        * WebCoreSupport/WebInspectorClient.h: Added.
        * WebCoreSupport/WebInspectorClient.mm: Added.
        (WebInspectorClient::WebInspectorClient):
        (WebInspectorClient::inspectorDestroyed):
        (WebInspectorClient::createPage):
        (WebInspectorClient::showWindow):
        (WebInspectorClient::closeWindow):
        (WebInspectorClient::attachWindow):
        (WebInspectorClient::detachWindow):
        (WebInspectorClient::highlight):
        (WebInspectorClient::hideHighlight):
        (WebInspectorClient::inspectedURLChanged):
        (WebInspectorClient::updateWindowTitle):
        (-[WebInspectorWindowController init]):
        (-[WebInspectorWindowController initWithInspectedWebView:]):
        (-[WebInspectorWindowController dealloc]):
        (-[WebInspectorWindowController inspectorVisible]):
        (-[WebInspectorWindowController webView]):
        (-[WebInspectorWindowController window]):
        (-[WebInspectorWindowController windowShouldClose:]):
        (-[WebInspectorWindowController close]):
        (-[WebInspectorWindowController showWindow:]):
        (-[WebInspectorWindowController attach]):
        (-[WebInspectorWindowController detach]):
        (-[WebInspectorWindowController highlightAndScrollToNode:]):
        (-[WebInspectorWindowController highlightNode:]):
        (-[WebInspectorWindowController hideHighlight]):
        (-[WebInspectorWindowController animationDidEnd:]):

        Add an easier-to-see highlight.

        * Misc/WebNSViewExtras.h:
        * Misc/WebNSViewExtras.m:
        (-[NSView _web_convertRect:toView:]):
        * WebInspector/WebNodeHighlight.h:
        * WebInspector/WebNodeHighlight.m:
        (-[WebNodeHighlightFadeInAnimation setCurrentProgress:]):
        (-[WebNodeHighlight initWithTargetView:]):
        (-[WebNodeHighlight setHighlightedNode:]):
        (-[WebNodeHighlight highlightedNode]):
        (-[WebNodeHighlight dealloc]):
        (-[WebNodeHighlight attachHighlight]):
        (-[WebNodeHighlight delegate]):
        (-[WebNodeHighlight detachHighlight]):
        (-[WebNodeHighlight show]):
        (-[WebNodeHighlight hide]):
        (-[WebNodeHighlight animationDidEnd:]):
        (-[WebNodeHighlight ignoresMouseEvents]):
        (-[WebNodeHighlight highlightView]):
        (-[WebNodeHighlight setDelegate:]):
        (-[WebNodeHighlight setHolesNeedUpdateInTargetViewRect:]):
        (-[WebNodeHighlight setIgnoresMouseEvents:]):
        (-[WebNodeHighlight targetView]):
        (-[WebNodeHighlight _computeHighlightWindowFrame]):
        (-[WebNodeHighlight _repositionHighlightWindow]):
        * WebInspector/WebNodeHighlightView.h:
        * WebInspector/WebNodeHighlightView.m:
        (-[WebNodeHighlightView initWithWebNodeHighlight:]):
        (-[WebNodeHighlightView dealloc]):
        (-[WebNodeHighlightView detachFromWebNodeHighlight]):
        (-[WebNodeHighlightView drawRect:]):
        (-[WebNodeHighlightView webNodeHighlight]):
        (-[WebNodeHighlightView fractionFadedIn]):
        (-[WebNodeHighlightView setFractionFadedIn:]):
        (-[WebNodeHighlightView setHolesNeedUpdateInRect:]):
        (-[WebNodeHighlightView _holes]):

        WebView changes needed for the new Inspector.

        * WebView/WebView.mm: Remove the old _inspectElement method now that
        this is handled by WebCore.
        (-[WebView _isClosed]): Added.
        (-[WebView initWithFrame]): Give each Page an InspectorClient to
        enable the Inspector.
        * WebView/WebViewPrivate.h:

        Updates needed for WebCore changes.

        * WebCoreSupport/WebContextMenuClient.h:
        * WebCoreSupport/WebContextMenuClient.mm:
        * WebCoreSupport/WebViewFactory.mm:
        (-[WebViewFactory contextMenuItemTagInspectElement]):
        * WebView/WebUIDelegatePrivate.h:

        Remove old Inspector code.

        * WebCoreSupport/WebFrameLoaderClient.mm:
        (WebFrameLoaderClient::dispatchDidLoadResourceFromMemoryCache):
        (WebFrameLoaderClient::assignIdentifierToInitialRequest):
        (WebFrameLoaderClient::dispatchDidFinishLoading):
        * WebInspector/WebInspector.m: Removed.
        * WebInspector/WebInspectorPanel.h: Removed.
        * WebInspector/WebInspectorPanel.m: Removed.
        * WebInspector/webInspector/Images/button.png: Removed.
        * WebInspector/webInspector/Images/buttonDivider.png: Removed.
        * WebInspector/webInspector/Images/buttonPressed.png: Removed.
        * WebInspector/webInspector/Images/close.png: Removed.
        * WebInspector/webInspector/Images/closePressed.png: Removed.
        * WebInspector/webInspector/Images/downTriangle.png: Removed.
        * WebInspector/webInspector/Images/menu.png: Removed.
        * WebInspector/webInspector/Images/menuPressed.png: Removed.
        * WebInspector/webInspector/Images/popup.png: Removed.
        * WebInspector/webInspector/Images/popupPressed.png: Removed.
        * WebInspector/webInspector/Images/resize.png: Removed.
        * WebInspector/webInspector/Images/rightTriangle.png: Removed.
        * WebInspector/webInspector/Images/scrollThumbBottom.png: Removed.
        * WebInspector/webInspector/Images/scrollThumbMiddle.png: Removed.
        * WebInspector/webInspector/Images/scrollTrackBottom.png: Removed.
        * WebInspector/webInspector/Images/upTriangle.png: Removed.
        * WebInspector/webInspector/inspector.css: Removed.
        * WebInspector/webInspector/inspector.html: Removed.
        * WebInspector/webInspector/inspector.js: Removed.
        * WebInspector/webInspector/scrollarea.js: Removed.
        * WebInspector/webInspector/scrollbar.js: Removed.
        * WebInspector/webInspector/utilities.js: Removed.
        * WebView/WebFrame.mm:
        (-[WebFramePrivate dealloc]):
        * WebView/WebFrameInternal.h:
        * WebView/WebHTMLView.mm:
        (-[WebHTMLView menuForEvent:]):

        Build-fu:

        * WebKit.exp:
        * WebKit.xcodeproj/project.pbxproj:

WebKit/win:

        Land the new Inspector.

        Co-written with Tim Hatcher.

        Reviewed by Anders, Adele, Hyatt, and Sam.

        Implement the InspectorClient interface.

        * WebInspectorClient.cpp: Added.
        (WebInspectorClient::WebInspectorClient):
        (WebInspectorClient::~WebInspectorClient):
        (WebInspectorClient::inspectorDestroyed):
        (WebInspectorClient::createPage):
        (WebInspectorClient::showWindow):
        (WebInspectorClient::closeWindow):
        (WebInspectorClient::windowVisible):
        (WebInspectorClient::attachWindow):
        (WebInspectorClient::detachWindow):
        (WebInspectorClient::highlight):
        (WebInspectorClient::hideHighlight):
        (WebInspectorClient::inspectedURLChanged):
        (WebInspectorClient::updateWindowTitle):
        (WebInspectorClient::onSize):
        (WebInspectorClient::onClose):
        (WebInspectorClient::onWebViewWindowPosChanging):
        (WebInspectorWndProc):
        (SubclassedWebViewWndProc):
        (registerWindowClass):
        * WebInspectorClient.h: Added.

        Add an easier-to-see highlight.

        * WebNodeHighlight.cpp: Added.
        (WebNodeHighlight::WebNodeHighlight):
        (WebNodeHighlight::~WebNodeHighlight):
        (WebNodeHighlight::highlight):
        (WebNodeHighlight::hide):
        (WebNodeHighlight::visible):
        (WebNodeHighlight::updateWindow):
        (WebNodeHighlight::removeSubclass):
        (registerOverlayClass):
        (OverlayWndProc):
        (SubclassedWndProc):
        * WebNodeHighlight.h: Added.

        WebView changes needed for the new Inspector.

        * WebView.cpp: Removed old inspectElement method now that this is
        handled by WebCore.
        (WebView::WebView):
        (WebView::close):
        (WebView::performContextMenuAction): Removed handling of the Inspect
        Element context menu item.
        (WebView::initWithFrame): Give each Page an InspectorClient to enable
        the Inspector.
        (WebView::setProhibitsMainFrameScrolling): Added.
        * WebView.h:

        Updates needed for WebCore changes.

        * Interfaces/IWebUIDelegate.idl:
        * WebContextMenuClient.cpp:
        (WebContextMenuClient::getCustomMenuFromDefaultItems):
        * WebContextMenuClient.h:
        * WebCoreLocalizedStrings.cpp:

        Remove old Inspector code.

        * WebFrame.cpp:
        * WebFrame.h:
        * WebInspector/WebInspector.cpp: Removed.
        * WebInspector/WebInspector.h: Removed.
        * WebInspector/webInspector/Images/button.png: Removed.
        * WebInspector/webInspector/Images/buttonDivider.png: Removed.
        * WebInspector/webInspector/Images/buttonPressed.png: Removed.
        * WebInspector/webInspector/Images/close.png: Removed.
        * WebInspector/webInspector/Images/closePressed.png: Removed.
        * WebInspector/webInspector/Images/downTriangle.png: Removed.
        * WebInspector/webInspector/Images/menu.png: Removed.
        * WebInspector/webInspector/Images/menuPressed.png: Removed.
        * WebInspector/webInspector/Images/popup.png: Removed.
        * WebInspector/webInspector/Images/popupPressed.png: Removed.
        * WebInspector/webInspector/Images/resize.png: Removed.
        * WebInspector/webInspector/Images/rightTriangle.png: Removed.
        * WebInspector/webInspector/Images/scrollThumbBottom.png: Removed.
        * WebInspector/webInspector/Images/scrollThumbMiddle.png: Removed.
        * WebInspector/webInspector/Images/scrollTrackMiddle.png: Removed.
        * WebInspector/webInspector/Images/upTriangle.png: Removed.
        * WebInspector/webInspector/inspector.css: Removed.
        * WebInspector/webInspector/inspector.html: Removed.
        * WebInspector/webInspector/inspector.js: Removed.
        * WebInspector/webInspector/scrollarea.js: Removed.
        * WebInspector/webInspector/scrollbar.js: Removed.
        * WebInspector/webInspector/treeoutline.js: Removed.
        * WebInspector/webInspector/utilities.js: Removed.

        Build-fu:

        * WebKit.vcproj/WebKit.vcproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@23677 268f45cc-cd09-0410-ab3c-d52691b4dbfc

217 files changed:
WebCore/ChangeLog
WebCore/WebCore.exp
WebCore/WebCore.vcproj/WebCore.vcproj
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/css/view-source.css
WebCore/history/HistoryItem.h
WebCore/html/HTMLDocument.cpp
WebCore/html/HTMLParser.cpp
WebCore/html/HTMLParser.h
WebCore/html/HTMLTokenizer.cpp
WebCore/html/HTMLTokenizer.h
WebCore/loader/DocumentLoader.h
WebCore/loader/FrameLoader.cpp
WebCore/loader/FrameLoader.h
WebCore/loader/FrameLoaderClient.h
WebCore/page/Chrome.cpp
WebCore/page/Chrome.h
WebCore/page/ContextMenuClient.h
WebCore/page/ContextMenuController.cpp
WebCore/page/InspectorClient.h [new file with mode: 0644]
WebCore/page/InspectorController.cpp [new file with mode: 0644]
WebCore/page/InspectorController.h [new file with mode: 0644]
WebCore/page/Page.cpp
WebCore/page/Page.h
WebCore/page/inspector/ConsolePanel.js [new file with mode: 0644]
WebCore/page/inspector/Images/attachedShadow.png [new file with mode: 0644]
WebCore/page/inspector/Images/bottomShadow.png [new file with mode: 0644]
WebCore/page/inspector/Images/breadcrumbBackground.png [new file with mode: 0644]
WebCore/page/inspector/Images/checker.png [new file with mode: 0644]
WebCore/page/inspector/Images/console.png [new file with mode: 0644]
WebCore/page/inspector/Images/darkShadow.png [new file with mode: 0644]
WebCore/page/inspector/Images/disclosureDownPressed.png [new file with mode: 0644]
WebCore/page/inspector/Images/disclosureRightDown.png [new file with mode: 0644]
WebCore/page/inspector/Images/disclosureRightPressed.png [new file with mode: 0644]
WebCore/page/inspector/Images/document.png [new file with mode: 0644]
WebCore/page/inspector/Images/domViewButton.png [new file with mode: 0644]
WebCore/page/inspector/Images/domViewButtonSelected.png [new file with mode: 0644]
WebCore/page/inspector/Images/downTriangle.png [new file with mode: 0644]
WebCore/page/inspector/Images/errorIcon.png [new file with mode: 0644]
WebCore/page/inspector/Images/errorMediumIcon.png [new file with mode: 0644]
WebCore/page/inspector/Images/folder.png [new file with mode: 0644]
WebCore/page/inspector/Images/goArrow.png [new file with mode: 0644]
WebCore/page/inspector/Images/gradient.png [new file with mode: 0644]
WebCore/page/inspector/Images/gradientHighlight.png [new file with mode: 0644]
WebCore/page/inspector/Images/gradientHighlightBottom.png [new file with mode: 0644]
WebCore/page/inspector/Images/hideStatusWidget.png [new file with mode: 0644]
WebCore/page/inspector/Images/hideStatusWidgetPressed.png [new file with mode: 0644]
WebCore/page/inspector/Images/network.png [new file with mode: 0644]
WebCore/page/inspector/Images/paneBottomGrow.png [new file with mode: 0644]
WebCore/page/inspector/Images/paneBottomGrowActive.png [new file with mode: 0644]
WebCore/page/inspector/Images/paneGrowHandleLine.png [new file with mode: 0644]
WebCore/page/inspector/Images/paneHeader.png [new file with mode: 0644]
WebCore/page/inspector/Images/paneHeaderActive.png [new file with mode: 0644]
WebCore/page/inspector/Images/plainDocument.png [new file with mode: 0644]
WebCore/page/inspector/Images/popupArrows.png [new file with mode: 0644]
WebCore/page/inspector/Images/rightTriangle.png [new file with mode: 0644]
WebCore/page/inspector/Images/segment.png [new file with mode: 0644]
WebCore/page/inspector/Images/segmentEnd.png [new file with mode: 0644]
WebCore/page/inspector/Images/segmentHover.png [new file with mode: 0644]
WebCore/page/inspector/Images/segmentHoverEnd.png [new file with mode: 0644]
WebCore/page/inspector/Images/segmentSelected.png [new file with mode: 0644]
WebCore/page/inspector/Images/segmentSelectedEnd.png [new file with mode: 0644]
WebCore/page/inspector/Images/showStatusWidget.png [new file with mode: 0644]
WebCore/page/inspector/Images/showStatusWidgetPressed.png [new file with mode: 0644]
WebCore/page/inspector/Images/sidbarItemBackground.png [new file with mode: 0644]
WebCore/page/inspector/Images/sidebarActionWidget.png [new file with mode: 0644]
WebCore/page/inspector/Images/sidebarActionWidgetPressed.png [new file with mode: 0644]
WebCore/page/inspector/Images/sidebarAttachWidget.png [new file with mode: 0644]
WebCore/page/inspector/Images/sidebarAttachWidgetPressed.png [new file with mode: 0644]
WebCore/page/inspector/Images/sidebarDetachWidget.png [new file with mode: 0644]
WebCore/page/inspector/Images/sidebarDetachWidgetPressed.png [new file with mode: 0644]
WebCore/page/inspector/Images/sidebarResizeWidget.png [new file with mode: 0644]
WebCore/page/inspector/Images/sidebarSelection.png [new file with mode: 0644]
WebCore/page/inspector/Images/sidebarSelectionBlurred.png [new file with mode: 0644]
WebCore/page/inspector/Images/sidebarSelectionBlurredTall.png [new file with mode: 0644]
WebCore/page/inspector/Images/sidebarSelectionGray.png [new file with mode: 0644]
WebCore/page/inspector/Images/sidebarSelectionGrayTall.png [new file with mode: 0644]
WebCore/page/inspector/Images/sidebarSelectionTall.png [new file with mode: 0644]
WebCore/page/inspector/Images/sidebarStatusAreaBackground.png [new file with mode: 0644]
WebCore/page/inspector/Images/sourceViewButton.png [new file with mode: 0644]
WebCore/page/inspector/Images/sourceViewButtonSelected.png [new file with mode: 0644]
WebCore/page/inspector/Images/splitviewDimple.png [new file with mode: 0644]
WebCore/page/inspector/Images/splitviewDividerBackground.png [new file with mode: 0644]
WebCore/page/inspector/Images/tab.png [new file with mode: 0644]
WebCore/page/inspector/Images/tabSelected.png [new file with mode: 0644]
WebCore/page/inspector/Images/timelinePillBlue.png [moved from WebKit/WebInspector/webInspector/Images/scrollTrackBottom.png with 76% similarity]
WebCore/page/inspector/Images/timelinePillGray.png [moved from WebKit/WebInspector/webInspector/Images/scrollThumbBottom.png with 77% similarity]
WebCore/page/inspector/Images/timelinePillGreen.png [new file with mode: 0644]
WebCore/page/inspector/Images/timelinePillOrange.png [new file with mode: 0644]
WebCore/page/inspector/Images/timelinePillPurple.png [new file with mode: 0644]
WebCore/page/inspector/Images/timelinePillRed.png [moved from WebKit/WebInspector/webInspector/Images/scrollThumbTop.png with 76% similarity]
WebCore/page/inspector/Images/timelinePillYellow.png [moved from WebKit/WebInspector/webInspector/Images/scrollThumbMiddle.png with 76% similarity]
WebCore/page/inspector/Images/tipBalloon.png [new file with mode: 0644]
WebCore/page/inspector/Images/tipBalloonBottom.png [new file with mode: 0644]
WebCore/page/inspector/Images/tipIcon.png [new file with mode: 0644]
WebCore/page/inspector/Images/tipIconPressed.png [new file with mode: 0644]
WebCore/page/inspector/Images/toggleDown.png [new file with mode: 0644]
WebCore/page/inspector/Images/toggleUp.png [new file with mode: 0644]
WebCore/page/inspector/Images/toolbarBackground.png [new file with mode: 0644]
WebCore/page/inspector/Images/toolbarBackgroundInactive.png [new file with mode: 0644]
WebCore/page/inspector/Images/toolbarButton.png [new file with mode: 0644]
WebCore/page/inspector/Images/toolbarButtonInactive.png [new file with mode: 0644]
WebCore/page/inspector/Images/toolbarButtonPressed.png [new file with mode: 0644]
WebCore/page/inspector/Images/toolbarButtonPressedInactive.png [new file with mode: 0644]
WebCore/page/inspector/Images/toolbarSplitButtonDivider.png [new file with mode: 0644]
WebCore/page/inspector/Images/toolbarSplitButtonDividerInactive.png [new file with mode: 0644]
WebCore/page/inspector/Images/treeDownTriangleBlack.png [new file with mode: 0644]
WebCore/page/inspector/Images/treeDownTriangleWhite.png [new file with mode: 0644]
WebCore/page/inspector/Images/treeLeftTriangleBlack.png [new file with mode: 0644]
WebCore/page/inspector/Images/treeRightTriangleBlack.png [new file with mode: 0644]
WebCore/page/inspector/Images/treeRightTriangleWhite.png [new file with mode: 0644]
WebCore/page/inspector/Images/warningIcon.png [new file with mode: 0644]
WebCore/page/inspector/Images/warningMediumIcon.png [new file with mode: 0644]
WebCore/page/inspector/Images/warningsErrors.png [new file with mode: 0644]
WebCore/page/inspector/NetworkPanel.js [new file with mode: 0644]
WebCore/page/inspector/Resource.js [new file with mode: 0644]
WebCore/page/inspector/ResourceCategory.js [new file with mode: 0644]
WebCore/page/inspector/ResourcePanel.js [new file with mode: 0644]
WebCore/page/inspector/inspector.css [new file with mode: 0644]
WebCore/page/inspector/inspector.html [new file with mode: 0644]
WebCore/page/inspector/inspector.js [new file with mode: 0644]
WebCore/page/inspector/treeoutline.js [moved from WebKit/WebInspector/webInspector/treeoutline.js with 68% similarity]
WebCore/page/inspector/utilities.js [moved from WebKit/WebInspector/webInspector/utilities.js with 53% similarity]
WebCore/page/mac/WebCoreViewFactory.h
WebCore/platform/ContextMenu.cpp
WebCore/platform/ContextMenu.h
WebCore/platform/ContextMenuItem.h
WebCore/platform/LocalizedStrings.h
WebCore/platform/graphics/svg/SVGImageEmptyClients.h
WebCore/platform/mac/LocalizedStringsMac.mm
WebCore/platform/win/ScrollViewWin.cpp
WebKit/ChangeLog
WebKit/Misc/WebNSViewExtras.h
WebKit/Misc/WebNSViewExtras.m
WebKit/WebCoreSupport/WebContextMenuClient.h
WebKit/WebCoreSupport/WebContextMenuClient.mm
WebKit/WebCoreSupport/WebFrameLoaderClient.mm
WebKit/WebCoreSupport/WebInspectorClient.h [moved from WebKit/WebInspector/WebInspectorInternal.h with 67% similarity]
WebKit/WebCoreSupport/WebInspectorClient.mm [new file with mode: 0644]
WebKit/WebCoreSupport/WebViewFactory.mm
WebKit/WebInspector/WebInspector.m [deleted file]
WebKit/WebInspector/WebInspectorPanel.h [deleted file]
WebKit/WebInspector/WebInspectorPanel.m [deleted file]
WebKit/WebInspector/WebNodeHighlight.h
WebKit/WebInspector/WebNodeHighlight.m
WebKit/WebInspector/WebNodeHighlightView.h
WebKit/WebInspector/WebNodeHighlightView.m
WebKit/WebInspector/webInspector/Images/button.png [deleted file]
WebKit/WebInspector/webInspector/Images/buttonDivider.png [deleted file]
WebKit/WebInspector/webInspector/Images/buttonPressed.png [deleted file]
WebKit/WebInspector/webInspector/Images/close.png [deleted file]
WebKit/WebInspector/webInspector/Images/closePressed.png [deleted file]
WebKit/WebInspector/webInspector/Images/downTriangle.png [deleted file]
WebKit/WebInspector/webInspector/Images/menu.png [deleted file]
WebKit/WebInspector/webInspector/Images/menuPressed.png [deleted file]
WebKit/WebInspector/webInspector/Images/popup.png [deleted file]
WebKit/WebInspector/webInspector/Images/popupPressed.png [deleted file]
WebKit/WebInspector/webInspector/Images/resize.png [deleted file]
WebKit/WebInspector/webInspector/Images/rightTriangle.png [deleted file]
WebKit/WebInspector/webInspector/Images/scrollTrackMiddle.png [deleted file]
WebKit/WebInspector/webInspector/Images/scrollTrackTop.png [deleted file]
WebKit/WebInspector/webInspector/Images/upTriangle.png [deleted file]
WebKit/WebInspector/webInspector/inspector.css [deleted file]
WebKit/WebInspector/webInspector/inspector.html [deleted file]
WebKit/WebInspector/webInspector/inspector.js [deleted file]
WebKit/WebInspector/webInspector/scrollarea.js [deleted file]
WebKit/WebInspector/webInspector/scrollbar.js [deleted file]
WebKit/WebKit.exp
WebKit/WebKit.xcodeproj/project.pbxproj
WebKit/WebView/WebFrame.mm
WebKit/WebView/WebFrameInternal.h
WebKit/WebView/WebHTMLView.mm
WebKit/WebView/WebUIDelegatePrivate.h
WebKit/WebView/WebView.mm
WebKit/WebView/WebViewPrivate.h
WebKit/win/ChangeLog
WebKit/win/Interfaces/IWebUIDelegate.idl
WebKit/win/WebContextMenuClient.cpp
WebKit/win/WebContextMenuClient.h
WebKit/win/WebCoreLocalizedStrings.cpp
WebKit/win/WebFrame.cpp
WebKit/win/WebFrame.h
WebKit/win/WebInspector/WebInspector.cpp [deleted file]
WebKit/win/WebInspector/WebInspector.h [deleted file]
WebKit/win/WebInspector/webInspector/Images/button.png [deleted file]
WebKit/win/WebInspector/webInspector/Images/buttonDivider.png [deleted file]
WebKit/win/WebInspector/webInspector/Images/buttonPressed.png [deleted file]
WebKit/win/WebInspector/webInspector/Images/close.png [deleted file]
WebKit/win/WebInspector/webInspector/Images/closePressed.png [deleted file]
WebKit/win/WebInspector/webInspector/Images/downTriangle.png [deleted file]
WebKit/win/WebInspector/webInspector/Images/menu.png [deleted file]
WebKit/win/WebInspector/webInspector/Images/menuPressed.png [deleted file]
WebKit/win/WebInspector/webInspector/Images/popup.png [deleted file]
WebKit/win/WebInspector/webInspector/Images/popupPressed.png [deleted file]
WebKit/win/WebInspector/webInspector/Images/resize.png [deleted file]
WebKit/win/WebInspector/webInspector/Images/rightTriangle.png [deleted file]
WebKit/win/WebInspector/webInspector/Images/scrollThumbBottom.png [deleted file]
WebKit/win/WebInspector/webInspector/Images/scrollThumbMiddle.png [deleted file]
WebKit/win/WebInspector/webInspector/Images/scrollThumbTop.png [deleted file]
WebKit/win/WebInspector/webInspector/Images/scrollTrackBottom.png [deleted file]
WebKit/win/WebInspector/webInspector/Images/scrollTrackMiddle.png [deleted file]
WebKit/win/WebInspector/webInspector/Images/scrollTrackTop.png [deleted file]
WebKit/win/WebInspector/webInspector/Images/upTriangle.png [deleted file]
WebKit/win/WebInspector/webInspector/inspector.css [deleted file]
WebKit/win/WebInspector/webInspector/inspector.html [deleted file]
WebKit/win/WebInspector/webInspector/inspector.js [deleted file]
WebKit/win/WebInspector/webInspector/scrollarea.js [deleted file]
WebKit/win/WebInspector/webInspector/scrollbar.js [deleted file]
WebKit/win/WebInspector/webInspector/treeoutline.js [deleted file]
WebKit/win/WebInspector/webInspector/utilities.js [deleted file]
WebKit/win/WebInspectorClient.cpp [new file with mode: 0644]
WebKit/win/WebInspectorClient.h [new file with mode: 0644]
WebKit/win/WebKit.vcproj/WebKit.vcproj
WebKit/win/WebNodeHighlight.cpp [new file with mode: 0644]
WebKit/win/WebNodeHighlight.h [moved from WebKit/WebInspector/WebInspector.h with 66% similarity]
WebKit/win/WebView.cpp
WebKit/win/WebView.h

index 3c75901ca56eac91cfd45d67763fc6e32bb72232..889111e3690497da73fe2b773302d8180492753e 100644 (file)
@@ -1,3 +1,292 @@
+2007-06-20  Adam Roben  <aroben@apple.com>
+
+        Land the new Inspector.
+
+        Co-written with Tim Hatcher.
+
+        Reviewed by Anders, Adele, Hyatt, and Sam.
+
+        No regression tests possible.
+
+        Add a new InspectorController that is in charge of the Inspector. It
+        has an InspectorClient that controls the Inspector's window and node
+        highlight.
+
+        * page/InspectorClient.h: Added.
+        (WebCore::InspectorClient::~InspectorClient):
+        * page/InspectorController.cpp: Added.
+        (WebCore::ConsoleMessage::ConsoleMessage):
+        (WebCore::InspectorResource::): Represents a single resource that the
+        Inspector knows about.
+        (WebCore::InspectorResource::InspectorResource):
+        (WebCore::InspectorResource::~InspectorResource):
+        (WebCore::InspectorResource::type):
+        (WebCore::InspectorResource::setScriptObject):
+        (WebCore::addSourceToFrame): Callback available from JS.
+        (WebCore::getResourceDocumentNode): Ditto.
+        (WebCore::highlightDOMNode): Ditto.
+        (WebCore::hideDOMNodeHighlight): Ditto.
+        (WebCore::loaded): Ditto.
+        (WebCore::unloading): Ditto.
+        (WebCore::attach): Ditto.
+        (WebCore::detach): Ditto.
+        (WebCore::log): Ditto.
+        (WebCore::search): Ditto.
+        (WebCore::inspectedWindow): Ditto.
+        (WebCore::InspectorController::InspectorController):
+        (WebCore::InspectorController::~InspectorController):
+        (WebCore::InspectorController::inspect): Called by
+        ContextMenuController to inspect a node.
+        (WebCore::InspectorController::focusNode):
+        (WebCore::InspectorController::highlight):
+        (WebCore::InspectorController::hideHighlight):
+        (WebCore::InspectorController::windowVisible):
+        (WebCore::InspectorController::setWindowVisible):
+        (WebCore::InspectorController::addMessageToConsole):
+        (WebCore::InspectorController::attachWindow):
+        (WebCore::InspectorController::detachWindow):
+        (WebCore::InspectorController::windowScriptObjectAvailable):
+        (WebCore::InspectorController::scriptObjectReady):
+        (WebCore::InspectorController::windowUnloading):
+        (WebCore::addHeaders): Static helper function.
+        (WebCore::objectForRequest): Ditto.
+        (WebCore::objectForResponse): Ditto.
+        (WebCore::InspectorController::addScriptResource):
+        (WebCore::InspectorController::addAndUpdateScriptResource):
+        (WebCore::InspectorController::removeScriptResource):
+        (WebCore::InspectorController::updateScriptResource):
+        (WebCore::InspectorController::populateScriptResources):
+        (WebCore::InspectorController::addScriptConsoleMessage):
+        (WebCore::callClearFunction): Static helper function.
+        (WebCore::InspectorController::clearScriptResources):
+        (WebCore::InspectorController::clearScriptConsoleMessages):
+        (WebCore::InspectorController::clearNetworkTimeline):
+        (WebCore::InspectorController::pruneResources):
+        (WebCore::InspectorController::didCommitLoad): Callback from
+        FrameLoader.
+        (WebCore::InspectorController::frameDetachedFromParent): Ditto.
+        (WebCore::InspectorController::addResource): Ditto.
+        (WebCore::InspectorController::removeResource): Ditto.
+        (WebCore::InspectorController::didLoadResourceFromMemoryCache): Ditto.
+        (WebCore::InspectorController::identifierForInitialRequest): Ditto.
+        (WebCore::InspectorController::willSendRequest): Ditto.
+        (WebCore::InspectorController::didReceiveResponse): Ditto.
+        (WebCore::InspectorController::didReceiveContentLength): Ditto.
+        (WebCore::InspectorController::didFinishLoading): Ditto.
+        (WebCore::InspectorController::didFailLoading): Ditto.
+        * page/InspectorController.h: Added.
+        (WebCore::InspectorController::inspectedPage):
+        (WebCore::InspectorController::scriptContext):
+        (WebCore::InspectorController::setScriptContext):
+        (WebCore::InspectorController::resources):
+        (WebCore::InspectorController::removeAllResources):
+
+        Add the JavaScript that defines most of the behavior of the Inspector.
+        
+        * page/inspector/ConsolePanel.js: Added.
+        * page/inspector/NetworkPanel.js: Added.
+        * page/inspector/Resource.js: Added.
+        * page/inspector/ResourceCategory.js: Added.
+        * page/inspector/ResourcePanel.js: Added.
+        * page/inspector/inspector.js: Added.
+        * page/inspector/treeoutline.js: Renamed from WebKit/WebInspector/webInspector/treeoutline.js.
+        * page/inspector/utilities.js: Added.
+
+        Add the Inspector's CSS and HTML.
+
+        * page/inspector/inspector.css: Added.
+        * page/inspector/inspector.html: Added.
+
+        Hang the InspectorController off of Page. We only create an
+        InspectorController if an InspectorClient is given to the Page.
+
+        * page/Page.cpp:
+        (WebCore::Page::Page):
+        * page/Page.h:
+        (WebCore::Page::inspectorController):
+
+        Use FrameLoader to notify the InspectorController of resource loads.
+
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::begin):
+        (WebCore::FrameLoader::transitionToCommitted):
+        (WebCore::FrameLoader::continueLoadAfterWillSubmitForm):
+        (WebCore::FrameLoader::detachFromParent):
+        (WebCore::FrameLoader::assignIdentifierToInitialRequest):
+        (WebCore::FrameLoader::willSendRequest):
+        (WebCore::FrameLoader::didReceiveResponse):
+        (WebCore::FrameLoader::didReceiveData):
+        (WebCore::FrameLoader::sendRemainingDelegateMessages):
+        (WebCore::FrameLoader::requestFromDelegate):
+        (WebCore::FrameLoader::didFinishLoad):
+        (WebCore::FrameLoader::dispatchWindowObjectAvailable):
+        (WebCore::FrameLoader::dispatchDidCommitLoad):
+        (WebCore::FrameLoader::dispatchAssignIdentifierToInitialRequest):
+        (WebCore::FrameLoader::dispatchWillSendRequest):
+        (WebCore::FrameLoader::dispatchDidReceiveResponse):
+        (WebCore::FrameLoader::dispatchDidReceiveContentLength):
+        (WebCore::FrameLoader::dispatchDidFinishLoading):
+        (WebCore::FrameLoader::dispatchDidLoadResourceFromMemoryCache):
+        * loader/FrameLoader.h:
+
+        Send console messages to the InspectorController.
+
+        * page/Chrome.cpp:
+        (WebCore::Chrome::addMessageToConsole): Send all console messages to
+        the InspectorController.
+        * page/Chrome.h: Add a new MessageLevel and MessageSource that are
+        used in the Inspector JS.
+
+        Report HTML errors when the Inspector window is open.
+        We don't report errors when the window is closed because we don't want
+        to slow down the HTMLTokenizer.
+
+        * html/HTMLDocument.cpp:
+        (WebCore::HTMLDocument::createTokenizer):
+        * html/HTMLParser.cpp:
+        (WebCore::HTMLParser::HTMLParser):
+        * html/HTMLParser.h:
+        * html/HTMLTokenizer.cpp:
+        (WebCore::HTMLTokenizer::HTMLTokenizer):
+        * html/HTMLTokenizer.h:
+
+        Append the "Inspect Element" context menu item after passing the
+        context menu to the ContextMenuClient. This work used to be done in
+        WebKit.
+
+        * page/ContextMenuClient.h:
+        * page/ContextMenuController.cpp:
+        (WebCore::ContextMenuController::handleContextMenuEvent): Add the
+        "Inspect Element" item.
+        (WebCore::ContextMenuController::contextMenuItemSelected): Handle the
+        "Inspect Element" item.
+        * platform/ContextMenu.cpp:
+        (WebCore::ContextMenu::addInspectElementItem):
+        (WebCore::ContextMenu::checkOrEnableIfNeeded): Updated for "Inspect
+        Element" item.
+        * platform/ContextMenu.h:
+        * platform/ContextMenuItem.h:
+        (WebCore::): Add ContextMenuItemTagInspectElement.
+        * platform/graphics/svg/SVGImageEmptyClients.h:
+        * page/mac/WebCoreViewFactory.h: Add the "Inspect Element" localized
+        string.
+        * platform/LocalizedStrings.h: Ditto.
+        * platform/mac/LocalizedStringsMac.mm:
+        (WebCore::contextMenuItemTagInspectElement): Ditto.
+
+        Miscellaneous changes:
+
+        * css/view-source.css: Add message bubble styles.
+        * loader/DocumentLoader.h: Add a frame getter.
+        * platform/win/ScrollViewWin.cpp:
+        (WebCore::ScrollView::updateScrollbars): Respect
+        Frame::prohibitsScrolling.
+
+        Add new images needed for the Inspector.
+
+        * page/inspector/Images/attachedShadow.png: Added.
+        * page/inspector/Images/bottomShadow.png: Added.
+        * page/inspector/Images/breadcrumbBackground.png: Added.
+        * page/inspector/Images/checker.png: Added.
+        * page/inspector/Images/console.png: Added.
+        * page/inspector/Images/darkShadow.png: Added.
+        * page/inspector/Images/disclosureDownPressed.png: Added.
+        * page/inspector/Images/disclosureRightDown.png: Added.
+        * page/inspector/Images/disclosureRightPressed.png: Added.
+        * page/inspector/Images/document.png: Added.
+        * page/inspector/Images/domViewButton.png: Added.
+        * page/inspector/Images/domViewButtonSelected.png: Added.
+        * page/inspector/Images/downTriangle.png: Added.
+        * page/inspector/Images/errorIcon.png: Added.
+        * page/inspector/Images/errorMediumIcon.png: Added.
+        * page/inspector/Images/folder.png: Added.
+        * page/inspector/Images/goArrow.png: Added.
+        * page/inspector/Images/gradient.png: Added.
+        * page/inspector/Images/gradientHighlight.png: Added.
+        * page/inspector/Images/gradientHighlightBottom.png: Added.
+        * page/inspector/Images/hideStatusWidget.png: Added.
+        * page/inspector/Images/hideStatusWidgetPressed.png: Added.
+        * page/inspector/Images/network.png: Added.
+        * page/inspector/Images/paneBottomGrow.png: Added.
+        * page/inspector/Images/paneBottomGrowActive.png: Added.
+        * page/inspector/Images/paneGrowHandleLine.png: Added.
+        * page/inspector/Images/paneHeader.png: Added.
+        * page/inspector/Images/paneHeaderActive.png: Added.
+        * page/inspector/Images/plainDocument.png: Added.
+        * page/inspector/Images/popupArrows.png: Added.
+        * page/inspector/Images/rightTriangle.png: Added.
+        * page/inspector/Images/segment.png: Added.
+        * page/inspector/Images/segmentEnd.png: Added.
+        * page/inspector/Images/segmentHover.png: Added.
+        * page/inspector/Images/segmentHoverEnd.png: Added.
+        * page/inspector/Images/segmentSelected.png: Added.
+        * page/inspector/Images/segmentSelectedEnd.png: Added.
+        * page/inspector/Images/showStatusWidget.png: Added.
+        * page/inspector/Images/showStatusWidgetPressed.png: Added.
+        * page/inspector/Images/sidbarItemBackground.png: Added.
+        * page/inspector/Images/sidebarActionWidget.png: Added.
+        * page/inspector/Images/sidebarActionWidgetPressed.png: Added.
+        * page/inspector/Images/sidebarAttachWidget.png: Added.
+        * page/inspector/Images/sidebarAttachWidgetPressed.png: Added.
+        * page/inspector/Images/sidebarDetachWidget.png: Added.
+        * page/inspector/Images/sidebarDetachWidgetPressed.png: Added.
+        * page/inspector/Images/sidebarResizeWidget.png: Added.
+        * page/inspector/Images/sidebarSelection.png: Added.
+        * page/inspector/Images/sidebarSelectionBlurred.png: Added.
+        * page/inspector/Images/sidebarSelectionBlurredTall.png: Added.
+        * page/inspector/Images/sidebarSelectionGray.png: Added.
+        * page/inspector/Images/sidebarSelectionGrayTall.png: Added.
+        * page/inspector/Images/sidebarSelectionTall.png: Added.
+        * page/inspector/Images/sidebarStatusAreaBackground.png: Added.
+        * page/inspector/Images/sourceViewButton.png: Added.
+        * page/inspector/Images/sourceViewButtonSelected.png: Added.
+        * page/inspector/Images/splitviewDimple.png: Added.
+        * page/inspector/Images/splitviewDividerBackground.png: Added.
+        * page/inspector/Images/tab.png: Added.
+        * page/inspector/Images/tabSelected.png: Added.
+        * page/inspector/Images/timelinePillBlue.png: Added.
+        * page/inspector/Images/timelinePillGray.png: Added.
+        * page/inspector/Images/timelinePillGreen.png: Added.
+        * page/inspector/Images/timelinePillOrange.png: Added.
+        * page/inspector/Images/timelinePillPurple.png: Added.
+        * page/inspector/Images/timelinePillRed.png: Added.
+        * page/inspector/Images/timelinePillYellow.png: Added.
+        * page/inspector/Images/tipBalloon.png: Added.
+        * page/inspector/Images/tipBalloonBottom.png: Added.
+        * page/inspector/Images/tipIcon.png: Added.
+        * page/inspector/Images/tipIconPressed.png: Added.
+        * page/inspector/Images/toggleDown.png: Added.
+        * page/inspector/Images/toggleUp.png: Added.
+        * page/inspector/Images/toolbarBackground.png: Added.
+        * page/inspector/Images/toolbarBackgroundInactive.png: Added.
+        * page/inspector/Images/toolbarButton.png: Added.
+        * page/inspector/Images/toolbarButtonInactive.png: Added.
+        * page/inspector/Images/toolbarButtonPressed.png: Added.
+        * page/inspector/Images/toolbarButtonPressedInactive.png: Added.
+        * page/inspector/Images/toolbarSplitButtonDivider.png: Added.
+        * page/inspector/Images/toolbarSplitButtonDividerInactive.png: Added.
+        * page/inspector/Images/treeDownTriangleBlack.png: Added.
+        * page/inspector/Images/treeDownTriangleWhite.png: Added.
+        * page/inspector/Images/treeLeftTriangleBlack.png: Added.
+        * page/inspector/Images/treeRightTriangleBlack.png: Added.
+        * page/inspector/Images/treeRightTriangleWhite.png: Added.
+        * page/inspector/Images/warningIcon.png: Added.
+        * page/inspector/Images/warningMediumIcon.png: Added.
+        * page/inspector/Images/warningsErrors.png: Added.
+
+        Build-fu:
+
+        * WebCore.exp: Added new symbols.
+        * WebCore.xcodeproj/project.pbxproj: Added new source files and
+        resources.
+        * WebCore.vcproj/WebCore.vcproj: Ditto, and copy the resources to
+        $WebKitOutputDir.
+
+        Windows build fixes:
+
+        * history/HistoryItem.h: ResourceRequest is a struct.
+        * loader/FrameLoaderClient.h: Ditto.
+
 2007-06-20  Mitz Pettel  <mitz@webkit.org>
 
         Reviewed by Beth.
index a435f9af52087a7d94d99d6ee8446a5ec376bba9..a9d1adb1525a33ed395509429e60043e20e1d3a7 100644 (file)
@@ -133,6 +133,7 @@ __ZN7WebCore10CachedPageD1Ev
 __ZN7WebCore10EventNames10clickEventE
 __ZN7WebCore10EventNames12keydownEventE
 __ZN7WebCore10MouseEventC1ERKNS_12AtomicStringEbbPNS_9DOMWindowEiiiiibbbbtPNS_15EventTargetNodeEPNS_9ClipboardEb
+__ZN7WebCore10StringImpl11computeHashEPKtj
 __ZN7WebCore10StringImpl7replaceEtt
 __ZN7WebCore10StringImplD1Ev
 __ZN7WebCore11ContextMenu22setPlatformDescriptionEP14NSMutableArray
@@ -228,6 +229,7 @@ __ZN7WebCore12IconDatabase7isEmptyEv
 __ZN7WebCore12IconDatabase8importedEv
 __ZN7WebCore12SharedBuffer10wrapNSDataEP6NSData
 __ZN7WebCore12SharedBuffer12createNSDataEv
+__ZN7WebCore12TextEncodingC1ERKNS_6StringE
 __ZN7WebCore12iconDatabaseEv
 __ZN7WebCore13HitTestResultC1ERKS0_
 __ZN7WebCore13HitTestResultD1Ev
@@ -300,6 +302,7 @@ __ZN7WebCore16NavigationActionC1ERKNS_4KURLENS_13FrameLoadTypeEb
 __ZN7WebCore16NavigationActionC1ERKNS_4KURLENS_14NavigationTypeE
 __ZN7WebCore16NavigationActionC1Ev
 __ZN7WebCore18PlatformMouseEventC1EP7NSEvent
+__ZN7WebCore19InspectorController16setWindowVisibleEb
 __ZN7WebCore19SelectionController16setSelectedRangeEPNS_5RangeENS_9EAffinityEbRi
 __ZN7WebCore19SelectionController5clearEv
 __ZN7WebCore19SelectionController9selectAllEv
@@ -317,6 +320,7 @@ __ZN7WebCore20JavaScriptStatistics24setShouldPrintExceptionsEb
 __ZN7WebCore20JavaScriptStatistics31garbageCollectOnAlternateThreadEb
 __ZN7WebCore21ContextMenuController16clearContextMenuEv
 __ZN7WebCore21PlatformKeyboardEventC1EP7NSEventb
+__ZN7WebCore21WindowsLatin1EncodingEv
 __ZN7WebCore21findEventWithKeyStateEPNS_5EventE
 __ZN7WebCore21isBackForwardLoadTypeENS_13FrameLoadTypeE
 __ZN7WebCore24notifyHistoryItemChangedE
@@ -336,6 +340,7 @@ __ZN7WebCore4Node18startIgnoringLeaksEv
 __ZN7WebCore4Page12setGroupNameERKNS_6StringE
 __ZN7WebCore4Page15backForwardListEv
 __ZN7WebCore4Page16setDefersLoadingEb
+__ZN7WebCore4Page18setInspectorClientEPNS_15InspectorClientE
 __ZN7WebCore4Page23clearUndoRedoOperationsEv
 __ZN7WebCore4Page6goBackEv
 __ZN7WebCore4Page8goToItemEPNS_11HistoryItemENS_13FrameLoadTypeE
@@ -486,6 +491,7 @@ __ZN7WebCore9TimerBase5startEdd
 __ZN7WebCore9TimerBaseC2Ev
 __ZN7WebCore9TimerBaseD2Ev
 __ZN7WebCore9pageCacheEv
+__ZN7WebCoreeqERKNS_15ResourceRequestES2_
 __ZN7WebCoreeqERKNS_4KURLES2_
 __ZNK7WebCore10StringImplcvP8NSStringEv
 __ZNK7WebCore11CachedImage5imageEv
@@ -524,6 +530,9 @@ __ZNK7WebCore12AtomicString16deprecatedStringEv
 __ZNK7WebCore12EventHandler17eventMayStartDragERKNS_18PlatformMouseEventE
 __ZNK7WebCore12EventHandler20currentKeyboardEventEv
 __ZNK7WebCore12RenderObject25backslashAsCurrencySymbolEv
+__ZNK7WebCore12SharedBuffer4dataEv
+__ZNK7WebCore12SharedBuffer4sizeEv
+__ZNK7WebCore12TextEncoding6decodeEPKcm
 __ZNK7WebCore13HitTestResult10isLiveLinkEv
 __ZNK7WebCore13HitTestResult10isSelectedEv
 __ZNK7WebCore13HitTestResult11targetFrameEv
@@ -539,6 +548,7 @@ __ZNK7WebCore13HitTestResult5titleEv
 __ZNK7WebCore13HitTestResult9imageRectEv
 __ZNK7WebCore13ResourceErrorcvP7NSErrorEv
 __ZNK7WebCore14DocumentLoader10isStoppingEv
+__ZNK7WebCore14DocumentLoader10requestURLEv
 __ZNK7WebCore14DocumentLoader11frameLoaderEv
 __ZNK7WebCore14DocumentLoader11isCommittedEv
 __ZNK7WebCore14DocumentLoader14initialRequestEv
@@ -558,6 +568,7 @@ __ZNK7WebCore14ResourceHandle10connectionEv
 __ZNK7WebCore14ResourceLoader11frameLoaderEv
 __ZNK7WebCore15ProgressTracker17estimatedProgressEv
 __ZNK7WebCore15ResourceRequest12nsURLRequestEv
+__ZNK7WebCore15ResourceRequest16httpHeaderFieldsEv
 __ZNK7WebCore15ResourceRequest3urlEv
 __ZNK7WebCore15ResourceRequest7isEmptyEv
 __ZNK7WebCore16DeprecatedString11getNSStringEv
@@ -565,11 +576,19 @@ __ZNK7WebCore16DeprecatedString2atEj
 __ZNK7WebCore16DeprecatedString3midEjj
 __ZNK7WebCore16DeprecatedString8endsWithERKS0_
 __ZNK7WebCore16ResourceResponse13nsURLResponseEv
+__ZNK7WebCore16ResourceResponse14httpStatusCodeEv
+__ZNK7WebCore16ResourceResponse16httpHeaderFieldsEv
+__ZNK7WebCore16ResourceResponse16textEncodingNameEv
+__ZNK7WebCore16ResourceResponse17suggestedFilenameEv
+__ZNK7WebCore16ResourceResponse21expectedContentLengthEv
 __ZNK7WebCore16ResourceResponse3urlEv
+__ZNK7WebCore16ResourceResponse8mimeTypeEv
 __ZNK7WebCore19SelectionController17isInPasswordFieldEv
 __ZNK7WebCore26NetscapePlugInStreamLoader6isDoneEv
 __ZNK7WebCore4Font11primaryFontEv
+__ZNK7WebCore4KURL17lastPathComponentEv
 __ZNK7WebCore4KURL4hostEv
+__ZNK7WebCore4KURL4pathEv
 __ZNK7WebCore4KURL8getNSURLEv
 __ZNK7WebCore5Frame10isFrameSetEv
 __ZNK7WebCore5Frame12eventHandlerEv
@@ -605,6 +624,7 @@ __ZNK7WebCore6Editor7canCopyEv
 __ZNK7WebCore6Editor7canEditEv
 __ZNK7WebCore6Editor8canPasteEv
 __ZNK7WebCore6Editor9canDeleteEv
+__ZNK7WebCore6String10charactersEv
 __ZNK7WebCore6String16deprecatedStringEv
 __ZNK7WebCore6String6lengthEv
 __ZNK7WebCore6String7isEmptyEv
index 02daa206713f5731e3ef263e3d6fe2e8d4313c8e..e0a9c9cd8509e90cebb23416d3a568494fbeada2 100644 (file)
@@ -85,7 +85,7 @@
                        />
                        <Tool
                                Name="VCPostBuildEventTool"
-                               CommandLine="mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\bindings&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\kjs&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\pcre&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode\icu&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\config.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitOutputDir)\obj\WebCore\DerivedSources\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\icon\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\history\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\html\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\css\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y &quot;$(ProjectDir)..\platform\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y &quot;$(ProjectDir)..\platform\network\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\cairo\cairo\src\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bindings\js\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bridge\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bridge\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y &quot;$(ProjectDir)..\bridge\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\plugins\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\rendering\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\editing\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\dom\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\xml\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\ksvg2\css\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\ksvg2\events\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\ksvg2\misc\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\ksvg2\scripts\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\ksvg2\svg\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\bindings\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\bindings&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\kjs\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\kjs&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\pcre\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\pcre&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\unicode\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\unicode\icu\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode\icu&quot;&#x0D;&#x0A;"
+                               CommandLine="mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\bindings&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\kjs&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\pcre&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode\icu&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\config.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitOutputDir)\obj\WebCore\DerivedSources\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\icon\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\history\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\html\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\css\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y &quot;$(ProjectDir)..\platform\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y &quot;$(ProjectDir)..\platform\network\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\cairo\cairo\src\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bindings\js\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bridge\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bridge\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y &quot;$(ProjectDir)..\bridge\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\plugins\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\rendering\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\editing\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\dom\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\xml\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\ksvg2\css\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\ksvg2\events\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\ksvg2\misc\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\ksvg2\scripts\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\ksvg2\svg\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\bindings\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\bindings&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\kjs\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\kjs&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\pcre\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\pcre&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\unicode\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\unicode\icu\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode\icu&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin\WebKit.resources\inspector&quot;&#x0D;&#x0A;xcopy /y /d /s &quot;$(ProjectDir)\..\page\inspector\*&quot; &quot;$(WebKitOutputDir)\bin\WebKit.resources\inspector&quot;&#x0D;&#x0A;"
                        />
                </Configuration>
                <Configuration
                        />
                        <Tool
                                Name="VCPostBuildEventTool"
-                               CommandLine="mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\bindings&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\kjs&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\pcre&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode\icu&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\config.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitOutputDir)\obj\WebCore\DerivedSources\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\icon\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\history\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\html\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\css\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y &quot;$(ProjectDir)..\platform\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y &quot;$(ProjectDir)..\platform\network\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\cairo\cairo\src\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bindings\js\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bridge\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bridge\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y &quot;$(ProjectDir)..\bridge\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\plugins\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\rendering\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\editing\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\dom\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\xml\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\ksvg2\css\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\ksvg2\events\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\ksvg2\misc\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\ksvg2\scripts\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\ksvg2\svg\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\bindings\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\bindings&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\kjs\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\kjs&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\pcre\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\pcre&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\unicode\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\unicode\icu\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode\icu&quot;&#x0D;&#x0A;"
+                               CommandLine="mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\bindings&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\kjs&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\pcre&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode\icu&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\config.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitOutputDir)\obj\WebCore\DerivedSources\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\icon\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\history\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\html\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\css\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y &quot;$(ProjectDir)..\platform\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y &quot;$(ProjectDir)..\platform\network\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\cairo\cairo\src\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bindings\js\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bridge\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bridge\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y &quot;$(ProjectDir)..\bridge\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\plugins\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\rendering\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\editing\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\dom\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\xml\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\ksvg2\css\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\ksvg2\events\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\ksvg2\misc\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\ksvg2\scripts\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\ksvg2\svg\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\bindings\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\bindings&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\kjs\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\kjs&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\pcre\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\pcre&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\unicode\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\unicode\icu\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode\icu&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin\WebKit.resources\inspector&quot;&#x0D;&#x0A;xcopy /y /d /s &quot;$(ProjectDir)\..\page\inspector\*&quot; &quot;$(WebKitOutputDir)\bin\WebKit.resources\inspector&quot;&#x0D;&#x0A;"
                        />
                </Configuration>
                <Configuration
                        />
                        <Tool
                                Name="VCPostBuildEventTool"
-                               CommandLine="mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\bindings&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\kjs&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\pcre&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode\icu&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\config.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitOutputDir)\obj\WebCore\DerivedSources\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\icon\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\history\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\html\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\css\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y &quot;$(ProjectDir)..\platform\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y &quot;$(ProjectDir)..\platform\network\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\cairo\cairo\src\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bindings\js\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bridge\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bridge\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y &quot;$(ProjectDir)..\bridge\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\plugins\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\rendering\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\editing\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\dom\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\xml\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\ksvg2\css\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\ksvg2\events\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\ksvg2\misc\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\ksvg2\scripts\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\ksvg2\svg\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\bindings\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\bindings&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\kjs\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\kjs&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\pcre\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\pcre&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\unicode\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\unicode\icu\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode\icu&quot;&#x0D;&#x0A;"
+                               CommandLine="mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\bindings&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\kjs&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\pcre&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode\icu&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\config.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitOutputDir)\obj\WebCore\DerivedSources\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\icon\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\history\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\html\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\css\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y &quot;$(ProjectDir)..\platform\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y &quot;$(ProjectDir)..\platform\network\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\cairo\cairo\src\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bindings\js\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bridge\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bridge\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y &quot;$(ProjectDir)..\bridge\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\plugins\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\rendering\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\editing\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\dom\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\xml\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\ksvg2\css\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\ksvg2\events\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\ksvg2\misc\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\ksvg2\scripts\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\ksvg2\svg\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\bindings\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\bindings&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\kjs\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\kjs&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\pcre\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\pcre&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\unicode\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\unicode\icu\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode\icu&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin\WebKit.resources\inspector&quot;&#x0D;&#x0A;xcopy /y /d /s &quot;$(ProjectDir)\..\page\inspector\*&quot; &quot;$(WebKitOutputDir)\bin\WebKit.resources\inspector&quot;&#x0D;&#x0A;"
                        />
                </Configuration>
        </Configurations>
                                >
                        </File>
                        <File
+                               RelativePath="..\page\InspectorClient.h"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\page\InspectorController.cpp"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\page\InspectorController.h"
+                               >
+                       </File>
+                        <File
                                RelativePath="..\page\MouseEventWithHitTestResults.cpp"
                                >
                        </File>
index 07bc04ebf6cabfab99f2da47abb34edfde9a333b..6eacf8f067c2d66ac8633098214a4f5c56952c28 100644 (file)
                065AD4F70B0C2EDA005A2B1D /* ContextMenuController.h in Headers */ = {isa = PBXBuildFile; fileRef = 065AD4F40B0C2EDA005A2B1D /* ContextMenuController.h */; settings = {ATTRIBUTES = (Private, ); }; };
                0668E18B0ADD9624004128E0 /* PopupMenu.h in Headers */ = {isa = PBXBuildFile; fileRef = 0668E1890ADD9624004128E0 /* PopupMenu.h */; };
                0668E1900ADD9640004128E0 /* PopupMenuMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0668E18E0ADD9640004128E0 /* PopupMenuMac.mm */; };
+               06693DBA0BFBA2F400216072 /* InspectorClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 06693DB70BFBA2F400216072 /* InspectorClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               06693DBB0BFBA2F400216072 /* InspectorController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 06693DB80BFBA2F400216072 /* InspectorController.cpp */; };
+               06693DBC0BFBA2F400216072 /* InspectorController.h in Headers */ = {isa = PBXBuildFile; fileRef = 06693DB90BFBA2F400216072 /* InspectorController.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               06693F7B0BFBC91700216072 /* inspector in Resources */ = {isa = PBXBuildFile; fileRef = 06693F450BFBC91600216072 /* inspector */; };
                066C772B0AB603B700238CC4 /* FileChooser.h in Headers */ = {isa = PBXBuildFile; fileRef = 066C772A0AB603B700238CC4 /* FileChooser.h */; };
                066C772D0AB603D200238CC4 /* FileChooserMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 066C772C0AB603D200238CC4 /* FileChooserMac.mm */; };
                066C77300AB603FD00238CC4 /* RenderFileUploadControl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 066C772E0AB603FD00238CC4 /* RenderFileUploadControl.cpp */; };
@@ -65,7 +69,7 @@
                14D8238B0AF92DF60004F057 /* Chrome.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14D8238A0AF92DF60004F057 /* Chrome.cpp */; };
                14D824080AF93AEB0004F057 /* ChromeClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 14D824060AF93AEB0004F057 /* ChromeClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
                14DC0D3709FED073007B0235 /* JSNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14DC0D3509FED073007B0235 /* JSNode.cpp */; };
-               14DC0D3809FED073007B0235 /* JSNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 14DC0D3609FED073007B0235 /* JSNode.h */; };
+               14DC0D3809FED073007B0235 /* JSNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 14DC0D3609FED073007B0235 /* JSNode.h */; settings = {ATTRIBUTES = (Private, ); }; };
                14E8378409F85D1C00B85AE4 /* JSEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14E8378309F85D1C00B85AE4 /* JSEvent.cpp */; };
                14E8378E09F85D4F00B85AE4 /* JSEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 14E8378D09F85D4F00B85AE4 /* JSEvent.h */; };
                14EC267F09CA07E000E1EEEC /* EventTargetNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 14EC267D09CA07E000E1EEEC /* EventTargetNode.h */; settings = {ATTRIBUTES = (Private, ); }; };
                93B70D6509EB0C7C009D8468 /* kjs_css.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93B70D4909EB0C7C009D8468 /* kjs_css.cpp */; };
                93B70D6609EB0C7C009D8468 /* kjs_css.h in Headers */ = {isa = PBXBuildFile; fileRef = 93B70D4A09EB0C7C009D8468 /* kjs_css.h */; };
                93B70D6709EB0C7C009D8468 /* kjs_dom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93B70D4B09EB0C7C009D8468 /* kjs_dom.cpp */; };
-               93B70D6809EB0C7C009D8468 /* kjs_dom.h in Headers */ = {isa = PBXBuildFile; fileRef = 93B70D4C09EB0C7C009D8468 /* kjs_dom.h */; };
+               93B70D6809EB0C7C009D8468 /* kjs_dom.h in Headers */ = {isa = PBXBuildFile; fileRef = 93B70D4C09EB0C7C009D8468 /* kjs_dom.h */; settings = {ATTRIBUTES = (Private, ); }; };
                93B70D6909EB0C7C009D8468 /* kjs_events.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93B70D4D09EB0C7C009D8468 /* kjs_events.cpp */; };
                93B70D6A09EB0C7C009D8468 /* kjs_events.h in Headers */ = {isa = PBXBuildFile; fileRef = 93B70D4E09EB0C7C009D8468 /* kjs_events.h */; };
                93B70D6B09EB0C7C009D8468 /* kjs_html.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93B70D4F09EB0C7C009D8468 /* kjs_html.cpp */; };
                A8185F3E09765766005826D9 /* DOMImplementation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8185F3609765765005826D9 /* DOMImplementation.cpp */; };
                A8185F3F09765766005826D9 /* DocumentFragment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8185F3709765765005826D9 /* DocumentFragment.cpp */; };
                A8185F4009765766005826D9 /* Document.h in Headers */ = {isa = PBXBuildFile; fileRef = A8185F3809765765005826D9 /* Document.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               A818721B0977D3C0005826D9 /* NodeList.h in Headers */ = {isa = PBXBuildFile; fileRef = A81872100977D3C0005826D9 /* NodeList.h */; };
+               A818721B0977D3C0005826D9 /* NodeList.h in Headers */ = {isa = PBXBuildFile; fileRef = A81872100977D3C0005826D9 /* NodeList.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A818721C0977D3C0005826D9 /* ContainerNode.h in Headers */ = {isa = PBXBuildFile; fileRef = A81872110977D3C0005826D9 /* ContainerNode.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A818721E0977D3C0005826D9 /* NameNodeList.h in Headers */ = {isa = PBXBuildFile; fileRef = A81872130977D3C0005826D9 /* NameNodeList.h */; };
                A818721F0977D3C0005826D9 /* ContainerNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A81872140977D3C0005826D9 /* ContainerNode.cpp */; };
                BCB16C270979C3BD00467741 /* CachedXSLStyleSheet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCB16C0E0979C3BD00467741 /* CachedXSLStyleSheet.cpp */; };
                BCB16C280979C3BD00467741 /* CachedXSLStyleSheet.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB16C0F0979C3BD00467741 /* CachedXSLStyleSheet.h */; };
                BCB16C290979C3BD00467741 /* DocLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCB16C100979C3BD00467741 /* DocLoader.cpp */; };
-               BCB16C2A0979C3BD00467741 /* DocLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB16C110979C3BD00467741 /* DocLoader.h */; };
+               BCB16C2A0979C3BD00467741 /* DocLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB16C110979C3BD00467741 /* DocLoader.h */; settings = {ATTRIBUTES = (Private, ); }; };
                BCB16C2C0979C3BD00467741 /* loader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCB16C130979C3BD00467741 /* loader.cpp */; };
                BCB16C2D0979C3BD00467741 /* loader.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB16C140979C3BD00467741 /* loader.h */; settings = {ATTRIBUTES = (Private, ); }; };
                BCB16C2E0979C3BD00467741 /* Request.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCB16C150979C3BD00467741 /* Request.cpp */; };
                065AD4F40B0C2EDA005A2B1D /* ContextMenuController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ContextMenuController.h; sourceTree = "<group>"; };
                0668E1890ADD9624004128E0 /* PopupMenu.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PopupMenu.h; sourceTree = "<group>"; };
                0668E18E0ADD9640004128E0 /* PopupMenuMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = PopupMenuMac.mm; sourceTree = "<group>"; };
+               06693DB70BFBA2F400216072 /* InspectorClient.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = InspectorClient.h; sourceTree = "<group>"; };
+               06693DB80BFBA2F400216072 /* InspectorController.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorController.cpp; sourceTree = "<group>"; };
+               06693DB90BFBA2F400216072 /* InspectorController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = InspectorController.h; sourceTree = "<group>"; };
+               06693F450BFBC91600216072 /* inspector */ = {isa = PBXFileReference; lastKnownFileType = folder; path = inspector; sourceTree = "<group>"; };
                066C772A0AB603B700238CC4 /* FileChooser.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FileChooser.h; sourceTree = "<group>"; };
                066C772C0AB603D200238CC4 /* FileChooserMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = FileChooserMac.mm; sourceTree = "<group>"; };
                066C772E0AB603FD00238CC4 /* RenderFileUploadControl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RenderFileUploadControl.cpp; sourceTree = "<group>"; };
                65BF02180974806300C43196 /* page */ = {
                        isa = PBXGroup;
                        children = (
+                               06693F450BFBC91600216072 /* inspector */,
                                93C09A820B064F05005ABD4D /* mac */,
                                8538F0000AD71770006A81D1 /* AbstractView.idl */,
                                BC124EE40C2641CD009E2349 /* BarInfo.cpp */,
                                65A21483097A3F5300B9050A /* FrameTree.h */,
                                65CBFEF70974F607001DAC25 /* FrameView.cpp */,
                                65CBFEF80974F607001DAC25 /* FrameView.h */,
+                               06693DB70BFBA2F400216072 /* InspectorClient.h */,
+                               06693DB80BFBA2F400216072 /* InspectorController.cpp */,
+                               06693DB90BFBA2F400216072 /* InspectorController.h */,
                                BC94D1500C275C8B006BC617 /* History.cpp */,
                                BC94D1510C275C8B006BC617 /* History.h */,
                                BC94D1520C275C8B006BC617 /* History.idl */,
                                93799EF90BF2743600D0F230 /* RenderWordBreak.h in Headers */,
                                37919C1D0BF3762800956998 /* ShapeArabic.h in Headers */,
                                BC588AF00BFA6CF900EE679E /* HTMLParserErrorCodes.h in Headers */,
+                               06693DBA0BFBA2F400216072 /* InspectorClient.h in Headers */,
+                               06693DBC0BFBA2F400216072 /* InspectorController.h in Headers */,
                                BCA169A30BFD55B40019CA76 /* JSHTMLTableCaptionElement.h in Headers */,
                                BC06ED070BFD5BAE00856E9D /* JSHTMLTableSectionElement.h in Headers */,
                                BC06ED9E0BFD660600856E9D /* JSHTMLTableColElement.h in Headers */,
                0867D690FE84028FC02AAC07 /* Project object */ = {
                        isa = PBXProject;
                        buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */;
+                       compatibilityVersion = "Xcode 2.4";
                        hasScannedForEncodings = 1;
                        knownRegions = (
                                English,
                                933A142F0B7D188600A53FFD /* TextEvent.idl in Resources */,
                                464EA2730B8A350B00A8E6E3 /* crossHairCursor.png in Resources */,
                                464EA2740B8A350B00A8E6E3 /* notAllowedCursor.png in Resources */,
+                               06693F7B0BFBC91700216072 /* inspector in Resources */,
                                BC491B4F0C023E2D009D6316 /* HTMLMarqueeElement.idl in Resources */,
                                1AB1AE7A0C051FDE00139F4F /* zoomInCursor.png in Resources */,
                                1AB1AE7B0C051FDE00139F4F /* zoomOutCursor.png in Resources */,
                                93799EF80BF2743600D0F230 /* RenderWordBreak.cpp in Sources */,
                                37919C190BF375DD00956998 /* ShapeArabic.c in Sources */,
                                BC588B4B0BFA723C00EE679E /* HTMLParserErrorCodes.cpp in Sources */,
+                               06693DBB0BFBA2F400216072 /* InspectorController.cpp in Sources */,
                                BCA169A20BFD55B40019CA76 /* JSHTMLTableCaptionElement.cpp in Sources */,
                                BC06ED060BFD5BAE00856E9D /* JSHTMLTableSectionElement.cpp in Sources */,
                                BC06ED9D0BFD660600856E9D /* JSHTMLTableColElement.cpp in Sources */,
index e3221bce1fcd589da222551dbd81f92a0c422417..686bf121cd60e20e3427a08925d5263e57c1f919 100644 (file)
@@ -87,10 +87,15 @@ td {
     color: rgb(26, 26, 166)
 }
 
-/*
 .webkit-html-external-link {
+    text-decoration: none;
+}
+
+.webkit-html-external-link:hover {
+    text-decoration: underline;
 }
 
+/*
 .webkit-html-resource-link {
 }
 */
@@ -106,3 +111,35 @@ td {
 .webkit-html-entity {
     rgb(136, 18, 128);
 }
+
+.webkit-html-message-bubble {
+    -webkit-box-shadow: black 0px 2px 5px;
+    -webkit-border-radius: 9px;
+    -webkit-border-fit: lines;
+    font-size: 9px;
+    font-family: Lucida Grande;
+    font-weight: bold;
+    margin: 6px 25px;
+    padding: 0 7px 1px;
+}
+
+.webkit-html-warning-message {
+    background-color: rgb(100%, 62%, 42%);
+    border: 2px solid rgb(100%, 52%, 21%);
+}
+
+.webkit-html-error-message {
+    background-color: rgb(100%, 42%, 42%);
+    border: 2px solid rgb(100%, 31%, 31%);
+}
+
+.webkit-html-message-line {
+    padding-left: 23px;
+    text-indent: -20px;
+}
+
+.webkit-html-message-icon {
+    position: relative;
+    top: 2px;
+    margin: 0 4px;
+}
index c4d383146bcfd78128a1d839bb4b5f793b2c1356..1236172472f0ebd659ab5cd03aceeb66da8030db 100644 (file)
@@ -47,7 +47,7 @@ namespace WebCore {
 class Document;
 class Image;
 class KURL;
-class ResourceRequest;
+struct ResourceRequest;
 
 class HistoryItem;
 typedef Vector<RefPtr<HistoryItem> > HistoryItemVector;
index 3a6b8860aee4ddc021b93f224147591ffa03632c..5e65d67cf7baa9ff2e89dd6df638feacd37a4d7e 100644 (file)
@@ -67,7 +67,9 @@
 #include "HTMLElementFactory.h"
 #include "HTMLNames.h"
 #include "HTMLTokenizer.h"
+#include "InspectorController.h"
 #include "KURL.h"
+#include "Page.h"
 #include "cssstyleselector.h"
 
 #include "DocTypeStrings.cpp"
@@ -282,7 +284,12 @@ void HTMLDocument::releaseEvents()
 
 Tokenizer *HTMLDocument::createTokenizer()
 {
-    return new HTMLTokenizer(this);
+    bool reportErrors = false;
+    if (Page* page = m_frame->page())
+        if (InspectorController* controller = page->inspectorController())
+            reportErrors = controller->windowVisible();
+
+    return new HTMLTokenizer(this, reportErrors);
 }
 
 // --------------------------------------------------------------------------
index 53e9103ce772ae50f2440d2189788a4e56475516..24b19420b6e084445fd7fda0f8f26d80a9e8e470 100644 (file)
@@ -109,7 +109,7 @@ struct HTMLStackElem : Noncopyable {
  *
  */
 
-HTMLParser::HTMLParser(HTMLDocument* doc
+HTMLParser::HTMLParser(HTMLDocument* doc, bool reportErrors)
     : document(doc)
     , current(doc)
     , didRefCurrent(false)
@@ -119,7 +119,7 @@ HTMLParser::HTMLParser(HTMLDocument* doc)
     , haveContent(false)
     , haveFrameSet(false)
     , m_isParsingFragment(false)
-    , m_reportErrors(false)
+    , m_reportErrors(reportErrors)
     , inStrayTableContent(0)
 {
 }
index e1f562bdfc19875970a9e24ceacee78a968950dd..70e1ea83123298fd522c3e64441c06a4c6054316 100644 (file)
@@ -48,7 +48,7 @@ struct HTMLStackElem;
  */
 class HTMLParser : Noncopyable {
 public:
-    HTMLParser(HTMLDocument*);
+    HTMLParser(HTMLDocument*, bool reportErrors);
     HTMLParser(DocumentFragment*);
     virtual ~HTMLParser();
 
index e22f62e7cb70d3e01a6e58b280816ecfcdb2e49c..66753327d062b0e75c3b48766c091bb4b0cbbe5d 100644 (file)
@@ -141,7 +141,7 @@ inline void Token::addAttribute(Document* doc, AtomicString& attrName, const Ato
 
 // ----------------------------------------------------------------------------
 
-HTMLTokenizer::HTMLTokenizer(HTMLDocument* doc)
+HTMLTokenizer::HTMLTokenizer(HTMLDocument* doc, bool reportErrors)
     : Tokenizer()
     , buffer(0)
     , scriptCode(0)
@@ -152,7 +152,7 @@ HTMLTokenizer::HTMLTokenizer(HTMLDocument* doc)
     , m_requestingScript(false)
     , m_timer(this, &HTMLTokenizer::timerFired)
     , m_doc(doc)
-    , parser(new HTMLParser(doc))
+    , parser(new HTMLParser(doc, reportErrors))
     , inWrite(false)
     , m_fragment(false)
 {
index be610a872f61adb43e5c54154c201bb77f58db42..70ce8be5d000e6fcc228425c5392aa0de246d14f 100644 (file)
@@ -87,7 +87,7 @@ public:
 
 class HTMLTokenizer : public Tokenizer, public CachedResourceClient {
 public:
-    HTMLTokenizer(HTMLDocument*);
+    HTMLTokenizer(HTMLDocument*, bool reportErrors);
     HTMLTokenizer(HTMLViewSourceDocument*);
     HTMLTokenizer(DocumentFragment*);
     virtual ~HTMLTokenizer();
index c312d2e6f4b8aac45d40c5e5da5fe7186fb20b74..b9ddaecd7dacd783ed4a7e88f9c20383e4cade8b 100644 (file)
@@ -61,6 +61,8 @@ namespace WebCore {
         virtual ~DocumentLoader();
 
         void setFrame(Frame*);
+        Frame* frame() const { return m_frame; }
+
         virtual void attachToFrame();
         virtual void detachFromFrame();
 
index 1a90e6e920ef04b749a16e7ec1b6caf98d4a8f15..a1372aaf9fe928a96d340781c98551225d3d34ff 100644 (file)
@@ -60,6 +60,7 @@
 #include "HTTPParsers.h"
 #include "IconDatabase.h"
 #include "IconLoader.h"
+#include "InspectorController.h"
 #include "Logging.h"
 #include "MainResourceLoader.h"
 #include "MimeTypeRegistry.h"
@@ -840,7 +841,7 @@ void FrameLoader::begin()
 void FrameLoader::begin(const KURL& url)
 {
     clear();
-    partClearedInBegin();
+    dispatchWindowObjectAvailable();
 
     m_needsClear = true;
     m_isComplete = false;
@@ -2469,7 +2470,7 @@ void FrameLoader::transitionToCommitted(PassRefPtr<CachedPage> cachedPage)
 
     m_committedFirstRealDocumentLoad = true;
 
-    m_client->dispatchDidCommitLoad();
+    dispatchDidCommitLoad();
     
     // If we have a title let the WebView know about it.
     if (!ptitle.isNull())
@@ -2823,7 +2824,7 @@ void FrameLoader::continueLoadAfterWillSubmitForm(PolicyAction)
     m_provisionalDocumentLoader->setLoadingFromCachedPage(false);
 
     unsigned long identifier = m_frame->page()->progress()->createUniqueIdentifier();
-    m_client->assignIdentifierToInitialRequest(identifier, m_provisionalDocumentLoader.get(), m_provisionalDocumentLoader->originalRequest());
+    dispatchAssignIdentifierToInitialRequest(identifier, m_provisionalDocumentLoader.get(), m_provisionalDocumentLoader->originalRequest());
 
     if (!m_provisionalDocumentLoader->startLoadingMainResource(identifier))
         m_provisionalDocumentLoader->updateLoading();
@@ -2985,6 +2986,12 @@ void FrameLoader::detachFromParent()
     stopAllLoaders();
     saveScrollPositionAndViewStateToItem(currentHistoryItem());
     detachChildren();
+
+    if (m_frame->page()) {
+        if (InspectorController* inspector = m_frame->page()->inspectorController())
+            inspector->frameDetachedFromParent(m_frame);
+    }
+
     m_client->detachedFromParent2();
     setDocumentLoader(0);
     m_client->detachedFromParent3();
@@ -3131,13 +3138,13 @@ void FrameLoader::loadResourceSynchronously(const ResourceRequest& request, Reso
 
 void FrameLoader::assignIdentifierToInitialRequest(unsigned long identifier, const ResourceRequest& clientRequest)
 {
-    return m_client->assignIdentifierToInitialRequest(identifier, activeDocumentLoader(), clientRequest);
+    return dispatchAssignIdentifierToInitialRequest(identifier, activeDocumentLoader(), clientRequest);
 }
 
 void FrameLoader::willSendRequest(ResourceLoader* loader, ResourceRequest& clientRequest, const ResourceResponse& redirectResponse)
 {
     applyUserAgent(clientRequest);
-    m_client->dispatchWillSendRequest(loader->documentLoader(), loader->identifier(), clientRequest, redirectResponse);
+    dispatchWillSendRequest(loader->documentLoader(), loader->identifier(), clientRequest, redirectResponse);
 }
 
 void FrameLoader::didReceiveResponse(ResourceLoader* loader, const ResourceResponse& r)
@@ -3146,14 +3153,14 @@ void FrameLoader::didReceiveResponse(ResourceLoader* loader, const ResourceRespo
     
     if (m_frame->page())
         m_frame->page()->progress()->incrementProgress(loader->identifier(), r);
-    m_client->dispatchDidReceiveResponse(loader->documentLoader(), loader->identifier(), r);
+    dispatchDidReceiveResponse(loader->documentLoader(), loader->identifier(), r);
 }
 
 void FrameLoader::didReceiveData(ResourceLoader* loader, const char* data, int length, int lengthReceived)
 {
     if (m_frame->page())
         m_frame->page()->progress()->incrementProgress(loader->identifier(), data, length);
-    m_client->dispatchDidReceiveContentLength(loader->documentLoader(), loader->identifier(), lengthReceived);
+    dispatchDidReceiveContentLength(loader->documentLoader(), loader->identifier(), lengthReceived);
 }
 
 void FrameLoader::didFailToLoad(ResourceLoader* loader, const ResourceError& error)
@@ -3468,13 +3475,13 @@ void FrameLoader::continueLoadAfterNewWindowPolicy(const ResourceRequest& reques
 void FrameLoader::sendRemainingDelegateMessages(unsigned long identifier, const ResourceResponse& response, unsigned length, const ResourceError& error)
 {    
     if (!response.isNull())
-        m_client->dispatchDidReceiveResponse(m_documentLoader.get(), identifier, response);
+        dispatchDidReceiveResponse(m_documentLoader.get(), identifier, response);
     
     if (length > 0)
-        m_client->dispatchDidReceiveContentLength(m_documentLoader.get(), identifier, length);
+        dispatchDidReceiveContentLength(m_documentLoader.get(), identifier, length);
     
     if (error.isNull())
-        m_client->dispatchDidFinishLoading(m_documentLoader.get(), identifier);
+        dispatchDidFinishLoading(m_documentLoader.get(), identifier);
     else
         m_client->dispatchDidFailLoading(m_documentLoader.get(), identifier, error);
 }
@@ -3484,10 +3491,10 @@ void FrameLoader::requestFromDelegate(ResourceRequest& request, unsigned long& i
     ASSERT(!request.isNull());
 
     identifier = m_frame->page()->progress()->createUniqueIdentifier();
-    m_client->assignIdentifierToInitialRequest(identifier, m_documentLoader.get(), request);
+    dispatchAssignIdentifierToInitialRequest(identifier, m_documentLoader.get(), request);
 
     ResourceRequest newRequest(request);
-    m_client->dispatchWillSendRequest(m_documentLoader.get(), identifier, newRequest, ResourceResponse());
+    dispatchWillSendRequest(m_documentLoader.get(), identifier, newRequest, ResourceResponse());
 
     if (newRequest.isNull())
         error = m_client->cancelledError(request);
@@ -3499,7 +3506,7 @@ void FrameLoader::requestFromDelegate(ResourceRequest& request, unsigned long& i
 
 void FrameLoader::loadedResourceFromMemoryCache(const ResourceRequest& request, const ResourceResponse& response, int length)
 {
-    if (m_client->dispatchDidLoadResourceFromMemoryCache(m_documentLoader.get(), request, response, length))
+    if (dispatchDidLoadResourceFromMemoryCache(m_documentLoader.get(), request, response, length))
         return;
 
     unsigned long identifier;
@@ -4201,7 +4208,7 @@ void FrameLoader::didFinishLoad(ResourceLoader* loader)
 {    
     if (m_frame->page())
         m_frame->page()->progress()->completeProgress(loader->identifier());
-    m_client->dispatchDidFinishLoading(loader->documentLoader(), loader->identifier());
+    dispatchDidFinishLoading(loader->documentLoader(), loader->identifier());
 }
 
 void FrameLoader::didReceiveAuthenticationChallenge(ResourceLoader* loader, const AuthenticationChallenge& currentWebChallenge)
@@ -4317,11 +4324,15 @@ String FrameLoader::referrer() const
     return documentLoader()->request().httpReferrer();
 }
 
-void FrameLoader::partClearedInBegin()
+void FrameLoader::dispatchWindowObjectAvailable()
 {
     Settings* settings = m_frame->settings();
-    if (settings && settings->isJavaScriptEnabled())
+    if (settings && settings->isJavaScriptEnabled()) {
         m_client->windowObjectCleared();
+
+        if (InspectorController* inspector = m_frame->page()->parentInspectorController())
+            inspector->windowScriptObjectAvailable();
+    }
 }
 
 Widget* FrameLoader::createJavaAppletWidget(const IntSize& size, Element* element, const HashMap<String, String>& args)
@@ -4406,6 +4417,64 @@ bool FrameLoader::shouldTreatURLAsLocal(const String& url)
     return localSchemes().contains(scheme);
 }
 
+void FrameLoader::dispatchDidCommitLoad()
+{
+    m_client->dispatchDidCommitLoad();
+
+    if (InspectorController* inspector = m_frame->page()->inspectorController())
+        inspector->didCommitLoad(m_documentLoader.get());
+}
+
+void FrameLoader::dispatchAssignIdentifierToInitialRequest(unsigned long identifier, DocumentLoader* loader, const ResourceRequest& request)
+{
+    m_client->assignIdentifierToInitialRequest(identifier, loader, request);
+
+    if (InspectorController* inspector = m_frame->page()->inspectorController())
+        inspector->identifierForInitialRequest(identifier, loader, request);
+}
+
+void FrameLoader::dispatchWillSendRequest(DocumentLoader* loader, unsigned long identifier, ResourceRequest& request, const ResourceResponse& redirectResponse)
+{
+    m_client->dispatchWillSendRequest(loader, identifier, request, redirectResponse);
+
+    if (InspectorController* inspector = m_frame->page()->inspectorController())
+        inspector->willSendRequest(loader, identifier, request, redirectResponse);
+}
+
+void FrameLoader::dispatchDidReceiveResponse(DocumentLoader* loader, unsigned long identifier, const ResourceResponse& r)
+{
+    m_client->dispatchDidReceiveResponse(loader, identifier, r);
+
+    if (InspectorController* inspector = m_frame->page()->inspectorController())
+        inspector->didReceiveResponse(loader, identifier, r);
+}
+
+void FrameLoader::dispatchDidReceiveContentLength(DocumentLoader* loader, unsigned long identifier, int length)
+{
+    m_client->dispatchDidReceiveContentLength(loader, identifier, length);
+
+    if (InspectorController* inspector = m_frame->page()->inspectorController())
+        inspector->didReceiveContentLength(loader, identifier, length);
+}
+
+void FrameLoader::dispatchDidFinishLoading(DocumentLoader* loader, unsigned long identifier)
+{
+    m_client->dispatchDidFinishLoading(loader, identifier);
+
+    if (InspectorController* inspector = m_frame->page()->inspectorController())
+        inspector->didFinishLoading(loader, identifier);
+}
+
+bool FrameLoader::dispatchDidLoadResourceFromMemoryCache(DocumentLoader* loader, const ResourceRequest& request, const ResourceResponse& response, int length)
+{
+    bool result = m_client->dispatchDidLoadResourceFromMemoryCache(loader, request, response, length);
+
+    if (InspectorController* inspector = m_frame->page()->inspectorController())
+        inspector->didLoadResourceFromMemoryCache(loader, request, response, length);
+
+    return result;
+}
+
 #if USE(LOW_BANDWIDTH_DISPLAY)
 
 bool FrameLoader::addLowBandwidthDisplayRequest(CachedResource* cache)
index 86bd21c0036c8d99d3e33e21b45a99fdb44f9915..137982e2a663bf61973715d471f4b3ff7d631694 100644 (file)
@@ -334,7 +334,7 @@ namespace WebCore {
 
         Widget* createJavaAppletWidget(const IntSize&, Element*, const HashMap<String, String>& args);
 
-        void partClearedInBegin(); 
+        void dispatchWindowObjectAvailable();
         void restoreDocumentState();
 
         String overrideMediaType() const;
@@ -551,6 +551,14 @@ namespace WebCore {
         void switchOutLowBandwidthDisplayIfReady();        
 #endif
 
+        void dispatchDidCommitLoad();
+        void dispatchAssignIdentifierToInitialRequest(unsigned long identifier, DocumentLoader*, const ResourceRequest&);
+        void dispatchWillSendRequest(DocumentLoader*, unsigned long identifier, ResourceRequest&, const ResourceResponse& redirectResponse);
+        void dispatchDidReceiveResponse(DocumentLoader*, unsigned long identifier, const ResourceResponse&);
+        void dispatchDidReceiveContentLength(DocumentLoader*, unsigned long identifier, int length);
+        void dispatchDidFinishLoading(DocumentLoader*, unsigned long identifier);
+        bool dispatchDidLoadResourceFromMemoryCache(DocumentLoader*, const ResourceRequest&, const ResourceResponse&, int length);
+
         Frame* m_frame;
         FrameLoaderClient* m_client;
 
index ee885bb9cf1272b69663bd3eaf4958a3e79531c3..50fbb97c15eadd519809a2a58683b8f9baffc3db 100644 (file)
@@ -58,13 +58,14 @@ namespace WebCore {
     class ResourceError;
     class ResourceHandle;
     class ResourceLoader;
-    class ResourceRequest;
     class ResourceResponse;
     class SharedBuffer;
     class SubstituteData;
     class String;
     class Widget;
 
+    struct ResourceRequest;
+
     typedef void (FrameLoader::*FramePolicyFunction)(PolicyAction);
 
     class FrameLoaderClient {
index 8b0332a1ca884a880adcf0381455c453da72a51d..8854f2ed839b4a5cce82f8a718be38e20e6846ca 100644 (file)
@@ -25,6 +25,7 @@
 #include "ChromeClient.h"
 #include "FloatRect.h"
 #include "Frame.h"
+#include "InspectorController.h"
 #include "Page.h"
 #include "ResourceHandle.h"
 #include <wtf/PassRefPtr.h>
@@ -184,6 +185,9 @@ void Chrome::addMessageToConsole(MessageSource source, MessageLevel level, const
 {
     if (source == JSMessageSource && level == ErrorMessageLevel)
         m_client->addMessageToConsole(message, lineNumber, sourceID);
+
+    if (InspectorController* inspector = m_page->inspectorController())
+        inspector->addMessageToConsole(source, level, message, lineNumber, sourceID);
 }
 
 bool Chrome::canRunBeforeUnloadConfirmPanel()
index 1d2aecbf01a6122eac8c850cafa3a68e5a257927..54d5c84816fe1da1220c33e4ccc71fce4ac73011 100644 (file)
@@ -47,10 +47,12 @@ namespace WebCore {
         HTMLMessageSource,
         XMLMessageSource,
         JSMessageSource,
-        CSSMessageSource
+        CSSMessageSource,
+        OtherMessageSource
     };
 
     enum MessageLevel {
+        TipMessageLevel,
         LogMessageLevel,
         WarningMessageLevel,
         ErrorMessageLevel
index 775adc50300473adda6d2e73877f2f0444f8ae3e..b905d62d078ebc0aa71b18fef3a7b7476283db9d 100644 (file)
@@ -49,6 +49,7 @@ namespace WebCore {
         virtual void lookUpInDictionary(Frame*) = 0;
         virtual void speak(const String&) = 0;
         virtual void stopSpeaking() = 0;
+        virtual bool shouldIncludeInspectElementItem() = 0;
 
 #if PLATFORM(MAC)
         virtual void searchWithSpotlight() = 0;
index b9f5ebbf13279297fef2c6b2fb7f6475353d497e..660194448966f5496101626c694fb139709ffec4 100644 (file)
@@ -42,6 +42,7 @@
 #include "FrameLoadRequest.h"
 #include "HitTestRequest.h"
 #include "HitTestResult.h"
+#include "InspectorController.h"
 #include "KURL.h"
 #include "MouseEvent.h"
 #include "Node.h"
@@ -93,6 +94,8 @@ void ContextMenuController::handleContextMenuEvent(Event* event)
     m_contextMenu->populate();
     PlatformMenuDescription customMenu = m_client->getCustomMenuFromDefaultItems(m_contextMenu.get());
     m_contextMenu->setPlatformDescription(customMenu);
+    if (m_client->shouldIncludeInspectElementItem())
+        m_contextMenu->addInspectElementItem();
     event->setDefaultHandled();
 }
 
@@ -269,6 +272,10 @@ void ContextMenuController::contextMenuItemSelected(ContextMenuItem* item)
             frame->editor()->showColorPanel();
             break;
 #endif
+        case ContextMenuItemTagInspectElement:
+            if (InspectorController* inspector = frame->page()->inspectorController())
+                inspector->inspect(result.innerNonSharedNode());
+            break;
         default:
             break;
     }
diff --git a/WebCore/page/InspectorClient.h b/WebCore/page/InspectorClient.h
new file mode 100644 (file)
index 0000000..ee6dade
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2007 Apple Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 COMPUTER, INC. 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. 
+ */
+
+#ifndef InspectorClient_h
+#define InspectorClient_h
+
+namespace WebCore {
+
+class Node;
+class Page;
+class String;
+
+class InspectorClient {
+public:
+    virtual ~InspectorClient() {  }
+
+    virtual void inspectorDestroyed() = 0;
+
+    virtual Page* createPage() = 0;
+
+    virtual void showWindow() = 0;
+    virtual void closeWindow() = 0;
+
+    virtual void attachWindow() = 0;
+    virtual void detachWindow() = 0;
+
+    virtual void highlight(Node*) = 0;
+    virtual void hideHighlight() = 0;
+
+    virtual void inspectedURLChanged(const String& newURL) = 0;
+};
+
+} // namespace WebCore
+
+#endif // !defined(InspectorClient_h)
diff --git a/WebCore/page/InspectorController.cpp b/WebCore/page/InspectorController.cpp
new file mode 100644 (file)
index 0000000..2fd9425
--- /dev/null
@@ -0,0 +1,1247 @@
+/*
+ * Copyright (C) 2007 Apple Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer. 
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution. 
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission. 
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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 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.
+ */
+
+#include "config.h"
+#include "InspectorController.h"
+
+#include "CString.h"
+#include "CachedResource.h"
+#include "DocLoader.h"
+#include "Document.h"
+#include "DocumentLoader.h"
+#include "Element.h"
+#include "FloatRect.h"
+#include "Frame.h"
+#include "FrameLoader.h"
+#include "FrameTree.h"
+#include "HTMLFrameOwnerElement.h"
+#include "InspectorClient.h"
+#include "JSRange.h"
+#include "Page.h"
+#include "Range.h"
+#include "ResourceError.h"
+#include "ResourceRequest.h"
+#include "ResourceResponse.h"
+#include "Shared.h"
+#include "SharedBuffer.h"
+#include "SystemTime.h"
+#include "TextEncoding.h"
+#include "TextIterator.h"
+#include "kjs_dom.h"
+#include "kjs_proxy.h"
+#include "kjs_window.h"
+
+#include <JavaScriptCore/APICast.h>
+#include <JavaScriptCore/JSLock.h>
+
+namespace WebCore {
+
+struct ConsoleMessage {
+    ConsoleMessage(MessageSource s, MessageLevel l, const String& m, unsigned li, const String& u)
+        : source(s)
+        , level(l)
+        , message(m)
+        , line(li)
+        , url(u)
+    {
+    }
+
+    MessageSource source;
+    MessageLevel level;
+    String message;
+    unsigned line;
+    String url;
+};
+
+struct InspectorResource : public Shared<InspectorResource> {
+    // Keep these in sync with WebInspector.Resource.Type
+    enum Type {
+        Doc,
+        Stylesheet,
+        Image,
+        Script,
+        Other
+    };
+
+    InspectorResource(unsigned long identifier, DocumentLoader* documentLoader, Frame* frame)
+        : identifier(identifier)
+        , loader(documentLoader)
+        , frame(frame)
+        , scriptContext(0)
+        , scriptObject(0)
+        , cached(false)
+        , finished(false)
+        , failed(false)
+        , length(0)
+        , startTime(-1.0)
+        , responseReceivedTime(-1.0)
+        , endTime(-1.0)
+    {
+    }
+
+    ~InspectorResource()
+    {
+        setScriptObject(0, 0);
+    }
+
+    Type type() const
+    {
+        if (request.isNull() || response.isNull())
+            return Other;
+
+        if (request.url() == loader->requestURL())
+            return Doc;
+
+        FrameLoader* frameLoader = loader->frameLoader();
+        if (!frameLoader)
+            return Other;
+
+        Document* doc = frameLoader->frame()->document();
+        if (!doc)
+            return Other;
+
+        CachedResource* cachedResource = doc->docLoader()->cachedResource(request.url().url());
+        if (!cachedResource)
+            return Other;
+
+        switch (cachedResource->type()) {
+            case CachedResource::ImageResource:
+                return Image;
+            case CachedResource::CSSStyleSheet:
+#if ENABLE(XSLT)
+            case CachedResource::XSLStyleSheet:
+#endif
+                return Stylesheet;
+            case CachedResource::Script:
+                return Script;
+            default:
+                return Other;
+        }
+    }
+
+    void setScriptObject(JSContextRef context, JSObjectRef newScriptObject)
+    {
+        if (scriptContext && scriptObject)
+            JSValueUnprotect(scriptContext, scriptObject);
+
+        scriptObject = newScriptObject;
+        scriptContext = context;
+
+        ASSERT((context && newScriptObject) || (!context && !newScriptObject));
+        if (context && newScriptObject)
+            JSValueProtect(context, newScriptObject);
+    }
+
+    unsigned long identifier;
+    RefPtr<DocumentLoader> loader;
+    RefPtr<Frame> frame;
+    ResourceRequest request;
+    ResourceResponse response;
+    ResourceResponse redirectResponse;
+    ResourceError error;
+    JSContextRef scriptContext;
+    JSObjectRef scriptObject;
+    bool cached;
+    bool finished;
+    bool failed;
+    int length;
+    double startTime;
+    double responseReceivedTime;
+    double endTime;
+};
+
+static JSValueRef addSourceToFrame(JSContextRef ctx, JSObjectRef /*function*/, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* /*exception*/)
+{
+    JSValueRef undefined = JSValueMakeUndefined(ctx);
+
+    InspectorController* controller = reinterpret_cast<InspectorController*>(JSObjectGetPrivate(thisObject));
+    if (argumentCount < 2 || !controller)
+        return undefined;
+
+    JSValueRef identifierValue = arguments[0];
+    if (!JSValueIsNumber(ctx, identifierValue))
+        return undefined;
+
+    unsigned long identifier = static_cast<unsigned long>(JSValueToNumber(ctx, identifierValue, 0));
+    RefPtr<InspectorResource> resource = controller->resources().get(identifier);
+    ASSERT(resource);
+    if (!resource)
+        return undefined;
+
+    RefPtr<SharedBuffer> buffer;
+    if (resource->request.url() == resource->loader->requestURL())
+        buffer = resource->loader->mainResourceData();
+    else {
+        FrameLoader* frameLoader = resource->loader->frameLoader();
+        if (!frameLoader)
+            return undefined;
+
+        Document* doc = frameLoader->frame()->document();
+        if (!doc)
+            return undefined;
+
+        CachedResource* cachedResource = doc->docLoader()->cachedResource(resource->request.url().url());
+        if (!cachedResource)
+            return undefined;
+
+        buffer = cachedResource->data();
+    }
+
+    if (!buffer)
+        return undefined;
+
+    String textEncodingName = resource->loader->overrideEncoding();
+    if (!textEncodingName)
+        textEncodingName = resource->response.textEncodingName();
+
+    TextEncoding encoding(textEncodingName);
+    if (!encoding.isValid())
+        encoding = WindowsLatin1Encoding();
+    String sourceString = encoding.decode(buffer->data(), buffer->size());
+
+    Node* node = toNode(toJS(arguments[1]));
+    ASSERT(node);
+    if (!node)
+        return undefined;
+
+    if (!node->attached()) {
+        ASSERT_NOT_REACHED();
+        return undefined;
+    }
+
+    ASSERT(node->isElementNode());
+    if (!node->isElementNode())
+        return undefined;
+
+    Element* element = static_cast<Element*>(node);
+    ASSERT(element->isFrameOwnerElement());
+    if (!element->isFrameOwnerElement())
+        return undefined;
+
+    HTMLFrameOwnerElement* frameOwner = static_cast<HTMLFrameOwnerElement*>(element);
+    ASSERT(frameOwner->contentFrame());
+    if (!frameOwner->contentFrame())
+        return undefined;
+
+    FrameLoader* loader = frameOwner->contentFrame()->loader();
+
+    loader->setResponseMIMEType(resource->response.mimeType());
+    loader->begin();
+    loader->write(sourceString);
+    loader->end();
+
+    return undefined;
+}
+
+static JSValueRef getResourceDocumentNode(JSContextRef ctx, JSObjectRef /*function*/, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* /*exception*/)
+{
+    JSValueRef undefined = JSValueMakeUndefined(ctx);
+
+    InspectorController* controller = reinterpret_cast<InspectorController*>(JSObjectGetPrivate(thisObject));
+    if (!argumentCount || argumentCount > 1 || !controller)
+        return undefined;
+
+    JSValueRef identifierValue = arguments[0];
+    if (!JSValueIsNumber(ctx, identifierValue))
+        return undefined;
+
+    unsigned long identifier = static_cast<unsigned long>(JSValueToNumber(ctx, identifierValue, 0));
+    RefPtr<InspectorResource> resource = controller->resources().get(identifier);
+    ASSERT(resource);
+    if (!resource)
+        return undefined;
+
+    FrameLoader* frameLoader = resource->loader->frameLoader();
+    if (!frameLoader)
+        return undefined;
+
+    Document* document = frameLoader->frame()->document();
+    if (!document)
+        return undefined;
+
+    if (document->isPluginDocument() || document->isImageDocument())
+        return undefined;
+
+    KJS::JSLock lock;
+    JSValueRef documentValue = toRef(toJS(toJS(controller->scriptContext()), document));
+    return documentValue;
+}
+
+static JSValueRef highlightDOMNode(JSContextRef context, JSObjectRef /*function*/, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* /*exception*/)
+{
+    JSValueRef undefined = JSValueMakeUndefined(context);
+
+    InspectorController* controller = reinterpret_cast<InspectorController*>(JSObjectGetPrivate(thisObject));
+    if (argumentCount < 1 || !controller)
+        return undefined;
+
+    Node* node = toNode(toJS(arguments[0]));
+    if (!node)
+        return undefined;
+
+    controller->highlight(node);
+
+    return undefined;
+}
+
+static JSValueRef hideDOMNodeHighlight(JSContextRef context, JSObjectRef /*function*/, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* /*exception*/)
+{
+    JSValueRef undefined = JSValueMakeUndefined(context);
+
+    InspectorController* controller = reinterpret_cast<InspectorController*>(JSObjectGetPrivate(thisObject));
+    if (argumentCount || !controller)
+        return undefined;
+
+    controller->hideHighlight();
+
+    return undefined;
+}
+
+static JSValueRef loaded(JSContextRef ctx, JSObjectRef /*function*/, JSObjectRef thisObject, size_t /*argumentCount*/, const JSValueRef[] /*arguments[]*/, JSValueRef* /*exception*/)
+{
+    InspectorController* controller = reinterpret_cast<InspectorController*>(JSObjectGetPrivate(thisObject));
+    if (!controller)
+        return JSValueMakeUndefined(ctx);
+
+    controller->scriptObjectReady();
+    return JSValueMakeUndefined(ctx);
+}
+
+static JSValueRef unloading(JSContextRef ctx, JSObjectRef /*function*/, JSObjectRef thisObject, size_t /*argumentCount*/, const JSValueRef[] /*arguments[]*/, JSValueRef* /*exception*/)
+{
+    InspectorController* controller = reinterpret_cast<InspectorController*>(JSObjectGetPrivate(thisObject));
+    if (!controller)
+        return JSValueMakeUndefined(ctx);
+
+    controller->windowUnloading();
+    return JSValueMakeUndefined(ctx);
+}
+
+static JSValueRef attach(JSContextRef ctx, JSObjectRef /*function*/, JSObjectRef thisObject, size_t /*argumentCount*/, const JSValueRef[] /*arguments[]*/, JSValueRef* /*exception*/)
+{
+    InspectorController* controller = reinterpret_cast<InspectorController*>(JSObjectGetPrivate(thisObject));
+    if (!controller)
+        return JSValueMakeUndefined(ctx);
+
+    controller->attachWindow();
+    return JSValueMakeUndefined(ctx);
+}
+
+static JSValueRef detach(JSContextRef ctx, JSObjectRef /*function*/, JSObjectRef thisObject, size_t /*argumentCount*/, const JSValueRef[] /*arguments[]*/, JSValueRef* /*exception*/)
+{
+    InspectorController* controller = reinterpret_cast<InspectorController*>(JSObjectGetPrivate(thisObject));
+    if (!controller)
+        return JSValueMakeUndefined(ctx);
+
+    controller->detachWindow();
+    return JSValueMakeUndefined(ctx);
+}
+
+static JSValueRef log(JSContextRef ctx, JSObjectRef /*function*/, JSObjectRef /*thisObject*/, size_t argumentCount, const JSValueRef arguments[], JSValueRef* /*exception*/)
+{
+    if (argumentCount < 1 || !JSValueIsString(ctx, arguments[0]))
+        return JSValueMakeUndefined(ctx);
+
+#ifndef NDEBUG
+    JSStringRef string = JSValueToStringCopy(ctx, arguments[0], 0);
+    String message(JSStringGetCharactersPtr(string), JSStringGetLength(string));
+    JSStringRelease(string);
+
+    fprintf(stderr, "%s\n", message.latin1().data());
+#endif
+
+    return JSValueMakeUndefined(ctx);
+}
+
+static JSValueRef search(JSContextRef ctx, JSObjectRef /*function*/, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* /*exception*/)
+{
+    InspectorController* controller = reinterpret_cast<InspectorController*>(JSObjectGetPrivate(thisObject));
+    if (!controller)
+        return JSValueMakeUndefined(ctx);
+
+    if (argumentCount < 2 || !JSValueIsString(ctx, arguments[1]))
+        return JSValueMakeUndefined(ctx);
+
+    Node* node = toNode(toJS(arguments[0]));
+    if (!node)
+        return JSValueMakeUndefined(ctx);
+
+    JSStringRef string = JSValueToStringCopy(ctx, arguments[1], 0);
+    String target(JSStringGetCharactersPtr(string), JSStringGetLength(string));
+    JSStringRelease(string);
+
+    JSObjectRef globalObject = JSContextGetGlobalObject(ctx);
+    JSStringRef constructorString = JSStringCreateWithUTF8CString("Array");
+    JSObjectRef arrayConstructor = JSValueToObject(ctx, JSObjectGetProperty(ctx, globalObject, constructorString, 0), 0);
+    JSStringRelease(constructorString);
+    JSObjectRef array = JSObjectCallAsConstructor(ctx, arrayConstructor, 0, 0, 0);
+
+    JSStringRef pushString = JSStringCreateWithUTF8CString("push");
+    JSValueRef pushValue = JSObjectGetProperty(ctx, array, pushString, 0);
+    JSStringRelease(pushString);
+    JSObjectRef push = JSValueToObject(ctx, pushValue, 0);
+
+    RefPtr<Range> searchRange(rangeOfContents(node));
+
+    int exception = 0;
+    do {
+        RefPtr<Range> resultRange(findPlainText(searchRange.get(), target, true, false));
+        if (resultRange->collapsed(exception))
+            break;
+
+        // A non-collapsed result range can in some funky whitespace cases still not
+        // advance the range's start position (4509328). Break to avoid infinite loop.
+        VisiblePosition newStart = endVisiblePosition(resultRange.get(), DOWNSTREAM);
+        if (newStart == startVisiblePosition(searchRange.get(), DOWNSTREAM))
+            break;
+
+        KJS::JSLock lock;
+        JSValueRef arg0 = toRef(toJS(toJS(ctx), resultRange.get()));
+        JSObjectCallAsFunction(ctx, push, array, 1, &arg0, 0);
+
+        setStart(searchRange.get(), newStart);
+    } while (true);
+
+    return array;
+}
+
+static JSValueRef inspectedWindow(JSContextRef ctx, JSObjectRef /*function*/, JSObjectRef thisObject, size_t /*argumentCount*/, const JSValueRef[] /*arguments[]*/, JSValueRef* /*exception*/)
+{
+    InspectorController* controller = reinterpret_cast<InspectorController*>(JSObjectGetPrivate(thisObject));
+    if (!controller)
+        return JSValueMakeUndefined(ctx);
+
+    return toRef(KJS::Window::retrieve(controller->inspectedPage()->mainFrame()));
+}
+
+InspectorController::InspectorController(Page* page, InspectorClient* client)
+    : m_inspectedPage(page)
+    , m_client(client)
+    , m_page(0)
+    , m_scriptObject(0)
+    , m_controllerScriptObject(0)
+    , m_scriptContext(0)
+    , m_windowVisible(false)
+    , m_nextIdentifier(-2)
+{
+    ASSERT_ARG(page, page);
+    ASSERT_ARG(client, client);
+}
+
+InspectorController::~InspectorController()
+{
+    if (m_scriptContext) {
+        JSObjectRef global = JSContextGetGlobalObject(m_scriptContext);
+        JSStringRef controllerProperty = JSStringCreateWithUTF8CString("InspectorController");
+        JSObjectRef controller = JSValueToObject(m_scriptContext, JSObjectGetProperty(m_scriptContext, global, controllerProperty, 0), 0);
+        JSStringRelease(controllerProperty);
+        JSObjectSetPrivate(controller, 0);
+    }
+
+    m_client->closeWindow();
+    m_client->inspectorDestroyed();
+
+    if (m_page)
+        m_page->setParentInspectorController(0);
+
+    deleteAllValues(m_frameResources);
+    deleteAllValues(m_consoleMessages);
+}
+
+void InspectorController::inspect(Node* node)
+{
+    if (!node)
+        return;
+
+    if (!m_page) {
+        m_page = m_client->createPage();
+        if (!m_page)
+            return;
+
+        m_page->setParentInspectorController(this);
+    }
+
+    if (node->nodeType() != Node::ELEMENT_NODE && node->nodeType() != Node::DOCUMENT_NODE)
+        node = node->parentNode();
+    m_nodeToFocus = node;
+
+    if (!m_scriptObject)
+        return;
+
+    if (windowVisible())
+        focusNode();
+    else
+        m_client->showWindow();
+}
+
+void InspectorController::focusNode()
+{
+    ASSERT(m_scriptContext);
+    ASSERT(m_scriptObject);
+    ASSERT(m_nodeToFocus);
+
+    JSValueRef arg0;
+
+    {
+        KJS::JSLock lock;
+        arg0 = toRef(toJS(toJS(m_scriptContext), m_nodeToFocus.get()));
+    }
+
+    m_nodeToFocus = 0;
+
+    JSStringRef functionProperty = JSStringCreateWithUTF8CString("updateFocusedNode");
+    JSObjectRef function = JSValueToObject(m_scriptContext, JSObjectGetProperty(m_scriptContext, m_scriptObject, functionProperty, 0), 0);
+    JSStringRelease(functionProperty);
+    ASSERT(function);
+
+    JSObjectCallAsFunction(m_scriptContext, function, m_scriptObject, 1, &arg0, 0);
+}
+
+void InspectorController::highlight(Node* node)
+{
+    ASSERT_ARG(node, node);
+
+    m_client->highlight(node);
+}
+
+void InspectorController::hideHighlight()
+{
+    m_client->hideHighlight();
+}
+
+bool InspectorController::windowVisible()
+{
+    return m_windowVisible;
+}
+
+void InspectorController::setWindowVisible(bool visible)
+{
+    if (visible == m_windowVisible)
+        return;
+
+    m_windowVisible = visible;
+
+    if (!m_scriptContext || !m_scriptObject)
+        return;
+
+    if (m_windowVisible) {
+        populateScriptResources();
+        if (m_nodeToFocus)
+            focusNode();
+    } else {
+        clearScriptResources();
+        clearScriptConsoleMessages();
+        clearNetworkTimeline();
+    }
+}
+
+void InspectorController::addMessageToConsole(MessageSource source, MessageLevel level, const String& message, unsigned lineNumber, const String& sourceID)
+{
+    ConsoleMessage* consoleMessage = new ConsoleMessage(source, level, message, lineNumber, sourceID);
+    m_consoleMessages.append(consoleMessage);
+
+    if (windowVisible())
+        addScriptConsoleMessage(consoleMessage);
+}
+
+void InspectorController::attachWindow()
+{
+    m_client->attachWindow();
+}
+
+void InspectorController::detachWindow()
+{
+    m_client->detachWindow();
+}
+
+void InspectorController::windowScriptObjectAvailable()
+{
+    ASSERT(m_page);
+
+    m_scriptContext = toRef(m_page->mainFrame()->scriptProxy()->interpreter()->globalExec());
+
+    JSObjectRef global = JSContextGetGlobalObject(m_scriptContext);
+    ASSERT(global);
+
+    static JSStaticFunction staticFunctions[] = {
+        { "addSourceToFrame", addSourceToFrame, kJSPropertyAttributeNone },
+        { "getResourceDocumentNode", getResourceDocumentNode, kJSPropertyAttributeNone },
+        { "highlightDOMNode", highlightDOMNode, kJSPropertyAttributeNone },
+        { "hideDOMNodeHighlight", hideDOMNodeHighlight, kJSPropertyAttributeNone },
+        { "loaded", loaded, kJSPropertyAttributeNone },
+        { "windowUnloading", unloading, kJSPropertyAttributeNone },
+        { "attach", attach, kJSPropertyAttributeNone },
+        { "detach", detach, kJSPropertyAttributeNone },
+        { "log", log, kJSPropertyAttributeNone },
+        { "search", search, kJSPropertyAttributeNone },
+        { "inspectedWindow", inspectedWindow, kJSPropertyAttributeNone },
+        { 0, 0, 0 }
+    };
+
+    JSClassDefinition inspectorControllerDefinition = {
+        0, kJSClassAttributeNone, "InspectorController", 0, 0, staticFunctions,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+    };
+
+    JSClassRef controllerClass = JSClassCreate(&inspectorControllerDefinition);
+    ASSERT(controllerClass);
+
+    m_controllerScriptObject = JSObjectMake(m_scriptContext, controllerClass, reinterpret_cast<void*>(this));
+    ASSERT(m_controllerScriptObject);
+
+    JSStringRef controllerObjectString = JSStringCreateWithUTF8CString("InspectorController");
+    JSObjectSetProperty(m_scriptContext, global, controllerObjectString, m_controllerScriptObject, kJSPropertyAttributeNone, 0);
+    JSStringRelease(controllerObjectString);
+}
+
+void InspectorController::scriptObjectReady()
+{
+    ASSERT(m_scriptContext);
+    if (!m_scriptContext)
+        return;
+
+    JSObjectRef global = JSContextGetGlobalObject(m_scriptContext);
+    ASSERT(global);
+
+    JSStringRef inspectorString = JSStringCreateWithUTF8CString("WebInspector");
+    JSValueRef inspectorValue = JSObjectGetProperty(m_scriptContext, global, inspectorString, 0);
+    JSStringRelease(inspectorString);
+
+    ASSERT(inspectorValue);
+    if (!inspectorValue)
+        return;
+
+    m_scriptObject = JSValueToObject(m_scriptContext, inspectorValue, 0);
+    ASSERT(m_scriptObject);
+
+    JSValueProtect(m_scriptContext, m_scriptObject);
+
+    // Make sure our window is visible now that the page loaded
+    m_client->showWindow();
+}
+
+void InspectorController::windowUnloading()
+{
+    m_client->closeWindow();
+    m_page->setParentInspectorController(0);
+
+    ASSERT(m_scriptContext && m_scriptObject);
+    JSValueUnprotect(m_scriptContext, m_scriptObject);
+
+    m_page = 0;
+    m_scriptObject = 0;
+    m_scriptContext = 0;
+}
+
+static void addHeaders(JSContextRef context, JSObjectRef object, const HTTPHeaderMap& headers)
+{
+    ASSERT_ARG(context, context);
+    ASSERT_ARG(object, object);
+    
+    HTTPHeaderMap::const_iterator end = headers.end();
+    for (HTTPHeaderMap::const_iterator it = headers.begin(); it != end; ++it) {
+        JSStringRef field = JSStringCreateWithCharacters(it->first.characters(), it->first.length());
+        JSStringRef valueString = JSStringCreateWithCharacters(it->second.characters(), it->second.length());
+        JSValueRef value = JSValueMakeString(context, valueString);
+        JSObjectSetProperty(context, object, field, value, kJSPropertyAttributeNone, 0);
+        JSStringRelease(field);
+        JSStringRelease(valueString);
+    }
+}
+
+static JSObjectRef objectForRequest(JSContextRef context, const ResourceRequest& request)
+{
+    ASSERT_ARG(context, context);
+    
+    JSObjectRef object = JSObjectMake(context, 0, 0);
+    addHeaders(context, object, request.httpHeaderFields());
+    
+    return object;
+}
+
+static JSObjectRef objectForResponse(JSContextRef context, const ResourceResponse& response)
+{
+    ASSERT_ARG(context, context);
+    
+    JSObjectRef object = JSObjectMake(context, 0, 0);
+    addHeaders(context, object, response.httpHeaderFields());
+    
+    return object;
+}
+
+JSObjectRef InspectorController::addScriptResource(InspectorResource* resource)
+{
+    ASSERT_ARG(resource, resource);
+    ASSERT(!resource->scriptObject);
+
+    ASSERT(m_scriptContext);
+    ASSERT(m_scriptObject);
+    if (!m_scriptContext || !m_scriptObject)
+        return 0;
+
+    JSStringRef resourceString = JSStringCreateWithUTF8CString("Resource");
+    JSObjectRef resourceConstructor = JSValueToObject(m_scriptContext, JSObjectGetProperty(m_scriptContext, m_scriptObject, resourceString, 0), 0);
+    JSStringRelease(resourceString);
+
+    String urlString = resource->request.url().url();
+    JSStringRef url = JSStringCreateWithCharacters(urlString.characters(), urlString.length());
+    JSValueRef urlValue = JSValueMakeString(m_scriptContext, url);
+    JSStringRelease(url);
+
+    urlString = resource->request.url().host();
+    JSStringRef domain = JSStringCreateWithCharacters(urlString.characters(), urlString.length());
+    JSValueRef domainValue = JSValueMakeString(m_scriptContext, domain);
+    JSStringRelease(domain);
+
+    urlString = resource->request.url().path();
+    JSStringRef path = JSStringCreateWithCharacters(urlString.characters(), urlString.length());
+    JSValueRef pathValue = JSValueMakeString(m_scriptContext, path);
+    JSStringRelease(path);
+
+    urlString = resource->request.url().lastPathComponent();
+    JSStringRef lastPathComponent = JSStringCreateWithCharacters(urlString.characters(), urlString.length());
+    JSValueRef lastPathComponentValue = JSValueMakeString(m_scriptContext, lastPathComponent);
+    JSStringRelease(lastPathComponent);
+
+    JSValueRef identifier = JSValueMakeNumber(m_scriptContext, resource->identifier);
+    JSValueRef mainResource = JSValueMakeBoolean(m_scriptContext, m_mainResource == resource);
+    JSValueRef cached = JSValueMakeBoolean(m_scriptContext, resource->cached);
+
+    JSValueRef arguments[] = { objectForRequest(m_scriptContext, resource->request), urlValue, domainValue, pathValue, lastPathComponentValue, identifier, mainResource, cached };
+    JSObjectRef result = JSObjectCallAsConstructor(m_scriptContext, resourceConstructor, 8, arguments, 0);
+
+    resource->setScriptObject(m_scriptContext, result);
+
+    ASSERT(result);
+
+    JSStringRef addResourceString = JSStringCreateWithUTF8CString("addResource");
+    JSObjectRef addResourceFunction = JSValueToObject(m_scriptContext, JSObjectGetProperty(m_scriptContext, m_scriptObject, addResourceString, 0), 0);
+    JSStringRelease(addResourceString);
+
+    JSValueRef addArguments[] = { result };
+    JSObjectCallAsFunction(m_scriptContext, addResourceFunction, m_scriptObject, 1, addArguments, 0);
+
+    return result;
+}
+
+JSObjectRef InspectorController::addAndUpdateScriptResource(InspectorResource* resource)
+{
+    ASSERT_ARG(resource, resource);
+
+    JSObjectRef scriptResource = addScriptResource(resource);
+    updateScriptResource(resource, resource->response);
+    updateScriptResource(resource, resource->length);
+    updateScriptResource(resource, resource->startTime, resource->responseReceivedTime, resource->endTime);
+    updateScriptResource(resource, resource->finished, resource->failed);
+    return scriptResource;
+}
+
+void InspectorController::removeScriptResource(InspectorResource* resource)
+{
+    ASSERT(m_scriptContext);
+    ASSERT(m_scriptObject);
+    if (!m_scriptContext || !m_scriptObject)
+        return;
+
+    ASSERT(resource);
+    ASSERT(resource->scriptObject);
+    if (!resource || !resource->scriptObject)
+        return;
+
+    JSStringRef removeResourceString = JSStringCreateWithUTF8CString("removeResource");
+    JSObjectRef removeResourceFunction = JSValueToObject(m_scriptContext, JSObjectGetProperty(m_scriptContext, m_scriptObject, removeResourceString, 0), 0);
+    JSStringRelease(removeResourceString);
+
+    JSValueRef arguments[] = { resource->scriptObject };
+    JSObjectCallAsFunction(m_scriptContext, removeResourceFunction, m_scriptObject, 1, arguments, 0);
+
+    resource->setScriptObject(0, 0);
+}
+
+void InspectorController::updateScriptResource(InspectorResource* resource, const ResourceRequest& request)
+{
+    ASSERT(resource->scriptObject);
+    ASSERT(m_scriptContext);
+    if (!resource->scriptObject || !m_scriptContext)
+        return;
+
+    String urlString = request.url().url();
+    JSStringRef url = JSStringCreateWithCharacters(urlString.characters(), urlString.length());
+    JSValueRef urlValue = JSValueMakeString(m_scriptContext, url);
+    JSStringRelease(url);
+
+    urlString = request.url().host();
+    JSStringRef domain = JSStringCreateWithCharacters(urlString.characters(), urlString.length());
+    JSValueRef domainValue = JSValueMakeString(m_scriptContext, domain);
+    JSStringRelease(domain);
+
+    urlString = request.url().path();
+    JSStringRef path = JSStringCreateWithCharacters(urlString.characters(), urlString.length());
+    JSValueRef pathValue = JSValueMakeString(m_scriptContext, path);
+    JSStringRelease(path);
+
+    urlString = request.url().lastPathComponent();
+    JSStringRef lastPathComponent = JSStringCreateWithCharacters(urlString.characters(), urlString.length());
+    JSValueRef lastPathComponentValue = JSValueMakeString(m_scriptContext, lastPathComponent);
+    JSStringRelease(lastPathComponent);
+
+    JSValueRef mainResourceValue = JSValueMakeBoolean(m_scriptContext, m_mainResource == resource);
+
+    JSStringRef propertyName = JSStringCreateWithUTF8CString("url");
+    JSObjectSetProperty(m_scriptContext, resource->scriptObject, propertyName, urlValue, kJSPropertyAttributeNone, 0);
+    JSStringRelease(propertyName);
+
+    propertyName = JSStringCreateWithUTF8CString("domain");
+    JSObjectSetProperty(m_scriptContext, resource->scriptObject, propertyName, domainValue, kJSPropertyAttributeNone, 0);
+    JSStringRelease(propertyName);
+
+    propertyName = JSStringCreateWithUTF8CString("path");
+    JSObjectSetProperty(m_scriptContext, resource->scriptObject, propertyName, pathValue, kJSPropertyAttributeNone, 0);
+    JSStringRelease(propertyName);
+
+    propertyName = JSStringCreateWithUTF8CString("lastPathComponent");
+    JSObjectSetProperty(m_scriptContext, resource->scriptObject, propertyName, lastPathComponentValue, kJSPropertyAttributeNone, 0);
+    JSStringRelease(propertyName);
+
+    propertyName = JSStringCreateWithUTF8CString("requestHeaders");
+    JSObjectSetProperty(m_scriptContext, resource->scriptObject, propertyName, objectForRequest(m_scriptContext, request), kJSPropertyAttributeNone, 0);
+    JSStringRelease(propertyName);
+
+    propertyName = JSStringCreateWithUTF8CString("mainResource");
+    JSObjectSetProperty(m_scriptContext, resource->scriptObject, propertyName, mainResourceValue, kJSPropertyAttributeNone, 0);
+    JSStringRelease(propertyName);
+}
+
+void InspectorController::updateScriptResource(InspectorResource* resource, const ResourceResponse& response, bool /*redirect*/)
+{
+    ASSERT(resource->scriptObject);
+    ASSERT(m_scriptContext);
+    if (!resource->scriptObject || !m_scriptContext)
+        return;
+
+    JSStringRef mimeType = JSStringCreateWithCharacters(response.mimeType().characters(), response.mimeType().length());
+    JSValueRef mimeTypeValue = JSValueMakeString(m_scriptContext, mimeType);
+    JSStringRelease(mimeType);
+
+    JSStringRef suggestedFilename = JSStringCreateWithCharacters(response.suggestedFilename().characters(), response.suggestedFilename().length());
+    JSValueRef suggestedFilenameValue = JSValueMakeString(m_scriptContext, suggestedFilename);
+    JSStringRelease(suggestedFilename);
+
+    JSValueRef expectedContentLengthValue = JSValueMakeNumber(m_scriptContext, static_cast<double>(response.expectedContentLength()));
+    JSValueRef statusCodeValue = JSValueMakeNumber(m_scriptContext, response.httpStatusCode());
+
+    JSStringRef propertyName = JSStringCreateWithUTF8CString("mimeType");
+    JSObjectSetProperty(m_scriptContext, resource->scriptObject, propertyName, mimeTypeValue, kJSPropertyAttributeNone, 0);
+    JSStringRelease(propertyName);
+
+    propertyName = JSStringCreateWithUTF8CString("suggestedFilename");
+    JSObjectSetProperty(m_scriptContext, resource->scriptObject, propertyName, suggestedFilenameValue, kJSPropertyAttributeNone, 0);
+    JSStringRelease(propertyName);
+
+    propertyName = JSStringCreateWithUTF8CString("expectedContentLength");
+    JSObjectSetProperty(m_scriptContext, resource->scriptObject, propertyName, expectedContentLengthValue, kJSPropertyAttributeNone, 0);
+    JSStringRelease(propertyName);
+
+    propertyName = JSStringCreateWithUTF8CString("statusCode");
+    JSObjectSetProperty(m_scriptContext, resource->scriptObject, propertyName, statusCodeValue, kJSPropertyAttributeNone, 0);
+    JSStringRelease(propertyName);
+    
+    propertyName = JSStringCreateWithUTF8CString("responseHeaders");
+    JSObjectSetProperty(m_scriptContext, resource->scriptObject, propertyName, objectForResponse(m_scriptContext, response), kJSPropertyAttributeNone, 0);
+    JSStringRelease(propertyName);
+
+    JSValueRef typeValue = JSValueMakeNumber(m_scriptContext, resource->type());
+    propertyName = JSStringCreateWithUTF8CString("type");
+    JSObjectSetProperty(m_scriptContext, resource->scriptObject, propertyName, typeValue, kJSPropertyAttributeNone, 0);
+    JSStringRelease(propertyName);
+}
+
+void InspectorController::updateScriptResource(InspectorResource*, const ResourceError&)
+{
+    // FIXME: Do something here when we start showing HTTP errors in the Inspector.
+}
+
+void InspectorController::updateScriptResource(InspectorResource* resource, int length)
+{
+    ASSERT(resource->scriptObject);
+    ASSERT(m_scriptContext);
+    if (!resource->scriptObject || !m_scriptContext)
+        return;
+
+    JSValueRef lengthValue = JSValueMakeNumber(m_scriptContext, length);
+
+    JSStringRef propertyName = JSStringCreateWithUTF8CString("contentLength");
+    JSObjectSetProperty(m_scriptContext, resource->scriptObject, propertyName, lengthValue, kJSPropertyAttributeNone, 0);
+    JSStringRelease(propertyName);
+}
+
+void InspectorController::updateScriptResource(InspectorResource* resource, bool finished, bool failed)
+{
+    ASSERT(resource->scriptObject);
+    ASSERT(m_scriptContext);
+    if (!resource->scriptObject || !m_scriptContext)
+        return;
+
+    JSValueRef failedValue = JSValueMakeBoolean(m_scriptContext, failed);
+    JSValueRef finishedValue = JSValueMakeBoolean(m_scriptContext, finished);
+
+    JSStringRef propertyName = JSStringCreateWithUTF8CString("failed");
+    JSObjectSetProperty(m_scriptContext, resource->scriptObject, propertyName, failedValue, kJSPropertyAttributeNone, 0);
+    JSStringRelease(propertyName);
+
+    propertyName = JSStringCreateWithUTF8CString("finished");
+    JSObjectSetProperty(m_scriptContext, resource->scriptObject, propertyName, finishedValue, kJSPropertyAttributeNone, 0);
+    JSStringRelease(propertyName);
+
+}
+
+void InspectorController::updateScriptResource(InspectorResource* resource, double startTime, double responseReceivedTime, double endTime)
+{
+    ASSERT(resource->scriptObject);
+    ASSERT(m_scriptContext);
+    if (!resource->scriptObject || !m_scriptContext)
+        return;
+
+    JSValueRef startTimeValue = JSValueMakeNumber(m_scriptContext, startTime);
+    JSValueRef responseReceivedTimeValue = JSValueMakeNumber(m_scriptContext, responseReceivedTime);
+    JSValueRef endTimeValue = JSValueMakeNumber(m_scriptContext, endTime);
+
+    JSStringRef propertyName = JSStringCreateWithUTF8CString("startTime");
+    JSObjectSetProperty(m_scriptContext, resource->scriptObject, propertyName, startTimeValue, kJSPropertyAttributeNone, 0);
+    JSStringRelease(propertyName);
+
+    propertyName = JSStringCreateWithUTF8CString("responseReceivedTime");
+    JSObjectSetProperty(m_scriptContext, resource->scriptObject, propertyName, responseReceivedTimeValue, kJSPropertyAttributeNone, 0);
+    JSStringRelease(propertyName);
+
+    propertyName = JSStringCreateWithUTF8CString("endTime");
+    JSObjectSetProperty(m_scriptContext, resource->scriptObject, propertyName, endTimeValue, kJSPropertyAttributeNone, 0);
+    JSStringRelease(propertyName);
+}
+
+void InspectorController::populateScriptResources()
+{
+    ASSERT(m_scriptContext);
+    if (!m_scriptContext)
+        return;
+
+    clearScriptResources();
+    clearScriptConsoleMessages();
+    clearNetworkTimeline();
+
+    ResourcesMap::iterator resourcesEnd = m_resources.end();
+    for (ResourcesMap::iterator it = m_resources.begin(); it != resourcesEnd; ++it)
+        addAndUpdateScriptResource(it->second.get());
+
+    unsigned messageCount = m_consoleMessages.size();
+    for (unsigned i = 0; i < messageCount; ++i)
+        addScriptConsoleMessage(m_consoleMessages[i]);
+}
+
+void InspectorController::addScriptConsoleMessage(const ConsoleMessage* message)
+{
+    ASSERT_ARG(message, message);
+
+    JSStringRef messageConstructorString = JSStringCreateWithUTF8CString("ConsoleMessage");
+    JSObjectRef messageConstructor = JSValueToObject(m_scriptContext, JSObjectGetProperty(m_scriptContext, m_scriptObject, messageConstructorString, 0), 0);
+    JSStringRelease(messageConstructorString);
+
+    JSStringRef addMessageString = JSStringCreateWithUTF8CString("addMessageToConsole");
+    JSObjectRef addMessage = JSValueToObject(m_scriptContext, JSObjectGetProperty(m_scriptContext, m_scriptObject, addMessageString, 0), 0);
+    JSStringRelease(addMessageString);
+
+    JSValueRef sourceValue = JSValueMakeNumber(m_scriptContext, message->source);
+    JSValueRef levelValue = JSValueMakeNumber(m_scriptContext, message->level);
+    JSStringRef messageString = JSStringCreateWithCharacters(message->message.characters(), message->message.length());
+    JSValueRef messageValue = JSValueMakeString(m_scriptContext, messageString);
+    JSValueRef lineValue = JSValueMakeNumber(m_scriptContext, message->line);
+    JSStringRef urlString = JSStringCreateWithCharacters(message->url.characters(), message->url.length());
+    JSValueRef urlValue = JSValueMakeString(m_scriptContext, urlString);
+
+    JSValueRef args[] = { sourceValue, levelValue, messageValue, lineValue, urlValue };
+    JSObjectRef messageObject = JSObjectCallAsConstructor(m_scriptContext, messageConstructor, 5, args, 0);
+    JSStringRelease(messageString);
+    JSStringRelease(urlString);
+
+    JSObjectCallAsFunction(m_scriptContext, addMessage, m_scriptObject, 1, &messageObject, 0);
+}
+
+static void callClearFunction(JSContextRef context, JSObjectRef thisObject, const char* functionName)
+{
+    ASSERT_ARG(context, context);
+    ASSERT_ARG(thisObject, thisObject);
+
+    JSStringRef string = JSStringCreateWithUTF8CString(functionName);
+    JSObjectRef function = JSValueToObject(context, JSObjectGetProperty(context, thisObject, string, 0), 0);
+    JSStringRelease(string);
+
+    JSObjectCallAsFunction(context, function, thisObject, 0, 0, 0);
+}
+
+void InspectorController::clearScriptResources()
+{
+    if (!m_scriptContext || !m_scriptObject)
+        return;
+
+    ResourcesMap::iterator resourcesEnd = m_resources.end();
+    for (ResourcesMap::iterator it = m_resources.begin(); it != resourcesEnd; ++it) {
+        InspectorResource* resource = it->second.get();
+        resource->setScriptObject(0, 0);
+    }
+
+    callClearFunction(m_scriptContext, m_scriptObject, "clearResources");
+}
+
+void InspectorController::clearScriptConsoleMessages()
+{
+    if (!m_scriptContext || !m_scriptObject)
+        return;
+
+    callClearFunction(m_scriptContext, m_scriptObject, "clearConsoleMessages");
+}
+
+void InspectorController::clearNetworkTimeline()
+{
+    if (!m_scriptContext || !m_scriptObject)
+        return;
+
+    callClearFunction(m_scriptContext, m_scriptObject, "clearNetworkTimeline");
+}
+
+void InspectorController::pruneResources(ResourcesMap* resourceMap, DocumentLoader* loaderToKeep)
+{
+    ASSERT_ARG(resourceMap, resourceMap);
+
+    ResourcesMap mapCopy(*resourceMap);
+    ResourcesMap::iterator end = mapCopy.end();
+    for (ResourcesMap::iterator it = mapCopy.begin(); it != end; ++it) {
+        InspectorResource* resource = (*it).second.get();
+        if (resource == m_mainResource)
+            continue;
+
+        if (!loaderToKeep || resource->loader != loaderToKeep) {
+            removeResource(resource);
+            if (windowVisible() && resource->scriptObject)
+                removeScriptResource(resource);
+        }
+    }
+}
+
+void InspectorController::didCommitLoad(DocumentLoader* loader)
+{
+    if (loader->frame() == m_inspectedPage->mainFrame()) {
+        ASSERT(m_mainResource);
+        ASSERT(m_mainResource->loader == loader);
+
+        m_client->inspectedURLChanged(loader->URL().url());
+        deleteAllValues(m_consoleMessages);
+        m_consoleMessages.clear();
+        if (windowVisible()) {
+            clearScriptConsoleMessages();
+            clearNetworkTimeline();
+
+            // We don't add the main resource until its load is committed. This
+            // is needed to keep the load for a user-entered URL from showing
+            // up in the list of resources for the page they are navigating
+            // away from.
+            addAndUpdateScriptResource(m_mainResource.get());
+        }
+    }
+
+    for (Frame* frame = loader->frame(); frame; frame = frame->tree()->traverseNext(loader->frame()))
+        if (ResourcesMap* resourceMap = m_frameResources.get(frame))
+            pruneResources(resourceMap, loader);
+}
+
+void InspectorController::frameDetachedFromParent(Frame* frame)
+{
+    if (ResourcesMap* resourceMap = m_frameResources.get(frame))
+        removeAllResources(resourceMap);
+}
+
+void InspectorController::addResource(InspectorResource* resource)
+{
+    m_resources.set(resource->identifier, resource);
+
+    Frame* frame = resource->frame.get();
+    ResourcesMap* resourceMap = m_frameResources.get(frame);
+    if (resourceMap)
+        resourceMap->set(resource->identifier, resource);
+    else {
+        resourceMap = new ResourcesMap;
+        resourceMap->set(resource->identifier, resource);
+        m_frameResources.set(frame, resourceMap);
+    }
+}
+
+void InspectorController::removeResource(InspectorResource* resource)
+{
+    m_resources.remove(resource->identifier);
+
+    Frame* frame = resource->frame.get();
+    ResourcesMap* resourceMap = m_frameResources.get(frame);
+    if (!resourceMap) {
+        ASSERT_NOT_REACHED();
+        return;
+    }
+
+    resourceMap->remove(resource->identifier);
+    if (resourceMap->isEmpty()) {
+        m_frameResources.remove(frame);
+        delete resourceMap;
+    }
+}
+
+void InspectorController::didLoadResourceFromMemoryCache(DocumentLoader* loader, const ResourceRequest& request, const ResourceResponse& response, int length)
+{
+    InspectorResource* resource = new InspectorResource(m_nextIdentifier--, loader, loader->frame());
+    resource->finished = true;
+    resource->request = request;
+    resource->response = response;
+    resource->length = length;
+    resource->cached = true;
+    resource->startTime = currentTime();
+    resource->responseReceivedTime = resource->startTime;
+    resource->endTime = resource->startTime;
+
+    if (loader->frame() == m_inspectedPage->mainFrame() && request.url() == loader->requestURL())
+        m_mainResource = resource;
+
+    addResource(resource);
+
+    if (windowVisible())
+        addAndUpdateScriptResource(resource);
+}
+
+void InspectorController::identifierForInitialRequest(unsigned long identifier, DocumentLoader* loader, const ResourceRequest& request)
+{
+    InspectorResource* resource = new InspectorResource(identifier, loader, loader->frame());
+    resource->request = request;
+
+    if (loader->frame() == m_inspectedPage->mainFrame() && request.url() == loader->requestURL())
+        m_mainResource = resource;
+
+    addResource(resource);
+}
+
+void InspectorController::willSendRequest(DocumentLoader* loader, unsigned long identifier, ResourceRequest& request, const ResourceResponse& redirectResponse)
+{
+    InspectorResource* resource = m_resources.get(identifier).get();
+    if (!resource)
+        return;
+
+    resource->startTime = currentTime();
+
+    if (resource->request != request)
+        resource->request = request;
+
+    if (!redirectResponse.isNull())
+        resource->redirectResponse = redirectResponse;
+
+    if (resource != m_mainResource && windowVisible()) {
+        if (!resource->scriptObject)
+            addScriptResource(resource);
+        else
+            updateScriptResource(resource, resource->request);
+
+        updateScriptResource(resource, resource->startTime, resource->responseReceivedTime, resource->endTime);
+
+        if (!redirectResponse.isNull())
+            updateScriptResource(resource, redirectResponse, true);
+    }
+}
+
+void InspectorController::didReceiveResponse(DocumentLoader*, unsigned long identifier, const ResourceResponse& response)
+{
+    InspectorResource* resource = m_resources.get(identifier).get();
+    if (!resource)
+        return;
+
+    resource->response = response;
+    resource->responseReceivedTime = currentTime();
+
+    if (windowVisible() && resource->scriptObject) {
+        updateScriptResource(resource, response);
+        updateScriptResource(resource, resource->startTime, resource->responseReceivedTime, resource->endTime);
+    }
+}
+
+void InspectorController::didReceiveContentLength(DocumentLoader*, unsigned long identifier, int lengthReceived)
+{
+    InspectorResource* resource = m_resources.get(identifier).get();
+    if (!resource)
+        return;
+
+    resource->length += lengthReceived;
+
+    if (windowVisible() && resource->scriptObject)
+        updateScriptResource(resource, resource->length);
+}
+
+void InspectorController::didFinishLoading(DocumentLoader* loader, unsigned long identifier)
+{
+    RefPtr<InspectorResource> resource = m_resources.get(identifier);
+    if (!resource)
+        return;
+
+    removeResource(resource.get());
+
+    resource->finished = true;
+    resource->endTime = currentTime();
+
+    addResource(resource.get());
+
+    if (windowVisible() && resource->scriptObject) {
+        updateScriptResource(resource.get(), resource->startTime, resource->responseReceivedTime, resource->endTime);
+        updateScriptResource(resource.get(), resource->finished);
+    }
+}
+
+void InspectorController::didFailLoading(DocumentLoader* loader, unsigned long identifier, const ResourceError& error)
+{
+    RefPtr<InspectorResource> resource = m_resources.get(identifier);
+    if (!resource)
+        return;
+
+    removeResource(resource.get());
+
+    resource->finished = true;
+    resource->failed = true;
+    resource->error = error;
+    resource->endTime = currentTime();
+
+    addResource(resource.get());
+
+    if (windowVisible() && resource->scriptObject) {
+        updateScriptResource(resource.get(), resource->error);
+        updateScriptResource(resource.get(), resource->startTime, resource->responseReceivedTime, resource->endTime);
+        updateScriptResource(resource.get(), resource->finished, resource->failed);
+    }
+}
+
+} // namespace WebCore
diff --git a/WebCore/page/InspectorController.h b/WebCore/page/InspectorController.h
new file mode 100644 (file)
index 0000000..b0f968f
--- /dev/null
@@ -0,0 +1,140 @@
+/*
+ * Copyright (C) 2007 Apple Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer. 
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution. 
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission. 
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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 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.
+ */
+
+#ifndef InspectorController_h
+#define InspectorController_h
+
+#include "Chrome.h"
+#include <JavaScriptCore/JavaScriptCore.h>
+#include <wtf/HashMap.h>
+#include <wtf/RefPtr.h>
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+class DocumentLoader;
+class Frame;
+class InspectorClient;
+class Node;
+class Page;
+class ResourceResponse;
+class ResourceError;
+
+struct ConsoleMessage;
+struct InspectorResource;
+struct ResourceRequest;
+
+class InspectorController {
+public:
+    typedef HashMap<long long, RefPtr<InspectorResource> > ResourcesMap;
+    typedef HashMap<RefPtr<Frame>, ResourcesMap*> FrameResourcesMap;
+
+    InspectorController(Page*, InspectorClient*);
+    ~InspectorController();
+
+    Page* inspectedPage() const { return m_inspectedPage; }
+
+    void inspect(Node*);
+    void highlight(Node*);
+    void hideHighlight();
+
+    bool windowVisible();
+    void setWindowVisible(bool visible = true);
+
+    void addMessageToConsole(MessageSource, MessageLevel, const String& message, unsigned lineNumber, const String& sourceID);
+
+    void attachWindow();
+    void detachWindow();
+
+    JSContextRef scriptContext() const { return m_scriptContext; };
+    void setScriptContext(JSContextRef context) { m_scriptContext = context; };
+
+    void windowScriptObjectAvailable();
+
+    void scriptObjectReady();
+    void windowUnloading();
+
+    void populateScriptResources();
+    void clearScriptResources();
+
+    void didCommitLoad(DocumentLoader*);
+    void frameDetachedFromParent(Frame*);
+
+    void didLoadResourceFromMemoryCache(DocumentLoader*, const ResourceRequest&, const ResourceResponse&, int length);
+
+    void identifierForInitialRequest(unsigned long identifier, DocumentLoader*, const ResourceRequest&);
+    void willSendRequest(DocumentLoader*, unsigned long identifier, ResourceRequest&, const ResourceResponse& redirectResponse);
+    void didReceiveResponse(DocumentLoader*, unsigned long identifier, const ResourceResponse&);
+    void didReceiveContentLength(DocumentLoader*, unsigned long identifier, int lengthReceived);
+    void didFinishLoading(DocumentLoader*, unsigned long identifier);
+    void didFailLoading(DocumentLoader*, unsigned long identifier, const ResourceError&);
+
+    const ResourcesMap& resources() const { return m_resources; }
+private:
+    void focusNode();
+
+    void addScriptConsoleMessage(const ConsoleMessage*);
+    void clearScriptConsoleMessages();
+
+    void clearNetworkTimeline();
+
+    void addResource(InspectorResource*);
+    void removeResource(InspectorResource*);
+
+    JSObjectRef addScriptResource(InspectorResource*);
+    void removeScriptResource(InspectorResource*);
+
+    JSObjectRef addAndUpdateScriptResource(InspectorResource*);
+    void updateScriptResource(InspectorResource*, const ResourceRequest&);
+    void updateScriptResource(InspectorResource*, const ResourceResponse&, bool redirect = false);
+    void updateScriptResource(InspectorResource*, const ResourceError&);
+    void updateScriptResource(InspectorResource*, int length);
+    void updateScriptResource(InspectorResource*, bool finished, bool failed = false);
+    void updateScriptResource(InspectorResource*, double startTime, double responseReceivedTime, double endTime);
+
+    void pruneResources(ResourcesMap*, DocumentLoader* loaderToKeep = 0);
+    void removeAllResources(ResourcesMap* map) { pruneResources(map); }
+
+    Page* m_inspectedPage;
+    InspectorClient* m_client;
+    Page* m_page;
+    RefPtr<Node> m_nodeToFocus;
+    RefPtr<InspectorResource> m_mainResource;
+    ResourcesMap m_resources;
+    FrameResourcesMap m_frameResources;
+    Vector<ConsoleMessage*> m_consoleMessages;
+    JSObjectRef m_scriptObject;
+    JSObjectRef m_controllerScriptObject;
+    JSContextRef m_scriptContext;
+    bool m_windowVisible;
+    long long m_nextIdentifier;
+};
+
+} // namespace WebCore
+
+#endif // !defined(InspectorController_h)
index 2545f18b602114f1ecb8f574891979b2f6c1d8b4..78097212c7876a61d9ef058d26be86d6d4364550 100644 (file)
@@ -33,6 +33,7 @@
 #include "FrameTree.h"
 #include "FrameView.h"
 #include "HistoryItem.h"
+#include "InspectorController.h"
 #include "ProgressTracker.h"
 #include "RenderWidget.h"
 #include "SelectionController.h"
@@ -63,6 +64,7 @@ Page::Page(ChromeClient* chromeClient, ContextMenuClient* contextMenuClient, Edi
     , m_frameCount(0)
     , m_tabKeyCyclesThroughElements(true)
     , m_defersLoading(false)
+    , m_parentInspectorController(0)
 {
     if (!allPages) {
         allPages = new HashSet<Page*>;
@@ -201,4 +203,9 @@ void Page::clearUndoRedoOperations()
     m_editorClient->clearUndoRedoOperations();
 }
 
+void Page::setInspectorClient(InspectorClient* client)
+{
+    m_inspectorController.set(new InspectorController(this, client));
+}
+
 } // namespace WebCore
index a7512db1e7d7b1d0074ced460d878bf6bf824716..c7f9dd928f37383e36b7c921f63768133841cba6 100644 (file)
@@ -44,6 +44,8 @@ namespace WebCore {
     class EditorClient;
     class FocusController;
     class Frame;
+    class InspectorClient;
+    class InspectorController;
     class Node;
     class ProgressTracker;
     class Selection;
@@ -87,8 +89,14 @@ namespace WebCore {
         DragController* dragController() const { return m_dragController.get(); }
         FocusController* focusController() const { return m_focusController.get(); }
         ContextMenuController* contextMenuController() const { return m_contextMenuController.get(); }
+        InspectorController* inspectorController() const { return m_inspectorController.get(); }
         Settings* settings() const { return m_settings.get(); }
         ProgressTracker* progress() const { return m_progress.get(); }
+
+        void setInspectorClient(InspectorClient*);
+
+        void setParentInspectorController(InspectorController* controller) { m_parentInspectorController = controller; }
+        InspectorController* parentInspectorController() const { return m_parentInspectorController; }
         
         void setTabKeyCyclesThroughElements(bool b) { m_tabKeyCyclesThroughElements = b; }
         bool tabKeyCyclesThroughElements() const { return m_tabKeyCyclesThroughElements; }
@@ -112,6 +120,7 @@ namespace WebCore {
         OwnPtr<DragController> m_dragController;
         OwnPtr<FocusController> m_focusController;
         OwnPtr<ContextMenuController> m_contextMenuController;
+        OwnPtr<InspectorController> m_inspectorController;
         OwnPtr<Settings> m_settings;
         OwnPtr<ProgressTracker> m_progress;
         
@@ -127,6 +136,8 @@ namespace WebCore {
         bool m_tabKeyCyclesThroughElements;
         bool m_defersLoading;
 
+        InspectorController* m_parentInspectorController;
+
 #if PLATFORM(WIN)
         static HINSTANCE s_instanceHandle;
 #endif
diff --git a/WebCore/page/inspector/ConsolePanel.js b/WebCore/page/inspector/ConsolePanel.js
new file mode 100644 (file)
index 0000000..758281e
--- /dev/null
@@ -0,0 +1,345 @@
+WebInspector.ConsolePanel = function()
+{
+    WebInspector.Panel.call(this);
+
+    this.messages = [];
+
+    this.commandHistory = [];
+    this.commandOffset = 0;
+
+    this.messageList = document.createElement("ol");
+    this.messageList.className = "console-message-list";
+    this.element.appendChild(this.messageList);
+
+    var console = this;
+    this.messageList.addEventListener("click", function(event) { console.messageListClicked(event) }, true);
+
+    this.consolePrompt = document.createElement("textarea");
+    this.consolePrompt.className = "console-prompt";
+    this.element.appendChild(this.consolePrompt);
+
+    this.consolePrompt.addEventListener("keydown", function(event) { console.promptKeypress(event) }, false);
+}
+
+WebInspector.ConsolePanel.prototype = {
+    show: function()
+    {
+        WebInspector.consoleListItem.item.select();
+        WebInspector.Panel.prototype.show.call(this);
+    },
+
+    hide: function()
+    {
+        WebInspector.consoleListItem.item.deselect();
+        WebInspector.Panel.prototype.hide.call(this);
+    },
+
+    addMessage: function(msg)
+    {
+        if (msg.url in WebInspector.resourceURLMap) {
+            msg.resource = WebInspector.resourceURLMap[msg.url];
+            switch (msg.level) {
+                case WebInspector.ConsoleMessage.WarningMessageLevel:
+                    ++msg.resource.warnings;
+                    msg.resource.panel.addMessageToSource(msg);
+                    break;
+                case WebInspector.ConsoleMessage.ErrorMessageLevel:
+                    ++msg.resource.errors;
+                    msg.resource.panel.addMessageToSource(msg);
+                    break;
+            }
+        }
+        this.messages.push(msg);
+
+        var item = msg.toListItem();
+        item.message = msg;
+        this.messageList.appendChild(item);
+        item.scrollIntoView(false);
+    },
+
+    clearMessages: function()
+    {
+        for (var i = 0; i < this.messages.length; ++i) {
+            var resource = this.messages[i].resource;
+            if (!resource)
+                continue;
+
+            resource.errors = 0;
+            resource.warnings = 0;
+        }
+
+        this.messages = [];
+        this.messageList.removeChildren();
+    },
+
+    messageListClicked: function(event)
+    {
+        var link = event.target.firstParentOrSelfWithNodeName("a");
+        if (link) {
+            WebInspector.updateFocusedNode(link.representedNode);
+            return;
+        }
+
+        var item = event.target.firstParentOrSelfWithNodeName("li");
+        if (!item)
+            return;
+
+        var resource = item.message.resource;
+        if (!resource)
+            return;
+
+        resource.panel.showSourceLine(item.message.line);
+
+        event.stopPropagation();
+        event.preventDefault();
+    },
+
+    promptKeypress: function(event)
+    {
+        switch (event.keyIdentifier) {
+            case "Enter":
+                this._onEnterPressed(event);
+                break;
+            case "Up":
+                this._onUpPressed(event);
+                break;
+            case "Down":
+                this._onDownPressed(event);
+                break;
+        }
+    },
+
+    _onEnterPressed: function(event)
+    {
+        event.preventDefault();
+        event.stopPropagation();
+
+        var str = this.consolePrompt.value;
+        if (!str.length)
+            return;
+
+        this.commandHistory.push(str);
+        this.commandOffset = 0;
+
+        this.consolePrompt.value = "";
+
+        var result;
+        var exception = false;
+        try {
+            // This with block is needed to work around http://bugs.webkit.org/show_bug.cgi?id=11399
+            with (InspectorController.inspectedWindow()) {
+                result = eval(str);
+            }
+        } catch(e) {
+            result = e;
+            exception = true;
+        }
+
+        var level = exception ? WebInspector.ConsoleMessage.ErrorMessageLevel : WebInspector.ConsoleMessage.LogMessageLevel;
+
+        this.addMessage(new WebInspector.ConsoleCommand(str, this._outputToNode(result)));
+    },
+
+    _onUpPressed: function(event)
+    {
+        event.preventDefault();
+        event.stopPropagation();
+
+        if (this.commandOffset == this.commandHistory.length)
+            return;
+
+        if (this.commandOffset == 0)
+            this.tempSavedCommand = this.consolePrompt.value;
+
+        ++this.commandOffset;
+        this.consolePrompt.value = this.commandHistory[this.commandHistory.length - this.commandOffset];
+        this.consolePrompt.moveCursorToEnd();
+    },
+
+    _onDownPressed: function(event)
+    {
+        event.preventDefault();
+        event.stopPropagation();
+
+        if (this.commandOffset == 0)
+            return;
+
+        --this.commandOffset;
+
+        if (this.commandOffset == 0) {
+            this.consolePrompt.value = this.tempSavedCommand;
+            this.consolePrompt.moveCursorToEnd();
+            delete this.tempSavedCommand;
+            return;
+        }
+
+        this.consolePrompt.value = this.commandHistory[this.commandHistory.length - this.commandOffset];
+        this.consolePrompt.moveCursorToEnd();
+    },
+
+    _outputToNode: function(output)
+    {
+        if (output instanceof Node) {
+            var anchor = document.createElement("a");
+            anchor.innerHTML = output.titleInfo().title;
+            anchor.representedNode = output;
+            return anchor;
+        }
+        return document.createTextNode(Object.describe(output));
+    }
+}
+
+WebInspector.ConsolePanel.prototype.__proto__ = WebInspector.Panel.prototype;
+
+WebInspector.ConsoleMessage = function(source, level, message, line, url)
+{
+    this.source = source;
+    this.level = level;
+    this.message = message;
+    this.line = line;
+    this.url = url;
+}
+
+WebInspector.ConsoleMessage.prototype = {
+    get shortURL()
+    {
+        if (this.resource)
+            return this.resource.displayName;
+        return this.url;
+    },
+
+    toListItem: function()
+    {
+        var item = document.createElement("li");
+        item.className = "console-message";
+        switch (this.source) {
+            case WebInspector.ConsoleMessage.HTMLMessageSource:
+                item.className += " console-html-source";
+                break;
+            case WebInspector.ConsoleMessage.XMLMessageSource:
+                item.className += " console-xml-source";
+                break;
+            case WebInspector.ConsoleMessage.JSMessageSource:
+                item.className += " console-js-source";
+                break;
+            case WebInspector.ConsoleMessage.CSSMessageSource:
+                item.className += " console-css-source";
+                break;
+            case WebInspector.ConsoleMessage.OtherMessageSource:
+                item.className += " console-other-source";
+                break;
+        }
+
+        switch (this.level) {
+            case WebInspector.ConsoleMessage.TipMessageLevel:
+                item.className += " console-tip-level";
+                break;
+            case WebInspector.ConsoleMessage.LogMessageLevel:
+                item.className += " console-log-level";
+                break;
+            case WebInspector.ConsoleMessage.WarningMessageLevel:
+                item.className += " console-warning-level";
+                break;
+            case WebInspector.ConsoleMessage.ErrorMessageLevel:
+                item.className += " console-error-level";
+        }
+
+
+        var messageDiv = document.createElement("div");
+        messageDiv.className = "console-message-message";
+        messageDiv.innerText = this.message;
+        item.appendChild(messageDiv);
+
+        var urlDiv = document.createElement("div");
+        urlDiv.className = "console-message-url";
+        urlDiv.innerText = this.url;
+        item.appendChild(urlDiv);
+
+        if (this.line >= 0) {
+            var lineDiv = document.createElement("div");
+            lineDiv.className = "console-message-line";
+            lineDiv.innerText = this.line;
+            item.appendChild(lineDiv);
+        }
+
+        return item;
+    },
+
+    toString: function()
+    {
+        var sourceString;
+        switch (this.source) {
+            case WebInspector.ConsoleMessage.HTMLMessageSource:
+                sourceString = "HTML";
+                break;
+            case WebInspector.ConsoleMessage.XMLMessageSource:
+                sourceString = "XML";
+                break;
+            case WebInspector.ConsoleMessage.JSMessageSource:
+                sourceString = "JS";
+                break;
+            case WebInspector.ConsoleMessage.CSSMessageSource:
+                sourceString = "CSS";
+                break;
+            case WebInspector.ConsoleMessage.OtherMessageSource:
+                sourceString = "Other";
+                break;
+        }
+
+        var levelString;
+        switch (this.level) {
+            case WebInspector.ConsoleMessage.TipMessageLevel:
+                levelString = "Tip";
+                break;
+            case WebInspector.ConsoleMessage.LogMessageLevel:
+                levelString = "Log";
+                break;
+            case WebInspector.ConsoleMessage.WarningMessageLevel:
+                levelString = "Warning";
+                break;
+            case WebInspector.ConsoleMessage.ErrorMessageLevel:
+                levelString = "Error";
+                break;
+        }
+
+        return sourceString + " " + levelString + ": " + this.message + "\n" + this.url + " line " + this.line;
+    }
+}
+
+// Note: Keep these constants in sync with the ones in Chrome.h
+WebInspector.ConsoleMessage.HTMLMessageSource = 0;
+WebInspector.ConsoleMessage.XMLMessageSource  = 1;
+WebInspector.ConsoleMessage.JSMessageSource   = 2;
+WebInspector.ConsoleMessage.CSSMessageSource  = 3;
+WebInspector.ConsoleMessage.OtherMessageSource = 4;
+
+WebInspector.ConsoleMessage.TipMessageLevel     = 0;
+WebInspector.ConsoleMessage.LogMessageLevel     = 1;
+WebInspector.ConsoleMessage.WarningMessageLevel = 2;
+WebInspector.ConsoleMessage.ErrorMessageLevel   = 3;
+
+WebInspector.ConsoleCommand = function(input, output)
+{
+    this.input = input;
+    this.output = output;
+}
+
+WebInspector.ConsoleCommand.prototype = {
+    toListItem: function()
+    {
+        var item = document.createElement("li");
+        item.className = "console-command";
+
+        var inputDiv = document.createElement("div");
+        inputDiv.className = "console-command-input";
+        inputDiv.innerText = this.input;
+        item.appendChild(inputDiv);
+
+        var outputDiv = document.createElement("div");
+        outputDiv.className = "console-command-output";
+        outputDiv.appendChild(this.output);
+        item.appendChild(outputDiv);
+
+        return item;
+    }
+}
diff --git a/WebCore/page/inspector/Images/attachedShadow.png b/WebCore/page/inspector/Images/attachedShadow.png
new file mode 100644 (file)
index 0000000..2c19e5f
Binary files /dev/null and b/WebCore/page/inspector/Images/attachedShadow.png differ
diff --git a/WebCore/page/inspector/Images/bottomShadow.png b/WebCore/page/inspector/Images/bottomShadow.png
new file mode 100644 (file)
index 0000000..6b31524
Binary files /dev/null and b/WebCore/page/inspector/Images/bottomShadow.png differ
diff --git a/WebCore/page/inspector/Images/breadcrumbBackground.png b/WebCore/page/inspector/Images/breadcrumbBackground.png
new file mode 100644 (file)
index 0000000..516452b
Binary files /dev/null and b/WebCore/page/inspector/Images/breadcrumbBackground.png differ
diff --git a/WebCore/page/inspector/Images/checker.png b/WebCore/page/inspector/Images/checker.png
new file mode 100644 (file)
index 0000000..8349908
Binary files /dev/null and b/WebCore/page/inspector/Images/checker.png differ
diff --git a/WebCore/page/inspector/Images/console.png b/WebCore/page/inspector/Images/console.png
new file mode 100644 (file)
index 0000000..c85fed0
Binary files /dev/null and b/WebCore/page/inspector/Images/console.png differ
diff --git a/WebCore/page/inspector/Images/darkShadow.png b/WebCore/page/inspector/Images/darkShadow.png
new file mode 100644 (file)
index 0000000..2b7ad47
Binary files /dev/null and b/WebCore/page/inspector/Images/darkShadow.png differ
diff --git a/WebCore/page/inspector/Images/disclosureDownPressed.png b/WebCore/page/inspector/Images/disclosureDownPressed.png
new file mode 100644 (file)
index 0000000..32ac517
Binary files /dev/null and b/WebCore/page/inspector/Images/disclosureDownPressed.png differ
diff --git a/WebCore/page/inspector/Images/disclosureRightDown.png b/WebCore/page/inspector/Images/disclosureRightDown.png
new file mode 100644 (file)
index 0000000..104ea86
Binary files /dev/null and b/WebCore/page/inspector/Images/disclosureRightDown.png differ
diff --git a/WebCore/page/inspector/Images/disclosureRightPressed.png b/WebCore/page/inspector/Images/disclosureRightPressed.png
new file mode 100644 (file)
index 0000000..41c9b20
Binary files /dev/null and b/WebCore/page/inspector/Images/disclosureRightPressed.png differ
diff --git a/WebCore/page/inspector/Images/document.png b/WebCore/page/inspector/Images/document.png
new file mode 100644 (file)
index 0000000..fa9c3f5
Binary files /dev/null and b/WebCore/page/inspector/Images/document.png differ
diff --git a/WebCore/page/inspector/Images/domViewButton.png b/WebCore/page/inspector/Images/domViewButton.png
new file mode 100644 (file)
index 0000000..7ad1e79
Binary files /dev/null and b/WebCore/page/inspector/Images/domViewButton.png differ
diff --git a/WebCore/page/inspector/Images/domViewButtonSelected.png b/WebCore/page/inspector/Images/domViewButtonSelected.png
new file mode 100644 (file)
index 0000000..aca8a8b
Binary files /dev/null and b/WebCore/page/inspector/Images/domViewButtonSelected.png differ
diff --git a/WebCore/page/inspector/Images/downTriangle.png b/WebCore/page/inspector/Images/downTriangle.png
new file mode 100644 (file)
index 0000000..18a2a89
Binary files /dev/null and b/WebCore/page/inspector/Images/downTriangle.png differ
diff --git a/WebCore/page/inspector/Images/errorIcon.png b/WebCore/page/inspector/Images/errorIcon.png
new file mode 100644 (file)
index 0000000..d6ec461
Binary files /dev/null and b/WebCore/page/inspector/Images/errorIcon.png differ
diff --git a/WebCore/page/inspector/Images/errorMediumIcon.png b/WebCore/page/inspector/Images/errorMediumIcon.png
new file mode 100644 (file)
index 0000000..6ca32bb
Binary files /dev/null and b/WebCore/page/inspector/Images/errorMediumIcon.png differ
diff --git a/WebCore/page/inspector/Images/folder.png b/WebCore/page/inspector/Images/folder.png
new file mode 100644 (file)
index 0000000..9bd7d9e
Binary files /dev/null and b/WebCore/page/inspector/Images/folder.png differ
diff --git a/WebCore/page/inspector/Images/goArrow.png b/WebCore/page/inspector/Images/goArrow.png
new file mode 100644 (file)
index 0000000..f318a56
Binary files /dev/null and b/WebCore/page/inspector/Images/goArrow.png differ
diff --git a/WebCore/page/inspector/Images/gradient.png b/WebCore/page/inspector/Images/gradient.png
new file mode 100644 (file)
index 0000000..0f80565
Binary files /dev/null and b/WebCore/page/inspector/Images/gradient.png differ
diff --git a/WebCore/page/inspector/Images/gradientHighlight.png b/WebCore/page/inspector/Images/gradientHighlight.png
new file mode 100644 (file)
index 0000000..ded3423
Binary files /dev/null and b/WebCore/page/inspector/Images/gradientHighlight.png differ
diff --git a/WebCore/page/inspector/Images/gradientHighlightBottom.png b/WebCore/page/inspector/Images/gradientHighlightBottom.png
new file mode 100644 (file)
index 0000000..2ae60d5
Binary files /dev/null and b/WebCore/page/inspector/Images/gradientHighlightBottom.png differ
diff --git a/WebCore/page/inspector/Images/hideStatusWidget.png b/WebCore/page/inspector/Images/hideStatusWidget.png
new file mode 100644 (file)
index 0000000..52ecece
Binary files /dev/null and b/WebCore/page/inspector/Images/hideStatusWidget.png differ
diff --git a/WebCore/page/inspector/Images/hideStatusWidgetPressed.png b/WebCore/page/inspector/Images/hideStatusWidgetPressed.png
new file mode 100644 (file)
index 0000000..f041662
Binary files /dev/null and b/WebCore/page/inspector/Images/hideStatusWidgetPressed.png differ
diff --git a/WebCore/page/inspector/Images/network.png b/WebCore/page/inspector/Images/network.png
new file mode 100644 (file)
index 0000000..bc215bc
Binary files /dev/null and b/WebCore/page/inspector/Images/network.png differ
diff --git a/WebCore/page/inspector/Images/paneBottomGrow.png b/WebCore/page/inspector/Images/paneBottomGrow.png
new file mode 100644 (file)
index 0000000..d55b865
Binary files /dev/null and b/WebCore/page/inspector/Images/paneBottomGrow.png differ
diff --git a/WebCore/page/inspector/Images/paneBottomGrowActive.png b/WebCore/page/inspector/Images/paneBottomGrowActive.png
new file mode 100644 (file)
index 0000000..ef3f259
Binary files /dev/null and b/WebCore/page/inspector/Images/paneBottomGrowActive.png differ
diff --git a/WebCore/page/inspector/Images/paneGrowHandleLine.png b/WebCore/page/inspector/Images/paneGrowHandleLine.png
new file mode 100644 (file)
index 0000000..4eaf61b
Binary files /dev/null and b/WebCore/page/inspector/Images/paneGrowHandleLine.png differ
diff --git a/WebCore/page/inspector/Images/paneHeader.png b/WebCore/page/inspector/Images/paneHeader.png
new file mode 100644 (file)
index 0000000..cc66afa
Binary files /dev/null and b/WebCore/page/inspector/Images/paneHeader.png differ
diff --git a/WebCore/page/inspector/Images/paneHeaderActive.png b/WebCore/page/inspector/Images/paneHeaderActive.png
new file mode 100644 (file)
index 0000000..08205fb
Binary files /dev/null and b/WebCore/page/inspector/Images/paneHeaderActive.png differ
diff --git a/WebCore/page/inspector/Images/plainDocument.png b/WebCore/page/inspector/Images/plainDocument.png
new file mode 100644 (file)
index 0000000..2e92b71
Binary files /dev/null and b/WebCore/page/inspector/Images/plainDocument.png differ
diff --git a/WebCore/page/inspector/Images/popupArrows.png b/WebCore/page/inspector/Images/popupArrows.png
new file mode 100644 (file)
index 0000000..b980e46
Binary files /dev/null and b/WebCore/page/inspector/Images/popupArrows.png differ
diff --git a/WebCore/page/inspector/Images/rightTriangle.png b/WebCore/page/inspector/Images/rightTriangle.png
new file mode 100644 (file)
index 0000000..9f519f2
Binary files /dev/null and b/WebCore/page/inspector/Images/rightTriangle.png differ
diff --git a/WebCore/page/inspector/Images/segment.png b/WebCore/page/inspector/Images/segment.png
new file mode 100644 (file)
index 0000000..bcef26a
Binary files /dev/null and b/WebCore/page/inspector/Images/segment.png differ
diff --git a/WebCore/page/inspector/Images/segmentEnd.png b/WebCore/page/inspector/Images/segmentEnd.png
new file mode 100644 (file)
index 0000000..374a53d
Binary files /dev/null and b/WebCore/page/inspector/Images/segmentEnd.png differ
diff --git a/WebCore/page/inspector/Images/segmentHover.png b/WebCore/page/inspector/Images/segmentHover.png
new file mode 100644 (file)
index 0000000..f54c029
Binary files /dev/null and b/WebCore/page/inspector/Images/segmentHover.png differ
diff --git a/WebCore/page/inspector/Images/segmentHoverEnd.png b/WebCore/page/inspector/Images/segmentHoverEnd.png
new file mode 100644 (file)
index 0000000..e377c2d
Binary files /dev/null and b/WebCore/page/inspector/Images/segmentHoverEnd.png differ
diff --git a/WebCore/page/inspector/Images/segmentSelected.png b/WebCore/page/inspector/Images/segmentSelected.png
new file mode 100644 (file)
index 0000000..a7f3a8f
Binary files /dev/null and b/WebCore/page/inspector/Images/segmentSelected.png differ
diff --git a/WebCore/page/inspector/Images/segmentSelectedEnd.png b/WebCore/page/inspector/Images/segmentSelectedEnd.png
new file mode 100644 (file)
index 0000000..be2c61b
Binary files /dev/null and b/WebCore/page/inspector/Images/segmentSelectedEnd.png differ
diff --git a/WebCore/page/inspector/Images/showStatusWidget.png b/WebCore/page/inspector/Images/showStatusWidget.png
new file mode 100644 (file)
index 0000000..051d883
Binary files /dev/null and b/WebCore/page/inspector/Images/showStatusWidget.png differ
diff --git a/WebCore/page/inspector/Images/showStatusWidgetPressed.png b/WebCore/page/inspector/Images/showStatusWidgetPressed.png
new file mode 100644 (file)
index 0000000..5622c9c
Binary files /dev/null and b/WebCore/page/inspector/Images/showStatusWidgetPressed.png differ
diff --git a/WebCore/page/inspector/Images/sidbarItemBackground.png b/WebCore/page/inspector/Images/sidbarItemBackground.png
new file mode 100644 (file)
index 0000000..5b94167
Binary files /dev/null and b/WebCore/page/inspector/Images/sidbarItemBackground.png differ
diff --git a/WebCore/page/inspector/Images/sidebarActionWidget.png b/WebCore/page/inspector/Images/sidebarActionWidget.png
new file mode 100644 (file)
index 0000000..daa1aff
Binary files /dev/null and b/WebCore/page/inspector/Images/sidebarActionWidget.png differ
diff --git a/WebCore/page/inspector/Images/sidebarActionWidgetPressed.png b/WebCore/page/inspector/Images/sidebarActionWidgetPressed.png
new file mode 100644 (file)
index 0000000..794b187
Binary files /dev/null and b/WebCore/page/inspector/Images/sidebarActionWidgetPressed.png differ
diff --git a/WebCore/page/inspector/Images/sidebarAttachWidget.png b/WebCore/page/inspector/Images/sidebarAttachWidget.png
new file mode 100644 (file)
index 0000000..0804062
Binary files /dev/null and b/WebCore/page/inspector/Images/sidebarAttachWidget.png differ
diff --git a/WebCore/page/inspector/Images/sidebarAttachWidgetPressed.png b/WebCore/page/inspector/Images/sidebarAttachWidgetPressed.png
new file mode 100644 (file)
index 0000000..b9a1c13
Binary files /dev/null and b/WebCore/page/inspector/Images/sidebarAttachWidgetPressed.png differ
diff --git a/WebCore/page/inspector/Images/sidebarDetachWidget.png b/WebCore/page/inspector/Images/sidebarDetachWidget.png
new file mode 100644 (file)
index 0000000..a4eb407
Binary files /dev/null and b/WebCore/page/inspector/Images/sidebarDetachWidget.png differ
diff --git a/WebCore/page/inspector/Images/sidebarDetachWidgetPressed.png b/WebCore/page/inspector/Images/sidebarDetachWidgetPressed.png
new file mode 100644 (file)
index 0000000..4a289e2
Binary files /dev/null and b/WebCore/page/inspector/Images/sidebarDetachWidgetPressed.png differ
diff --git a/WebCore/page/inspector/Images/sidebarResizeWidget.png b/WebCore/page/inspector/Images/sidebarResizeWidget.png
new file mode 100644 (file)
index 0000000..7c1ff70
Binary files /dev/null and b/WebCore/page/inspector/Images/sidebarResizeWidget.png differ
diff --git a/WebCore/page/inspector/Images/sidebarSelection.png b/WebCore/page/inspector/Images/sidebarSelection.png
new file mode 100644 (file)
index 0000000..a06d4b6
Binary files /dev/null and b/WebCore/page/inspector/Images/sidebarSelection.png differ
diff --git a/WebCore/page/inspector/Images/sidebarSelectionBlurred.png b/WebCore/page/inspector/Images/sidebarSelectionBlurred.png
new file mode 100644 (file)
index 0000000..5b5fe3f
Binary files /dev/null and b/WebCore/page/inspector/Images/sidebarSelectionBlurred.png differ
diff --git a/WebCore/page/inspector/Images/sidebarSelectionBlurredTall.png b/WebCore/page/inspector/Images/sidebarSelectionBlurredTall.png
new file mode 100644 (file)
index 0000000..1ff0b3d
Binary files /dev/null and b/WebCore/page/inspector/Images/sidebarSelectionBlurredTall.png differ
diff --git a/WebCore/page/inspector/Images/sidebarSelectionGray.png b/WebCore/page/inspector/Images/sidebarSelectionGray.png
new file mode 100644 (file)
index 0000000..bb09671
Binary files /dev/null and b/WebCore/page/inspector/Images/sidebarSelectionGray.png differ
diff --git a/WebCore/page/inspector/Images/sidebarSelectionGrayTall.png b/WebCore/page/inspector/Images/sidebarSelectionGrayTall.png
new file mode 100644 (file)
index 0000000..b7a30b6
Binary files /dev/null and b/WebCore/page/inspector/Images/sidebarSelectionGrayTall.png differ
diff --git a/WebCore/page/inspector/Images/sidebarSelectionTall.png b/WebCore/page/inspector/Images/sidebarSelectionTall.png
new file mode 100644 (file)
index 0000000..d46dbb3
Binary files /dev/null and b/WebCore/page/inspector/Images/sidebarSelectionTall.png differ
diff --git a/WebCore/page/inspector/Images/sidebarStatusAreaBackground.png b/WebCore/page/inspector/Images/sidebarStatusAreaBackground.png
new file mode 100644 (file)
index 0000000..0127d9d
Binary files /dev/null and b/WebCore/page/inspector/Images/sidebarStatusAreaBackground.png differ
diff --git a/WebCore/page/inspector/Images/sourceViewButton.png b/WebCore/page/inspector/Images/sourceViewButton.png
new file mode 100644 (file)
index 0000000..8c78f26
Binary files /dev/null and b/WebCore/page/inspector/Images/sourceViewButton.png differ
diff --git a/WebCore/page/inspector/Images/sourceViewButtonSelected.png b/WebCore/page/inspector/Images/sourceViewButtonSelected.png
new file mode 100644 (file)
index 0000000..bd9dea4
Binary files /dev/null and b/WebCore/page/inspector/Images/sourceViewButtonSelected.png differ
diff --git a/WebCore/page/inspector/Images/splitviewDimple.png b/WebCore/page/inspector/Images/splitviewDimple.png
new file mode 100644 (file)
index 0000000..584ffd4
Binary files /dev/null and b/WebCore/page/inspector/Images/splitviewDimple.png differ
diff --git a/WebCore/page/inspector/Images/splitviewDividerBackground.png b/WebCore/page/inspector/Images/splitviewDividerBackground.png
new file mode 100644 (file)
index 0000000..1120a7f
Binary files /dev/null and b/WebCore/page/inspector/Images/splitviewDividerBackground.png differ
diff --git a/WebCore/page/inspector/Images/tab.png b/WebCore/page/inspector/Images/tab.png
new file mode 100644 (file)
index 0000000..2f5000a
Binary files /dev/null and b/WebCore/page/inspector/Images/tab.png differ
diff --git a/WebCore/page/inspector/Images/tabSelected.png b/WebCore/page/inspector/Images/tabSelected.png
new file mode 100644 (file)
index 0000000..76c2f66
Binary files /dev/null and b/WebCore/page/inspector/Images/tabSelected.png differ
similarity index 76%
rename from WebKit/WebInspector/webInspector/Images/scrollTrackBottom.png
rename to WebCore/page/inspector/Images/timelinePillBlue.png
index 226c33b8ff5d3a8334106e029ac2355b0a07a461..c897faa7234746b308f4cb8b47f68d497d1ddb18 100644 (file)
Binary files a/WebKit/WebInspector/webInspector/Images/scrollTrackBottom.png and b/WebCore/page/inspector/Images/timelinePillBlue.png differ
similarity index 77%
rename from WebKit/WebInspector/webInspector/Images/scrollThumbBottom.png
rename to WebCore/page/inspector/Images/timelinePillGray.png
index b0b388324911c3a914325deb60667364609c7555..212889619ea65c751d44f9f7634f8cf15bdf9883 100644 (file)
Binary files a/WebKit/WebInspector/webInspector/Images/scrollThumbBottom.png and b/WebCore/page/inspector/Images/timelinePillGray.png differ
diff --git a/WebCore/page/inspector/Images/timelinePillGreen.png b/WebCore/page/inspector/Images/timelinePillGreen.png
new file mode 100644 (file)
index 0000000..9b66125
Binary files /dev/null and b/WebCore/page/inspector/Images/timelinePillGreen.png differ
diff --git a/WebCore/page/inspector/Images/timelinePillOrange.png b/WebCore/page/inspector/Images/timelinePillOrange.png
new file mode 100644 (file)
index 0000000..dd944fb
Binary files /dev/null and b/WebCore/page/inspector/Images/timelinePillOrange.png differ
diff --git a/WebCore/page/inspector/Images/timelinePillPurple.png b/WebCore/page/inspector/Images/timelinePillPurple.png
new file mode 100644 (file)
index 0000000..21b96f7
Binary files /dev/null and b/WebCore/page/inspector/Images/timelinePillPurple.png differ
similarity index 76%
rename from WebKit/WebInspector/webInspector/Images/scrollThumbTop.png
rename to WebCore/page/inspector/Images/timelinePillRed.png
index 543360ac4d1714fe29c9a838721b098b1031d21f..f5e213ba2f411b92400bf4301e9ac20f438addbf 100644 (file)
Binary files a/WebKit/WebInspector/webInspector/Images/scrollThumbTop.png and b/WebCore/page/inspector/Images/timelinePillRed.png differ
similarity index 76%
rename from WebKit/WebInspector/webInspector/Images/scrollThumbMiddle.png
rename to WebCore/page/inspector/Images/timelinePillYellow.png
index ccdce6fddec6f5f34b2741daa07c1d63c4dbf6ac..ae2a5a23e2b193fc15dea7e7ffdb3470f4c782c5 100644 (file)
Binary files a/WebKit/WebInspector/webInspector/Images/scrollThumbMiddle.png and b/WebCore/page/inspector/Images/timelinePillYellow.png differ
diff --git a/WebCore/page/inspector/Images/tipBalloon.png b/WebCore/page/inspector/Images/tipBalloon.png
new file mode 100644 (file)
index 0000000..4cdf738
Binary files /dev/null and b/WebCore/page/inspector/Images/tipBalloon.png differ
diff --git a/WebCore/page/inspector/Images/tipBalloonBottom.png b/WebCore/page/inspector/Images/tipBalloonBottom.png
new file mode 100644 (file)
index 0000000..3317a5a
Binary files /dev/null and b/WebCore/page/inspector/Images/tipBalloonBottom.png differ
diff --git a/WebCore/page/inspector/Images/tipIcon.png b/WebCore/page/inspector/Images/tipIcon.png
new file mode 100644 (file)
index 0000000..8ca6124
Binary files /dev/null and b/WebCore/page/inspector/Images/tipIcon.png differ
diff --git a/WebCore/page/inspector/Images/tipIconPressed.png b/WebCore/page/inspector/Images/tipIconPressed.png
new file mode 100644 (file)
index 0000000..443e410
Binary files /dev/null and b/WebCore/page/inspector/Images/tipIconPressed.png differ
diff --git a/WebCore/page/inspector/Images/toggleDown.png b/WebCore/page/inspector/Images/toggleDown.png
new file mode 100644 (file)
index 0000000..9e73bfb
Binary files /dev/null and b/WebCore/page/inspector/Images/toggleDown.png differ
diff --git a/WebCore/page/inspector/Images/toggleUp.png b/WebCore/page/inspector/Images/toggleUp.png
new file mode 100644 (file)
index 0000000..6b62aee
Binary files /dev/null and b/WebCore/page/inspector/Images/toggleUp.png differ
diff --git a/WebCore/page/inspector/Images/toolbarBackground.png b/WebCore/page/inspector/Images/toolbarBackground.png
new file mode 100644 (file)
index 0000000..257d63d
Binary files /dev/null and b/WebCore/page/inspector/Images/toolbarBackground.png differ
diff --git a/WebCore/page/inspector/Images/toolbarBackgroundInactive.png b/WebCore/page/inspector/Images/toolbarBackgroundInactive.png
new file mode 100644 (file)
index 0000000..a62b8df
Binary files /dev/null and b/WebCore/page/inspector/Images/toolbarBackgroundInactive.png differ
diff --git a/WebCore/page/inspector/Images/toolbarButton.png b/WebCore/page/inspector/Images/toolbarButton.png
new file mode 100644 (file)
index 0000000..3245e99
Binary files /dev/null and b/WebCore/page/inspector/Images/toolbarButton.png differ
diff --git a/WebCore/page/inspector/Images/toolbarButtonInactive.png b/WebCore/page/inspector/Images/toolbarButtonInactive.png
new file mode 100644 (file)
index 0000000..ea45266
Binary files /dev/null and b/WebCore/page/inspector/Images/toolbarButtonInactive.png differ
diff --git a/WebCore/page/inspector/Images/toolbarButtonPressed.png b/WebCore/page/inspector/Images/toolbarButtonPressed.png
new file mode 100644 (file)
index 0000000..eb8e946
Binary files /dev/null and b/WebCore/page/inspector/Images/toolbarButtonPressed.png differ
diff --git a/WebCore/page/inspector/Images/toolbarButtonPressedInactive.png b/WebCore/page/inspector/Images/toolbarButtonPressedInactive.png
new file mode 100644 (file)
index 0000000..44ec20f
Binary files /dev/null and b/WebCore/page/inspector/Images/toolbarButtonPressedInactive.png differ
diff --git a/WebCore/page/inspector/Images/toolbarSplitButtonDivider.png b/WebCore/page/inspector/Images/toolbarSplitButtonDivider.png
new file mode 100644 (file)
index 0000000..ac50295
Binary files /dev/null and b/WebCore/page/inspector/Images/toolbarSplitButtonDivider.png differ
diff --git a/WebCore/page/inspector/Images/toolbarSplitButtonDividerInactive.png b/WebCore/page/inspector/Images/toolbarSplitButtonDividerInactive.png
new file mode 100644 (file)
index 0000000..6a7e431
Binary files /dev/null and b/WebCore/page/inspector/Images/toolbarSplitButtonDividerInactive.png differ
diff --git a/WebCore/page/inspector/Images/treeDownTriangleBlack.png b/WebCore/page/inspector/Images/treeDownTriangleBlack.png
new file mode 100644 (file)
index 0000000..0821112
Binary files /dev/null and b/WebCore/page/inspector/Images/treeDownTriangleBlack.png differ
diff --git a/WebCore/page/inspector/Images/treeDownTriangleWhite.png b/WebCore/page/inspector/Images/treeDownTriangleWhite.png
new file mode 100644 (file)
index 0000000..1667b51
Binary files /dev/null and b/WebCore/page/inspector/Images/treeDownTriangleWhite.png differ
diff --git a/WebCore/page/inspector/Images/treeLeftTriangleBlack.png b/WebCore/page/inspector/Images/treeLeftTriangleBlack.png
new file mode 100644 (file)
index 0000000..81bc7e0
Binary files /dev/null and b/WebCore/page/inspector/Images/treeLeftTriangleBlack.png differ
diff --git a/WebCore/page/inspector/Images/treeRightTriangleBlack.png b/WebCore/page/inspector/Images/treeRightTriangleBlack.png
new file mode 100644 (file)
index 0000000..90de820
Binary files /dev/null and b/WebCore/page/inspector/Images/treeRightTriangleBlack.png differ
diff --git a/WebCore/page/inspector/Images/treeRightTriangleWhite.png b/WebCore/page/inspector/Images/treeRightTriangleWhite.png
new file mode 100644 (file)
index 0000000..2b6a82f
Binary files /dev/null and b/WebCore/page/inspector/Images/treeRightTriangleWhite.png differ
diff --git a/WebCore/page/inspector/Images/warningIcon.png b/WebCore/page/inspector/Images/warningIcon.png
new file mode 100644 (file)
index 0000000..f37727e
Binary files /dev/null and b/WebCore/page/inspector/Images/warningIcon.png differ
diff --git a/WebCore/page/inspector/Images/warningMediumIcon.png b/WebCore/page/inspector/Images/warningMediumIcon.png
new file mode 100644 (file)
index 0000000..291e111
Binary files /dev/null and b/WebCore/page/inspector/Images/warningMediumIcon.png differ
diff --git a/WebCore/page/inspector/Images/warningsErrors.png b/WebCore/page/inspector/Images/warningsErrors.png
new file mode 100644 (file)
index 0000000..878b593
Binary files /dev/null and b/WebCore/page/inspector/Images/warningsErrors.png differ
diff --git a/WebCore/page/inspector/NetworkPanel.js b/WebCore/page/inspector/NetworkPanel.js
new file mode 100644 (file)
index 0000000..e0c85d8
--- /dev/null
@@ -0,0 +1,945 @@
+WebInspector.NetworkPanel = function()
+{
+    WebInspector.Panel.call(this);
+
+    this.timelineEntries = [];
+
+    this.timelineElement = document.createElement("div");
+    this.timelineElement.className = "network-timeline";
+    this.element.appendChild(this.timelineElement);
+
+    this.summaryElement = document.createElement("div");
+    this.summaryElement.className = "network-summary";
+    this.element.appendChild(this.summaryElement);
+
+    this.dividersElement = document.createElement("div");
+    this.dividersElement.className = "network-dividers";
+    this.timelineElement.appendChild(this.dividersElement);
+
+    this.resourcesElement = document.createElement("div");
+    this.resourcesElement.className = "network-resources";
+    var panel = this;
+    this.resourcesElement.addEventListener("click", function(event) { return panel.onClick(event) }, false);
+    this.timelineElement.appendChild(this.resourcesElement);
+
+    var graphArea = document.createElement("div");
+    graphArea.className = "network-graph-area";
+    this.summaryElement.appendChild(graphArea);
+
+    this.graphLabelElement = document.createElement("div");
+    this.graphLabelElement.className = "network-graph-label";
+    graphArea.appendChild(this.graphLabelElement);
+
+    this.graphModeSelectElement = document.createElement("select");
+    this.graphModeSelectElement.className = "network-graph-mode";
+    this.graphModeSelectElement.addEventListener("change", function(event) { return panel.onModeChange(event) }, false);
+    this.graphLabelElement.appendChild(this.graphModeSelectElement);
+    this.graphLabelElement.appendChild(document.createElement("br"));
+
+    var sizeOptionElement = document.createElement("option");
+    sizeOptionElement.textContent = "Transfer Size";
+    sizeOptionElement.calculator = new WebInspector.TransferSizeCalculator();
+    this.graphModeSelectElement.appendChild(sizeOptionElement);
+
+    var timeOptionElement = document.createElement("option");
+    timeOptionElement.textContent = "Transfer Time";
+    timeOptionElement.calculator = new WebInspector.TransferTimeCalculator();
+    this.graphModeSelectElement.appendChild(timeOptionElement);
+
+    var graphSideElement = document.createElement("div");
+    graphSideElement.className = "network-graph-side";
+    graphArea.appendChild(graphSideElement);
+
+    this.summaryGraphElement = document.createElement("canvas");
+    this.summaryGraphElement.setAttribute("width", "450");
+    this.summaryGraphElement.setAttribute("height", "38");
+    this.summaryGraphElement.className = "network-summary-graph";
+    graphSideElement.appendChild(this.summaryGraphElement);
+
+    this.legendElement = document.createElement("div");
+    this.legendElement.className = "network-graph-legend";
+    graphSideElement.appendChild(this.legendElement);
+
+    var networkPanel = this;
+    window.addEventListener("resize", function() { networkPanel.updateTimelineDividersIfNeeded() }, false);
+
+    this.setup = true;
+    this.drawSummaryGraph(); // draws an empty graph
+}
+
+WebInspector.NetworkPanel.prototype = {
+    show: function()
+    {
+        WebInspector.networkListItem.select();
+        WebInspector.Panel.prototype.show.call(this);
+    },
+
+    hide: function()
+    {
+        WebInspector.networkListItem.deselect();
+        WebInspector.Panel.prototype.hide.call(this);
+    },
+
+    onClick: function(event)
+    {
+        var resourceElement = event.target.firstParentOrSelfWithClass("network-resource");
+        if (!resourceElement)
+            return;
+
+        var balloon = event.target.firstParentOrSelfWithClass("tip-balloon");
+        if (balloon) {
+            resourceElement.timelineEntry.toggleTipBalloon(event);
+            return;
+        }
+
+        resourceElement.timelineEntry.toggleShowingInfo();
+    },
+
+    onModeChange: function(event)
+    {
+        this.updateSummaryGraph();
+    },
+
+    get calculator()
+    {
+        return this.graphModeSelectElement.options[this.graphModeSelectElement.selectedIndex].calculator;
+    },
+
+    get totalDuration()
+    {
+        return this.latestEndTime - this.earliestStartTime;
+    },
+
+    refresh: function()
+    {
+        if (!this.setup)
+            return;
+
+        this.needsRefresh = false;
+
+        // calling refresh will call updateTimelineBoundriesIfNeeded, which can clear needsRefresh for future entries,
+        // so find all the entries that needs refresh first, then loop back trough them to call refresh
+        var entriesNeedingRefresh = [];
+        var entriesLength = this.timelineEntries.length;
+        for (var i = 0; i < entriesLength; ++i) {
+            var entry = this.timelineEntries[i];
+            if (entry.needsRefresh || entry.infoNeedsRefresh)
+                entriesNeedingRefresh.push(entry);
+        }
+
+        entriesLength = entriesNeedingRefresh.length;
+        for (var i = 0; i < entriesLength; ++i)
+            entriesNeedingRefresh[i].refresh(false, true, true);
+
+        this.updateTimelineDividersIfNeeded();
+        this.sortTimelineEntriesIfNeeded();
+        this.updateSummaryGraph();
+    },
+
+    makeLegendElement: function(label, value, color)
+    {
+        var legendElement = document.createElement("label");
+        legendElement.className = "network-graph-legend-item";
+
+        if (color) {
+            var swatch = document.createElement("canvas");
+            swatch.className = "network-graph-legend-swatch";
+            swatch.setAttribute("width", "13");
+            swatch.setAttribute("height", "24");
+
+            legendElement.appendChild(swatch);
+
+            this.drawSwatch(swatch, color);
+        }
+
+        var labelElement = document.createElement("div");
+        labelElement.className = "network-graph-legend-label";
+        legendElement.appendChild(labelElement);
+
+        var headerElement = document.createElement("div");
+        var headerElement = document.createElement("div");
+        headerElement.className = "network-graph-legend-header";
+        headerElement.textContent = label;
+        labelElement.appendChild(headerElement);
+
+        var valueElement = document.createElement("div");
+        valueElement.className = "network-graph-legend-value";
+        valueElement.textContent = value;
+        labelElement.appendChild(valueElement);
+
+        return legendElement;
+    },
+
+    sortTimelineEntriesSoonIfNeeded: function()
+    {
+        if ("sortTimelineEntriesTimeout" in this)
+            return;
+
+        var _self = this;
+        this.sortTimelineEntriesTimeout = setTimeout(function () { _self.sortTimelineEntriesIfNeeded() }, 500);
+    },
+
+    sortTimelineEntriesIfNeeded: function()
+    {
+        if ("sortTimelineEntriesTimeout" in this) {
+            clearTimeout(this.sortTimelineEntriesTimeout);
+            delete this.sortTimelineEntriesTimeout;
+        }
+
+        this.timelineEntries.sort(WebInspector.NetworkPanel.timelineEntryCompare);
+
+        var nextSibling = null;
+        for (var i = (this.timelineEntries.length - 1); i >= 0; --i) {
+            var entry = this.timelineEntries[i];
+            if (entry.resourceElement.nextSibling !== nextSibling)
+                this.resourcesElement.insertBefore(entry.resourceElement, nextSibling);
+            nextSibling = entry.resourceElement;
+        }
+    },
+
+    updateTimelineBoundriesIfNeeded: function(resource, immediate)
+    {
+        var didUpdate = false;
+        if (resource.startTime !== -1 && (this.earliestStartTime === undefined || resource.startTime < this.earliestStartTime)) {
+            this.earliestStartTime = resource.startTime;
+            didUpdate = true;
+        }
+
+        if (resource.endTime !== -1 && (this.latestEndTime === undefined || resource.endTime > this.latestEndTime)) {
+            this.latestEndTime = resource.endTime;
+            didUpdate = true;
+        }
+
+        if (didUpdate) {
+            if (immediate) {
+                this.refreshAllTimelineEntries(true, true, immediate);
+                this.updateTimelineDividersIfNeeded();
+            } else {
+                this.refreshAllTimelineEntriesSoon(true, true, immediate);
+                this.updateTimelineDividersSoonIfNeeded();
+            }
+        }
+
+        return didUpdate;
+    },
+
+    updateTimelineDividersSoonIfNeeded: function()
+    {
+        if ("updateTimelineDividersTimeout" in this)
+            return;
+
+        var _self = this;
+        this.updateTimelineDividersTimeout = setTimeout(function () { _self.updateTimelineDividersIfNeeded() }, 500);
+    },
+
+    updateTimelineDividersIfNeeded: function()
+    {
+        if ("updateTimelineDividersTimeout" in this) {
+            clearTimeout(this.updateTimelineDividersTimeout);
+            delete this.updateTimelineDividersTimeout;
+        }
+
+        if (!this.visible) {
+            this.needsRefresh = true;
+            return;
+        }
+
+        var dividerCount = Math.round(this.dividersElement.offsetWidth / 64);
+        var timeSlice = this.totalDuration / dividerCount;
+        
+        if (this.lastDividerTimeSlice === timeSlice)
+            return;
+
+        this.lastDividerTimeSlice = timeSlice;
+
+        this.dividersElement.removeChildren();
+
+        for (var i = 1; i <= dividerCount; ++i) {
+            var divider = document.createElement("div");
+            divider.className = "network-divider";
+            if (i === dividerCount)
+                divider.addStyleClass("last");
+            divider.style.left = ((i / dividerCount) * 100) + "%";
+
+            var label = document.createElement("div");
+            label.className = "network-divider-label";
+            label.textContent = Number.secondsToString(timeSlice * i);
+            divider.appendChild(label);
+
+            this.dividersElement.appendChild(divider);
+        }
+    },
+
+    refreshAllTimelineEntriesSoon: function(skipBoundryUpdate, skipTimelineSort, immediate)
+    {
+        if ("refreshAllTimelineEntriesTimeout" in this)
+            return;
+
+        var _self = this;
+        this.refreshAllTimelineEntriesTimeout = setTimeout(function () { _self.refreshAllTimelineEntries() }, 500, skipBoundryUpdate, skipTimelineSort, immediate);
+    },
+
+    refreshAllTimelineEntries: function(skipBoundryUpdate, skipTimelineSort, immediate)
+    {
+        if ("refreshAllTimelineEntriesTimeout" in this) {
+            clearTimeout(this.refreshAllTimelineEntriesTimeout);
+            delete this.refreshAllTimelineEntriesTimeout;
+        }
+
+        var entriesLength = this.timelineEntries.length;
+        for (var i = 0; i < entriesLength; ++i)
+            this.timelineEntries[i].refresh(skipBoundryUpdate, skipTimelineSort, immediate);
+    },
+
+    drawSwatch: function(canvas, color) {
+        var ctx = canvas.getContext('2d');
+
+        ctx.save();
+
+        drawSwatchSquare(ctx, color);
+
+        ctx.save();
+
+        ctx.translate(0, (13 * 2) - 1);
+        ctx.scale(1, -1);
+
+        drawSwatchSquare(ctx, color);
+
+        ctx.restore();
+
+        fadeOutRect(ctx, 0, 0 + 13, 13, 13, 0.5, 0.0);
+
+        ctx.restore();
+    },
+
+    drawSummaryGraph: function(segments) {
+        if (!this.summaryGraphElement)
+            return;
+
+        var ctx = this.summaryGraphElement.getContext('2d');
+        var x = 0;
+        var y = 0;
+        var width = 450;
+        var height = 19;
+
+        if (!segments || !segments.length)
+            segments = [{color: "white", value: 1}];
+
+        ctx.save();
+
+        ctx.clearRect(x, y, width, (height * 2));
+
+        drawShadowLine(ctx, x, y + height, width, 2);
+        drawPill(ctx, x, y, width, height, height / 2, segments);
+
+        ctx.save();
+
+        ctx.translate(0, (height * 2) + 1);
+        ctx.scale(1, -1);
+
+        drawPill(ctx, x, y, width, height, height / 2, segments);
+
+        ctx.restore();
+
+        fadeOutRect(ctx, x, y + height + 2, width, height, 0.5, 0.0);
+
+        ctx.restore();
+    },
+
+    updateSummaryGraphSoon: function()
+    {
+        if ("updateSummaryGraphTimeout" in this)
+            return;
+
+        var _self = this;
+        this.updateSummaryGraphTimeout = setTimeout(function () { _self.updateSummaryGraph() }, 500);
+    },
+
+    updateSummaryGraph: function()
+    {
+        if ("updateSummaryGraphTimeout" in this) {
+            clearTimeout(this.updateSummaryGraphTimeout);
+            delete this.updateSummaryGraphTimeout;
+        }
+
+        var graphInfo = this.calculator.computeValues(this.timelineEntries);
+
+        var categoryOrder = ["documents", "stylesheets", "images", "scripts", "other"];
+        var categoryColors = {documents: {r: 47, g: 102, b: 236}, stylesheets: {r: 157, g: 231, b: 119}, images: {r: 164, g: 60, b: 255}, scripts: {r: 255, g: 121, b: 0}, other: {r: 186, g: 186, b: 186}};
+        var fillSegments = [];
+
+        this.legendElement.removeChildren();
+
+        if (this.totalLegendLabel)
+            this.totalLegendLabel.parentNode.removeChild(this.totalLegendLabel);
+
+        this.totalLegendLabel = this.makeLegendElement(this.calculator.title, this.calculator.formatValue(graphInfo.total));
+        this.totalLegendLabel.addStyleClass("network-graph-legend-total");
+        this.graphLabelElement.appendChild(this.totalLegendLabel);
+
+        for (var i = 0; i < categoryOrder.length; ++i) {
+            var category = categoryOrder[i];
+            var size = graphInfo.categoryValues[category];
+            if (!size)
+                continue;
+
+            var color = categoryColors[category];
+            var colorString = "rgb(" + color.r + ", " + color.g + ", " + color.b + ")";
+
+            var fillSegment = {color: colorString, value: size};
+            fillSegments.push(fillSegment);
+
+            var legendLabel = this.makeLegendElement(category, this.calculator.formatValue(size), colorString);
+            this.legendElement.appendChild(legendLabel);
+        }
+
+        this.drawSummaryGraph(fillSegments);
+    },
+
+    clearTimeline: function()
+    {
+        delete this.earliestStartTime;
+        delete this.latestEndTime;
+
+        var entriesLength = this.timelineEntries.length;
+        for (var i = 0; i < entriesLength; ++i)
+            delete this.timelineEntries[i].resource.networkTimelineEntry;
+
+        this.timelineEntries = [];
+        this.resourcesElement.removeChildren();
+
+        this.drawSummaryGraph(); // draws an empty graph
+    },
+
+    addResourceToTimeline: function(resource)
+    {
+        var timelineEntry = new WebInspector.NetworkTimelineEntry(this, resource);
+        this.timelineEntries.push(timelineEntry);
+        this.resourcesElement.appendChild(timelineEntry.resourceElement);
+
+        timelineEntry.refresh();
+        this.updateSummaryGraphSoon();
+    }
+}
+
+WebInspector.NetworkPanel.prototype.__proto__ = WebInspector.Panel.prototype;
+
+WebInspector.NetworkPanel.timelineEntryCompare = function(a, b)
+{
+    if (a.resource.startTime < b.resource.startTime)
+        return -1;
+    if (a.resource.startTime > b.resource.startTime)
+        return 1;
+    if (a.resource.endTime < b.resource.endTime)
+        return -1;
+    if (a.resource.endTime > b.resource.endTime)
+        return 1;
+    return 0;
+}
+
+WebInspector.NetworkTimelineEntry = function(panel, resource)
+{
+    this.panel = panel;
+    this.resource = resource;
+    resource.networkTimelineEntry = this;
+
+    this.resourceElement = document.createElement("div");
+    this.resourceElement.className = "network-resource";
+    this.resourceElement.timelineEntry = this;
+
+    this.titleElement = document.createElement("div");
+    this.titleElement.className = "network-title";
+    this.resourceElement.appendChild(this.titleElement);
+
+    this.fileElement = document.createElement("div");
+    this.fileElement.className = "network-file";
+    this.fileElement.innerHTML = WebInspector.linkifyURL(resource.url, resource.displayName);
+    this.titleElement.appendChild(this.fileElement);
+
+    this.tipButtonElement = document.createElement("button");
+    this.tipButtonElement.className = "tip-button";
+    this.showingTipButton = this.resource.tips.length;
+    this.fileElement.insertBefore(this.tipButtonElement, this.fileElement.firstChild);
+
+    var entry = this;
+    this.tipButtonElement.addEventListener("click", function(event) { entry.toggleTipBalloon(event) }, false );
+
+    this.areaElement = document.createElement("div");
+    this.areaElement.className = "network-area";
+    this.titleElement.appendChild(this.areaElement);
+
+    this.barElement = document.createElement("div");
+    this.areaElement.appendChild(this.barElement);
+
+    this.infoElement = document.createElement("div");
+    this.infoElement.className = "network-info hidden";
+    this.resourceElement.appendChild(this.infoElement);
+}
+
+WebInspector.NetworkTimelineEntry.prototype = {
+    refresh: function(skipBoundryUpdate, skipTimelineSort, immediate)
+    {
+        if (!this.panel.visible) {
+            this.needsRefresh = true;
+            this.panel.needsRefresh = true;
+            return;
+        }
+
+        delete this.needsRefresh;
+
+        if (!skipBoundryUpdate) {
+            if (this.panel.updateTimelineBoundriesIfNeeded(this.resource, immediate))
+                return; // updateTimelineBoundriesIfNeeded calls refresh() on all entries, so we can just return
+        }
+
+        if (!skipTimelineSort) {
+            if (immediate)
+                this.panel.sortTimelineEntriesIfNeeded();
+            else
+                this.panel.sortTimelineEntriesSoonIfNeeded();
+        }
+
+        if (this.resource.startTime !== -1) {
+            var percentStart = ((this.resource.startTime - this.panel.earliestStartTime) / this.panel.totalDuration) * 100;
+            this.barElement.style.left = percentStart + "%";
+        } else {
+            this.barElement.style.left = null;
+        }
+
+        if (this.resource.endTime !== -1) {
+            var percentEnd = ((this.panel.latestEndTime - this.resource.endTime) / this.panel.totalDuration) * 100;
+            this.barElement.style.right = percentEnd + "%";
+        } else {
+            this.barElement.style.right = "0px";
+        }
+
+        this.barElement.className = "network-bar network-category-" + this.resource.category.title;
+
+        if (this.infoNeedsRefresh)
+            this.refreshInfo();
+    },
+
+    refreshInfo: function()
+    {
+        if (!this.showingInfo) {
+            this.infoNeedsRefresh = true;
+            return;
+        }
+
+        if (!this.panel.visible) {
+            this.panel.needsRefresh = true;
+            this.infoNeedsRefresh = true;
+            return;
+        }
+
+        this.infoNeedsRefresh = false;
+
+        this.infoElement.removeChildren();
+
+        var sections = [
+            {title: "Request", info: this.resource.sortedRequestHeaders},
+            {title: "Response", info: this.resource.sortedResponseHeaders}
+        ];
+
+        function createSectionTable(section) {
+            if (!section.info.length)
+                return;
+
+            var table = document.createElement("table");
+            this.infoElement.appendChild(table);
+
+            var heading = document.createElement("th");
+            heading.innerText = section.title;
+            var row = table.createTHead().insertRow(-1).appendChild(heading);
+            var body = document.createElement("tbody");
+            table.appendChild(body);
+
+            section.info.forEach(function(header) {
+                var row = body.insertRow(-1);
+                var th = document.createElement("th");
+                th.innerText = header.header;
+                row.appendChild(th);
+                row.insertCell(-1).innerText = header.value;
+            });
+        }
+        sections.forEach(createSectionTable, this);
+    },
+
+    refreshInfoIfNeeded: function()
+    {
+        if (this.infoNeedsRefresh === false)
+            return;
+
+        this.refreshInfo();
+    },
+
+    toggleShowingInfo: function()
+    {
+        this.showingInfo = !this.showingInfo;
+    },
+
+    get showingInfo()
+    {
+        return this._showingInfo;
+    },
+
+    set showingInfo(x)
+    {
+        if (this._showingInfo === x)
+            return;
+
+        this._showingInfo = x;
+
+        var element = this.infoElement;
+        if (x) {
+            element.removeStyleClass("hidden");
+            element.style.setProperty("overflow", "hidden");
+            this.refreshInfoIfNeeded();
+            WebInspector.animateStyle([{element: element, start: {height: 0}, end: {height: element.offsetHeight}}], 250, function() { element.style.removeProperty("height"); element.style.removeProperty("overflow") });
+        } else {
+            element.style.setProperty("overflow", "hidden");
+            WebInspector.animateStyle([{element: element, end: {height: 0}}], 250, function() { element.addStyleClass("hidden"); element.style.removeProperty("height") });
+        }
+    },
+
+    get showingTipButton()
+    {
+        return !this.tipButtonElement.hasStyleClass("hidden");
+    },
+
+    set showingTipButton(x)
+    {
+        if (x)
+            this.tipButtonElement.removeStyleClass("hidden");
+        else
+            this.tipButtonElement.addStyleClass("hidden");
+    },
+
+    toggleTipBalloon: function(event)
+    {
+        this.showingTipBalloon = !this.showingTipBalloon;
+        event.stopPropagation();
+    },
+
+    get showingTipBalloon()
+    {
+        return this._showingTipBalloon;
+    },
+
+    set showingTipBalloon(x)
+    {
+        if (this._showingTipBalloon === x)
+            return;
+
+        this._showingTipBalloon = x;
+
+        if (x) {
+            if (!this.tipBalloonElement) {
+                this.tipBalloonElement = document.createElement("div");
+                this.tipBalloonElement.className = "tip-balloon";
+                this.titleElement.appendChild(this.tipBalloonElement);
+
+                this.tipBalloonContentElement = document.createElement("div");
+                this.tipBalloonContentElement.className = "tip-balloon-content";
+                this.tipBalloonElement.appendChild(this.tipBalloonContentElement);
+                var tipText = '';
+                for (var id in this.resource.tips)
+                    tipText += this.resource.tips[id].message + "\n";
+                this.tipBalloonContentElement.textContent = tipText;
+            }
+
+            this.tipBalloonElement.removeStyleClass("hidden");
+            WebInspector.animateStyle([{element: this.tipBalloonElement, start: {left: 160, opacity: 0}, end: {left: 145, opacity: 1}}], 250);
+        } else {
+            var element = this.tipBalloonElement;
+            WebInspector.animateStyle([{element: this.tipBalloonElement, start: {left: 145, opacity: 1}, end: {left: 160, opacity: 0}}], 250, function() { element.addStyleClass("hidden") });
+        }
+    }
+}
+
+WebInspector.TimelineValueCalculator = function()
+{
+}
+
+WebInspector.TimelineValueCalculator.prototype = {
+    computeValues: function(entries)
+    {
+        var total = 0;
+        var categoryValues = {};
+
+        function compute(entry)
+        {
+            var value = this._value(entry);
+            if (value === undefined)
+                return;
+
+            if (!(entry.resource.category in categoryValues))
+                categoryValues[entry.resource.category] = 0;
+            categoryValues[entry.resource.category] += value;
+            total += value;
+        }
+        entries.forEach(compute, this);
+
+        return {categoryValues: categoryValues, total: total};
+    },
+
+    _value: function(entry)
+    {
+        return 0;
+    },
+
+    get title()
+    {
+        return "";
+    },
+
+    formatValue: function(value)
+    {
+        return value.toString();
+    }
+}
+
+WebInspector.TransferTimeCalculator = function()
+{
+    WebInspector.TimelineValueCalculator.call(this);
+}
+
+WebInspector.TransferTimeCalculator.prototype = {
+    computeValues: function(entries)
+    {
+        var entriesByCategory = {};
+        entries.forEach(function(entry) {
+            if (!(entry.resource.category in entriesByCategory))
+                entriesByCategory[entry.resource.category] = [];
+            entriesByCategory[entry.resource.category].push(entry);
+        });
+
+        var earliestStart;
+        var latestEnd;
+        var categoryValues = {};
+        for (var category in entriesByCategory) {
+            entriesByCategory[category].sort(WebInspector.NetworkPanel.timelineEntryCompare);
+            categoryValues[category] = 0;
+
+            var segment = {start: -1, end: -1};
+            entriesByCategory[category].forEach(function(entry) {
+                if (entry.resource.startTime == -1 || entry.resource.endTime == -1)
+                    return;
+
+                if (earliestStart === undefined)
+                    earliestStart = entry.resource.startTime;
+                else
+                    earliestStart = Math.min(earliestStart, entry.resource.startTime);
+
+                if (latestEnd === undefined)
+                    latestEnd = entry.resource.endTime;
+                else
+                    latestEnd = Math.max(latestEnd, entry.resource.endTime);
+
+                if (entry.resource.startTime <= segment.end) {
+                    segment.end = Math.max(segment.end, entry.resource.endTime);
+                    return;
+                }
+
+                categoryValues[category] += segment.end - segment.start;
+
+                segment.start = entry.resource.startTime;
+                segment.end = entry.resource.endTime;
+            });
+
+            // Add the last segment
+            categoryValues[category] += segment.end - segment.start;
+        }
+
+        return {categoryValues: categoryValues, total: latestEnd - earliestStart};
+    },
+
+    get title()
+    {
+        return "Transfer Time";
+    },
+
+    formatValue: function(value)
+    {
+        return Number.secondsToString(value);
+    }
+}
+
+WebInspector.TransferTimeCalculator.prototype.__proto__ = WebInspector.TimelineValueCalculator.prototype;
+
+WebInspector.TransferSizeCalculator = function()
+{
+    WebInspector.TimelineValueCalculator.call(this);
+}
+
+WebInspector.TransferSizeCalculator.prototype = {
+    _value: function(entry)
+    {
+        return entry.resource.contentLength;
+    },
+
+    get title()
+    {
+        return "Transfer Size";
+    },
+
+    formatValue: function(value)
+    {
+        return Number.bytesToString(value);
+    }
+}
+
+WebInspector.TransferSizeCalculator.prototype.__proto__ = WebInspector.TimelineValueCalculator.prototype;
+
+function makeRoundedRectPath(ctx, x, y, w, h, r) {
+    ctx.beginPath();
+    ctx.moveTo(x, y + r);
+    ctx.lineTo(x, y + h - r);
+    ctx.quadraticCurveTo(x, y + h, x + r, y + h);
+    ctx.lineTo(x + w - r, y + h);
+    ctx.quadraticCurveTo(x + w, y + h, x + w, y + h - r);
+    ctx.lineTo(x + w, y + r);
+    ctx.quadraticCurveTo(x + w, y, x + w - r, y);
+    ctx.lineTo(x + r, y);
+    ctx.quadraticCurveTo(x, y, x, y + r);
+    ctx.closePath();
+}
+
+function drawPillShading(ctx, x, y, w, h) {
+    var lightGradient = ctx.createLinearGradient(x, y, x, y + (h / 1.5));
+    lightGradient.addColorStop(0.0, 'rgba(220, 220, 220, 0.6)');
+    lightGradient.addColorStop(0.4, 'rgba(220, 220, 220, 0.2)');
+    lightGradient.addColorStop(1.0, 'rgba(255, 255, 255, 0.0)');
+
+    var darkGradient = ctx.createLinearGradient(x, y + (h / 3), x, y + h);
+    darkGradient.addColorStop(0.0, 'rgba(0, 0, 0, 0.0)');
+    darkGradient.addColorStop(0.8, 'rgba(0, 0, 0, 0.2)');
+    darkGradient.addColorStop(1.0, 'rgba(0, 0, 0, 0.5)');
+
+    ctx.fillStyle = darkGradient;
+    ctx.fillRect(x, y, w, h);
+
+    ctx.fillStyle = lightGradient;
+    ctx.fillRect(x, y, w, h);
+}
+
+function drawDividerLines(ctx, x, y, w, h) {
+    ctx.save();
+
+    ctx.lineWidth = 1;
+
+    for (var i = 1; i < 20; ++i) {
+        ctx.beginPath();
+        ctx.moveTo(x + (i * Math.round(w / 20)) + 0.5, y);
+        ctx.lineTo(x + (i * Math.round(w / 20)) + 0.5, y + h);
+        ctx.closePath();
+
+        ctx.strokeStyle = 'rgba(0, 0, 0, 0.2)';
+        ctx.stroke();
+
+        ctx.beginPath();
+        ctx.moveTo(x + (i * Math.round(w / 20)) + 1.5, y);
+        ctx.lineTo(x + (i * Math.round(w / 20)) + 1.5, y + h);
+        ctx.closePath();
+
+        ctx.strokeStyle = 'rgba(255, 255, 255, 0.2)';
+        ctx.stroke();
+    }
+
+    ctx.restore();
+}
+
+function fadeOutRect(ctx, x, y, w, h, a1, a2) {
+    ctx.save();
+
+    var gradient = ctx.createLinearGradient(x, y, x, y + h);
+    gradient.addColorStop(0.0, 'rgba(0, 0, 0, ' + (1.0 - a1) + ')');
+    gradient.addColorStop(0.8, 'rgba(0, 0, 0, ' + (1.0 - a2) + ')');
+    gradient.addColorStop(1.0, 'rgba(0, 0, 0, 1.0)');
+
+    ctx.globalCompositeOperation = 'destination-out';
+
+    ctx.fillStyle = gradient;
+    ctx.fillRect(x, y, w, h);
+
+    ctx.restore();
+}
+
+function drawPillSegments(ctx, x, y, w, h, segments) {
+    var total = 0;
+    for (var i = 0; i < segments.length; ++i)
+        total += segments[i].value;
+
+    var percents = segments.map(function(s) { return Math.max(Math.round(100 * s.value / total), 1) });
+    var percentTotal = 0;
+    for (var i = 0; i < percents.length; ++i)
+        percentTotal += percents[i];
+
+    while (percentTotal > 100) {
+        var difference = percentTotal - 100;
+        for (var i = 0; i < percents.length && percentTotal > 100; ++i) {
+            if (percents[i] > 1) {
+                --percents[i];
+                --percentTotal;
+            }
+        }
+    }
+
+    var previousWidth = 0;
+    for (var i = 0; i < segments.length; ++i) {
+        var width = Math.round(w * percents[i] / 100);
+        ctx.fillStyle = segments[i].color;
+        ctx.fillRect(x + previousWidth, y, width, h);
+        previousWidth += width;
+    }
+}
+
+function drawPill(ctx, x, y, w, h, r, segments) {
+    ctx.save();
+
+    makeRoundedRectPath(ctx, x, y, w, h, r);
+    ctx.clip();
+
+    drawPillSegments(ctx, x, y, w, h, segments);
+    drawDividerLines(ctx, x, y, w, h);
+    drawPillShading(ctx, x, y, w, h);
+
+    ctx.restore();
+}
+
+function drawShadowLine(ctx, x, y, w, h) {
+    ctx.beginPath();
+    ctx.moveTo(x + 1.5, y + 0.5);
+    ctx.lineTo(x + w - 1.5, y + 0.5);
+    ctx.closePath();
+
+    ctx.strokeStyle = 'rgba(0, 0, 0, 0.2)';
+    ctx.lineWidth = h;
+    ctx.stroke();
+}
+
+function drawSwatchSquare(ctx, color) {
+    ctx.save();
+
+    ctx.fillStyle = color;
+    ctx.fillRect(0, 0, 13, 13);
+
+    var gradient = ctx.createLinearGradient(0, 0, 13, 13);
+    gradient.addColorStop(0.0, 'rgba(255, 255, 255, 0.2)');
+    gradient.addColorStop(1.0, 'rgba(255, 255, 255, 0.0)');
+
+    ctx.fillStyle = gradient;
+    ctx.fillRect(0, 0, 13, 13);
+
+    gradient = ctx.createLinearGradient(13, 13, 0, 0);
+    gradient.addColorStop(0.0, 'rgba(0, 0, 0, 0.2)');
+    gradient.addColorStop(1.0, 'rgba(0, 0, 0, 0.0)');
+
+    ctx.fillStyle = gradient;
+    ctx.fillRect(0, 0, 13, 13);
+
+    ctx.strokeStyle = "rgba(0, 0, 0, 0.6)";
+    ctx.strokeRect(0.5, 0.5, 12, 12);
+
+    ctx.restore();
+}
diff --git a/WebCore/page/inspector/Resource.js b/WebCore/page/inspector/Resource.js
new file mode 100644 (file)
index 0000000..763b462
--- /dev/null
@@ -0,0 +1,606 @@
+WebInspector.Resource = function(requestHeaders, url, domain, path, lastPathComponent, identifier, mainResource, cached)
+{
+    this.identifier = identifier;
+
+    this.startTime = -1;
+    this.endTime = -1;
+    this.mainResource = mainResource;
+    this.requestHeaders = requestHeaders;
+    this.url = url;
+    this.domain = domain;
+    this.path = path;
+    this.lastPathComponent = lastPathComponent;
+    this.cached = cached;
+
+    this.listItem = new WebInspector.ResourceTreeElement(this);
+    this.updateTitle();
+
+    this.category = WebInspector.resourceCategories.other;
+}
+
+// Keep these in sync with WebCore::InspectorResource::Type
+WebInspector.Resource.Type = {
+    Document:   0,
+    Stylesheet: 1,
+    Image:      2,
+    Script:     3,
+    Other:      4,
+
+    isTextType: function(type)
+    {
+        return (type == 0) || (type == 1) || (type == 3);
+    },
+
+    toString: function(type)
+    {
+        switch (type) {
+            case 0:
+                return "document";
+            case 1:
+                return "stylesheet";
+            case 2:
+                return "image";
+            case 3:
+                return "script";
+            case 4:
+            default:
+                return "other";
+        }
+    },
+}
+
+WebInspector.Resource.prototype = {
+    get url()
+    {
+        return this._url;
+    },
+
+    set url(x)
+    {
+        if (this._url === x)
+            return;
+
+        var oldURL = this._url;
+        this._url = x;
+        WebInspector.resourceURLChanged(this, oldURL);
+        this.updateTitleSoon();
+    },
+
+    get domain()
+    {
+        return this._domain;
+    },
+
+    set domain(x)
+    {
+        if (this._domain === x)
+            return;
+        this._domain = x;
+        this.updateTitleSoon();
+    },
+
+    get lastPathComponent()
+    {
+        return this._lastPathComponent;
+    },
+
+    set lastPathComponent(x)
+    {
+        if (this._lastPathComponent === x)
+            return;
+        this._lastPathComponent = x;
+        this._lastPathComponentLowerCase = x ? x.toLowerCase() : null;
+        this.updateTitleSoon();
+    },
+
+    get displayName()
+    {
+        var title = this.lastPathComponent;
+        if (!title)
+            title = this.domain;
+        if (!title)
+            title = this.url;
+        return title;
+    },
+
+    get startTime()
+    {
+        return this._startTime;
+    },
+
+    set startTime(x)
+    {
+        if (this._startTime === x)
+            return;
+
+        this._startTime = x;
+
+        if (this.networkTimelineEntry)
+            this.networkTimelineEntry.refresh();
+    },
+
+    get responseReceivedTime()
+    {
+        return this._responseReceivedTime;
+    },
+
+    set responseReceivedTime(x)
+    {
+        if (this._responseReceivedTime === x)
+            return;
+
+        this._responseReceivedTime = x;
+
+        if (this.networkTimelineEntry)
+            this.networkTimelineEntry.refresh();
+    },
+
+    get endTime()
+    {
+        return this._endTime;
+    },
+
+    set endTime(x)
+    {
+        if (this._endTime === x)
+            return;
+
+        this._endTime = x;
+
+        if (this.networkTimelineEntry)
+            this.networkTimelineEntry.refresh();
+    },
+
+    get contentLength()
+    {
+        return this._contentLength;
+    },
+
+    set contentLength(x)
+    {
+        if (this._contentLength === x)
+            return;
+
+        this._contentLength = x;
+
+        if (this._expectedContentLength && this._expectedContentLength > x) {
+            this.updateTitle();
+            var canvas = document.getElementById("loadingIcon" + this.identifier);
+            if (canvas)
+                WebInspector.drawLoadingPieChart(canvas, (x / this._expectedContentLength));
+        }
+
+        WebInspector.networkPanel.updateSummaryGraphSoon();
+    },
+
+    get expectedContentLength()
+    {
+        return this._expectedContentLength;
+    },
+
+    set expectedContentLength(x)
+    {
+        if (this._expectedContentLength === x)
+            return;
+
+        this._expectedContentLength = x;
+
+        if (x && this._contentLength && this._contentLength <= x) {
+            var canvas = document.getElementById("loadingIcon" + this.identifier);
+            if (canvas)
+                WebInspector.drawLoadingPieChart(canvas, (this._contentLength / x));
+        }
+    },
+
+    get finished()
+    {
+        return this._finished;
+    },
+
+    set finished(x)
+    {
+        if (this._finished === x)
+            return;
+
+        this._finished = x;
+        this.updateTitleSoon();
+
+        if (this.panel)
+            this.panel.needsRefresh = true;
+
+        if (x) {
+            var canvas = document.getElementById("loadingIcon" + this.identifier);
+            if (canvas)
+                canvas.parentNode.removeChild(canvas);
+
+            this._checkTips();
+            this._checkWarnings();
+        }
+    },
+
+    get failed()
+    {
+        return this._failed;
+    },
+
+    set failed(x)
+    {
+        this._failed = x;
+    },
+
+    get category()
+    {
+        return this._category;
+    },
+
+    set category(x)
+    {
+        if (this._category === x)
+            return;
+
+        var oldCategory = this._category;
+        if (oldCategory)
+            oldCategory.removeResource(this);
+
+        this._category = x;
+        this.updateTitle();
+
+        if (this._category)
+            this._category.addResource(this);
+
+        if (this.panel)
+            this.panel.needsRefresh = true;
+    },
+
+    get mimeType()
+    {
+        return this._mimeType;
+    },
+
+    set mimeType(x)
+    {
+        if (this._mimeType === x)
+            return;
+
+        this._mimeType = x;
+    },
+
+    get type()
+    {
+        return this._type;
+    },
+
+    set type(x)
+    {
+        if (this._type === x)
+            return;
+
+        this._type = x;
+
+        switch (x) {
+            case WebInspector.Resource.Type.Document:
+                this.category = WebInspector.resourceCategories.documents;
+                break;
+            case WebInspector.Resource.Type.Stylesheet:
+                this.category = WebInspector.resourceCategories.stylesheets;
+                break;
+            case WebInspector.Resource.Type.Script:
+                this.category = WebInspector.resourceCategories.scripts;
+                break;
+            case WebInspector.Resource.Type.Image:
+                this.category = WebInspector.resourceCategories.images;
+                break;
+            case WebInspector.Resource.Type.Other:
+            default:
+                this.category = WebInspector.resourceCategories.other;
+                break;
+        }
+    },
+
+    get documentNode() {
+        if ("identifier" in this)
+            return InspectorController.getResourceDocumentNode(this.identifier);
+        return null;
+    },
+
+    get requestHeaders()
+    {
+        if (this._requestHeaders === undefined)
+            this._requestHeaders = {};
+        return this._requestHeaders;
+    },
+
+    set requestHeaders(x)
+    {
+        if (this._requestHeaders === x)
+            return;
+
+        this._requestHeaders = x;
+        delete this._sortedRequestHeaders;
+
+        if (this.networkTimelineEntry)
+            this.networkTimelineEntry.refreshInfo();
+    },
+
+    get sortedRequestHeaders()
+    {
+        if (this._sortedRequestHeaders !== undefined)
+            return this._sortedRequestHeaders;
+
+        this._sortedRequestHeaders = [];
+        for (var key in this.requestHeaders)
+            this._sortedRequestHeaders.push({header: key, value: this.requestHeaders[key]});
+        this._sortedRequestHeaders.sort(function(a,b) { return a.header.localeCompare(b.header) });
+
+        return this._sortedRequestHeaders;
+    },
+
+    get responseHeaders()
+    {
+        if (this._responseHeaders === undefined)
+            this._responseHeaders = {};
+        return this._responseHeaders;
+    },
+
+    set responseHeaders(x)
+    {
+        if (this._responseHeaders === x)
+            return;
+
+        this._responseHeaders = x;
+        delete this._sortedResponseHeaders;
+
+        if (this.networkTimelineEntry)
+            this.networkTimelineEntry.refreshInfo();
+    },
+
+    get sortedResponseHeaders()
+    {
+        if (this._sortedResponseHeaders !== undefined)
+            return this._sortedResponseHeaders;
+
+        this._sortedResponseHeaders = [];
+        for (var key in this.responseHeaders)
+            this._sortedResponseHeaders.push({header: key, value: this.responseHeaders[key]});
+        this._sortedResponseHeaders.sort(function(a,b) { return a.header.localeCompare(b.header) });
+
+        return this._sortedResponseHeaders;
+    },
+
+    get tips()
+    {
+        if (!("_tips" in this))
+            this._tips = {};
+        return this._tips;
+    },
+
+    _addTip: function(tip)
+    {
+        if (tip.id in this.tips)
+            return;
+
+        this.tips[tip.id] = tip;
+
+        // FIXME: Re-enable this code once we have a scope bar in the Console.
+        // Otherwise, we flood the Console with too many tips.
+        /*
+        var msg = new WebInspector.ConsoleMessage(WebInspector.ConsoleMessage.OtherMessageSource,
+                    WebInspector.ConsoleMessage.TipMessageLevel, tip.message, -1, this.url);
+        WebInspector.consolePanel.addMessage(msg);
+        */
+
+        if (this.networkTimelineEntry)
+            this.networkTimelineEntry.showingTipButton = true;
+    },
+
+    _checkTips: function()
+    {
+        for (var tip in WebInspector.Tips)
+            this._checkTip(WebInspector.Tips[tip]);
+    },
+
+    _checkTip: function(tip)
+    {
+        var addTip = false;
+        switch (tip.id) {
+            case WebInspector.Tips.ResourceNotCompressed.id:
+                addTip = this._shouldCompress();
+                break;
+        }
+
+        if (addTip)
+            this._addTip(tip);
+    },
+
+    _shouldCompress: function()
+    {
+        return WebInspector.Resource.Type.isTextType(this.type)
+            && !("Content-Encoding" in this.responseHeaders)
+            && this.contentLength !== undefined
+            && this.contentLength >= 512;
+    },
+
+    _mimeTypeIsConsistentWithType: function()
+    {
+        if (this.type === undefined || this.type === WebInspector.Resource.Type.Other)
+            return true;
+
+        if (this.mimeType in WebInspector.MIMETypes)
+            return this.type in WebInspector.MIMETypes[this.mimeType];
+
+        return true;
+    },
+
+    _checkWarnings: function()
+    {
+        for (var warning in WebInspector.Warnings)
+            this._checkWarning(WebInspector.Warnings[warning]);
+    },
+
+    _checkWarning: function(warning)
+    {
+        var addWarning = false;
+        var msg;
+        switch (warning.id) {
+            case WebInspector.Warnings.IncorrectMIMEType.id:
+                if (!this._mimeTypeIsConsistentWithType())
+                    msg = new WebInspector.ConsoleMessage(WebInspector.ConsoleMessage.OtherMessageSource,
+                                WebInspector.ConsoleMessage.WarningMessageLevel,
+                                String.sprintf(WebInspector.Warnings.IncorrectMIMEType.message,
+                                    WebInspector.Resource.Type.toString(this.type), this.mimeType),
+                                -1, this.url);
+                break;
+        }
+
+        if (msg)
+            WebInspector.consolePanel.addMessage(msg);
+    },
+
+    updateTitleSoon: function()
+    {
+        if (this.updateTitleTimeout)
+            return;
+        var _self = this;
+        this.updateTitleTimeout = setTimeout(function () { _self.updateTitle() }, 0);
+    },
+
+    updateTitle: function()
+    {
+        delete this.updateTitleTimeout;
+
+        var title = this.displayName;
+
+        var info = "";
+        if (this.domain && (!WebInspector.mainResource || (WebInspector.mainResource && this.domain !== WebInspector.mainResource.domain)))
+            info = this.domain;
+
+        if (this.path && this.lastPathComponent) {
+            var lastPathComponentIndex = this.path.lastIndexOf("/" + this.lastPathComponent);
+            if (lastPathComponentIndex != -1)
+                info += this.path.substring(0, lastPathComponentIndex);
+        }
+
+        var fullTitle = "";
+
+        if (this.errors)
+            fullTitle += "<span class=\"count errors\">" + (this.errors + this.warnings) + "</span>";
+        else if (this.warnings)
+            fullTitle += "<span class=\"count warnings\">" + this.warnings + "</span>";
+
+        fullTitle += "<span class=\"title" + (info && info.length ? "" : " only") + "\">" + title.escapeHTML() + "</span>";
+        if (info && info.length)
+            fullTitle += "<span class=\"info\">" + info.escapeHTML() + "</span>";
+
+        var iconClass = "icon";
+        switch (this.category) {
+        default:
+            break;
+        case WebInspector.resourceCategories.images:
+        case WebInspector.resourceCategories.other:
+            iconClass = "icon plain";
+        }
+
+        if (!this.finished)
+            fullTitle += "<div class=\"" + iconClass + "\"><canvas id=\"loadingIcon" + this.identifier + "\" class=\"progress\" width=\"16\" height=\"16\"></canvas></div>";
+        else if (this.category === WebInspector.resourceCategories.images)
+            fullTitle += "<div class=\"" + iconClass + "\"><img class=\"preview\" src=\"" + this.url + "\"></div>";
+        else
+            fullTitle += "<div class=\"" + iconClass + "\"></div>";
+
+        this.listItem.title = fullTitle;
+        this.listItem.tooltip = this.url;
+    },
+
+    get panel()
+    {
+        if (!this._panel)
+            this._panel = new WebInspector.ResourcePanel(this);
+        return this._panel;
+    },
+
+    select: function()
+    {
+        WebInspector.navigateToResource(this);
+    },
+
+    deselect: function()
+    {
+        this.listItem.deselect(true);
+        if (WebInspector.currentPanel === this._panel)
+            WebInspector.currentPanel = null;
+    },
+
+    attach: function()
+    {
+        this.panel.attach();
+    },
+
+    detach: function()
+    {
+        if (this._panel)
+            this.panel.detach();
+    },
+
+    get errors()
+    {
+        if (!("_errors" in this))
+            this._errors = 0;
+
+        return this._errors;
+    },
+
+    set errors(x)
+    {
+        if (this._errors === x)
+            return;
+
+        this._errors = x;
+        this.updateTitleSoon();
+    },
+
+    get warnings()
+    {
+        if (!("_warnings" in this))
+            this._warnings = 0;
+
+        return this._warnings;
+    },
+
+    set warnings(x)
+    {
+        if (this._warnings === x)
+            return;
+
+        this._warnings = x;
+        this.updateTitleSoon();
+    }
+}
+
+WebInspector.ResourceTreeElement = function(resource)
+{
+    var item = new TreeElement("", resource, false);
+    item.onselect = WebInspector.ResourceTreeElement.selected;
+    item.ondeselect = WebInspector.ResourceTreeElement.deselected;
+    item.onreveal = WebInspector.ResourceTreeElement.revealed;
+    return item;
+}
+
+WebInspector.ResourceTreeElement.selected = function(element)
+{
+    var selectedElement = WebInspector.statusOutline.selectedTreeElement;
+    if (selectedElement)
+        selectedElement.deselect();
+    element.representedObject.select();
+}
+
+WebInspector.ResourceTreeElement.deselected = function(element)
+{
+    element.representedObject.deselect();
+}
+
+WebInspector.ResourceTreeElement.revealed = function(element)
+{
+    if (!element._listItemNode || !element.treeOutline || !element.treeOutline._childrenListNode)
+        return;
+    element.treeOutline._childrenListNode.scrollToElement(element._listItemNode);
+}
diff --git a/WebCore/page/inspector/ResourceCategory.js b/WebCore/page/inspector/ResourceCategory.js
new file mode 100644 (file)
index 0000000..e6918cd
--- /dev/null
@@ -0,0 +1,67 @@
+WebInspector.ResourceCategory = function(title)
+{
+    this.title = title;
+    this.resources = [];
+    this.listItem = new WebInspector.ResourceCategoryTreeElement(this);
+    this.listItem.hidden = true;
+    WebInspector.fileOutline.appendChild(this.listItem);
+}
+
+WebInspector.ResourceCategory.prototype = {
+    toString: function()
+    {
+        return this.title;
+    },
+
+    addResource: function(resource)
+    {
+        var a = resource;
+        var resourcesLength = this.resources.length;
+        for (var i = 0; i < resourcesLength; ++i) {
+            var b = this.resources[i];
+            if (a._lastPathComponentLowerCase < b._lastPathComponentLowerCase)
+                break;
+        }
+
+        this.resources.splice(i, 0, resource);
+        this.listItem.insertChild(resource.listItem, i);
+        this.listItem.hidden = false;
+
+        resource.attach();
+    },
+
+    removeResource: function(resource)
+    {
+        resource.detach();
+
+        var resourcesLength = this.resources.length;
+        for (var i = 0; i < resourcesLength; ++i) {
+            if (this.resources[i] === resource) {
+                this.resources.splice(i, 1);
+                break;
+            }
+        }
+
+        this.listItem.removeChild(resource.listItem);
+
+        if (!this.resources.length)
+            this.listItem.hidden = true;
+    },
+
+    removeAllResources: function(resource)
+    {
+        var resourcesLength = this.resources.length;
+        for (var i = 0; i < resourcesLength; ++i)
+            this.resources[i].detach();
+        this.resources = [];
+        this.listItem.removeChildren();
+        this.listItem.hidden = true;
+    }
+}
+
+WebInspector.ResourceCategoryTreeElement = function(category)
+{
+    var item = new TreeElement(category.title, category, true);
+    item.selectable = false;
+    return item;
+}
diff --git a/WebCore/page/inspector/ResourcePanel.js b/WebCore/page/inspector/ResourcePanel.js
new file mode 100644 (file)
index 0000000..9e717f9
--- /dev/null
@@ -0,0 +1,1348 @@
+WebInspector.ResourcePanel = function(resource)
+{
+    this.resource = resource;
+    this.messages = [];
+
+    WebInspector.Panel.call(this);
+}
+
+WebInspector.ResourcePanel.prototype = {
+    show: function()
+    {
+        this.resource.listItem.select(true);
+        this.resource.listItem.reveal();
+
+        if (this.currentView && "onshow" in this.currentView)
+            this.currentView.onshow();
+
+        WebInspector.Panel.prototype.show.call(this);
+    },
+
+    hide: function()
+    {
+        this.resource.listItem.deselect(true);
+        if (this.currentView && "onhide" in this.currentView)
+            this.currentView.onhide();
+        WebInspector.Panel.prototype.hide.call(this);
+    },
+
+    sourceRow: function(lineNumber)
+    {
+        this.refreshIfNeeded();
+        var doc = this.sourceFrame.contentDocument;
+        var rows = doc.getElementsByTagName("table")[0].rows;
+
+        // Line numbers are a 1-based index, but the rows collection is 0-based.
+        --lineNumber;
+        if (lineNumber >= rows.length)
+            lineNumber = rows.length - 1;
+
+        return rows[lineNumber];
+    },
+
+    showSourceLine: function(lineNumber)
+    {
+        var row = this.sourceRow(lineNumber);
+        if (!row)
+            return;
+        this.navigateToView("source");
+        row.scrollIntoView(true);
+    },
+
+    addMessageToSource: function(msg)
+    {
+        this.messages.push(msg);
+        if (this.sourceFrame)
+            this._addMessageToSource(msg);
+    },
+
+    _addMessageToSource: function(msg)
+    {
+        var row = this.sourceRow(msg.line);
+        if (!row)
+            return;
+        var cell = row.getElementsByTagName("td")[1];
+
+        var errorDiv = cell.lastChild;
+        if (!errorDiv || errorDiv.nodeName.toLowerCase() !== "div" || !errorDiv.hasStyleClass("webkit-html-message-bubble")) {
+            errorDiv = document.createElement("div");
+            errorDiv.className = "webkit-html-message-bubble";
+            cell.appendChild(errorDiv);
+        }
+        var imageURL;
+        switch (msg.level) {
+            case WebInspector.ConsoleMessage.ErrorMessageLevel:
+                errorDiv.addStyleClass("webkit-html-error-message");
+                imageURL = "Images/errorIcon.png";
+                break;
+            case WebInspector.ConsoleMessage.WarningMessageLevel:
+                errorDiv.addStyleClass("webkit-html-warning-message");
+                imageURL = "Images/warningIcon.png";
+                break;
+        }
+
+        var lineDiv = document.createElement("div");
+        lineDiv.className = "webkit-html-message-line";
+        errorDiv.appendChild(lineDiv);
+
+        var image = document.createElement("img");
+        image.src = imageURL;
+        image.className = "webkit-html-message-icon";
+        lineDiv.appendChild(image);
+
+        lineDiv.appendChild(document.createTextNode(msg.message));
+    },
+
+    _addMessagesToSource: function()
+    {
+        for (var i = 0; i < this.messages.length; ++i)
+            this._addMessageToSource(this.messages[i]);
+    },
+
+    navigateToView: function(view)
+    {
+        if (typeof view === "string" || view instanceof String) {
+            if (this.needsRefresh)
+                this.refresh();
+            view = this.views[view];
+        }
+
+        WebInspector.navigateToView(view);
+    },
+
+    createViews: function()
+    {
+        this.currentView = null;
+
+        var selectViewFunction = function(event)
+        {
+            WebInspector.navigateToView(event.currentTarget.view);
+        }
+
+        var views = [
+            {name: "source", title: "Source", selected: true},
+        ];
+
+        if (this.resource.category === WebInspector.resourceCategories.documents) {
+            var domView = {name: "dom", title: "DOM", selected: false};
+            var panel = this;
+            domView.onshow = function() { InspectorController.highlightDOMNode(panel.focusedDOMNode) };
+            domView.onhide = function() { InspectorController.hideDOMNodeHighlight() };
+            views.push(domView);
+        }
+
+        var oldViews = this.views || {};
+        this.views = {};
+        this.viewButtons = [];
+        for (var i = 0; i < views.length; ++i) {
+            var buttonElement = document.createElement("button");
+            buttonElement.setAttribute("title", views[i].title);
+            buttonElement.addEventListener("click", selectViewFunction, "true");
+            buttonElement.appendChild(document.createElement("img"));
+
+            var contentElement = document.createElement("div");
+            contentElement.className = "content " + views[i].name;
+
+            // We need to reuse the old view object if possible because it might
+            // already be in the backForwardList
+            var view = oldViews[views[i].name] || {};
+
+            view.buttonElement = buttonElement;
+            view.contentElement = contentElement;
+            view.panel = this;
+            view.buttonElement.view = view;
+            if ("onshow" in views[i])
+                view.onshow = views[i].onshow;
+            if ("onhide" in views[i])
+                view.onhide = views[i].onhide;
+
+            this.views[views[i].name] = view;
+            this.viewButtons.push(buttonElement);
+            this.element.appendChild(contentElement);
+        }
+
+        this.currentView = this.views.source;
+
+        if (WebInspector.currentPanel == this)
+            WebInspector.updateViewButtons();
+    },
+
+    _createSourceFrame: function()
+    {
+        this.sourceFrame = document.createElement("iframe");
+        this.sourceFrame.setAttribute("viewsource", "true");
+        this.sourceFrame.name = "sourceFrame" + WebInspector.ResourcePanel.sourceFrameCounter++;
+        this.views.source.contentElement.appendChild(this.sourceFrame);
+        InspectorController.addSourceToFrame(this.resource.identifier, this.sourceFrame);
+        WebInspector.addMainEventListeners(this.sourceFrame.contentDocument);
+        this._addMessagesToSource();
+    },
+
+    updateTreeSelection: function()
+    {
+        if (!this.domTreeOutline || !this.domTreeOutline.selectedTreeElement)
+            return;
+        var element = this.domTreeOutline.selectedTreeElement;
+        element.updateSelection(element);
+    },
+
+    refresh: function()
+    {
+        this.needsRefresh = false;
+
+        this.element.removeChildren();
+
+        this.createViews();
+
+        if (!this.resource.finished)
+            this.views.source.contentElement.addStyleClass("loading");
+        else if (this.resource.failed)
+            this.views.source.contentElement.removeStyleClass("failed");
+        else if (this.resource.category === WebInspector.resourceCategories.documents) {
+            this._createSourceFrame();
+
+            this.views.dom.contentElement.sideContentElement = document.createElement("div");
+            this.views.dom.contentElement.sideContentElement.className = "content side";
+
+            this.views.dom.contentElement.treeContentElement = document.createElement("div");
+            this.views.dom.contentElement.treeContentElement.className = "content tree outline-disclosure";
+
+            this.views.dom.contentElement.treeListElement = document.createElement("ol");
+            this.domTreeOutline = new TreeOutline(this.views.dom.contentElement.treeListElement);
+            this.domTreeOutline.panel = this;
+
+            var panel = this;
+            window.addEventListener("resize", function() { panel.updateTreeSelection() }, false);
+
+            this.views.dom.contentElement.crumbsElement = document.createElement("div");
+            this.views.dom.contentElement.crumbsElement.className = "crumbs";
+
+            this.views.dom.contentElement.innerCrumbsElement = document.createElement("div");
+            this.views.dom.contentElement.crumbsElement.appendChild(this.views.dom.contentElement.innerCrumbsElement);
+
+            this.views.dom.contentElement.sidebarPanes = {};
+            this.views.dom.contentElement.sidebarPanes.styles = new WebInspector.SidebarPane("Styles");
+            this.views.dom.contentElement.sidebarPanes.metrics = new WebInspector.SidebarPane("Metrics");
+            this.views.dom.contentElement.sidebarPanes.properties = new WebInspector.SidebarPane("Properties");
+
+            var panel = this;
+            this.views.dom.contentElement.sidebarPanes.styles.onexpand = function() { panel.updateStyles() };
+            this.views.dom.contentElement.sidebarPanes.metrics.onexpand = function() { panel.updateMetrics() };
+            this.views.dom.contentElement.sidebarPanes.properties.onexpand = function() { panel.updateProperties() };
+
+            this.views.dom.contentElement.sidebarPanes.styles.expanded = true;
+
+            this.views.dom.contentElement.sidebarElement = document.createElement("div");
+            this.views.dom.contentElement.sidebarElement.className = "sidebar";
+
+            this.views.dom.contentElement.sidebarElement.appendChild(this.views.dom.contentElement.sidebarPanes.styles.element);
+            this.views.dom.contentElement.sidebarElement.appendChild(this.views.dom.contentElement.sidebarPanes.metrics.element);
+            this.views.dom.contentElement.sidebarElement.appendChild(this.views.dom.contentElement.sidebarPanes.properties.element);
+
+            this.views.dom.contentElement.sideContentElement.appendChild(this.views.dom.contentElement.treeContentElement);
+            this.views.dom.contentElement.sideContentElement.appendChild(this.views.dom.contentElement.crumbsElement);
+            this.views.dom.contentElement.treeContentElement.appendChild(this.views.dom.contentElement.treeListElement);
+
+            this.views.dom.contentElement.appendChild(this.views.dom.contentElement.sideContentElement);
+            this.views.dom.contentElement.appendChild(this.views.dom.contentElement.sidebarElement);
+
+            this.rootDOMNode = this.resource.documentNode;
+        } else if (this.resource.category === WebInspector.resourceCategories.images) {
+            this.views.source.contentElement.removeStyleClass("source");
+            this.views.source.contentElement.addStyleClass("image");
+
+            var container = document.createElement("div");
+            container.className = "image";
+            this.views.source.contentElement.appendChild(container);
+
+            this.imagePreviewElement = document.createElement("img");
+            this.imagePreviewElement.setAttribute("src", this.resource.url);
+
+            container.appendChild(this.imagePreviewElement);
+
+            container = document.createElement("div");
+            container.className = "info";
+            this.views.source.contentElement.appendChild(container);
+
+            var imageNameElement = document.createElement("h1");
+            imageNameElement.className = "title";
+            imageNameElement.textContent = this.resource.displayName;
+            container.appendChild(imageNameElement);
+
+            var infoListElement = document.createElement("dl");
+            infoListElement.className = "infoList";
+
+            var imageProperties = [
+                {name: "Dimensions", value: this.imagePreviewElement.naturalWidth + " \u00D7 " + this.imagePreviewElement.height},
+                {name: "File size", value: (this.resource.contentLength / 1024).toPrecision(2) + "KB"},
+                {name: "MIME type", value: this.resource.mimeType}
+            ];
+
+            var listHTML = '';
+            for (var i = 0; i < imageProperties.length; ++i)
+                listHTML += "<dt>" + imageProperties[i].name + "</dt><dd>" + imageProperties[i].value + "</dd>";
+
+            infoListElement.innerHTML = listHTML;
+            container.appendChild(infoListElement);
+        } else if (this.resource.category === WebInspector.resourceCategories.stylesheets
+                   || this.resource.category === WebInspector.resourceCategories.scripts) {
+                this.views.source.contentElement.addStyleClass(this.resource.category.title.toLowerCase());
+            this._createSourceFrame();
+        } else {
+            if (this.resource.category)
+                this.views.source.contentElement.addStyleClass(this.resource.category.title.toLowerCase());
+        }
+    },
+
+    get currentView()
+    {
+        return this._currentView;
+    },
+
+    set currentView(x)
+    {
+        if (this._currentView === x)
+            return;
+
+        if (this._currentView) {
+            this._currentView.buttonElement.removeStyleClass("selected");
+            this._currentView.contentElement.removeStyleClass("selected");
+            if ("onhide" in this._currentView)
+                this._currentView.onhide();
+        }
+
+        this._currentView = x;
+
+        if (x) {
+            x.buttonElement.addStyleClass("selected");
+            x.contentElement.addStyleClass("selected");
+            if ("onshow" in x)
+                x.onshow();
+
+            if (x.contentElement.parentNode !== this.element)
+                InspectorController.log("Tried to set currentView to a view " + x.title + " whose contentElement is a non-child");
+        }
+    },
+
+    get rootDOMNode()
+    {
+        return this._rootDOMNode;
+    },
+
+    set rootDOMNode(x)
+    {
+        if (this._rootDOMNode === x)
+            return;
+
+        this._rootDOMNode = x;
+
+        this.updateBreadcrumb();
+        this.updateTreeOutline();
+    },
+
+    get focusedDOMNode()
+    {
+        return this._focusedDOMNode;
+    },
+
+    set focusedDOMNode(x)
+    {
+        if (this.resource.category !== WebInspector.resourceCategories.documents) {
+            InspectorController.log("Called set focusedDOMNode on a non-document resource " + this.resource.displayName + " which is not a document");
+            return;
+        }
+
+        if (this._focusedDOMNode === x) {
+            var nodeItem = this.revealNode(x);
+            if (nodeItem)
+                nodeItem.select();
+            return;
+        }
+
+        this._focusedDOMNode = x;
+
+        this.updateBreadcrumb();
+
+        for (var pane in this.views.dom.contentElement.sidebarPanes)
+            this.views.dom.contentElement.sidebarPanes[pane].needsUpdate = true;
+
+        this.updateStyles();
+        this.updateMetrics();
+        this.updateProperties();
+
+        InspectorController.highlightDOMNode(x);
+
+        var nodeItem = this.revealNode(x);
+        if (nodeItem)
+            nodeItem.select();
+    },
+
+    revealNode: function(node)
+    {
+        var nodeItem = this.domTreeOutline.findTreeElement(node, function(a, b) { return isAncestorNode.call(a, b); }, function(a) { return a.parentNode; });
+        if (!nodeItem)
+            return;
+
+        nodeItem.reveal();
+        return nodeItem;
+    },
+
+    updateTreeOutline: function()
+    {
+        this.domTreeOutline.removeChildrenRecursive();
+
+        if (!this.rootDOMNode)
+            return;
+
+        // FIXME: this could use findTreeElement to reuse a tree element if it already exists
+        var node = (Preferences.ignoreWhitespace ? firstChildSkippingWhitespace.call(this.rootDOMNode) : this.rootDOMNode.firstChild);
+        while (node) {
+            var item = new WebInspector.DOMNodeTreeElement(node);
+            this.domTreeOutline.appendChild(item);
+            node = Preferences.ignoreWhitespace ? nextSiblingSkippingWhitespace.call(node) : node.nextSibling;
+        }
+
+        this.updateTreeSelection();
+    },
+
+    updateBreadcrumb: function()
+    {
+        if (!this.views || !this.views.dom.contentElement)
+            return;
+        var crumbs = this.views.dom.contentElement.innerCrumbsElement;
+        if (!crumbs)
+            return;
+
+        var handled = false;
+        var foundRoot = false;
+        var crumb = crumbs.firstChild;
+        while (crumb) {
+            if (crumb.representedObject === this.rootDOMNode)
+                foundRoot = true;
+
+            if (foundRoot)
+                crumb.addStyleClass("hidden");
+            else
+                crumb.removeStyleClass("hidden");
+
+            if (crumb.representedObject === this.focusedDOMNode) {
+                crumb.addStyleClass("selected");
+                handled = true;
+            } else {
+                crumb.removeStyleClass("selected");
+            }
+
+            crumb = crumb.nextSibling;
+        }
+
+        if (handled)
+            return;
+
+        crumbs.removeChildren();
+
+        var panel = this;
+        var selectCrumbFunction = function(event)
+        {
+            if (event.currentTarget.hasStyleClass("hidden"))
+                panel.rootDOMNode = event.currentTarget.representedObject.parentNode;
+            panel.focusedDOMNode = event.currentTarget.representedObject;
+            event.preventDefault();
+            event.stopPropagation();
+        }
+
+        var selectCrumbRootFunction = function(event)
+        {
+            panel.rootDOMNode = event.currentTarget.representedObject.parentNode;
+            panel.focusedDOMNode = event.currentTarget.representedObject;
+            event.preventDefault();
+            event.stopPropagation();
+        }
+
+        foundRoot = false;
+        var current = this.focusedDOMNode;
+        while (current) {
+            if (current.nodeType === Node.DOCUMENT_NODE)
+                break;
+
+            if (current === this.rootDOMNode)
+                foundRoot = true;
+
+            var crumb = document.createElement("span");
+            crumb.className = "crumb";
+            crumb.representedObject = current;
+            crumb.addEventListener("mousedown", selectCrumbFunction, false);
+            crumb.addEventListener("dblclick", selectCrumbRootFunction, false);
+
+            var crumbTitle;
+            switch (current.nodeType) {
+                case Node.ELEMENT_NODE:
+                    crumbTitle = current.nodeName.toLowerCase();
+    
+                    var value = current.getAttribute("id");
+                    if (value && value.length)
+                        crumbTitle += "#" + value;
+
+                    value = current.getAttribute("class");
+                    if (value && value.length) {
+                        var classes = value.split(/\s+/);
+                        var classesLength = classes.length;
+                        for (var i = 0; i < classesLength; ++i) {
+                            value = classes[i];
+                            if (value && value.length)
+                                crumbTitle += "." + value;
+                        }
+                    }
+
+                    break;
+
+                case Node.TEXT_NODE:
+                    if (isNodeWhitespace.call(current))
+                        crumbTitle = "(whitespace)";
+                    else
+                        crumbTitle = "(text)";
+                    break
+
+                case Node.COMMENT_NODE:
+                    crumbTitle = "<!-->";
+                    break;
+
+                default:
+                    crumbTitle = current.nodeName.toLowerCase();
+            }
+
+            crumb.textContent = crumbTitle;
+
+            if (foundRoot)
+                crumb.addStyleClass("hidden");
+            if (current === this.focusedDOMNode)
+                crumb.addStyleClass("selected");
+            if (!crumbs.childNodes.length)
+                crumb.addStyleClass("end");
+            if (current.parentNode.nodeType === Node.DOCUMENT_NODE)
+                crumb.addStyleClass("start");
+
+            crumbs.appendChild(crumb);
+            current = current.parentNode;
+        }
+    },
+
+    updateStyles: function()
+    {
+        if (!this.views.dom.contentElement.sidebarPanes.styles.expanded)
+            return;
+        if (!this.views.dom.contentElement.sidebarPanes.styles.needsUpdate)
+            return;
+
+        this.views.dom.contentElement.sidebarPanes.styles.needsUpdate = false;
+
+        var stylesBody = this.views.dom.contentElement.sidebarPanes.styles.bodyElement;
+
+        stylesBody.removeChildren();
+        this.views.dom.contentElement.sidebarPanes.styles.sections = [];
+
+        if (!this.focusedDOMNode)
+            return;
+
+        var styleNode = this.focusedDOMNode;
+        if (styleNode.nodeType === Node.TEXT_NODE && styleNode.parentNode)
+            styleNode = styleNode.parentNode;
+
+        var styleRules = [];
+        var styleProperties = [];
+
+        if (styleNode.nodeType === Node.ELEMENT_NODE) {
+            var propertyCount = [];
+
+            var computedStyle = styleNode.ownerDocument.defaultView.getComputedStyle(styleNode);
+            if (computedStyle && computedStyle.length)
+                styleRules.push({ isComputedStyle: true, selectorText: "Computed Style", style: computedStyle });
+
+            var styleNodeName = styleNode.nodeName.toLowerCase();
+            for (var i = 0; i < styleNode.attributes.length; ++i) {
+                var attr = styleNode.attributes[i];
+                if (attr.style) {
+                    var attrStyle = { attrName: attr.name, style: attr.style };
+                    attrStyle.subtitle = "element\u2019s \u201C" + attr.name + "\u201D attribute";
+                    attrStyle.selectorText = styleNodeName + "[" + attr.name;
+                    if (attr.value.length)
+                        attrStyle.selectorText += "=" + attr.value;
+                    attrStyle.selectorText += "]";
+                    styleRules.push(attrStyle);
+                }
+            }
+
+            if (styleNode.style && styleNode.style.length) {
+                var inlineStyle = { selectorText: "Inline Style Attribute", style: styleNode.style };
+                inlineStyle.subtitle = "element\u2019s \u201Cstyle\u201D attribute";
+                styleRules.push(inlineStyle);
+            }
+
+            var matchedStyleRules = styleNode.ownerDocument.defaultView.getMatchedCSSRules(styleNode, "", !Preferences.showUserAgentStyles);
+            if (matchedStyleRules) {
+                for (var i = matchedStyleRules.length - 1; i >= 0; --i)
+                    styleRules.push(matchedStyleRules[i]);
+            }
+
+            var priorityUsed = false;
+            var usedProperties = {};
+            var shorthandProperties = {};
+            for (var i = 0; i < styleRules.length; ++i) {
+                styleProperties[i] = [];
+
+                var style = styleRules[i].style;
+                var styleShorthandLookup = [];
+                for (var j = 0; j < style.length; ++j) {
+                    var prop = null;
+                    var name = style[j];
+                    var shorthand = style.getPropertyShorthand(name);
+                    if (!shorthand && styleRules[i].isComputedStyle)
+                        shorthand = shorthandProperties[name];
+
+                    if (shorthand) {
+                        prop = styleShorthandLookup[shorthand];
+                        shorthandProperties[name] = shorthand;
+                    }
+
+                    if (!priorityUsed && style.getPropertyPriority(name).length)
+                        priorityUsed = true;
+
+                    if (prop) {
+                        prop.subProperties.push(name);
+                    } else {
+                        prop = { style: style, subProperties: [name], unusedProperties: [], name: (shorthand ? shorthand : name) };
+                        styleProperties[i].push(prop);
+
+                        if (shorthand) {
+                            styleShorthandLookup[shorthand] = prop;
+                            if (!styleRules[i].isComputedStyle) {
+                                if (!propertyCount[shorthand]) {
+                                    propertyCount[shorthand] = 1;
+                                } else {
+                                    prop.unusedProperties[shorthand] = true;
+                                    propertyCount[shorthand]++;
+                                }
+                            }
+                        }
+                    }
+
+                    if (styleRules[i].isComputedStyle)
+                        continue;
+
+                    usedProperties[name] = true;
+                    if (shorthand)
+                        usedProperties[shorthand] = true;
+
+                    if (!propertyCount[name]) {
+                        propertyCount[name] = 1;
+                    } else {
+                        prop.unusedProperties[name] = true;
+                        propertyCount[name]++;
+                    }
+                }
+            }
+
+            if (priorityUsed) {
+                // walk the properties again and account for !important
+                var priorityCount = [];
+                for (var i = 0; i < styleRules.length; ++i) {
+                    if (styleRules[i].isComputedStyle)
+                        continue;
+                    var style = styleRules[i].style;
+                    for (var j = 0; j < styleProperties[i].length; ++j) {
+                        var prop = styleProperties[i][j];
+                        for (var k = 0; k < prop.subProperties.length; ++k) {
+                            var name = prop.subProperties[k];
+                            if (style.getPropertyPriority(name).length) {
+                                if (!priorityCount[name]) {
+                                    if (prop.unusedProperties[name])
+                                        prop.unusedProperties[name] = false;
+                                    priorityCount[name] = 1;
+                                } else {
+                                    priorityCount[name]++;
+                                }
+                            } else if (priorityCount[name]) {
+                                prop.unusedProperties[name] = true;
+                            }
+                        }
+                    }
+                }
+            }
+
+            var styleRulesLength = styleRules.length;
+            for (var i = 0; i < styleRulesLength; ++i) {
+                var selectorText = styleRules[i].selectorText;
+
+                var section = new WebInspector.PropertiesSection(selectorText);
+                if (!styleRules[i].isComputedStyle)
+                    section.expanded = true;
+
+                if (!styleRules[i].isComputedStyle) {
+                    var sheet;
+                    var file = false;
+                    if (styleRules[i].subtitle)
+                        sheet = styleRules[i].subtitle;
+                    else if (styleRules[i].parentStyleSheet && styleRules[i].parentStyleSheet.href) {
+                        var url = styleRules[i].parentStyleSheet.href;
+                        sheet = WebInspector.linkifyURL(url, url.trimURL(WebInspector.mainResource.domain).escapeHTML());
+                        file = true;
+                    } else if (styleRules[i].parentStyleSheet && !styleRules[i].parentStyleSheet.ownerNode)
+                        sheet = "user agent stylesheet";
+                    else
+                        sheet = "inline stylesheet";
+
+                    if (file)
+                        section.subtitleElement.addStyleClass("file");
+
+                    section.subtitle = sheet;
+                }
+
+                stylesBody.appendChild(section.element);
+                this.views.dom.contentElement.sidebarPanes.styles.sections.push(section);
+
+                var properties = styleProperties[i];
+                var isComputedStyle = styleRules[i].isComputedStyle;
+                var alwaysShowComputedProperties = { "display": true, "height": true, "width": true };
+
+                for (var j = 0; j < properties.length; ++j) {
+                    var prop = properties[j];
+
+                    if (isComputedStyle && !alwaysShowComputedProperties[prop.name] && !usedProperties[prop.name])
+                        continue;
+
+                    var propTreeElement = new WebInspector.StylePropertyTreeElement(prop, isComputedStyle);
+                    section.propertiesTreeOutline.appendChild(propTreeElement);
+                }
+            }
+        } else {
+            // can't style this node
+        }
+    },
+
+    updateMetrics: function()
+    {
+        if (!this.views.dom.contentElement.sidebarPanes.metrics.expanded)
+            return;
+        if (!this.views.dom.contentElement.sidebarPanes.metrics.needsUpdate)
+            return;
+
+        this.views.dom.contentElement.sidebarPanes.metrics.needsUpdate = false;
+
+        var metricsBody = this.views.dom.contentElement.sidebarPanes.metrics.bodyElement;
+
+        metricsBody.removeChildren();
+
+        if (!this.focusedDOMNode)
+            return;
+
+        var style;
+        if (this.focusedDOMNode.nodeType === Node.ELEMENT_NODE)
+            style = this.focusedDOMNode.ownerDocument.defaultView.getComputedStyle(this.focusedDOMNode);
+        if (!style)
+            return;
+
+        var metricsElement = document.createElement("div");
+        metricsElement.className = "metrics";
+
+        function boxPartValue(style, name, suffix)
+        {
+            var value = style.getPropertyValue(name + suffix);
+            if (value === "" || value === "0px")
+                value = "\u2012";
+            return value.replace(/px$/, "");
+        }
+
+        // Display types for which margin is ignored.
+        var noMarginDisplayType = {
+            "table-cell": true,
+            "table-column": true,
+            "table-column-group": true,
+            "table-footer-group": true,
+            "table-header-group": true,
+            "table-row": true,
+            "table-row-group": true
+        };
+
+        // Display types for which padding is ignored.
+        var noPaddingDisplayType = {
+            "table-column": true,
+            "table-column-group": true,
+            "table-footer-group": true,
+            "table-header-group": true,
+            "table-row": true,
+            "table-row-group": true
+        };
+
+        var boxes = ["content", "padding", "border", "margin"];
+        var previousBox;
+        for (var i = 0; i < boxes.length; ++i) {
+            var name = boxes[i];
+
+            if (name === "margin" && noMarginDisplayType[style.display])
+                continue;
+            if (name === "padding" && noPaddingDisplayType[style.display])
+                continue;
+
+            var boxElement = document.createElement("div");
+            boxElement.className = name;
+
+            if (boxes[i] === "content") {
+                var width = style.width.replace(/px$/, "");
+                var height = style.height.replace(/px$/, "");
+                boxElement.textContent = width + " \u00D7 " + height;
+            } else {
+                var suffix = boxes[i] === "border" ? "-width" : "";
+
+                var labelElement = document.createElement("div");
+                labelElement.className = "label";
+                labelElement.textContent = name;
+                boxElement.appendChild(labelElement);
+
+                var topElement = document.createElement("div");
+                topElement.className = "top";
+                topElement.textContent = boxPartValue(style, name + "-top", suffix);
+                boxElement.appendChild(topElement);
+
+                var leftElement = document.createElement("div");
+                leftElement.className = "left";
+                leftElement.textContent = boxPartValue(style, name + "-left", suffix);
+                boxElement.appendChild(leftElement);
+
+                if (previousBox)
+                    boxElement.appendChild(previousBox);
+
+                var rightElement = document.createElement("div");
+                rightElement.className = "right";
+                rightElement.textContent = boxPartValue(style, name + "-right", suffix);
+                boxElement.appendChild(rightElement);
+
+                var bottomElement = document.createElement("div");
+                bottomElement.className = "bottom";
+                bottomElement.textContent = boxPartValue(style, name + "-bottom", suffix);
+                boxElement.appendChild(bottomElement);
+            }
+
+            previousBox = boxElement;
+        }
+
+        metricsElement.appendChild(previousBox);
+        metricsBody.appendChild(metricsElement);
+    },
+
+    updateProperties: function()
+    {
+        if (!this.views.dom.contentElement.sidebarPanes.properties.expanded)
+            return;
+        if (!this.views.dom.contentElement.sidebarPanes.properties.needsUpdate)
+            return;
+
+        this.views.dom.contentElement.sidebarPanes.properties.needsUpdate = false;
+
+        var propertiesBody = this.views.dom.contentElement.sidebarPanes.properties.bodyElement;
+
+        propertiesBody.removeChildren();
+        this.views.dom.contentElement.sidebarPanes.properties.sections = [];
+
+        if (!this.focusedDOMNode)
+            return;
+
+        for (var prototype = this.focusedDOMNode; prototype; prototype = prototype.__proto__) {
+            var hasChildren = false;
+            for (var prop in prototype) {
+                if (prop === "__treeElementIdentifier")
+                    continue;
+                if (!prototype.hasOwnProperty(prop))
+                    continue;
+
+                hasChildren = true;
+                break;
+            }
+
+            if (!hasChildren)
+                continue;
+
+            var title = prototype.toString().replace(/^\[object (\w*?)(Prototype)?\]$/i, "$1");
+            var section = new WebInspector.PropertiesSection(title);
+            section.onpopulate = WebInspector.DOMPropertiesSection.onpopulate(prototype);
+
+            propertiesBody.appendChild(section.element);
+            this.views.dom.contentElement.sidebarPanes.properties.sections.push(section);
+        }
+    },
+
+    handleKeyEvent: function(event)
+    {
+        if (this.domTreeOutline && this.currentView && this.currentView === this.views.dom)
+            this.domTreeOutline.handleKeyEvent(event);
+    }
+}
+
+WebInspector.ResourcePanel.sourceFrameCounter = 0;
+
+WebInspector.ResourcePanel.prototype.__proto__ = WebInspector.Panel.prototype;
+
+WebInspector.SidebarPane = function(title)
+{
+    this.element = document.createElement("div");
+    this.element.className = "pane";
+
+    this.titleElement = document.createElement("div");
+    this.titleElement.className = "title";
+
+    var pane = this;
+    this.titleElement.addEventListener("click", function() { pane.expanded = !pane.expanded; }, false);
+
+    this.bodyElement = document.createElement("div");
+    this.bodyElement.className = "body";
+
+    this.element.appendChild(this.titleElement);
+    this.element.appendChild(this.bodyElement);
+
+    this.title = title;
+    this.growbarVisible = false;
+    this.expanded = false;
+    this.onexpand = null;
+    this.oncollapse = null;
+}
+
+WebInspector.SidebarPane.prototype = {
+    get title()
+    {
+        return this._title;
+    },
+
+    set title(x)
+    {
+        if (this._title === x)
+            return;
+        this._title = x;
+        this.titleElement.textContent = x;
+    },
+
+    get growbarVisible()
+    {
+        return this._growbarVisible;
+    },
+
+    set growbarVisible(x)
+    {
+        if (this._growbarVisible === x)
+            return;
+
+        this._growbarVisible = x;
+
+        if (x && !this._growbarElement) {
+            this._growbarElement = document.createElement("div");
+            this._growbarElement.className = "growbar";
+            this.element.appendChild(this._growbarElement);
+        } else if (!x && this._growbarElement) {
+            if (this._growbarElement.parentNode)
+                this._growbarElement.parentNode(this._growbarElement);
+            delete this._growbarElement;
+        }
+    },
+
+    get expanded()
+    {
+        return this._expanded;
+    },
+
+    set expanded(x)
+    {
+        if (x)
+            this.expand();
+        else
+            this.collapse();
+    },
+
+    expand: function()
+    {
+        if (this._expanded)
+            return;
+        this._expanded = true;
+        this.element.addStyleClass("expanded");
+        if (this.onexpand)
+            this.onexpand(this);
+    },
+
+    collapse: function()
+    {
+        if (!this._expanded)
+            return;
+        this._expanded = false;
+        this.element.removeStyleClass("expanded");
+        if (this.oncollapse)
+            this.oncollapse(this);
+    }
+}
+
+WebInspector.PropertiesSection = function(title, subtitle)
+{
+    this.element = document.createElement("div");
+    this.element.className = "section";
+
+    this.headerElement = document.createElement("div");
+    this.headerElement.className = "header";
+
+    this.titleElement = document.createElement("div");
+    this.titleElement.className = "title";
+
+    this.subtitleElement = document.createElement("div");
+    this.subtitleElement.className = "subtitle";
+
+    this.headerElement.appendChild(this.titleElement);
+    this.headerElement.appendChild(this.subtitleElement);
+
+    var section = this;
+    this.headerElement.addEventListener("click", function() { section.expanded = !section.expanded; }, false);
+
+    this.propertiesElement = document.createElement("ol");
+    this.propertiesElement.className = "properties";
+    this.propertiesTreeOutline = new TreeOutline(this.propertiesElement);
+
+    this.element.appendChild(this.headerElement);
+    this.element.appendChild(this.propertiesElement);
+
+    this.title = title;
+    this.subtitle = subtitle;
+    this.expanded = false;
+}
+
+WebInspector.PropertiesSection.prototype = {
+    get title()
+    {
+        return this._title;
+    },
+
+    set title(x)
+    {
+        if (this._title === x)
+            return;
+        this._title = x;
+        this.titleElement.textContent = x;
+    },
+
+    get subtitle()
+    {
+        return this._subtitle;
+    },
+
+    set subtitle(x)
+    {
+        if (this._subtitle === x)
+            return;
+        this._subtitle = x;
+        this.subtitleElement.innerHTML = x;
+    },
+
+    get expanded()
+    {
+        return this._expanded;
+    },
+
+    set expanded(x)
+    {
+        if (x)
+            this.expand();
+        else
+            this.collapse();
+    },
+
+    expand: function()
+    {
+        if (this._expanded)
+            return;
+        this._expanded = true;
+
+        if (!this._populated && this.onpopulate) {
+            this.onpopulate(this);
+            this._populated = true;
+        }
+        this.element.addStyleClass("expanded");
+    },
+
+    collapse: function()
+    {
+        if (!this._expanded)
+            return;
+        this._expanded = false;
+        this.element.removeStyleClass("expanded");
+    }
+}
+
+WebInspector.DOMPropertiesSection = function()
+{
+    // FIXME: Perhaps this should be a real subclass someday
+}
+
+WebInspector.DOMPropertiesSection.onpopulate = function(prototype)
+{
+    return function(section) {
+        var properties = Object.sortedProperties(prototype);
+        for (var i = 0; i < properties.length; ++i) {
+            var name = properties[i];
+            if (!prototype.hasOwnProperty(name))
+                continue;
+            if (name === "__treeElementIdentifier")
+                continue;
+            var item = new WebInspector.DOMPropertyTreeElement(name, prototype);
+            section.propertiesTreeOutline.appendChild(item);
+        }
+    }
+}
+
+WebInspector.DOMNodeTreeElement = function(node)
+{
+    var hasChildren = (Preferences.ignoreWhitespace ? (firstChildSkippingWhitespace.call(node) ? true : false) : node.hasChildNodes());
+
+    var titleInfo = nodeTitleInfo.call(node, hasChildren, WebInspector.linkifyURL);
+    var title = titleInfo.title;
+    hasChildren = titleInfo.hasChildren;
+
+    var item = new TreeElement(title, node, hasChildren);
+    item.updateSelection = WebInspector.DOMNodeTreeElement.updateSelection;
+    item.onpopulate = WebInspector.DOMNodeTreeElement.populate;
+    item.onexpand = WebInspector.DOMNodeTreeElement.expanded;
+    item.oncollapse = WebInspector.DOMNodeTreeElement.collapsed;
+    item.onselect = WebInspector.DOMNodeTreeElement.selected;
+    item.onreveal = WebInspector.DOMNodeTreeElement.revealed;
+    item.ondblclick = WebInspector.DOMNodeTreeElement.doubleClicked;
+    if (hasChildren) 
+        item.whitespaceIgnored = Preferences.ignoreWhitespace;
+    return item;
+}
+
+WebInspector.DOMNodeTreeElement.updateSelection = function(element)
+{
+    if (!element || !element._listItemNode)
+        return;
+
+    if (!element.selectionElement) {
+        element.selectionElement = document.createElement("div");
+        element.selectionElement.className = "selection selected";
+        element._listItemNode.insertBefore(element.selectionElement, element._listItemNode.firstChild);
+    }
+
+    element.selectionElement.style.height = element._listItemNode.offsetHeight + "px";
+}
+
+WebInspector.DOMNodeTreeElement.populate = function(element)
+{
+    if (element.children.length || element.whitespaceIgnored !== Preferences.ignoreWhitespace)
+        return;
+
+    element.removeChildren();
+    element.whitespaceIgnored = Preferences.ignoreWhitespace;
+
+    var node = (Preferences.ignoreWhitespace ? firstChildSkippingWhitespace.call(element.representedObject) : element.representedObject.firstChild);
+    while (node) {
+        var item = new WebInspector.DOMNodeTreeElement(node);
+        element.appendChild(item);
+        node = Preferences.ignoreWhitespace ? nextSiblingSkippingWhitespace.call(node) : node.nextSibling;
+    }
+
+    if (element.representedObject.nodeType == Node.ELEMENT_NODE) {
+        var title = "<span class=\"tag close\">&lt;/" + element.representedObject.nodeName.toLowerCase().escapeHTML() + "&gt;</span>";
+        var item = new TreeElement(title, element.representedObject, false);
+        item.selectable = false;
+        element.appendChild(item);
+    }
+}
+
+WebInspector.DOMNodeTreeElement.expanded = function(element)
+{
+    element.treeOutline.panel.updateTreeSelection();
+}
+
+WebInspector.DOMNodeTreeElement.collapsed = function(element)
+{
+    element.treeOutline.panel.updateTreeSelection();
+}
+
+WebInspector.DOMNodeTreeElement.revealed = function(element)
+{
+    if (!element._listItemNode || !element.treeOutline || !element.treeOutline._childrenListNode)
+        return;
+    var parent = element.treeOutline.panel.views.dom.contentElement.treeContentElement;
+    parent.scrollToElement(element._listItemNode);
+}
+
+WebInspector.DOMNodeTreeElement.selected = function(element)
+{
+    var panel = element.treeOutline.panel;
+    panel.focusedDOMNode = element.representedObject;
+
+    // Call updateSelection twice to make sure the height is correct,
+    // the first time might have a bad height because we are in a weird tree state
+    element.updateSelection(element);
+    setTimeout(function() { element.updateSelection(element) }, 0);
+}
+
+WebInspector.DOMNodeTreeElement.doubleClicked = function(element)
+{
+    var panel = element.treeOutline.panel;
+    panel.rootDOMNode = element.representedObject.parentNode;
+    panel.focusedDOMNode = element.representedObject;
+}
+
+WebInspector.StylePropertyTreeElement = function(prop, computedStyle)
+{
+    var overloadCount = 0;
+    var priority;
+    if (prop.subProperties && prop.subProperties.length > 1) {
+        for (var i = 0; i < prop.subProperties.length; ++i) {
+            var name = prop.subProperties[i];
+            if (!priority)
+                priority = prop.style.getPropertyPriority(name);
+            if (prop.unusedProperties[name])
+                overloadCount++;
+        }
+    }
+
+    if (!priority)
+        priority = prop.style.getPropertyPriority(prop.name);
+
+    var overloaded = (prop.unusedProperties[prop.name] || overloadCount === prop.subProperties.length);
+    var title = WebInspector.StylePropertyTreeElement.createTitle(prop.name, prop.style, overloaded, priority, computedStyle);
+
+    var item = new TreeElement(title, prop, (prop.subProperties && prop.subProperties.length > 1));
+    item.computedStyle = computedStyle;
+    item.onpopulate = WebInspector.StylePropertyTreeElement.populate;
+    return item;
+}
+
+WebInspector.StylePropertyTreeElement.createTitle = function(name, style, overloaded, priority, computed)
+{
+    // "Nicknames" for some common values that are easier to read.
+    var valueNickname = {
+        "rgb(0, 0, 0)": "black",
+        "rgb(255, 255, 255)": "white",
+        "rgba(0, 0, 0, 0)": "transparent"
+    };
+
+    var value = style.getPropertyValue(name);
+
+    var textValue = value;
+    if (value) {
+        var urls = value.match(/url\([^)]+\)/);
+        if (urls) {
+            for (var i = 0; i < urls.length; ++i) {
+                var url = urls[i].substring(4, urls[i].length - 1);
+                textValue = textValue.replace(urls[i], "url(" + WebInspector.linkifyURL(url) + ")");
+            }
+        } else {
+            if (value in valueNickname)
+                textValue = valueNickname[value];
+            textValue = textValue.escapeHTML();
+        }
+    }
+
+    var classes = [];
+    if (!computed && (style.isPropertyImplicit(name) || value == "initial"))
+        classes.push("implicit");
+    if (overloaded)
+        classes.push("overloaded");
+
+    var title = "";
+    if (classes.length)
+        title += "<span class=\"" + classes.join(" ") + "\">";
+
+    title += "<span class=\"name\">" + name.escapeHTML() + "</span>: ";
+    title += "<span class=\"value\">" + textValue;
+    if (priority && priority.length)
+        title += " !" + priority;
+    title += "</span>;";
+
+    if (value) {
+        // FIXME: this dosen't catch keyword based colors like black and white
+        var colors = value.match(/(rgb\([0-9]+,\s?[0-9]+,\s?[0-9]+\))|(rgba\([0-9]+,\s?[0-9]+,\s?[0-9]+,\s?[0-9]+\))/g);
+        if (colors) {
+            var colorsLength = colors.length;
+            for (var i = 0; i < colorsLength; ++i)
+                title += "<span class=\"swatch\" style=\"background-color: " + colors[i] + "\"></span>";
+        }
+    }
+
+    if (classes.length)
+        title += "</span>";
+
+    return title;
+}
+
+WebInspector.StylePropertyTreeElement.populate = function(element)
+{
+    if (element.children.length)
+        return;
+
+    var prop = element.representedObject;
+    if (prop.subProperties && prop.subProperties.length > 1) {
+        for (var i = 0; i < prop.subProperties.length; ++i) {
+            var name = prop.subProperties[i];
+            var overloaded = (prop.unusedProperties[prop.name] || prop.unusedProperties[name]);
+            var priority = prop.style.getPropertyPriority(name);
+            var title = WebInspector.StylePropertyTreeElement.createTitle(name, prop.style, overloaded, priority, element.computedStyle);
+            var subitem = new TreeElement(title, {}, false);
+            element.appendChild(subitem);
+        }
+    }
+}
+
+WebInspector.RequestResponseTreeElement = function(name, object)
+{
+    var title = "<span class=\"name\">" + name.escapeHTML() + "</span>";
+
+    var hasChildren = object instanceof Object;
+    if (!hasChildren) {
+        var objectAsString = object.toString();
+        title += ": <span class=\"value\">" + objectAsString.escapeHTML() + "</span>";
+    }
+
+    var item = new TreeElement(title, object, hasChildren);
+    item.onpopulate = WebInspector.RequestResponseTreeElement.onpopulate;
+    return item;
+}
+
+WebInspector.RequestResponseTreeElement.onpopulate = function(element)
+{
+    if (element.children.length)
+        return;
+
+    for (var field in element.representedObject) {
+        var item = new WebInspector.RequestResponseTreeElement(field, element.representedObject[field]);
+        element.appendChild(item);
+    }
+}
+
+WebInspector.DOMPropertyTreeElement = function(name, object)
+{
+    var title = "<span class=\"name\">" + name.escapeHTML() + "</span>: ";
+    title += "<span class=\"value\">" + Object.describe(object[name], true).escapeHTML() + "</span>";
+
+    var hasChildren = false;
+    var type = typeof object[name];
+    if (object[name] && (type === "object" || type === "function")) {
+        for (value in object[name]) {
+            hasChildren = true;
+            break;
+        }
+    }
+
+    var representedObj = { object: object, name: name };
+    var item = new TreeElement(title, representedObj, hasChildren);
+    item.onpopulate = WebInspector.DOMPropertyTreeElement.populate;
+    return item;
+}
+
+WebInspector.DOMPropertyTreeElement.populate = function(element)
+{
+    if (element.children.length)
+        return;
+
+    var parent = element.representedObject.object[element.representedObject.name];
+    var properties = Object.sortedProperties(parent);
+    for (var i = 0; i < properties.length; ++i) {
+        if (properties[i] === "__treeElementIdentifier")
+            continue;
+        var item = new WebInspector.DOMPropertyTreeElement(properties[i], parent);
+        element.appendChild(item);
+    }
+}
diff --git a/WebCore/page/inspector/inspector.css b/WebCore/page/inspector/inspector.css
new file mode 100644 (file)
index 0000000..69f472e
--- /dev/null
@@ -0,0 +1,1593 @@
+/*
+ * Copyright (C) 2006, 2007 Apple Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer. 
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution. 
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission. 
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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 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.
+ */
+
+body {
+    -webkit-user-select: none;
+    height: 100%;
+    width: 100%;
+    overflow: hidden;
+    font-family: Lucida Grande, sans-serif;
+}
+
+iframe, a img {
+    border: none;
+}
+
+.focused .selected {
+    background-color: rgb(56, 121, 217);
+}
+
+.blurred .selected, body.inactive .selected {
+    background-color: rgb(212, 212, 212);
+}
+
+.hidden {
+    display: none;
+}
+
+#toolbar {
+    position: absolute;
+    top: 0;
+    left: 0;
+    right: 0;
+    height: 28px;
+    background: rgb(245, 245, 250);
+    background-image: url(Images/toolbarBackground.png);
+    background-repeat: repeat-x;
+    background-position: top;
+    border-bottom: 1px solid rgb(80, 80, 80);
+    padding: 2px 8px;
+    -webkit-box-sizing: border-box;
+    -webkit-background-size: auto 135%;
+}
+
+body.inactive #toolbar {
+    background-image: url(Images/toolbarBackgroundInactive.png);
+    border-bottom: 1px solid rgb(64%, 64%, 64%);
+}
+
+body.attached #toolbar {
+    border-top: 1px solid rgb(80, 80, 80);
+    background-image: url(Images/darkShadow.png), url(Images/toolbarBackground.png);
+    background-position: center -2px, top;
+    -webkit-background-size: auto auto, auto 135%;
+}
+
+body.attached.inactive #toolbar {
+    background-image: url(Images/darkShadow.png), url(Images/toolbarBackgroundInactive.png);
+    background-position: center -3px, top;
+    border-top: 1px solid rgb(100, 100, 100);
+    border-bottom: 1px solid rgb(64%, 64%, 64%);
+}
+
+#toolbar button, #toolbar button:disabled:active {
+    border-width: 3px 3px 4px 3px;
+    -webkit-border-image: url(Images/toolbarButton.png) 3 3 4 3;
+    height: 19px;
+    -webkit-box-sizing: border-box;
+    vertical-align: middle;
+}
+
+#toolbar button:focus {
+    outline: none;
+}
+
+#toolbar button:active, #toolbar button.selected {
+    -webkit-border-image: url(Images/toolbarButtonPressed.png) 3 3 4 3;
+}
+
+body.inactive #toolbar button:active, body.inactive #toolbar button.selected {
+    -webkit-border-image: url(Images/toolbarButtonPressedInactive.png) 3 3 4 3;
+}
+
+body.inactive #toolbar button, body.inactive #toolbar button:disabled:active {
+    -webkit-border-image: url(Images/toolbarButtonInactive.png) 3 3 4 3;
+}
+
+#toolbar .split-button-divider {
+    width: 1px;
+    height: 19px;
+    content: url(Images/toolbarSplitButtonDivider.png);
+    vertical-align: middle;
+}
+
+body.inactive #toolbar .split-button-divider {
+    content: url(Images/toolbarSplitButtonDividerInactive.png);
+}
+
+#toolbar .split-button {
+    padding: 0;
+    width: 20px;
+}
+
+#toolbar .split-button.middle {
+    border-left: transparent none 0 !important;
+    border-right: transparent none 0 !important;
+}
+
+#toolbar .split-button.first {
+    border-right: transparent none 0 !important;
+}
+
+#toolbar .split-button.last {
+    border-left: transparent none 0 !important;
+}
+
+#back img {
+    content: url(Images/treeLeftTriangleBlack.png);
+    position: relative;
+    top: -1px;
+    left: -1px;
+    width: 8px;
+    height: 8px;
+}
+
+#back:disabled img, #forward:disabled img {
+    opacity: 0.5;
+}
+
+#forward img {
+    content: url(Images/treeRightTriangleBlack.png);
+    position: relative;
+    top: -1px;
+    left: 2px;
+    width: 8px;
+    height: 8px;
+}
+
+.view-button-source img {
+    content: url(Images/sourceViewButton.png);
+    position: relative;
+    top: -1px;
+    width: 8px;
+    height: 7px;
+}
+
+.view-button-source.selected img {
+    content: url(Images/sourceViewButtonSelected.png);
+}
+
+.view-button-dom img {
+    content: url(Images/domViewButton.png);
+    position: relative;
+    top: -1px;
+    left: 1px;
+    width: 10px;
+    height: 7px;
+}
+
+.view-button-dom.selected img {
+    content: url(Images/domViewButtonSelected.png);
+}
+
+#viewbuttons {
+    position: absolute;
+    left: 200px;
+    padding-left: 8px;
+}
+
+#viewbuttons .selected {
+    font-weight: bold;
+}
+
+#search {
+    float: right;
+    width: 200px;
+}
+
+#search:focus {
+    outline: 1px auto;
+}
+
+#searchResults {
+    position: absolute;
+    top: -73px;
+    left: 200px;
+    right: 0;
+    height: 100px;
+    z-index: -1;
+    background-color: white;
+    border-bottom: 1px solid rgb(180, 180, 180);
+    overflow-y: auto;
+    overflow-x: hidden;
+}
+
+.search-results-section {
+    color: gray;
+    width: 28px;
+    float: left;
+    margin-left: -45px;
+    text-align: right;
+    font-size: 10px;
+    margin-top: 1px;
+    white-space: nowrap;
+}
+
+.selected .search-results-section {
+    color: rgba(255, 255, 255, 0.8);
+}
+
+.blurred .selected .search-results-section {
+    color: rgba(0, 0, 0, 0.5);
+}
+
+#searchResults > ol > ol > li {
+    padding-left: 45px;
+    white-space: nowrap;
+}
+
+.search-matched-string {
+    background-color: #ff8;
+}
+
+.selected .search-matched-string {
+    background-color: transparent;
+}
+
+#sidebar {
+    position: absolute;
+    top: 28px;
+    left: 0;
+    bottom: 0;
+    width: 200px;
+    background-color: rgb(214, 221, 229);
+    border-right: 1px solid rgb(64%, 64%, 64%);
+    -webkit-box-sizing: border-box;
+}
+
+body.inactive #sidebar {
+    background-color: rgb(232, 232, 232);
+}
+
+#statusbar {
+    position: absolute;
+    padding: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+    height: 21px;
+    border-top: 1px solid #bbb;
+    -webkit-box-sizing: border-box;
+    background-image: url(Images/sidebarResizeWidget.png), url(Images/sidebarStatusAreaBackground.png);
+    background-position: right, center;
+    background-repeat: no-repeat, repeat-x;
+}
+
+#statusbar button {
+    -webkit-apearance: none;
+    vertical-align: top;
+    border: 0;
+    width: 32px;
+    height: 20px;
+    margin: 0;
+    margin-left: -1px;
+    padding: 0;
+}
+
+#statusbar button:focus {
+    outline: none;
+}
+
+#statusbar button.action {
+    background-image: url(Images/sidebarActionWidget.png);
+}
+
+#statusbar button.action:active {
+    background-image: url(Images/sidebarActionWidgetPressed.png);
+}
+
+#statusbar #statusToggle {
+    background-image: url(Images/showStatusWidget.png);
+}
+
+#statusbar #statusToggle:active {
+    background-image: url(Images/showStatusWidgetPressed.png);
+}
+
+#statusbar #statusToggle.hide {
+    background-image: url(Images/hideStatusWidget.png);
+}
+
+#statusbar #statusToggle.hide:active {
+    background-image: url(Images/hideStatusWidgetPressed.png);
+}
+
+body.detached #attachToggle {
+    background-image: url(Images/sidebarAttachWidget.png);
+}
+
+body.detached #attachToggle:active {
+    background-image: url(Images/sidebarAttachWidgetPressed.png);
+}
+
+body.attached #attachToggle {
+    background-image: url(Images/sidebarDetachWidget.png);
+}
+
+body.attached #attachToggle:active {
+    background-image: url(Images/sidebarDetachWidgetPressed.png);
+}
+
+#status {
+    overflow: hidden;
+    position: absolute;
+    bottom: -57px;
+    left: 0;
+    width: 100%;
+    height: 78px;
+    padding: 2px 0;
+    margin: 0;
+    border-top: 1px solid rgb(64%, 64%, 64%);
+    -webkit-box-sizing: border-box;
+    list-style: none;
+    font-size: 11px;
+}
+
+#status li {
+    position: relative;
+    height: 37px;
+    -webkit-box-sizing: border-box;
+}
+
+#status li.selected {
+    background-image: url(Images/sidebarSelectionTall.png);
+    background-repeat: repeat-x;
+    background-position: center;
+    background-color: transparent !important;
+    color: white;
+    font-weight: bold;
+    text-shadow: rgba(0, 0, 0, 0.4) 0 1px 0;
+}
+
+#status .icon {
+    position: absolute;
+    top: 2px;
+    left: 15px;
+    width: 32px;
+    height: 32px;
+    background-repeat: no-repeat;
+    background-position: center center;
+}
+
+#status .icon.console {
+    background-image: url(Images/console.png);
+}
+
+#status .icon.network {
+    background-image: url(Images/network.png);
+}
+
+#status .title {
+    -webkit-box-sizing: border-box;
+    position: relative;
+    top: 5px;
+    padding-left: 58px;
+    right: 5px;
+    display: block;
+    white-space: nowrap;
+    overflow: hidden;
+    text-overflow: ellipsis;
+}
+
+#status .title.only {
+    top: 10px;
+}
+
+#status .info {
+    -webkit-box-sizing: border-box;
+    position: relative;
+    margin-top: 6px;
+    padding-left: 58px;
+    right: 5px;
+    display: block;
+    font-size: 9px;
+    white-space: nowrap;
+    overflow: hidden;
+    text-overflow: ellipsis;
+}
+
+#list {
+    overflow-x: hidden;
+    overflow-y: auto;
+    position: absolute;
+    top: 0;
+    left: 0;
+    bottom: 21px;
+    width: 100%;
+    padding: 2px 0;
+    margin: 0;
+    -webkit-box-sizing: border-box;
+    list-style: none;
+    font-size: 11px;
+}
+
+#list > li {
+    height: 26px;
+    color: rgb(96, 110, 128);
+    text-shadow: rgba(255, 255, 255, 0.75) 0 1px 0;
+    font-weight: bold;
+    line-height: 20px;
+    text-indent: 20px;
+    background-image: url(Images/rightTriangle.png);
+    background-repeat: no-repeat;
+    background-position: 10px 6px;
+    text-transform: uppercase;
+}
+
+#list > ol + li {
+    margin-top: 5px;
+}
+
+#list > li + li {
+    margin-top: 5px;
+}
+
+#list > li.expanded {
+    background-image: url(Images/downTriangle.png);
+    background-position: 10px 7px;
+}
+
+#list > ol {
+    display: none;
+    list-style: none;
+    padding: 0;
+    margin: 0;
+}
+
+#list > ol.expanded {
+    display: block;
+}
+
+#list > ol > li {
+    position: relative;
+    height: 37px;
+    -webkit-box-sizing: border-box;
+}
+
+#list .icon {
+    position: absolute;
+    top: 2px;
+    left: 15px;
+    width: 32px;
+    height: 32px;
+    background-image: url(Images/document.png);
+    background-repeat: no-repeat;
+    background-position: center center;
+}
+
+#list .icon.plain {
+    background-image: url(Images/plainDocument.png);
+}
+
+#list .icon .preview {
+    margin: auto;
+    display: block;
+    position: absolute;
+    top: 0;
+    bottom: 0;
+    left: 0;
+    right: 0;
+    max-width: 20px;
+    max-height: 22px;
+    -webkit-user-drag: none;
+    -webkit-box-sizing: border-box;
+    border-top: 6px solid transparent;
+}
+
+#list .icon .progress {
+    margin: auto;
+    display: block;
+    position: absolute;
+    top: 0;
+    bottom: 0;
+    left: 0;
+    right: 0;
+}
+
+#list .title {
+    -webkit-box-sizing: border-box;
+    position: relative;
+    top: 5px;
+    padding-left: 58px;
+    right: 5px;
+    display: block;
+    white-space: nowrap;
+    overflow: hidden;
+    text-overflow: ellipsis;
+}
+
+#list .title.only {
+    top: 10px;
+}
+
+#sidebar li .count {
+    float: right;
+    margin-top: 11px;
+    margin-right: 6px;
+    font-family: Helvetica, sans-serif;
+    font-weight: bold;
+    font-size: 11px;
+    line-height: 10px;
+    -webkit-border-radius: 7px;
+    color: white;
+    text-shadow: none;
+    background-image: url(Images/gradientHighlight.png), url(Images/gradient.png);
+    -webkit-background-size: 100%, 100%;
+    background-position: center;
+    padding: 2px 4px;
+    text-align: center;
+    text-indent: 0;
+    min-width: 20px;
+    -webkit-box-sizing: border-box;
+}
+
+#sidebar li .count.warnings {
+    background-color: orange;
+}
+
+#sidebar li .count.errors {
+    background-color: red;
+}
+
+#list .info {
+    -webkit-box-sizing: border-box;
+    position: relative;
+    margin-top: 6px;
+    padding-left: 58px;
+    right: 5px;
+    display: block;
+    font-size: 9px;
+    white-space: nowrap;
+    overflow: hidden;
+    text-overflow: ellipsis;
+}
+
+#list li.selected {
+    background-image: url(Images/sidebarSelectionTall.png);
+    background-repeat: repeat-x;
+    background-position: center;
+    background-color: transparent !important;
+    color: white;
+    font-weight: bold;
+    text-shadow: rgba(0, 0, 0, 0.4) 0 1px 0;
+}
+
+#sidebar.blurred li.selected {
+    background-image: url(Images/sidebarSelectionBlurredTall.png);
+}
+
+body.inactive #sidebar li.selected {
+    background-image: url(Images/sidebarSelectionGrayTall.png);
+}
+
+#main {
+    position: absolute;
+    top: 28px;
+    left: 200px;
+    right: 0;
+    bottom: 0;
+    overflow: hidden;
+    background-color: white;
+    z-index: -100;
+}
+
+.panel {
+    display: none;
+    overflow: hidden;
+    position: absolute;
+    top: 0;
+    left: 0;
+  &nbs