haikuwebkit/LayoutTests/tiled-drawing/simple-document-with-margin...

45 lines
1.3 KiB
HTML
Raw Permalink Normal View History

Need a way to test the tile cache with margins enabled https://bugs.webkit.org/show_bug.cgi?id=127194 -and corresponding- <rdar://problem/15571327> Reviewed by Tim Horton. Source/WebCore: This patch adds a new function to InternalSettings that will allow layout tests to flip the setting Settings::setBackgroundShouldExtendBeyondPage(). This patch also makes changing that setting take effect immediately. To make this setting dynamic, we can no longer generate the Setting function, so we have to export the symbol manually. * WebCore.exp.in: This new function on FrameView will call into RenderLayerBacking to add or remove margins. * page/FrameView.cpp: (WebCore::FrameView::setBackgroundExtendsBeyondPage): * page/FrameView.h: Again, we’re no longer using the boiler-plate generated Setting functions, so now we can call into FrameView to make the background extend. * page/Settings.cpp: (WebCore::Settings::Settings): (WebCore::Settings::setBackgroundShouldExtendBeyondPage): * page/Settings.h: (WebCore::Settings::backgroundShouldExtendBeyondPage): * page/Settings.in: Whenever tile margins are set, call setNeedsRevalidateTiles() to make the change dynamic. * platform/graphics/ca/mac/TileController.mm: (WebCore::TileController::setTileMargins): Move the call to TiledBacking::setTileMargins() into a helper function so that the same code can be used for FrameView. * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::RenderLayerBacking): (WebCore::RenderLayerBacking::setTiledBackingHasMargins): * rendering/RenderLayerBacking.h: New InternalSetting. * testing/InternalSettings.cpp: (WebCore::InternalSettings::setBackgroundShouldExtendBeyondPage): * testing/InternalSettings.h: * testing/InternalSettings.idl: Source/WebKit: Attempt to keep Windows building. * WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in: LayoutTests: * platform/mac-wk2/tiled-drawing/simple-document-with-margin-tiles-expected.txt: Added. * platform/mac-wk2/tiled-drawing/simple-document-with-margin-tiles.html: Added. Canonical link: https://commits.webkit.org/145196@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@162230 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-01-18 00:05:59 +00:00
<!DOCTYPE html>
<html>
<head>
<style>
body {
width: 1200px;
height: 2000px;
Extended background should only create margin tiles for pages with background images https://bugs.webkit.org/show_bug.cgi?id=127876 -and corresponding- <rdar://problem/15827632> Reviewed by Simon Fraser. Source/WebCore: Settings::backgroundShouldExtendBeyondPage() doesn't need to create margin tiles for pages with simple background colors. Instead, those pages should achieve the same effect by setting a background color on RenderLayerCompositor's m_layerForOverhangAreas. For now, we should only create tiles when there is a background image. We may want to extend this to other types of complicated backgrounds in the future. This patch makes callers that only care about the value of the setting always call Settings::backgroundShouldExtendBeyondPage() rather than asking about margin tiles. And callers that want to know about margin tiles can either keep querying that directly or they can call FrameView::hasExtendedBackgroundRectForPainting(). An extended background does not necessarily require an extended background rect for painting, and this new FrameView function can make that distinction. When setBackgroundExtendsBeyondPage() is called, call RenderLayerCompositor:: setRootExtendedBackgroundColor() with either the document background color, or an invalid color, depending on whether you have or do not have an extended background. Also call needsExtendedBackgroundRectForPainting() to determine if we also need to extend the background rect, and then call setHasExtendedBackgroundRectForPainting() with its value. * page/FrameView.cpp: (WebCore::FrameView::setBackgroundExtendsBeyondPage): (WebCore::FrameView::hasExtendedBackgroundRectForPainting): Right now we only need to extend the background rect for documents with background images on the root. This may be extended in the future. (WebCore::FrameView::needsExtendedBackgroundRectForPainting): (WebCore::FrameView::setHasExtendedBackgroundRectForPainting): (WebCore::FrameView::extendedBackgroundRectForPainting): * page/FrameView.h: Expose defaultTileWidth and defaultTileHeight from TiledBacking.h so that we can access the values from RenderLayerBacking. * platform/graphics/TiledBacking.h: * platform/graphics/ca/mac/TileController.mm: hasExtendedBackgroundForPainting() is now called hasExtendedBackgroundRectForPainting() to distinguish the case where an extended RECT is needed. * rendering/RenderBox.cpp: (WebCore::RenderBox::repaintLayerRectsForImage): * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry): Call setHasExtendedBackgroundRectForPainting() if relevant. * rendering/RenderElement.cpp: (WebCore::RenderElement::styleWillChange): Don't call setTiledBackingHasMargins() right in the constructor because we only want margins if we have a background image, and we won't have that information yet. * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::RenderLayerBacking): Clean up the variable name here. We are only setting margins when we need to extend the background rect for painting. Also make us of newly-exposed defaultTileWidth and Height. (WebCore::RenderLayerBacking::setTiledBackingHasMargins): Remove RenderLayerBacking::tiledBackingHasMargin() since there aren't any more callers. * rendering/RenderLayerBacking.h: (WebCore::RenderLayerBacking::usingTiledBacking): setMasksToBounds(false) based on the Setting, and not based on whether there are tile margins. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateBacking): Return false from RenderLayerCompositor::requiresContentShadowLayer() if there is an extended background. (WebCore::RenderLayerCompositor::requiresContentShadowLayer): Setting the background color on m_layerForOverhangAreas is all we need to do to create the extended background effect on pages that only have background colors. (WebCore::RenderLayerCompositor::setRootExtendedBackgroundColor): (WebCore::RenderLayerCompositor::updateOverflowControlsLayers): Remove mainFrameBackingIsTiledWithMargin() since there aren't any more callers, and add setRootExtendedBackgroundColor() so that we can update the color from RenderView. * rendering/RenderLayerCompositor.h: Revert the code that was added to paint background color here, since this should all be covered by calling RenderLayerCompositor::setExtendedBackgroundColor(). More complicated backgrounds will run through the full background painting code. * rendering/RenderView.cpp: (WebCore::RenderView::paintBoxDecorations): (WebCore::RenderView::backgroundRect): LayoutTests: We can only test margin tiles if we also give the document a background image. * platform/mac-wk2/tiled-drawing/resources/greenbox.png: Added. * platform/mac-wk2/tiled-drawing/simple-document-with-margin-tiles.html: Canonical link: https://commits.webkit.org/146011@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@163190 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-01-31 21:06:38 +00:00
/* The setBackgroundShouldExtendBeyondPage setting will only create margin tiles for documents
that have background images. */
background-image:url(resources/greenbox.png);
background-repeat:repeat;
Need a way to test the tile cache with margins enabled https://bugs.webkit.org/show_bug.cgi?id=127194 -and corresponding- <rdar://problem/15571327> Reviewed by Tim Horton. Source/WebCore: This patch adds a new function to InternalSettings that will allow layout tests to flip the setting Settings::setBackgroundShouldExtendBeyondPage(). This patch also makes changing that setting take effect immediately. To make this setting dynamic, we can no longer generate the Setting function, so we have to export the symbol manually. * WebCore.exp.in: This new function on FrameView will call into RenderLayerBacking to add or remove margins. * page/FrameView.cpp: (WebCore::FrameView::setBackgroundExtendsBeyondPage): * page/FrameView.h: Again, we’re no longer using the boiler-plate generated Setting functions, so now we can call into FrameView to make the background extend. * page/Settings.cpp: (WebCore::Settings::Settings): (WebCore::Settings::setBackgroundShouldExtendBeyondPage): * page/Settings.h: (WebCore::Settings::backgroundShouldExtendBeyondPage): * page/Settings.in: Whenever tile margins are set, call setNeedsRevalidateTiles() to make the change dynamic. * platform/graphics/ca/mac/TileController.mm: (WebCore::TileController::setTileMargins): Move the call to TiledBacking::setTileMargins() into a helper function so that the same code can be used for FrameView. * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::RenderLayerBacking): (WebCore::RenderLayerBacking::setTiledBackingHasMargins): * rendering/RenderLayerBacking.h: New InternalSetting. * testing/InternalSettings.cpp: (WebCore::InternalSettings::setBackgroundShouldExtendBeyondPage): * testing/InternalSettings.h: * testing/InternalSettings.idl: Source/WebKit: Attempt to keep Windows building. * WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in: LayoutTests: * platform/mac-wk2/tiled-drawing/simple-document-with-margin-tiles-expected.txt: Added. * platform/mac-wk2/tiled-drawing/simple-document-with-margin-tiles.html: Added. Canonical link: https://commits.webkit.org/145196@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@162230 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-01-18 00:05:59 +00:00
}
</style>
<script>
Adjust tile coverage with margin tiles, and tidy up the indicator https://bugs.webkit.org/show_bug.cgi?id=152742 Reviewed by Beth Dakin. Source/WebCore: The tile coverage rect was unfeasibly large when margin tiles are present, and could be bigger than the layer itself, making the indicator look odd. Fix by improving the logic in TileController::adjustTileCoverageRect(): this now first extends the visible rect for scrolling, and then constrains it within the bounds with margin padding. It also unites with the passed-in coverageRect, ensuring that we don't lose information about overhang for margin tile coverage. Second, update the tiled scrolling indicator when the visible rect changes, and coalesce the map updates on a timer. * platform/graphics/TiledBacking.h: * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::adjustCoverageRect): * platform/graphics/ca/TileController.cpp: (WebCore::TileController::setVisibleRect): (WebCore::TileController::setTiledScrollingIndicatorPosition): (WebCore::expandRectWithinRect): (WebCore::TileController::adjustTileCoverageRect): (WebCore::TileController::updateTileCoverageMap): (WebCore::TileController::computeTileCoverageRect): Deleted. * platform/graphics/ca/TileController.h: * platform/graphics/ca/TileCoverageMap.cpp: (WebCore::TileCoverageMap::TileCoverageMap): (WebCore::TileCoverageMap::setNeedsUpdate): (WebCore::TileCoverageMap::updateTimerFired): * platform/graphics/ca/TileCoverageMap.h: LayoutTests: New baselines. simple-document-with-margin-tiles.html needs to wait for over 0.5s for the FrameView::enableSpeculativeTilingIfNeeded() timer to fire before dumping coverage (ouch). * tiled-drawing/scrolling/fast-scroll-iframe-latched-iframe-expected.txt: * tiled-drawing/scrolling/fast-scroll-iframe-latched-iframe-with-handler-expected.txt: * tiled-drawing/scrolling/fast-scroll-iframe-latched-mainframe-expected.txt: * tiled-drawing/scrolling/fast-scroll-iframe-latched-mainframe-with-handler-expected.txt: * tiled-drawing/simple-document-with-margin-tiles.html: Canonical link: https://commits.webkit.org/170843@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194607 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-01-05 22:09:20 +00:00
if (window.testRunner) {
Need a way to test the tile cache with margins enabled https://bugs.webkit.org/show_bug.cgi?id=127194 -and corresponding- <rdar://problem/15571327> Reviewed by Tim Horton. Source/WebCore: This patch adds a new function to InternalSettings that will allow layout tests to flip the setting Settings::setBackgroundShouldExtendBeyondPage(). This patch also makes changing that setting take effect immediately. To make this setting dynamic, we can no longer generate the Setting function, so we have to export the symbol manually. * WebCore.exp.in: This new function on FrameView will call into RenderLayerBacking to add or remove margins. * page/FrameView.cpp: (WebCore::FrameView::setBackgroundExtendsBeyondPage): * page/FrameView.h: Again, we’re no longer using the boiler-plate generated Setting functions, so now we can call into FrameView to make the background extend. * page/Settings.cpp: (WebCore::Settings::Settings): (WebCore::Settings::setBackgroundShouldExtendBeyondPage): * page/Settings.h: (WebCore::Settings::backgroundShouldExtendBeyondPage): * page/Settings.in: Whenever tile margins are set, call setNeedsRevalidateTiles() to make the change dynamic. * platform/graphics/ca/mac/TileController.mm: (WebCore::TileController::setTileMargins): Move the call to TiledBacking::setTileMargins() into a helper function so that the same code can be used for FrameView. * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::RenderLayerBacking): (WebCore::RenderLayerBacking::setTiledBackingHasMargins): * rendering/RenderLayerBacking.h: New InternalSetting. * testing/InternalSettings.cpp: (WebCore::InternalSettings::setBackgroundShouldExtendBeyondPage): * testing/InternalSettings.h: * testing/InternalSettings.idl: Source/WebKit: Attempt to keep Windows building. * WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in: LayoutTests: * platform/mac-wk2/tiled-drawing/simple-document-with-margin-tiles-expected.txt: Added. * platform/mac-wk2/tiled-drawing/simple-document-with-margin-tiles.html: Added. Canonical link: https://commits.webkit.org/145196@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@162230 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-01-18 00:05:59 +00:00
testRunner.dumpAsText();
Adjust tile coverage with margin tiles, and tidy up the indicator https://bugs.webkit.org/show_bug.cgi?id=152742 Reviewed by Beth Dakin. Source/WebCore: The tile coverage rect was unfeasibly large when margin tiles are present, and could be bigger than the layer itself, making the indicator look odd. Fix by improving the logic in TileController::adjustTileCoverageRect(): this now first extends the visible rect for scrolling, and then constrains it within the bounds with margin padding. It also unites with the passed-in coverageRect, ensuring that we don't lose information about overhang for margin tile coverage. Second, update the tiled scrolling indicator when the visible rect changes, and coalesce the map updates on a timer. * platform/graphics/TiledBacking.h: * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::adjustCoverageRect): * platform/graphics/ca/TileController.cpp: (WebCore::TileController::setVisibleRect): (WebCore::TileController::setTiledScrollingIndicatorPosition): (WebCore::expandRectWithinRect): (WebCore::TileController::adjustTileCoverageRect): (WebCore::TileController::updateTileCoverageMap): (WebCore::TileController::computeTileCoverageRect): Deleted. * platform/graphics/ca/TileController.h: * platform/graphics/ca/TileCoverageMap.cpp: (WebCore::TileCoverageMap::TileCoverageMap): (WebCore::TileCoverageMap::setNeedsUpdate): (WebCore::TileCoverageMap::updateTimerFired): * platform/graphics/ca/TileCoverageMap.h: LayoutTests: New baselines. simple-document-with-margin-tiles.html needs to wait for over 0.5s for the FrameView::enableSpeculativeTilingIfNeeded() timer to fire before dumping coverage (ouch). * tiled-drawing/scrolling/fast-scroll-iframe-latched-iframe-expected.txt: * tiled-drawing/scrolling/fast-scroll-iframe-latched-iframe-with-handler-expected.txt: * tiled-drawing/scrolling/fast-scroll-iframe-latched-mainframe-expected.txt: * tiled-drawing/scrolling/fast-scroll-iframe-latched-mainframe-with-handler-expected.txt: * tiled-drawing/simple-document-with-margin-tiles.html: Canonical link: https://commits.webkit.org/170843@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194607 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-01-05 22:09:20 +00:00
testRunner.waitUntilDone();
}
Need a way to test the tile cache with margins enabled https://bugs.webkit.org/show_bug.cgi?id=127194 -and corresponding- <rdar://problem/15571327> Reviewed by Tim Horton. Source/WebCore: This patch adds a new function to InternalSettings that will allow layout tests to flip the setting Settings::setBackgroundShouldExtendBeyondPage(). This patch also makes changing that setting take effect immediately. To make this setting dynamic, we can no longer generate the Setting function, so we have to export the symbol manually. * WebCore.exp.in: This new function on FrameView will call into RenderLayerBacking to add or remove margins. * page/FrameView.cpp: (WebCore::FrameView::setBackgroundExtendsBeyondPage): * page/FrameView.h: Again, we’re no longer using the boiler-plate generated Setting functions, so now we can call into FrameView to make the background extend. * page/Settings.cpp: (WebCore::Settings::Settings): (WebCore::Settings::setBackgroundShouldExtendBeyondPage): * page/Settings.h: (WebCore::Settings::backgroundShouldExtendBeyondPage): * page/Settings.in: Whenever tile margins are set, call setNeedsRevalidateTiles() to make the change dynamic. * platform/graphics/ca/mac/TileController.mm: (WebCore::TileController::setTileMargins): Move the call to TiledBacking::setTileMargins() into a helper function so that the same code can be used for FrameView. * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::RenderLayerBacking): (WebCore::RenderLayerBacking::setTiledBackingHasMargins): * rendering/RenderLayerBacking.h: New InternalSetting. * testing/InternalSettings.cpp: (WebCore::InternalSettings::setBackgroundShouldExtendBeyondPage): * testing/InternalSettings.h: * testing/InternalSettings.idl: Source/WebKit: Attempt to keep Windows building. * WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in: LayoutTests: * platform/mac-wk2/tiled-drawing/simple-document-with-margin-tiles-expected.txt: Added. * platform/mac-wk2/tiled-drawing/simple-document-with-margin-tiles.html: Added. Canonical link: https://commits.webkit.org/145196@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@162230 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-01-18 00:05:59 +00:00
function doTest()
{
Adjust tile coverage with margin tiles, and tidy up the indicator https://bugs.webkit.org/show_bug.cgi?id=152742 Reviewed by Beth Dakin. Source/WebCore: The tile coverage rect was unfeasibly large when margin tiles are present, and could be bigger than the layer itself, making the indicator look odd. Fix by improving the logic in TileController::adjustTileCoverageRect(): this now first extends the visible rect for scrolling, and then constrains it within the bounds with margin padding. It also unites with the passed-in coverageRect, ensuring that we don't lose information about overhang for margin tile coverage. Second, update the tiled scrolling indicator when the visible rect changes, and coalesce the map updates on a timer. * platform/graphics/TiledBacking.h: * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::adjustCoverageRect): * platform/graphics/ca/TileController.cpp: (WebCore::TileController::setVisibleRect): (WebCore::TileController::setTiledScrollingIndicatorPosition): (WebCore::expandRectWithinRect): (WebCore::TileController::adjustTileCoverageRect): (WebCore::TileController::updateTileCoverageMap): (WebCore::TileController::computeTileCoverageRect): Deleted. * platform/graphics/ca/TileController.h: * platform/graphics/ca/TileCoverageMap.cpp: (WebCore::TileCoverageMap::TileCoverageMap): (WebCore::TileCoverageMap::setNeedsUpdate): (WebCore::TileCoverageMap::updateTimerFired): * platform/graphics/ca/TileCoverageMap.h: LayoutTests: New baselines. simple-document-with-margin-tiles.html needs to wait for over 0.5s for the FrameView::enableSpeculativeTilingIfNeeded() timer to fire before dumping coverage (ouch). * tiled-drawing/scrolling/fast-scroll-iframe-latched-iframe-expected.txt: * tiled-drawing/scrolling/fast-scroll-iframe-latched-iframe-with-handler-expected.txt: * tiled-drawing/scrolling/fast-scroll-iframe-latched-mainframe-expected.txt: * tiled-drawing/scrolling/fast-scroll-iframe-latched-mainframe-with-handler-expected.txt: * tiled-drawing/simple-document-with-margin-tiles.html: Canonical link: https://commits.webkit.org/170843@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194607 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-01-05 22:09:20 +00:00
if (window.internals)
Extended background should only create margin tiles for pages with background images https://bugs.webkit.org/show_bug.cgi?id=127876 -and corresponding- <rdar://problem/15827632> Reviewed by Simon Fraser. Source/WebCore: Settings::backgroundShouldExtendBeyondPage() doesn't need to create margin tiles for pages with simple background colors. Instead, those pages should achieve the same effect by setting a background color on RenderLayerCompositor's m_layerForOverhangAreas. For now, we should only create tiles when there is a background image. We may want to extend this to other types of complicated backgrounds in the future. This patch makes callers that only care about the value of the setting always call Settings::backgroundShouldExtendBeyondPage() rather than asking about margin tiles. And callers that want to know about margin tiles can either keep querying that directly or they can call FrameView::hasExtendedBackgroundRectForPainting(). An extended background does not necessarily require an extended background rect for painting, and this new FrameView function can make that distinction. When setBackgroundExtendsBeyondPage() is called, call RenderLayerCompositor:: setRootExtendedBackgroundColor() with either the document background color, or an invalid color, depending on whether you have or do not have an extended background. Also call needsExtendedBackgroundRectForPainting() to determine if we also need to extend the background rect, and then call setHasExtendedBackgroundRectForPainting() with its value. * page/FrameView.cpp: (WebCore::FrameView::setBackgroundExtendsBeyondPage): (WebCore::FrameView::hasExtendedBackgroundRectForPainting): Right now we only need to extend the background rect for documents with background images on the root. This may be extended in the future. (WebCore::FrameView::needsExtendedBackgroundRectForPainting): (WebCore::FrameView::setHasExtendedBackgroundRectForPainting): (WebCore::FrameView::extendedBackgroundRectForPainting): * page/FrameView.h: Expose defaultTileWidth and defaultTileHeight from TiledBacking.h so that we can access the values from RenderLayerBacking. * platform/graphics/TiledBacking.h: * platform/graphics/ca/mac/TileController.mm: hasExtendedBackgroundForPainting() is now called hasExtendedBackgroundRectForPainting() to distinguish the case where an extended RECT is needed. * rendering/RenderBox.cpp: (WebCore::RenderBox::repaintLayerRectsForImage): * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry): Call setHasExtendedBackgroundRectForPainting() if relevant. * rendering/RenderElement.cpp: (WebCore::RenderElement::styleWillChange): Don't call setTiledBackingHasMargins() right in the constructor because we only want margins if we have a background image, and we won't have that information yet. * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::RenderLayerBacking): Clean up the variable name here. We are only setting margins when we need to extend the background rect for painting. Also make us of newly-exposed defaultTileWidth and Height. (WebCore::RenderLayerBacking::setTiledBackingHasMargins): Remove RenderLayerBacking::tiledBackingHasMargin() since there aren't any more callers. * rendering/RenderLayerBacking.h: (WebCore::RenderLayerBacking::usingTiledBacking): setMasksToBounds(false) based on the Setting, and not based on whether there are tile margins. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateBacking): Return false from RenderLayerCompositor::requiresContentShadowLayer() if there is an extended background. (WebCore::RenderLayerCompositor::requiresContentShadowLayer): Setting the background color on m_layerForOverhangAreas is all we need to do to create the extended background effect on pages that only have background colors. (WebCore::RenderLayerCompositor::setRootExtendedBackgroundColor): (WebCore::RenderLayerCompositor::updateOverflowControlsLayers): Remove mainFrameBackingIsTiledWithMargin() since there aren't any more callers, and add setRootExtendedBackgroundColor() so that we can update the color from RenderView. * rendering/RenderLayerCompositor.h: Revert the code that was added to paint background color here, since this should all be covered by calling RenderLayerCompositor::setExtendedBackgroundColor(). More complicated backgrounds will run through the full background painting code. * rendering/RenderView.cpp: (WebCore::RenderView::paintBoxDecorations): (WebCore::RenderView::backgroundRect): LayoutTests: We can only test margin tiles if we also give the document a background image. * platform/mac-wk2/tiled-drawing/resources/greenbox.png: Added. * platform/mac-wk2/tiled-drawing/simple-document-with-margin-tiles.html: Canonical link: https://commits.webkit.org/146011@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@163190 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-01-31 21:06:38 +00:00
window.internals.settings.setBackgroundShouldExtendBeyondPage(true);
Adjust tile coverage with margin tiles, and tidy up the indicator https://bugs.webkit.org/show_bug.cgi?id=152742 Reviewed by Beth Dakin. Source/WebCore: The tile coverage rect was unfeasibly large when margin tiles are present, and could be bigger than the layer itself, making the indicator look odd. Fix by improving the logic in TileController::adjustTileCoverageRect(): this now first extends the visible rect for scrolling, and then constrains it within the bounds with margin padding. It also unites with the passed-in coverageRect, ensuring that we don't lose information about overhang for margin tile coverage. Second, update the tiled scrolling indicator when the visible rect changes, and coalesce the map updates on a timer. * platform/graphics/TiledBacking.h: * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::adjustCoverageRect): * platform/graphics/ca/TileController.cpp: (WebCore::TileController::setVisibleRect): (WebCore::TileController::setTiledScrollingIndicatorPosition): (WebCore::expandRectWithinRect): (WebCore::TileController::adjustTileCoverageRect): (WebCore::TileController::updateTileCoverageMap): (WebCore::TileController::computeTileCoverageRect): Deleted. * platform/graphics/ca/TileController.h: * platform/graphics/ca/TileCoverageMap.cpp: (WebCore::TileCoverageMap::TileCoverageMap): (WebCore::TileCoverageMap::setNeedsUpdate): (WebCore::TileCoverageMap::updateTimerFired): * platform/graphics/ca/TileCoverageMap.h: LayoutTests: New baselines. simple-document-with-margin-tiles.html needs to wait for over 0.5s for the FrameView::enableSpeculativeTilingIfNeeded() timer to fire before dumping coverage (ouch). * tiled-drawing/scrolling/fast-scroll-iframe-latched-iframe-expected.txt: * tiled-drawing/scrolling/fast-scroll-iframe-latched-iframe-with-handler-expected.txt: * tiled-drawing/scrolling/fast-scroll-iframe-latched-mainframe-expected.txt: * tiled-drawing/scrolling/fast-scroll-iframe-latched-mainframe-with-handler-expected.txt: * tiled-drawing/simple-document-with-margin-tiles.html: Canonical link: https://commits.webkit.org/170843@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194607 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-01-05 22:09:20 +00:00
// FrameView::enableSpeculativeTilingIfNeeded() uses a 0.5s timer to enable speculative tiling.
window.setTimeout(function() {
if (window.internals) {
document.getElementById('layers').innerText = internals.layerTreeAsText(document,
internals.LAYER_TREE_INCLUDES_VISIBLE_RECTS | internals.LAYER_TREE_INCLUDES_TILE_CACHES);
}
if (window.testRunner)
testRunner.notifyDone();
}, 550);
Need a way to test the tile cache with margins enabled https://bugs.webkit.org/show_bug.cgi?id=127194 -and corresponding- <rdar://problem/15571327> Reviewed by Tim Horton. Source/WebCore: This patch adds a new function to InternalSettings that will allow layout tests to flip the setting Settings::setBackgroundShouldExtendBeyondPage(). This patch also makes changing that setting take effect immediately. To make this setting dynamic, we can no longer generate the Setting function, so we have to export the symbol manually. * WebCore.exp.in: This new function on FrameView will call into RenderLayerBacking to add or remove margins. * page/FrameView.cpp: (WebCore::FrameView::setBackgroundExtendsBeyondPage): * page/FrameView.h: Again, we’re no longer using the boiler-plate generated Setting functions, so now we can call into FrameView to make the background extend. * page/Settings.cpp: (WebCore::Settings::Settings): (WebCore::Settings::setBackgroundShouldExtendBeyondPage): * page/Settings.h: (WebCore::Settings::backgroundShouldExtendBeyondPage): * page/Settings.in: Whenever tile margins are set, call setNeedsRevalidateTiles() to make the change dynamic. * platform/graphics/ca/mac/TileController.mm: (WebCore::TileController::setTileMargins): Move the call to TiledBacking::setTileMargins() into a helper function so that the same code can be used for FrameView. * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::RenderLayerBacking): (WebCore::RenderLayerBacking::setTiledBackingHasMargins): * rendering/RenderLayerBacking.h: New InternalSetting. * testing/InternalSettings.cpp: (WebCore::InternalSettings::setBackgroundShouldExtendBeyondPage): * testing/InternalSettings.h: * testing/InternalSettings.idl: Source/WebKit: Attempt to keep Windows building. * WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in: LayoutTests: * platform/mac-wk2/tiled-drawing/simple-document-with-margin-tiles-expected.txt: Added. * platform/mac-wk2/tiled-drawing/simple-document-with-margin-tiles.html: Added. Canonical link: https://commits.webkit.org/145196@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@162230 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-01-18 00:05:59 +00:00
}
window.addEventListener('load', doTest, false);
</script>
</head>
Extended background should only create margin tiles for pages with background images https://bugs.webkit.org/show_bug.cgi?id=127876 -and corresponding- <rdar://problem/15827632> Reviewed by Simon Fraser. Source/WebCore: Settings::backgroundShouldExtendBeyondPage() doesn't need to create margin tiles for pages with simple background colors. Instead, those pages should achieve the same effect by setting a background color on RenderLayerCompositor's m_layerForOverhangAreas. For now, we should only create tiles when there is a background image. We may want to extend this to other types of complicated backgrounds in the future. This patch makes callers that only care about the value of the setting always call Settings::backgroundShouldExtendBeyondPage() rather than asking about margin tiles. And callers that want to know about margin tiles can either keep querying that directly or they can call FrameView::hasExtendedBackgroundRectForPainting(). An extended background does not necessarily require an extended background rect for painting, and this new FrameView function can make that distinction. When setBackgroundExtendsBeyondPage() is called, call RenderLayerCompositor:: setRootExtendedBackgroundColor() with either the document background color, or an invalid color, depending on whether you have or do not have an extended background. Also call needsExtendedBackgroundRectForPainting() to determine if we also need to extend the background rect, and then call setHasExtendedBackgroundRectForPainting() with its value. * page/FrameView.cpp: (WebCore::FrameView::setBackgroundExtendsBeyondPage): (WebCore::FrameView::hasExtendedBackgroundRectForPainting): Right now we only need to extend the background rect for documents with background images on the root. This may be extended in the future. (WebCore::FrameView::needsExtendedBackgroundRectForPainting): (WebCore::FrameView::setHasExtendedBackgroundRectForPainting): (WebCore::FrameView::extendedBackgroundRectForPainting): * page/FrameView.h: Expose defaultTileWidth and defaultTileHeight from TiledBacking.h so that we can access the values from RenderLayerBacking. * platform/graphics/TiledBacking.h: * platform/graphics/ca/mac/TileController.mm: hasExtendedBackgroundForPainting() is now called hasExtendedBackgroundRectForPainting() to distinguish the case where an extended RECT is needed. * rendering/RenderBox.cpp: (WebCore::RenderBox::repaintLayerRectsForImage): * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry): Call setHasExtendedBackgroundRectForPainting() if relevant. * rendering/RenderElement.cpp: (WebCore::RenderElement::styleWillChange): Don't call setTiledBackingHasMargins() right in the constructor because we only want margins if we have a background image, and we won't have that information yet. * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::RenderLayerBacking): Clean up the variable name here. We are only setting margins when we need to extend the background rect for painting. Also make us of newly-exposed defaultTileWidth and Height. (WebCore::RenderLayerBacking::setTiledBackingHasMargins): Remove RenderLayerBacking::tiledBackingHasMargin() since there aren't any more callers. * rendering/RenderLayerBacking.h: (WebCore::RenderLayerBacking::usingTiledBacking): setMasksToBounds(false) based on the Setting, and not based on whether there are tile margins. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateBacking): Return false from RenderLayerCompositor::requiresContentShadowLayer() if there is an extended background. (WebCore::RenderLayerCompositor::requiresContentShadowLayer): Setting the background color on m_layerForOverhangAreas is all we need to do to create the extended background effect on pages that only have background colors. (WebCore::RenderLayerCompositor::setRootExtendedBackgroundColor): (WebCore::RenderLayerCompositor::updateOverflowControlsLayers): Remove mainFrameBackingIsTiledWithMargin() since there aren't any more callers, and add setRootExtendedBackgroundColor() so that we can update the color from RenderView. * rendering/RenderLayerCompositor.h: Revert the code that was added to paint background color here, since this should all be covered by calling RenderLayerCompositor::setExtendedBackgroundColor(). More complicated backgrounds will run through the full background painting code. * rendering/RenderView.cpp: (WebCore::RenderView::paintBoxDecorations): (WebCore::RenderView::backgroundRect): LayoutTests: We can only test margin tiles if we also give the document a background image. * platform/mac-wk2/tiled-drawing/resources/greenbox.png: Added. * platform/mac-wk2/tiled-drawing/simple-document-with-margin-tiles.html: Canonical link: https://commits.webkit.org/146011@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@163190 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-01-31 21:06:38 +00:00
Need a way to test the tile cache with margins enabled https://bugs.webkit.org/show_bug.cgi?id=127194 -and corresponding- <rdar://problem/15571327> Reviewed by Tim Horton. Source/WebCore: This patch adds a new function to InternalSettings that will allow layout tests to flip the setting Settings::setBackgroundShouldExtendBeyondPage(). This patch also makes changing that setting take effect immediately. To make this setting dynamic, we can no longer generate the Setting function, so we have to export the symbol manually. * WebCore.exp.in: This new function on FrameView will call into RenderLayerBacking to add or remove margins. * page/FrameView.cpp: (WebCore::FrameView::setBackgroundExtendsBeyondPage): * page/FrameView.h: Again, we’re no longer using the boiler-plate generated Setting functions, so now we can call into FrameView to make the background extend. * page/Settings.cpp: (WebCore::Settings::Settings): (WebCore::Settings::setBackgroundShouldExtendBeyondPage): * page/Settings.h: (WebCore::Settings::backgroundShouldExtendBeyondPage): * page/Settings.in: Whenever tile margins are set, call setNeedsRevalidateTiles() to make the change dynamic. * platform/graphics/ca/mac/TileController.mm: (WebCore::TileController::setTileMargins): Move the call to TiledBacking::setTileMargins() into a helper function so that the same code can be used for FrameView. * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::RenderLayerBacking): (WebCore::RenderLayerBacking::setTiledBackingHasMargins): * rendering/RenderLayerBacking.h: New InternalSetting. * testing/InternalSettings.cpp: (WebCore::InternalSettings::setBackgroundShouldExtendBeyondPage): * testing/InternalSettings.h: * testing/InternalSettings.idl: Source/WebKit: Attempt to keep Windows building. * WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in: LayoutTests: * platform/mac-wk2/tiled-drawing/simple-document-with-margin-tiles-expected.txt: Added. * platform/mac-wk2/tiled-drawing/simple-document-with-margin-tiles.html: Added. Canonical link: https://commits.webkit.org/145196@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@162230 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-01-18 00:05:59 +00:00
<body>
<pre id="layers">Layer tree goes here</p>
</body>
</html>