Diff
Modified: trunk/LayoutTests/ChangeLog (174314 => 174315)
--- trunk/LayoutTests/ChangeLog 2014-10-04 08:37:57 UTC (rev 174314)
+++ trunk/LayoutTests/ChangeLog 2014-10-04 08:47:04 UTC (rev 174315)
@@ -1,3 +1,45 @@
+2014-10-04 Tim Horton <timothy_hor...@apple.com>
+
+ Make it possible to test page overlays
+ https://bugs.webkit.org/show_bug.cgi?id=137339
+
+ Reviewed by Dan Bernstein.
+
+ * 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.
+
2014-10-04 Roger Fong <roger_f...@apple.com>
[Windows] Skip remaining failing media tests after adding audio devices to the bots.
Added: trunk/LayoutTests/pageoverlay/overlay-installation-expected.txt (0 => 174315)
--- trunk/LayoutTests/pageoverlay/overlay-installation-expected.txt (rev 0)
+++ trunk/LayoutTests/pageoverlay/overlay-installation-expected.txt 2014-10-04 08:47:04 UTC (rev 174315)
@@ -0,0 +1,25 @@
+View-relative:
+(GraphicsLayer
+ (children 1
+ (GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 800.00 600.00)
+ (drawsContent 1)
+ (backgroundColor #00000000)
+ )
+ )
+)
+
+
+Document-relative:
+(GraphicsLayer
+ (children 1
+ (GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 800.00 600.00)
+ (drawsContent 1)
+ (backgroundColor #00000000)
+ )
+ )
+)
+
Added: trunk/LayoutTests/pageoverlay/overlay-installation.html (0 => 174315)
--- trunk/LayoutTests/pageoverlay/overlay-installation.html (rev 0)
+++ trunk/LayoutTests/pageoverlay/overlay-installation.html 2014-10-04 08:47:04 UTC (rev 174315)
@@ -0,0 +1,17 @@
+<html>
+<script>
+window._onload_ = function () {
+ if (window.testRunner && window.internals) {
+ testRunner.dumpAsText(true);
+ internals.installMockPageOverlay("document");
+ internals.installMockPageOverlay("view");
+
+ var layersResult = document.getElementById('layers');
+ layersResult.innerText = window.internals.pageOverlayLayerTreeAsText();
+ }
+}
+</script>
+<body>
+ <pre id="layers" style="position: absolute; height: 1px; width: 1px; overflow: hidden;"></pre>
+</body>
+</html>
\ No newline at end of file
Added: trunk/LayoutTests/pageoverlay/overlay-large-document-expected.txt (0 => 174315)
--- trunk/LayoutTests/pageoverlay/overlay-large-document-expected.txt (rev 0)
+++ trunk/LayoutTests/pageoverlay/overlay-large-document-expected.txt 2014-10-04 08:47:04 UTC (rev 174315)
@@ -0,0 +1,25 @@
+View-relative:
+(GraphicsLayer
+ (children 1
+ (GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 785.00 585.00)
+ (drawsContent 1)
+ (backgroundColor #00000000)
+ )
+ )
+)
+
+
+Document-relative:
+(GraphicsLayer
+ (children 1
+ (GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 5008.00 5016.00)
+ (drawsContent 1)
+ (backgroundColor #00000000)
+ )
+ )
+)
+
Added: trunk/LayoutTests/pageoverlay/overlay-large-document-scrolled-expected.txt (0 => 174315)
--- trunk/LayoutTests/pageoverlay/overlay-large-document-scrolled-expected.txt (rev 0)
+++ trunk/LayoutTests/pageoverlay/overlay-large-document-scrolled-expected.txt 2014-10-04 08:47:04 UTC (rev 174315)
@@ -0,0 +1,25 @@
+View-relative:
+(GraphicsLayer
+ (children 1
+ (GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 785.00 585.00)
+ (drawsContent 1)
+ (backgroundColor #00000000)
+ )
+ )
+)
+
+
+Document-relative:
+(GraphicsLayer
+ (children 1
+ (GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 5008.00 5016.00)
+ (drawsContent 1)
+ (backgroundColor #00000000)
+ )
+ )
+)
+
Added: trunk/LayoutTests/pageoverlay/overlay-large-document-scrolled.html (0 => 174315)
--- trunk/LayoutTests/pageoverlay/overlay-large-document-scrolled.html (rev 0)
+++ trunk/LayoutTests/pageoverlay/overlay-large-document-scrolled.html 2014-10-04 08:47:04 UTC (rev 174315)
@@ -0,0 +1,25 @@
+<html>
+<style>
+body {
+ height: 5000px;
+ width: 5000px;
+}
+</style>
+<script>
+window._onload_ = function () {
+ if (window.testRunner && window.internals) {
+ testRunner.dumpAsText(true);
+ internals.installMockPageOverlay("document");
+ internals.installMockPageOverlay("view");
+
+ window.scrollTo(10000, 10000);
+
+ var layersResult = document.getElementById('layers');
+ layersResult.innerText = window.internals.pageOverlayLayerTreeAsText();
+ }
+}
+</script>
+<body>
+ <pre id="layers" style="position: absolute; height: 1px; width: 1px; overflow: hidden;"></pre>
+</body>
+</html>
\ No newline at end of file
Added: trunk/LayoutTests/pageoverlay/overlay-large-document.html (0 => 174315)
--- trunk/LayoutTests/pageoverlay/overlay-large-document.html (rev 0)
+++ trunk/LayoutTests/pageoverlay/overlay-large-document.html 2014-10-04 08:47:04 UTC (rev 174315)
@@ -0,0 +1,23 @@
+<html>
+<style>
+body {
+ height: 5000px;
+ width: 5000px;
+}
+</style>
+<script>
+window._onload_ = function () {
+ if (window.testRunner && window.internals) {
+ testRunner.dumpAsText(true);
+ internals.installMockPageOverlay("document");
+ internals.installMockPageOverlay("view");
+
+ var layersResult = document.getElementById('layers');
+ layersResult.innerText = window.internals.pageOverlayLayerTreeAsText();
+ }
+}
+</script>
+<body>
+ <pre id="layers" style="position: absolute; height: 1px; width: 1px; overflow: hidden;"></pre>
+</body>
+</html>
\ No newline at end of file
Added: trunk/LayoutTests/platform/mac/pageoverlay/overlay-installation-expected.png
(Binary files differ)
Property changes on: trunk/LayoutTests/platform/mac/pageoverlay/overlay-installation-expected.png
___________________________________________________________________
Added: svn:mime-type
Added: trunk/LayoutTests/platform/mac/pageoverlay/overlay-large-document-expected.png
(Binary files differ)
Property changes on: trunk/LayoutTests/platform/mac/pageoverlay/overlay-large-document-expected.png
___________________________________________________________________
Added: svn:mime-type
Added: trunk/LayoutTests/platform/mac/pageoverlay/overlay-large-document-scrolled-expected.png
(Binary files differ)
Property changes on: trunk/LayoutTests/platform/mac/pageoverlay/overlay-large-document-scrolled-expected.png
___________________________________________________________________
Added: svn:mime-type
Added: trunk/LayoutTests/platform/mac-wk1/pageoverlay/overlay-installation-expected.png
(Binary files differ)
Property changes on: trunk/LayoutTests/platform/mac-wk1/pageoverlay/overlay-installation-expected.png
___________________________________________________________________
Added: svn:mime-type
Added: trunk/LayoutTests/platform/mac-wk1/pageoverlay/overlay-installation-expected.txt (0 => 174315)
--- trunk/LayoutTests/platform/mac-wk1/pageoverlay/overlay-installation-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/mac-wk1/pageoverlay/overlay-installation-expected.txt 2014-10-04 08:47:04 UTC (rev 174315)
@@ -0,0 +1,25 @@
+View-relative:
+(GraphicsLayer
+ (children 1
+ (GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 800.00 600.00)
+ (drawsContent 1)
+ (backgroundColor #00000000)
+ )
+ )
+)
+
+
+Document-relative:
+(GraphicsLayer
+ (children 1
+ (GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 800.00 600.00)
+ (drawsContent 1)
+ (backgroundColor #00000000)
+ )
+ )
+)
+
Added: trunk/LayoutTests/platform/mac-wk1/pageoverlay/overlay-large-document-expected.png
(Binary files differ)
Property changes on: trunk/LayoutTests/platform/mac-wk1/pageoverlay/overlay-large-document-expected.png
___________________________________________________________________
Added: svn:mime-type
Added: trunk/LayoutTests/platform/mac-wk1/pageoverlay/overlay-large-document-expected.txt (0 => 174315)
--- trunk/LayoutTests/platform/mac-wk1/pageoverlay/overlay-large-document-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/mac-wk1/pageoverlay/overlay-large-document-expected.txt 2014-10-04 08:47:04 UTC (rev 174315)
@@ -0,0 +1,25 @@
+View-relative:
+(GraphicsLayer
+ (children 1
+ (GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 800.00 600.00)
+ (drawsContent 1)
+ (backgroundColor #00000000)
+ )
+ )
+)
+
+
+Document-relative:
+(GraphicsLayer
+ (children 1
+ (GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 5008.00 5016.00)
+ (drawsContent 1)
+ (backgroundColor #00000000)
+ )
+ )
+)
+
Added: trunk/LayoutTests/platform/mac-wk1/pageoverlay/overlay-large-document-scrolled-expected.png
(Binary files differ)
Property changes on: trunk/LayoutTests/platform/mac-wk1/pageoverlay/overlay-large-document-scrolled-expected.png
___________________________________________________________________
Added: svn:mime-type
Added: trunk/LayoutTests/platform/mac-wk1/pageoverlay/overlay-large-document-scrolled-expected.txt (0 => 174315)
--- trunk/LayoutTests/platform/mac-wk1/pageoverlay/overlay-large-document-scrolled-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/mac-wk1/pageoverlay/overlay-large-document-scrolled-expected.txt 2014-10-04 08:47:04 UTC (rev 174315)
@@ -0,0 +1,25 @@
+View-relative:
+(GraphicsLayer
+ (children 1
+ (GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 800.00 600.00)
+ (drawsContent 1)
+ (backgroundColor #00000000)
+ )
+ )
+)
+
+
+Document-relative:
+(GraphicsLayer
+ (children 1
+ (GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 5008.00 5016.00)
+ (drawsContent 1)
+ (backgroundColor #00000000)
+ )
+ )
+)
+
Modified: trunk/Source/WebCore/CMakeLists.txt (174314 => 174315)
--- trunk/Source/WebCore/CMakeLists.txt 2014-10-04 08:37:57 UTC (rev 174314)
+++ trunk/Source/WebCore/CMakeLists.txt 2014-10-04 08:47:04 UTC (rev 174315)
@@ -3170,6 +3170,8 @@
testing/InternalSettings.cpp
testing/Internals.cpp
+ testing/MockPageOverlayClient.cpp
+
testing/js/WebCoreTestSupport.cpp
)
Modified: trunk/Source/WebCore/ChangeLog (174314 => 174315)
--- trunk/Source/WebCore/ChangeLog 2014-10-04 08:37:57 UTC (rev 174314)
+++ trunk/Source/WebCore/ChangeLog 2014-10-04 08:47:04 UTC (rev 174315)
@@ -1,3 +1,81 @@
+2014-10-04 Tim Horton <timothy_hor...@apple.com>
+
+ 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.
+
2014-10-04 Carlos Garcia Campos <cgar...@igalia.com>
Move DragController::createFragmentFromDragData implementation to the editor
Modified: trunk/Source/WebCore/WebCore.exp.in (174314 => 174315)
--- trunk/Source/WebCore/WebCore.exp.in 2014-10-04 08:37:57 UTC (rev 174314)
+++ trunk/Source/WebCore/WebCore.exp.in 2014-10-04 08:47:04 UTC (rev 174315)
@@ -919,6 +919,7 @@
__ZN7WebCore21PageOverlayController18installPageOverlayEN3WTF10PassRefPtrINS_11PageOverlayEEENS3_8FadeModeE
__ZN7WebCore21PageOverlayController20uninstallPageOverlayEPNS_11PageOverlayENS1_8FadeModeE
__ZN7WebCore21PageOverlayController20viewOverlayRootLayerEv
+__ZN7WebCore21PageOverlayController24documentOverlayRootLayerEv
__ZN7WebCore21PageOverlayController32copyAccessibilityAttributesNamesEb
__ZN7WebCore21PageOverlayController43copyAccessibilityAttributeBoolValueForPointEN3WTF6StringENS_10FloatPointERb
__ZN7WebCore21PageOverlayController45copyAccessibilityAttributeStringValueForPointEN3WTF6StringENS_10FloatPointERS2_
@@ -1065,6 +1066,7 @@
__ZN7WebCore28UserMessageHandlerDescriptorD1Ev
__ZN7WebCore28encodeWithURLEscapeSequencesERKN3WTF6StringE
__ZN7WebCore28removeLanguageChangeObserverEPv
+__ZN7WebCore28throwArgumentMustBeEnumErrorERN3JSC9ExecStateEjPKcS4_S4_S4_
__ZN7WebCore29cookieRequestHeaderFieldValueERKNS_21NetworkStorageSessionERKNS_3URLES5_
__ZN7WebCore29createDefaultParagraphElementERNS_8DocumentE
__ZN7WebCore29isCharacterSmartReplaceExemptEib
@@ -1616,6 +1618,7 @@
__ZNK7WebCore11HistoryItem8referrerEv
__ZNK7WebCore11HistoryItem9urlStringEv
__ZNK7WebCore11HistoryItem9viewStateEv
+__ZNK7WebCore11PageOverlay10controllerEv
__ZNK7WebCore11PageOverlay5frameEv
__ZNK7WebCore11PageOverlay6boundsEv
__ZNK7WebCore11RenderBlock25inlineElementContinuationEv
@@ -1642,6 +1645,7 @@
__ZNK7WebCore12TextIterator4nodeEv
__ZNK7WebCore12TextIterator5rangeEv
__ZNK7WebCore13ContainerNode15countChildNodesEv
+__ZNK7WebCore13GraphicsLayer15layerTreeAsTextEj
__ZNK7WebCore13GraphicsLayer18accumulatedOpacityEv
__ZNK7WebCore13GraphicsLayer18getDebugBorderInfoERNS_5ColorERf
__ZNK7WebCore13GraphicsLayer26backingStoreMemoryEstimateEv
Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCoreTestSupport.vcxproj (174314 => 174315)
--- trunk/Source/WebCore/WebCore.vcxproj/WebCoreTestSupport.vcxproj 2014-10-04 08:37:57 UTC (rev 174314)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCoreTestSupport.vcxproj 2014-10-04 08:47:04 UTC (rev 174315)
@@ -706,6 +706,68 @@
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Production|x64'">
</ForcedIncludeFiles>
</ClCompile>
+ <ClCompile Include="..\testing\MockPageOverlayClient.cpp">
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ </PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ </PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">
+ </PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">
+ </PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">
+ </PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">
+ </PrecompiledHeader>
+ <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">4065;4273;4565;4701;4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">4065;4273;4565;4701;4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">4065;4273;4565;4701;4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">4065;4273;4565;4701;4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">4065;4273;4565;4701;4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">4065;4273;4565;4701;4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ </ForcedIncludeFiles>
+ <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ </ForcedIncludeFiles>
+ <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">
+ </ForcedIncludeFiles>
+ <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">
+ </ForcedIncludeFiles>
+ <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">
+ </ForcedIncludeFiles>
+ <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">
+ </ForcedIncludeFiles>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ </PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ </PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">
+ </PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">
+ </PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">
+ </PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Production|x64'">
+ </PrecompiledHeader>
+ <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">4065;4273;4565;4701;4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release|x64'">4065;4273;4565;4701;4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">4065;4273;4565;4701;4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">4065;4273;4565;4701;4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">4065;4273;4565;4701;4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Production|x64'">4065;4273;4565;4701;4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ </ForcedIncludeFiles>
+ <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ </ForcedIncludeFiles>
+ <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">
+ </ForcedIncludeFiles>
+ <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">
+ </ForcedIncludeFiles>
+ <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">
+ </ForcedIncludeFiles>
+ <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Production|x64'">
+ </ForcedIncludeFiles>
+ </ClCompile>
<ClCompile Include="..\testing\InternalSettings.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
</PrecompiledHeader>
@@ -856,6 +918,7 @@
<ClInclude Include="..\testing\MallocStatistics.h" />
<ClInclude Include="..\testing\MemoryInfo.h" />
<ClInclude Include="..\testing\MockCDM.h" />
+ <ClInclude Include="..\testing\MockPageOverlayClient.h" />
<ClInclude Include="..\testing\TypeConversions.h" />
<ClInclude Include="..\testing\Internals.h" />
<ClInclude Include="..\testing\InternalSettings.h" />
Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters (174314 => 174315)
--- trunk/Source/WebCore/WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters 2014-10-04 08:37:57 UTC (rev 174314)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters 2014-10-04 08:47:04 UTC (rev 174315)
@@ -42,6 +42,9 @@
<ClCompile Include="..\testing\MockCDM.cpp">
<Filter>testing</Filter>
</ClCompile>
+ <ClCompile Include="..\testing\MockPageOverlayClient.cpp">
+ <Filter>testing</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\WebCore\DerivedSources\InternalSettingsGenerated.h">
@@ -87,5 +90,8 @@
<ClInclude Include="..\testing\MockCDM.h">
<Filter>testing</Filter>
</ClInclude>
+ <ClInclude Include="..\testing\MockPageOverlayClient.h">
+ <Filter>testing</Filter>
+ </ClInclude>
</ItemGroup>
</Project>
\ No newline at end of file
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (174314 => 174315)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2014-10-04 08:37:57 UTC (rev 174314)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2014-10-04 08:47:04 UTC (rev 174315)
@@ -1106,6 +1106,8 @@
2D8FEBDD143E3EF70072502B /* CSSCrossfadeValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D8FEBDB143E3EF70072502B /* CSSCrossfadeValue.h */; };
2D9066060BE141D400956998 /* LayoutState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D9066040BE141D400956998 /* LayoutState.cpp */; };
2D9066070BE141D400956998 /* LayoutState.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D9066050BE141D400956998 /* LayoutState.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 2D97F04719DD413C001EE9C3 /* MockPageOverlayClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2DAAE32C19DCAF6000E002D2 /* MockPageOverlayClient.cpp */; };
+ 2D97F04819DD4140001EE9C3 /* MockPageOverlayClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DAAE32D19DCAF6000E002D2 /* MockPageOverlayClient.h */; };
2D9A246E15B9BD0000D34527 /* DOMSecurityPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D9A246B15B9BBDD00D34527 /* DOMSecurityPolicy.h */; };
2D9A246F15B9BD2F00D34527 /* DOMSecurityPolicy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D9A246A15B9BBDD00D34527 /* DOMSecurityPolicy.cpp */; };
2D9A247315B9C2D100D34527 /* DOMDOMSecurityPolicy.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D9A247215B9C2C700D34527 /* DOMDOMSecurityPolicy.mm */; };
@@ -8110,6 +8112,8 @@
2D9A247115B9C29500D34527 /* DOMDOMSecurityPolicyInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMDOMSecurityPolicyInternal.h; sourceTree = "<group>"; };
2D9A247215B9C2C700D34527 /* DOMDOMSecurityPolicy.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMDOMSecurityPolicy.mm; sourceTree = "<group>"; };
2D9F0E1214FF1CBF00BA0FF7 /* linearSRGB.icc */ = {isa = PBXFileReference; lastKnownFileType = file; path = linearSRGB.icc; sourceTree = "<group>"; };
+ 2DAAE32C19DCAF6000E002D2 /* MockPageOverlayClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MockPageOverlayClient.cpp; sourceTree = "<group>"; };
+ 2DAAE32D19DCAF6000E002D2 /* MockPageOverlayClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MockPageOverlayClient.h; sourceTree = "<group>"; };
2DE70022192FE82A00B0975C /* DisplayRefreshMonitorMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DisplayRefreshMonitorMac.h; sourceTree = "<group>"; };
2E0888C3114883A900AF4265 /* DOMFormData.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMFormData.idl; sourceTree = "<group>"; };
2E0888D21148848A00AF4265 /* JSDOMFormData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMFormData.cpp; sourceTree = "<group>"; };
@@ -15591,6 +15595,8 @@
CD5393CC175DCCE600C07123 /* MemoryInfo.idl */,
CDC26B3C160A62B00026757B /* MockCDM.cpp */,
CDC26B3D160A62B00026757B /* MockCDM.h */,
+ 2DAAE32C19DCAF6000E002D2 /* MockPageOverlayClient.cpp */,
+ 2DAAE32D19DCAF6000E002D2 /* MockPageOverlayClient.h */,
EB081CD81696084400553730 /* TypeConversions.h */,
EB081CD91696084400553730 /* TypeConversions.idl */,
E1BA67191742BEF400C20251 /* WebCoreTestShimLibrary.cpp */,
@@ -23249,6 +23255,7 @@
EBF5121D1696496C0056BD25 /* JSTypeConversions.h in Headers */,
CDC26B41160A8CCE0026757B /* MockCDM.h in Headers */,
AA5F3B8D16CC33D100455EB0 /* PlatformSpeechSynthesizerMock.h in Headers */,
+ 2D97F04819DD4140001EE9C3 /* MockPageOverlayClient.h in Headers */,
41815C1F138319830057AAA4 /* WebCoreTestSupport.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -26998,6 +27005,7 @@
A740B5A714C935AF00A77FA4 /* JSInternalSettings.cpp in Sources */,
53ED3FDE167A88E7006762E6 /* JSInternalSettingsGenerated.cpp in Sources */,
A740B59714C935AF00A77FA4 /* JSMallocStatistics.cpp in Sources */,
+ 2D97F04719DD413C001EE9C3 /* MockPageOverlayClient.cpp in Sources */,
CD5393D3175E018600C07123 /* JSMemoryInfo.cpp in Sources */,
EBF5121C1696496C0056BD25 /* JSTypeConversions.cpp in Sources */,
CDC26B40160A8CC60026757B /* MockCDM.cpp in Sources */,
Modified: trunk/Source/WebCore/page/PageOverlayController.cpp (174314 => 174315)
--- trunk/Source/WebCore/page/PageOverlayController.cpp 2014-10-04 08:37:57 UTC (rev 174314)
+++ trunk/Source/WebCore/page/PageOverlayController.cpp 2014-10-04 08:47:04 UTC (rev 174315)
@@ -358,4 +358,9 @@
m_overlayGraphicsLayers.get(&overlay)->setBackgroundColor(overlay.backgroundColor());
}
+bool PageOverlayController::shouldSkipLayerInDump(const GraphicsLayer*, LayerTreeAsTextBehavior behavior) const
+{
+ return !(behavior & LayerTreeAsTextIncludePageOverlayLayers);
+}
+
} // namespace WebKit
Modified: trunk/Source/WebCore/page/PageOverlayController.h (174314 => 174315)
--- trunk/Source/WebCore/page/PageOverlayController.h 2014-10-04 08:37:57 UTC (rev 174314)
+++ trunk/Source/WebCore/page/PageOverlayController.h 2014-10-04 08:47:04 UTC (rev 174315)
@@ -87,7 +87,7 @@
virtual void notifyFlushRequired(const GraphicsLayer*) override;
virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const FloatRect& clipRect) override;
virtual float deviceScaleFactor() const override;
- virtual bool shouldSkipLayerInDump(const GraphicsLayer*) const override { return true; }
+ virtual bool shouldSkipLayerInDump(const GraphicsLayer*, LayerTreeAsTextBehavior) const override;
std::unique_ptr<GraphicsLayer> m_documentOverlayRootLayer;
std::unique_ptr<GraphicsLayer> m_viewOverlayRootLayer;
Modified: trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp (174314 => 174315)
--- trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp 2014-10-04 08:37:57 UTC (rev 174314)
+++ trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp 2014-10-04 08:47:04 UTC (rev 174315)
@@ -605,7 +605,7 @@
{
totalChildCount += children.size();
for (auto* child : children) {
- if (!child->client().shouldSkipLayerInDump(child)) {
+ if (!child->client().shouldSkipLayerInDump(child, behavior)) {
child->dumpLayer(ts, indent + 2, behavior);
continue;
}
Modified: trunk/Source/WebCore/platform/graphics/GraphicsLayer.h (174314 => 174315)
--- trunk/Source/WebCore/platform/graphics/GraphicsLayer.h 2014-10-04 08:37:57 UTC (rev 174314)
+++ trunk/Source/WebCore/platform/graphics/GraphicsLayer.h 2014-10-04 08:47:04 UTC (rev 174315)
@@ -46,17 +46,6 @@
namespace WebCore {
-enum LayerTreeAsTextBehaviorFlags {
- LayerTreeAsTextBehaviorNormal = 0,
- LayerTreeAsTextDebug = 1 << 0, // Dump extra debugging info like layer addresses.
- LayerTreeAsTextIncludeVisibleRects = 1 << 1,
- LayerTreeAsTextIncludeTileCaches = 1 << 2,
- LayerTreeAsTextIncludeRepaintRects = 1 << 3,
- LayerTreeAsTextIncludePaintingPhases = 1 << 4,
- LayerTreeAsTextIncludeContentLayers = 1 << 5
-};
-typedef unsigned LayerTreeAsTextBehavior;
-
class GraphicsContext;
class GraphicsLayerFactory;
class Image;
Modified: trunk/Source/WebCore/platform/graphics/GraphicsLayerClient.h (174314 => 174315)
--- trunk/Source/WebCore/platform/graphics/GraphicsLayerClient.h 2014-10-04 08:37:57 UTC (rev 174314)
+++ trunk/Source/WebCore/platform/graphics/GraphicsLayerClient.h 2014-10-04 08:47:04 UTC (rev 174315)
@@ -56,6 +56,18 @@
AnimatedPropertyWebkitFilter
};
+enum LayerTreeAsTextBehaviorFlags {
+ LayerTreeAsTextBehaviorNormal = 0,
+ LayerTreeAsTextDebug = 1 << 0, // Dump extra debugging info like layer addresses.
+ LayerTreeAsTextIncludeVisibleRects = 1 << 1,
+ LayerTreeAsTextIncludeTileCaches = 1 << 2,
+ LayerTreeAsTextIncludeRepaintRects = 1 << 3,
+ LayerTreeAsTextIncludePaintingPhases = 1 << 4,
+ LayerTreeAsTextIncludeContentLayers = 1 << 5,
+ LayerTreeAsTextIncludePageOverlayLayers = 1 << 6,
+};
+typedef unsigned LayerTreeAsTextBehavior;
+
class GraphicsLayerClient {
public:
virtual ~GraphicsLayerClient() {}
@@ -96,7 +108,7 @@
virtual bool isTrackingRepaints() const { return false; }
- virtual bool shouldSkipLayerInDump(const GraphicsLayer*) const { return false; }
+ virtual bool shouldSkipLayerInDump(const GraphicsLayer*, LayerTreeAsTextBehavior) const { return false; }
virtual bool shouldDumpPropertyForLayer(const GraphicsLayer*, const char*) const { return true; }
virtual bool shouldAggressivelyRetainTiles(const GraphicsLayer*) const { return false; }
Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (174314 => 174315)
--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2014-10-04 08:37:57 UTC (rev 174314)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2014-10-04 08:47:04 UTC (rev 174315)
@@ -2265,7 +2265,7 @@
return static_cast<GraphicsLayerClient&>(compositor()).isTrackingRepaints();
}
-bool RenderLayerBacking::shouldSkipLayerInDump(const GraphicsLayer* layer) const
+bool RenderLayerBacking::shouldSkipLayerInDump(const GraphicsLayer* layer, LayerTreeAsTextBehavior) const
{
// Skip the root tile cache's flattening layer.
return m_isMainFrameRenderViewLayer && layer && layer == m_childContainmentLayer.get();
Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.h (174314 => 174315)
--- trunk/Source/WebCore/rendering/RenderLayerBacking.h 2014-10-04 08:37:57 UTC (rev 174314)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.h 2014-10-04 08:47:04 UTC (rev 174315)
@@ -211,7 +211,7 @@
virtual bool getCurrentTransform(const GraphicsLayer*, TransformationMatrix&) const override;
virtual bool isTrackingRepaints() const override;
- virtual bool shouldSkipLayerInDump(const GraphicsLayer*) const override;
+ virtual bool shouldSkipLayerInDump(const GraphicsLayer*, LayerTreeAsTextBehavior) const override;
virtual bool shouldDumpPropertyForLayer(const GraphicsLayer*, const char* propertyName) const override;
virtual bool shouldAggressivelyRetainTiles(const GraphicsLayer*) const override;
Modified: trunk/Source/WebCore/testing/Internals.cpp (174314 => 174315)
--- trunk/Source/WebCore/testing/Internals.cpp 2014-10-04 08:37:57 UTC (rev 174314)
+++ trunk/Source/WebCore/testing/Internals.cpp 2014-10-04 08:47:04 UTC (rev 174315)
@@ -75,7 +75,9 @@
#include "MediaSessionManager.h"
#include "MemoryCache.h"
#include "MemoryInfo.h"
+#include "MockPageOverlayClient.h"
#include "Page.h"
+#include "PageOverlay.h"
#include "PrintContext.h"
#include "PseudoElement.h"
#include "Range.h"
@@ -300,6 +302,8 @@
AXObjectCache::setEnhancedUserInterfaceAccessibility(false);
AXObjectCache::disableAccessibility();
#endif
+
+ MockPageOverlayClient::shared().uninstallAllOverlays();
}
Internals::Internals(Document* document)
@@ -2356,4 +2360,28 @@
#endif
}
+void Internals::installMockPageOverlay(const String& overlayType, ExceptionCode& ec)
+{
+ Document* document = contextDocument();
+ if (!document || !document->frame()) {
+ ec = INVALID_ACCESS_ERR;
+ return;
+ }
+
+ MockPageOverlayClient::shared().installOverlay(document->frame()->mainFrame(), overlayType == "view" ? PageOverlay::OverlayType::View : PageOverlay::OverlayType::Document);
}
+
+String Internals::pageOverlayLayerTreeAsText(ExceptionCode& ec) const
+{
+ Document* document = contextDocument();
+ if (!document || !document->frame()) {
+ ec = INVALID_ACCESS_ERR;
+ return String();
+ }
+
+ document->updateLayout();
+
+ return MockPageOverlayClient::shared().layerTreeAsText(document->frame()->mainFrame());
+}
+
+}
Modified: trunk/Source/WebCore/testing/Internals.h (174314 => 174315)
--- trunk/Source/WebCore/testing/Internals.h 2014-10-04 08:37:57 UTC (rev 174314)
+++ trunk/Source/WebCore/testing/Internals.h 2014-10-04 08:47:04 UTC (rev 174315)
@@ -342,6 +342,9 @@
void simulateSystemSleep() const;
void simulateSystemWake() const;
+ void installMockPageOverlay(const String& overlayType, ExceptionCode&);
+ String pageOverlayLayerTreeAsText(ExceptionCode&) const;
+
private:
explicit Internals(Document*);
Document* contextDocument() const;
Modified: trunk/Source/WebCore/testing/Internals.idl (174314 => 174315)
--- trunk/Source/WebCore/testing/Internals.idl 2014-10-04 08:37:57 UTC (rev 174314)
+++ trunk/Source/WebCore/testing/Internals.idl 2014-10-04 08:47:04 UTC (rev 174315)
@@ -185,7 +185,7 @@
// As per spec: http://www.w3.org/TR/WebIDL/#idl-sequence
// "Sequences must not be used as the type of an attribute, constant or exception field."
- // FIXME: this will lead to BUG interals.consoleProfiles !== interals.consoleProfiles as profile will always returns new array.
+ // FIXME: this will lead to BUG internals.consoleProfiles !== internals.consoleProfiles as profile will always returns new array.
readonly attribute ScriptProfile[] consoleProfiles;
unsigned long numberOfLiveNodes();
@@ -230,7 +230,7 @@
DOMString[] getReferencedFilePaths();
- // These functions both reset the tracked repaint rects. They are inteded to be used in the following order:
+ // These functions both reset the tracked repaint rects. They are intended to be used in the following order:
// startTrackingRepaints, repaintRectsAsText, stopTrackingRepaints.
[RaisesException] void startTrackingRepaints();
[RaisesException] void stopTrackingRepaints();
@@ -292,4 +292,12 @@
[Conditional=VIDEO] void simulateSystemSleep();
[Conditional=VIDEO] void simulateSystemWake();
+
+ [RaisesException] void installMockPageOverlay(PageOverlayType type);
+ [RaisesException] DOMString pageOverlayLayerTreeAsText();
};
+
+enum PageOverlayType {
+ "view",
+ "document"
+};
\ No newline at end of file
Added: trunk/Source/WebCore/testing/MockPageOverlayClient.cpp (0 => 174315)
--- trunk/Source/WebCore/testing/MockPageOverlayClient.cpp (rev 0)
+++ trunk/Source/WebCore/testing/MockPageOverlayClient.cpp 2014-10-04 08:47:04 UTC (rev 174315)
@@ -0,0 +1,124 @@
+/*
+ * 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"
+
+#include "GraphicsContext.h"
+#include "GraphicsLayer.h"
+#include "MainFrame.h"
+#include "PageOverlayController.h"
+#include <wtf/NeverDestroyed.h>
+
+namespace WebCore {
+
+MockPageOverlayClient& MockPageOverlayClient::shared()
+{
+ static NeverDestroyed<MockPageOverlayClient> sharedClient;
+ return sharedClient.get();
+}
+
+MockPageOverlayClient::MockPageOverlayClient()
+{
+}
+
+void MockPageOverlayClient::installOverlay(MainFrame& mainFrame, PageOverlay::OverlayType overlayType)
+{
+ RefPtr<PageOverlay> overlay = PageOverlay::create(*this, overlayType);
+ mainFrame.pageOverlayController().installPageOverlay(overlay, PageOverlay::FadeMode::DoNotFade);
+ m_overlays.add(overlay.get());
+}
+
+void MockPageOverlayClient::uninstallAllOverlays()
+{
+ while (!m_overlays.isEmpty()) {
+ PageOverlay* overlay = m_overlays.takeAny();
+ ASSERT(overlay->controller());
+ overlay->controller()->uninstallPageOverlay(overlay, PageOverlay::FadeMode::DoNotFade);
+ }
+}
+
+String MockPageOverlayClient::layerTreeAsText(MainFrame& mainFrame)
+{
+ return "View-relative:\n" + mainFrame.pageOverlayController().viewOverlayRootLayer().layerTreeAsText(LayerTreeAsTextIncludePageOverlayLayers) + "\n\nDocument-relative:\n" + mainFrame.pageOverlayController().documentOverlayRootLayer().layerTreeAsText(LayerTreeAsTextIncludePageOverlayLayers);
+}
+
+void MockPageOverlayClient::pageOverlayDestroyed(PageOverlay& overlay)
+{
+ m_overlays.remove(&overlay);
+}
+
+void MockPageOverlayClient::willMoveToPage(PageOverlay&, Page*)
+{
+}
+
+void MockPageOverlayClient::didMoveToPage(PageOverlay& overlay, Page* page)
+{
+ if (page)
+ overlay.setNeedsDisplay();
+}
+
+void MockPageOverlayClient::drawRect(PageOverlay& overlay, GraphicsContext& context, const IntRect&)
+{
+ GraphicsContextStateSaver stateSaver(context);
+
+ FloatRect insetRect = overlay.bounds();
+
+ if (overlay.overlayType() == PageOverlay::OverlayType::Document) {
+ context.setStrokeColor(Color(0, 255, 0), ColorSpaceDeviceRGB);
+ insetRect.inflate(-50);
+ } else {
+ context.setStrokeColor(Color(0, 0, 255), ColorSpaceDeviceRGB);
+ insetRect.inflate(-20);
+ }
+
+ context.strokeRect(insetRect, 20);
+}
+
+bool MockPageOverlayClient::mouseEvent(PageOverlay&, const PlatformMouseEvent&)
+{
+ 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>();
+}
+
+}
Added: trunk/Source/WebCore/testing/MockPageOverlayClient.h (0 => 174315)
--- trunk/Source/WebCore/testing/MockPageOverlayClient.h (rev 0)
+++ trunk/Source/WebCore/testing/MockPageOverlayClient.h 2014-10-04 08:47:04 UTC (rev 174315)
@@ -0,0 +1,67 @@
+/*
+ * 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.
+ */
+
+#ifndef MockPageOverlayClient_h
+#define MockPageOverlayClient_h
+
+#include "PageOverlay.h"
+#include <wtf/HashSet.h>
+
+namespace WebCore {
+
+class MainFrame;
+
+class MockPageOverlayClient final : public PageOverlay::Client {
+ friend class NeverDestroyed<MockPageOverlayClient>;
+public:
+ static MockPageOverlayClient& shared();
+
+ explicit MockPageOverlayClient();
+
+ void installOverlay(MainFrame&, PageOverlay::OverlayType);
+ void uninstallAllOverlays();
+
+ String layerTreeAsText(MainFrame&);
+
+ virtual ~MockPageOverlayClient() { }
+
+private:
+ virtual void pageOverlayDestroyed(PageOverlay&) override;
+ virtual void willMoveToPage(PageOverlay&, Page*) override;
+ virtual void didMoveToPage(PageOverlay&, Page*) override;
+ virtual void drawRect(PageOverlay&, GraphicsContext&, const IntRect& dirtyRect) override;
+ virtual bool mouseEvent(PageOverlay&, const PlatformMouseEvent&) override;
+ virtual void didScrollFrame(PageOverlay&, Frame&) override;
+
+ virtual bool copyAccessibilityAttributeStringValueForPoint(PageOverlay&, String /* attribute */, FloatPoint, String&) override;
+ virtual bool copyAccessibilityAttributeBoolValueForPoint(PageOverlay&, String /* attribute */, FloatPoint, bool&) override;
+ virtual Vector<String> copyAccessibilityAttributeNames(PageOverlay&, bool /* parameterizedNames */) override;
+
+ HashSet<PageOverlay*> m_overlays;
+};
+
+}
+
+#endif // MockPageOverlayClient_h