haikuwebkit/Source/WebCore/testing/MockPageOverlayClient.cpp

136 lines
5.1 KiB
C++
Raw Permalink Normal View History

Make it possible to test page overlays https://bugs.webkit.org/show_bug.cgi?id=137339 Reviewed by Dan Bernstein. Tests: pageoverlay/overlay-installation.html pageoverlay/overlay-large-document-scrolled.html pageoverlay/overlay-large-document.html Do some initial work to make page overlays testable. There are many more tests to be written, but this lays the groundwork. * WebCore.exp.in: * WebCore.xcodeproj/project.pbxproj: * WebCore.vcxproj/WebCoreTestSupport.vcxproj: * WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters: * CMakeLists.txt: Add MockPageOverlayClient. * platform/graphics/GraphicsLayer.h: * page/PageOverlayController.h: * page/PageOverlayController.cpp: (WebCore::PageOverlayController::shouldSkipLayerInDump): Don't skip PageOverlayController-owned layers in the layer tree dump if the layerTreeAsText behavior says that we should include them. * platform/graphics/GraphicsLayer.cpp: (WebCore::dumpChildren): * platform/graphics/GraphicsLayerClient.h: (WebCore::GraphicsLayerClient::shouldSkipLayerInDump): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::shouldSkipLayerInDump): * rendering/RenderLayerBacking.h: Pass the LayerTreeAsTextBehavior through shouldSkipLayerInDump. * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): Uninstall all page overlays when resetting to a consistent state. (WebCore::Internals::installMockPageOverlay): (WebCore::Internals::pageOverlayLayerTreeAsText): Expose two new internals functions. installMockPageOverlay takes "view" or "document", allowing script to choose the appropriate overlay type. pageOverlayLayerTreeAsText dumps both view and document-relative overlays, from each overlay container layer. * testing/Internals.h: * testing/Internals.idl: Fix some typos. * testing/MockPageOverlayClient.cpp: Added. (WebCore::MockPageOverlayClient::shared): (WebCore::MockPageOverlayClient::MockPageOverlayClient): (WebCore::MockPageOverlayClient::installOverlay): (WebCore::MockPageOverlayClient::uninstallAllOverlays): (WebCore::MockPageOverlayClient::layerTreeAsText): (WebCore::MockPageOverlayClient::pageOverlayDestroyed): (WebCore::MockPageOverlayClient::willMoveToPage): (WebCore::MockPageOverlayClient::didMoveToPage): When the overlay is parented, mark it as needing repaint. Future tests might want to test overlays without content, but for now this is a reasonable default behavior. (WebCore::MockPageOverlayClient::drawRect): Paint the overlay rects as described in the LayoutTests ChangeLog. (WebCore::MockPageOverlayClient::mouseEvent): (WebCore::MockPageOverlayClient::didScrollFrame): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeStringValueForPoint): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeBoolValueForPoint): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeNames): * testing/MockPageOverlayClient.h: Added. * pageoverlay/overlay-installation.html: Added. Add a test which just installs one view-relative and one document-relative overlay, and dumps the layer tree and pixel results. The mock overlay strokes a blue rectangle (inset a little from the overlay bounds) for view-relative overlays, and a green rectangle (inset a bit more) for document-relative overlays. * pageoverlay/overlay-large-document.html: Added. * pageoverlay/overlay-large-document-scrolled.html: Added. Tests that do the same as the -installation test, but with a larger document; the view-relative overlay should be the same size (or slightly smaller, because we have scrollbars now), but the document-relative overlay should be the size of the document. The second test scrolls to maxX, maxY, and the document-relative overlay should scroll along with it, while the view-relative overlay should remain fixed. * pageoverlay/overlay-installation-expected.txt: Added. * pageoverlay/overlay-large-document-expected.txt: Added. * pageoverlay/overlay-large-document-scrolled-expected.txt: Added. "Normal" layer tree expectations. * platform/mac-wk1/pageoverlay/overlay-installation-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-installation-expected.txt: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-expected.txt: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-scrolled-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-scrolled-expected.txt: Added. Expected results for WebKit1 differ for view-relative overlays, because we don't currently hook up view-relative overlays for WebKit1. * platform/mac/pageoverlay/overlay-installation-expected.png: Added. * platform/mac/pageoverlay/overlay-large-document-expected.png: Added. * platform/mac/pageoverlay/overlay-large-document-scrolled-expected.png: Added. "Normal" pixel dump expectations. Canonical link: https://commits.webkit.org/155229@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-04 08:47:04 +00:00
/*
* Copyright (C) 2014 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 INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "MockPageOverlayClient.h"
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. Canonical link: https://commits.webkit.org/170422@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194117 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-12-15 22:46:02 +00:00
#include "Document.h"
Drop MainFrame class https://bugs.webkit.org/show_bug.cgi?id=184191 Reviewed by Darin Adler. Source/WebCore: Drop MainFrame class and move contents into Page / Frame since there is a 1:1 relationship between the Page and the MainFrame. This is ground work for introducing LocalFrame / RemoteFrame concepts. * Modules/applepay/ApplePaySession.cpp: (WebCore::ApplePaySession::create): (WebCore::ApplePaySession::supportsVersion): (WebCore::ApplePaySession::canMakePayments): (WebCore::ApplePaySession::canMakePaymentsWithActiveCard): (WebCore::ApplePaySession::openPaymentSetup): (WebCore::ApplePaySession::paymentCoordinator const): * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp: (WebCore::paymentCoordinator): * Modules/mediastream/MediaDevicesEnumerationRequest.cpp: * Modules/mediastream/UserMediaRequest.cpp: * Modules/plugins/QuickTimePluginReplacement.mm: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::mainFrame const): (WebCore::AccessibilityObject::visiblePositionForBounds const): * accessibility/AccessibilityObject.h: * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: * bindings/js/ScriptController.cpp: * bindings/js/ScriptState.cpp: * contentextensions/ContentExtensionsBackend.cpp: * css/MediaQueryEvaluator.cpp: (WebCore::displayModeEvaluate): * dom/DOMImplementation.cpp: * dom/Document.cpp: * dom/DocumentMarkerController.cpp: * dom/Element.cpp: (WebCore::Element::removedFromAncestor): * dom/EventDispatcher.cpp: * dom/ScriptedAnimationController.cpp: * editing/Editor.cpp: (WebCore::Editor::scanSelectionForTelephoneNumbers): * editing/EditorCommand.cpp: * editing/SelectionRectGatherer.cpp: (WebCore::SelectionRectGatherer::Notifier::~Notifier): * editing/cocoa/WebContentReaderCocoa.mm: * editing/markup.cpp: * history/CachedFrame.cpp: * history/CachedPage.cpp: * history/PageCache.cpp: (WebCore::destroyRenderTree): * html/HTMLMediaElement.cpp: * html/HTMLPlugInImageElement.cpp: * html/ImageDocument.cpp: * html/MediaElementSession.cpp: (WebCore::isMainContentForPurposesOfAutoplay): * html/canvas/WebGLRenderingContextBase.cpp: * inspector/InspectorClient.cpp: * inspector/InspectorController.cpp: * inspector/InspectorFrontendClientLocal.cpp: * inspector/InspectorFrontendHost.cpp: * inspector/InspectorInstrumentation.cpp: * inspector/InspectorOverlay.cpp: * inspector/PageScriptDebugServer.cpp: * inspector/agents/InspectorApplicationCacheAgent.cpp: * inspector/agents/InspectorCanvasAgent.cpp: * inspector/agents/InspectorDOMAgent.cpp: * inspector/agents/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::mainFrame): * inspector/agents/InspectorPageAgent.h: * inspector/agents/page/PageDebuggerAgent.cpp: * inspector/agents/page/PageRuntimeAgent.cpp: * loader/DocumentLoader.cpp: * loader/DocumentWriter.cpp: * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadWithDocumentLoader): (WebCore::FrameLoader::setState): * loader/HistoryController.cpp: * loader/NavigationDisabler.h: * loader/ProgressTracker.cpp: * loader/ResourceLoadObserver.cpp: * loader/ResourceLoader.cpp: * loader/SubframeLoader.cpp: * loader/SubresourceLoader.cpp: * loader/appcache/ApplicationCacheHost.cpp: * loader/archive/mhtml/MHTMLArchive.cpp: * loader/cache/CachedResource.cpp: * loader/cache/CachedResourceLoader.cpp: * page/AutoscrollController.cpp: * page/Chrome.cpp: * page/ContextMenuController.cpp: * page/DOMWindow.cpp: * page/DebugPageOverlays.cpp: (WebCore::MouseWheelRegionOverlay::updateRegion): (WebCore::NonFastScrollableRegionOverlay::updateRegion): (WebCore::RegionOverlay::create): (WebCore::RegionOverlay::RegionOverlay): (WebCore::RegionOverlay::~RegionOverlay): (WebCore::DebugPageOverlays::ensureRegionOverlayForPage): (WebCore::DebugPageOverlays::showRegionOverlay): (WebCore::DebugPageOverlays::hideRegionOverlay): (WebCore::DebugPageOverlays::regionChanged): (WebCore::DebugPageOverlays::regionOverlayForPage const): (WebCore::DebugPageOverlays::updateOverlayRegionVisibility): (WebCore::DebugPageOverlays::settingsChanged): * page/DebugPageOverlays.h: (WebCore::DebugPageOverlays::hasOverlaysForPage const): (WebCore::DebugPageOverlays::hasOverlays): (WebCore::DebugPageOverlays::didLayout): (WebCore::DebugPageOverlays::didChangeEventHandlers): * page/DragController.cpp: (WebCore::DragController::performDragOperation): (WebCore::DragController::tryDHTMLDrag): (WebCore::DragController::beginDrag): (WebCore::DragController::doSystemDrag): * page/EventHandler.cpp: (WebCore::EventHandler::handleMousePressEvent): (WebCore::EventHandler::mouseMoved): (WebCore::EventHandler::handleMouseReleaseEvent): (WebCore::EventHandler::handleWheelEvent): (WebCore::EventHandler::clearLatchedState): (WebCore::EventHandler::defaultWheelEventHandler): * page/FocusController.cpp: * page/Frame.cpp: (WebCore::Frame::Frame): (WebCore::Frame::dropChildren): (WebCore::Frame::selfOnlyRef): (WebCore::Frame::selfOnlyDeref): * page/Frame.h: (WebCore::Frame::mainFrame const): * page/FrameTree.cpp: * page/FrameView.cpp: (WebCore::FrameView::setFrameRect): (WebCore::FrameView::setContentsSize): (WebCore::FrameView::didChangeScrollOffset): (WebCore::FrameView::setViewExposedRect): * page/History.cpp: * page/MainFrame.cpp: Removed. * page/MainFrame.h: Removed. * page/MemoryRelease.cpp: * page/Page.cpp: (WebCore::Page::Page): (WebCore::m_applicationManifest): (WebCore::Page::setDeviceScaleFactor): (WebCore::Page::latchingState): (WebCore::Page::pushNewLatchingState): (WebCore::Page::resetLatchingState): (WebCore::Page::popLatchingState): (WebCore::Page::removeLatchingStateForTarget): (WebCore::Page::setPaymentCoordinator): * page/Page.h: (WebCore::Page::mainFrame): (WebCore::Page::mainFrame const): (WebCore::Page::wheelEventDeltaFilter): (WebCore::Page::pageOverlayController): (WebCore::Page::servicesOverlayController): (WebCore::Page::paymentCoordinator const): (WebCore::Page::applicationManifest const): (WebCore::Page::performanceLogging const): * page/PageConsoleClient.cpp: * page/PageDebuggable.cpp: * page/PageGroup.cpp: * page/PageGroupLoadDeferrer.cpp: * page/PageOverlay.cpp: (WebCore::PageOverlay::controller const): * page/PageOverlayController.cpp: (WebCore::PageOverlayController::PageOverlayController): (WebCore::PageOverlayController::createRootLayersIfNeeded): (WebCore::PageOverlayController::layerWithDocumentOverlays): (WebCore::PageOverlayController::layerWithViewOverlays): (WebCore::PageOverlayController::installPageOverlay): (WebCore::PageOverlayController::updateForceSynchronousScrollLayerPositionUpdates): (WebCore::PageOverlayController::didChangeViewExposedRect): (WebCore::PageOverlayController::updateSettingsForLayer): (WebCore::PageOverlayController::deviceScaleFactor const): (WebCore::PageOverlayController::notifyFlushRequired): (WebCore::PageOverlayController::tiledBackingUsageChanged): * page/PageOverlayController.h: * page/PageSerializer.cpp: * page/PerformanceLogging.cpp: (WebCore::PerformanceLogging::PerformanceLogging): (WebCore::PerformanceLogging::didReachPointOfInterest): * page/PerformanceLogging.h: * page/PerformanceMonitor.cpp: * page/ResourceUsageOverlay.cpp: (WebCore::ResourceUsageOverlay::~ResourceUsageOverlay): (WebCore::ResourceUsageOverlay::initialize): * page/SettingsBase.cpp: * page/SpatialNavigation.cpp: * page/UserContentProvider.cpp: * page/ios/FrameIOS.mm: * page/mac/DragControllerMac.mm: * page/mac/EventHandlerMac.mm: (WebCore::latchingIsLockedToPlatformFrame): (WebCore::latchingIsLockedToAncestorOfThisFrame): (WebCore::EventHandler::clearOrScheduleClearingLatchedStateIfNeeded): (WebCore::EventHandler::platformPrepareForWheelEvents): (WebCore::EventHandler::platformRecordWheelEvent): (WebCore::EventHandler::platformCompleteWheelEvent): (WebCore::EventHandler::platformCompletePlatformWidgetWheelEvent): * page/mac/PageMac.mm: * page/mac/ServicesOverlayController.h: (WebCore::ServicesOverlayController::page const): * page/mac/ServicesOverlayController.mm: (WebCore::ServicesOverlayController::Highlight::Highlight): (WebCore::ServicesOverlayController::Highlight::notifyFlushRequired): (WebCore::ServicesOverlayController::Highlight::deviceScaleFactor const): (WebCore::ServicesOverlayController::ServicesOverlayController): (WebCore::ServicesOverlayController::invalidateHighlightsOfType): (WebCore::ServicesOverlayController::buildPotentialHighlightsIfNeeded): (WebCore::ServicesOverlayController::remainingTimeUntilHighlightShouldBeShown const): (WebCore::ServicesOverlayController::buildPhoneNumberHighlights): (WebCore::ServicesOverlayController::buildSelectionHighlight): (WebCore::ServicesOverlayController::hasRelevantSelectionServices): (WebCore::ServicesOverlayController::createOverlayIfNeeded): (WebCore::ServicesOverlayController::telephoneNumberRangesForFocusedFrame): (WebCore::ServicesOverlayController::findTelephoneNumberHighlightContainingSelectionHighlight): (WebCore::ServicesOverlayController::mouseEvent): (WebCore::ServicesOverlayController::handleClick): (WebCore::ServicesOverlayController::mainFrame const): * page/scrolling/AsyncScrollingCoordinator.cpp: * page/scrolling/ScrollingCoordinator.cpp: * page/scrolling/ios/ScrollingCoordinatorIOS.mm: * page/scrolling/mac/ScrollingCoordinatorMac.mm: * platform/graphics/ca/win/CACFLayerTreeHost.cpp: * plugins/DOMMimeType.cpp: * plugins/PluginInfoProvider.cpp: (WebCore::PluginInfoProvider::refresh): * rendering/RenderBox.cpp: * rendering/RenderLayer.cpp: * rendering/RenderLayerBacking.cpp: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers const): (WebCore::RenderLayerCompositor::updateCompositingLayers): (WebCore::RenderLayerCompositor::appendDocumentOverlayLayers): (WebCore::RenderLayerCompositor::attachRootLayer): (WebCore::RenderLayerCompositor::detachRootLayer): (WebCore::RenderLayerCompositor::rootLayerAttachmentChanged): * rendering/RenderObject.cpp: * replay/UserInputBridge.cpp: * storage/StorageEventDispatcher.cpp: * style/StyleTreeResolver.cpp: (WebCore::Style::suspendMemoryCacheClientCalls): * svg/SVGSVGElement.cpp: * svg/graphics/SVGImage.cpp: * testing/InternalSettings.cpp: * testing/Internals.cpp: (WebCore::Internals::Internals): (WebCore::Internals::installMockPageOverlay): (WebCore::Internals::pageOverlayLayerTreeAsText const): * testing/MockPageOverlay.cpp: * testing/MockPageOverlay.h: * testing/MockPageOverlayClient.cpp: (WebCore::MockPageOverlayClient::installOverlay): (WebCore::MockPageOverlayClient::layerTreeAsText): * testing/MockPageOverlayClient.h: * testing/MockPaymentCoordinator.cpp: (WebCore::MockPaymentCoordinator::MockPaymentCoordinator): (WebCore::MockPaymentCoordinator::showPaymentUI): (WebCore::MockPaymentCoordinator::completeMerchantValidation): (WebCore::MockPaymentCoordinator::changeShippingOption): (WebCore::MockPaymentCoordinator::changePaymentMethod): (WebCore::MockPaymentCoordinator::acceptPayment): (WebCore::MockPaymentCoordinator::cancelPayment): * testing/MockPaymentCoordinator.h: * workers/service/context/ServiceWorkerThreadProxy.cpp: Source/WebKit: Drop MainFrame class and move contents into Page / Frame since there is a 1:1 relationship between the Page and the MainFrame. This is ground work for introducing LocalFrame / RemoteFrame concepts. * Shared/WebRenderLayer.cpp: * Shared/WebRenderObject.cpp: * WebProcess/ApplePay/WebPaymentCoordinator.cpp: (WebKit::WebPaymentCoordinator::paymentCoordinator): * WebProcess/Automation/WebAutomationSessionProxy.cpp: * WebProcess/FullScreen/WebFullScreenManager.cpp: * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKBundlePageInstallPageOverlay): (WKBundlePageUninstallPageOverlay): (WKBundlePageInstallPageOverlayWithAnimation): (WKBundlePageUninstallPageOverlayWithAnimation): * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp: * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: * WebProcess/InjectedBundle/InjectedBundle.cpp: * WebProcess/Plugins/PDF/PDFPlugin.mm: * WebProcess/Plugins/PluginView.cpp: * WebProcess/Plugins/WebPluginInfoProvider.cpp: * WebProcess/WebCoreSupport/WebChromeClient.cpp: * WebProcess/WebCoreSupport/WebContextMenuClient.cpp: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: * WebProcess/WebCoreSupport/WebInspectorClient.cpp: (WebKit::WebInspectorClient::~WebInspectorClient): (WebKit::WebInspectorClient::highlight): (WebKit::WebInspectorClient::hideHighlight): (WebKit::WebInspectorClient::showPaintRect): * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: * WebProcess/WebCoreSupport/WebProgressTrackerClient.cpp: * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm: * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: * WebProcess/WebPage/AcceleratedDrawingArea.cpp: * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp: * WebProcess/WebPage/FindController.cpp: (WebKit::FindController::updateFindUIAfterPageScroll): (WebKit::FindController::hideFindUI): * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm: * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::updatePreferences): * WebProcess/WebPage/WKAccessibilityWebPageObjectIOS.mm: * WebProcess/WebPage/WebBackForwardListProxy.cpp: * WebProcess/WebPage/WebFrame.cpp: * WebProcess/WebPage/WebInspector.cpp: * WebProcess/WebPage/WebInspectorFrontendAPIDispatcher.cpp: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::mainFrame const): (WebKit::WebPage::determinePrimarySnapshottedPlugIn): (WebKit::WebPage::plugInIntersectsSearchRect): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/atk/WebPageAccessibilityObjectAtk.cpp: * WebProcess/WebPage/ios/FindControllerIOS.mm: * WebProcess/WebPage/ios/WebPageIOS.mm: * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::updatePreferences): * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm: * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm: (-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]): (-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performImmediateActionHitTestAtLocation): (WebKit::WebPage::dataDetectorsDidPresentUI): (WebKit::WebPage::dataDetectorsDidChangeUI): (WebKit::WebPage::dataDetectorsDidHideUI): * WebProcess/WebProcess.cpp: * WebProcess/WebStorage/StorageAreaMap.cpp: Source/WebKitLegacy/mac: Drop MainFrame class and move contents into Page / Frame since there is a 1:1 relationship between the Page and the MainFrame. This is ground work for introducing LocalFrame / RemoteFrame concepts. * WebCoreSupport/WebDragClient.mm: * WebCoreSupport/WebFrameLoaderClient.mm: * WebCoreSupport/WebInspectorClient.mm: * WebCoreSupport/WebPlatformStrategies.mm: * WebCoreSupport/WebPluginInfoProvider.mm: * WebView/WebFrame.mm: * WebView/WebFrameView.mm: * WebView/WebHTMLView.mm: * WebView/WebView.mm: Source/WebKitLegacy/win: Drop MainFrame class and move contents into Page / Frame since there is a 1:1 relationship between the Page and the MainFrame. This is ground work for introducing LocalFrame / RemoteFrame concepts. * WebCoreSupport/AcceleratedCompositingContext.cpp: * WebCoreSupport/WebContextMenuClient.cpp: * WebCoreSupport/WebDragClient.cpp: * WebDropSource.cpp: * WebFrame.cpp: * WebView.cpp: Tools: * TestWebKitAPI/Tests/WebCore/cocoa/WebCoreNSURLSession.mm: Canonical link: https://commits.webkit.org/199818@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230211 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-03 18:01:41 +00:00
#include "Frame.h"
Make it possible to test page overlays https://bugs.webkit.org/show_bug.cgi?id=137339 Reviewed by Dan Bernstein. Tests: pageoverlay/overlay-installation.html pageoverlay/overlay-large-document-scrolled.html pageoverlay/overlay-large-document.html Do some initial work to make page overlays testable. There are many more tests to be written, but this lays the groundwork. * WebCore.exp.in: * WebCore.xcodeproj/project.pbxproj: * WebCore.vcxproj/WebCoreTestSupport.vcxproj: * WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters: * CMakeLists.txt: Add MockPageOverlayClient. * platform/graphics/GraphicsLayer.h: * page/PageOverlayController.h: * page/PageOverlayController.cpp: (WebCore::PageOverlayController::shouldSkipLayerInDump): Don't skip PageOverlayController-owned layers in the layer tree dump if the layerTreeAsText behavior says that we should include them. * platform/graphics/GraphicsLayer.cpp: (WebCore::dumpChildren): * platform/graphics/GraphicsLayerClient.h: (WebCore::GraphicsLayerClient::shouldSkipLayerInDump): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::shouldSkipLayerInDump): * rendering/RenderLayerBacking.h: Pass the LayerTreeAsTextBehavior through shouldSkipLayerInDump. * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): Uninstall all page overlays when resetting to a consistent state. (WebCore::Internals::installMockPageOverlay): (WebCore::Internals::pageOverlayLayerTreeAsText): Expose two new internals functions. installMockPageOverlay takes "view" or "document", allowing script to choose the appropriate overlay type. pageOverlayLayerTreeAsText dumps both view and document-relative overlays, from each overlay container layer. * testing/Internals.h: * testing/Internals.idl: Fix some typos. * testing/MockPageOverlayClient.cpp: Added. (WebCore::MockPageOverlayClient::shared): (WebCore::MockPageOverlayClient::MockPageOverlayClient): (WebCore::MockPageOverlayClient::installOverlay): (WebCore::MockPageOverlayClient::uninstallAllOverlays): (WebCore::MockPageOverlayClient::layerTreeAsText): (WebCore::MockPageOverlayClient::pageOverlayDestroyed): (WebCore::MockPageOverlayClient::willMoveToPage): (WebCore::MockPageOverlayClient::didMoveToPage): When the overlay is parented, mark it as needing repaint. Future tests might want to test overlays without content, but for now this is a reasonable default behavior. (WebCore::MockPageOverlayClient::drawRect): Paint the overlay rects as described in the LayoutTests ChangeLog. (WebCore::MockPageOverlayClient::mouseEvent): (WebCore::MockPageOverlayClient::didScrollFrame): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeStringValueForPoint): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeBoolValueForPoint): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeNames): * testing/MockPageOverlayClient.h: Added. * pageoverlay/overlay-installation.html: Added. Add a test which just installs one view-relative and one document-relative overlay, and dumps the layer tree and pixel results. The mock overlay strokes a blue rectangle (inset a little from the overlay bounds) for view-relative overlays, and a green rectangle (inset a bit more) for document-relative overlays. * pageoverlay/overlay-large-document.html: Added. * pageoverlay/overlay-large-document-scrolled.html: Added. Tests that do the same as the -installation test, but with a larger document; the view-relative overlay should be the same size (or slightly smaller, because we have scrollbars now), but the document-relative overlay should be the size of the document. The second test scrolls to maxX, maxY, and the document-relative overlay should scroll along with it, while the view-relative overlay should remain fixed. * pageoverlay/overlay-installation-expected.txt: Added. * pageoverlay/overlay-large-document-expected.txt: Added. * pageoverlay/overlay-large-document-scrolled-expected.txt: Added. "Normal" layer tree expectations. * platform/mac-wk1/pageoverlay/overlay-installation-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-installation-expected.txt: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-expected.txt: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-scrolled-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-scrolled-expected.txt: Added. Expected results for WebKit1 differ for view-relative overlays, because we don't currently hook up view-relative overlays for WebKit1. * platform/mac/pageoverlay/overlay-installation-expected.png: Added. * platform/mac/pageoverlay/overlay-large-document-expected.png: Added. * platform/mac/pageoverlay/overlay-large-document-scrolled-expected.png: Added. "Normal" pixel dump expectations. Canonical link: https://commits.webkit.org/155229@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-04 08:47:04 +00:00
#include "GraphicsContext.h"
#include "GraphicsLayer.h"
Add WebSocketProvider stub https://bugs.webkit.org/show_bug.cgi?id=158702 Reviewed by Brady Eidson. Source/WebCore: No new tests. No change in behavior. * WebCore.xcodeproj/project.pbxproj: * dom/DocumentMarkerController.cpp: * dom/ScriptedAnimationController.cpp: * html/HTMLMediaElement.cpp: * html/MediaDocument.cpp: * html/shadow/MediaControlElements.cpp: * html/shadow/MediaControls.cpp: * html/shadow/MediaControls.h: * html/shadow/MediaControlsApple.cpp: * inspector/InspectorInstrumentation.cpp: * inspector/InspectorInstrumentation.h: * inspector/InspectorOverlay.cpp: (WebCore::InspectorOverlay::overlayPage): * loader/EmptyClients.h: * loader/FrameLoader.cpp: * loader/FrameLoader.h: * loader/appcache/ApplicationCacheHost.cpp: * loader/cache/CachedResource.cpp: * page/FrameView.cpp: * page/Page.cpp: (WebCore::Page::Page): * page/Page.h: (WebCore::Page::applicationCacheStorage): (WebCore::Page::databaseProvider): (WebCore::Page::socketProvider): (WebCore::Page::storageNamespaceProvider): * page/PageConfiguration.cpp: (WebCore::PageConfiguration::PageConfiguration): * page/PageConfiguration.h: * page/ResourceUsageOverlay.cpp: * page/SocketProvider.h: Added. (WebCore::SocketProvider::~SocketProvider): * page/cocoa/ResourceUsageOverlayCocoa.mm: * rendering/RenderElement.cpp: * rendering/RenderLayerBacking.cpp: * style/StyleResolveForDocument.cpp: * style/StyleTreeResolver.cpp: * svg/graphics/SVGImage.cpp: (WebCore::SVGImage::dataChanged): * testing/MockPageOverlayClient.cpp: Source/WebKit: * WebKit.xcodeproj/project.pbxproj: Source/WebKit/mac: * Misc/WebSocketProvider.h: Added. * WebView/WebView.mm: (-[WebView _commonInitializationWithFrameName:groupName:]): (-[WebView initSimpleHTMLDocumentWithStyle:frame:preferences:groupName:]): Source/WebKit/win: * WebSocketProvider.h: Added. * WebView.cpp: (WebView::initWithFrame): Source/WebKit2: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/Network/WebSocketProvider.h: Added. * WebProcess/WebPage/WebPage.cpp: (WebKit::m_shouldDispatchFakeMouseMoveEvents): Source/WTF: * wtf/UniqueRef.h: (WTF::UniqueRef::operator->): (WTF::UniqueRef::operator T&): (WTF::UniqueRef::operator const T&): Added operator T& to avoid unneeded .get() calls. Canonical link: https://commits.webkit.org/176784@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202005 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-06-13 21:58:53 +00:00
#include "Page.h"
Make it possible to test page overlays https://bugs.webkit.org/show_bug.cgi?id=137339 Reviewed by Dan Bernstein. Tests: pageoverlay/overlay-installation.html pageoverlay/overlay-large-document-scrolled.html pageoverlay/overlay-large-document.html Do some initial work to make page overlays testable. There are many more tests to be written, but this lays the groundwork. * WebCore.exp.in: * WebCore.xcodeproj/project.pbxproj: * WebCore.vcxproj/WebCoreTestSupport.vcxproj: * WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters: * CMakeLists.txt: Add MockPageOverlayClient. * platform/graphics/GraphicsLayer.h: * page/PageOverlayController.h: * page/PageOverlayController.cpp: (WebCore::PageOverlayController::shouldSkipLayerInDump): Don't skip PageOverlayController-owned layers in the layer tree dump if the layerTreeAsText behavior says that we should include them. * platform/graphics/GraphicsLayer.cpp: (WebCore::dumpChildren): * platform/graphics/GraphicsLayerClient.h: (WebCore::GraphicsLayerClient::shouldSkipLayerInDump): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::shouldSkipLayerInDump): * rendering/RenderLayerBacking.h: Pass the LayerTreeAsTextBehavior through shouldSkipLayerInDump. * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): Uninstall all page overlays when resetting to a consistent state. (WebCore::Internals::installMockPageOverlay): (WebCore::Internals::pageOverlayLayerTreeAsText): Expose two new internals functions. installMockPageOverlay takes "view" or "document", allowing script to choose the appropriate overlay type. pageOverlayLayerTreeAsText dumps both view and document-relative overlays, from each overlay container layer. * testing/Internals.h: * testing/Internals.idl: Fix some typos. * testing/MockPageOverlayClient.cpp: Added. (WebCore::MockPageOverlayClient::shared): (WebCore::MockPageOverlayClient::MockPageOverlayClient): (WebCore::MockPageOverlayClient::installOverlay): (WebCore::MockPageOverlayClient::uninstallAllOverlays): (WebCore::MockPageOverlayClient::layerTreeAsText): (WebCore::MockPageOverlayClient::pageOverlayDestroyed): (WebCore::MockPageOverlayClient::willMoveToPage): (WebCore::MockPageOverlayClient::didMoveToPage): When the overlay is parented, mark it as needing repaint. Future tests might want to test overlays without content, but for now this is a reasonable default behavior. (WebCore::MockPageOverlayClient::drawRect): Paint the overlay rects as described in the LayoutTests ChangeLog. (WebCore::MockPageOverlayClient::mouseEvent): (WebCore::MockPageOverlayClient::didScrollFrame): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeStringValueForPoint): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeBoolValueForPoint): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeNames): * testing/MockPageOverlayClient.h: Added. * pageoverlay/overlay-installation.html: Added. Add a test which just installs one view-relative and one document-relative overlay, and dumps the layer tree and pixel results. The mock overlay strokes a blue rectangle (inset a little from the overlay bounds) for view-relative overlays, and a green rectangle (inset a bit more) for document-relative overlays. * pageoverlay/overlay-large-document.html: Added. * pageoverlay/overlay-large-document-scrolled.html: Added. Tests that do the same as the -installation test, but with a larger document; the view-relative overlay should be the same size (or slightly smaller, because we have scrollbars now), but the document-relative overlay should be the size of the document. The second test scrolls to maxX, maxY, and the document-relative overlay should scroll along with it, while the view-relative overlay should remain fixed. * pageoverlay/overlay-installation-expected.txt: Added. * pageoverlay/overlay-large-document-expected.txt: Added. * pageoverlay/overlay-large-document-scrolled-expected.txt: Added. "Normal" layer tree expectations. * platform/mac-wk1/pageoverlay/overlay-installation-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-installation-expected.txt: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-expected.txt: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-scrolled-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-scrolled-expected.txt: Added. Expected results for WebKit1 differ for view-relative overlays, because we don't currently hook up view-relative overlays for WebKit1. * platform/mac/pageoverlay/overlay-installation-expected.png: Added. * platform/mac/pageoverlay/overlay-large-document-expected.png: Added. * platform/mac/pageoverlay/overlay-large-document-scrolled-expected.png: Added. "Normal" pixel dump expectations. Canonical link: https://commits.webkit.org/155229@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-04 08:47:04 +00:00
#include "PageOverlayController.h"
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. Canonical link: https://commits.webkit.org/170422@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194117 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-12-15 22:46:02 +00:00
#include "PlatformMouseEvent.h"
Make it possible to test page overlays https://bugs.webkit.org/show_bug.cgi?id=137339 Reviewed by Dan Bernstein. Tests: pageoverlay/overlay-installation.html pageoverlay/overlay-large-document-scrolled.html pageoverlay/overlay-large-document.html Do some initial work to make page overlays testable. There are many more tests to be written, but this lays the groundwork. * WebCore.exp.in: * WebCore.xcodeproj/project.pbxproj: * WebCore.vcxproj/WebCoreTestSupport.vcxproj: * WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters: * CMakeLists.txt: Add MockPageOverlayClient. * platform/graphics/GraphicsLayer.h: * page/PageOverlayController.h: * page/PageOverlayController.cpp: (WebCore::PageOverlayController::shouldSkipLayerInDump): Don't skip PageOverlayController-owned layers in the layer tree dump if the layerTreeAsText behavior says that we should include them. * platform/graphics/GraphicsLayer.cpp: (WebCore::dumpChildren): * platform/graphics/GraphicsLayerClient.h: (WebCore::GraphicsLayerClient::shouldSkipLayerInDump): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::shouldSkipLayerInDump): * rendering/RenderLayerBacking.h: Pass the LayerTreeAsTextBehavior through shouldSkipLayerInDump. * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): Uninstall all page overlays when resetting to a consistent state. (WebCore::Internals::installMockPageOverlay): (WebCore::Internals::pageOverlayLayerTreeAsText): Expose two new internals functions. installMockPageOverlay takes "view" or "document", allowing script to choose the appropriate overlay type. pageOverlayLayerTreeAsText dumps both view and document-relative overlays, from each overlay container layer. * testing/Internals.h: * testing/Internals.idl: Fix some typos. * testing/MockPageOverlayClient.cpp: Added. (WebCore::MockPageOverlayClient::shared): (WebCore::MockPageOverlayClient::MockPageOverlayClient): (WebCore::MockPageOverlayClient::installOverlay): (WebCore::MockPageOverlayClient::uninstallAllOverlays): (WebCore::MockPageOverlayClient::layerTreeAsText): (WebCore::MockPageOverlayClient::pageOverlayDestroyed): (WebCore::MockPageOverlayClient::willMoveToPage): (WebCore::MockPageOverlayClient::didMoveToPage): When the overlay is parented, mark it as needing repaint. Future tests might want to test overlays without content, but for now this is a reasonable default behavior. (WebCore::MockPageOverlayClient::drawRect): Paint the overlay rects as described in the LayoutTests ChangeLog. (WebCore::MockPageOverlayClient::mouseEvent): (WebCore::MockPageOverlayClient::didScrollFrame): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeStringValueForPoint): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeBoolValueForPoint): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeNames): * testing/MockPageOverlayClient.h: Added. * pageoverlay/overlay-installation.html: Added. Add a test which just installs one view-relative and one document-relative overlay, and dumps the layer tree and pixel results. The mock overlay strokes a blue rectangle (inset a little from the overlay bounds) for view-relative overlays, and a green rectangle (inset a bit more) for document-relative overlays. * pageoverlay/overlay-large-document.html: Added. * pageoverlay/overlay-large-document-scrolled.html: Added. Tests that do the same as the -installation test, but with a larger document; the view-relative overlay should be the same size (or slightly smaller, because we have scrollbars now), but the document-relative overlay should be the size of the document. The second test scrolls to maxX, maxY, and the document-relative overlay should scroll along with it, while the view-relative overlay should remain fixed. * pageoverlay/overlay-installation-expected.txt: Added. * pageoverlay/overlay-large-document-expected.txt: Added. * pageoverlay/overlay-large-document-scrolled-expected.txt: Added. "Normal" layer tree expectations. * platform/mac-wk1/pageoverlay/overlay-installation-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-installation-expected.txt: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-expected.txt: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-scrolled-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-scrolled-expected.txt: Added. Expected results for WebKit1 differ for view-relative overlays, because we don't currently hook up view-relative overlays for WebKit1. * platform/mac/pageoverlay/overlay-installation-expected.png: Added. * platform/mac/pageoverlay/overlay-large-document-expected.png: Added. * platform/mac/pageoverlay/overlay-large-document-scrolled-expected.png: Added. "Normal" pixel dump expectations. Canonical link: https://commits.webkit.org/155229@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-04 08:47:04 +00:00
#include <wtf/NeverDestroyed.h>
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. Canonical link: https://commits.webkit.org/170422@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194117 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-12-15 22:46:02 +00:00
#include <wtf/text/StringBuilder.h>
Make it possible to test page overlays https://bugs.webkit.org/show_bug.cgi?id=137339 Reviewed by Dan Bernstein. Tests: pageoverlay/overlay-installation.html pageoverlay/overlay-large-document-scrolled.html pageoverlay/overlay-large-document.html Do some initial work to make page overlays testable. There are many more tests to be written, but this lays the groundwork. * WebCore.exp.in: * WebCore.xcodeproj/project.pbxproj: * WebCore.vcxproj/WebCoreTestSupport.vcxproj: * WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters: * CMakeLists.txt: Add MockPageOverlayClient. * platform/graphics/GraphicsLayer.h: * page/PageOverlayController.h: * page/PageOverlayController.cpp: (WebCore::PageOverlayController::shouldSkipLayerInDump): Don't skip PageOverlayController-owned layers in the layer tree dump if the layerTreeAsText behavior says that we should include them. * platform/graphics/GraphicsLayer.cpp: (WebCore::dumpChildren): * platform/graphics/GraphicsLayerClient.h: (WebCore::GraphicsLayerClient::shouldSkipLayerInDump): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::shouldSkipLayerInDump): * rendering/RenderLayerBacking.h: Pass the LayerTreeAsTextBehavior through shouldSkipLayerInDump. * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): Uninstall all page overlays when resetting to a consistent state. (WebCore::Internals::installMockPageOverlay): (WebCore::Internals::pageOverlayLayerTreeAsText): Expose two new internals functions. installMockPageOverlay takes "view" or "document", allowing script to choose the appropriate overlay type. pageOverlayLayerTreeAsText dumps both view and document-relative overlays, from each overlay container layer. * testing/Internals.h: * testing/Internals.idl: Fix some typos. * testing/MockPageOverlayClient.cpp: Added. (WebCore::MockPageOverlayClient::shared): (WebCore::MockPageOverlayClient::MockPageOverlayClient): (WebCore::MockPageOverlayClient::installOverlay): (WebCore::MockPageOverlayClient::uninstallAllOverlays): (WebCore::MockPageOverlayClient::layerTreeAsText): (WebCore::MockPageOverlayClient::pageOverlayDestroyed): (WebCore::MockPageOverlayClient::willMoveToPage): (WebCore::MockPageOverlayClient::didMoveToPage): When the overlay is parented, mark it as needing repaint. Future tests might want to test overlays without content, but for now this is a reasonable default behavior. (WebCore::MockPageOverlayClient::drawRect): Paint the overlay rects as described in the LayoutTests ChangeLog. (WebCore::MockPageOverlayClient::mouseEvent): (WebCore::MockPageOverlayClient::didScrollFrame): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeStringValueForPoint): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeBoolValueForPoint): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeNames): * testing/MockPageOverlayClient.h: Added. * pageoverlay/overlay-installation.html: Added. Add a test which just installs one view-relative and one document-relative overlay, and dumps the layer tree and pixel results. The mock overlay strokes a blue rectangle (inset a little from the overlay bounds) for view-relative overlays, and a green rectangle (inset a bit more) for document-relative overlays. * pageoverlay/overlay-large-document.html: Added. * pageoverlay/overlay-large-document-scrolled.html: Added. Tests that do the same as the -installation test, but with a larger document; the view-relative overlay should be the same size (or slightly smaller, because we have scrollbars now), but the document-relative overlay should be the size of the document. The second test scrolls to maxX, maxY, and the document-relative overlay should scroll along with it, while the view-relative overlay should remain fixed. * pageoverlay/overlay-installation-expected.txt: Added. * pageoverlay/overlay-large-document-expected.txt: Added. * pageoverlay/overlay-large-document-scrolled-expected.txt: Added. "Normal" layer tree expectations. * platform/mac-wk1/pageoverlay/overlay-installation-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-installation-expected.txt: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-expected.txt: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-scrolled-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-scrolled-expected.txt: Added. Expected results for WebKit1 differ for view-relative overlays, because we don't currently hook up view-relative overlays for WebKit1. * platform/mac/pageoverlay/overlay-installation-expected.png: Added. * platform/mac/pageoverlay/overlay-large-document-expected.png: Added. * platform/mac/pageoverlay/overlay-large-document-scrolled-expected.png: Added. "Normal" pixel dump expectations. Canonical link: https://commits.webkit.org/155229@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-04 08:47:04 +00:00
namespace WebCore {
MockPageOverlayClient& MockPageOverlayClient::singleton()
Make it possible to test page overlays https://bugs.webkit.org/show_bug.cgi?id=137339 Reviewed by Dan Bernstein. Tests: pageoverlay/overlay-installation.html pageoverlay/overlay-large-document-scrolled.html pageoverlay/overlay-large-document.html Do some initial work to make page overlays testable. There are many more tests to be written, but this lays the groundwork. * WebCore.exp.in: * WebCore.xcodeproj/project.pbxproj: * WebCore.vcxproj/WebCoreTestSupport.vcxproj: * WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters: * CMakeLists.txt: Add MockPageOverlayClient. * platform/graphics/GraphicsLayer.h: * page/PageOverlayController.h: * page/PageOverlayController.cpp: (WebCore::PageOverlayController::shouldSkipLayerInDump): Don't skip PageOverlayController-owned layers in the layer tree dump if the layerTreeAsText behavior says that we should include them. * platform/graphics/GraphicsLayer.cpp: (WebCore::dumpChildren): * platform/graphics/GraphicsLayerClient.h: (WebCore::GraphicsLayerClient::shouldSkipLayerInDump): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::shouldSkipLayerInDump): * rendering/RenderLayerBacking.h: Pass the LayerTreeAsTextBehavior through shouldSkipLayerInDump. * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): Uninstall all page overlays when resetting to a consistent state. (WebCore::Internals::installMockPageOverlay): (WebCore::Internals::pageOverlayLayerTreeAsText): Expose two new internals functions. installMockPageOverlay takes "view" or "document", allowing script to choose the appropriate overlay type. pageOverlayLayerTreeAsText dumps both view and document-relative overlays, from each overlay container layer. * testing/Internals.h: * testing/Internals.idl: Fix some typos. * testing/MockPageOverlayClient.cpp: Added. (WebCore::MockPageOverlayClient::shared): (WebCore::MockPageOverlayClient::MockPageOverlayClient): (WebCore::MockPageOverlayClient::installOverlay): (WebCore::MockPageOverlayClient::uninstallAllOverlays): (WebCore::MockPageOverlayClient::layerTreeAsText): (WebCore::MockPageOverlayClient::pageOverlayDestroyed): (WebCore::MockPageOverlayClient::willMoveToPage): (WebCore::MockPageOverlayClient::didMoveToPage): When the overlay is parented, mark it as needing repaint. Future tests might want to test overlays without content, but for now this is a reasonable default behavior. (WebCore::MockPageOverlayClient::drawRect): Paint the overlay rects as described in the LayoutTests ChangeLog. (WebCore::MockPageOverlayClient::mouseEvent): (WebCore::MockPageOverlayClient::didScrollFrame): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeStringValueForPoint): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeBoolValueForPoint): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeNames): * testing/MockPageOverlayClient.h: Added. * pageoverlay/overlay-installation.html: Added. Add a test which just installs one view-relative and one document-relative overlay, and dumps the layer tree and pixel results. The mock overlay strokes a blue rectangle (inset a little from the overlay bounds) for view-relative overlays, and a green rectangle (inset a bit more) for document-relative overlays. * pageoverlay/overlay-large-document.html: Added. * pageoverlay/overlay-large-document-scrolled.html: Added. Tests that do the same as the -installation test, but with a larger document; the view-relative overlay should be the same size (or slightly smaller, because we have scrollbars now), but the document-relative overlay should be the size of the document. The second test scrolls to maxX, maxY, and the document-relative overlay should scroll along with it, while the view-relative overlay should remain fixed. * pageoverlay/overlay-installation-expected.txt: Added. * pageoverlay/overlay-large-document-expected.txt: Added. * pageoverlay/overlay-large-document-scrolled-expected.txt: Added. "Normal" layer tree expectations. * platform/mac-wk1/pageoverlay/overlay-installation-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-installation-expected.txt: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-expected.txt: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-scrolled-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-scrolled-expected.txt: Added. Expected results for WebKit1 differ for view-relative overlays, because we don't currently hook up view-relative overlays for WebKit1. * platform/mac/pageoverlay/overlay-installation-expected.png: Added. * platform/mac/pageoverlay/overlay-large-document-expected.png: Added. * platform/mac/pageoverlay/overlay-large-document-scrolled-expected.png: Added. "Normal" pixel dump expectations. Canonical link: https://commits.webkit.org/155229@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-04 08:47:04 +00:00
{
static NeverDestroyed<MockPageOverlayClient> sharedClient;
return sharedClient.get();
}
Use "= default" to denote default constructor or destructor https://bugs.webkit.org/show_bug.cgi?id=178528 Rubber-stamped by Andy Estes. Source/WebCore: * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.h: * Modules/applepay/ApplePayError.cpp: * Modules/applepay/ApplePayPaymentAuthorizedEvent.cpp: * Modules/applepay/ApplePayPaymentMethodSelectedEvent.cpp: * Modules/applepay/ApplePaySession.cpp: * Modules/applepay/ApplePaySessionPaymentRequest.cpp: * Modules/applepay/ApplePayShippingContactSelectedEvent.cpp: * Modules/applepay/ApplePayShippingMethodSelectedEvent.cpp: * Modules/applepay/ApplePayValidateMerchantEvent.cpp: * Modules/applepay/Payment.h: * Modules/applepay/PaymentCoordinatorClient.h: * Modules/credentials/BasicCredential.cpp: * Modules/credentials/FederatedCredential.cpp: * Modules/credentials/NavigatorCredentials.cpp: * Modules/credentials/PasswordCredential.cpp: * Modules/encryptedmedia/CDMClient.h: * Modules/encryptedmedia/legacy/LegacyCDM.cpp: * Modules/encryptedmedia/legacy/LegacyCDM.h: * Modules/encryptedmedia/legacy/LegacyCDMPrivate.h: * Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.h: * Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.h: * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp: * Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.cpp: * Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.cpp: * Modules/entriesapi/DOMFileSystem.cpp: * Modules/entriesapi/FileSystemDirectoryReader.cpp: * Modules/entriesapi/FileSystemEntry.cpp: * Modules/fetch/FetchLoaderClient.h: * Modules/gamepad/Gamepad.cpp: * Modules/gamepad/GamepadEvent.h: * Modules/gamepad/deprecated/Gamepad.cpp: [ truncated ] Source/WebCore/PAL: * pal/Logger.h: (PAL::Logger::Observer::~Observer): Deleted. * pal/crypto/gcrypt/CryptoDigestGCrypt.cpp: * pal/system/SleepDisabler.cpp: * pal/system/SystemSleepListener.h: Canonical link: https://commits.webkit.org/194740@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223728 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-10-19 23:48:45 +00:00
MockPageOverlayClient::MockPageOverlayClient() = default;
Make it possible to test page overlays https://bugs.webkit.org/show_bug.cgi?id=137339 Reviewed by Dan Bernstein. Tests: pageoverlay/overlay-installation.html pageoverlay/overlay-large-document-scrolled.html pageoverlay/overlay-large-document.html Do some initial work to make page overlays testable. There are many more tests to be written, but this lays the groundwork. * WebCore.exp.in: * WebCore.xcodeproj/project.pbxproj: * WebCore.vcxproj/WebCoreTestSupport.vcxproj: * WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters: * CMakeLists.txt: Add MockPageOverlayClient. * platform/graphics/GraphicsLayer.h: * page/PageOverlayController.h: * page/PageOverlayController.cpp: (WebCore::PageOverlayController::shouldSkipLayerInDump): Don't skip PageOverlayController-owned layers in the layer tree dump if the layerTreeAsText behavior says that we should include them. * platform/graphics/GraphicsLayer.cpp: (WebCore::dumpChildren): * platform/graphics/GraphicsLayerClient.h: (WebCore::GraphicsLayerClient::shouldSkipLayerInDump): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::shouldSkipLayerInDump): * rendering/RenderLayerBacking.h: Pass the LayerTreeAsTextBehavior through shouldSkipLayerInDump. * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): Uninstall all page overlays when resetting to a consistent state. (WebCore::Internals::installMockPageOverlay): (WebCore::Internals::pageOverlayLayerTreeAsText): Expose two new internals functions. installMockPageOverlay takes "view" or "document", allowing script to choose the appropriate overlay type. pageOverlayLayerTreeAsText dumps both view and document-relative overlays, from each overlay container layer. * testing/Internals.h: * testing/Internals.idl: Fix some typos. * testing/MockPageOverlayClient.cpp: Added. (WebCore::MockPageOverlayClient::shared): (WebCore::MockPageOverlayClient::MockPageOverlayClient): (WebCore::MockPageOverlayClient::installOverlay): (WebCore::MockPageOverlayClient::uninstallAllOverlays): (WebCore::MockPageOverlayClient::layerTreeAsText): (WebCore::MockPageOverlayClient::pageOverlayDestroyed): (WebCore::MockPageOverlayClient::willMoveToPage): (WebCore::MockPageOverlayClient::didMoveToPage): When the overlay is parented, mark it as needing repaint. Future tests might want to test overlays without content, but for now this is a reasonable default behavior. (WebCore::MockPageOverlayClient::drawRect): Paint the overlay rects as described in the LayoutTests ChangeLog. (WebCore::MockPageOverlayClient::mouseEvent): (WebCore::MockPageOverlayClient::didScrollFrame): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeStringValueForPoint): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeBoolValueForPoint): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeNames): * testing/MockPageOverlayClient.h: Added. * pageoverlay/overlay-installation.html: Added. Add a test which just installs one view-relative and one document-relative overlay, and dumps the layer tree and pixel results. The mock overlay strokes a blue rectangle (inset a little from the overlay bounds) for view-relative overlays, and a green rectangle (inset a bit more) for document-relative overlays. * pageoverlay/overlay-large-document.html: Added. * pageoverlay/overlay-large-document-scrolled.html: Added. Tests that do the same as the -installation test, but with a larger document; the view-relative overlay should be the same size (or slightly smaller, because we have scrollbars now), but the document-relative overlay should be the size of the document. The second test scrolls to maxX, maxY, and the document-relative overlay should scroll along with it, while the view-relative overlay should remain fixed. * pageoverlay/overlay-installation-expected.txt: Added. * pageoverlay/overlay-large-document-expected.txt: Added. * pageoverlay/overlay-large-document-scrolled-expected.txt: Added. "Normal" layer tree expectations. * platform/mac-wk1/pageoverlay/overlay-installation-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-installation-expected.txt: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-expected.txt: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-scrolled-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-scrolled-expected.txt: Added. Expected results for WebKit1 differ for view-relative overlays, because we don't currently hook up view-relative overlays for WebKit1. * platform/mac/pageoverlay/overlay-installation-expected.png: Added. * platform/mac/pageoverlay/overlay-large-document-expected.png: Added. * platform/mac/pageoverlay/overlay-large-document-scrolled-expected.png: Added. "Normal" pixel dump expectations. Canonical link: https://commits.webkit.org/155229@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-04 08:47:04 +00:00
Drop MainFrame class https://bugs.webkit.org/show_bug.cgi?id=184191 Reviewed by Darin Adler. Source/WebCore: Drop MainFrame class and move contents into Page / Frame since there is a 1:1 relationship between the Page and the MainFrame. This is ground work for introducing LocalFrame / RemoteFrame concepts. * Modules/applepay/ApplePaySession.cpp: (WebCore::ApplePaySession::create): (WebCore::ApplePaySession::supportsVersion): (WebCore::ApplePaySession::canMakePayments): (WebCore::ApplePaySession::canMakePaymentsWithActiveCard): (WebCore::ApplePaySession::openPaymentSetup): (WebCore::ApplePaySession::paymentCoordinator const): * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp: (WebCore::paymentCoordinator): * Modules/mediastream/MediaDevicesEnumerationRequest.cpp: * Modules/mediastream/UserMediaRequest.cpp: * Modules/plugins/QuickTimePluginReplacement.mm: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::mainFrame const): (WebCore::AccessibilityObject::visiblePositionForBounds const): * accessibility/AccessibilityObject.h: * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: * bindings/js/ScriptController.cpp: * bindings/js/ScriptState.cpp: * contentextensions/ContentExtensionsBackend.cpp: * css/MediaQueryEvaluator.cpp: (WebCore::displayModeEvaluate): * dom/DOMImplementation.cpp: * dom/Document.cpp: * dom/DocumentMarkerController.cpp: * dom/Element.cpp: (WebCore::Element::removedFromAncestor): * dom/EventDispatcher.cpp: * dom/ScriptedAnimationController.cpp: * editing/Editor.cpp: (WebCore::Editor::scanSelectionForTelephoneNumbers): * editing/EditorCommand.cpp: * editing/SelectionRectGatherer.cpp: (WebCore::SelectionRectGatherer::Notifier::~Notifier): * editing/cocoa/WebContentReaderCocoa.mm: * editing/markup.cpp: * history/CachedFrame.cpp: * history/CachedPage.cpp: * history/PageCache.cpp: (WebCore::destroyRenderTree): * html/HTMLMediaElement.cpp: * html/HTMLPlugInImageElement.cpp: * html/ImageDocument.cpp: * html/MediaElementSession.cpp: (WebCore::isMainContentForPurposesOfAutoplay): * html/canvas/WebGLRenderingContextBase.cpp: * inspector/InspectorClient.cpp: * inspector/InspectorController.cpp: * inspector/InspectorFrontendClientLocal.cpp: * inspector/InspectorFrontendHost.cpp: * inspector/InspectorInstrumentation.cpp: * inspector/InspectorOverlay.cpp: * inspector/PageScriptDebugServer.cpp: * inspector/agents/InspectorApplicationCacheAgent.cpp: * inspector/agents/InspectorCanvasAgent.cpp: * inspector/agents/InspectorDOMAgent.cpp: * inspector/agents/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::mainFrame): * inspector/agents/InspectorPageAgent.h: * inspector/agents/page/PageDebuggerAgent.cpp: * inspector/agents/page/PageRuntimeAgent.cpp: * loader/DocumentLoader.cpp: * loader/DocumentWriter.cpp: * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadWithDocumentLoader): (WebCore::FrameLoader::setState): * loader/HistoryController.cpp: * loader/NavigationDisabler.h: * loader/ProgressTracker.cpp: * loader/ResourceLoadObserver.cpp: * loader/ResourceLoader.cpp: * loader/SubframeLoader.cpp: * loader/SubresourceLoader.cpp: * loader/appcache/ApplicationCacheHost.cpp: * loader/archive/mhtml/MHTMLArchive.cpp: * loader/cache/CachedResource.cpp: * loader/cache/CachedResourceLoader.cpp: * page/AutoscrollController.cpp: * page/Chrome.cpp: * page/ContextMenuController.cpp: * page/DOMWindow.cpp: * page/DebugPageOverlays.cpp: (WebCore::MouseWheelRegionOverlay::updateRegion): (WebCore::NonFastScrollableRegionOverlay::updateRegion): (WebCore::RegionOverlay::create): (WebCore::RegionOverlay::RegionOverlay): (WebCore::RegionOverlay::~RegionOverlay): (WebCore::DebugPageOverlays::ensureRegionOverlayForPage): (WebCore::DebugPageOverlays::showRegionOverlay): (WebCore::DebugPageOverlays::hideRegionOverlay): (WebCore::DebugPageOverlays::regionChanged): (WebCore::DebugPageOverlays::regionOverlayForPage const): (WebCore::DebugPageOverlays::updateOverlayRegionVisibility): (WebCore::DebugPageOverlays::settingsChanged): * page/DebugPageOverlays.h: (WebCore::DebugPageOverlays::hasOverlaysForPage const): (WebCore::DebugPageOverlays::hasOverlays): (WebCore::DebugPageOverlays::didLayout): (WebCore::DebugPageOverlays::didChangeEventHandlers): * page/DragController.cpp: (WebCore::DragController::performDragOperation): (WebCore::DragController::tryDHTMLDrag): (WebCore::DragController::beginDrag): (WebCore::DragController::doSystemDrag): * page/EventHandler.cpp: (WebCore::EventHandler::handleMousePressEvent): (WebCore::EventHandler::mouseMoved): (WebCore::EventHandler::handleMouseReleaseEvent): (WebCore::EventHandler::handleWheelEvent): (WebCore::EventHandler::clearLatchedState): (WebCore::EventHandler::defaultWheelEventHandler): * page/FocusController.cpp: * page/Frame.cpp: (WebCore::Frame::Frame): (WebCore::Frame::dropChildren): (WebCore::Frame::selfOnlyRef): (WebCore::Frame::selfOnlyDeref): * page/Frame.h: (WebCore::Frame::mainFrame const): * page/FrameTree.cpp: * page/FrameView.cpp: (WebCore::FrameView::setFrameRect): (WebCore::FrameView::setContentsSize): (WebCore::FrameView::didChangeScrollOffset): (WebCore::FrameView::setViewExposedRect): * page/History.cpp: * page/MainFrame.cpp: Removed. * page/MainFrame.h: Removed. * page/MemoryRelease.cpp: * page/Page.cpp: (WebCore::Page::Page): (WebCore::m_applicationManifest): (WebCore::Page::setDeviceScaleFactor): (WebCore::Page::latchingState): (WebCore::Page::pushNewLatchingState): (WebCore::Page::resetLatchingState): (WebCore::Page::popLatchingState): (WebCore::Page::removeLatchingStateForTarget): (WebCore::Page::setPaymentCoordinator): * page/Page.h: (WebCore::Page::mainFrame): (WebCore::Page::mainFrame const): (WebCore::Page::wheelEventDeltaFilter): (WebCore::Page::pageOverlayController): (WebCore::Page::servicesOverlayController): (WebCore::Page::paymentCoordinator const): (WebCore::Page::applicationManifest const): (WebCore::Page::performanceLogging const): * page/PageConsoleClient.cpp: * page/PageDebuggable.cpp: * page/PageGroup.cpp: * page/PageGroupLoadDeferrer.cpp: * page/PageOverlay.cpp: (WebCore::PageOverlay::controller const): * page/PageOverlayController.cpp: (WebCore::PageOverlayController::PageOverlayController): (WebCore::PageOverlayController::createRootLayersIfNeeded): (WebCore::PageOverlayController::layerWithDocumentOverlays): (WebCore::PageOverlayController::layerWithViewOverlays): (WebCore::PageOverlayController::installPageOverlay): (WebCore::PageOverlayController::updateForceSynchronousScrollLayerPositionUpdates): (WebCore::PageOverlayController::didChangeViewExposedRect): (WebCore::PageOverlayController::updateSettingsForLayer): (WebCore::PageOverlayController::deviceScaleFactor const): (WebCore::PageOverlayController::notifyFlushRequired): (WebCore::PageOverlayController::tiledBackingUsageChanged): * page/PageOverlayController.h: * page/PageSerializer.cpp: * page/PerformanceLogging.cpp: (WebCore::PerformanceLogging::PerformanceLogging): (WebCore::PerformanceLogging::didReachPointOfInterest): * page/PerformanceLogging.h: * page/PerformanceMonitor.cpp: * page/ResourceUsageOverlay.cpp: (WebCore::ResourceUsageOverlay::~ResourceUsageOverlay): (WebCore::ResourceUsageOverlay::initialize): * page/SettingsBase.cpp: * page/SpatialNavigation.cpp: * page/UserContentProvider.cpp: * page/ios/FrameIOS.mm: * page/mac/DragControllerMac.mm: * page/mac/EventHandlerMac.mm: (WebCore::latchingIsLockedToPlatformFrame): (WebCore::latchingIsLockedToAncestorOfThisFrame): (WebCore::EventHandler::clearOrScheduleClearingLatchedStateIfNeeded): (WebCore::EventHandler::platformPrepareForWheelEvents): (WebCore::EventHandler::platformRecordWheelEvent): (WebCore::EventHandler::platformCompleteWheelEvent): (WebCore::EventHandler::platformCompletePlatformWidgetWheelEvent): * page/mac/PageMac.mm: * page/mac/ServicesOverlayController.h: (WebCore::ServicesOverlayController::page const): * page/mac/ServicesOverlayController.mm: (WebCore::ServicesOverlayController::Highlight::Highlight): (WebCore::ServicesOverlayController::Highlight::notifyFlushRequired): (WebCore::ServicesOverlayController::Highlight::deviceScaleFactor const): (WebCore::ServicesOverlayController::ServicesOverlayController): (WebCore::ServicesOverlayController::invalidateHighlightsOfType): (WebCore::ServicesOverlayController::buildPotentialHighlightsIfNeeded): (WebCore::ServicesOverlayController::remainingTimeUntilHighlightShouldBeShown const): (WebCore::ServicesOverlayController::buildPhoneNumberHighlights): (WebCore::ServicesOverlayController::buildSelectionHighlight): (WebCore::ServicesOverlayController::hasRelevantSelectionServices): (WebCore::ServicesOverlayController::createOverlayIfNeeded): (WebCore::ServicesOverlayController::telephoneNumberRangesForFocusedFrame): (WebCore::ServicesOverlayController::findTelephoneNumberHighlightContainingSelectionHighlight): (WebCore::ServicesOverlayController::mouseEvent): (WebCore::ServicesOverlayController::handleClick): (WebCore::ServicesOverlayController::mainFrame const): * page/scrolling/AsyncScrollingCoordinator.cpp: * page/scrolling/ScrollingCoordinator.cpp: * page/scrolling/ios/ScrollingCoordinatorIOS.mm: * page/scrolling/mac/ScrollingCoordinatorMac.mm: * platform/graphics/ca/win/CACFLayerTreeHost.cpp: * plugins/DOMMimeType.cpp: * plugins/PluginInfoProvider.cpp: (WebCore::PluginInfoProvider::refresh): * rendering/RenderBox.cpp: * rendering/RenderLayer.cpp: * rendering/RenderLayerBacking.cpp: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers const): (WebCore::RenderLayerCompositor::updateCompositingLayers): (WebCore::RenderLayerCompositor::appendDocumentOverlayLayers): (WebCore::RenderLayerCompositor::attachRootLayer): (WebCore::RenderLayerCompositor::detachRootLayer): (WebCore::RenderLayerCompositor::rootLayerAttachmentChanged): * rendering/RenderObject.cpp: * replay/UserInputBridge.cpp: * storage/StorageEventDispatcher.cpp: * style/StyleTreeResolver.cpp: (WebCore::Style::suspendMemoryCacheClientCalls): * svg/SVGSVGElement.cpp: * svg/graphics/SVGImage.cpp: * testing/InternalSettings.cpp: * testing/Internals.cpp: (WebCore::Internals::Internals): (WebCore::Internals::installMockPageOverlay): (WebCore::Internals::pageOverlayLayerTreeAsText const): * testing/MockPageOverlay.cpp: * testing/MockPageOverlay.h: * testing/MockPageOverlayClient.cpp: (WebCore::MockPageOverlayClient::installOverlay): (WebCore::MockPageOverlayClient::layerTreeAsText): * testing/MockPageOverlayClient.h: * testing/MockPaymentCoordinator.cpp: (WebCore::MockPaymentCoordinator::MockPaymentCoordinator): (WebCore::MockPaymentCoordinator::showPaymentUI): (WebCore::MockPaymentCoordinator::completeMerchantValidation): (WebCore::MockPaymentCoordinator::changeShippingOption): (WebCore::MockPaymentCoordinator::changePaymentMethod): (WebCore::MockPaymentCoordinator::acceptPayment): (WebCore::MockPaymentCoordinator::cancelPayment): * testing/MockPaymentCoordinator.h: * workers/service/context/ServiceWorkerThreadProxy.cpp: Source/WebKit: Drop MainFrame class and move contents into Page / Frame since there is a 1:1 relationship between the Page and the MainFrame. This is ground work for introducing LocalFrame / RemoteFrame concepts. * Shared/WebRenderLayer.cpp: * Shared/WebRenderObject.cpp: * WebProcess/ApplePay/WebPaymentCoordinator.cpp: (WebKit::WebPaymentCoordinator::paymentCoordinator): * WebProcess/Automation/WebAutomationSessionProxy.cpp: * WebProcess/FullScreen/WebFullScreenManager.cpp: * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKBundlePageInstallPageOverlay): (WKBundlePageUninstallPageOverlay): (WKBundlePageInstallPageOverlayWithAnimation): (WKBundlePageUninstallPageOverlayWithAnimation): * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp: * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: * WebProcess/InjectedBundle/InjectedBundle.cpp: * WebProcess/Plugins/PDF/PDFPlugin.mm: * WebProcess/Plugins/PluginView.cpp: * WebProcess/Plugins/WebPluginInfoProvider.cpp: * WebProcess/WebCoreSupport/WebChromeClient.cpp: * WebProcess/WebCoreSupport/WebContextMenuClient.cpp: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: * WebProcess/WebCoreSupport/WebInspectorClient.cpp: (WebKit::WebInspectorClient::~WebInspectorClient): (WebKit::WebInspectorClient::highlight): (WebKit::WebInspectorClient::hideHighlight): (WebKit::WebInspectorClient::showPaintRect): * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: * WebProcess/WebCoreSupport/WebProgressTrackerClient.cpp: * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm: * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: * WebProcess/WebPage/AcceleratedDrawingArea.cpp: * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp: * WebProcess/WebPage/FindController.cpp: (WebKit::FindController::updateFindUIAfterPageScroll): (WebKit::FindController::hideFindUI): * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm: * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::updatePreferences): * WebProcess/WebPage/WKAccessibilityWebPageObjectIOS.mm: * WebProcess/WebPage/WebBackForwardListProxy.cpp: * WebProcess/WebPage/WebFrame.cpp: * WebProcess/WebPage/WebInspector.cpp: * WebProcess/WebPage/WebInspectorFrontendAPIDispatcher.cpp: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::mainFrame const): (WebKit::WebPage::determinePrimarySnapshottedPlugIn): (WebKit::WebPage::plugInIntersectsSearchRect): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/atk/WebPageAccessibilityObjectAtk.cpp: * WebProcess/WebPage/ios/FindControllerIOS.mm: * WebProcess/WebPage/ios/WebPageIOS.mm: * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::updatePreferences): * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm: * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm: (-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]): (-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performImmediateActionHitTestAtLocation): (WebKit::WebPage::dataDetectorsDidPresentUI): (WebKit::WebPage::dataDetectorsDidChangeUI): (WebKit::WebPage::dataDetectorsDidHideUI): * WebProcess/WebProcess.cpp: * WebProcess/WebStorage/StorageAreaMap.cpp: Source/WebKitLegacy/mac: Drop MainFrame class and move contents into Page / Frame since there is a 1:1 relationship between the Page and the MainFrame. This is ground work for introducing LocalFrame / RemoteFrame concepts. * WebCoreSupport/WebDragClient.mm: * WebCoreSupport/WebFrameLoaderClient.mm: * WebCoreSupport/WebInspectorClient.mm: * WebCoreSupport/WebPlatformStrategies.mm: * WebCoreSupport/WebPluginInfoProvider.mm: * WebView/WebFrame.mm: * WebView/WebFrameView.mm: * WebView/WebHTMLView.mm: * WebView/WebView.mm: Source/WebKitLegacy/win: Drop MainFrame class and move contents into Page / Frame since there is a 1:1 relationship between the Page and the MainFrame. This is ground work for introducing LocalFrame / RemoteFrame concepts. * WebCoreSupport/AcceleratedCompositingContext.cpp: * WebCoreSupport/WebContextMenuClient.cpp: * WebCoreSupport/WebDragClient.cpp: * WebDropSource.cpp: * WebFrame.cpp: * WebView.cpp: Tools: * TestWebKitAPI/Tests/WebCore/cocoa/WebCoreNSURLSession.mm: Canonical link: https://commits.webkit.org/199818@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230211 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-03 18:01:41 +00:00
Ref<MockPageOverlay> MockPageOverlayClient::installOverlay(Page& page, PageOverlay::OverlayType overlayType)
Make it possible to test page overlays https://bugs.webkit.org/show_bug.cgi?id=137339 Reviewed by Dan Bernstein. Tests: pageoverlay/overlay-installation.html pageoverlay/overlay-large-document-scrolled.html pageoverlay/overlay-large-document.html Do some initial work to make page overlays testable. There are many more tests to be written, but this lays the groundwork. * WebCore.exp.in: * WebCore.xcodeproj/project.pbxproj: * WebCore.vcxproj/WebCoreTestSupport.vcxproj: * WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters: * CMakeLists.txt: Add MockPageOverlayClient. * platform/graphics/GraphicsLayer.h: * page/PageOverlayController.h: * page/PageOverlayController.cpp: (WebCore::PageOverlayController::shouldSkipLayerInDump): Don't skip PageOverlayController-owned layers in the layer tree dump if the layerTreeAsText behavior says that we should include them. * platform/graphics/GraphicsLayer.cpp: (WebCore::dumpChildren): * platform/graphics/GraphicsLayerClient.h: (WebCore::GraphicsLayerClient::shouldSkipLayerInDump): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::shouldSkipLayerInDump): * rendering/RenderLayerBacking.h: Pass the LayerTreeAsTextBehavior through shouldSkipLayerInDump. * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): Uninstall all page overlays when resetting to a consistent state. (WebCore::Internals::installMockPageOverlay): (WebCore::Internals::pageOverlayLayerTreeAsText): Expose two new internals functions. installMockPageOverlay takes "view" or "document", allowing script to choose the appropriate overlay type. pageOverlayLayerTreeAsText dumps both view and document-relative overlays, from each overlay container layer. * testing/Internals.h: * testing/Internals.idl: Fix some typos. * testing/MockPageOverlayClient.cpp: Added. (WebCore::MockPageOverlayClient::shared): (WebCore::MockPageOverlayClient::MockPageOverlayClient): (WebCore::MockPageOverlayClient::installOverlay): (WebCore::MockPageOverlayClient::uninstallAllOverlays): (WebCore::MockPageOverlayClient::layerTreeAsText): (WebCore::MockPageOverlayClient::pageOverlayDestroyed): (WebCore::MockPageOverlayClient::willMoveToPage): (WebCore::MockPageOverlayClient::didMoveToPage): When the overlay is parented, mark it as needing repaint. Future tests might want to test overlays without content, but for now this is a reasonable default behavior. (WebCore::MockPageOverlayClient::drawRect): Paint the overlay rects as described in the LayoutTests ChangeLog. (WebCore::MockPageOverlayClient::mouseEvent): (WebCore::MockPageOverlayClient::didScrollFrame): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeStringValueForPoint): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeBoolValueForPoint): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeNames): * testing/MockPageOverlayClient.h: Added. * pageoverlay/overlay-installation.html: Added. Add a test which just installs one view-relative and one document-relative overlay, and dumps the layer tree and pixel results. The mock overlay strokes a blue rectangle (inset a little from the overlay bounds) for view-relative overlays, and a green rectangle (inset a bit more) for document-relative overlays. * pageoverlay/overlay-large-document.html: Added. * pageoverlay/overlay-large-document-scrolled.html: Added. Tests that do the same as the -installation test, but with a larger document; the view-relative overlay should be the same size (or slightly smaller, because we have scrollbars now), but the document-relative overlay should be the size of the document. The second test scrolls to maxX, maxY, and the document-relative overlay should scroll along with it, while the view-relative overlay should remain fixed. * pageoverlay/overlay-installation-expected.txt: Added. * pageoverlay/overlay-large-document-expected.txt: Added. * pageoverlay/overlay-large-document-scrolled-expected.txt: Added. "Normal" layer tree expectations. * platform/mac-wk1/pageoverlay/overlay-installation-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-installation-expected.txt: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-expected.txt: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-scrolled-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-scrolled-expected.txt: Added. Expected results for WebKit1 differ for view-relative overlays, because we don't currently hook up view-relative overlays for WebKit1. * platform/mac/pageoverlay/overlay-installation-expected.png: Added. * platform/mac/pageoverlay/overlay-large-document-expected.png: Added. * platform/mac/pageoverlay/overlay-large-document-scrolled-expected.png: Added. "Normal" pixel dump expectations. Canonical link: https://commits.webkit.org/155229@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-04 08:47:04 +00:00
{
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. Canonical link: https://commits.webkit.org/170422@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194117 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-12-15 22:46:02 +00:00
auto overlay = PageOverlay::create(*this, overlayType);
Drop MainFrame class https://bugs.webkit.org/show_bug.cgi?id=184191 Reviewed by Darin Adler. Source/WebCore: Drop MainFrame class and move contents into Page / Frame since there is a 1:1 relationship between the Page and the MainFrame. This is ground work for introducing LocalFrame / RemoteFrame concepts. * Modules/applepay/ApplePaySession.cpp: (WebCore::ApplePaySession::create): (WebCore::ApplePaySession::supportsVersion): (WebCore::ApplePaySession::canMakePayments): (WebCore::ApplePaySession::canMakePaymentsWithActiveCard): (WebCore::ApplePaySession::openPaymentSetup): (WebCore::ApplePaySession::paymentCoordinator const): * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp: (WebCore::paymentCoordinator): * Modules/mediastream/MediaDevicesEnumerationRequest.cpp: * Modules/mediastream/UserMediaRequest.cpp: * Modules/plugins/QuickTimePluginReplacement.mm: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::mainFrame const): (WebCore::AccessibilityObject::visiblePositionForBounds const): * accessibility/AccessibilityObject.h: * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: * bindings/js/ScriptController.cpp: * bindings/js/ScriptState.cpp: * contentextensions/ContentExtensionsBackend.cpp: * css/MediaQueryEvaluator.cpp: (WebCore::displayModeEvaluate): * dom/DOMImplementation.cpp: * dom/Document.cpp: * dom/DocumentMarkerController.cpp: * dom/Element.cpp: (WebCore::Element::removedFromAncestor): * dom/EventDispatcher.cpp: * dom/ScriptedAnimationController.cpp: * editing/Editor.cpp: (WebCore::Editor::scanSelectionForTelephoneNumbers): * editing/EditorCommand.cpp: * editing/SelectionRectGatherer.cpp: (WebCore::SelectionRectGatherer::Notifier::~Notifier): * editing/cocoa/WebContentReaderCocoa.mm: * editing/markup.cpp: * history/CachedFrame.cpp: * history/CachedPage.cpp: * history/PageCache.cpp: (WebCore::destroyRenderTree): * html/HTMLMediaElement.cpp: * html/HTMLPlugInImageElement.cpp: * html/ImageDocument.cpp: * html/MediaElementSession.cpp: (WebCore::isMainContentForPurposesOfAutoplay): * html/canvas/WebGLRenderingContextBase.cpp: * inspector/InspectorClient.cpp: * inspector/InspectorController.cpp: * inspector/InspectorFrontendClientLocal.cpp: * inspector/InspectorFrontendHost.cpp: * inspector/InspectorInstrumentation.cpp: * inspector/InspectorOverlay.cpp: * inspector/PageScriptDebugServer.cpp: * inspector/agents/InspectorApplicationCacheAgent.cpp: * inspector/agents/InspectorCanvasAgent.cpp: * inspector/agents/InspectorDOMAgent.cpp: * inspector/agents/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::mainFrame): * inspector/agents/InspectorPageAgent.h: * inspector/agents/page/PageDebuggerAgent.cpp: * inspector/agents/page/PageRuntimeAgent.cpp: * loader/DocumentLoader.cpp: * loader/DocumentWriter.cpp: * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadWithDocumentLoader): (WebCore::FrameLoader::setState): * loader/HistoryController.cpp: * loader/NavigationDisabler.h: * loader/ProgressTracker.cpp: * loader/ResourceLoadObserver.cpp: * loader/ResourceLoader.cpp: * loader/SubframeLoader.cpp: * loader/SubresourceLoader.cpp: * loader/appcache/ApplicationCacheHost.cpp: * loader/archive/mhtml/MHTMLArchive.cpp: * loader/cache/CachedResource.cpp: * loader/cache/CachedResourceLoader.cpp: * page/AutoscrollController.cpp: * page/Chrome.cpp: * page/ContextMenuController.cpp: * page/DOMWindow.cpp: * page/DebugPageOverlays.cpp: (WebCore::MouseWheelRegionOverlay::updateRegion): (WebCore::NonFastScrollableRegionOverlay::updateRegion): (WebCore::RegionOverlay::create): (WebCore::RegionOverlay::RegionOverlay): (WebCore::RegionOverlay::~RegionOverlay): (WebCore::DebugPageOverlays::ensureRegionOverlayForPage): (WebCore::DebugPageOverlays::showRegionOverlay): (WebCore::DebugPageOverlays::hideRegionOverlay): (WebCore::DebugPageOverlays::regionChanged): (WebCore::DebugPageOverlays::regionOverlayForPage const): (WebCore::DebugPageOverlays::updateOverlayRegionVisibility): (WebCore::DebugPageOverlays::settingsChanged): * page/DebugPageOverlays.h: (WebCore::DebugPageOverlays::hasOverlaysForPage const): (WebCore::DebugPageOverlays::hasOverlays): (WebCore::DebugPageOverlays::didLayout): (WebCore::DebugPageOverlays::didChangeEventHandlers): * page/DragController.cpp: (WebCore::DragController::performDragOperation): (WebCore::DragController::tryDHTMLDrag): (WebCore::DragController::beginDrag): (WebCore::DragController::doSystemDrag): * page/EventHandler.cpp: (WebCore::EventHandler::handleMousePressEvent): (WebCore::EventHandler::mouseMoved): (WebCore::EventHandler::handleMouseReleaseEvent): (WebCore::EventHandler::handleWheelEvent): (WebCore::EventHandler::clearLatchedState): (WebCore::EventHandler::defaultWheelEventHandler): * page/FocusController.cpp: * page/Frame.cpp: (WebCore::Frame::Frame): (WebCore::Frame::dropChildren): (WebCore::Frame::selfOnlyRef): (WebCore::Frame::selfOnlyDeref): * page/Frame.h: (WebCore::Frame::mainFrame const): * page/FrameTree.cpp: * page/FrameView.cpp: (WebCore::FrameView::setFrameRect): (WebCore::FrameView::setContentsSize): (WebCore::FrameView::didChangeScrollOffset): (WebCore::FrameView::setViewExposedRect): * page/History.cpp: * page/MainFrame.cpp: Removed. * page/MainFrame.h: Removed. * page/MemoryRelease.cpp: * page/Page.cpp: (WebCore::Page::Page): (WebCore::m_applicationManifest): (WebCore::Page::setDeviceScaleFactor): (WebCore::Page::latchingState): (WebCore::Page::pushNewLatchingState): (WebCore::Page::resetLatchingState): (WebCore::Page::popLatchingState): (WebCore::Page::removeLatchingStateForTarget): (WebCore::Page::setPaymentCoordinator): * page/Page.h: (WebCore::Page::mainFrame): (WebCore::Page::mainFrame const): (WebCore::Page::wheelEventDeltaFilter): (WebCore::Page::pageOverlayController): (WebCore::Page::servicesOverlayController): (WebCore::Page::paymentCoordinator const): (WebCore::Page::applicationManifest const): (WebCore::Page::performanceLogging const): * page/PageConsoleClient.cpp: * page/PageDebuggable.cpp: * page/PageGroup.cpp: * page/PageGroupLoadDeferrer.cpp: * page/PageOverlay.cpp: (WebCore::PageOverlay::controller const): * page/PageOverlayController.cpp: (WebCore::PageOverlayController::PageOverlayController): (WebCore::PageOverlayController::createRootLayersIfNeeded): (WebCore::PageOverlayController::layerWithDocumentOverlays): (WebCore::PageOverlayController::layerWithViewOverlays): (WebCore::PageOverlayController::installPageOverlay): (WebCore::PageOverlayController::updateForceSynchronousScrollLayerPositionUpdates): (WebCore::PageOverlayController::didChangeViewExposedRect): (WebCore::PageOverlayController::updateSettingsForLayer): (WebCore::PageOverlayController::deviceScaleFactor const): (WebCore::PageOverlayController::notifyFlushRequired): (WebCore::PageOverlayController::tiledBackingUsageChanged): * page/PageOverlayController.h: * page/PageSerializer.cpp: * page/PerformanceLogging.cpp: (WebCore::PerformanceLogging::PerformanceLogging): (WebCore::PerformanceLogging::didReachPointOfInterest): * page/PerformanceLogging.h: * page/PerformanceMonitor.cpp: * page/ResourceUsageOverlay.cpp: (WebCore::ResourceUsageOverlay::~ResourceUsageOverlay): (WebCore::ResourceUsageOverlay::initialize): * page/SettingsBase.cpp: * page/SpatialNavigation.cpp: * page/UserContentProvider.cpp: * page/ios/FrameIOS.mm: * page/mac/DragControllerMac.mm: * page/mac/EventHandlerMac.mm: (WebCore::latchingIsLockedToPlatformFrame): (WebCore::latchingIsLockedToAncestorOfThisFrame): (WebCore::EventHandler::clearOrScheduleClearingLatchedStateIfNeeded): (WebCore::EventHandler::platformPrepareForWheelEvents): (WebCore::EventHandler::platformRecordWheelEvent): (WebCore::EventHandler::platformCompleteWheelEvent): (WebCore::EventHandler::platformCompletePlatformWidgetWheelEvent): * page/mac/PageMac.mm: * page/mac/ServicesOverlayController.h: (WebCore::ServicesOverlayController::page const): * page/mac/ServicesOverlayController.mm: (WebCore::ServicesOverlayController::Highlight::Highlight): (WebCore::ServicesOverlayController::Highlight::notifyFlushRequired): (WebCore::ServicesOverlayController::Highlight::deviceScaleFactor const): (WebCore::ServicesOverlayController::ServicesOverlayController): (WebCore::ServicesOverlayController::invalidateHighlightsOfType): (WebCore::ServicesOverlayController::buildPotentialHighlightsIfNeeded): (WebCore::ServicesOverlayController::remainingTimeUntilHighlightShouldBeShown const): (WebCore::ServicesOverlayController::buildPhoneNumberHighlights): (WebCore::ServicesOverlayController::buildSelectionHighlight): (WebCore::ServicesOverlayController::hasRelevantSelectionServices): (WebCore::ServicesOverlayController::createOverlayIfNeeded): (WebCore::ServicesOverlayController::telephoneNumberRangesForFocusedFrame): (WebCore::ServicesOverlayController::findTelephoneNumberHighlightContainingSelectionHighlight): (WebCore::ServicesOverlayController::mouseEvent): (WebCore::ServicesOverlayController::handleClick): (WebCore::ServicesOverlayController::mainFrame const): * page/scrolling/AsyncScrollingCoordinator.cpp: * page/scrolling/ScrollingCoordinator.cpp: * page/scrolling/ios/ScrollingCoordinatorIOS.mm: * page/scrolling/mac/ScrollingCoordinatorMac.mm: * platform/graphics/ca/win/CACFLayerTreeHost.cpp: * plugins/DOMMimeType.cpp: * plugins/PluginInfoProvider.cpp: (WebCore::PluginInfoProvider::refresh): * rendering/RenderBox.cpp: * rendering/RenderLayer.cpp: * rendering/RenderLayerBacking.cpp: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers const): (WebCore::RenderLayerCompositor::updateCompositingLayers): (WebCore::RenderLayerCompositor::appendDocumentOverlayLayers): (WebCore::RenderLayerCompositor::attachRootLayer): (WebCore::RenderLayerCompositor::detachRootLayer): (WebCore::RenderLayerCompositor::rootLayerAttachmentChanged): * rendering/RenderObject.cpp: * replay/UserInputBridge.cpp: * storage/StorageEventDispatcher.cpp: * style/StyleTreeResolver.cpp: (WebCore::Style::suspendMemoryCacheClientCalls): * svg/SVGSVGElement.cpp: * svg/graphics/SVGImage.cpp: * testing/InternalSettings.cpp: * testing/Internals.cpp: (WebCore::Internals::Internals): (WebCore::Internals::installMockPageOverlay): (WebCore::Internals::pageOverlayLayerTreeAsText const): * testing/MockPageOverlay.cpp: * testing/MockPageOverlay.h: * testing/MockPageOverlayClient.cpp: (WebCore::MockPageOverlayClient::installOverlay): (WebCore::MockPageOverlayClient::layerTreeAsText): * testing/MockPageOverlayClient.h: * testing/MockPaymentCoordinator.cpp: (WebCore::MockPaymentCoordinator::MockPaymentCoordinator): (WebCore::MockPaymentCoordinator::showPaymentUI): (WebCore::MockPaymentCoordinator::completeMerchantValidation): (WebCore::MockPaymentCoordinator::changeShippingOption): (WebCore::MockPaymentCoordinator::changePaymentMethod): (WebCore::MockPaymentCoordinator::acceptPayment): (WebCore::MockPaymentCoordinator::cancelPayment): * testing/MockPaymentCoordinator.h: * workers/service/context/ServiceWorkerThreadProxy.cpp: Source/WebKit: Drop MainFrame class and move contents into Page / Frame since there is a 1:1 relationship between the Page and the MainFrame. This is ground work for introducing LocalFrame / RemoteFrame concepts. * Shared/WebRenderLayer.cpp: * Shared/WebRenderObject.cpp: * WebProcess/ApplePay/WebPaymentCoordinator.cpp: (WebKit::WebPaymentCoordinator::paymentCoordinator): * WebProcess/Automation/WebAutomationSessionProxy.cpp: * WebProcess/FullScreen/WebFullScreenManager.cpp: * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKBundlePageInstallPageOverlay): (WKBundlePageUninstallPageOverlay): (WKBundlePageInstallPageOverlayWithAnimation): (WKBundlePageUninstallPageOverlayWithAnimation): * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp: * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: * WebProcess/InjectedBundle/InjectedBundle.cpp: * WebProcess/Plugins/PDF/PDFPlugin.mm: * WebProcess/Plugins/PluginView.cpp: * WebProcess/Plugins/WebPluginInfoProvider.cpp: * WebProcess/WebCoreSupport/WebChromeClient.cpp: * WebProcess/WebCoreSupport/WebContextMenuClient.cpp: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: * WebProcess/WebCoreSupport/WebInspectorClient.cpp: (WebKit::WebInspectorClient::~WebInspectorClient): (WebKit::WebInspectorClient::highlight): (WebKit::WebInspectorClient::hideHighlight): (WebKit::WebInspectorClient::showPaintRect): * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: * WebProcess/WebCoreSupport/WebProgressTrackerClient.cpp: * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm: * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: * WebProcess/WebPage/AcceleratedDrawingArea.cpp: * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp: * WebProcess/WebPage/FindController.cpp: (WebKit::FindController::updateFindUIAfterPageScroll): (WebKit::FindController::hideFindUI): * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm: * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::updatePreferences): * WebProcess/WebPage/WKAccessibilityWebPageObjectIOS.mm: * WebProcess/WebPage/WebBackForwardListProxy.cpp: * WebProcess/WebPage/WebFrame.cpp: * WebProcess/WebPage/WebInspector.cpp: * WebProcess/WebPage/WebInspectorFrontendAPIDispatcher.cpp: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::mainFrame const): (WebKit::WebPage::determinePrimarySnapshottedPlugIn): (WebKit::WebPage::plugInIntersectsSearchRect): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/atk/WebPageAccessibilityObjectAtk.cpp: * WebProcess/WebPage/ios/FindControllerIOS.mm: * WebProcess/WebPage/ios/WebPageIOS.mm: * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::updatePreferences): * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm: * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm: (-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]): (-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performImmediateActionHitTestAtLocation): (WebKit::WebPage::dataDetectorsDidPresentUI): (WebKit::WebPage::dataDetectorsDidChangeUI): (WebKit::WebPage::dataDetectorsDidHideUI): * WebProcess/WebProcess.cpp: * WebProcess/WebStorage/StorageAreaMap.cpp: Source/WebKitLegacy/mac: Drop MainFrame class and move contents into Page / Frame since there is a 1:1 relationship between the Page and the MainFrame. This is ground work for introducing LocalFrame / RemoteFrame concepts. * WebCoreSupport/WebDragClient.mm: * WebCoreSupport/WebFrameLoaderClient.mm: * WebCoreSupport/WebInspectorClient.mm: * WebCoreSupport/WebPlatformStrategies.mm: * WebCoreSupport/WebPluginInfoProvider.mm: * WebView/WebFrame.mm: * WebView/WebFrameView.mm: * WebView/WebHTMLView.mm: * WebView/WebView.mm: Source/WebKitLegacy/win: Drop MainFrame class and move contents into Page / Frame since there is a 1:1 relationship between the Page and the MainFrame. This is ground work for introducing LocalFrame / RemoteFrame concepts. * WebCoreSupport/AcceleratedCompositingContext.cpp: * WebCoreSupport/WebContextMenuClient.cpp: * WebCoreSupport/WebDragClient.cpp: * WebDropSource.cpp: * WebFrame.cpp: * WebView.cpp: Tools: * TestWebKitAPI/Tests/WebCore/cocoa/WebCoreNSURLSession.mm: Canonical link: https://commits.webkit.org/199818@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230211 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-03 18:01:41 +00:00
page.pageOverlayController().installPageOverlay(overlay, PageOverlay::FadeMode::DoNotFade);
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. Canonical link: https://commits.webkit.org/170422@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194117 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-12-15 22:46:02 +00:00
auto mockOverlay = MockPageOverlay::create(overlay.ptr());
m_overlays.add(mockOverlay.ptr());
return mockOverlay;
Make it possible to test page overlays https://bugs.webkit.org/show_bug.cgi?id=137339 Reviewed by Dan Bernstein. Tests: pageoverlay/overlay-installation.html pageoverlay/overlay-large-document-scrolled.html pageoverlay/overlay-large-document.html Do some initial work to make page overlays testable. There are many more tests to be written, but this lays the groundwork. * WebCore.exp.in: * WebCore.xcodeproj/project.pbxproj: * WebCore.vcxproj/WebCoreTestSupport.vcxproj: * WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters: * CMakeLists.txt: Add MockPageOverlayClient. * platform/graphics/GraphicsLayer.h: * page/PageOverlayController.h: * page/PageOverlayController.cpp: (WebCore::PageOverlayController::shouldSkipLayerInDump): Don't skip PageOverlayController-owned layers in the layer tree dump if the layerTreeAsText behavior says that we should include them. * platform/graphics/GraphicsLayer.cpp: (WebCore::dumpChildren): * platform/graphics/GraphicsLayerClient.h: (WebCore::GraphicsLayerClient::shouldSkipLayerInDump): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::shouldSkipLayerInDump): * rendering/RenderLayerBacking.h: Pass the LayerTreeAsTextBehavior through shouldSkipLayerInDump. * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): Uninstall all page overlays when resetting to a consistent state. (WebCore::Internals::installMockPageOverlay): (WebCore::Internals::pageOverlayLayerTreeAsText): Expose two new internals functions. installMockPageOverlay takes "view" or "document", allowing script to choose the appropriate overlay type. pageOverlayLayerTreeAsText dumps both view and document-relative overlays, from each overlay container layer. * testing/Internals.h: * testing/Internals.idl: Fix some typos. * testing/MockPageOverlayClient.cpp: Added. (WebCore::MockPageOverlayClient::shared): (WebCore::MockPageOverlayClient::MockPageOverlayClient): (WebCore::MockPageOverlayClient::installOverlay): (WebCore::MockPageOverlayClient::uninstallAllOverlays): (WebCore::MockPageOverlayClient::layerTreeAsText): (WebCore::MockPageOverlayClient::pageOverlayDestroyed): (WebCore::MockPageOverlayClient::willMoveToPage): (WebCore::MockPageOverlayClient::didMoveToPage): When the overlay is parented, mark it as needing repaint. Future tests might want to test overlays without content, but for now this is a reasonable default behavior. (WebCore::MockPageOverlayClient::drawRect): Paint the overlay rects as described in the LayoutTests ChangeLog. (WebCore::MockPageOverlayClient::mouseEvent): (WebCore::MockPageOverlayClient::didScrollFrame): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeStringValueForPoint): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeBoolValueForPoint): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeNames): * testing/MockPageOverlayClient.h: Added. * pageoverlay/overlay-installation.html: Added. Add a test which just installs one view-relative and one document-relative overlay, and dumps the layer tree and pixel results. The mock overlay strokes a blue rectangle (inset a little from the overlay bounds) for view-relative overlays, and a green rectangle (inset a bit more) for document-relative overlays. * pageoverlay/overlay-large-document.html: Added. * pageoverlay/overlay-large-document-scrolled.html: Added. Tests that do the same as the -installation test, but with a larger document; the view-relative overlay should be the same size (or slightly smaller, because we have scrollbars now), but the document-relative overlay should be the size of the document. The second test scrolls to maxX, maxY, and the document-relative overlay should scroll along with it, while the view-relative overlay should remain fixed. * pageoverlay/overlay-installation-expected.txt: Added. * pageoverlay/overlay-large-document-expected.txt: Added. * pageoverlay/overlay-large-document-scrolled-expected.txt: Added. "Normal" layer tree expectations. * platform/mac-wk1/pageoverlay/overlay-installation-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-installation-expected.txt: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-expected.txt: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-scrolled-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-scrolled-expected.txt: Added. Expected results for WebKit1 differ for view-relative overlays, because we don't currently hook up view-relative overlays for WebKit1. * platform/mac/pageoverlay/overlay-installation-expected.png: Added. * platform/mac/pageoverlay/overlay-large-document-expected.png: Added. * platform/mac/pageoverlay/overlay-large-document-scrolled-expected.png: Added. "Normal" pixel dump expectations. Canonical link: https://commits.webkit.org/155229@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-04 08:47:04 +00:00
}
void MockPageOverlayClient::uninstallAllOverlays()
{
while (!m_overlays.isEmpty()) {
RefPtr<MockPageOverlay> mockOverlay = m_overlays.takeAny();
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. Canonical link: https://commits.webkit.org/170422@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194117 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-12-15 22:46:02 +00:00
PageOverlayController* overlayController = mockOverlay->overlay()->controller();
ASSERT(overlayController);
Remove PassRefPtr from "page" directory of WebCore, also deploy references https://bugs.webkit.org/show_bug.cgi?id=167224 Reviewed by Chris Dumez. Source/WebCore: * Modules/fetch/DOMWindowFetch.cpp: (WebCore::DOMWindowFetch::fetch): Use DOMWindow::document instead of scriptExecutionContext. * Modules/webdatabase/DatabaseContext.cpp: (WebCore::DatabaseContext::databaseExceededQuota): Pass a reference. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper accessibilityShowContextMenu]): Pass a reference. * bindings/js/JSDOMWindowCustom.cpp: (WebCore::JSDOMWindow::getOwnPropertySlot): Pass a reference. * dom/Document.cpp: (WebCore::Document::childrenChanged): Pass a reference. Also made the didReceiveDocType code unconditional instead of iOS-only. (WebCore::Document::platformSuspendOrStopActiveDOMObjects): Ditto. (WebCore::Document::updateViewportArguments): Ditto. (WebCore::Document::setFocusedElement): Ditto. (WebCore::Document::createDOMWindow): Ditto. (WebCore::Document::takeDOMWindowFrom): Ditto. (WebCore::Document::requestFullScreenForElement): Ditto. (WebCore::Document::webkitExitFullscreen): Ditto. * dom/Element.cpp: (WebCore::Element::focus): Ditto. (WebCore::Element::blur): Ditto. (WebCore::Element::dispatchFocusEvent): Ditto. (WebCore::Element::dispatchBlurEvent): Ditto. * dom/Node.cpp: (WebCore::Node::defaultEventHandler): Ditto. * editing/EditorCommand.cpp: (WebCore::executePrint): Ditto. * editing/FrameSelection.cpp: (WebCore::FrameSelection::setFocusedElementIfNeeded): Ditto. * history/CachedFrame.cpp: (WebCore::CachedFrameBase::restore): Ditto. (WebCore::CachedFrame::CachedFrame): Ditto. * html/ColorInputType.cpp: (WebCore::ColorInputType::handleDOMActivateEvent): Ditto. * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::isKeyboardFocusable): Ditto. * html/HTMLFormControlElement.cpp: (WebCore::HTMLFormControlElement::isKeyboardFocusable): Pass a reference, and also rewrote to use && for clarity. * html/HTMLVideoElement.cpp: (WebCore::HTMLVideoElement::supportsFullscreen): Pass a reference. * html/shadow/SpinButtonElement.cpp: (WebCore::SpinButtonElement::defaultEventHandler): Ditto. (WebCore::SpinButtonElement::releaseCapture): Ditto. * html/shadow/mac/ImageControlsButtonElementMac.cpp: (WebCore::ImageControlsButtonElementMac::defaultEventHandler): Ditto. * inspector/InspectorFrontendHost.cpp: (WebCore::InspectorFrontendHost::showContextMenu): Ditto. (WebCore::InspectorFrontendHost::dispatchEventAsContextMenuEvent): Ditto. * loader/EmptyClients.cpp: (WebCore::EmptyChromeClient::createPopupMenu): Updated to take reference. (WebCore::EmptyChromeClient::createSearchPopupMenu): Ditto. (WebCore::EmptyChromeClient::createColorChooser): Ditto. * loader/EmptyClients.h: Ditto. * loader/FrameLoader.cpp: (WebCore::FrameLoader::submitForm): Pass a reference. (WebCore::FrameLoader::commitProvisionalLoad): Ditto. (WebCore::FrameLoader::closeAndRemoveChild): Take a reference. (WebCore::FrameLoader::detachFromParent): Pass a reference. (WebCore::FrameLoader::dispatchBeforeUnloadEvent): Ditto. (WebCore::createWindow): Ditto. * loader/FrameLoader.h: Updated for the above. * loader/PolicyChecker.cpp: (WebCore::PolicyChecker::checkNewWindowPolicy): Pass a reference. * loader/appcache/ApplicationCacheGroup.cpp: (WebCore::ApplicationCacheGroup::recalculateAvailableSpaceInQuota): Ditto. * loader/appcache/ApplicationCacheGroup.h: Return a reference from origin. * loader/appcache/ApplicationCacheStorage.cpp: (WebCore::ApplicationCacheStorage::calculateQuotaForOrigin): Take a reference. (WebCore::ApplicationCacheStorage::calculateRemainingSizeForOriginExcludingCache): Ditto. (WebCore::ApplicationCacheStorage::store): Pass a reference. (WebCore::ApplicationCacheStorage::checkOriginQuota): Updated since origin now returns areference. * loader/appcache/ApplicationCacheStorage.h: Updated for the above. * loader/archive/mhtml/MHTMLArchive.cpp: (WebCore::MHTMLArchive::generateMHTMLData): Pass a reference. * mathml/MathMLElement.cpp: (WebCore::MathMLElement::isKeyboardFocusable): Ditto. * page/Chrome.cpp: (WebCore::Chrome::Chrome): Moved initialization of data members to the class definition. (WebCore::Chrome::contentsSizeChanged): Take a reference. (WebCore::Chrome::createWindow): Ditto. (WebCore::Chrome::runBeforeUnloadConfirmPanel): Ditto. (WebCore::Chrome::runJavaScriptAlert): Ditto. (WebCore::Chrome::runJavaScriptConfirm): Ditto. (WebCore::Chrome::runJavaScriptPrompt): Ditto. (WebCore::Chrome::setStatusbarText): Ditto. (WebCore::Chrome::print): Ditto. (WebCore::Chrome::createColorChooser): Ditto. (WebCore::Chrome::createPopupMenu): Ditto. (WebCore::Chrome::createSearchPopupMenu): Ditto. (WebCore::Chrome::didReceiveDocType): Ditto. Also made unconditional, but empty for non-iOS platforms. (WebCore::Chrome::registerPopupOpeningObserver): Take a reference. (WebCore::Chrome::unregisterPopupOpeningObserver): Ditto. * page/Chrome.h: Updated for the above. * page/ChromeClient.h: Take references. Also updated some arguments from Node to Element. * page/ContextMenuController.cpp: (WebCore::ContextMenuController::handleContextMenuEvent): Take a reference. (WebCore::ContextMenuController::showContextMenu): Ditto. (WebCore::ContextMenuController::maybeCreateContextMenu): Ditto. Also use make_unique instead of unique_ptr plus new. (WebCore::openNewWindow): Ditto. (WebCore::insertUnicodeCharacter): Ditto. (WebCore::ContextMenuController::contextMenuItemSelected): Ditto. (WebCore::ContextMenuController::showContextMenuAt): Ditto. (WebCore::ContextMenuController::showImageControlsMenu): Ditto. * page/ContextMenuController.h: Updated for the above. * page/DOMTimer.cpp: (WebCore::DOMTimer::fired): Pass a reference. * page/DOMWindow.cpp: (WebCore::PostMessageTimer::PostMessageTimer): Take Ref&& instead of PassRefPtr. (WebCore::DOMWindow::adjustWindowRect): Use a reference. (WebCore::DOMWindow::allowPopUp): Ditto. Also rewrite to use || instead of successive if statements. (WebCore::DOMWindow::canShowModalDialog): Ditto. (WebCore::DOMWindow::DOMWindow): Ditto. (WebCore::DOMWindow::didSecureTransitionTo): Ditto. (WebCore::DOMWindow::registerProperty): Ditto. (WebCore::DOMWindow::unregisterProperty): Ditto. (WebCore::DOMWindow::postMessageTimerFired): Merge with the function immediately followed, called only from here. (WebCore::DOMWindow::dispatchMessageEventWithOriginCheck): Deleted. (WebCore::DOMWindow::print): Pass a reference. (WebCore::DOMWindow::alert): Ditto. (WebCore::DOMWindow::confirm): Ditto. (WebCore::DOMWindow::prompt): Ditto. (WebCore::DOMWindow::setStatus): Ditto. (WebCore::DOMWindow::setDefaultStatus): Ditto. (WebCore::DOMWindow::moveBy): Ditto. (WebCore::DOMWindow::moveTo): Ditto. (WebCore::DOMWindow::resizeBy): Ditto. (WebCore::DOMWindow::resizeTo): Ditto. (WebCore::DOMWindow::clearTimeout): Ditto. (WebCore::DOMWindow::incrementScrollEventListenersCount): Ditto. (WebCore::DOMWindow::decrementScrollEventListenersCount): Ditto. (WebCore::DOMWindow::showModalDialog): Ditto. * page/DOMWindow.h: Updated for the above. ALso made functions private and final. * page/DOMWindowProperty.cpp: (WebCore::DOMWindowProperty::DOMWindowProperty): Pass a reference. (WebCore::DOMWindowProperty::~DOMWindowProperty): Ditto. (WebCore::DOMWindowProperty::willDestroyGlobalObjectInCachedFrame): Ditto. (WebCore::DOMWindowProperty::willDestroyGlobalObjectInFrame): Ditto. * page/DebugPageOverlays.cpp: (WebCore::RegionOverlay::create): Return RefPtr instead of PassRefPtr. (WebCore::RegionOverlay::~RegionOverlay): Pass a reference. (WebCore::DebugPageOverlays::showRegionOverlay): Ditto. (WebCore::DebugPageOverlays::hideRegionOverlay): Ditto. * page/DragController.cpp: (WebCore::DragController::dragExited): Pass a reference. (WebCore::DragController::performDragOperation): Ditto. (WebCore::DragController::concludeEditDrag): Ditto. (WebCore::DragController::tryDHTMLDrag): Ditto. * page/EventHandler.cpp: Replaced OptionalCursor with std::optional<Cursor>. (WebCore::EventHandler::updateCursor): Refactor into two functions so we can share more code with selectCursor. (WebCore::EventHandler::selectCursor): Updated to use std::optional. (WebCore::EventHandler::handleMouseMoveEvent): Use the new updateCursor. (WebCore::EventHandler::startPanScrolling): Use a reference. (WebCore::EventHandler::updateDragAndDrop): Ditto. (WebCore::EventHandler::cancelDragAndDrop): Ditto. (WebCore::EventHandler::performDragAndDrop): Ditto. (WebCore::EventHandler::setCapturingMouseEventsElement): Take a raw pointer instead of a PassRefPtr. (WebCore::EventHandler::dispatchMouseEvent): Use a reference. (WebCore::EventHandler::updateDragStateAfterEditDragIfNeeded): Ditto. (WebCore::EventHandler::isKeyboardOptionTab): Ditto. (WebCore::EventHandler::eventInvertsTabsToLinksClientCallResult): Ditto. (WebCore::EventHandler::tabsToLinks): Ditto. * page/EventHandler.h: Updated for the above. * page/FocusController.cpp: (WebCore::FocusController::setFocusedFrame): Take pointer instead of PassRefPtr. (WebCore::FocusController::setFocusedElement): Take reference instead of PassRefPtr. * page/FocusController.h: Updated for the above changes. * page/FrameTree.cpp: (WebCore::FrameTree::transferChild): Deleted. Unused function. (WebCore::FrameTree::appendChild): Merged with the following function since it's now only used here. Take reference instead of PassRefPtr. (WebCore::FrameTree::actuallyAppendChild): Deleted. (WebCore::FrameTree::removeChild): Take reference instead of pointer. Use move instead of trickier swap. * page/FrameTree.h: Updated for the above. * page/FrameView.cpp: (WebCore::FrameView::setContentsSize): Use a reference. * page/MainFrame.cpp: (WebCore::MainFrame::dropChildren): Ditto. * page/Page.cpp: (WebCore::Page::scrollingCoordinator): Ditto. * page/PageOverlay.cpp: (WebCore::PageOverlay::fadeAnimationTimerFired): Ditto. * page/PageOverlayController.cpp: (WebCore::PageOverlayController::installPageOverlay): Take reference instead of PassRefPtr. (WebCore::PageOverlayController::uninstallPageOverlay): Take reference intead of pointer. * page/PageOverlayController.h: Updated for the above. * page/PageSerializer.cpp: (WebCore::PageSerializer::PageSerializer): Moved most initialization to the class definition. (WebCore::PageSerializer::serialize): Use reference. (WebCore::PageSerializer::serializeFrame): Use initializer list instead of constructor for resource. (WebCore::PageSerializer::serializeCSSStyleSheet): Ditto. (WebCore::PageSerializer::addImageToResources): Ditto. * page/PageSerializer.h: Removed constructors from PageSerializer::Resource struct since structures don't really need them. Updated for the above. Changed SerializerMarkupAccumulator into a nested class. * page/PerformanceEntry.h: (WebCore::PerformanceEntry::startTimeCompareLessThan): Use const RefPtr& instead of PassRefPtr to compare RefPtr in place. * page/PerformanceUserTiming.cpp: (WebCore::insertPerformanceEntry): Take Ref&& instead of PassRefPtr. * page/ResourceUsageOverlay.cpp: (WebCore::ResourceUsageOverlay::~ResourceUsageOverlay): Use refrence. (WebCore::ResourceUsageOverlay::initialize): Ditto. * page/animation/AnimationBase.h: Removed unneeded include. * page/animation/AnimationController.cpp: (WebCore::AnimationControllerPrivate::clear): Use reference. (WebCore::AnimationControllerPrivate::fireEventsAndUpdateStyle): Ditto. (WebCore::AnimationControllerPrivate::addEventToDispatch): Use the append function instead of a hand-written alternative. (WebCore::AnimationControllerPrivate::addElementChangeToDispatch): Take a reference rather than a Ref&& since no caller is passing ownership. * page/animation/AnimationControllerPrivate.h: Updated for the above. * page/animation/CSSPropertyAnimation.cpp: (WebCore::blendFunc): Return RefPtr instead of PassRefPtr. (WebCore::blendFilter): Ditto. (WebCore::crossfadeBlend): Ditto. * page/animation/CompositeAnimation.cpp: (WebCore::CompositeAnimation::updateTransitions): Updated to use animationForProperty, which returns a raw pointer. (WebCore::CompositeAnimation::animationForProperty): Renamed from getAnimationForProperty and changed to return raw pointer instead of PassRefPtr. * page/animation/CompositeAnimation.h: Updated for the above. * page/animation/ImplicitAnimation.cpp: (WebCore::ImplicitAnimation::onAnimationEnd): Use animationForProperty. (WebCore::ImplicitAnimation::sendTransitionEvent): Pass reference. * page/animation/KeyframeAnimation.cpp: (WebCore::KeyframeAnimation::sendAnimationEvent): Ditto. * page/efl/EventHandlerEfl.cpp: (WebCore::EventHandler::tabsToAllFormControls): Take reference. (WebCore::EventHandler::createDraggingDataTransfer): Return Ref. * page/gtk/EventHandlerGtk.cpp: (WebCore::EventHandler::tabsToAllFormControls): Ditto. (WebCore::EventHandler::createDraggingDataTransfer): Ditto. * page/ios/EventHandlerIOS.mm: (WebCore::EventHandler::tabsToAllFormControls): Ditto. * page/mac/EventHandlerMac.mm: (WebCore::EventHandler::createDraggingDataTransfer): Ditto. (WebCore::EventHandler::tabsToAllFormControls): Ditto. (WebCore::EventHandler::platformPrepareForWheelEvents): Ditto. * page/mac/ServicesOverlayController.h: Take Ref&& for ranges instead of PassRefPtr. Use references. * page/mac/ServicesOverlayController.mm: (WebCore::ServicesOverlayController::Highlight::createForSelection): Ditto. (WebCore::ServicesOverlayController::Highlight::createForTelephoneNumber): Ditto. (WebCore::ServicesOverlayController::Highlight::Highlight): Ditto. (WebCore::ServicesOverlayController::buildPotentialHighlightsIfNeeded): Ditto. (WebCore::ServicesOverlayController::buildPhoneNumberHighlights): Ditto. (WebCore::ServicesOverlayController::buildSelectionHighlight): Ditto. (WebCore::ServicesOverlayController::highlightsAreEquivalent): Ditto. (WebCore::ServicesOverlayController::findTelephoneNumberHighlightContainingSelectionHighlight): Ditto. (WebCore::ServicesOverlayController::handleClick): Ditto. * page/mac/TextIndicatorWindow.mm: (-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]): Take a reference instead of PassRefPtr. (WebCore::TextIndicatorWindow::setTextIndicator): Updated for the above. * page/scrolling/AsyncScrollingCoordinator.h: Use Ref&& and RefPtr intead of PsasRefPtr. * page/scrolling/ScrollLatchingState.cpp: (WebCore::ScrollLatchingState::ScrollLatchingState): Initialize data members in class definition. (WebCore::ScrollLatchingState::setWheelEventElement): Use raw pointer instead of PassRefPtr. (WebCore::ScrollLatchingState::setPreviousWheelScrolledElement): Use raw pointer instead of RefPtr&&. (WebCore::ScrollLatchingState::setScrollableContainer): Use raw pointer instead of PassRefPtr. * page/scrolling/ScrollLatchingState.h: Updated for the above. * page/scrolling/ScrollingStateNode.cpp: (WebCore::ScrollingStateNode::cloneAndReset): Use Ref instead of PassRefPtr. (WebCore::ScrollingStateNode::appendChild): Use Ref&& instead of PassRefPtr. * page/scrolling/ScrollingStateNode.h: Updated for the above. * page/scrolling/ScrollingStateTree.cpp: (WebCore::ScrollingStateTree::createNode): Use Ref instead of PassRefPtr. (WebCore::ScrollingStateTree::attachNode): Updated for the abve. (WebCore::ScrollingStateTree::commit): Ditto. * page/scrolling/ScrollingStateTree.h: Ditto. * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::updateTreeFromStateNode): Use reference. * page/scrolling/ScrollingTree.h: Return Ref instead of PassRefPtr. * page/scrolling/ScrollingTreeNode.cpp: (WebCore::ScrollingTreeNode::appendChild): Take Ref&& instead of PassRefPtr. (WebCore::ScrollingTreeNode::removeChild): Take reference instead of pointer. * page/scrolling/ScrollingTreeNode.h: Updated for the above. * page/scrolling/ThreadedScrollingTree.cpp: (WebCore::ThreadedScrollingTree::ThreadedScrollingTree): Take reference instead of pointer. * page/scrolling/ThreadedScrollingTree.h: Updated for the above. * page/scrolling/ios/ScrollingCoordinatorIOS.mm: (WebCore::ScrollingCoordinatorIOS::ScrollingCoordinatorIOS): Pass reference. * page/scrolling/ios/ScrollingTreeIOS.cpp: (WebCore::ScrollingTreeIOS::create): Take a reference. (WebCore::ScrollingTreeIOS::ScrollingTreeIOS): Ditto. (WebCore::ScrollingTreeIOS::createScrollingTreeNode): Return Ref instead of PassRefPtr. * page/scrolling/ios/ScrollingTreeIOS.h: Updated for the above. * page/scrolling/mac/ScrollingCoordinatorMac.mm: (WebCore::ScrollingCoordinatorMac::ScrollingCoordinatorMac): Use reference. * page/scrolling/mac/ScrollingTreeMac.cpp: (ScrollingTreeMac::create): Take a reference. (ScrollingTreeMac::ScrollingTreeMac): Ditto. (ScrollingTreeMac::createScrollingTreeNode): Return a Ref instead of a PassRefPtr. * page/scrolling/mac/ScrollingTreeMac.h: Updated for the above. * page/win/EventHandlerWin.cpp: (WebCore::EventHandler::tabsToAllFormControls): Take reference. (WebCore::EventHandler::createDraggingDataTransfer): Return Ref. * platform/Cursor.h: Rearranged the header a bit. Got rid of the explicit copy constructor, assignment operator, and destructor. Using the ones that the compiler automatically generates will work for all platforms and we then also get move constructor and move assignment operator. * platform/efl/CursorEfl.cpp: (WebCore::Cursor::Cursor): Deleted. (WebCore::Cursor::~Cursor): Deleted. (WebCore::Cursor::operator=): Deleted. * platform/gtk/CursorGtk.cpp: (WebCore::Cursor::Cursor): Deleted. (WebCore::Cursor::operator=): Deleted. (WebCore::Cursor::~Cursor): Deleted. * platform/mac/CursorMac.mm: (WebCore::Cursor::Cursor): Deleted. (WebCore::Cursor::operator=): Deleted. (WebCore::Cursor::~Cursor): Deleted. * platform/win/CursorWin.cpp: (WebCore::SharedCursor::SharedCursor): Moved this here from the header since it is only used within this file. (WebCore::SharedCursor::create): Ditto. (WebCore::Cursor::Cursor): Deleted. (WebCore::Cursor::operator=): Deleted. (WebCore::Cursor::~Cursor): Deleted. * rendering/RenderEmbeddedObject.cpp: (WebCore::RenderEmbeddedObject::handleUnavailablePluginIndicatorEvent): Pass reference. * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::RenderLayerBacking): Get to FrameView through the render tree itself, rather than through the frame. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateLayerForHeader): Use reference. (WebCore::RenderLayerCompositor::updateLayerForFooter): Ditto. (WebCore::RenderLayerCompositor::attachRootLayer): Ditto. (WebCore::RenderLayerCompositor::detachRootLayer): Ditto. * rendering/RenderMenuList.cpp: (RenderMenuList::showPopup): Ditto. * rendering/RenderSearchField.cpp: (WebCore::RenderSearchField::addSearchResult): Ditto. (WebCore::RenderSearchField::showPopup): Ditto. (WebCore::RenderSearchField::valueChanged): Ditto. * svg/SVGAElement.cpp: (WebCore::SVGAElement::isKeyboardFocusable): Ditto. * testing/MockPageOverlayClient.cpp: (WebCore::MockPageOverlayClient::installOverlay): Ditto. (WebCore::MockPageOverlayClient::uninstallAllOverlays): Ditto. Source/WebKit/ios: * WebCoreSupport/WebChromeClientIOS.h: Update for changes to ChromeClient. * WebCoreSupport/WebChromeClientIOS.mm: (WebChromeClientIOS::runJavaScriptAlert): Ditto. (WebChromeClientIOS::runJavaScriptConfirm): Ditto. (WebChromeClientIOS::runJavaScriptPrompt): Ditto. (WebChromeClientIOS::setNeedsScrollNotifications): Ditto. (WebChromeClientIOS::observedContentChange): Ditto. (WebChromeClientIOS::clearContentChangeObservers): Ditto. (WebChromeClientIOS::notifyRevealedSelectionByScrollingFrame): Ditto. (WebChromeClientIOS::elementDidFocus): Ditto. (WebChromeClientIOS::elementDidBlur): Ditto. (WebChromeClientIOS::createPopupMenu): Ditto. (WebChromeClientIOS::createSearchPopupMenu): Ditto. (WebChromeClientIOS::attachRootGraphicsLayer): Ditto. Source/WebKit/mac: * WebCoreSupport/WebApplicationCacheQuotaManager.mm: (-[WebApplicationCacheQuotaManager quota]): Pass reference. * WebCoreSupport/WebChromeClient.h: Updated for changes to ChromeClient. * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::focusedElementChanged): Ditto. (WebChromeClient::createWindow): Ditto. (WebChromeClient::runBeforeUnloadConfirmPanel): Ditto. (WebChromeClient::runJavaScriptAlert): Ditto. (WebChromeClient::runJavaScriptConfirm): Ditto. (WebChromeClient::runJavaScriptPrompt): Ditto. (WebChromeClient::contentsSizeChanged): Ditto. (WebChromeClient::unavailablePluginButtonClicked): Ditto. (WebChromeClient::print): Ditto. (WebChromeClient::exceededDatabaseQuota): Ditto. (WebChromeClient::reachedApplicationCacheOriginQuota): Ditto. (WebChromeClient::createColorChooser): Ditto. (WebChromeClient::elementDidFocus): Ditto. (WebChromeClient::elementDidBlur): Ditto. (WebChromeClient::createPopupMenu): Ditto. (WebChromeClient::createSearchPopupMenu): Ditto. (WebChromeClient::attachRootGraphicsLayer): Ditto. (WebChromeClient::attachViewOverlayGraphicsLayer): Ditto. (WebChromeClient::supportsFullScreenForElement): Ditto. (WebChromeClient::enterFullScreenForElement): Ditto. (WebChromeClient::exitFullScreenForElement): Ditto. * WebView/WebFrame.mm: (+[WebFrame _createFrameWithPage:frameName:frameView:ownerElement:]): Updated for change to the appendChild function. Source/WebKit/win: * Plugins/PluginView.cpp: (WebCore::PluginView::status): Pass reference. (WebCore::PluginView::focusPluginElement): Ditto. * WebCoreSupport/WebChromeClient.cpp: (WebChromeClient::createWindow): Updated for change to ChromeClient. (WebChromeClient::runBeforeUnloadConfirmPanel): Ditto. (WebChromeClient::runJavaScriptAlert): Ditto. (WebChromeClient::runJavaScriptConfirm): Ditto. (WebChromeClient::runJavaScriptPrompt): Ditto. (WebChromeClient::contentsSizeChanged): Ditto. (WebChromeClient::unavailablePluginButtonClicked): Ditto. (WebChromeClient::print): Ditto. (WebChromeClient::exceededDatabaseQuota): Ditto. (WebChromeClient::reachedApplicationCacheOriginQuota): Ditto. (WebChromeClient::attachRootGraphicsLayer): Ditto. (WebChromeClient::attachViewOverlayGraphicsLayer): Ditto. (WebChromeClient::enterVideoFullscreenForVideoElement): Ditto. (WebChromeClient::createPopupMenu): Ditto. (WebChromeClient::createSearchPopupMenu): Ditto. (WebChromeClient::supportsFullScreenForElement): Ditto. (WebChromeClient::enterFullScreenForElement): Ditto. (WebChromeClient::exitFullScreenForElement): Ditto. (WebChromeClient::shouldUseTiledBackingForFrameView): Ditto. * WebCoreSupport/WebChromeClient.h: Ditto. Source/WebKit2: * UIProcess/Scrolling/RemoteScrollingTree.cpp: (WebKit::RemoteScrollingTree::createScrollingTreeNode): Return a Ref instead of PassRefPtr. * UIProcess/Scrolling/RemoteScrollingTree.h: Updated for the above. * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKBundlePageInstallPageOverlay): Pass a reference. (WKBundlePageUninstallPageOverlay): Ditto. (WKBundlePageInstallPageOverlayWithAnimation): Ditto. (WKBundlePageUninstallPageOverlayWithAnimation): Ditto. * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm: (WebKit::PDFPlugin::jsPDFDocPrint): Ditto. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::focusPluginElement): Ditto. (WebKit::PluginView::setStatusbarText): Ditto. * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::elementDidFocus): Updated for changes to ChromeClient. (WebKit::WebChromeClient::elementDidBlur): Ditto. (WebKit::WebChromeClient::makeFirstResponder): Ditto. (WebKit::WebChromeClient::createWindow): Ditto. (WebKit::WebChromeClient::runBeforeUnloadConfirmPanel): Ditto. (WebKit::WebChromeClient::runJavaScriptAlert): Ditto. (WebKit::WebChromeClient::runJavaScriptConfirm): Ditto. (WebKit::WebChromeClient::runJavaScriptPrompt): Ditto. (WebKit::WebChromeClient::contentsSizeChanged): Ditto. (WebKit::WebChromeClient::unavailablePluginButtonClicked): Ditto. (WebKit::WebChromeClient::print): Ditto. (WebKit::WebChromeClient::exceededDatabaseQuota): Ditto. (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota): Ditto. (WebKit::WebChromeClient::createColorChooser): Ditto. (WebKit::WebChromeClient::createPopupMenu): Ditto. (WebKit::WebChromeClient::createSearchPopupMenu): Ditto. (WebKit::WebChromeClient::attachRootGraphicsLayer): Ditto. (WebKit::WebChromeClient::attachViewOverlayGraphicsLayer): Ditto. (WebKit::WebChromeClient::createScrollingCoordinator): Ditto. (WebKit::WebChromeClient::supportsFullScreenForElement): Ditto. (WebKit::WebChromeClient::enterFullScreenForElement): Ditto. (WebKit::WebChromeClient::exitFullScreenForElement): Ditto. (WebKit::WebChromeClient::didAddHeaderLayer): Ditto. (WebKit::WebChromeClient::didAddFooterLayer): Ditto. (WebKit::WebChromeClient::shouldUseTiledBackingForFrameView): Ditto. * WebProcess/WebCoreSupport/WebChromeClient.h: Ditto. * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm: (WebKit::WebChromeClient::elementDidRefocus): Ditto. (WebKit::WebChromeClient::didReceiveMobileDocType): Ditto. (WebKit::WebChromeClient::observedContentChange): Ditto. (WebKit::WebChromeClient::clearContentChangeObservers): Ditto. (WebKit::WebChromeClient::notifyRevealedSelectionByScrollingFrame): Ditto. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchCreatePage): Pass reference. * WebProcess/WebCoreSupport/WebInspectorClient.cpp: (WebKit::WebInspectorClient::~WebInspectorClient): Ditto. (WebKit::WebInspectorClient::hideHighlight): Ditto. (WebKit::WebInspectorClient::showPaintRect): Ditto. * WebProcess/WebPage/FindController.cpp: (WebKit::FindController::updateFindUIAfterPageScroll): Ditto. (WebKit::FindController::hideFindUI): Ditto. * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::createWithCoreMainFrame): Return Ref instead of PassRefPtr. (WebKit::WebFrame::createSubframe): Ditto. (WebKit::WebFrame::create): Ditto. * WebProcess/WebPage/WebFrame.h: Updated for the above. * WebProcess/WebPage/WebInspector.cpp: (WebKit::WebInspector::openInNewTab): Pass reference. * WebProcess/WebPage/ios/FindControllerIOS.mm: (WebKit::FindController::updateFindIndicator): Use reference. (WebKit::FindController::hideFindIndicator): Ditto. Canonical link: https://commits.webkit.org/184345@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211033 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-23 06:24:18 +00:00
overlayController->uninstallPageOverlay(*mockOverlay->overlay(), PageOverlay::FadeMode::DoNotFade);
Make it possible to test page overlays https://bugs.webkit.org/show_bug.cgi?id=137339 Reviewed by Dan Bernstein. Tests: pageoverlay/overlay-installation.html pageoverlay/overlay-large-document-scrolled.html pageoverlay/overlay-large-document.html Do some initial work to make page overlays testable. There are many more tests to be written, but this lays the groundwork. * WebCore.exp.in: * WebCore.xcodeproj/project.pbxproj: * WebCore.vcxproj/WebCoreTestSupport.vcxproj: * WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters: * CMakeLists.txt: Add MockPageOverlayClient. * platform/graphics/GraphicsLayer.h: * page/PageOverlayController.h: * page/PageOverlayController.cpp: (WebCore::PageOverlayController::shouldSkipLayerInDump): Don't skip PageOverlayController-owned layers in the layer tree dump if the layerTreeAsText behavior says that we should include them. * platform/graphics/GraphicsLayer.cpp: (WebCore::dumpChildren): * platform/graphics/GraphicsLayerClient.h: (WebCore::GraphicsLayerClient::shouldSkipLayerInDump): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::shouldSkipLayerInDump): * rendering/RenderLayerBacking.h: Pass the LayerTreeAsTextBehavior through shouldSkipLayerInDump. * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): Uninstall all page overlays when resetting to a consistent state. (WebCore::Internals::installMockPageOverlay): (WebCore::Internals::pageOverlayLayerTreeAsText): Expose two new internals functions. installMockPageOverlay takes "view" or "document", allowing script to choose the appropriate overlay type. pageOverlayLayerTreeAsText dumps both view and document-relative overlays, from each overlay container layer. * testing/Internals.h: * testing/Internals.idl: Fix some typos. * testing/MockPageOverlayClient.cpp: Added. (WebCore::MockPageOverlayClient::shared): (WebCore::MockPageOverlayClient::MockPageOverlayClient): (WebCore::MockPageOverlayClient::installOverlay): (WebCore::MockPageOverlayClient::uninstallAllOverlays): (WebCore::MockPageOverlayClient::layerTreeAsText): (WebCore::MockPageOverlayClient::pageOverlayDestroyed): (WebCore::MockPageOverlayClient::willMoveToPage): (WebCore::MockPageOverlayClient::didMoveToPage): When the overlay is parented, mark it as needing repaint. Future tests might want to test overlays without content, but for now this is a reasonable default behavior. (WebCore::MockPageOverlayClient::drawRect): Paint the overlay rects as described in the LayoutTests ChangeLog. (WebCore::MockPageOverlayClient::mouseEvent): (WebCore::MockPageOverlayClient::didScrollFrame): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeStringValueForPoint): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeBoolValueForPoint): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeNames): * testing/MockPageOverlayClient.h: Added. * pageoverlay/overlay-installation.html: Added. Add a test which just installs one view-relative and one document-relative overlay, and dumps the layer tree and pixel results. The mock overlay strokes a blue rectangle (inset a little from the overlay bounds) for view-relative overlays, and a green rectangle (inset a bit more) for document-relative overlays. * pageoverlay/overlay-large-document.html: Added. * pageoverlay/overlay-large-document-scrolled.html: Added. Tests that do the same as the -installation test, but with a larger document; the view-relative overlay should be the same size (or slightly smaller, because we have scrollbars now), but the document-relative overlay should be the size of the document. The second test scrolls to maxX, maxY, and the document-relative overlay should scroll along with it, while the view-relative overlay should remain fixed. * pageoverlay/overlay-installation-expected.txt: Added. * pageoverlay/overlay-large-document-expected.txt: Added. * pageoverlay/overlay-large-document-scrolled-expected.txt: Added. "Normal" layer tree expectations. * platform/mac-wk1/pageoverlay/overlay-installation-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-installation-expected.txt: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-expected.txt: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-scrolled-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-scrolled-expected.txt: Added. Expected results for WebKit1 differ for view-relative overlays, because we don't currently hook up view-relative overlays for WebKit1. * platform/mac/pageoverlay/overlay-installation-expected.png: Added. * platform/mac/pageoverlay/overlay-large-document-expected.png: Added. * platform/mac/pageoverlay/overlay-large-document-scrolled-expected.png: Added. "Normal" pixel dump expectations. Canonical link: https://commits.webkit.org/155229@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-04 08:47:04 +00:00
}
}
Remove duplicate LayerTreeAsText enums and use an OptionSet<> https://bugs.webkit.org/show_bug.cgi?id=229226 Reviewed by Antti Koivisto. GraphicsLayerClient had enum LayerTreeAsTextBehaviorFlags and Frame had an anonymous enum and typedef unsigned LayerTreeFlags. Clean up by adding LayerTreeAsTextOptions.h and using OptionSet<LayerTreeAsTextOptions> everywhere. * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: * page/Frame.h: * page/PageOverlayController.cpp: (WebCore::PageOverlayController::shouldSkipLayerInDump const): * page/PageOverlayController.h: * platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::dumpLayer const): (WebCore::dumpChildren): (WebCore::GraphicsLayer::dumpProperties const): (WebCore::GraphicsLayer::layerTreeAsText const): (showGraphicsLayerTree): * platform/graphics/GraphicsLayer.h: (WebCore::GraphicsLayer::dumpLayer): (WebCore::GraphicsLayer::layerTreeAsText): (WebCore::GraphicsLayer::dumpAdditionalProperties const): * platform/graphics/GraphicsLayerClient.h: (WebCore::GraphicsLayerClient::shouldSkipLayerInDump const): (WebCore::GraphicsLayerClient::shouldDumpPropertyForLayer const): * platform/graphics/LayerTreeAsTextOptions.h: Added. * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::dumpAdditionalProperties const): * platform/graphics/ca/GraphicsLayerCA.h: * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: (WebCore::dumpInnerLayer): (WebCore::CoordinatedGraphicsLayer::dumpAdditionalProperties const): * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h: * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::shouldSkipLayerInDump const): (WebCore::RenderLayerBacking::shouldDumpPropertyForLayer const): * rendering/RenderLayerBacking.h: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::layerTreeAsText): * rendering/RenderLayerCompositor.h: * testing/Internals.cpp: (WebCore::toLayerTreeAsTextOptions): (WebCore::Internals::layerTreeAsText const): (WebCore::Internals::pageOverlayLayerTreeAsText const): (WebCore::toLayerTreeFlags): Deleted. * testing/MockPageOverlayClient.cpp: (WebCore::MockPageOverlayClient::layerTreeAsText): * testing/MockPageOverlayClient.h: Canonical link: https://commits.webkit.org/240675@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281238 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-08-19 15:47:35 +00:00
String MockPageOverlayClient::layerTreeAsText(Page& page, OptionSet<LayerTreeAsTextOptions> options)
Make it possible to test page overlays https://bugs.webkit.org/show_bug.cgi?id=137339 Reviewed by Dan Bernstein. Tests: pageoverlay/overlay-installation.html pageoverlay/overlay-large-document-scrolled.html pageoverlay/overlay-large-document.html Do some initial work to make page overlays testable. There are many more tests to be written, but this lays the groundwork. * WebCore.exp.in: * WebCore.xcodeproj/project.pbxproj: * WebCore.vcxproj/WebCoreTestSupport.vcxproj: * WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters: * CMakeLists.txt: Add MockPageOverlayClient. * platform/graphics/GraphicsLayer.h: * page/PageOverlayController.h: * page/PageOverlayController.cpp: (WebCore::PageOverlayController::shouldSkipLayerInDump): Don't skip PageOverlayController-owned layers in the layer tree dump if the layerTreeAsText behavior says that we should include them. * platform/graphics/GraphicsLayer.cpp: (WebCore::dumpChildren): * platform/graphics/GraphicsLayerClient.h: (WebCore::GraphicsLayerClient::shouldSkipLayerInDump): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::shouldSkipLayerInDump): * rendering/RenderLayerBacking.h: Pass the LayerTreeAsTextBehavior through shouldSkipLayerInDump. * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): Uninstall all page overlays when resetting to a consistent state. (WebCore::Internals::installMockPageOverlay): (WebCore::Internals::pageOverlayLayerTreeAsText): Expose two new internals functions. installMockPageOverlay takes "view" or "document", allowing script to choose the appropriate overlay type. pageOverlayLayerTreeAsText dumps both view and document-relative overlays, from each overlay container layer. * testing/Internals.h: * testing/Internals.idl: Fix some typos. * testing/MockPageOverlayClient.cpp: Added. (WebCore::MockPageOverlayClient::shared): (WebCore::MockPageOverlayClient::MockPageOverlayClient): (WebCore::MockPageOverlayClient::installOverlay): (WebCore::MockPageOverlayClient::uninstallAllOverlays): (WebCore::MockPageOverlayClient::layerTreeAsText): (WebCore::MockPageOverlayClient::pageOverlayDestroyed): (WebCore::MockPageOverlayClient::willMoveToPage): (WebCore::MockPageOverlayClient::didMoveToPage): When the overlay is parented, mark it as needing repaint. Future tests might want to test overlays without content, but for now this is a reasonable default behavior. (WebCore::MockPageOverlayClient::drawRect): Paint the overlay rects as described in the LayoutTests ChangeLog. (WebCore::MockPageOverlayClient::mouseEvent): (WebCore::MockPageOverlayClient::didScrollFrame): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeStringValueForPoint): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeBoolValueForPoint): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeNames): * testing/MockPageOverlayClient.h: Added. * pageoverlay/overlay-installation.html: Added. Add a test which just installs one view-relative and one document-relative overlay, and dumps the layer tree and pixel results. The mock overlay strokes a blue rectangle (inset a little from the overlay bounds) for view-relative overlays, and a green rectangle (inset a bit more) for document-relative overlays. * pageoverlay/overlay-large-document.html: Added. * pageoverlay/overlay-large-document-scrolled.html: Added. Tests that do the same as the -installation test, but with a larger document; the view-relative overlay should be the same size (or slightly smaller, because we have scrollbars now), but the document-relative overlay should be the size of the document. The second test scrolls to maxX, maxY, and the document-relative overlay should scroll along with it, while the view-relative overlay should remain fixed. * pageoverlay/overlay-installation-expected.txt: Added. * pageoverlay/overlay-large-document-expected.txt: Added. * pageoverlay/overlay-large-document-scrolled-expected.txt: Added. "Normal" layer tree expectations. * platform/mac-wk1/pageoverlay/overlay-installation-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-installation-expected.txt: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-expected.txt: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-scrolled-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-scrolled-expected.txt: Added. Expected results for WebKit1 differ for view-relative overlays, because we don't currently hook up view-relative overlays for WebKit1. * platform/mac/pageoverlay/overlay-installation-expected.png: Added. * platform/mac/pageoverlay/overlay-large-document-expected.png: Added. * platform/mac/pageoverlay/overlay-large-document-scrolled-expected.png: Added. "Normal" pixel dump expectations. Canonical link: https://commits.webkit.org/155229@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-04 08:47:04 +00:00
{
Drop MainFrame class https://bugs.webkit.org/show_bug.cgi?id=184191 Reviewed by Darin Adler. Source/WebCore: Drop MainFrame class and move contents into Page / Frame since there is a 1:1 relationship between the Page and the MainFrame. This is ground work for introducing LocalFrame / RemoteFrame concepts. * Modules/applepay/ApplePaySession.cpp: (WebCore::ApplePaySession::create): (WebCore::ApplePaySession::supportsVersion): (WebCore::ApplePaySession::canMakePayments): (WebCore::ApplePaySession::canMakePaymentsWithActiveCard): (WebCore::ApplePaySession::openPaymentSetup): (WebCore::ApplePaySession::paymentCoordinator const): * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp: (WebCore::paymentCoordinator): * Modules/mediastream/MediaDevicesEnumerationRequest.cpp: * Modules/mediastream/UserMediaRequest.cpp: * Modules/plugins/QuickTimePluginReplacement.mm: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::mainFrame const): (WebCore::AccessibilityObject::visiblePositionForBounds const): * accessibility/AccessibilityObject.h: * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: * bindings/js/ScriptController.cpp: * bindings/js/ScriptState.cpp: * contentextensions/ContentExtensionsBackend.cpp: * css/MediaQueryEvaluator.cpp: (WebCore::displayModeEvaluate): * dom/DOMImplementation.cpp: * dom/Document.cpp: * dom/DocumentMarkerController.cpp: * dom/Element.cpp: (WebCore::Element::removedFromAncestor): * dom/EventDispatcher.cpp: * dom/ScriptedAnimationController.cpp: * editing/Editor.cpp: (WebCore::Editor::scanSelectionForTelephoneNumbers): * editing/EditorCommand.cpp: * editing/SelectionRectGatherer.cpp: (WebCore::SelectionRectGatherer::Notifier::~Notifier): * editing/cocoa/WebContentReaderCocoa.mm: * editing/markup.cpp: * history/CachedFrame.cpp: * history/CachedPage.cpp: * history/PageCache.cpp: (WebCore::destroyRenderTree): * html/HTMLMediaElement.cpp: * html/HTMLPlugInImageElement.cpp: * html/ImageDocument.cpp: * html/MediaElementSession.cpp: (WebCore::isMainContentForPurposesOfAutoplay): * html/canvas/WebGLRenderingContextBase.cpp: * inspector/InspectorClient.cpp: * inspector/InspectorController.cpp: * inspector/InspectorFrontendClientLocal.cpp: * inspector/InspectorFrontendHost.cpp: * inspector/InspectorInstrumentation.cpp: * inspector/InspectorOverlay.cpp: * inspector/PageScriptDebugServer.cpp: * inspector/agents/InspectorApplicationCacheAgent.cpp: * inspector/agents/InspectorCanvasAgent.cpp: * inspector/agents/InspectorDOMAgent.cpp: * inspector/agents/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::mainFrame): * inspector/agents/InspectorPageAgent.h: * inspector/agents/page/PageDebuggerAgent.cpp: * inspector/agents/page/PageRuntimeAgent.cpp: * loader/DocumentLoader.cpp: * loader/DocumentWriter.cpp: * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadWithDocumentLoader): (WebCore::FrameLoader::setState): * loader/HistoryController.cpp: * loader/NavigationDisabler.h: * loader/ProgressTracker.cpp: * loader/ResourceLoadObserver.cpp: * loader/ResourceLoader.cpp: * loader/SubframeLoader.cpp: * loader/SubresourceLoader.cpp: * loader/appcache/ApplicationCacheHost.cpp: * loader/archive/mhtml/MHTMLArchive.cpp: * loader/cache/CachedResource.cpp: * loader/cache/CachedResourceLoader.cpp: * page/AutoscrollController.cpp: * page/Chrome.cpp: * page/ContextMenuController.cpp: * page/DOMWindow.cpp: * page/DebugPageOverlays.cpp: (WebCore::MouseWheelRegionOverlay::updateRegion): (WebCore::NonFastScrollableRegionOverlay::updateRegion): (WebCore::RegionOverlay::create): (WebCore::RegionOverlay::RegionOverlay): (WebCore::RegionOverlay::~RegionOverlay): (WebCore::DebugPageOverlays::ensureRegionOverlayForPage): (WebCore::DebugPageOverlays::showRegionOverlay): (WebCore::DebugPageOverlays::hideRegionOverlay): (WebCore::DebugPageOverlays::regionChanged): (WebCore::DebugPageOverlays::regionOverlayForPage const): (WebCore::DebugPageOverlays::updateOverlayRegionVisibility): (WebCore::DebugPageOverlays::settingsChanged): * page/DebugPageOverlays.h: (WebCore::DebugPageOverlays::hasOverlaysForPage const): (WebCore::DebugPageOverlays::hasOverlays): (WebCore::DebugPageOverlays::didLayout): (WebCore::DebugPageOverlays::didChangeEventHandlers): * page/DragController.cpp: (WebCore::DragController::performDragOperation): (WebCore::DragController::tryDHTMLDrag): (WebCore::DragController::beginDrag): (WebCore::DragController::doSystemDrag): * page/EventHandler.cpp: (WebCore::EventHandler::handleMousePressEvent): (WebCore::EventHandler::mouseMoved): (WebCore::EventHandler::handleMouseReleaseEvent): (WebCore::EventHandler::handleWheelEvent): (WebCore::EventHandler::clearLatchedState): (WebCore::EventHandler::defaultWheelEventHandler): * page/FocusController.cpp: * page/Frame.cpp: (WebCore::Frame::Frame): (WebCore::Frame::dropChildren): (WebCore::Frame::selfOnlyRef): (WebCore::Frame::selfOnlyDeref): * page/Frame.h: (WebCore::Frame::mainFrame const): * page/FrameTree.cpp: * page/FrameView.cpp: (WebCore::FrameView::setFrameRect): (WebCore::FrameView::setContentsSize): (WebCore::FrameView::didChangeScrollOffset): (WebCore::FrameView::setViewExposedRect): * page/History.cpp: * page/MainFrame.cpp: Removed. * page/MainFrame.h: Removed. * page/MemoryRelease.cpp: * page/Page.cpp: (WebCore::Page::Page): (WebCore::m_applicationManifest): (WebCore::Page::setDeviceScaleFactor): (WebCore::Page::latchingState): (WebCore::Page::pushNewLatchingState): (WebCore::Page::resetLatchingState): (WebCore::Page::popLatchingState): (WebCore::Page::removeLatchingStateForTarget): (WebCore::Page::setPaymentCoordinator): * page/Page.h: (WebCore::Page::mainFrame): (WebCore::Page::mainFrame const): (WebCore::Page::wheelEventDeltaFilter): (WebCore::Page::pageOverlayController): (WebCore::Page::servicesOverlayController): (WebCore::Page::paymentCoordinator const): (WebCore::Page::applicationManifest const): (WebCore::Page::performanceLogging const): * page/PageConsoleClient.cpp: * page/PageDebuggable.cpp: * page/PageGroup.cpp: * page/PageGroupLoadDeferrer.cpp: * page/PageOverlay.cpp: (WebCore::PageOverlay::controller const): * page/PageOverlayController.cpp: (WebCore::PageOverlayController::PageOverlayController): (WebCore::PageOverlayController::createRootLayersIfNeeded): (WebCore::PageOverlayController::layerWithDocumentOverlays): (WebCore::PageOverlayController::layerWithViewOverlays): (WebCore::PageOverlayController::installPageOverlay): (WebCore::PageOverlayController::updateForceSynchronousScrollLayerPositionUpdates): (WebCore::PageOverlayController::didChangeViewExposedRect): (WebCore::PageOverlayController::updateSettingsForLayer): (WebCore::PageOverlayController::deviceScaleFactor const): (WebCore::PageOverlayController::notifyFlushRequired): (WebCore::PageOverlayController::tiledBackingUsageChanged): * page/PageOverlayController.h: * page/PageSerializer.cpp: * page/PerformanceLogging.cpp: (WebCore::PerformanceLogging::PerformanceLogging): (WebCore::PerformanceLogging::didReachPointOfInterest): * page/PerformanceLogging.h: * page/PerformanceMonitor.cpp: * page/ResourceUsageOverlay.cpp: (WebCore::ResourceUsageOverlay::~ResourceUsageOverlay): (WebCore::ResourceUsageOverlay::initialize): * page/SettingsBase.cpp: * page/SpatialNavigation.cpp: * page/UserContentProvider.cpp: * page/ios/FrameIOS.mm: * page/mac/DragControllerMac.mm: * page/mac/EventHandlerMac.mm: (WebCore::latchingIsLockedToPlatformFrame): (WebCore::latchingIsLockedToAncestorOfThisFrame): (WebCore::EventHandler::clearOrScheduleClearingLatchedStateIfNeeded): (WebCore::EventHandler::platformPrepareForWheelEvents): (WebCore::EventHandler::platformRecordWheelEvent): (WebCore::EventHandler::platformCompleteWheelEvent): (WebCore::EventHandler::platformCompletePlatformWidgetWheelEvent): * page/mac/PageMac.mm: * page/mac/ServicesOverlayController.h: (WebCore::ServicesOverlayController::page const): * page/mac/ServicesOverlayController.mm: (WebCore::ServicesOverlayController::Highlight::Highlight): (WebCore::ServicesOverlayController::Highlight::notifyFlushRequired): (WebCore::ServicesOverlayController::Highlight::deviceScaleFactor const): (WebCore::ServicesOverlayController::ServicesOverlayController): (WebCore::ServicesOverlayController::invalidateHighlightsOfType): (WebCore::ServicesOverlayController::buildPotentialHighlightsIfNeeded): (WebCore::ServicesOverlayController::remainingTimeUntilHighlightShouldBeShown const): (WebCore::ServicesOverlayController::buildPhoneNumberHighlights): (WebCore::ServicesOverlayController::buildSelectionHighlight): (WebCore::ServicesOverlayController::hasRelevantSelectionServices): (WebCore::ServicesOverlayController::createOverlayIfNeeded): (WebCore::ServicesOverlayController::telephoneNumberRangesForFocusedFrame): (WebCore::ServicesOverlayController::findTelephoneNumberHighlightContainingSelectionHighlight): (WebCore::ServicesOverlayController::mouseEvent): (WebCore::ServicesOverlayController::handleClick): (WebCore::ServicesOverlayController::mainFrame const): * page/scrolling/AsyncScrollingCoordinator.cpp: * page/scrolling/ScrollingCoordinator.cpp: * page/scrolling/ios/ScrollingCoordinatorIOS.mm: * page/scrolling/mac/ScrollingCoordinatorMac.mm: * platform/graphics/ca/win/CACFLayerTreeHost.cpp: * plugins/DOMMimeType.cpp: * plugins/PluginInfoProvider.cpp: (WebCore::PluginInfoProvider::refresh): * rendering/RenderBox.cpp: * rendering/RenderLayer.cpp: * rendering/RenderLayerBacking.cpp: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers const): (WebCore::RenderLayerCompositor::updateCompositingLayers): (WebCore::RenderLayerCompositor::appendDocumentOverlayLayers): (WebCore::RenderLayerCompositor::attachRootLayer): (WebCore::RenderLayerCompositor::detachRootLayer): (WebCore::RenderLayerCompositor::rootLayerAttachmentChanged): * rendering/RenderObject.cpp: * replay/UserInputBridge.cpp: * storage/StorageEventDispatcher.cpp: * style/StyleTreeResolver.cpp: (WebCore::Style::suspendMemoryCacheClientCalls): * svg/SVGSVGElement.cpp: * svg/graphics/SVGImage.cpp: * testing/InternalSettings.cpp: * testing/Internals.cpp: (WebCore::Internals::Internals): (WebCore::Internals::installMockPageOverlay): (WebCore::Internals::pageOverlayLayerTreeAsText const): * testing/MockPageOverlay.cpp: * testing/MockPageOverlay.h: * testing/MockPageOverlayClient.cpp: (WebCore::MockPageOverlayClient::installOverlay): (WebCore::MockPageOverlayClient::layerTreeAsText): * testing/MockPageOverlayClient.h: * testing/MockPaymentCoordinator.cpp: (WebCore::MockPaymentCoordinator::MockPaymentCoordinator): (WebCore::MockPaymentCoordinator::showPaymentUI): (WebCore::MockPaymentCoordinator::completeMerchantValidation): (WebCore::MockPaymentCoordinator::changeShippingOption): (WebCore::MockPaymentCoordinator::changePaymentMethod): (WebCore::MockPaymentCoordinator::acceptPayment): (WebCore::MockPaymentCoordinator::cancelPayment): * testing/MockPaymentCoordinator.h: * workers/service/context/ServiceWorkerThreadProxy.cpp: Source/WebKit: Drop MainFrame class and move contents into Page / Frame since there is a 1:1 relationship between the Page and the MainFrame. This is ground work for introducing LocalFrame / RemoteFrame concepts. * Shared/WebRenderLayer.cpp: * Shared/WebRenderObject.cpp: * WebProcess/ApplePay/WebPaymentCoordinator.cpp: (WebKit::WebPaymentCoordinator::paymentCoordinator): * WebProcess/Automation/WebAutomationSessionProxy.cpp: * WebProcess/FullScreen/WebFullScreenManager.cpp: * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKBundlePageInstallPageOverlay): (WKBundlePageUninstallPageOverlay): (WKBundlePageInstallPageOverlayWithAnimation): (WKBundlePageUninstallPageOverlayWithAnimation): * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp: * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: * WebProcess/InjectedBundle/InjectedBundle.cpp: * WebProcess/Plugins/PDF/PDFPlugin.mm: * WebProcess/Plugins/PluginView.cpp: * WebProcess/Plugins/WebPluginInfoProvider.cpp: * WebProcess/WebCoreSupport/WebChromeClient.cpp: * WebProcess/WebCoreSupport/WebContextMenuClient.cpp: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: * WebProcess/WebCoreSupport/WebInspectorClient.cpp: (WebKit::WebInspectorClient::~WebInspectorClient): (WebKit::WebInspectorClient::highlight): (WebKit::WebInspectorClient::hideHighlight): (WebKit::WebInspectorClient::showPaintRect): * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: * WebProcess/WebCoreSupport/WebProgressTrackerClient.cpp: * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm: * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: * WebProcess/WebPage/AcceleratedDrawingArea.cpp: * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp: * WebProcess/WebPage/FindController.cpp: (WebKit::FindController::updateFindUIAfterPageScroll): (WebKit::FindController::hideFindUI): * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm: * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::updatePreferences): * WebProcess/WebPage/WKAccessibilityWebPageObjectIOS.mm: * WebProcess/WebPage/WebBackForwardListProxy.cpp: * WebProcess/WebPage/WebFrame.cpp: * WebProcess/WebPage/WebInspector.cpp: * WebProcess/WebPage/WebInspectorFrontendAPIDispatcher.cpp: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::mainFrame const): (WebKit::WebPage::determinePrimarySnapshottedPlugIn): (WebKit::WebPage::plugInIntersectsSearchRect): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/atk/WebPageAccessibilityObjectAtk.cpp: * WebProcess/WebPage/ios/FindControllerIOS.mm: * WebProcess/WebPage/ios/WebPageIOS.mm: * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::updatePreferences): * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm: * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm: (-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]): (-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performImmediateActionHitTestAtLocation): (WebKit::WebPage::dataDetectorsDidPresentUI): (WebKit::WebPage::dataDetectorsDidChangeUI): (WebKit::WebPage::dataDetectorsDidHideUI): * WebProcess/WebProcess.cpp: * WebProcess/WebStorage/StorageAreaMap.cpp: Source/WebKitLegacy/mac: Drop MainFrame class and move contents into Page / Frame since there is a 1:1 relationship between the Page and the MainFrame. This is ground work for introducing LocalFrame / RemoteFrame concepts. * WebCoreSupport/WebDragClient.mm: * WebCoreSupport/WebFrameLoaderClient.mm: * WebCoreSupport/WebInspectorClient.mm: * WebCoreSupport/WebPlatformStrategies.mm: * WebCoreSupport/WebPluginInfoProvider.mm: * WebView/WebFrame.mm: * WebView/WebFrameView.mm: * WebView/WebHTMLView.mm: * WebView/WebView.mm: Source/WebKitLegacy/win: Drop MainFrame class and move contents into Page / Frame since there is a 1:1 relationship between the Page and the MainFrame. This is ground work for introducing LocalFrame / RemoteFrame concepts. * WebCoreSupport/AcceleratedCompositingContext.cpp: * WebCoreSupport/WebContextMenuClient.cpp: * WebCoreSupport/WebDragClient.cpp: * WebDropSource.cpp: * WebFrame.cpp: * WebView.cpp: Tools: * TestWebKitAPI/Tests/WebCore/cocoa/WebCoreNSURLSession.mm: Canonical link: https://commits.webkit.org/199818@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230211 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-03 18:01:41 +00:00
GraphicsLayer* viewOverlayRoot = page.pageOverlayController().viewOverlayRootLayer();
GraphicsLayer* documentOverlayRoot = page.pageOverlayController().documentOverlayRootLayer();
Clean up how GraphicsLayer's "inWindow" state is set, and fix some issues with Page Overlays https://bugs.webkit.org/show_bug.cgi?id=167850 Reviewed by Tim Horton. Source/WebCore: RenderLayerCompositor::setIsInWindowForLayerIncludingDescendants() walked the RenderLayer tree to set the GraphicsLayer's "inWindow" state. This had the problem of skipping non-primary GraphicsLayers. We also never did this work for page overlay layers. Fix by giving GraphicsLayers a recursive function that sets the inWindow state, and call that from RenderLayerCompositor::setIsInWindow() and PageOverlayController. PageOverlayController also needs to implement tiledBackingUsageChanged so that tiled backings created dynamically get the correct in-window state. Page overlays also had some serious issues in MiniBrowser, in that they disappeared on reload, and on hide/show web view. This was because the overlay root layers were re-parented, but addChild() for each overlay's layer wasn't called. Clean up by replacing willAttachRootLayer() followed by viewOverlayRootLayer()/documentOverlayRootLayer() with single calls that set up the layers, update the inWindow state, and return the layer. Make it possible to dump tile caches in page overlay tests. Make showGraphicsLayers() always dump page overlay layers (source of much confusion). Test: pageoverlay/overlay-remove-reinsert-view.html * page/PageOverlayController.cpp: (WebCore::PageOverlayController::documentOverlayRootLayer): (WebCore::PageOverlayController::viewOverlayRootLayer): (WebCore::PageOverlayController::layerWithDocumentOverlays): (WebCore::PageOverlayController::layerWithViewOverlays): (WebCore::PageOverlayController::tiledBackingUsageChanged): (WebCore::PageOverlayController::willAttachRootLayer): Deleted. * page/PageOverlayController.h: * platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::setIsInWindowIncludingDescendants): (WebCore::dumpChildren): * platform/graphics/GraphicsLayer.h: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::appendDocumentOverlayLayers): (WebCore::RenderLayerCompositor::setIsInWindow): (WebCore::RenderLayerCompositor::attachRootLayer): (WebCore::RenderLayerCompositor::rootLayerAttachmentChanged): (WebCore::RenderLayerCompositor::setIsInWindowForLayerIncludingDescendants): Deleted. * rendering/RenderLayerCompositor.h: * testing/Internals.cpp: (WebCore::toLayerTreeFlags): (WebCore::Internals::layerTreeAsText): (WebCore::Internals::pageOverlayLayerTreeAsText): * testing/Internals.h: * testing/Internals.idl: * testing/MockPageOverlayClient.cpp: (WebCore::MockPageOverlayClient::layerTreeAsText): * testing/MockPageOverlayClient.h: Tools: * DumpRenderTree/TestRunner.cpp: (TestRunner::uiScriptDidComplete): Fix an assertion that fires for non-16-bit strings. LayoutTests: * pageoverlay/overlay-large-document-expected.txt: * pageoverlay/overlay-large-document-scrolled-expected.txt: * pageoverlay/overlay-remove-reinsert-view-expected.txt: Added. * pageoverlay/overlay-remove-reinsert-view.html: Added. * platform/ios-simulator-wk2/pageoverlay/overlay-remove-reinsert-view-expected.txt: Added. * platform/mac-wk1/pageoverlay/overlay-remove-reinsert-view-expected.txt: Added. * tiled-drawing/tiled-backing-in-window-expected.txt: Canonical link: https://commits.webkit.org/184886@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211683 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-02-05 19:18:16 +00:00
Remove duplicate LayerTreeAsText enums and use an OptionSet<> https://bugs.webkit.org/show_bug.cgi?id=229226 Reviewed by Antti Koivisto. GraphicsLayerClient had enum LayerTreeAsTextBehaviorFlags and Frame had an anonymous enum and typedef unsigned LayerTreeFlags. Clean up by adding LayerTreeAsTextOptions.h and using OptionSet<LayerTreeAsTextOptions> everywhere. * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: * page/Frame.h: * page/PageOverlayController.cpp: (WebCore::PageOverlayController::shouldSkipLayerInDump const): * page/PageOverlayController.h: * platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::dumpLayer const): (WebCore::dumpChildren): (WebCore::GraphicsLayer::dumpProperties const): (WebCore::GraphicsLayer::layerTreeAsText const): (showGraphicsLayerTree): * platform/graphics/GraphicsLayer.h: (WebCore::GraphicsLayer::dumpLayer): (WebCore::GraphicsLayer::layerTreeAsText): (WebCore::GraphicsLayer::dumpAdditionalProperties const): * platform/graphics/GraphicsLayerClient.h: (WebCore::GraphicsLayerClient::shouldSkipLayerInDump const): (WebCore::GraphicsLayerClient::shouldDumpPropertyForLayer const): * platform/graphics/LayerTreeAsTextOptions.h: Added. * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::dumpAdditionalProperties const): * platform/graphics/ca/GraphicsLayerCA.h: * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: (WebCore::dumpInnerLayer): (WebCore::CoordinatedGraphicsLayer::dumpAdditionalProperties const): * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h: * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::shouldSkipLayerInDump const): (WebCore::RenderLayerBacking::shouldDumpPropertyForLayer const): * rendering/RenderLayerBacking.h: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::layerTreeAsText): * rendering/RenderLayerCompositor.h: * testing/Internals.cpp: (WebCore::toLayerTreeAsTextOptions): (WebCore::Internals::layerTreeAsText const): (WebCore::Internals::pageOverlayLayerTreeAsText const): (WebCore::toLayerTreeFlags): Deleted. * testing/MockPageOverlayClient.cpp: (WebCore::MockPageOverlayClient::layerTreeAsText): * testing/MockPageOverlayClient.h: Canonical link: https://commits.webkit.org/240675@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281238 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-08-19 15:47:35 +00:00
return "View-relative:\n" + (viewOverlayRoot ? viewOverlayRoot->layerTreeAsText(options | LayerTreeAsTextOptions::IncludePageOverlayLayers) : "(no view-relative overlay root)")
+ "\n\nDocument-relative:\n" + (documentOverlayRoot ? documentOverlayRoot->layerTreeAsText(options | LayerTreeAsTextOptions::IncludePageOverlayLayers) : "(no document-relative overlay root)");
Make it possible to test page overlays https://bugs.webkit.org/show_bug.cgi?id=137339 Reviewed by Dan Bernstein. Tests: pageoverlay/overlay-installation.html pageoverlay/overlay-large-document-scrolled.html pageoverlay/overlay-large-document.html Do some initial work to make page overlays testable. There are many more tests to be written, but this lays the groundwork. * WebCore.exp.in: * WebCore.xcodeproj/project.pbxproj: * WebCore.vcxproj/WebCoreTestSupport.vcxproj: * WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters: * CMakeLists.txt: Add MockPageOverlayClient. * platform/graphics/GraphicsLayer.h: * page/PageOverlayController.h: * page/PageOverlayController.cpp: (WebCore::PageOverlayController::shouldSkipLayerInDump): Don't skip PageOverlayController-owned layers in the layer tree dump if the layerTreeAsText behavior says that we should include them. * platform/graphics/GraphicsLayer.cpp: (WebCore::dumpChildren): * platform/graphics/GraphicsLayerClient.h: (WebCore::GraphicsLayerClient::shouldSkipLayerInDump): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::shouldSkipLayerInDump): * rendering/RenderLayerBacking.h: Pass the LayerTreeAsTextBehavior through shouldSkipLayerInDump. * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): Uninstall all page overlays when resetting to a consistent state. (WebCore::Internals::installMockPageOverlay): (WebCore::Internals::pageOverlayLayerTreeAsText): Expose two new internals functions. installMockPageOverlay takes "view" or "document", allowing script to choose the appropriate overlay type. pageOverlayLayerTreeAsText dumps both view and document-relative overlays, from each overlay container layer. * testing/Internals.h: * testing/Internals.idl: Fix some typos. * testing/MockPageOverlayClient.cpp: Added. (WebCore::MockPageOverlayClient::shared): (WebCore::MockPageOverlayClient::MockPageOverlayClient): (WebCore::MockPageOverlayClient::installOverlay): (WebCore::MockPageOverlayClient::uninstallAllOverlays): (WebCore::MockPageOverlayClient::layerTreeAsText): (WebCore::MockPageOverlayClient::pageOverlayDestroyed): (WebCore::MockPageOverlayClient::willMoveToPage): (WebCore::MockPageOverlayClient::didMoveToPage): When the overlay is parented, mark it as needing repaint. Future tests might want to test overlays without content, but for now this is a reasonable default behavior. (WebCore::MockPageOverlayClient::drawRect): Paint the overlay rects as described in the LayoutTests ChangeLog. (WebCore::MockPageOverlayClient::mouseEvent): (WebCore::MockPageOverlayClient::didScrollFrame): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeStringValueForPoint): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeBoolValueForPoint): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeNames): * testing/MockPageOverlayClient.h: Added. * pageoverlay/overlay-installation.html: Added. Add a test which just installs one view-relative and one document-relative overlay, and dumps the layer tree and pixel results. The mock overlay strokes a blue rectangle (inset a little from the overlay bounds) for view-relative overlays, and a green rectangle (inset a bit more) for document-relative overlays. * pageoverlay/overlay-large-document.html: Added. * pageoverlay/overlay-large-document-scrolled.html: Added. Tests that do the same as the -installation test, but with a larger document; the view-relative overlay should be the same size (or slightly smaller, because we have scrollbars now), but the document-relative overlay should be the size of the document. The second test scrolls to maxX, maxY, and the document-relative overlay should scroll along with it, while the view-relative overlay should remain fixed. * pageoverlay/overlay-installation-expected.txt: Added. * pageoverlay/overlay-large-document-expected.txt: Added. * pageoverlay/overlay-large-document-scrolled-expected.txt: Added. "Normal" layer tree expectations. * platform/mac-wk1/pageoverlay/overlay-installation-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-installation-expected.txt: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-expected.txt: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-scrolled-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-scrolled-expected.txt: Added. Expected results for WebKit1 differ for view-relative overlays, because we don't currently hook up view-relative overlays for WebKit1. * platform/mac/pageoverlay/overlay-installation-expected.png: Added. * platform/mac/pageoverlay/overlay-large-document-expected.png: Added. * platform/mac/pageoverlay/overlay-large-document-scrolled-expected.png: Added. "Normal" pixel dump expectations. Canonical link: https://commits.webkit.org/155229@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-04 08:47:04 +00:00
}
void MockPageOverlayClient::willMoveToPage(PageOverlay&, Page*)
{
}
void MockPageOverlayClient::didMoveToPage(PageOverlay& overlay, Page* page)
{
if (page)
overlay.setNeedsDisplay();
}
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. Canonical link: https://commits.webkit.org/170422@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194117 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-12-15 22:46:02 +00:00
void MockPageOverlayClient::drawRect(PageOverlay& overlay, GraphicsContext& context, const IntRect& dirtyRect)
Make it possible to test page overlays https://bugs.webkit.org/show_bug.cgi?id=137339 Reviewed by Dan Bernstein. Tests: pageoverlay/overlay-installation.html pageoverlay/overlay-large-document-scrolled.html pageoverlay/overlay-large-document.html Do some initial work to make page overlays testable. There are many more tests to be written, but this lays the groundwork. * WebCore.exp.in: * WebCore.xcodeproj/project.pbxproj: * WebCore.vcxproj/WebCoreTestSupport.vcxproj: * WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters: * CMakeLists.txt: Add MockPageOverlayClient. * platform/graphics/GraphicsLayer.h: * page/PageOverlayController.h: * page/PageOverlayController.cpp: (WebCore::PageOverlayController::shouldSkipLayerInDump): Don't skip PageOverlayController-owned layers in the layer tree dump if the layerTreeAsText behavior says that we should include them. * platform/graphics/GraphicsLayer.cpp: (WebCore::dumpChildren): * platform/graphics/GraphicsLayerClient.h: (WebCore::GraphicsLayerClient::shouldSkipLayerInDump): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::shouldSkipLayerInDump): * rendering/RenderLayerBacking.h: Pass the LayerTreeAsTextBehavior through shouldSkipLayerInDump. * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): Uninstall all page overlays when resetting to a consistent state. (WebCore::Internals::installMockPageOverlay): (WebCore::Internals::pageOverlayLayerTreeAsText): Expose two new internals functions. installMockPageOverlay takes "view" or "document", allowing script to choose the appropriate overlay type. pageOverlayLayerTreeAsText dumps both view and document-relative overlays, from each overlay container layer. * testing/Internals.h: * testing/Internals.idl: Fix some typos. * testing/MockPageOverlayClient.cpp: Added. (WebCore::MockPageOverlayClient::shared): (WebCore::MockPageOverlayClient::MockPageOverlayClient): (WebCore::MockPageOverlayClient::installOverlay): (WebCore::MockPageOverlayClient::uninstallAllOverlays): (WebCore::MockPageOverlayClient::layerTreeAsText): (WebCore::MockPageOverlayClient::pageOverlayDestroyed): (WebCore::MockPageOverlayClient::willMoveToPage): (WebCore::MockPageOverlayClient::didMoveToPage): When the overlay is parented, mark it as needing repaint. Future tests might want to test overlays without content, but for now this is a reasonable default behavior. (WebCore::MockPageOverlayClient::drawRect): Paint the overlay rects as described in the LayoutTests ChangeLog. (WebCore::MockPageOverlayClient::mouseEvent): (WebCore::MockPageOverlayClient::didScrollFrame): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeStringValueForPoint): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeBoolValueForPoint): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeNames): * testing/MockPageOverlayClient.h: Added. * pageoverlay/overlay-installation.html: Added. Add a test which just installs one view-relative and one document-relative overlay, and dumps the layer tree and pixel results. The mock overlay strokes a blue rectangle (inset a little from the overlay bounds) for view-relative overlays, and a green rectangle (inset a bit more) for document-relative overlays. * pageoverlay/overlay-large-document.html: Added. * pageoverlay/overlay-large-document-scrolled.html: Added. Tests that do the same as the -installation test, but with a larger document; the view-relative overlay should be the same size (or slightly smaller, because we have scrollbars now), but the document-relative overlay should be the size of the document. The second test scrolls to maxX, maxY, and the document-relative overlay should scroll along with it, while the view-relative overlay should remain fixed. * pageoverlay/overlay-installation-expected.txt: Added. * pageoverlay/overlay-large-document-expected.txt: Added. * pageoverlay/overlay-large-document-scrolled-expected.txt: Added. "Normal" layer tree expectations. * platform/mac-wk1/pageoverlay/overlay-installation-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-installation-expected.txt: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-expected.txt: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-scrolled-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-scrolled-expected.txt: Added. Expected results for WebKit1 differ for view-relative overlays, because we don't currently hook up view-relative overlays for WebKit1. * platform/mac/pageoverlay/overlay-installation-expected.png: Added. * platform/mac/pageoverlay/overlay-large-document-expected.png: Added. * platform/mac/pageoverlay/overlay-large-document-scrolled-expected.png: Added. "Normal" pixel dump expectations. Canonical link: https://commits.webkit.org/155229@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-04 08:47:04 +00:00
{
Remove StringBuilder::appendNumber https://bugs.webkit.org/show_bug.cgi?id=225732 Reviewed by Sam Weinig. Source/JavaScriptCore: * API/JSContextRef.cpp: (BacktraceFunctor::operator() const): Use append instead of appendNumber. * API/tests/PingPongStackOverflowTest.cpp: (PingPongStackOverflowObject_hasInstance): Ditto. * heap/HeapSnapshotBuilder.cpp: (JSC::HeapSnapshotBuilder::json): Ditto. * interpreter/StackVisitor.cpp: (JSC::StackVisitor::Frame::toString const): Use makeString instead of StringBuilder. * runtime/ConsoleClient.cpp: (JSC::appendURLAndPosition): Ditto. (JSC::ConsoleClient::printConsoleMessageWithArguments): Use append instead of appendNumber. * runtime/JSONObject.cpp: (JSC::Stringifier::appendStringifiedValue): Ditto. * runtime/Options.cpp: (JSC::OptionReader::Option::dump const): Ditto. * runtime/StackFrame.cpp: (JSC::StackFrame::toString const): Use makeString instead of StringBuilder. Source/WebCore: * Modules/indexeddb/server/IndexValueStore.cpp: (WebCore::IDBServer::IndexValueStore::loggingString const): Use append instead of appendNumber. * Modules/websockets/WebSocketHandshake.cpp: (WebCore::hostName): Use makeString instead of StringBuilder. * contentextensions/CombinedURLFilters.cpp: (WebCore::ContentExtensions::prefixTreeVertexToString): Use append instead of appendNumber. * contentextensions/Term.h: (WebCore::ContentExtensions::Term::toString const): Ditto. * css/CSSFontFeatureValue.cpp: (WebCore::CSSFontFeatureValue::customCSSText const): Ditto. * css/CSSTimingFunctionValue.cpp: (WebCore::CSSStepsTimingFunctionValue::customCSSText const): Ditto. * dom/Document.cpp: (WebCore::Document::downgradeReferrerToRegistrableDomain): Use makeString instead of StringBuilder. * editing/MarkupAccumulator.cpp: (WebCore::MarkupAccumulator::generateUniquePrefix): Ditto. * editing/cocoa/DataDetection.mm: (WebCore::dataDetectorStringForPath): Use append instead of appendNumber. * html/HTMLAnchorElement.cpp: (WebCore::appendServerMapMousePosition): Ditto. * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::createContext2d): Use makeString instead of StringBuilder. (WebCore::HTMLCanvasElement::createImageBuffer const): Ditto. * loader/ResourceLoadStatistics.cpp: (WebCore::ResourceLoadStatistics::toString const): Use append instead of appendNumber. * loader/SubresourceIntegrity.cpp: (WebCore::integrityMismatchDescription): Use makeString instead of StringBuilder. * page/IntersectionObserver.cpp: (WebCore::IntersectionObserver::rootMargin const): Use append instead of appendNumber. * page/SecurityOriginData.cpp: (WebCore::SecurityOriginData::databaseIdentifier const): Use makeString instead of StringBuilder. * platform/Decimal.cpp: (WebCore::Decimal::toString const): Use append instead of appendNumber. * platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::animationNameForTransition): Use makeString instead of StringBuilder. * platform/graphics/ca/TileController.cpp: (WebCore::TileController::createTileLayer): Ditto. * platform/graphics/ca/win/PlatformCALayerWin.cpp: (printTransform): Use single append instead of a run of them. (printLayer): Ditto, and use append instead of apppendNumber. (PlatformCALayerWin::layerTreeAsString const): Ditto. * platform/mediarecorder/MediaRecorderPrivateMock.cpp: (WebCore::MediaRecorderPrivateMock::generateMockCounterString): Use append instead of appendNumber. * platform/network/ProxyServer.cpp: (WebCore::appendProxyServerString): Ditto. * rendering/RenderTreeAsText.cpp: (WebCore::nodePosition): Ditto. * svg/SVGPathUtilities.cpp: (WebCore::buildStringFromPath): Ditto. * testing/Internals.cpp: (WebCore::Internals::parserMetaData): Use makeString instead of StringBuilder. (WebCore::appendOffsets): Use append instead of appendNumber. * testing/MockPageOverlayClient.cpp: (WebCore::MockPageOverlayClient::drawRect): Use makeString instead of StringBuilder. (WebCore::MockPageOverlayClient::mouseEvent): Ditto. * xml/XMLErrors.cpp: (WebCore::XMLErrors::appendErrorMessage): Use append instead of appendNumber. Source/WebDriver: * SessionHost.cpp: (WebDriver::SessionHost::sendCommandToBackend): Use append instead of appendNumber. * socket/HTTPServerSocket.cpp: (WebDriver::HTTPRequestHandler::packHTTPMessage const): Ditto. Source/WebKit: * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: (WebKit::buildList): Use append instead of appendNumber. (WebKit::ResourceLoadStatisticsDatabaseStore::findNotVeryPrevalentResources): Ditto. (WebKit::ResourceLoadStatisticsDatabaseStore::resourceToString const): Ditto. (WebKit::ResourceLoadStatisticsDatabaseStore::attributionToString): Ditto. (WebKit::ResourceLoadStatisticsDatabaseStore::privateClickMeasurementToString): Ditto. * Shared/WebMemorySampler.cpp: (WebKit::WebMemorySampler::appendCurrentMemoryUsageToFile): Ditto. * UIProcess/API/glib/WebKitWebView.cpp: (webkitWebViewRunJavaScriptCallback): Ditto. * UIProcess/WebBackForwardList.cpp: (WebKit::WebBackForwardList::loggingString): Ditto. * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp: (PageResourceLoadClient::didReceiveResponseForResource): Use makeString instead of StringBuilder. * WebProcess/Plugins/PluginView.cpp: (WebKit::buildHTTPHeaders): Use append instead of appendNumber. Source/WebKitLegacy/win: * WebKitStatistics.cpp: (WebKitStatistics::comClassNameCounts): Use append instead of appendNumber. Source/WTF: We originally added StringBuilder::appendNumber to resolve the ambiguity between UChar and uint16_t, but that problem was solved long ago and it is safe to use StringBuilder::append, including the variadic form, on all types of numbers and we'll get the same results we did with appendNumber. * wtf/JSONValues.cpp: (WTF::JSONImpl::Value::writeJSON const): Use append instead of appendNumber. * wtf/text/StringBuilder.cpp: (WTF::StringBuilder::appendNumber): Deleted. * wtf/text/StringBuilder.h: Removed appendNumber. * wtf/text/TextStream.cpp: (WTF::TextStream::operator<<): Use append instead of appendNumber. Tools: * TestWebKitAPI/Tests/WTF/StringBuilder.cpp: Test append with a number instead of appendNumber. * TestWebKitAPI/Tests/WebKitGLib/TestAutomationSession.cpp: Use append instead of appendNumber. * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp: (WTR::dumpResponseDescriptionSuitableForTestResult): Use append instead of appendNumber. (WTR::dumpFrameScrollPosition): Ditto. (WTR::InjectedBundlePage::didFinishDocumentLoadForFrame): Use makeString instead of StringBuilder. (WTR::InjectedBundlePage::shouldCacheResponse): Ditto. * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp: (WTR::attributesOfElement): Use append instead of appendNumber. (WTR::AccessibilityUIElement::attributedStringForRange): Ditto. (WTR::stringAtOffset): Ditto. Canonical link: https://commits.webkit.org/237685@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277437 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-13 16:18:32 +00:00
overlay.page()->mainFrame().document()->addConsoleMessage(MessageSource::Other, MessageLevel::Debug,
makeString("MockPageOverlayClient::drawRect dirtyRect (", dirtyRect.x(), ", ", dirtyRect.y(), ", ", dirtyRect.width(), ", ", dirtyRect.height(), ')'));
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. Canonical link: https://commits.webkit.org/170422@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194117 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-12-15 22:46:02 +00:00
Make it possible to test page overlays https://bugs.webkit.org/show_bug.cgi?id=137339 Reviewed by Dan Bernstein. Tests: pageoverlay/overlay-installation.html pageoverlay/overlay-large-document-scrolled.html pageoverlay/overlay-large-document.html Do some initial work to make page overlays testable. There are many more tests to be written, but this lays the groundwork. * WebCore.exp.in: * WebCore.xcodeproj/project.pbxproj: * WebCore.vcxproj/WebCoreTestSupport.vcxproj: * WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters: * CMakeLists.txt: Add MockPageOverlayClient. * platform/graphics/GraphicsLayer.h: * page/PageOverlayController.h: * page/PageOverlayController.cpp: (WebCore::PageOverlayController::shouldSkipLayerInDump): Don't skip PageOverlayController-owned layers in the layer tree dump if the layerTreeAsText behavior says that we should include them. * platform/graphics/GraphicsLayer.cpp: (WebCore::dumpChildren): * platform/graphics/GraphicsLayerClient.h: (WebCore::GraphicsLayerClient::shouldSkipLayerInDump): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::shouldSkipLayerInDump): * rendering/RenderLayerBacking.h: Pass the LayerTreeAsTextBehavior through shouldSkipLayerInDump. * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): Uninstall all page overlays when resetting to a consistent state. (WebCore::Internals::installMockPageOverlay): (WebCore::Internals::pageOverlayLayerTreeAsText): Expose two new internals functions. installMockPageOverlay takes "view" or "document", allowing script to choose the appropriate overlay type. pageOverlayLayerTreeAsText dumps both view and document-relative overlays, from each overlay container layer. * testing/Internals.h: * testing/Internals.idl: Fix some typos. * testing/MockPageOverlayClient.cpp: Added. (WebCore::MockPageOverlayClient::shared): (WebCore::MockPageOverlayClient::MockPageOverlayClient): (WebCore::MockPageOverlayClient::installOverlay): (WebCore::MockPageOverlayClient::uninstallAllOverlays): (WebCore::MockPageOverlayClient::layerTreeAsText): (WebCore::MockPageOverlayClient::pageOverlayDestroyed): (WebCore::MockPageOverlayClient::willMoveToPage): (WebCore::MockPageOverlayClient::didMoveToPage): When the overlay is parented, mark it as needing repaint. Future tests might want to test overlays without content, but for now this is a reasonable default behavior. (WebCore::MockPageOverlayClient::drawRect): Paint the overlay rects as described in the LayoutTests ChangeLog. (WebCore::MockPageOverlayClient::mouseEvent): (WebCore::MockPageOverlayClient::didScrollFrame): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeStringValueForPoint): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeBoolValueForPoint): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeNames): * testing/MockPageOverlayClient.h: Added. * pageoverlay/overlay-installation.html: Added. Add a test which just installs one view-relative and one document-relative overlay, and dumps the layer tree and pixel results. The mock overlay strokes a blue rectangle (inset a little from the overlay bounds) for view-relative overlays, and a green rectangle (inset a bit more) for document-relative overlays. * pageoverlay/overlay-large-document.html: Added. * pageoverlay/overlay-large-document-scrolled.html: Added. Tests that do the same as the -installation test, but with a larger document; the view-relative overlay should be the same size (or slightly smaller, because we have scrollbars now), but the document-relative overlay should be the size of the document. The second test scrolls to maxX, maxY, and the document-relative overlay should scroll along with it, while the view-relative overlay should remain fixed. * pageoverlay/overlay-installation-expected.txt: Added. * pageoverlay/overlay-large-document-expected.txt: Added. * pageoverlay/overlay-large-document-scrolled-expected.txt: Added. "Normal" layer tree expectations. * platform/mac-wk1/pageoverlay/overlay-installation-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-installation-expected.txt: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-expected.txt: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-scrolled-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-scrolled-expected.txt: Added. Expected results for WebKit1 differ for view-relative overlays, because we don't currently hook up view-relative overlays for WebKit1. * platform/mac/pageoverlay/overlay-installation-expected.png: Added. * platform/mac/pageoverlay/overlay-large-document-expected.png: Added. * platform/mac/pageoverlay/overlay-large-document-scrolled-expected.png: Added. "Normal" pixel dump expectations. Canonical link: https://commits.webkit.org/155229@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-04 08:47:04 +00:00
GraphicsContextStateSaver stateSaver(context);
FloatRect insetRect = overlay.bounds();
if (overlay.overlayType() == PageOverlay::OverlayType::Document) {
Remove final vestigates of SimpleColor https://bugs.webkit.org/show_bug.cgi?id=214439 Reviewed by Simon Fraser. Source/WebCore: Replace remaining makeSimpleColor uses: - Literal / constant colors switched to using SRGBA<uint8_t> { ... }. - Direct construction from uint8_t values also switched to SRGBA<uint8_t> { ... } - Where possible switched to using of named colors (e.g. Color::yellow) both directly and where an override alpha was needed. To aid this, new named colors were added for red, magenta, blue, green, darkGreen and orange. - Remaining callers switched to directly calling clampToComponentBytes, which was all that makeSimpleColor did. An overload of clampToComponentBytes that doesn't require the alpha parameter was added to simplify calls. To make construction of SRGBA<uint8_t> values nicer, callers no longer need to specify the alpha explicitly if the color is opaque. * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/SimpleColor.h: Removed. Remove SimpleColor.h * css/parser/CSSParserFastPaths.cpp: (WebCore::parseNumericColor): Switch to clampToComponentBytes, but leave a FIXME indicating this should be switched to direct SRGBA<uint8_t> when hepler functions are fixed to return uint8_ts rather than ints. * inspector/agents/InspectorDOMAgent.cpp: (WebCore::parseColor): Switched to clampToComponentBytes and removed existing unnecessary additional clamping of the alpha component. * page/DebugPageOverlays.cpp: (WebCore::NonFastScrollableRegionOverlay::drawRect): Restructure HashMap construction to use the HashMap std::intializer_list constructor. This takes advantage of a change to WTF::KeyValuePair that allows it deduce in this context. * platform/graphics/Color.h: Remove SimpleColor.h include, but add ColorBuilder.h and ColorUtilities.h which SimpleColor was including on its behalf. Add new named colors for red, magenta, blue, green, darkGreen and orange. For all named colors, use ColorBuilder<SRGBA<uint8_t>> rather than SRGBA<uint8_t> alone to allow for callers to do things like Color::yellow.colorWithAlpha(...). In the future, it might make more sense to merge ColorBuilder's functionality directly into the color types, but for now this preserves that functionality. * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h: (WebCore::SVGAnimationColorFunction::animate): (WebCore::SVGAnimationColorFunction::roundAndClampColorChannel): Deleted. Replace bespoke rounding/clamping functions in favor of ColorUtilities.h aggregate ones and directly calling std::lround. * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::parseRGBParameters): * editing/CompositionHighlight.h: * html/ColorInputType.cpp: (WebCore::parseSimpleColorValue): * html/HTMLElement.cpp: (WebCore::parseLegacyColorValue): * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::createInnerTextStyle): * inspector/InspectorOverlay.cpp: (WebCore::drawOutlinedQuadWithClip): (WebCore::drawShapeHighlight): (WebCore::InspectorOverlay::paint): (WebCore::InspectorOverlay::drawPaintRects): (WebCore::InspectorOverlay::drawBounds): (WebCore::InspectorOverlay::drawRulers): (WebCore::InspectorOverlay::drawElementTitle): * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::debugTextShadow): * page/CaptionUserPreferencesMediaAF.cpp: (WebCore::CaptionUserPreferencesMediaAF::captionsBackgroundCSS const): * page/FrameView.cpp: (WebCore::FrameView::paintContents): * page/PrintContext.cpp: (WebCore::PrintContext::spoolAllPagesWithBoundaries): * page/cocoa/ResourceUsageOverlayCocoa.mm: (WebCore::HistoricResourceUsageData::HistoricResourceUsageData): * page/linux/ResourceUsageOverlayLinux.cpp: (WebCore::ResourceUsageOverlay::platformInitialize): * platform/adwaita/ScrollbarThemeAdwaita.cpp: * platform/adwaita/ThemeAdwaita.cpp: (WebCore::ThemeAdwaita::activeSelectionForegroundColor const): (WebCore::ThemeAdwaita::activeSelectionBackgroundColor const): (WebCore::ThemeAdwaita::inactiveSelectionForegroundColor const): * platform/graphics/Color.cpp: * platform/graphics/ColorBlending.cpp: (WebCore::blendSourceOver): (WebCore::blendWithWhite): * platform/graphics/ColorBuilder.h: (WebCore::ColorBuilder::colorWithAlpha const): (WebCore::ColorBuilder::ColorBuilder): Deleted. * platform/graphics/ColorTypes.h: (WebCore::SRGBA::SRGBA): * platform/graphics/ColorUtilities.h: (WebCore::clampToComponentBytes): (WebCore::clampToComponentFloats): * platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::getDebugBorderInfo const): * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::recursiveCommitChanges): (WebCore::contentsLayerDebugBorderColor): (WebCore::cloneLayerDebugBorderColor): (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): * platform/graphics/ca/PlatformCALayer.cpp: (WebCore::PlatformCALayer::drawRepaintIndicator): * platform/graphics/ca/TileCoverageMap.cpp: (WebCore::TileCoverageMap::TileCoverageMap): (WebCore::TileCoverageMap::update): * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp: (PlatformCALayerWinInternal::drawRepaintCounters): * platform/graphics/cg/NativeImageCG.cpp: (WebCore::nativeImageSinglePixelSolidColor): * platform/graphics/cocoa/GraphicsContextCocoa.mm: (WebCore::colorForMarkerLineStyle): * platform/graphics/mac/ColorMac.mm: (WebCore::makeSimpleColorFromNSColor): * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp: (WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper): * platform/graphics/win/GraphicsContextCGWin.cpp: (WebCore::GraphicsContext::drawDotsForDocumentMarker): * platform/ios/DragImageIOS.mm: (WebCore::createDragImageForLink): * platform/ios/LegacyTileCache.mm: (WebCore::LegacyTileCache::colorForGridTileBorder const): * platform/mock/MockRealtimeMediaSourceCenter.cpp: (WebCore::defaultDevices): * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::drawBoxes): * platform/mock/ScrollbarThemeMock.cpp: (WebCore::ScrollbarThemeMock::paintTrackBackground): * platform/playstation/ScrollbarThemePlayStation.cpp: (WebCore::ScrollbarThemePlayStation::paintTrackBackground): * platform/win/DragImageWin.cpp: (WebCore::createDragImageForLink): * rendering/RenderEmbeddedObject.cpp: * rendering/RenderFrameSet.cpp: * rendering/RenderLayer.cpp: (WebCore::RenderLayer::beginTransparencyLayers): (WebCore::RenderLayer::paintResizer): * rendering/RenderLayerBacking.cpp: (WebCore::patternForTouchAction): (WebCore::patternForEventListenerRegionType): (WebCore::RenderLayerBacking::paintDebugOverlays): * rendering/RenderTheme.cpp: (WebCore::RenderTheme::platformActiveSelectionBackgroundColor const): (WebCore::RenderTheme::platformInactiveSelectionBackgroundColor const): (WebCore::RenderTheme::systemColor const): (WebCore::RenderTheme::paintSystemPreviewBadge): (WebCore::RenderTheme::platformTapHighlightColor const): * rendering/RenderThemeAdwaita.cpp: * rendering/RenderThemeIOS.h: * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::paintSliderTrack): (WebCore::RenderThemeIOS::paintProgressBar): * rendering/RenderThemeMac.mm: (WebCore::menuBackgroundColor): (WebCore::RenderThemeMac::systemColor const): (WebCore::RenderThemeMac::paintMenuListButtonDecorations): * rendering/RenderThemeWin.cpp: (WebCore::RenderThemeWin::platformActiveSelectionBackgroundColor const): (WebCore::RenderThemeWin::platformInactiveSelectionBackgroundColor const): (WebCore::RenderThemeWin::platformActiveSelectionForegroundColor const): (WebCore::RenderThemeWin::systemColor const): * rendering/SimpleLineLayoutFunctions.cpp: (WebCore::SimpleLineLayout::paintFlow): * rendering/mathml/RenderMathMLBlock.cpp: (WebCore::RenderMathMLBlock::paint): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::colorResolvingCurrentColor const): * rendering/style/SVGRenderStyle.h: (WebCore::SVGRenderStyle::initialStopColor): (WebCore::SVGRenderStyle::initialFloodColor): (WebCore::SVGRenderStyle::initialLightingColor): * testing/MockPageOverlayClient.cpp: (WebCore::MockPageOverlayClient::drawRect): * testing/cocoa/WebViewVisualIdentificationOverlay.mm: (-[WebViewVisualIdentificationOverlay initWithWebView:kind:deprecated:]): Replace makeSimpleColor uses with appropriate alternative. Source/WebKit: * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::drawInContext): * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _tapHighlightColorForFastClick:]): * WebProcess/Inspector/WebInspectorClient.cpp: (WebKit::WebInspectorClient::showPaintRect): * WebProcess/WebPage/FindController.cpp: (WebKit::FindController::drawRect): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::paintSnapshotAtSize): * WebProcess/WebPage/ios/FindControllerIOS.mm: Replace remaining makeSimpleColor() uses. Source/WebKitLegacy/mac: * WebView/WebIndicateLayer.mm: Replace remaining makeSimpleColor() uses. Source/WebKitLegacy/win: * FullscreenVideoController.cpp: * WebView.cpp: (compositionToUnderlines): Replace remaining makeSimpleColor() uses. Source/WTF: * wtf/KeyValuePair.h: (WTF::KeyValuePair::KeyValuePair): Add overload of constructor that is not a template function to aid deduction when using std::initializer_lists to contruct a HashMap. Tools: * TestWebKitAPI/Tests/WebCore/ColorTests.cpp: * TestWebKitAPI/Tests/WebCore/ExtendedColorTests.cpp: * TestWebKitAPI/Tests/WebKitCocoa/PDFSnapshot.mm: * TestWebKitAPI/cocoa/TestPDFDocument.mm: Replace remaining makeSimpleColor() uses. Canonical link: https://commits.webkit.org/227313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@264565 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-07-18 03:13:20 +00:00
context.setStrokeColor(Color::green);
Make it possible to test page overlays https://bugs.webkit.org/show_bug.cgi?id=137339 Reviewed by Dan Bernstein. Tests: pageoverlay/overlay-installation.html pageoverlay/overlay-large-document-scrolled.html pageoverlay/overlay-large-document.html Do some initial work to make page overlays testable. There are many more tests to be written, but this lays the groundwork. * WebCore.exp.in: * WebCore.xcodeproj/project.pbxproj: * WebCore.vcxproj/WebCoreTestSupport.vcxproj: * WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters: * CMakeLists.txt: Add MockPageOverlayClient. * platform/graphics/GraphicsLayer.h: * page/PageOverlayController.h: * page/PageOverlayController.cpp: (WebCore::PageOverlayController::shouldSkipLayerInDump): Don't skip PageOverlayController-owned layers in the layer tree dump if the layerTreeAsText behavior says that we should include them. * platform/graphics/GraphicsLayer.cpp: (WebCore::dumpChildren): * platform/graphics/GraphicsLayerClient.h: (WebCore::GraphicsLayerClient::shouldSkipLayerInDump): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::shouldSkipLayerInDump): * rendering/RenderLayerBacking.h: Pass the LayerTreeAsTextBehavior through shouldSkipLayerInDump. * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): Uninstall all page overlays when resetting to a consistent state. (WebCore::Internals::installMockPageOverlay): (WebCore::Internals::pageOverlayLayerTreeAsText): Expose two new internals functions. installMockPageOverlay takes "view" or "document", allowing script to choose the appropriate overlay type. pageOverlayLayerTreeAsText dumps both view and document-relative overlays, from each overlay container layer. * testing/Internals.h: * testing/Internals.idl: Fix some typos. * testing/MockPageOverlayClient.cpp: Added. (WebCore::MockPageOverlayClient::shared): (WebCore::MockPageOverlayClient::MockPageOverlayClient): (WebCore::MockPageOverlayClient::installOverlay): (WebCore::MockPageOverlayClient::uninstallAllOverlays): (WebCore::MockPageOverlayClient::layerTreeAsText): (WebCore::MockPageOverlayClient::pageOverlayDestroyed): (WebCore::MockPageOverlayClient::willMoveToPage): (WebCore::MockPageOverlayClient::didMoveToPage): When the overlay is parented, mark it as needing repaint. Future tests might want to test overlays without content, but for now this is a reasonable default behavior. (WebCore::MockPageOverlayClient::drawRect): Paint the overlay rects as described in the LayoutTests ChangeLog. (WebCore::MockPageOverlayClient::mouseEvent): (WebCore::MockPageOverlayClient::didScrollFrame): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeStringValueForPoint): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeBoolValueForPoint): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeNames): * testing/MockPageOverlayClient.h: Added. * pageoverlay/overlay-installation.html: Added. Add a test which just installs one view-relative and one document-relative overlay, and dumps the layer tree and pixel results. The mock overlay strokes a blue rectangle (inset a little from the overlay bounds) for view-relative overlays, and a green rectangle (inset a bit more) for document-relative overlays. * pageoverlay/overlay-large-document.html: Added. * pageoverlay/overlay-large-document-scrolled.html: Added. Tests that do the same as the -installation test, but with a larger document; the view-relative overlay should be the same size (or slightly smaller, because we have scrollbars now), but the document-relative overlay should be the size of the document. The second test scrolls to maxX, maxY, and the document-relative overlay should scroll along with it, while the view-relative overlay should remain fixed. * pageoverlay/overlay-installation-expected.txt: Added. * pageoverlay/overlay-large-document-expected.txt: Added. * pageoverlay/overlay-large-document-scrolled-expected.txt: Added. "Normal" layer tree expectations. * platform/mac-wk1/pageoverlay/overlay-installation-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-installation-expected.txt: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-expected.txt: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-scrolled-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-scrolled-expected.txt: Added. Expected results for WebKit1 differ for view-relative overlays, because we don't currently hook up view-relative overlays for WebKit1. * platform/mac/pageoverlay/overlay-installation-expected.png: Added. * platform/mac/pageoverlay/overlay-large-document-expected.png: Added. * platform/mac/pageoverlay/overlay-large-document-scrolled-expected.png: Added. "Normal" pixel dump expectations. Canonical link: https://commits.webkit.org/155229@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-04 08:47:04 +00:00
insetRect.inflate(-50);
} else {
Remove final vestigates of SimpleColor https://bugs.webkit.org/show_bug.cgi?id=214439 Reviewed by Simon Fraser. Source/WebCore: Replace remaining makeSimpleColor uses: - Literal / constant colors switched to using SRGBA<uint8_t> { ... }. - Direct construction from uint8_t values also switched to SRGBA<uint8_t> { ... } - Where possible switched to using of named colors (e.g. Color::yellow) both directly and where an override alpha was needed. To aid this, new named colors were added for red, magenta, blue, green, darkGreen and orange. - Remaining callers switched to directly calling clampToComponentBytes, which was all that makeSimpleColor did. An overload of clampToComponentBytes that doesn't require the alpha parameter was added to simplify calls. To make construction of SRGBA<uint8_t> values nicer, callers no longer need to specify the alpha explicitly if the color is opaque. * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/SimpleColor.h: Removed. Remove SimpleColor.h * css/parser/CSSParserFastPaths.cpp: (WebCore::parseNumericColor): Switch to clampToComponentBytes, but leave a FIXME indicating this should be switched to direct SRGBA<uint8_t> when hepler functions are fixed to return uint8_ts rather than ints. * inspector/agents/InspectorDOMAgent.cpp: (WebCore::parseColor): Switched to clampToComponentBytes and removed existing unnecessary additional clamping of the alpha component. * page/DebugPageOverlays.cpp: (WebCore::NonFastScrollableRegionOverlay::drawRect): Restructure HashMap construction to use the HashMap std::intializer_list constructor. This takes advantage of a change to WTF::KeyValuePair that allows it deduce in this context. * platform/graphics/Color.h: Remove SimpleColor.h include, but add ColorBuilder.h and ColorUtilities.h which SimpleColor was including on its behalf. Add new named colors for red, magenta, blue, green, darkGreen and orange. For all named colors, use ColorBuilder<SRGBA<uint8_t>> rather than SRGBA<uint8_t> alone to allow for callers to do things like Color::yellow.colorWithAlpha(...). In the future, it might make more sense to merge ColorBuilder's functionality directly into the color types, but for now this preserves that functionality. * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h: (WebCore::SVGAnimationColorFunction::animate): (WebCore::SVGAnimationColorFunction::roundAndClampColorChannel): Deleted. Replace bespoke rounding/clamping functions in favor of ColorUtilities.h aggregate ones and directly calling std::lround. * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::parseRGBParameters): * editing/CompositionHighlight.h: * html/ColorInputType.cpp: (WebCore::parseSimpleColorValue): * html/HTMLElement.cpp: (WebCore::parseLegacyColorValue): * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::createInnerTextStyle): * inspector/InspectorOverlay.cpp: (WebCore::drawOutlinedQuadWithClip): (WebCore::drawShapeHighlight): (WebCore::InspectorOverlay::paint): (WebCore::InspectorOverlay::drawPaintRects): (WebCore::InspectorOverlay::drawBounds): (WebCore::InspectorOverlay::drawRulers): (WebCore::InspectorOverlay::drawElementTitle): * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::debugTextShadow): * page/CaptionUserPreferencesMediaAF.cpp: (WebCore::CaptionUserPreferencesMediaAF::captionsBackgroundCSS const): * page/FrameView.cpp: (WebCore::FrameView::paintContents): * page/PrintContext.cpp: (WebCore::PrintContext::spoolAllPagesWithBoundaries): * page/cocoa/ResourceUsageOverlayCocoa.mm: (WebCore::HistoricResourceUsageData::HistoricResourceUsageData): * page/linux/ResourceUsageOverlayLinux.cpp: (WebCore::ResourceUsageOverlay::platformInitialize): * platform/adwaita/ScrollbarThemeAdwaita.cpp: * platform/adwaita/ThemeAdwaita.cpp: (WebCore::ThemeAdwaita::activeSelectionForegroundColor const): (WebCore::ThemeAdwaita::activeSelectionBackgroundColor const): (WebCore::ThemeAdwaita::inactiveSelectionForegroundColor const): * platform/graphics/Color.cpp: * platform/graphics/ColorBlending.cpp: (WebCore::blendSourceOver): (WebCore::blendWithWhite): * platform/graphics/ColorBuilder.h: (WebCore::ColorBuilder::colorWithAlpha const): (WebCore::ColorBuilder::ColorBuilder): Deleted. * platform/graphics/ColorTypes.h: (WebCore::SRGBA::SRGBA): * platform/graphics/ColorUtilities.h: (WebCore::clampToComponentBytes): (WebCore::clampToComponentFloats): * platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::getDebugBorderInfo const): * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::recursiveCommitChanges): (WebCore::contentsLayerDebugBorderColor): (WebCore::cloneLayerDebugBorderColor): (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): * platform/graphics/ca/PlatformCALayer.cpp: (WebCore::PlatformCALayer::drawRepaintIndicator): * platform/graphics/ca/TileCoverageMap.cpp: (WebCore::TileCoverageMap::TileCoverageMap): (WebCore::TileCoverageMap::update): * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp: (PlatformCALayerWinInternal::drawRepaintCounters): * platform/graphics/cg/NativeImageCG.cpp: (WebCore::nativeImageSinglePixelSolidColor): * platform/graphics/cocoa/GraphicsContextCocoa.mm: (WebCore::colorForMarkerLineStyle): * platform/graphics/mac/ColorMac.mm: (WebCore::makeSimpleColorFromNSColor): * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp: (WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper): * platform/graphics/win/GraphicsContextCGWin.cpp: (WebCore::GraphicsContext::drawDotsForDocumentMarker): * platform/ios/DragImageIOS.mm: (WebCore::createDragImageForLink): * platform/ios/LegacyTileCache.mm: (WebCore::LegacyTileCache::colorForGridTileBorder const): * platform/mock/MockRealtimeMediaSourceCenter.cpp: (WebCore::defaultDevices): * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::drawBoxes): * platform/mock/ScrollbarThemeMock.cpp: (WebCore::ScrollbarThemeMock::paintTrackBackground): * platform/playstation/ScrollbarThemePlayStation.cpp: (WebCore::ScrollbarThemePlayStation::paintTrackBackground): * platform/win/DragImageWin.cpp: (WebCore::createDragImageForLink): * rendering/RenderEmbeddedObject.cpp: * rendering/RenderFrameSet.cpp: * rendering/RenderLayer.cpp: (WebCore::RenderLayer::beginTransparencyLayers): (WebCore::RenderLayer::paintResizer): * rendering/RenderLayerBacking.cpp: (WebCore::patternForTouchAction): (WebCore::patternForEventListenerRegionType): (WebCore::RenderLayerBacking::paintDebugOverlays): * rendering/RenderTheme.cpp: (WebCore::RenderTheme::platformActiveSelectionBackgroundColor const): (WebCore::RenderTheme::platformInactiveSelectionBackgroundColor const): (WebCore::RenderTheme::systemColor const): (WebCore::RenderTheme::paintSystemPreviewBadge): (WebCore::RenderTheme::platformTapHighlightColor const): * rendering/RenderThemeAdwaita.cpp: * rendering/RenderThemeIOS.h: * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::paintSliderTrack): (WebCore::RenderThemeIOS::paintProgressBar): * rendering/RenderThemeMac.mm: (WebCore::menuBackgroundColor): (WebCore::RenderThemeMac::systemColor const): (WebCore::RenderThemeMac::paintMenuListButtonDecorations): * rendering/RenderThemeWin.cpp: (WebCore::RenderThemeWin::platformActiveSelectionBackgroundColor const): (WebCore::RenderThemeWin::platformInactiveSelectionBackgroundColor const): (WebCore::RenderThemeWin::platformActiveSelectionForegroundColor const): (WebCore::RenderThemeWin::systemColor const): * rendering/SimpleLineLayoutFunctions.cpp: (WebCore::SimpleLineLayout::paintFlow): * rendering/mathml/RenderMathMLBlock.cpp: (WebCore::RenderMathMLBlock::paint): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::colorResolvingCurrentColor const): * rendering/style/SVGRenderStyle.h: (WebCore::SVGRenderStyle::initialStopColor): (WebCore::SVGRenderStyle::initialFloodColor): (WebCore::SVGRenderStyle::initialLightingColor): * testing/MockPageOverlayClient.cpp: (WebCore::MockPageOverlayClient::drawRect): * testing/cocoa/WebViewVisualIdentificationOverlay.mm: (-[WebViewVisualIdentificationOverlay initWithWebView:kind:deprecated:]): Replace makeSimpleColor uses with appropriate alternative. Source/WebKit: * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::drawInContext): * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _tapHighlightColorForFastClick:]): * WebProcess/Inspector/WebInspectorClient.cpp: (WebKit::WebInspectorClient::showPaintRect): * WebProcess/WebPage/FindController.cpp: (WebKit::FindController::drawRect): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::paintSnapshotAtSize): * WebProcess/WebPage/ios/FindControllerIOS.mm: Replace remaining makeSimpleColor() uses. Source/WebKitLegacy/mac: * WebView/WebIndicateLayer.mm: Replace remaining makeSimpleColor() uses. Source/WebKitLegacy/win: * FullscreenVideoController.cpp: * WebView.cpp: (compositionToUnderlines): Replace remaining makeSimpleColor() uses. Source/WTF: * wtf/KeyValuePair.h: (WTF::KeyValuePair::KeyValuePair): Add overload of constructor that is not a template function to aid deduction when using std::initializer_lists to contruct a HashMap. Tools: * TestWebKitAPI/Tests/WebCore/ColorTests.cpp: * TestWebKitAPI/Tests/WebCore/ExtendedColorTests.cpp: * TestWebKitAPI/Tests/WebKitCocoa/PDFSnapshot.mm: * TestWebKitAPI/cocoa/TestPDFDocument.mm: Replace remaining makeSimpleColor() uses. Canonical link: https://commits.webkit.org/227313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@264565 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-07-18 03:13:20 +00:00
context.setStrokeColor(Color::blue);
Make it possible to test page overlays https://bugs.webkit.org/show_bug.cgi?id=137339 Reviewed by Dan Bernstein. Tests: pageoverlay/overlay-installation.html pageoverlay/overlay-large-document-scrolled.html pageoverlay/overlay-large-document.html Do some initial work to make page overlays testable. There are many more tests to be written, but this lays the groundwork. * WebCore.exp.in: * WebCore.xcodeproj/project.pbxproj: * WebCore.vcxproj/WebCoreTestSupport.vcxproj: * WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters: * CMakeLists.txt: Add MockPageOverlayClient. * platform/graphics/GraphicsLayer.h: * page/PageOverlayController.h: * page/PageOverlayController.cpp: (WebCore::PageOverlayController::shouldSkipLayerInDump): Don't skip PageOverlayController-owned layers in the layer tree dump if the layerTreeAsText behavior says that we should include them. * platform/graphics/GraphicsLayer.cpp: (WebCore::dumpChildren): * platform/graphics/GraphicsLayerClient.h: (WebCore::GraphicsLayerClient::shouldSkipLayerInDump): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::shouldSkipLayerInDump): * rendering/RenderLayerBacking.h: Pass the LayerTreeAsTextBehavior through shouldSkipLayerInDump. * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): Uninstall all page overlays when resetting to a consistent state. (WebCore::Internals::installMockPageOverlay): (WebCore::Internals::pageOverlayLayerTreeAsText): Expose two new internals functions. installMockPageOverlay takes "view" or "document", allowing script to choose the appropriate overlay type. pageOverlayLayerTreeAsText dumps both view and document-relative overlays, from each overlay container layer. * testing/Internals.h: * testing/Internals.idl: Fix some typos. * testing/MockPageOverlayClient.cpp: Added. (WebCore::MockPageOverlayClient::shared): (WebCore::MockPageOverlayClient::MockPageOverlayClient): (WebCore::MockPageOverlayClient::installOverlay): (WebCore::MockPageOverlayClient::uninstallAllOverlays): (WebCore::MockPageOverlayClient::layerTreeAsText): (WebCore::MockPageOverlayClient::pageOverlayDestroyed): (WebCore::MockPageOverlayClient::willMoveToPage): (WebCore::MockPageOverlayClient::didMoveToPage): When the overlay is parented, mark it as needing repaint. Future tests might want to test overlays without content, but for now this is a reasonable default behavior. (WebCore::MockPageOverlayClient::drawRect): Paint the overlay rects as described in the LayoutTests ChangeLog. (WebCore::MockPageOverlayClient::mouseEvent): (WebCore::MockPageOverlayClient::didScrollFrame): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeStringValueForPoint): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeBoolValueForPoint): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeNames): * testing/MockPageOverlayClient.h: Added. * pageoverlay/overlay-installation.html: Added. Add a test which just installs one view-relative and one document-relative overlay, and dumps the layer tree and pixel results. The mock overlay strokes a blue rectangle (inset a little from the overlay bounds) for view-relative overlays, and a green rectangle (inset a bit more) for document-relative overlays. * pageoverlay/overlay-large-document.html: Added. * pageoverlay/overlay-large-document-scrolled.html: Added. Tests that do the same as the -installation test, but with a larger document; the view-relative overlay should be the same size (or slightly smaller, because we have scrollbars now), but the document-relative overlay should be the size of the document. The second test scrolls to maxX, maxY, and the document-relative overlay should scroll along with it, while the view-relative overlay should remain fixed. * pageoverlay/overlay-installation-expected.txt: Added. * pageoverlay/overlay-large-document-expected.txt: Added. * pageoverlay/overlay-large-document-scrolled-expected.txt: Added. "Normal" layer tree expectations. * platform/mac-wk1/pageoverlay/overlay-installation-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-installation-expected.txt: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-expected.txt: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-scrolled-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-scrolled-expected.txt: Added. Expected results for WebKit1 differ for view-relative overlays, because we don't currently hook up view-relative overlays for WebKit1. * platform/mac/pageoverlay/overlay-installation-expected.png: Added. * platform/mac/pageoverlay/overlay-large-document-expected.png: Added. * platform/mac/pageoverlay/overlay-large-document-scrolled-expected.png: Added. "Normal" pixel dump expectations. Canonical link: https://commits.webkit.org/155229@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-04 08:47:04 +00:00
insetRect.inflate(-20);
}
context.strokeRect(insetRect, 20);
}
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. Canonical link: https://commits.webkit.org/170422@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194117 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-12-15 22:46:02 +00:00
bool MockPageOverlayClient::mouseEvent(PageOverlay& overlay, const PlatformMouseEvent& event)
Make it possible to test page overlays https://bugs.webkit.org/show_bug.cgi?id=137339 Reviewed by Dan Bernstein. Tests: pageoverlay/overlay-installation.html pageoverlay/overlay-large-document-scrolled.html pageoverlay/overlay-large-document.html Do some initial work to make page overlays testable. There are many more tests to be written, but this lays the groundwork. * WebCore.exp.in: * WebCore.xcodeproj/project.pbxproj: * WebCore.vcxproj/WebCoreTestSupport.vcxproj: * WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters: * CMakeLists.txt: Add MockPageOverlayClient. * platform/graphics/GraphicsLayer.h: * page/PageOverlayController.h: * page/PageOverlayController.cpp: (WebCore::PageOverlayController::shouldSkipLayerInDump): Don't skip PageOverlayController-owned layers in the layer tree dump if the layerTreeAsText behavior says that we should include them. * platform/graphics/GraphicsLayer.cpp: (WebCore::dumpChildren): * platform/graphics/GraphicsLayerClient.h: (WebCore::GraphicsLayerClient::shouldSkipLayerInDump): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::shouldSkipLayerInDump): * rendering/RenderLayerBacking.h: Pass the LayerTreeAsTextBehavior through shouldSkipLayerInDump. * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): Uninstall all page overlays when resetting to a consistent state. (WebCore::Internals::installMockPageOverlay): (WebCore::Internals::pageOverlayLayerTreeAsText): Expose two new internals functions. installMockPageOverlay takes "view" or "document", allowing script to choose the appropriate overlay type. pageOverlayLayerTreeAsText dumps both view and document-relative overlays, from each overlay container layer. * testing/Internals.h: * testing/Internals.idl: Fix some typos. * testing/MockPageOverlayClient.cpp: Added. (WebCore::MockPageOverlayClient::shared): (WebCore::MockPageOverlayClient::MockPageOverlayClient): (WebCore::MockPageOverlayClient::installOverlay): (WebCore::MockPageOverlayClient::uninstallAllOverlays): (WebCore::MockPageOverlayClient::layerTreeAsText): (WebCore::MockPageOverlayClient::pageOverlayDestroyed): (WebCore::MockPageOverlayClient::willMoveToPage): (WebCore::MockPageOverlayClient::didMoveToPage): When the overlay is parented, mark it as needing repaint. Future tests might want to test overlays without content, but for now this is a reasonable default behavior. (WebCore::MockPageOverlayClient::drawRect): Paint the overlay rects as described in the LayoutTests ChangeLog. (WebCore::MockPageOverlayClient::mouseEvent): (WebCore::MockPageOverlayClient::didScrollFrame): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeStringValueForPoint): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeBoolValueForPoint): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeNames): * testing/MockPageOverlayClient.h: Added. * pageoverlay/overlay-installation.html: Added. Add a test which just installs one view-relative and one document-relative overlay, and dumps the layer tree and pixel results. The mock overlay strokes a blue rectangle (inset a little from the overlay bounds) for view-relative overlays, and a green rectangle (inset a bit more) for document-relative overlays. * pageoverlay/overlay-large-document.html: Added. * pageoverlay/overlay-large-document-scrolled.html: Added. Tests that do the same as the -installation test, but with a larger document; the view-relative overlay should be the same size (or slightly smaller, because we have scrollbars now), but the document-relative overlay should be the size of the document. The second test scrolls to maxX, maxY, and the document-relative overlay should scroll along with it, while the view-relative overlay should remain fixed. * pageoverlay/overlay-installation-expected.txt: Added. * pageoverlay/overlay-large-document-expected.txt: Added. * pageoverlay/overlay-large-document-scrolled-expected.txt: Added. "Normal" layer tree expectations. * platform/mac-wk1/pageoverlay/overlay-installation-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-installation-expected.txt: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-expected.txt: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-scrolled-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-scrolled-expected.txt: Added. Expected results for WebKit1 differ for view-relative overlays, because we don't currently hook up view-relative overlays for WebKit1. * platform/mac/pageoverlay/overlay-installation-expected.png: Added. * platform/mac/pageoverlay/overlay-large-document-expected.png: Added. * platform/mac/pageoverlay/overlay-large-document-scrolled-expected.png: Added. "Normal" pixel dump expectations. Canonical link: https://commits.webkit.org/155229@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-04 08:47:04 +00:00
{
Remove StringBuilder::appendNumber https://bugs.webkit.org/show_bug.cgi?id=225732 Reviewed by Sam Weinig. Source/JavaScriptCore: * API/JSContextRef.cpp: (BacktraceFunctor::operator() const): Use append instead of appendNumber. * API/tests/PingPongStackOverflowTest.cpp: (PingPongStackOverflowObject_hasInstance): Ditto. * heap/HeapSnapshotBuilder.cpp: (JSC::HeapSnapshotBuilder::json): Ditto. * interpreter/StackVisitor.cpp: (JSC::StackVisitor::Frame::toString const): Use makeString instead of StringBuilder. * runtime/ConsoleClient.cpp: (JSC::appendURLAndPosition): Ditto. (JSC::ConsoleClient::printConsoleMessageWithArguments): Use append instead of appendNumber. * runtime/JSONObject.cpp: (JSC::Stringifier::appendStringifiedValue): Ditto. * runtime/Options.cpp: (JSC::OptionReader::Option::dump const): Ditto. * runtime/StackFrame.cpp: (JSC::StackFrame::toString const): Use makeString instead of StringBuilder. Source/WebCore: * Modules/indexeddb/server/IndexValueStore.cpp: (WebCore::IDBServer::IndexValueStore::loggingString const): Use append instead of appendNumber. * Modules/websockets/WebSocketHandshake.cpp: (WebCore::hostName): Use makeString instead of StringBuilder. * contentextensions/CombinedURLFilters.cpp: (WebCore::ContentExtensions::prefixTreeVertexToString): Use append instead of appendNumber. * contentextensions/Term.h: (WebCore::ContentExtensions::Term::toString const): Ditto. * css/CSSFontFeatureValue.cpp: (WebCore::CSSFontFeatureValue::customCSSText const): Ditto. * css/CSSTimingFunctionValue.cpp: (WebCore::CSSStepsTimingFunctionValue::customCSSText const): Ditto. * dom/Document.cpp: (WebCore::Document::downgradeReferrerToRegistrableDomain): Use makeString instead of StringBuilder. * editing/MarkupAccumulator.cpp: (WebCore::MarkupAccumulator::generateUniquePrefix): Ditto. * editing/cocoa/DataDetection.mm: (WebCore::dataDetectorStringForPath): Use append instead of appendNumber. * html/HTMLAnchorElement.cpp: (WebCore::appendServerMapMousePosition): Ditto. * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::createContext2d): Use makeString instead of StringBuilder. (WebCore::HTMLCanvasElement::createImageBuffer const): Ditto. * loader/ResourceLoadStatistics.cpp: (WebCore::ResourceLoadStatistics::toString const): Use append instead of appendNumber. * loader/SubresourceIntegrity.cpp: (WebCore::integrityMismatchDescription): Use makeString instead of StringBuilder. * page/IntersectionObserver.cpp: (WebCore::IntersectionObserver::rootMargin const): Use append instead of appendNumber. * page/SecurityOriginData.cpp: (WebCore::SecurityOriginData::databaseIdentifier const): Use makeString instead of StringBuilder. * platform/Decimal.cpp: (WebCore::Decimal::toString const): Use append instead of appendNumber. * platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::animationNameForTransition): Use makeString instead of StringBuilder. * platform/graphics/ca/TileController.cpp: (WebCore::TileController::createTileLayer): Ditto. * platform/graphics/ca/win/PlatformCALayerWin.cpp: (printTransform): Use single append instead of a run of them. (printLayer): Ditto, and use append instead of apppendNumber. (PlatformCALayerWin::layerTreeAsString const): Ditto. * platform/mediarecorder/MediaRecorderPrivateMock.cpp: (WebCore::MediaRecorderPrivateMock::generateMockCounterString): Use append instead of appendNumber. * platform/network/ProxyServer.cpp: (WebCore::appendProxyServerString): Ditto. * rendering/RenderTreeAsText.cpp: (WebCore::nodePosition): Ditto. * svg/SVGPathUtilities.cpp: (WebCore::buildStringFromPath): Ditto. * testing/Internals.cpp: (WebCore::Internals::parserMetaData): Use makeString instead of StringBuilder. (WebCore::appendOffsets): Use append instead of appendNumber. * testing/MockPageOverlayClient.cpp: (WebCore::MockPageOverlayClient::drawRect): Use makeString instead of StringBuilder. (WebCore::MockPageOverlayClient::mouseEvent): Ditto. * xml/XMLErrors.cpp: (WebCore::XMLErrors::appendErrorMessage): Use append instead of appendNumber. Source/WebDriver: * SessionHost.cpp: (WebDriver::SessionHost::sendCommandToBackend): Use append instead of appendNumber. * socket/HTTPServerSocket.cpp: (WebDriver::HTTPRequestHandler::packHTTPMessage const): Ditto. Source/WebKit: * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: (WebKit::buildList): Use append instead of appendNumber. (WebKit::ResourceLoadStatisticsDatabaseStore::findNotVeryPrevalentResources): Ditto. (WebKit::ResourceLoadStatisticsDatabaseStore::resourceToString const): Ditto. (WebKit::ResourceLoadStatisticsDatabaseStore::attributionToString): Ditto. (WebKit::ResourceLoadStatisticsDatabaseStore::privateClickMeasurementToString): Ditto. * Shared/WebMemorySampler.cpp: (WebKit::WebMemorySampler::appendCurrentMemoryUsageToFile): Ditto. * UIProcess/API/glib/WebKitWebView.cpp: (webkitWebViewRunJavaScriptCallback): Ditto. * UIProcess/WebBackForwardList.cpp: (WebKit::WebBackForwardList::loggingString): Ditto. * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp: (PageResourceLoadClient::didReceiveResponseForResource): Use makeString instead of StringBuilder. * WebProcess/Plugins/PluginView.cpp: (WebKit::buildHTTPHeaders): Use append instead of appendNumber. Source/WebKitLegacy/win: * WebKitStatistics.cpp: (WebKitStatistics::comClassNameCounts): Use append instead of appendNumber. Source/WTF: We originally added StringBuilder::appendNumber to resolve the ambiguity between UChar and uint16_t, but that problem was solved long ago and it is safe to use StringBuilder::append, including the variadic form, on all types of numbers and we'll get the same results we did with appendNumber. * wtf/JSONValues.cpp: (WTF::JSONImpl::Value::writeJSON const): Use append instead of appendNumber. * wtf/text/StringBuilder.cpp: (WTF::StringBuilder::appendNumber): Deleted. * wtf/text/StringBuilder.h: Removed appendNumber. * wtf/text/TextStream.cpp: (WTF::TextStream::operator<<): Use append instead of appendNumber. Tools: * TestWebKitAPI/Tests/WTF/StringBuilder.cpp: Test append with a number instead of appendNumber. * TestWebKitAPI/Tests/WebKitGLib/TestAutomationSession.cpp: Use append instead of appendNumber. * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp: (WTR::dumpResponseDescriptionSuitableForTestResult): Use append instead of appendNumber. (WTR::dumpFrameScrollPosition): Ditto. (WTR::InjectedBundlePage::didFinishDocumentLoadForFrame): Use makeString instead of StringBuilder. (WTR::InjectedBundlePage::shouldCacheResponse): Ditto. * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp: (WTR::attributesOfElement): Use append instead of appendNumber. (WTR::AccessibilityUIElement::attributedStringForRange): Ditto. (WTR::stringAtOffset): Ditto. Canonical link: https://commits.webkit.org/237685@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277437 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-13 16:18:32 +00:00
overlay.page()->mainFrame().document()->addConsoleMessage(MessageSource::Other, MessageLevel::Debug,
makeString("MockPageOverlayClient::mouseEvent location (", event.position().x(), ", ", event.position().y(), ')'));
Make it possible to test page overlays https://bugs.webkit.org/show_bug.cgi?id=137339 Reviewed by Dan Bernstein. Tests: pageoverlay/overlay-installation.html pageoverlay/overlay-large-document-scrolled.html pageoverlay/overlay-large-document.html Do some initial work to make page overlays testable. There are many more tests to be written, but this lays the groundwork. * WebCore.exp.in: * WebCore.xcodeproj/project.pbxproj: * WebCore.vcxproj/WebCoreTestSupport.vcxproj: * WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters: * CMakeLists.txt: Add MockPageOverlayClient. * platform/graphics/GraphicsLayer.h: * page/PageOverlayController.h: * page/PageOverlayController.cpp: (WebCore::PageOverlayController::shouldSkipLayerInDump): Don't skip PageOverlayController-owned layers in the layer tree dump if the layerTreeAsText behavior says that we should include them. * platform/graphics/GraphicsLayer.cpp: (WebCore::dumpChildren): * platform/graphics/GraphicsLayerClient.h: (WebCore::GraphicsLayerClient::shouldSkipLayerInDump): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::shouldSkipLayerInDump): * rendering/RenderLayerBacking.h: Pass the LayerTreeAsTextBehavior through shouldSkipLayerInDump. * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): Uninstall all page overlays when resetting to a consistent state. (WebCore::Internals::installMockPageOverlay): (WebCore::Internals::pageOverlayLayerTreeAsText): Expose two new internals functions. installMockPageOverlay takes "view" or "document", allowing script to choose the appropriate overlay type. pageOverlayLayerTreeAsText dumps both view and document-relative overlays, from each overlay container layer. * testing/Internals.h: * testing/Internals.idl: Fix some typos. * testing/MockPageOverlayClient.cpp: Added. (WebCore::MockPageOverlayClient::shared): (WebCore::MockPageOverlayClient::MockPageOverlayClient): (WebCore::MockPageOverlayClient::installOverlay): (WebCore::MockPageOverlayClient::uninstallAllOverlays): (WebCore::MockPageOverlayClient::layerTreeAsText): (WebCore::MockPageOverlayClient::pageOverlayDestroyed): (WebCore::MockPageOverlayClient::willMoveToPage): (WebCore::MockPageOverlayClient::didMoveToPage): When the overlay is parented, mark it as needing repaint. Future tests might want to test overlays without content, but for now this is a reasonable default behavior. (WebCore::MockPageOverlayClient::drawRect): Paint the overlay rects as described in the LayoutTests ChangeLog. (WebCore::MockPageOverlayClient::mouseEvent): (WebCore::MockPageOverlayClient::didScrollFrame): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeStringValueForPoint): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeBoolValueForPoint): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeNames): * testing/MockPageOverlayClient.h: Added. * pageoverlay/overlay-installation.html: Added. Add a test which just installs one view-relative and one document-relative overlay, and dumps the layer tree and pixel results. The mock overlay strokes a blue rectangle (inset a little from the overlay bounds) for view-relative overlays, and a green rectangle (inset a bit more) for document-relative overlays. * pageoverlay/overlay-large-document.html: Added. * pageoverlay/overlay-large-document-scrolled.html: Added. Tests that do the same as the -installation test, but with a larger document; the view-relative overlay should be the same size (or slightly smaller, because we have scrollbars now), but the document-relative overlay should be the size of the document. The second test scrolls to maxX, maxY, and the document-relative overlay should scroll along with it, while the view-relative overlay should remain fixed. * pageoverlay/overlay-installation-expected.txt: Added. * pageoverlay/overlay-large-document-expected.txt: Added. * pageoverlay/overlay-large-document-scrolled-expected.txt: Added. "Normal" layer tree expectations. * platform/mac-wk1/pageoverlay/overlay-installation-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-installation-expected.txt: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-expected.txt: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-scrolled-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-scrolled-expected.txt: Added. Expected results for WebKit1 differ for view-relative overlays, because we don't currently hook up view-relative overlays for WebKit1. * platform/mac/pageoverlay/overlay-installation-expected.png: Added. * platform/mac/pageoverlay/overlay-large-document-expected.png: Added. * platform/mac/pageoverlay/overlay-large-document-scrolled-expected.png: Added. "Normal" pixel dump expectations. Canonical link: https://commits.webkit.org/155229@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-04 08:47:04 +00:00
return false;
}
void MockPageOverlayClient::didScrollFrame(PageOverlay&, Frame&)
{
}
bool MockPageOverlayClient::copyAccessibilityAttributeStringValueForPoint(PageOverlay&, String /* attribute */, FloatPoint, String&)
{
return false;
}
bool MockPageOverlayClient::copyAccessibilityAttributeBoolValueForPoint(PageOverlay&, String /* attribute */, FloatPoint, bool&)
{
return false;
}
Vector<String> MockPageOverlayClient::copyAccessibilityAttributeNames(PageOverlay&, bool /* parameterizedNames */)
{
return Vector<String>();
}
}