Make seamless iframes paginate properly in their enclosing document's pagination context.
https://bugs.webkit.org/show_bug.cgi?id=106125
<rdar://problem/12922720> Text in iframe is clipped while printing

Reviewed by Simon Fraser.

Added new tests in fast/multicol and fast/region.

Source/WebCore: 

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::clampToStartAndEndRegions):
Don't clamp when the RenderView is the containing block of an object in a RenderFlowThread.

* rendering/RenderObject.cpp:
(WebCore::RenderObject::containerForRepaint):
Don't attempt any repaint container antics when we're in a seamless iframe, since the ancestor
document will actually do the handoff into the flow thread.

* rendering/RenderView.cpp:
(WebCore::enclosingSeamlessRenderer):
Heper function to test for an enclosing seamless iframe.
        
(WebCore::RenderView::addChild):
Subclass addChild on RenderView to properly set the inRenderFlowThread state for a seamless
child document so thta it will check regions.

(WebCore::RenderView::initializeLayoutState):
New helper method for setting up the initial layout state of a RenderView. If inside a seamless
paginated ancestor, set up the appropriate pagination information so the child document
knows about it. This method will expand to inherit info about line grids and exclusions eventually
also.

(WebCore::RenderView::layout):
Now calls initializeLayoutState to set up the layout state.

* rendering/RenderView.h:
(WebCore::RenderView::pageLogicalHeight):
(WebCore::RenderView::setPageLogicalHeight):
(RenderView):
Fix the type of the page logical height methods to be LayoutUnit instead of unsigned.

LayoutTests: 

* fast/multicol/resources/ipad.jpg: Added.
* fast/multicol/resources/seamless.html: Added.
* fast/multicol/seamless-flowed-through-columns-expected.html: Added.
* fast/multicol/seamless-flowed-through-columns.html: Added.
* fast/regions/resources/ipad.jpg: Added.
* fast/regions/resources/seamless.html: Added.
* fast/regions/seamless-iframe-flowed-into-regions-expected.html: Added.
* fast/regions/seamless-iframe-flowed-into-regions.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143256 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix scaling of tiled SVG backgrounds on high-dpi displays
https://bugs.webkit.org/show_bug.cgi?id=110047

Reviewed by Dirk Schulze.

Source/WebCore:

This patch fixes the scaling of SVG when used for drawing patterns. Tiled/patterend SVG
images are first drawn into an image buffer and then the image buffer is used to stamp
out tiles. Because it is a raster source, the size of the image buffer needs to
be scaled to the final resolution of the device. After scaling the image buffer, the
source rect and pattern transforms need to be adjusted so they align in device pixel
coordinates. This adjustment was not done before this patch, causing pixelated rendering.

Additionally, a FIXME has been added due to webkit.org/b/110065 and the image buffer
has been manually scaled (using "zoomedAndScaledContainerRect") instead of relying
on the ImageBuffer's resolutionScale parameter.

Test: svg/as-background-image/tiled-background-image.html

* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::drawPatternForContainer):

    Note that fixing the FIXME does not change that the source rect and transform need
    to be adjusted for page scale.

LayoutTests:

* svg/as-background-image/tiled-background-image-expected.html: Added.
* svg/as-background-image/tiled-background-image.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143257 268f45cc-cd09-0410-ab3c-d52691b4dbfc