Changeset 194117 in webkit


Ignore:
Timestamp:
Dec 15, 2015 2:46:02 PM (8 years ago)
Author:
timothy_horton@apple.com
Message:

REGRESSION (r191849): There's no yellow bouncy highlight when using Find on Page on iOS
https://bugs.webkit.org/show_bug.cgi?id=152241
<rdar://problem/23642574>

Reviewed by Simon Fraser.

Tests: pageoverlay/overlay-small-frame-mouse-events.html

pageoverlay/overlay-small-frame-paints.html

  • page/PageOverlay.cpp:

(WebCore::PageOverlay::bounds):
Revert r191849's change that made bounds() actually return the frame()
if we frame is manually overriden.

(WebCore::PageOverlay::mouseEvent):
Convert the mouse event the rest of the way into overlay coordinates (by
applying the overlay's frame origin) before deciding whether to handle
the event.

  • page/PageOverlay.h:
  • DerivedSources.make:
  • WebCore.xcodeproj/project.pbxproj:
  • testing/Internals.cpp:

(WebCore::Internals::installMockPageOverlay):

  • testing/Internals.h:
  • testing/Internals.idl:
  • testing/MockPageOverlay.cpp: Added.

(WebCore::MockPageOverlay::create):
(WebCore::MockPageOverlay::MockPageOverlay):
(WebCore::MockPageOverlay::setFrame):

  • testing/MockPageOverlay.h: Added.

(WebCore::MockPageOverlay::overlay):

  • testing/MockPageOverlay.idl: Added.
  • testing/MockPageOverlayClient.cpp:

(WebCore::MockPageOverlayClient::installOverlay):
(WebCore::MockPageOverlayClient::uninstallAllOverlays):
(WebCore::MockPageOverlayClient::pageOverlayDestroyed):
(WebCore::MockPageOverlayClient::drawRect):
(WebCore::MockPageOverlayClient::mouseEvent):

  • testing/MockPageOverlayClient.h:

Make internals.installMockPageOverlay return a MockPageOverlay object so
tests can manipulate their overlay. For now, expose setFrame.
Also, log when MockPageOverlayClient gets asked to paint or receives a mouse event,
which will show up in test output. Slightly unconventional, but very convenient.

  • pageoverlay/overlay-small-frame-mouse-events-expected.txt: Added.
  • pageoverlay/overlay-small-frame-mouse-events.html: Added.

Add a test ensuring that small-frame overlays get mouse events.

  • pageoverlay/overlay-small-frame-paints-expected.txt: Added.
  • pageoverlay/overlay-small-frame-paints.html: Added.

Add a test ensuring that small-frame overlays get paint callbacks.

Location:
trunk
Files:
7 added
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r194114 r194117  
     12015-12-15  Tim Horton  <timothy_horton@apple.com>
     2
     3        REGRESSION (r191849): There's no yellow bouncy highlight when using Find on Page on iOS
     4        https://bugs.webkit.org/show_bug.cgi?id=152241
     5        <rdar://problem/23642574>
     6
     7        Reviewed by Simon Fraser.
     8
     9        * pageoverlay/overlay-small-frame-mouse-events-expected.txt: Added.
     10        * pageoverlay/overlay-small-frame-mouse-events.html: Added.
     11        Add a test ensuring that small-frame overlays get mouse events.
     12
     13        * pageoverlay/overlay-small-frame-paints-expected.txt: Added.
     14        * pageoverlay/overlay-small-frame-paints.html: Added.
     15        Add a test ensuring that small-frame overlays get paint callbacks.
     16
    1172015-12-15  Myles C. Maxfield  <mmaxfield@apple.com>
    218
  • trunk/LayoutTests/pageoverlay/overlay-installation-expected.txt

    r174315 r194117  
     1CONSOLE MESSAGE: MockPageOverlayClient::drawRect dirtyRect (0, 0, 800, 600)
     2CONSOLE MESSAGE: MockPageOverlayClient::drawRect dirtyRect (0, 0, 800, 600)
    13View-relative:
    24(GraphicsLayer
  • trunk/LayoutTests/pageoverlay/overlay-large-document-expected.txt

    r174315 r194117  
     1CONSOLE MESSAGE: MockPageOverlayClient::drawRect dirtyRect (0, 0, 785, 585)
     2CONSOLE MESSAGE: MockPageOverlayClient::drawRect dirtyRect (512, 512, 512, 512)
     3CONSOLE MESSAGE: MockPageOverlayClient::drawRect dirtyRect (0, 512, 512, 512)
     4CONSOLE MESSAGE: MockPageOverlayClient::drawRect dirtyRect (512, 0, 512, 512)
     5CONSOLE MESSAGE: MockPageOverlayClient::drawRect dirtyRect (0, 0, 512, 512)
    16View-relative:
    27(GraphicsLayer
  • trunk/LayoutTests/pageoverlay/overlay-large-document-scrolled-expected.txt

    r174315 r194117  
     1CONSOLE MESSAGE: MockPageOverlayClient::drawRect dirtyRect (0, 0, 785, 585)
     2CONSOLE MESSAGE: MockPageOverlayClient::drawRect dirtyRect (4608, 4608, 400, 408)
     3CONSOLE MESSAGE: MockPageOverlayClient::drawRect dirtyRect (4096, 4608, 512, 408)
     4CONSOLE MESSAGE: MockPageOverlayClient::drawRect dirtyRect (4608, 4096, 400, 512)
     5CONSOLE MESSAGE: MockPageOverlayClient::drawRect dirtyRect (4096, 4096, 512, 512)
    16View-relative:
    27(GraphicsLayer
  • trunk/Source/WebCore/ChangeLog

    r194114 r194117  
     12015-12-15  Tim Horton  <timothy_horton@apple.com>
     2
     3        REGRESSION (r191849): There's no yellow bouncy highlight when using Find on Page on iOS
     4        https://bugs.webkit.org/show_bug.cgi?id=152241
     5        <rdar://problem/23642574>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Tests: pageoverlay/overlay-small-frame-mouse-events.html
     10               pageoverlay/overlay-small-frame-paints.html
     11
     12        * page/PageOverlay.cpp:
     13        (WebCore::PageOverlay::bounds):
     14        Revert r191849's change that made bounds() actually return the frame()
     15        if we frame is manually overriden.
     16
     17        (WebCore::PageOverlay::mouseEvent):
     18        Convert the mouse event the rest of the way into overlay coordinates (by
     19        applying the overlay's frame origin) before deciding whether to handle
     20        the event.
     21
     22        * page/PageOverlay.h:
     23
     24        * DerivedSources.make:
     25        * WebCore.xcodeproj/project.pbxproj:
     26        * testing/Internals.cpp:
     27        (WebCore::Internals::installMockPageOverlay):
     28        * testing/Internals.h:
     29        * testing/Internals.idl:
     30        * testing/MockPageOverlay.cpp: Added.
     31        (WebCore::MockPageOverlay::create):
     32        (WebCore::MockPageOverlay::MockPageOverlay):
     33        (WebCore::MockPageOverlay::setFrame):
     34        * testing/MockPageOverlay.h: Added.
     35        (WebCore::MockPageOverlay::overlay):
     36        * testing/MockPageOverlay.idl: Added.
     37        * testing/MockPageOverlayClient.cpp:
     38        (WebCore::MockPageOverlayClient::installOverlay):
     39        (WebCore::MockPageOverlayClient::uninstallAllOverlays):
     40        (WebCore::MockPageOverlayClient::pageOverlayDestroyed):
     41        (WebCore::MockPageOverlayClient::drawRect):
     42        (WebCore::MockPageOverlayClient::mouseEvent):
     43        * testing/MockPageOverlayClient.h:
     44        Make internals.installMockPageOverlay return a MockPageOverlay object so
     45        tests can manipulate their overlay. For now, expose setFrame.
     46        Also, log when MockPageOverlayClient gets asked to paint or receives a mouse event,
     47        which will show up in test output. Slightly unconventional, but very convenient.
     48
    1492015-12-15  Myles C. Maxfield  <mmaxfield@apple.com>
    250
  • trunk/Source/WebCore/DerivedSources.make

    r193957 r194117  
    526526    $(WebCore)/testing/MemoryInfo.idl \
    527527    $(WebCore)/testing/MockContentFilterSettings.idl \
     528        $(WebCore)/testing/MockPageOverlay.idl \
    528529    $(WebCore)/testing/TypeConversions.idl \
    529530    $(WebCore)/workers/AbstractWorker.idl \
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r194033 r194117  
    131131                07277E5417D018CC0015534D /* JSMediaStreamTrackEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07277E4817D018CC0015534D /* JSMediaStreamTrackEvent.cpp */; };
    132132                07277E5517D018CC0015534D /* JSMediaStreamTrackEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 07277E4917D018CC0015534D /* JSMediaStreamTrackEvent.h */; };
    133                 07297FA71C1881C5003F0735 /* UserMediaPermissionCheck.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07297FA51C1881C5003F0735 /* UserMediaPermissionCheck.cpp */; settings = {ASSET_TAGS = (); }; };
     133                07297FA71C1881C5003F0735 /* UserMediaPermissionCheck.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07297FA51C1881C5003F0735 /* UserMediaPermissionCheck.cpp */; };
    134134                07297FA81C1881C5003F0735 /* UserMediaPermissionCheck.h in Headers */ = {isa = PBXBuildFile; fileRef = 07297FA61C1881C5003F0735 /* UserMediaPermissionCheck.h */; settings = {ATTRIBUTES = (Private, ); }; };
    135135                072AE1E5183C0741000A5988 /* PluginReplacement.h in Headers */ = {isa = PBXBuildFile; fileRef = 072AE1DF183C0741000A5988 /* PluginReplacement.h */; };
     
    11141114                2D3EF44B1917915C00034184 /* WebCoreCALayerExtras.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D3EF4471917915C00034184 /* WebCoreCALayerExtras.mm */; };
    11151115                2D413F611A187A3F0041A521 /* LookupSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D413F601A187A3F0041A521 /* LookupSPI.h */; settings = {ATTRIBUTES = (Private, ); }; };
     1116                2D4150DE1C1F868C000A3BA2 /* JSMockPageOverlay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D6F3E921C1F85550061DBD4 /* JSMockPageOverlay.cpp */; };
    11161117                2D46F04E17B96FBD005647F0 /* IntPoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D46F04D17B96FBD005647F0 /* IntPoint.cpp */; };
    11171118                2D46F05017B96FD2005647F0 /* IntSize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D46F04F17B96FD2005647F0 /* IntSize.cpp */; };
     
    11401141                2D5C9D0219C7B52E00B3C5C1 /* PageOverlayController.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D5C9CFE19C7B52E00B3C5C1 /* PageOverlayController.h */; settings = {ATTRIBUTES = (Private, ); }; };
    11411142                2D6E468417D660F500ECF8BB /* PDFDocumentImageMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D6E468217D660F500ECF8BB /* PDFDocumentImageMac.mm */; };
     1143                2D6F3E901C1ECB270061DBD4 /* MockPageOverlay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D6F3E8A1C1ECB1C0061DBD4 /* MockPageOverlay.cpp */; };
     1144                2D6F3E911C1ECB2F0061DBD4 /* MockPageOverlay.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D6F3E8B1C1ECB1C0061DBD4 /* MockPageOverlay.h */; };
     1145                2D6F3E951C1F85550061DBD4 /* JSMockPageOverlay.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D6F3E931C1F85550061DBD4 /* JSMockPageOverlay.h */; };
    11421146                2D70BA1318074DDF0001908A /* PlatformCALayerCocoa.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D70BA1218074DDF0001908A /* PlatformCALayerCocoa.h */; settings = {ATTRIBUTES = (Private, ); }; };
    11431147                2D70BA1518074F860001908A /* PlatformCALayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D70BA1418074F850001908A /* PlatformCALayer.cpp */; };
     
    84918495                2D5C9CFE19C7B52E00B3C5C1 /* PageOverlayController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageOverlayController.h; sourceTree = "<group>"; };
    84928496                2D6E468217D660F500ECF8BB /* PDFDocumentImageMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PDFDocumentImageMac.mm; sourceTree = "<group>"; };
     8497                2D6F3E8A1C1ECB1C0061DBD4 /* MockPageOverlay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MockPageOverlay.cpp; sourceTree = "<group>"; };
     8498                2D6F3E8B1C1ECB1C0061DBD4 /* MockPageOverlay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MockPageOverlay.h; sourceTree = "<group>"; };
     8499                2D6F3E8C1C1ECB1C0061DBD4 /* MockPageOverlay.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MockPageOverlay.idl; sourceTree = "<group>"; };
     8500                2D6F3E921C1F85550061DBD4 /* JSMockPageOverlay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMockPageOverlay.cpp; sourceTree = "<group>"; };
     8501                2D6F3E931C1F85550061DBD4 /* JSMockPageOverlay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMockPageOverlay.h; sourceTree = "<group>"; };
    84938502                2D70BA1218074DDF0001908A /* PlatformCALayerCocoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformCALayerCocoa.h; sourceTree = "<group>"; };
    84948503                2D70BA1418074F850001908A /* PlatformCALayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformCALayer.cpp; sourceTree = "<group>"; };
     
    1640216411                                A1B5B29D1AAA846E008B6042 /* MockContentFilterSettings.h */,
    1640316412                                A19AEA1C1AAA7C4900B52B25 /* MockContentFilterSettings.idl */,
     16413                                2D6F3E8A1C1ECB1C0061DBD4 /* MockPageOverlay.cpp */,
     16414                                2D6F3E8B1C1ECB1C0061DBD4 /* MockPageOverlay.h */,
     16415                                2D6F3E8C1C1ECB1C0061DBD4 /* MockPageOverlay.idl */,
    1640416416                                2DAAE32C19DCAF6000E002D2 /* MockPageOverlayClient.cpp */,
    1640516417                                2DAAE32D19DCAF6000E002D2 /* MockPageOverlayClient.h */,
     
    1642616438                                A19AEA1D1AAA806E00B52B25 /* JSMockContentFilterSettings.cpp */,
    1642716439                                A19AEA1E1AAA806E00B52B25 /* JSMockContentFilterSettings.h */,
     16440                                2D6F3E921C1F85550061DBD4 /* JSMockPageOverlay.cpp */,
     16441                                2D6F3E931C1F85550061DBD4 /* JSMockPageOverlay.h */,
    1642816442                                EBF5121A1696496C0056BD25 /* JSTypeConversions.cpp */,
    1642916443                                EBF5121B1696496C0056BD25 /* JSTypeConversions.h */,
     
    2448724501                                A740B5A514C935AB00A77FA4 /* JSInternalSettings.h in Headers */,
    2448824502                                53ED3FDF167A88E7006762E6 /* JSInternalSettingsGenerated.h in Headers */,
     24503                                2D6F3E911C1ECB2F0061DBD4 /* MockPageOverlay.h in Headers */,
    2448924504                                A740B59514C935AB00A77FA4 /* JSMallocStatistics.h in Headers */,
    2449024505                                CD5393D4175E018600C07123 /* JSMemoryInfo.h in Headers */,
     
    2756427579                                B22279D10D00BF220071B782 /* SVGFECompositeElement.h in Headers */,
    2756527580                                1921327511C0E6BB00456238 /* SVGFEConvolveMatrixElement.h in Headers */,
     27581                                2D6F3E951C1F85550061DBD4 /* JSMockPageOverlay.h in Headers */,
    2756627582                                B22279D40D00BF220071B782 /* SVGFEDiffuseLightingElement.h in Headers */,
    2756727583                                B22279D70D00BF220071B782 /* SVGFEDisplacementMapElement.h in Headers */,
     
    2840328419                        buildActionMask = 2147483647;
    2840428420                        files = (
     28421                                2D4150DE1C1F868C000A3BA2 /* JSMockPageOverlay.cpp in Sources */,
    2840528422                                417DA6D913734E6E007C57FB /* Internals.cpp in Sources */,
    2840628423                                E179F0DA1B9774FE00ED0A27 /* Internals.mm in Sources */,
     
    2841428431                                A19AEA221AAA808A00B52B25 /* JSMockContentFilterSettings.cpp in Sources */,
    2841528432                                A1E5B31F1AAD1DA4006EBEFB /* JSMockContentFilterSettingsCustom.cpp in Sources */,
     28433                                2D6F3E901C1ECB270061DBD4 /* MockPageOverlay.cpp in Sources */,
    2841628434                                EBF5121C1696496C0056BD25 /* JSTypeConversions.cpp in Sources */,
    2841728435                                CDC26B40160A8CC60026757B /* MockCDM.cpp in Sources */,
  • trunk/Source/WebCore/page/PageOverlay.cpp

    r191922 r194117  
    7676{
    7777    if (!m_overrideFrame.isEmpty())
    78         return m_overrideFrame;
     78        return { { }, m_overrideFrame.size() };
    7979
    8080    FrameView* frameView = m_page->mainFrame().view();
     
    188188    if (m_overlayType == PageOverlay::OverlayType::Document)
    189189        mousePositionInOverlayCoordinates = m_page->mainFrame().view()->windowToContents(mousePositionInOverlayCoordinates);
     190    mousePositionInOverlayCoordinates.moveBy(-frame().location());
    190191
    191192    // Ignore events outside the bounds.
  • trunk/Source/WebCore/page/PageOverlay.h

    r191922 r194117  
    7979
    8080    void setPage(Page*);
     81    Page* page() const { return m_page; }
    8182    WEBCORE_EXPORT void setNeedsDisplay(const IntRect& dirtyRect);
    8283    WEBCORE_EXPORT void setNeedsDisplay();
  • trunk/Source/WebCore/testing/Internals.cpp

    r194000 r194117  
    8383#include "MemoryCache.h"
    8484#include "MemoryInfo.h"
     85#include "MockPageOverlay.h"
    8586#include "MockPageOverlayClient.h"
    8687#include "Page.h"
     
    29912992#endif
    29922993
    2993 
    2994 void Internals::installMockPageOverlay(const String& overlayType, ExceptionCode& ec)
     2994RefPtr<MockPageOverlay> Internals::installMockPageOverlay(const String& overlayType, ExceptionCode& ec)
    29952995{
    29962996    Document* document = contextDocument();
    29972997    if (!document || !document->frame()) {
    29982998        ec = INVALID_ACCESS_ERR;
    2999         return;
    3000     }
    3001 
    3002     MockPageOverlayClient::singleton().installOverlay(document->frame()->mainFrame(), overlayType == "view" ? PageOverlay::OverlayType::View : PageOverlay::OverlayType::Document);
     2999        return nullptr;
     3000    }
     3001
     3002    return MockPageOverlayClient::singleton().installOverlay(document->frame()->mainFrame(), overlayType == "view" ? PageOverlay::OverlayType::View : PageOverlay::OverlayType::Document);
    30033003}
    30043004
  • trunk/Source/WebCore/testing/Internals.h

    r194000 r194117  
    5959class MediaSession;
    6060class MemoryInfo;
     61class MockPageOverlay;
    6162class Node;
    6263class Page;
     
    418419    void simulateSystemWake() const;
    419420
    420     void installMockPageOverlay(const String& overlayType, ExceptionCode&);
     421    RefPtr<MockPageOverlay> installMockPageOverlay(const String& overlayType, ExceptionCode&);
    421422    String pageOverlayLayerTreeAsText(ExceptionCode&) const;
    422423
  • trunk/Source/WebCore/testing/Internals.idl

    r194000 r194117  
    386386    [Conditional=VIDEO] boolean elementIsBlockingDisplaySleep(Element element);
    387387
    388     [RaisesException] void installMockPageOverlay(PageOverlayType type);
     388    [RaisesException] MockPageOverlay installMockPageOverlay(PageOverlayType type);
    389389    [RaisesException] DOMString pageOverlayLayerTreeAsText();
    390390
  • trunk/Source/WebCore/testing/MockPageOverlayClient.cpp

    r192140 r194117  
    2727#include "MockPageOverlayClient.h"
    2828
     29#include "Document.h"
    2930#include "GraphicsContext.h"
    3031#include "GraphicsLayer.h"
    3132#include "MainFrame.h"
    3233#include "PageOverlayController.h"
     34#include "PlatformMouseEvent.h"
    3335#include <wtf/NeverDestroyed.h>
     36#include <wtf/text/StringBuilder.h>
    3437
    3538namespace WebCore {
     
    4548}
    4649
    47 void MockPageOverlayClient::installOverlay(MainFrame& mainFrame, PageOverlay::OverlayType overlayType)
     50Ref<MockPageOverlay> MockPageOverlayClient::installOverlay(MainFrame& mainFrame, PageOverlay::OverlayType overlayType)
    4851{
    49     RefPtr<PageOverlay> overlay = PageOverlay::create(*this, overlayType);
    50     mainFrame.pageOverlayController().installPageOverlay(overlay, PageOverlay::FadeMode::DoNotFade);
    51     m_overlays.add(overlay.get());
     52    auto overlay = PageOverlay::create(*this, overlayType);
     53    mainFrame.pageOverlayController().installPageOverlay(overlay.ptr(), PageOverlay::FadeMode::DoNotFade);
     54
     55    auto mockOverlay = MockPageOverlay::create(overlay.ptr());
     56    m_overlays.add(mockOverlay.ptr());
     57
     58    return mockOverlay;
    5259}
    5360
     
    5562{
    5663    while (!m_overlays.isEmpty()) {
    57         PageOverlay* overlay = m_overlays.takeAny();
    58         ASSERT(overlay->controller());
    59         overlay->controller()->uninstallPageOverlay(overlay, PageOverlay::FadeMode::DoNotFade);
     64        MockPageOverlay* mockOverlay = m_overlays.takeAny();
     65        PageOverlayController* overlayController = mockOverlay->overlay()->controller();
     66        ASSERT(overlayController);
     67        overlayController->uninstallPageOverlay(mockOverlay->overlay(), PageOverlay::FadeMode::DoNotFade);
    6068    }
    6169}
     
    6876void MockPageOverlayClient::pageOverlayDestroyed(PageOverlay& overlay)
    6977{
    70     m_overlays.remove(&overlay);
     78    for (auto& mockOverlay : m_overlays) {
     79        if (mockOverlay->overlay() == &overlay) {
     80            m_overlays.remove(mockOverlay);
     81            return;
     82        }
     83    }
    7184}
    7285
     
    8194}
    8295
    83 void MockPageOverlayClient::drawRect(PageOverlay& overlay, GraphicsContext& context, const IntRect&)
     96void MockPageOverlayClient::drawRect(PageOverlay& overlay, GraphicsContext& context, const IntRect& dirtyRect)
    8497{
     98    StringBuilder message;
     99    message.appendLiteral("MockPageOverlayClient::drawRect dirtyRect (");
     100    message.appendNumber(dirtyRect.x());
     101    message.appendLiteral(", ");
     102    message.appendNumber(dirtyRect.y());
     103    message.appendLiteral(", ");
     104    message.appendNumber(dirtyRect.width());
     105    message.appendLiteral(", ");
     106    message.appendNumber(dirtyRect.height());
     107    message.appendLiteral(")");
     108    overlay.page()->mainFrame().document()->addConsoleMessage(MessageSource::Other, MessageLevel::Debug, message.toString());
     109
    85110    GraphicsContextStateSaver stateSaver(context);
    86111
     
    98123}
    99124
    100 bool MockPageOverlayClient::mouseEvent(PageOverlay&, const PlatformMouseEvent&)
     125bool MockPageOverlayClient::mouseEvent(PageOverlay& overlay, const PlatformMouseEvent& event)
    101126{
     127    StringBuilder message;
     128    message.appendLiteral("MockPageOverlayClient::mouseEvent location (");
     129    message.appendNumber(event.position().x());
     130    message.appendLiteral(", ");
     131    message.appendNumber(event.position().y());
     132    message.appendLiteral(")");
     133    overlay.page()->mainFrame().document()->addConsoleMessage(MessageSource::Other, MessageLevel::Debug, message.toString());
     134
    102135    return false;
    103136}
  • trunk/Source/WebCore/testing/MockPageOverlayClient.h

    r179409 r194117  
    2727#define MockPageOverlayClient_h
    2828
     29#include "MockPageOverlay.h"
    2930#include "PageOverlay.h"
    3031#include <wtf/HashSet.h>
     
    4142    explicit MockPageOverlayClient();
    4243
    43     void installOverlay(MainFrame&, PageOverlay::OverlayType);
     44    Ref<MockPageOverlay> installOverlay(MainFrame&, PageOverlay::OverlayType);
    4445    void uninstallAllOverlays();
    4546
     
    6061    virtual Vector<String> copyAccessibilityAttributeNames(PageOverlay&, bool /* parameterizedNames */) override;
    6162
    62     HashSet<PageOverlay*> m_overlays;
     63    HashSet<MockPageOverlay*> m_overlays;
    6364};
    6465
Note: See TracChangeset for help on using the changeset viewer.