Changeset 126857 in webkit
- Timestamp:
- Aug 28, 2012, 1:52:26 AM (14 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 1 added
- 13 edited
-
CMakeLists.txt (modified) (1 diff)
-
ChangeLog (modified) (1 diff)
-
DerivedSources.make (modified) (1 diff)
-
DerivedSources.pri (modified) (2 diffs)
-
GNUmakefile.am (modified) (2 diffs)
-
GNUmakefile.list.am (modified) (1 diff)
-
WebCore.gyp/WebCore.gyp (modified) (3 diffs)
-
WebCore.gypi (modified) (1 diff)
-
WebCore.vcproj/WebCore.vcproj (modified) (1 diff)
-
WebCore.xcodeproj/project.pbxproj (modified) (2 diffs)
-
inspector/InspectorOverlay.cpp (modified) (18 diffs)
-
inspector/InspectorOverlay.h (modified) (3 diffs)
-
inspector/InspectorOverlayPage.html (added)
-
inspector/InspectorPageAgent.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/CMakeLists.txt
r126735 r126857 2765 2765 2766 2766 2767 # Generate InspectorOverlayPage.h 2768 ADD_CUSTOM_COMMAND( 2769 OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorOverlayPage.h 2770 MAIN_DEPENDENCY inspector/InspectorOverlayPage.html 2771 COMMAND ${PERL_EXECUTABLE} ${WEBCORE_DIR}/inspector/xxd.pl InspectorOverlayPage_html ${WEBCORE_DIR}/inspector/InspectorOverlayPage.html ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorOverlayPage.h 2772 VERBATIM) 2773 LIST(APPEND WebCore_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorOverlayPage.h) 2774 2775 2767 2776 # Generate InjectedScriptSource.h 2768 2777 ADD_CUSTOM_COMMAND( -
trunk/Source/WebCore/ChangeLog
r126855 r126857 1 2012-08-28 Pavel Feldman <pfeldman@chromium.org> 2 3 Web Inspector: introduce overlay page and migrate "paused in debugger" to it. 4 https://bugs.webkit.org/show_bug.cgi?id=95080 5 6 Reviewed by Yury Semikhatsky. 7 8 Separate page instance is now used to render overlay. Paused in debugger is migrated to the new overlay. 9 10 * CMakeLists.txt: 11 * DerivedSources.make: 12 * GNUmakefile.am: 13 * WebCore.gyp/WebCore.gyp: 14 * WebCore.gypi: 15 * WebCore.vcproj/WebCore.vcproj: 16 * WebCore.xcodeproj/project.pbxproj: 17 * inspector/InspectorOverlay.cpp: 18 (WebCore::InspectorOverlay::~InspectorOverlay): 19 (WebCore): 20 (WebCore::InspectorOverlay::paint): 21 (WebCore::InspectorOverlay::drawOutline): 22 (WebCore::InspectorOverlay::setPausedInDebuggerMessage): 23 (WebCore::InspectorOverlay::drawNodeHighlight): 24 (WebCore::InspectorOverlay::drawRectHighlight): 25 (WebCore::InspectorOverlay::drawOverlayPage): 26 (WebCore::InspectorOverlay::overlayPage): 27 (WebCore::InspectorOverlay::evaluateInOverlay): 28 * inspector/InspectorOverlay.h: 29 (InspectorOverlay): 30 * inspector/InspectorOverlayPage.html: Added. 31 * inspector/InspectorPageAgent.cpp: 32 (WebCore::InspectorPageAgent::didPaint): 33 1 34 2012-08-28 Andrey Adaikin <aandrey@chromium.org> 2 35 -
trunk/Source/WebCore/DerivedSources.make
r126627 r126857 1031 1031 python $(WebCore)/inspector/CodeGeneratorInspector.py $(WebCore)/inspector/Inspector.json --output_h_dir . --output_cpp_dir . 1032 1032 1033 all : InspectorOverlayPage.h 1034 1035 InspectorOverlayPage.h : InspectorOverlayPage.html 1036 perl $(WebCore)/inspector/xxd.pl InspectorOverlayPage_html $(WebCore)/inspector/InspectorOverlayPage.html InspectorOverlayPage.h 1037 1033 1038 all : InjectedScriptSource.h 1034 1039 -
trunk/Source/WebCore/DerivedSources.pri
r126756 r126857 57 57 58 58 INSPECTOR_BACKEND_COMMANDS_QRC = $$PWD/inspector/front-end/InspectorBackendCommands.qrc 59 60 INSPECTOR_OVERLAY_PAGE = $$PWD/inspector/InspectorOverlayPage.html 59 61 60 62 INJECTED_SCRIPT_SOURCE = $$PWD/inspector/InjectedScriptSource.js … … 784 786 GENERATORS += inspectorBackendCommands 785 787 788 inspectorOverlayPage.output = InspectorOverlayPage.h 789 inspectorOverlayPage.input = INSPECTOR_OVERLAY_PAGE 790 inspectorOverlayPage.commands = perl $$PWD/inspector/xxd.pl InspectorOverlayPage_html ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} 791 injectedScriptSource.add_output_to_sources = false 792 GENERATORS += inspectorOverlayPage 793 786 794 # GENERATOR 2-a: inspector injected script source compiler 787 795 injectedScriptSource.output = InjectedScriptSource.h -
trunk/Source/WebCore/GNUmakefile.am
r126735 r126857 919 919 DerivedSources/WebCore/InspectorBackendCommands.js: DerivedSources/WebCore/InspectorBackendDispatcher.h 920 920 DerivedSources/WebCore/InspectorBackendDispatcher.h: DerivedSources/WebCore/InspectorBackendDispatcher.cpp 921 DerivedSources/WebCore/InspectorOverlayPage.h: $(WebCore)/inspector/InspectorOverlayPage.html 922 $(AM_V_GEN)$(PERL) $(WebCore)/inspector/xxd.pl InspectorOverlayPage_html $(WebCore)/inspector/InspectorOverlayPage.html $(GENSOURCES_WEBCORE)/InspectorOverlayPage.h 921 923 DerivedSources/WebCore/InjectedScriptSource.h: $(WebCore)/inspector/InjectedScriptSource.js 922 924 $(AM_V_GEN)$(PERL) $(WebCore)/inspector/xxd.pl InjectedScriptSource_js $(WebCore)/inspector/InjectedScriptSource.js $(GENSOURCES_WEBCORE)/InjectedScriptSource.h … … 1195 1197 Source/WebCore/inspector/Inspector.json \ 1196 1198 Source/WebCore/inspector/Inspector-1.0.json \ 1199 Source/WebCore/inspector/InspectorOverlayPage.html \ 1197 1200 Source/WebCore/inspector/generate-inspector-protocol-version \ 1198 1201 Source/WebCore/inspector/xxd.pl \ -
trunk/Source/WebCore/GNUmakefile.list.am
r126735 r126857 26 26 DerivedSources/WebCore/InspectorFrontend.cpp \ 27 27 DerivedSources/WebCore/InspectorFrontend.h \ 28 DerivedSources/WebCore/InspectorOverlayPage.h \ 28 29 DerivedSources/WebCore/InspectorTypeBuilder.cpp \ 29 30 DerivedSources/WebCore/InspectorTypeBuilder.h \ -
trunk/Source/WebCore/WebCore.gyp/WebCore.gyp
r126735 r126857 440 440 }, 441 441 { 442 'target_name': 'inspector_overlay_page', 443 'type': 'none', 444 'actions': [ 445 { 446 'action_name': 'generateInspectorOverlayPage', 447 'inputs': [ 448 '../inspector/InspectorOverlayPage.html', 449 ], 450 'outputs': [ 451 '<(SHARED_INTERMEDIATE_DIR)/webkit/InspectorOverlayPage.h', 452 ], 453 'msvs_cygwin_shell': 0, 454 'action': [ 455 '<(perl_exe)', 456 '../inspector/xxd.pl', 457 'InspectorOverlayPage_html', 458 '<@(_inputs)', 459 '<@(_outputs)' 460 ], 461 'message': 'Generating InspectorOverlayPage.h from InspectorOverlayPage.html', 462 }, 463 ] 464 }, 465 { 442 466 'target_name': 'injected_script_source', 443 467 'type': 'none', … … 1177 1201 'dependencies': [ 1178 1202 'webcore_bindings_sources', 1203 'inspector_overlay_page', 1179 1204 'inspector_protocol_sources', 1180 1205 'injected_script_source', … … 1307 1332 'injected_script_source', 1308 1333 'injected_webgl_script_source', 1334 'inspector_overlay_page', 1309 1335 'inspector_protocol_sources', 1310 1336 'webcore_bindings_sources', -
trunk/Source/WebCore/WebCore.gypi
r126855 r126857 7227 7227 '<(PRODUCT_DIR)/DerivedSources/WebCore/InspectorFrontend.cpp', 7228 7228 '<(PRODUCT_DIR)/DerivedSources/WebCore/InspectorFrontend.h', 7229 '<(PRODUCT_DIR)/DerivedSources/WebCore/InspectorOverlayPage.h', 7229 7230 '<(PRODUCT_DIR)/DerivedSources/WebCore/InspectorTypeBuilder.cpp', 7230 7231 '<(PRODUCT_DIR)/DerivedSources/WebCore/InspectorTypeBuilder.h', -
trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj
r126735 r126857 615 615 </File> 616 616 <File 617 RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\InspectorOverlayPage.h" 618 > 619 </File> 620 <File 617 621 RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\InspectorTypeBuilder.cpp" 618 622 > -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r126834 r126857 9136 9136 7A674BD90F9EBF4E006CF099 /* PageGroupLoadDeferrer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageGroupLoadDeferrer.cpp; sourceTree = "<group>"; }; 9137 9137 7A674BDA0F9EBF4E006CF099 /* PageGroupLoadDeferrer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageGroupLoadDeferrer.h; sourceTree = "<group>"; }; 9138 7A7256B915EB9F5B007323A7 /* InspectorOverlayPage.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = InspectorOverlayPage.html; sourceTree = "<group>"; }; 9138 9139 7A74ECB8101839A500BF939E /* InspectorDOMStorageAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorDOMStorageAgent.cpp; sourceTree = "<group>"; }; 9139 9140 7A74ECB9101839A600BF939E /* InspectorDOMStorageAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorDOMStorageAgent.h; sourceTree = "<group>"; }; … … 14672 14673 7C522D4915B477E8009B7C95 /* InspectorOverlay.cpp */, 14673 14674 7C522D4A15B478B2009B7C95 /* InspectorOverlay.h */, 14675 7A7256B915EB9F5B007323A7 /* InspectorOverlayPage.html */, 14674 14676 4F6FDD621341DEDD001F8EE3 /* InspectorPageAgent.cpp */, 14675 14677 4F6FDD631341DEDD001F8EE3 /* InspectorPageAgent.h */, -
trunk/Source/WebCore/inspector/InspectorOverlay.cpp
r126359 r126857 33 33 #include "InspectorOverlay.h" 34 34 35 #include "DocumentLoader.h" 35 36 #include "Element.h" 37 #include "EmptyClients.h" 36 38 #include "Font.h" 37 39 #include "FontCache.h" … … 42 44 #include "GraphicsTypes.h" 43 45 #include "InspectorClient.h" 46 #include "InspectorOverlayPage.h" 47 #include "InspectorValues.h" 44 48 #include "Node.h" 45 49 #include "Page.h" … … 48 52 #include "RenderInline.h" 49 53 #include "RenderObject.h" 54 #include "ScriptSourceCode.h" 55 #include "ScriptValue.h" 50 56 #include "Settings.h" 51 57 #include "StyledElement.h" … … 82 88 } 83 89 84 void drawOutlinedQuad(GraphicsContext &context, const FloatQuad& quad, const Color& fillColor, const Color& outlineColor)90 void drawOutlinedQuad(GraphicsContext* context, const FloatQuad& quad, const Color& fillColor, const Color& outlineColor) 85 91 { 86 92 static const int outlineThickness = 2; … … 91 97 // of outline (because inflating a quad is hard) 92 98 { 93 context .save();94 context .clipOut(quadPath);95 96 context .setStrokeThickness(outlineThickness);97 context .setStrokeColor(outlineColor, ColorSpaceDeviceRGB);98 context .strokePath(quadPath);99 100 context .restore();99 context->save(); 100 context->clipOut(quadPath); 101 102 context->setStrokeThickness(outlineThickness); 103 context->setStrokeColor(outlineColor, ColorSpaceDeviceRGB); 104 context->strokePath(quadPath); 105 106 context->restore(); 101 107 } 102 108 103 109 // Now do the fill 104 context .setFillColor(fillColor, ColorSpaceDeviceRGB);105 context .fillPath(quadPath);106 } 107 108 void drawOutlinedQuadWithClip(GraphicsContext &context, const FloatQuad& quad, const FloatQuad& clipQuad, const Color& fillColor)109 { 110 context .save();110 context->setFillColor(fillColor, ColorSpaceDeviceRGB); 111 context->fillPath(quadPath); 112 } 113 114 void drawOutlinedQuadWithClip(GraphicsContext* context, const FloatQuad& quad, const FloatQuad& clipQuad, const Color& fillColor) 115 { 116 context->save(); 111 117 Path clipQuadPath = quadToPath(clipQuad); 112 context .clipOut(clipQuadPath);118 context->clipOut(clipQuadPath); 113 119 drawOutlinedQuad(context, quad, fillColor, Color::transparent); 114 context .restore();115 } 116 117 void drawHighlightForBox(GraphicsContext &context, const FloatQuad& contentQuad, const FloatQuad& paddingQuad, const FloatQuad& borderQuad, const FloatQuad& marginQuad, const HighlightConfig& highlightConfig)120 context->restore(); 121 } 122 123 void drawHighlightForBox(GraphicsContext* context, const FloatQuad& contentQuad, const FloatQuad& paddingQuad, const FloatQuad& borderQuad, const FloatQuad& marginQuad, const HighlightConfig& highlightConfig) 118 124 { 119 125 bool hasMargin = highlightConfig.margin != Color::transparent; … … 140 146 } 141 147 142 void drawHighlightForSVGRenderer(GraphicsContext &context, const Vector<FloatQuad>& absoluteQuads, const HighlightConfig& highlightConfig)148 void drawHighlightForSVGRenderer(GraphicsContext* context, const Vector<FloatQuad>& absoluteQuads, const HighlightConfig& highlightConfig) 143 149 { 144 150 for (size_t i = 0; i < absoluteQuads.size(); ++i) … … 146 152 } 147 153 148 int drawSubstring(const TextRun& globalTextRun, int offset, int length, const Color& textColor, const Font& font, GraphicsContext &context, const LayoutRect& titleRect)149 { 150 context .setFillColor(textColor, ColorSpaceDeviceRGB);151 context .drawText(font, globalTextRun, IntPoint(titleRect.pixelSnappedX() + rectInflatePx, titleRect.pixelSnappedY() + font.fontMetrics().height()), offset, offset + length);154 int drawSubstring(const TextRun& globalTextRun, int offset, int length, const Color& textColor, const Font& font, GraphicsContext* context, const LayoutRect& titleRect) 155 { 156 context->setFillColor(textColor, ColorSpaceDeviceRGB); 157 context->drawText(font, globalTextRun, IntPoint(titleRect.pixelSnappedX() + rectInflatePx, titleRect.pixelSnappedY() + font.fontMetrics().height()), offset, offset + length); 152 158 return offset + length; 153 159 } … … 219 225 } 220 226 221 void drawElementTitle(GraphicsContext &context, Node* node, RenderObject* renderer, const IntRect& boundingBox, const IntRect& anchorBox, const FloatRect& visibleRect, WebCore::Settings* settings)227 void drawElementTitle(GraphicsContext* context, Node* node, RenderObject* renderer, const IntRect& boundingBox, const IntRect& anchorBox, const FloatRect& visibleRect, WebCore::Settings* settings) 222 228 { 223 229 DEFINE_STATIC_LOCAL(Color, backgroundColor, (255, 255, 194)); … … 334 340 path.addLineTo(points[i]); 335 341 336 context .save();337 context .translate(0.5f, 0.5f);338 context .setStrokeColor(pxAndBorderColor, ColorSpaceDeviceRGB);339 context .setFillColor(backgroundColor, ColorSpaceDeviceRGB);340 context .setStrokeThickness(borderWidthPx);341 context .fillPath(path);342 context .strokePath(path);343 context .restore();342 context->save(); 343 context->translate(0.5f, 0.5f); 344 context->setStrokeColor(pxAndBorderColor, ColorSpaceDeviceRGB); 345 context->setFillColor(backgroundColor, ColorSpaceDeviceRGB); 346 context->setStrokeThickness(borderWidthPx); 347 context->fillPath(path); 348 context->strokePath(path); 349 context->restore(); 344 350 } 345 351 … … 398 404 399 405 if (context) 400 drawHighlightForSVGRenderer( *context, highlight->quads, highlightConfig);406 drawHighlightForSVGRenderer(context, highlight->quads, highlightConfig); 401 407 } else if (renderer->isBox() || renderer->isRenderInline()) { 402 408 LayoutRect contentBox; … … 452 458 453 459 if (context) 454 drawHighlightForBox( *context, absContentQuad, absPaddingQuad, absBorderQuad, absMarginQuad, highlightConfig);460 drawHighlightForBox(context, absContentQuad, absPaddingQuad, absBorderQuad, absMarginQuad, highlightConfig); 455 461 } 456 462 … … 461 467 462 468 if (context && highlightConfig.showInfo) 463 drawElementTitle( *context, node, renderer, pixelSnappedIntRect(boundingBox), pixelSnappedIntRect(titleAnchorBox), visibleRect, containingFrame->settings());469 drawElementTitle(context, node, renderer, pixelSnappedIntRect(boundingBox), pixelSnappedIntRect(titleAnchorBox), visibleRect, containingFrame->settings()); 464 470 } 465 471 … … 481 487 } 482 488 483 drawOutlinedQuad( *context, highlightRect, highlightConfig.content, highlightConfig.contentOutline);489 drawOutlinedQuad(context, highlightRect, highlightConfig.content, highlightConfig.contentOutline); 484 490 } 485 491 } … … 493 499 } 494 500 501 InspectorOverlay::~InspectorOverlay() 502 { 503 } 504 495 505 void InspectorOverlay::paint(GraphicsContext& context) 496 506 { 497 drawPausedInDebugger(context); 498 drawNodeHighlight(context); 499 drawRectHighlight(context); 500 } 501 502 void InspectorOverlay::drawOutline(GraphicsContext& context, const LayoutRect& rect, const Color& color) 507 drawNodeHighlight(&context); 508 drawRectHighlight(&context); 509 510 if (m_pausedInDebuggerMessage.isNull()) 511 return; 512 drawOverlayPage(&context); 513 } 514 515 void InspectorOverlay::drawOutline(GraphicsContext* context, const LayoutRect& rect, const Color& color) 503 516 { 504 517 FloatRect outlineRect = rect; … … 524 537 { 525 538 m_pausedInDebuggerMessage = message ? *message : String(); 539 evaluateInOverlay("setPausedInDebuggerMessage", m_pausedInDebuggerMessage); 526 540 update(); 527 541 } … … 555 569 void InspectorOverlay::update() 556 570 { 557 if (m_highlightNode || m_highlightRect || !m_pausedInDebuggerMessage.isNull()) 558 m_client->highlight(); 559 else 571 if (!m_highlightNode && !m_highlightRect && m_pausedInDebuggerMessage.isNull()) { 560 572 m_client->hideHighlight(); 561 } 562 563 void InspectorOverlay::drawNodeHighlight(GraphicsContext& context) 573 return; 574 } 575 576 FrameView* view = m_page->mainFrame()->view(); 577 FrameView* overlayView = overlayPage()->mainFrame()->view(); 578 IntRect visibleRect = enclosingIntRect(view->visibleContentRect()); 579 overlayView->resize(visibleRect.width(), visibleRect.height()); 580 if (overlayView->needsLayout()) 581 overlayView->layout(); 582 m_client->highlight(); 583 } 584 585 void InspectorOverlay::drawNodeHighlight(GraphicsContext* context) 564 586 { 565 587 if (!m_highlightNode) … … 567 589 568 590 Highlight highlight; 569 getOrDrawNodeHighlight( &context, m_highlightNode.get(), m_nodeHighlightConfig, &highlight);570 } 571 572 void InspectorOverlay::drawRectHighlight(GraphicsContext &context)591 getOrDrawNodeHighlight(context, m_highlightNode.get(), m_nodeHighlightConfig, &highlight); 592 } 593 594 void InspectorOverlay::drawRectHighlight(GraphicsContext* context) 573 595 { 574 596 if (!m_highlightRect) … … 576 598 577 599 Highlight highlight; 578 getOrDrawRectHighlight(&context, m_page, m_highlightRect.get(), m_rectHighlightConfig, &highlight); 579 } 580 581 void InspectorOverlay::drawPausedInDebugger(GraphicsContext& context) 582 { 583 if (m_pausedInDebuggerMessage.isNull()) 584 return; 585 586 DEFINE_STATIC_LOCAL(Color, backgroundColor, (0, 0, 0, 31)); 587 DEFINE_STATIC_LOCAL(Color, textBackgroundColor, (255, 255, 194)); 588 DEFINE_STATIC_LOCAL(Color, borderColor, (128, 128, 128)); 589 590 Frame* frame = m_page->mainFrame(); 591 Settings* settings = frame->settings(); 592 IntRect visibleRect = IntRect(IntPoint(), frame->view()->visibleSize()); 593 594 context.setFillColor(backgroundColor, ColorSpaceDeviceRGB); 595 context.fillRect(visibleRect); 596 597 FontDescription desc; 598 setUpFontDescription(desc, settings); 599 Font font = Font(desc, 0, 0); 600 font.update(0); 601 602 TextRun textRun(m_pausedInDebuggerMessage); 603 IntRect titleRect = enclosingIntRect(font.selectionRectForText(textRun, IntPoint(), fontHeightPx)); 604 titleRect.inflate(rectInflatePx); 605 titleRect.setLocation(IntPoint(visibleRect.width() / 2 - titleRect.width() / 2, 0)); 606 607 context.setFillColor(textBackgroundColor, ColorSpaceDeviceRGB); 608 context.setStrokeColor(borderColor, ColorSpaceDeviceRGB); 609 context.drawRect(titleRect); 610 drawSubstring(textRun, 0, m_pausedInDebuggerMessage.length(), Color::black, font, context, titleRect); 600 getOrDrawRectHighlight(context, m_page, m_highlightRect.get(), m_rectHighlightConfig, &highlight); 601 } 602 603 void InspectorOverlay::drawOverlayPage(GraphicsContext* context) 604 { 605 GraphicsContextStateSaver stateSaver(*context); 606 FrameView* view = overlayPage()->mainFrame()->view(); 607 view->paint(context, IntRect(0, 0, view->width(), view->height())); 608 } 609 610 Page* InspectorOverlay::overlayPage() 611 { 612 if (m_overlayPage) 613 return m_overlayPage.get(); 614 615 static FrameLoaderClient* dummyFrameLoaderClient = new EmptyFrameLoaderClient; 616 Page::PageClients pageClients; 617 fillWithEmptyClients(pageClients); 618 m_overlayPage = adoptPtr(new Page(pageClients)); 619 620 Settings* settings = m_page->settings(); 621 Settings* overlaySettings = m_overlayPage->settings(); 622 623 overlaySettings->setStandardFontFamily(settings->standardFontFamily()); 624 #if OS(WINDOWS) 625 overlaySettings->setFixedFontFamily("Consolas"); 626 #elif OS(MAC_OS_X) 627 overlaySettings->setFixedFontFamily("Menlo"); 628 #elif OS(UNIX) 629 overlaySettings->setFixedFontFamily("dejavu sans mono"); 630 #endif 631 overlaySettings->setSerifFontFamily(settings->serifFontFamily()); 632 overlaySettings->setSansSerifFontFamily(settings->sansSerifFontFamily()); 633 overlaySettings->setCursiveFontFamily(settings->cursiveFontFamily()); 634 overlaySettings->setFantasyFontFamily(settings->fantasyFontFamily()); 635 overlaySettings->setPictographFontFamily(settings->pictographFontFamily()); 636 overlaySettings->setMinimumFontSize(settings->minimumFontSize()); 637 overlaySettings->setMinimumLogicalFontSize(settings->minimumLogicalFontSize()); 638 overlaySettings->setDefaultFontSize(settings->defaultFontSize()); 639 overlaySettings->setDefaultFixedFontSize(settings->defaultFixedFontSize()); 640 overlaySettings->setMediaEnabled(false); 641 overlaySettings->setScriptEnabled(true); 642 overlaySettings->setPluginsEnabled(false); 643 644 RefPtr<Frame> frame = Frame::create(m_overlayPage.get(), 0, dummyFrameLoaderClient); 645 frame->setView(FrameView::create(frame.get())); 646 frame->init(); 647 FrameLoader* loader = frame->loader(); 648 frame->view()->setCanHaveScrollbars(false); 649 frame->view()->setTransparent(true); 650 ASSERT(loader->activeDocumentLoader()); 651 loader->activeDocumentLoader()->writer()->setMIMEType("text/html"); 652 loader->activeDocumentLoader()->writer()->begin(); 653 loader->activeDocumentLoader()->writer()->addData(reinterpret_cast<const char*>(InspectorOverlayPage_html), sizeof(InspectorOverlayPage_html)); 654 loader->activeDocumentLoader()->writer()->end(); 655 656 return m_overlayPage.get(); 657 } 658 659 void InspectorOverlay::evaluateInOverlay(const String& method, const String& argument) 660 { 661 RefPtr<InspectorArray> command = InspectorArray::create(); 662 command->pushString(method); 663 command->pushString(argument); 664 overlayPage()->mainFrame()->script()->evaluate(ScriptSourceCode(makeString("dispatch(", command->toJSONString(), ")"))); 611 665 } 612 666 -
trunk/Source/WebCore/inspector/InspectorOverlay.h
r125025 r126857 89 89 return adoptPtr(new InspectorOverlay(page, client)); 90 90 } 91 ~InspectorOverlay(); 91 92 92 93 void paint(GraphicsContext&); 93 void drawOutline(GraphicsContext &, const LayoutRect&, const Color&);94 void drawOutline(GraphicsContext*, const LayoutRect&, const Color&); 94 95 void getHighlight(Highlight*) const; 95 96 … … 106 107 107 108 void update(); 108 void drawNodeHighlight(GraphicsContext&); 109 void drawRectHighlight(GraphicsContext&); 110 void drawPausedInDebugger(GraphicsContext&); 109 void drawNodeHighlight(GraphicsContext*); 110 void drawRectHighlight(GraphicsContext*); 111 void drawOverlayPage(GraphicsContext*); 112 Page* overlayPage(); 113 void evaluateInOverlay(const String& method, const String& argument); 111 114 112 115 Page* m_page; … … 116 119 HighlightConfig m_nodeHighlightConfig; 117 120 OwnPtr<IntRect> m_highlightRect; 121 OwnPtr<Page> m_overlayPage; 118 122 HighlightConfig m_rectHighlightConfig; 119 123 }; -
trunk/Source/WebCore/inspector/InspectorPageAgent.cpp
r126837 r126857 900 900 }; 901 901 902 m_overlay->drawOutline( *m_lastPaintContext, m_lastPaintRect, colors[colorSelector++ % WTF_ARRAY_LENGTH(colors)]);902 m_overlay->drawOutline(m_lastPaintContext, m_lastPaintRect, colors[colorSelector++ % WTF_ARRAY_LENGTH(colors)]); 903 903 904 904 m_lastPaintContext = 0;
Note:
See TracChangeset
for help on using the changeset viewer.