2011-10-31 Nikolas Zimmermann <nzimmermann@rim.com>
authorzimmermann@webkit.org <zimmermann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 31 Oct 2011 14:07:49 +0000 (14:07 +0000)
committerzimmermann@webkit.org <zimmermann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 31 Oct 2011 14:07:49 +0000 (14:07 +0000)
        CSS 2.1 failure: background-intrinsic-*
        https://bugs.webkit.org/show_bug.cgi?id=47156

        Reviewed by Antti Koivisto.

        Add all *intrinsic* tests from the CSS 2.1 Testsuite - we pass all of them now.
        All tests regarding SVG are now imported in LayoutTests, none are failing anymore.

        Add several new testcases covering the SVG Image size negotiation logic, as defined in CSS 2.1.

        * css2.1/20110323/background-intrinsic-001.htm: Added.
        * css2.1/20110323/background-intrinsic-002.htm: Added.
        * css2.1/20110323/background-intrinsic-003.htm: Added.
        * css2.1/20110323/background-intrinsic-004.htm: Added.
        * css2.1/20110323/background-intrinsic-005.htm: Added.
        * css2.1/20110323/background-intrinsic-006.htm: Added.
        * css2.1/20110323/background-intrinsic-007.htm: Added.
        * css2.1/20110323/background-intrinsic-008.htm: Added.
        * css2.1/20110323/background-intrinsic-009.htm: Added.
        * css2.1/20110323/resources/green-intrinsic-height-ratio.svg: Added.
        * css2.1/20110323/resources/green-intrinsic-height.svg: Added.
        * css2.1/20110323/resources/green-intrinsic-none.svg: Added.
        * css2.1/20110323/resources/green-intrinsic-ratio-landscape.svg: Added.
        * css2.1/20110323/resources/green-intrinsic-ratio-portrait.svg: Added.
        * css2.1/20110323/resources/green-intrinsic-width-height.svg: Added.
        * css2.1/20110323/resources/green-intrinsic-width-pc-height-pc.svg: Added.
        * css2.1/20110323/resources/green-intrinsic-width-ratio.svg: Added.
        * css2.1/20110323/resources/green-intrinsic-width.svg: Added.
        * css2.1/20110323/resources/red-intrinsic-height-ratio.svg: Added.
        * css2.1/20110323/resources/red-intrinsic-height.svg: Added.
        * css2.1/20110323/resources/red-intrinsic-none.svg: Added.
        * css2.1/20110323/resources/red-intrinsic-ratio-landscape.svg: Added.
        * css2.1/20110323/resources/red-intrinsic-ratio-portrait.svg: Added.
        * css2.1/20110323/resources/red-intrinsic-width-height.svg: Added.
        * css2.1/20110323/resources/red-intrinsic-width-pc-height-pc.svg: Added.
        * css2.1/20110323/resources/red-intrinsic-width-ratio.svg: Added.
        * css2.1/20110323/resources/red-intrinsic-width.svg: Added.
        * fast/backgrounds/size/contain-and-cover-zoomed.html: Added.
        * fast/images/percent-height-image-expected.txt: Update results, testcase is fixed now.
        * fast/images/percent-height-image.html: Make test async, to make it work cross-browser. With this patch we now pass this testcase.
        * platform/mac-snowleopard/svg/zoom/page/relative-sized-document-scrollbars-expected.png: Removed.
        * platform/mac-snowleopard/svg/zoom/page/zoom-foreignObject-expected.png: Removed.
        * platform/mac/css1/text_properties/vertical_align-expected.txt: Update for rounding differences.
        * platform/mac/css2.1/20110323/background-intrinsic-001-expected.png: Added.
        * platform/mac/css2.1/20110323/background-intrinsic-001-expected.txt: Added.
        * platform/mac/css2.1/20110323/background-intrinsic-002-expected.png: Added.
        * platform/mac/css2.1/20110323/background-intrinsic-002-expected.txt: Added.
        * platform/mac/css2.1/20110323/background-intrinsic-003-expected.png: Added.
        * platform/mac/css2.1/20110323/background-intrinsic-003-expected.txt: Added.
        * platform/mac/css2.1/20110323/background-intrinsic-004-expected.png: Added.
        * platform/mac/css2.1/20110323/background-intrinsic-004-expected.txt: Added.
        * platform/mac/css2.1/20110323/background-intrinsic-005-expected.png: Added.
        * platform/mac/css2.1/20110323/background-intrinsic-005-expected.txt: Added.
        * platform/mac/css2.1/20110323/background-intrinsic-006-expected.png: Added.
        * platform/mac/css2.1/20110323/background-intrinsic-006-expected.txt: Added.
        * platform/mac/css2.1/20110323/background-intrinsic-007-expected.png: Added.
        * platform/mac/css2.1/20110323/background-intrinsic-007-expected.txt: Added.
        * platform/mac/css2.1/20110323/background-intrinsic-008-expected.png: Added.
        * platform/mac/css2.1/20110323/background-intrinsic-008-expected.txt: Added.
        * platform/mac/css2.1/20110323/background-intrinsic-009-expected.png: Added.
        * platform/mac/css2.1/20110323/background-intrinsic-009-expected.txt: Added.
        * platform/mac/fast/backgrounds/size/contain-and-cover-expected.png: Updated for rounding differences.
        * platform/mac/fast/backgrounds/size/contain-and-cover-zoomed-expected.png: Added.
        * platform/mac/fast/backgrounds/size/contain-and-cover-zoomed-expected.txt: Added.
        * platform/mac/fast/block/float/015-expected.png: Slight changes, due 49x50 -> 50x50 size change.
        * platform/mac/fast/block/float/015-expected.txt: Ditto.
        * platform/mac/fast/block/positioning/replaced-inside-fixed-top-bottom-expected.png: Slight changes due to rounding.
        * platform/mac/fast/block/positioning/replaced-inside-fixed-top-bottom-expected.txt: Ditto.
        * platform/mac/fast/repaint/block-layout-inline-children-replaced-expected.png: Ditto.
        * platform/mac/fast/repaint/block-layout-inline-children-replaced-expected.txt: Ditto.
        * platform/mac/svg/as-background-image/background-image-preserveaspectRatio-support-expected.png: Added.
        * platform/mac/svg/as-background-image/background-image-preserveaspectRatio-support-expected.txt: Added.
        * platform/mac/svg/as-background-image/background-image-tiled-expected.png: Added.
        * platform/mac/svg/as-background-image/background-image-tiled-expected.txt: Added.
        * platform/mac/svg/as-background-image/same-image-two-instances-background-image-expected.png: Added.
        * platform/mac/svg/as-background-image/same-image-two-instances-background-image-expected.txt: Added.
        * platform/mac/svg/as-background-image/svg-as-background-4-expected.png: Adapt to preserveAspectRatio changes in hearts.svg.
        * platform/mac/svg/as-border-image/svg-as-border-image-expected.png: This needed a rebaseline, it was forgotten before.
        * platform/mac/svg/as-image/animated-svg-as-image-expected.png: Progression, now both images share the same size & ratio, as desired.
        * platform/mac/svg/as-image/img-preserveAspectRatio-support-1-expected.png: Added.
        * platform/mac/svg/as-image/img-preserveAspectRatio-support-1-expected.txt: Added.
        * platform/mac/svg/as-image/same-image-two-instances-expected.png: Added.
        * platform/mac/svg/as-image/same-image-two-instances-expected.txt: Added.
        * platform/mac/svg/as-image/svg-as-relative-image-expected.png: Adapt to green-relative-size-rect.svg - a circle got added to make it easier to compare.
        * platform/mac/svg/as-image/svg-as-relative-image-with-explicit-size-expected.png: Added.
        * platform/mac/svg/as-image/svg-as-relative-image-with-explicit-size-expected.txt: Added.
        * platform/mac/svg/as-image/svg-image-change-content-size-expected.png: Added.
        * platform/mac/svg/as-image/svg-image-change-content-size-expected.txt: Added.
        * platform/mac/svg/zoom/page/relative-sized-document-scrollbars-expected.png: Updated, scrollbars are gone - now matching Opera/FF.
        * platform/mac/svg/zoom/page/relative-sized-document-scrollbars-expected.txt: Ditto.
        * platform/mac/svg/zoom/page/zoom-background-image-tiled-expected.png: Added.
        * platform/mac/svg/zoom/page/zoom-background-image-tiled-expected.txt: Added.
        * platform/mac/svg/zoom/page/zoom-background-images-expected.png: Added.
        * platform/mac/svg/zoom/page/zoom-background-images-expected.txt: Added.
        * platform/mac/svg/zoom/page/zoom-foreignObject-expected.png: Updated, scrollbars are gone - now matching Opera/FF.
        * platform/mac/svg/zoom/page/zoom-foreignObject-expected.txt: Ditto.
        * platform/mac/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.png: Added.
        * platform/mac/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.txt: Added.
        * platform/mac/svg/zoom/page/zoom-svg-as-background-with-relative-size-and-viewBox-expected.png: Added.
        * platform/mac/svg/zoom/page/zoom-svg-as-background-with-relative-size-and-viewBox-expected.txt: Added.
        * platform/mac/svg/zoom/page/zoom-svg-as-background-with-relative-size-expected.png: Added.
        * platform/mac/svg/zoom/page/zoom-svg-as-background-with-relative-size-expected.txt: Added.
        * platform/mac/svg/zoom/page/zoom-svg-as-image-expected.png: Added.
        * platform/mac/svg/zoom/page/zoom-svg-as-image-expected.txt: Added.
        * platform/mac/svg/zoom/page/zoom-svg-as-relative-image-expected.png: Added.
        * platform/mac/svg/zoom/page/zoom-svg-as-relative-image-expected.txt: Added.
        * svg/as-background-image/background-image-preserveaspectRatio-support.html: Added.
        * svg/as-background-image/background-image-tiled.html: Added.
        * svg/as-background-image/resources/construction-tape.svg: Added.
        * svg/as-background-image/resources/hearts.svg: Fix testcase, by adding pAR="none", which is now respected. Now the image looks as desired across Opera/FF and us.
        * svg/as-background-image/same-image-two-instances-background-image.html: Added.
        * svg/as-image/img-preserveAspectRatio-support-1.html: Added.
        * svg/as-image/resources/circle-default-meet.svg: Added.
        * svg/as-image/resources/circle-default-none.svg: Added.
        * svg/as-image/resources/circle-default-slice.svg: Added.
        * svg/as-image/resources/circle-nosize.svg: Added.
        * svg/as-image/resources/circle-viewbox-default.svg: Added.
        * svg/as-image/resources/circle-viewbox-meet.svg: Added.
        * svg/as-image/resources/circle-viewbox-none.svg: Added.
        * svg/as-image/resources/circle-viewbox-slice.svg: Added.
        * svg/as-image/resources/green-relative-size-rect.svg: Use relative units everywhere as intended. Add circle to make it easy to spot ratio changes.
        * svg/as-image/same-image-two-instances.html: Added.
        * svg/as-image/svg-as-relative-image-with-explicit-size.html: Added.
        * svg/as-image/svg-image-change-content-size.xhtml: Added.
        * svg/zoom/page/resources/relative-sized-background-with-viewBox.svg: Added.
        * svg/zoom/page/zoom-background-image-tiled.html: Added.
        * svg/zoom/page/zoom-background-images.html: Added.
        * svg/zoom/page/zoom-img-preserveAspectRatio-support-1.html: Added.
        * svg/zoom/page/zoom-svg-as-background-with-relative-size-and-viewBox.html: Added.
        * svg/zoom/page/zoom-svg-as-background-with-relative-size.html: Added.
        * svg/zoom/page/zoom-svg-as-image.html: Added.
        * svg/zoom/page/zoom-svg-as-relative-image.html: Added.

2011-10-31  Nikolas Zimmermann  <nzimmermann@rim.com>

        CSS 2.1 failure: background-intrinsic-*
        https://bugs.webkit.org/show_bug.cgi?id=47156

        SVGs do not work as tiled background images
        https://bugs.webkit.org/show_bug.cgi?id=16281

        Apply preserveAspectRatio and synthesize viewboxes in <img>
        https://bugs.webkit.org/show_bug.cgi?id=34521

        SVG background doesn't resize properly when dimensions are changed
        https://bugs.webkit.org/show_bug.cgi?id=42944

        Images with percent height inside a floated div should use intrinsic height.
        https://bugs.webkit.org/show_bug.cgi?id=45439

        SVG image in HTML changes size as the window is resized
        https://bugs.webkit.org/show_bug.cgi?id=52045

        Reviewed by Antti Koivisto.

        Implement intrinsic sizing support for SVGImage (svg embedded through <html:img>/<svg:image>/background-image/border-image/...).
        This is demanded by CSS 2.1, and covered by new layout tests in LayoutTests/css2.1 and several new custom testcases.

        Tests: css2.1/20110323/background-intrinsic-001.htm
               css2.1/20110323/background-intrinsic-002.htm
               css2.1/20110323/background-intrinsic-003.htm
               css2.1/20110323/background-intrinsic-004.htm
               css2.1/20110323/background-intrinsic-005.htm
               css2.1/20110323/background-intrinsic-006.htm
               css2.1/20110323/background-intrinsic-007.htm
               css2.1/20110323/background-intrinsic-008.htm
               css2.1/20110323/background-intrinsic-009.htm
               svg/as-background-image/background-image-preserveaspectRatio-support.html (adapted from testcase from bug 34521)
               svg/as-background-image/background-image-tiled.html (reduction from bug 16281)
               svg/as-background-image/same-image-two-instances-background-image.html
               svg/as-image/img-preserveAspectRatio-support-1.html (reduction from bug 34521)
               svg/as-image/same-image-two-instances.html
               svg/as-image/svg-as-relative-image-with-explicit-size.html
               svg/as-image/svg-image-change-content-size.xhtml (reduction from bug 42944)
               svg/zoom/page/zoom-img-preserveAspectRatio-support-1.html
               svg/zoom/page/zoom-svg-as-image.html
               svg/zoom/page/zoom-svg-as-relative-image.html

        * css/CSSImageGeneratorValue.cpp:
        (WebCore::CSSImageGeneratorValue::addClient): Pass default zoom factor.
        (WebCore::CSSImageGeneratorValue::getImage): Ditto.
        * loader/cache/CachedImage.cpp: Enable SVGImage <-> IntSize cache.
        (WebCore::CachedImage::lookupImageForSize): Use recently introduced ImageBySizeCache, to lookup an image for a certain size.
        (WebCore::CachedImage::lookupOrCreateImageForRenderer): Use recently introduced ImageBySizeCache, to dynamically create copies of m_image if needed.
        (WebCore::CachedImage::imageForRenderer): Lookup image by renderer, which first looks up a size for a renderer, then uses lookupImageForSize().
        (WebCore::CachedImage::setContainerSizeForRenderer): For SVGImages, pass on container size handling to ImageBySizeCache.
        (WebCore::CachedImage::imageSizeForRenderer): Figure out the image size, respecting per-renderer overrides, for a certain renderer.
        (WebCore::CachedImage::computeIntrinsicDimensions): Remove unnecessary RenderObject parameter.
        * loader/cache/CachedImage.h:
        * page/ChromeClient.h:
        (WebCore::ChromeClient::isSVGImageChromeClient): Used to identify whether a RenderSVGRoot is embedded through a SVGImage. Returns false, by default.
        * platform/graphics/Image.h:
        (WebCore::Image::setImageObserver): Add helper.
        * rendering/ImageBySizeCache.cpp: Cleanup code.
        (WebCore::ImageBySizeCache::addClient): Assert the passed renderer is valid.
        (WebCore::ImageBySizeCache::removeClient): Ditto. Allow removeClient() to be called w/o prio addClient() usage.
        (WebCore::ImageBySizeCache::getImage): Add zoom parameter.
        (WebCore::ImageBySizeCache::getRequestedSizeAndZoom): Add way to get requested size from cache, instead of actual cached sizes.
        (WebCore::ImageBySizeCache::imageForSize): Respect empty sizes, just return 0, instead of asserting.
        (WebCore::ImageBySizeCache::imageForRenderer): Added a helper that retrieves an image for a renderer, by lookup up its size and using imageForSize().
        * rendering/ImageBySizeCache.h: Cleaup code, introduce struct that replaces the std::pair<IntSize, int>.
        (WebCore::SizeZoomAndCount::SizeZoomAndCount):
        * rendering/RenderBoxModelObject.cpp: Implement CSS 2.1 intrinsic size negotiation for images.
        (WebCore::resolveWidthForRatio): New inline helper function used by calculateImageIntrinsicDimensions.
        (WebCore::resolveHeightForRatio): Ditto.
        (WebCore::resolveAgainstIntrinsicWidthOrHeightAndRatio): Ditto.
        (WebCore::resolveAgainstIntrinsicRatio):  Ditto.
        (WebCore::RenderBoxModelObject::calculateImageIntrinsicDimensions): New helper function, containing the main algorithm, which is a pure transcription of the spec.
        (WebCore::RenderBoxModelObject::calculateFillTileSize): Use new calculateImageIntrinsicDimensions() helper to figure out the intrinsic size.
        (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry): Propagate calculateFillTileSize() result to the image resource, via setContainerSizeForRenderer().
        (WebCore::RenderBoxModelObject::paintNinePieceImage): Use new calculateImageIntrinsicDimensions() helper to figure out the intrinsic size.
        * rendering/RenderBoxModelObject.h: Clarify some variable names, added calculateImageIntrinsicDimensions().
        * rendering/RenderImage.cpp:
        (WebCore::RenderImage::RenderImage): Use IntSize(), instead of IntSize(0, 0).
        (WebCore::RenderImage::updateIntrinsicSizeIfNeeded): Refactored from imageDimensionsChanged().
        (WebCore::RenderImage::imageDimensionsChanged): Use updateIntrinsicSizeIfNeeded().
        (WebCore::RenderImage::computeReplacedLogicalWidth): Use RenderReplaced::computeReplacedLogicalWidth() exclusively. For this to work, the intrinsic size must be correct.
        (WebCore::RenderImage::computeIntrinsicRatioInformation): Default implementation for non-SVGImages.
        (WebCore::RenderImage::needsPreferredWidthsRecalculation): Return true, just like RenderPart, if embeddedContentBox is not null.
        (WebCore::RenderImage::embeddedContentBox): Returns the RenderSVGRoot* renderer of the embedded SVG, if possible.
        * rendering/RenderImage.h: Remove isLogicalWidth/HeightSpecified() / computeReplacedLogicalHeight() / calcAspectRatioLogicalWidth/Height().
        * rendering/RenderImageResource.cpp:
        (WebCore::RenderImageResource::setContainerSizeForRenderer): Pass around new "float containerZoomFactor" parameter.
        * rendering/RenderImageResourceStyleImage.cpp:
        (WebCore::RenderImageResourceStyleImage::image): embeddedContentBox() is now calling image() earlier than before. We now have to handle the case that the image is pending.
        (WebCore::RenderImageResourceStyleImage::setContainerSizeForRenderer): Pass zoom factor.
        * rendering/RenderImageResourceStyleImage.h:
        * rendering/RenderListMarker.cpp:
        (WebCore::RenderListMarker::computePreferredLogicalWidths): Pass effective zoom to setContainerSizeForRenderer().
        * rendering/RenderReplaced.cpp:
        (WebCore::RenderReplaced::computeIntrinsicLogicalWidth): Generalized this code, as RenderImage is using it as well now. Marginal changes needed.
        (WebCore::RenderReplaced::computeIntrinsicLogicalHeight): Ditto.
        (WebCore::RenderReplaced::computeReplacedLogicalWidth): Ditto.
        * rendering/style/StyleCachedImage.cpp:
        (WebCore::StyleCachedImage::computeIntrinsicDimensions): Stop passing m_renderer to CachedImage, it's no longer needed.
        (WebCore::StyleCachedImage::setContainerSizeForRenderer): Add "float containerZoomFactor" parameter.
        * rendering/style/StyleCachedImage.h: Add "float containerZoomFactor" parameter to setContainerSizeForRenderer.
        * rendering/style/StyleGeneratedImage.h:
        (WebCore::StyleGeneratedImage::setContainerSizeForRenderer): Ditto.
        * rendering/style/StyleImage.h: Ditto.
        * rendering/style/StylePendingImage.h:
        (WebCore::StylePendingImage::setContainerSizeForRenderer): Ditto.
        * rendering/svg/RenderSVGImage.cpp:
        (WebCore::RenderSVGImage::layout): Always supply a container size when embedding SVGs in <svg:image>.
        * rendering/svg/RenderSVGRoot.cpp: Move "override container size" from SVGSVGElement into RenderSVGRoot, where it belongs.
        (WebCore::RenderSVGRoot::isEmbeddedThroughImageElement): Add helper method to determine whether we're loaded through SVGImage.
        (WebCore::RenderSVGRoot::computeReplacedLogicalWidth): If we have a valid container size, it has precendence (only supplied via external SVGImages).
        (WebCore::RenderSVGRoot::computeReplacedLogicalHeight): Ditto.
        (WebCore::RenderSVGRoot::layout): Remove calcViewport() usage, no need to track/override the viewport size anymore, all done in coputeReplacedLogical* now.
        (WebCore::RenderSVGRoot::paint): Use borderBoxRect() which now always matches the previously computed m_viewportSize.
        (WebCore::RenderSVGRoot::computeRectForRepaint): Ditto.
        * rendering/svg/RenderSVGRoot.h: Move "override container size" from SVGSVGElement into RenderSVGRoot, where it belongs.
        (WebCore::RenderSVGRoot::containerSize):
        (WebCore::RenderSVGRoot::setContainerSize):
        * svg/SVGLength.cpp:
        (WebCore::SVGLength::determineViewport): Resolve lengths against override container size in documents embedded through SVGImage.
        * svg/SVGSVGElement.cpp: Remove "override container size" handling from SVGSVGElement.
        (WebCore::SVGSVGElement::SVGSVGElement): Ditto.
        (WebCore::SVGSVGElement::currentViewBoxRect): Always synthesize a viewBox, if we're embedded through SVGImage, as demanded by SVG 1.1 2nd Edition.
        * svg/SVGSVGElement.h:
        * svg/graphics/SVGImage.cpp:
        (WebCore::SVGImageChromeClient::isSVGImageChromeClient): Return true, used to identify whether RenderSVGRoot is embedded through SVGImage.
        (WebCore::SVGImage::createWithDataAndSize): Add new helper function.
        (WebCore::SVGImage::setContainerZoom): Forwarded to Page::setPageZoomFactor.
        (WebCore::SVGImage::setContainerSize): Assert that container size is not empty. We should never receive an empty container size.
        (WebCore::SVGImage::usesContainerSize): Adapt to override container size changes, it now lives in RenderSVGRoot instead of SVGSVGElement.
        (WebCore::SVGImage::size): New algorithm to figure out the size of an embedded SVG, as demanded by the CSS/SVG specs.
        (WebCore::SVGImage::embeddedContentBox): Add helper which returns the RenderSVGRoot of the document.
        (WebCore::SVGImage::computeIntrinsicDimensions): Implement intrinsic ratio calculation.
        (WebCore::SVGImage::dataChanged): Force calling FrameView::setCanHaveScrollbars(false), as SVG images now always synthesize a viewBox, and thus never receive scrollbars.
        * svg/graphics/SVGImage.h:

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

156 files changed:
LayoutTests/ChangeLog
LayoutTests/css2.1/20110323/background-intrinsic-001.htm [new file with mode: 0644]
LayoutTests/css2.1/20110323/background-intrinsic-002.htm [new file with mode: 0644]
LayoutTests/css2.1/20110323/background-intrinsic-003.htm [new file with mode: 0644]
LayoutTests/css2.1/20110323/background-intrinsic-004.htm [new file with mode: 0644]
LayoutTests/css2.1/20110323/background-intrinsic-005.htm [new file with mode: 0644]
LayoutTests/css2.1/20110323/background-intrinsic-006.htm [new file with mode: 0644]
LayoutTests/css2.1/20110323/background-intrinsic-007.htm [new file with mode: 0644]
LayoutTests/css2.1/20110323/background-intrinsic-008.htm [new file with mode: 0644]
LayoutTests/css2.1/20110323/background-intrinsic-009.htm [new file with mode: 0644]
LayoutTests/css2.1/20110323/resources/green-intrinsic-height-ratio.svg [new file with mode: 0644]
LayoutTests/css2.1/20110323/resources/green-intrinsic-height.svg [new file with mode: 0644]
LayoutTests/css2.1/20110323/resources/green-intrinsic-none.svg [new file with mode: 0644]
LayoutTests/css2.1/20110323/resources/green-intrinsic-ratio-landscape.svg [new file with mode: 0644]
LayoutTests/css2.1/20110323/resources/green-intrinsic-ratio-portrait.svg [new file with mode: 0644]
LayoutTests/css2.1/20110323/resources/green-intrinsic-width-height.svg [new file with mode: 0644]
LayoutTests/css2.1/20110323/resources/green-intrinsic-width-pc-height-pc.svg [new file with mode: 0644]
LayoutTests/css2.1/20110323/resources/green-intrinsic-width-ratio.svg [new file with mode: 0644]
LayoutTests/css2.1/20110323/resources/green-intrinsic-width.svg [new file with mode: 0644]
LayoutTests/css2.1/20110323/resources/red-intrinsic-height-ratio.svg [new file with mode: 0644]
LayoutTests/css2.1/20110323/resources/red-intrinsic-height.svg [new file with mode: 0644]
LayoutTests/css2.1/20110323/resources/red-intrinsic-none.svg [new file with mode: 0644]
LayoutTests/css2.1/20110323/resources/red-intrinsic-ratio-landscape.svg [new file with mode: 0644]
LayoutTests/css2.1/20110323/resources/red-intrinsic-ratio-portrait.svg [new file with mode: 0644]
LayoutTests/css2.1/20110323/resources/red-intrinsic-width-height.svg [new file with mode: 0644]
LayoutTests/css2.1/20110323/resources/red-intrinsic-width-pc-height-pc.svg [new file with mode: 0644]
LayoutTests/css2.1/20110323/resources/red-intrinsic-width-ratio.svg [new file with mode: 0644]
LayoutTests/css2.1/20110323/resources/red-intrinsic-width.svg [new file with mode: 0644]
LayoutTests/fast/backgrounds/size/contain-and-cover-zoomed.html [new file with mode: 0644]
LayoutTests/fast/images/percent-height-image-expected.txt
LayoutTests/fast/images/percent-height-image.html
LayoutTests/platform/mac-snowleopard/svg/zoom/page/relative-sized-document-scrollbars-expected.png [deleted file]
LayoutTests/platform/mac-snowleopard/svg/zoom/page/zoom-foreignObject-expected.png [deleted file]
LayoutTests/platform/mac/css1/text_properties/vertical_align-expected.txt
LayoutTests/platform/mac/css2.1/20110323/abspos-non-replaced-width-margin-000-expected.png
LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-001-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-001-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-002-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-002-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-003-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-003-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-004-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-004-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-005-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-005-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-006-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-006-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-007-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-007-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-008-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-008-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-009-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-009-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/css2.1/20110323/block-non-replaced-width-008-expected.png
LayoutTests/platform/mac/fast/backgrounds/background-leakage-transforms-expected.png
LayoutTests/platform/mac/fast/backgrounds/size/contain-and-cover-expected.png
LayoutTests/platform/mac/fast/backgrounds/size/contain-and-cover-zoomed-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/backgrounds/size/contain-and-cover-zoomed-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/fast/block/float/015-expected.png
LayoutTests/platform/mac/fast/block/float/015-expected.txt
LayoutTests/platform/mac/fast/block/positioning/replaced-inside-fixed-top-bottom-expected.png
LayoutTests/platform/mac/fast/block/positioning/replaced-inside-fixed-top-bottom-expected.txt
LayoutTests/platform/mac/fast/repaint/block-layout-inline-children-replaced-expected.png
LayoutTests/platform/mac/fast/repaint/block-layout-inline-children-replaced-expected.txt
LayoutTests/platform/mac/svg/as-background-image/background-image-preserveaspectRatio-support-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/svg/as-background-image/background-image-preserveaspectRatio-support-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/svg/as-background-image/background-image-tiled-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/svg/as-background-image/background-image-tiled-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/svg/as-background-image/same-image-two-instances-background-image-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/svg/as-background-image/same-image-two-instances-background-image-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/svg/as-background-image/svg-as-background-4-expected.png
LayoutTests/platform/mac/svg/as-border-image/svg-as-border-image-expected.png
LayoutTests/platform/mac/svg/as-image/animated-svg-as-image-expected.png
LayoutTests/platform/mac/svg/as-image/img-preserveAspectRatio-support-1-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/svg/as-image/img-preserveAspectRatio-support-1-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/svg/as-image/same-image-two-instances-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/svg/as-image/same-image-two-instances-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/svg/as-image/svg-as-relative-image-expected.png
LayoutTests/platform/mac/svg/as-image/svg-as-relative-image-with-explicit-size-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/svg/as-image/svg-as-relative-image-with-explicit-size-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/svg/as-image/svg-image-change-content-size-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/svg/as-image/svg-image-change-content-size-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/svg/zoom/page/relative-sized-document-scrollbars-expected.png
LayoutTests/platform/mac/svg/zoom/page/relative-sized-document-scrollbars-expected.txt
LayoutTests/platform/mac/svg/zoom/page/zoom-background-image-tiled-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/svg/zoom/page/zoom-background-image-tiled-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/svg/zoom/page/zoom-background-images-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/svg/zoom/page/zoom-background-images-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/svg/zoom/page/zoom-foreignObject-expected.png
LayoutTests/platform/mac/svg/zoom/page/zoom-foreignObject-expected.txt
LayoutTests/platform/mac/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/svg/zoom/page/zoom-svg-as-background-with-relative-size-and-viewBox-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/svg/zoom/page/zoom-svg-as-background-with-relative-size-and-viewBox-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/svg/zoom/page/zoom-svg-as-background-with-relative-size-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/svg/zoom/page/zoom-svg-as-background-with-relative-size-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/svg/zoom/page/zoom-svg-as-image-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/svg/zoom/page/zoom-svg-as-image-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/svg/zoom/page/zoom-svg-as-relative-image-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/svg/zoom/page/zoom-svg-as-relative-image-expected.txt [new file with mode: 0644]
LayoutTests/svg/as-background-image/background-image-preserveaspectRatio-support.html [new file with mode: 0644]
LayoutTests/svg/as-background-image/background-image-tiled.html [new file with mode: 0644]
LayoutTests/svg/as-background-image/resources/construction-tape.svg [new file with mode: 0644]
LayoutTests/svg/as-background-image/resources/hearts.svg
LayoutTests/svg/as-background-image/same-image-two-instances-background-image.html [new file with mode: 0644]
LayoutTests/svg/as-image/img-preserveAspectRatio-support-1.html [new file with mode: 0644]
LayoutTests/svg/as-image/resources/circle-default-meet.svg [new file with mode: 0644]
LayoutTests/svg/as-image/resources/circle-default-none.svg [new file with mode: 0644]
LayoutTests/svg/as-image/resources/circle-default-slice.svg [new file with mode: 0644]
LayoutTests/svg/as-image/resources/circle-nosize.svg [new file with mode: 0644]
LayoutTests/svg/as-image/resources/circle-viewbox-default.svg [new file with mode: 0644]
LayoutTests/svg/as-image/resources/circle-viewbox-meet.svg [new file with mode: 0644]
LayoutTests/svg/as-image/resources/circle-viewbox-none.svg [new file with mode: 0644]
LayoutTests/svg/as-image/resources/circle-viewbox-slice.svg [new file with mode: 0644]
LayoutTests/svg/as-image/resources/green-relative-size-rect.svg
LayoutTests/svg/as-image/same-image-two-instances.html [new file with mode: 0644]
LayoutTests/svg/as-image/svg-as-relative-image-with-explicit-size.html [new file with mode: 0644]
LayoutTests/svg/as-image/svg-image-change-content-size.xhtml [new file with mode: 0644]
LayoutTests/svg/zoom/page/resources/relative-sized-background-with-viewBox.svg [new file with mode: 0644]
LayoutTests/svg/zoom/page/zoom-background-image-tiled.html [new file with mode: 0644]
LayoutTests/svg/zoom/page/zoom-background-images.html [new file with mode: 0644]
LayoutTests/svg/zoom/page/zoom-img-preserveAspectRatio-support-1.html [new file with mode: 0644]
LayoutTests/svg/zoom/page/zoom-svg-as-background-with-relative-size-and-viewBox.html [new file with mode: 0644]
LayoutTests/svg/zoom/page/zoom-svg-as-background-with-relative-size.html [new file with mode: 0644]
LayoutTests/svg/zoom/page/zoom-svg-as-image.html [new file with mode: 0644]
LayoutTests/svg/zoom/page/zoom-svg-as-relative-image.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/CSSImageGeneratorValue.cpp
Source/WebCore/loader/cache/CachedImage.cpp
Source/WebCore/loader/cache/CachedImage.h
Source/WebCore/page/ChromeClient.h
Source/WebCore/platform/graphics/Image.h
Source/WebCore/rendering/ImageBySizeCache.cpp
Source/WebCore/rendering/ImageBySizeCache.h
Source/WebCore/rendering/RenderBoxModelObject.cpp
Source/WebCore/rendering/RenderBoxModelObject.h
Source/WebCore/rendering/RenderImage.cpp
Source/WebCore/rendering/RenderImage.h
Source/WebCore/rendering/RenderImageResource.cpp
Source/WebCore/rendering/RenderImageResourceStyleImage.cpp
Source/WebCore/rendering/RenderImageResourceStyleImage.h
Source/WebCore/rendering/RenderListMarker.cpp
Source/WebCore/rendering/RenderReplaced.cpp
Source/WebCore/rendering/style/StyleCachedImage.cpp
Source/WebCore/rendering/style/StyleCachedImage.h
Source/WebCore/rendering/style/StyleGeneratedImage.h
Source/WebCore/rendering/style/StyleImage.h
Source/WebCore/rendering/style/StylePendingImage.h
Source/WebCore/rendering/svg/RenderSVGImage.cpp
Source/WebCore/rendering/svg/RenderSVGRoot.cpp
Source/WebCore/rendering/svg/RenderSVGRoot.h
Source/WebCore/svg/SVGLength.cpp
Source/WebCore/svg/SVGSVGElement.cpp
Source/WebCore/svg/SVGSVGElement.h
Source/WebCore/svg/graphics/SVGImage.cpp
Source/WebCore/svg/graphics/SVGImage.h

index 3e4c85f..7fabff3 100755 (executable)
@@ -1,3 +1,138 @@
+2011-10-31  Nikolas Zimmermann  <nzimmermann@rim.com>
+
+        CSS 2.1 failure: background-intrinsic-*
+        https://bugs.webkit.org/show_bug.cgi?id=47156
+
+        Reviewed by Antti Koivisto.
+
+        Add all *intrinsic* tests from the CSS 2.1 Testsuite - we pass all of them now.
+        All tests regarding SVG are now imported in LayoutTests, none are failing anymore.
+
+        Add several new testcases covering the SVG Image size negotiation logic, as defined in CSS 2.1.
+
+        * css2.1/20110323/background-intrinsic-001.htm: Added.
+        * css2.1/20110323/background-intrinsic-002.htm: Added.
+        * css2.1/20110323/background-intrinsic-003.htm: Added.
+        * css2.1/20110323/background-intrinsic-004.htm: Added.
+        * css2.1/20110323/background-intrinsic-005.htm: Added.
+        * css2.1/20110323/background-intrinsic-006.htm: Added.
+        * css2.1/20110323/background-intrinsic-007.htm: Added.
+        * css2.1/20110323/background-intrinsic-008.htm: Added.
+        * css2.1/20110323/background-intrinsic-009.htm: Added.
+        * css2.1/20110323/resources/green-intrinsic-height-ratio.svg: Added.
+        * css2.1/20110323/resources/green-intrinsic-height.svg: Added.
+        * css2.1/20110323/resources/green-intrinsic-none.svg: Added.
+        * css2.1/20110323/resources/green-intrinsic-ratio-landscape.svg: Added.
+        * css2.1/20110323/resources/green-intrinsic-ratio-portrait.svg: Added.
+        * css2.1/20110323/resources/green-intrinsic-width-height.svg: Added.
+        * css2.1/20110323/resources/green-intrinsic-width-pc-height-pc.svg: Added.
+        * css2.1/20110323/resources/green-intrinsic-width-ratio.svg: Added.
+        * css2.1/20110323/resources/green-intrinsic-width.svg: Added.
+        * css2.1/20110323/resources/red-intrinsic-height-ratio.svg: Added.
+        * css2.1/20110323/resources/red-intrinsic-height.svg: Added.
+        * css2.1/20110323/resources/red-intrinsic-none.svg: Added.
+        * css2.1/20110323/resources/red-intrinsic-ratio-landscape.svg: Added.
+        * css2.1/20110323/resources/red-intrinsic-ratio-portrait.svg: Added.
+        * css2.1/20110323/resources/red-intrinsic-width-height.svg: Added.
+        * css2.1/20110323/resources/red-intrinsic-width-pc-height-pc.svg: Added.
+        * css2.1/20110323/resources/red-intrinsic-width-ratio.svg: Added.
+        * css2.1/20110323/resources/red-intrinsic-width.svg: Added.
+        * fast/backgrounds/size/contain-and-cover-zoomed.html: Added.
+        * fast/images/percent-height-image-expected.txt: Update results, testcase is fixed now.
+        * fast/images/percent-height-image.html: Make test async, to make it work cross-browser. With this patch we now pass this testcase.
+        * platform/mac-snowleopard/svg/zoom/page/relative-sized-document-scrollbars-expected.png: Removed.
+        * platform/mac-snowleopard/svg/zoom/page/zoom-foreignObject-expected.png: Removed.
+        * platform/mac/css1/text_properties/vertical_align-expected.txt: Update for rounding differences.
+        * platform/mac/css2.1/20110323/background-intrinsic-001-expected.png: Added.
+        * platform/mac/css2.1/20110323/background-intrinsic-001-expected.txt: Added.
+        * platform/mac/css2.1/20110323/background-intrinsic-002-expected.png: Added.
+        * platform/mac/css2.1/20110323/background-intrinsic-002-expected.txt: Added.
+        * platform/mac/css2.1/20110323/background-intrinsic-003-expected.png: Added.
+        * platform/mac/css2.1/20110323/background-intrinsic-003-expected.txt: Added.
+        * platform/mac/css2.1/20110323/background-intrinsic-004-expected.png: Added.
+        * platform/mac/css2.1/20110323/background-intrinsic-004-expected.txt: Added.
+        * platform/mac/css2.1/20110323/background-intrinsic-005-expected.png: Added.
+        * platform/mac/css2.1/20110323/background-intrinsic-005-expected.txt: Added.
+        * platform/mac/css2.1/20110323/background-intrinsic-006-expected.png: Added.
+        * platform/mac/css2.1/20110323/background-intrinsic-006-expected.txt: Added.
+        * platform/mac/css2.1/20110323/background-intrinsic-007-expected.png: Added.
+        * platform/mac/css2.1/20110323/background-intrinsic-007-expected.txt: Added.
+        * platform/mac/css2.1/20110323/background-intrinsic-008-expected.png: Added.
+        * platform/mac/css2.1/20110323/background-intrinsic-008-expected.txt: Added.
+        * platform/mac/css2.1/20110323/background-intrinsic-009-expected.png: Added.
+        * platform/mac/css2.1/20110323/background-intrinsic-009-expected.txt: Added.
+        * platform/mac/fast/backgrounds/size/contain-and-cover-expected.png: Updated for rounding differences.
+        * platform/mac/fast/backgrounds/size/contain-and-cover-zoomed-expected.png: Added.
+        * platform/mac/fast/backgrounds/size/contain-and-cover-zoomed-expected.txt: Added.
+        * platform/mac/fast/block/float/015-expected.png: Slight changes, due 49x50 -> 50x50 size change.
+        * platform/mac/fast/block/float/015-expected.txt: Ditto.
+        * platform/mac/fast/block/positioning/replaced-inside-fixed-top-bottom-expected.png: Slight changes due to rounding.
+        * platform/mac/fast/block/positioning/replaced-inside-fixed-top-bottom-expected.txt: Ditto.
+        * platform/mac/fast/repaint/block-layout-inline-children-replaced-expected.png: Ditto.
+        * platform/mac/fast/repaint/block-layout-inline-children-replaced-expected.txt: Ditto.
+        * platform/mac/svg/as-background-image/background-image-preserveaspectRatio-support-expected.png: Added.
+        * platform/mac/svg/as-background-image/background-image-preserveaspectRatio-support-expected.txt: Added.
+        * platform/mac/svg/as-background-image/background-image-tiled-expected.png: Added.
+        * platform/mac/svg/as-background-image/background-image-tiled-expected.txt: Added.
+        * platform/mac/svg/as-background-image/same-image-two-instances-background-image-expected.png: Added.
+        * platform/mac/svg/as-background-image/same-image-two-instances-background-image-expected.txt: Added.
+        * platform/mac/svg/as-background-image/svg-as-background-4-expected.png: Adapt to preserveAspectRatio changes in hearts.svg.
+        * platform/mac/svg/as-border-image/svg-as-border-image-expected.png: This needed a rebaseline, it was forgotten before.
+        * platform/mac/svg/as-image/animated-svg-as-image-expected.png: Progression, now both images share the same size & ratio, as desired.
+        * platform/mac/svg/as-image/img-preserveAspectRatio-support-1-expected.png: Added.
+        * platform/mac/svg/as-image/img-preserveAspectRatio-support-1-expected.txt: Added.
+        * platform/mac/svg/as-image/same-image-two-instances-expected.png: Added.
+        * platform/mac/svg/as-image/same-image-two-instances-expected.txt: Added.
+        * platform/mac/svg/as-image/svg-as-relative-image-expected.png: Adapt to green-relative-size-rect.svg - a circle got added to make it easier to compare.
+        * platform/mac/svg/as-image/svg-as-relative-image-with-explicit-size-expected.png: Added.
+        * platform/mac/svg/as-image/svg-as-relative-image-with-explicit-size-expected.txt: Added.
+        * platform/mac/svg/as-image/svg-image-change-content-size-expected.png: Added.
+        * platform/mac/svg/as-image/svg-image-change-content-size-expected.txt: Added.
+        * platform/mac/svg/zoom/page/relative-sized-document-scrollbars-expected.png: Updated, scrollbars are gone - now matching Opera/FF.
+        * platform/mac/svg/zoom/page/relative-sized-document-scrollbars-expected.txt: Ditto.
+        * platform/mac/svg/zoom/page/zoom-background-image-tiled-expected.png: Added.
+        * platform/mac/svg/zoom/page/zoom-background-image-tiled-expected.txt: Added.
+        * platform/mac/svg/zoom/page/zoom-background-images-expected.png: Added.
+        * platform/mac/svg/zoom/page/zoom-background-images-expected.txt: Added.
+        * platform/mac/svg/zoom/page/zoom-foreignObject-expected.png: Updated, scrollbars are gone - now matching Opera/FF.
+        * platform/mac/svg/zoom/page/zoom-foreignObject-expected.txt: Ditto.
+        * platform/mac/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.png: Added.
+        * platform/mac/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.txt: Added.
+        * platform/mac/svg/zoom/page/zoom-svg-as-background-with-relative-size-and-viewBox-expected.png: Added.
+        * platform/mac/svg/zoom/page/zoom-svg-as-background-with-relative-size-and-viewBox-expected.txt: Added.
+        * platform/mac/svg/zoom/page/zoom-svg-as-background-with-relative-size-expected.png: Added.
+        * platform/mac/svg/zoom/page/zoom-svg-as-background-with-relative-size-expected.txt: Added.
+        * platform/mac/svg/zoom/page/zoom-svg-as-image-expected.png: Added.
+        * platform/mac/svg/zoom/page/zoom-svg-as-image-expected.txt: Added.
+        * platform/mac/svg/zoom/page/zoom-svg-as-relative-image-expected.png: Added.
+        * platform/mac/svg/zoom/page/zoom-svg-as-relative-image-expected.txt: Added.
+        * svg/as-background-image/background-image-preserveaspectRatio-support.html: Added.
+        * svg/as-background-image/background-image-tiled.html: Added.
+        * svg/as-background-image/resources/construction-tape.svg: Added.
+        * svg/as-background-image/resources/hearts.svg: Fix testcase, by adding pAR="none", which is now respected. Now the image looks as desired across Opera/FF and us.
+        * svg/as-background-image/same-image-two-instances-background-image.html: Added.
+        * svg/as-image/img-preserveAspectRatio-support-1.html: Added.
+        * svg/as-image/resources/circle-default-meet.svg: Added.
+        * svg/as-image/resources/circle-default-none.svg: Added.
+        * svg/as-image/resources/circle-default-slice.svg: Added.
+        * svg/as-image/resources/circle-nosize.svg: Added.
+        * svg/as-image/resources/circle-viewbox-default.svg: Added.
+        * svg/as-image/resources/circle-viewbox-meet.svg: Added.
+        * svg/as-image/resources/circle-viewbox-none.svg: Added.
+        * svg/as-image/resources/circle-viewbox-slice.svg: Added.
+        * svg/as-image/resources/green-relative-size-rect.svg: Use relative units everywhere as intended. Add circle to make it easy to spot ratio changes.
+        * svg/as-image/same-image-two-instances.html: Added.
+        * svg/as-image/svg-as-relative-image-with-explicit-size.html: Added.
+        * svg/as-image/svg-image-change-content-size.xhtml: Added.
+        * svg/zoom/page/resources/relative-sized-background-with-viewBox.svg: Added.
+        * svg/zoom/page/zoom-background-image-tiled.html: Added.
+        * svg/zoom/page/zoom-background-images.html: Added.
+        * svg/zoom/page/zoom-img-preserveAspectRatio-support-1.html: Added.
+        * svg/zoom/page/zoom-svg-as-background-with-relative-size-and-viewBox.html: Added.
+        * svg/zoom/page/zoom-svg-as-background-with-relative-size.html: Added.
+        * svg/zoom/page/zoom-svg-as-image.html: Added.
+        * svg/zoom/page/zoom-svg-as-relative-image.html: Added.
+
 2011-10-31  Vsevolod Vlasov  <vsevik@chromium.org>
 
         Unreviewed, skiped failing test inspector/debugger/selected-call-frame-after-formatting-source.html on QT.
diff --git a/LayoutTests/css2.1/20110323/background-intrinsic-001.htm b/LayoutTests/css2.1/20110323/background-intrinsic-001.htm
new file mode 100644 (file)
index 0000000..c24cc28
--- /dev/null
@@ -0,0 +1,65 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+ <head>
+  <link rel="reference" href="background-intrinsic-ref.xht">
+  <title>CSS Test: Background Intrinsic Sizes: No intrinsic size</title>
+  <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact">
+  <link rel="help" href="http://www.w3.org/TR/CSS21/colors.html#background-properties">
+  <link rel="help" href="http://www.w3.org/TR/css3-background/#the-background-size">
+  <meta name="flags" content="svg">
+  <meta name="assert" content="A background image with no intrinsic size covers     the entire padding box.">
+  <style type="text/css">
+    /* Setup. Use 5:6 ratio because it's weird and unlikely to be hard-coded anywhere. */
+    div {
+      position: relative;
+    }
+    .cover, .limit {
+      width: 120px;
+      height: 120px;
+      margin: 0.5em;
+      background: green; /* Used to match reference; remove for debugging. */
+    }
+    .control {
+      position: absolute;
+      top: 10px; bottom: 10px;
+      left: 10px; right: 30px;
+    }
+    .cover .control {
+      background: red;
+    }
+    .limit .control {
+      background: green;
+    }
+    .test {
+      /* 80x100 bgpos area */
+      height: 80px;
+      width: 60px;
+      padding: 10px;
+      /* 100 x 120 bgpaint area */
+      border: 10px solid transparent;
+    }
+
+    /* Test */
+    .cover .test {
+      background: no-repeat url(resources/green-intrinsic-none.svg);
+    }
+    .limit .test {
+      background: no-repeat url(resources/red-intrinsic-none.svg);
+    }
+  </style>
+ </head>
+ <body>
+  <p>There must be two green boxes below and no red.</p>
+
+  <div class="cover">
+    <div class="control"></div>
+    <div class="test"></div>
+  </div>
+
+  <div class="limit">
+    <div class="test"></div>
+    <div class="control"></div>
+  </div>
+
+ </body>
+</html>
diff --git a/LayoutTests/css2.1/20110323/background-intrinsic-002.htm b/LayoutTests/css2.1/20110323/background-intrinsic-002.htm
new file mode 100644 (file)
index 0000000..c49d4b7
--- /dev/null
@@ -0,0 +1,67 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+ <head>
+  <link rel="reference" href="background-intrinsic-ref.xht">
+  <title>CSS Test: Background Intrinsic Sizes: Intrinsic Width</title>
+  <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact">
+  <link rel="help" href="http://www.w3.org/TR/CSS21/colors.html#background-properties">
+  <link rel="help" href="http://www.w3.org/TR/css3-background/#the-background-size">
+  <meta name="flags" content="svg">
+  <meta name="assert" content="A background image with only an intrinsic width     covers its intrinsic width and the height of the padding box.">
+  <style type="text/css">
+    /* Setup. Use 5:6 ratio because it's weird and unlikely to be hard-coded anywhere. */
+    div {
+      position: relative;
+    }
+    .cover, .limit {
+      width: 120px;
+      height: 120px;
+      margin: 0.5em;
+      background: green; /* Used to match reference; remove for debugging. */
+    }
+    .control {
+      position: absolute;
+      top: 10px; bottom: 10px;
+      left: 10px; right: 30px;
+    }
+    .cover .control {
+      background: red;
+    }
+    .limit .control {
+      background: green;
+    }
+    .test {
+      /* 80x100 bgpos area */
+      height: 80px;
+      width: 60px;
+      padding: 10px;
+      border: 10px solid transparent;
+    }
+
+    /* Test */
+    .cover .test {
+      background: no-repeat url(resources/green-intrinsic-width.svg);
+    }
+    .limit .test {
+      background: no-repeat url(resources/red-intrinsic-width.svg);
+    }
+    .control {
+      width: 60px;
+    }
+  </style>
+ </head>
+ <body>
+  <p>There must be two green boxes below and no red.</p>
+
+  <div class="cover">
+    <div class="control"></div>
+    <div class="test"></div>
+  </div>
+
+  <div class="limit">
+    <div class="test"></div>
+    <div class="control"></div>
+  </div>
+
+ </body>
+</html>
diff --git a/LayoutTests/css2.1/20110323/background-intrinsic-003.htm b/LayoutTests/css2.1/20110323/background-intrinsic-003.htm
new file mode 100644 (file)
index 0000000..551c6c9
--- /dev/null
@@ -0,0 +1,67 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+ <head>
+  <link rel="reference" href="background-intrinsic-ref.xht">
+  <title>CSS Test: Background Intrinsic Sizes: Intrinsic Height</title>
+  <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact">
+  <link rel="help" href="http://www.w3.org/TR/CSS21/colors.html#background-properties">
+  <link rel="help" href="http://www.w3.org/TR/css3-background/#the-background-size">
+  <meta name="flags" content="svg">
+  <meta name="assert" content="A background image with only an intrinsic height     covers its intrinsic height and the width of the padding box.">
+  <style type="text/css">
+    /* Setup. Use 5:6 ratio because it's weird and unlikely to be hard-coded anywhere. */
+    div {
+      position: relative;
+    }
+    .cover, .limit {
+      width: 120px;
+      height: 120px;
+      margin: 0.5em;
+      background: green; /* Used to match reference; remove for debugging. */
+    }
+    .control {
+      position: absolute;
+      top: 10px; bottom: 10px;
+      left: 10px; right: 30px;
+    }
+    .cover .control {
+      background: red;
+    }
+    .limit .control {
+      background: green;
+    }
+    .test {
+      /* 80x100 bgpos area */
+      height: 80px;
+      width: 60px;
+      padding: 10px;
+      border: 10px solid transparent;
+    }
+
+    /* Test */
+    .cover .test {
+      background: no-repeat url(resources/green-intrinsic-height.svg);
+    }
+    .limit .test {
+      background: no-repeat url(resources/red-intrinsic-height.svg);
+    }
+    .control {
+      height: 60px;
+    }
+  </style>
+ </head>
+ <body>
+  <p>There must be two green boxes below and no red.</p>
+
+  <div class="cover">
+    <div class="control"></div>
+    <div class="test"></div>
+  </div>
+
+  <div class="limit">
+    <div class="test"></div>
+    <div class="control"></div>
+  </div>
+
+ </body>
+</html>
diff --git a/LayoutTests/css2.1/20110323/background-intrinsic-004.htm b/LayoutTests/css2.1/20110323/background-intrinsic-004.htm
new file mode 100644 (file)
index 0000000..d038bac
--- /dev/null
@@ -0,0 +1,70 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+ <head>
+  <link rel="reference" href="background-intrinsic-ref.xht">
+  <title>CSS Test: Background Intrinsic Sizes: Intrinsic Ratio (Match Heights)</title>
+  <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact">
+  <link rel="help" href="http://www.w3.org/TR/CSS21/colors.html#background-properties">
+  <link rel="help" href="http://www.w3.org/TR/css3-background/#the-background-size">
+  <meta name="flags" content="may svg">
+  <meta name="assert" content="A background image with only an intrinsic ratio     covers largest rectangle at that ratio that exceeds neither the height nor     width of the background positioning area.">
+  <style type="text/css">
+    /* Setup. Use 5:6 ratio because it's weird and unlikely to be hard-coded anywhere. */
+    div {
+      position: relative;
+    }
+    .cover, .limit {
+      width: 120px;
+      height: 120px;
+      margin: 0.5em;
+      background: green; /* Used to match reference; remove for debugging. */
+    }
+    .control {
+      position: absolute;
+      top: 10px; bottom: 10px;
+      left: 10px; right: 30px;
+    }
+    .cover .control {
+      background: red;
+    }
+    .limit .control {
+      background: green;
+    }
+    .test {
+      /* 80x100 bgpos area */
+      height: 80px;
+      width: 60px;
+      padding: 10px;
+      border: 10px solid transparent;
+    }
+
+    /* Test */
+    .cover .test {
+      background: no-repeat url(resources/green-intrinsic-ratio-portrait.svg);
+    }
+    .limit .test {
+      background: no-repeat url(resources/red-intrinsic-ratio-portrait.svg);
+    }
+    .cover .control {
+      width: 66px;
+    }
+    .limit .control {
+      width: 67px;
+    }
+  </style>
+ </head>
+ <body>
+  <p>There must be two green boxes below and no red.</p>
+
+  <div class="cover">
+    <div class="control"></div>
+    <div class="test"></div>
+  </div>
+
+  <div class="limit">
+    <div class="test"></div>
+    <div class="control"></div>
+  </div>
+
+ </body>
+</html>
diff --git a/LayoutTests/css2.1/20110323/background-intrinsic-005.htm b/LayoutTests/css2.1/20110323/background-intrinsic-005.htm
new file mode 100644 (file)
index 0000000..36484f1
--- /dev/null
@@ -0,0 +1,70 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+ <head>
+  <link rel="reference" href="background-intrinsic-ref.xht">
+  <title>CSS Test: Background Intrinsic Sizes: Intrinsic Ratio (Match Widths)</title>
+  <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact">
+  <link rel="help" href="http://www.w3.org/TR/CSS21/colors.html#background-properties">
+  <link rel="help" href="http://www.w3.org/TR/css3-background/#the-background-size">
+  <meta name="flags" content="may svg">
+  <meta name="assert" content="A background image with only an intrinsic ratio     covers largest rectangle at that ratio that exceeds neither the height nor     width of the background positioning area.">
+  <style type="text/css">
+    /* Setup. Use 5:6 ratio because it's weird and unlikely to be hard-coded anywhere. */
+    div {
+      position: relative;
+    }
+    .cover, .limit {
+      width: 120px;
+      height: 120px;
+      margin: 0.5em;
+      background: green; /* Used to match reference; remove for debugging. */
+    }
+    .control {
+      position: absolute;
+      top: 10px; bottom: 10px;
+      left: 10px; right: 30px;
+    }
+    .cover .control {
+      background: red;
+    }
+    .limit .control {
+      background: green;
+    }
+    .test {
+      /* 80x100 bgpos area */
+      height: 80px;
+      width: 60px;
+      padding: 10px;
+      border: 10px solid transparent;
+    }
+
+    /* Test */
+    .cover .test {
+      background: no-repeat url(resources/green-intrinsic-ratio-landscape.svg);
+    }
+    .limit .test {
+      background: no-repeat url(resources/red-intrinsic-ratio-landscape.svg);
+    }
+    .cover .control {
+      height: 53px;
+    }
+    .limit .control {
+      height: 54px;
+    }
+  </style>
+ </head>
+ <body>
+  <p>There must be two green boxes below and no red.</p>
+
+  <div class="cover">
+    <div class="control"></div>
+    <div class="test"></div>
+  </div>
+
+  <div class="limit">
+    <div class="test"></div>
+    <div class="control"></div>
+  </div>
+
+ </body>
+</html>
diff --git a/LayoutTests/css2.1/20110323/background-intrinsic-006.htm b/LayoutTests/css2.1/20110323/background-intrinsic-006.htm
new file mode 100644 (file)
index 0000000..c21e796
--- /dev/null
@@ -0,0 +1,68 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+ <head>
+  <link rel="reference" href="background-intrinsic-ref.xht">
+  <title>CSS Test: Background Intrinsic Sizes: Intrinsic Percentage Width and Height</title>
+  <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact">
+  <link rel="help" href="http://www.w3.org/TR/CSS21/colors.html#background-properties">
+  <link rel="help" href="http://www.w3.org/TR/css3-background/#the-background-size">
+  <meta name="flags" content="svg">
+  <meta name="assert" content="A background image with only an intrinsic ratio     covers largest rectangle at that ratio that exceeds neither the height nor     width of the background positioning area.">
+  <style type="text/css">
+    /* Setup. Use 5:6 ratio because it's weird and unlikely to be hard-coded anywhere. */
+    div {
+      position: relative;
+    }
+    .cover, .limit {
+      width: 120px;
+      height: 120px;
+      margin: 0.5em;
+      background: green; /* Used to match reference; remove for debugging. */
+    }
+    .control {
+      position: absolute;
+      top: 10px; bottom: 10px;
+      left: 10px; right: 30px;
+    }
+    .cover .control {
+      background: red;
+    }
+    .limit .control {
+      background: green;
+    }
+    .test {
+      /* 80x100 bgpos area */
+      height: 80px;
+      width: 60px;
+      padding: 10px;
+      border: 10px solid transparent;
+    }
+
+    /* Test */
+    .cover .test {
+      background: no-repeat url(resources/green-intrinsic-width-pc-height-pc.svg);
+    }
+    .limit .test {
+      background: no-repeat url(resources/red-intrinsic-width-pc-height-pc.svg);
+    }
+    .control {
+      width: 32px;
+      height: 60px;
+    }
+  </style>
+ </head>
+ <body>
+  <p>There must be two green boxes below and no red.</p>
+
+  <div class="cover">
+    <div class="control"></div>
+    <div class="test"></div>
+  </div>
+
+  <div class="limit">
+    <div class="test"></div>
+    <div class="control"></div>
+  </div>
+
+ </body>
+</html>
diff --git a/LayoutTests/css2.1/20110323/background-intrinsic-007.htm b/LayoutTests/css2.1/20110323/background-intrinsic-007.htm
new file mode 100644 (file)
index 0000000..fcd0127
--- /dev/null
@@ -0,0 +1,68 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+ <head>
+  <link rel="reference" href="background-intrinsic-ref.xht">
+  <title>CSS Test: Background Intrinsic Sizes: Intrinsic Width and Ratio</title>
+  <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact">
+  <link rel="help" href="http://www.w3.org/TR/CSS21/colors.html#background-properties">
+  <link rel="help" href="http://www.w3.org/TR/css3-background/#the-background-size">
+  <meta name="flags" content="svg">
+  <meta name="assert" content="A missing background image height is calculated     from the width and the ratio.">
+  <style type="text/css">
+    /* Setup. Use 5:6 ratio because it's weird and unlikely to be hard-coded anywhere. */
+    div {
+      position: relative;
+    }
+    .cover, .limit {
+      width: 120px;
+      height: 120px;
+      margin: 0.5em;
+      background: green; /* Used to match reference; remove for debugging. */
+    }
+    .control {
+      position: absolute;
+      top: 10px; bottom: 10px;
+      left: 10px; right: 30px;
+    }
+    .cover .control {
+      background: red;
+    }
+    .limit .control {
+      background: green;
+    }
+    .test {
+      /* 80x100 bgpos area */
+      height: 80px;
+      width: 60px;
+      padding: 10px;
+      border: 10px solid transparent;
+    }
+
+    /* Test */
+    .cover .test {
+      background: no-repeat url(resources/green-intrinsic-width-ratio.svg);
+    }
+    .limit .test {
+      background: no-repeat url(resources/red-intrinsic-width-ratio.svg);
+    }
+    .control {
+      width: 40px;
+      height: 60px;
+    }
+  </style>
+ </head>
+ <body>
+  <p>There must be two green boxes below and no red.</p>
+
+  <div class="cover">
+    <div class="control"></div>
+    <div class="test"></div>
+  </div>
+
+  <div class="limit">
+    <div class="test"></div>
+    <div class="control"></div>
+  </div>
+
+ </body>
+</html>
diff --git a/LayoutTests/css2.1/20110323/background-intrinsic-008.htm b/LayoutTests/css2.1/20110323/background-intrinsic-008.htm
new file mode 100644 (file)
index 0000000..2ac1d1b
--- /dev/null
@@ -0,0 +1,68 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+ <head>
+  <link rel="reference" href="background-intrinsic-ref.xht">
+  <title>CSS Test: Background Intrinsic Sizes: Intrinsic Height and Ratio</title>
+  <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact">
+  <link rel="help" href="http://www.w3.org/TR/CSS21/colors.html#background-properties">
+  <link rel="help" href="http://www.w3.org/TR/css3-background/#the-background-size">
+  <meta name="flags" content="svg">
+  <meta name="assert" content="A missing background image width is calculated     from the height and the ratio.">
+  <style type="text/css">
+    /* Setup. Use 5:6 ratio because it's weird and unlikely to be hard-coded anywhere. */
+    div {
+      position: relative;
+    }
+    .cover, .limit {
+      width: 120px;
+      height: 120px;
+      margin: 0.5em;
+      background: green; /* Used to match reference; remove for debugging. */
+    }
+    .control {
+      position: absolute;
+      top: 10px; bottom: 10px;
+      left: 10px; right: 30px;
+    }
+    .cover .control {
+      background: red;
+    }
+    .limit .control {
+      background: green;
+    }
+    .test {
+      /* 80x100 bgpos area */
+      height: 80px;
+      width: 60px;
+      padding: 10px;
+      border: 10px solid transparent;
+    }
+
+    /* Test */
+    .cover .test {
+      background: no-repeat url(resources/green-intrinsic-height-ratio.svg);
+    }
+    .limit .test {
+      background: no-repeat url(resources/red-intrinsic-height-ratio.svg);
+    }
+    .control {
+      width: 40px;
+      height: 60px;
+    }
+  </style>
+ </head>
+ <body>
+  <p>There must be two green boxes below and no red.</p>
+
+  <div class="cover">
+    <div class="control"></div>
+    <div class="test"></div>
+  </div>
+
+  <div class="limit">
+    <div class="test"></div>
+    <div class="control"></div>
+  </div>
+
+ </body>
+</html>
diff --git a/LayoutTests/css2.1/20110323/background-intrinsic-009.htm b/LayoutTests/css2.1/20110323/background-intrinsic-009.htm
new file mode 100644 (file)
index 0000000..d62705c
--- /dev/null
@@ -0,0 +1,68 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+ <head>
+  <link rel="reference" href="background-intrinsic-ref.xht">
+  <title>CSS Test: Background Intrinsic Sizes: Intrinsic Width and Height (Vector)</title>
+  <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact">
+  <link rel="help" href="http://www.w3.org/TR/CSS21/colors.html#background-properties">
+  <link rel="help" href="http://www.w3.org/TR/css3-background/#the-background-size">
+  <meta name="flags" content="svg">
+  <meta name="assert" content="A background with an intrinsic width and height     is drawn at that size.">
+  <style type="text/css">
+    /* Setup. Use 5:6 ratio because it's weird and unlikely to be hard-coded anywhere. */
+    div {
+      position: relative;
+    }
+    .cover, .limit {
+      width: 120px;
+      height: 120px;
+      margin: 0.5em;
+      background: green; /* Used to match reference; remove for debugging. */
+    }
+    .control {
+      position: absolute;
+      top: 10px; bottom: 10px;
+      left: 10px; right: 30px;
+    }
+    .cover .control {
+      background: red;
+    }
+    .limit .control {
+      background: green;
+    }
+    .test {
+      /* 80x100 bgpos area */
+      height: 80px;
+      width: 60px;
+      padding: 10px;
+      border: 10px solid transparent;
+    }
+
+    /* Test */
+    .cover .test {
+      background: no-repeat url(resources/green-intrinsic-width-height.svg);
+    }
+    .limit .test {
+      background: no-repeat url(resources/red-intrinsic-width-height.svg);
+    }
+    .control {
+      width: 40px;
+      height: 60px;
+    }
+  </style>
+ </head>
+ <body>
+  <p>There must be two green boxes below and no red.</p>
+
+  <div class="cover">
+    <div class="control"></div>
+    <div class="test"></div>
+  </div>
+
+  <div class="limit">
+    <div class="test"></div>
+    <div class="control"></div>
+  </div>
+
+ </body>
+</html>
diff --git a/LayoutTests/css2.1/20110323/resources/green-intrinsic-height-ratio.svg b/LayoutTests/css2.1/20110323/resources/green-intrinsic-height-ratio.svg
new file mode 100644 (file)
index 0000000..6a0495b
--- /dev/null
@@ -0,0 +1,5 @@
+<!-- only intrinsic ratio and height -->
+<svg xmlns="http://www.w3.org/2000/svg"
+     height="60" viewBox="0 0 4 6">
+  <rect width="100%" height="100%" fill="green"/>
+</svg>
diff --git a/LayoutTests/css2.1/20110323/resources/green-intrinsic-height.svg b/LayoutTests/css2.1/20110323/resources/green-intrinsic-height.svg
new file mode 100644 (file)
index 0000000..04f7787
--- /dev/null
@@ -0,0 +1,5 @@
+<!-- only intrinsic height -->
+<svg xmlns="http://www.w3.org/2000/svg"
+     height="60">
+  <rect width="100%" height="100%" fill="green"/>
+</svg>
diff --git a/LayoutTests/css2.1/20110323/resources/green-intrinsic-none.svg b/LayoutTests/css2.1/20110323/resources/green-intrinsic-none.svg
new file mode 100644 (file)
index 0000000..8f1cf0a
--- /dev/null
@@ -0,0 +1,4 @@
+<!-- no intrinsic size -->
+<svg xmlns="http://www.w3.org/2000/svg">
+  <rect width="100%" height="100%" fill="green"/>
+</svg>
diff --git a/LayoutTests/css2.1/20110323/resources/green-intrinsic-ratio-landscape.svg b/LayoutTests/css2.1/20110323/resources/green-intrinsic-ratio-landscape.svg
new file mode 100644 (file)
index 0000000..4c2e75b
--- /dev/null
@@ -0,0 +1,5 @@
+<!-- only intrinsic ratio (landscape) -->
+<svg xmlns="http://www.w3.org/2000/svg"
+     viewBox="0 0 6 4">
+  <rect width="100%" height="100%" fill="green"/>
+</svg>
diff --git a/LayoutTests/css2.1/20110323/resources/green-intrinsic-ratio-portrait.svg b/LayoutTests/css2.1/20110323/resources/green-intrinsic-ratio-portrait.svg
new file mode 100644 (file)
index 0000000..0ec89f8
--- /dev/null
@@ -0,0 +1,5 @@
+<!-- only intrinsic ratio (portrait) -->
+<svg xmlns="http://www.w3.org/2000/svg"
+     viewBox="0 0 4 6">
+  <rect width="100%" height="100%" fill="green"/>
+</svg>
diff --git a/LayoutTests/css2.1/20110323/resources/green-intrinsic-width-height.svg b/LayoutTests/css2.1/20110323/resources/green-intrinsic-width-height.svg
new file mode 100644 (file)
index 0000000..2c5d164
--- /dev/null
@@ -0,0 +1,5 @@
+<!-- only intrinsic height -->
+<svg xmlns="http://www.w3.org/2000/svg"
+     width="40" height="60">
+  <rect width="100%" height="100%" fill="green"/>
+</svg>
diff --git a/LayoutTests/css2.1/20110323/resources/green-intrinsic-width-pc-height-pc.svg b/LayoutTests/css2.1/20110323/resources/green-intrinsic-width-pc-height-pc.svg
new file mode 100644 (file)
index 0000000..6fc18f3
--- /dev/null
@@ -0,0 +1,5 @@
+<!-- only intrinsic height -->
+<svg xmlns="http://www.w3.org/2000/svg"
+     width="40%" height="60%">
+  <rect width="100%" height="100%" fill="green"/>
+</svg>
diff --git a/LayoutTests/css2.1/20110323/resources/green-intrinsic-width-ratio.svg b/LayoutTests/css2.1/20110323/resources/green-intrinsic-width-ratio.svg
new file mode 100644 (file)
index 0000000..9e44203
--- /dev/null
@@ -0,0 +1,5 @@
+<!-- only intrinsic ratio and height -->
+<svg xmlns="http://www.w3.org/2000/svg"
+     width="40" viewBox="0 0 4 6">
+  <rect width="100%" height="100%" fill="green"/>
+</svg>
diff --git a/LayoutTests/css2.1/20110323/resources/green-intrinsic-width.svg b/LayoutTests/css2.1/20110323/resources/green-intrinsic-width.svg
new file mode 100644 (file)
index 0000000..dd72952
--- /dev/null
@@ -0,0 +1,5 @@
+<!-- only intrinsic width -->
+<svg xmlns="http://www.w3.org/2000/svg"
+     width="60">
+  <rect width="100%" height="100%" fill="green"/>
+</svg>
diff --git a/LayoutTests/css2.1/20110323/resources/red-intrinsic-height-ratio.svg b/LayoutTests/css2.1/20110323/resources/red-intrinsic-height-ratio.svg
new file mode 100644 (file)
index 0000000..55063b9
--- /dev/null
@@ -0,0 +1,5 @@
+<!-- only intrinsic ratio and height -->
+<svg xmlns="http://www.w3.org/2000/svg"
+     height="60" viewBox="0 0 4 6">
+  <rect width="100%" height="100%" fill="red"/>
+</svg>
diff --git a/LayoutTests/css2.1/20110323/resources/red-intrinsic-height.svg b/LayoutTests/css2.1/20110323/resources/red-intrinsic-height.svg
new file mode 100644 (file)
index 0000000..9e446e0
--- /dev/null
@@ -0,0 +1,5 @@
+<!-- only intrinsic height -->
+<svg xmlns="http://www.w3.org/2000/svg"
+     height="60">
+  <rect width="100%" height="100%" fill="red"/>
+</svg>
diff --git a/LayoutTests/css2.1/20110323/resources/red-intrinsic-none.svg b/LayoutTests/css2.1/20110323/resources/red-intrinsic-none.svg
new file mode 100644 (file)
index 0000000..078e34a
--- /dev/null
@@ -0,0 +1,4 @@
+<!-- no intrinsic size -->
+<svg xmlns="http://www.w3.org/2000/svg">
+  <rect width="100%" height="100%" fill="red"/>
+</svg>
diff --git a/LayoutTests/css2.1/20110323/resources/red-intrinsic-ratio-landscape.svg b/LayoutTests/css2.1/20110323/resources/red-intrinsic-ratio-landscape.svg
new file mode 100644 (file)
index 0000000..8fafa8c
--- /dev/null
@@ -0,0 +1,5 @@
+<!-- only intrinsic ratio (landscape) -->
+<svg xmlns="http://www.w3.org/2000/svg"
+     viewBox="0 0 6 4">
+  <rect width="100%" height="100%" fill="red"/>
+</svg>
diff --git a/LayoutTests/css2.1/20110323/resources/red-intrinsic-ratio-portrait.svg b/LayoutTests/css2.1/20110323/resources/red-intrinsic-ratio-portrait.svg
new file mode 100644 (file)
index 0000000..962bc5d
--- /dev/null
@@ -0,0 +1,5 @@
+<!-- only intrinsic ratio (portrait) -->
+<svg xmlns="http://www.w3.org/2000/svg"
+     viewBox="0 0 4 6">
+  <rect width="100%" height="100%" fill="red"/>
+</svg>
diff --git a/LayoutTests/css2.1/20110323/resources/red-intrinsic-width-height.svg b/LayoutTests/css2.1/20110323/resources/red-intrinsic-width-height.svg
new file mode 100644 (file)
index 0000000..b3c8e47
--- /dev/null
@@ -0,0 +1,5 @@
+<!-- only intrinsic height -->
+<svg xmlns="http://www.w3.org/2000/svg"
+     width="40" height="60">
+  <rect width="100%" height="100%" fill="red"/>
+</svg>
diff --git a/LayoutTests/css2.1/20110323/resources/red-intrinsic-width-pc-height-pc.svg b/LayoutTests/css2.1/20110323/resources/red-intrinsic-width-pc-height-pc.svg
new file mode 100644 (file)
index 0000000..361a8af
--- /dev/null
@@ -0,0 +1,5 @@
+<!-- only intrinsic height -->
+<svg xmlns="http://www.w3.org/2000/svg"
+     width="40%" height="60%">
+  <rect width="100%" height="100%" fill="red"/>
+</svg>
diff --git a/LayoutTests/css2.1/20110323/resources/red-intrinsic-width-ratio.svg b/LayoutTests/css2.1/20110323/resources/red-intrinsic-width-ratio.svg
new file mode 100644 (file)
index 0000000..2d0e67e
--- /dev/null
@@ -0,0 +1,5 @@
+<!-- only intrinsic ratio and width -->
+<svg xmlns="http://www.w3.org/2000/svg"
+     width="40" viewBox="0 0 4 6">
+  <rect width="100%" height="100%" fill="red"/>
+</svg>
diff --git a/LayoutTests/css2.1/20110323/resources/red-intrinsic-width.svg b/LayoutTests/css2.1/20110323/resources/red-intrinsic-width.svg
new file mode 100644 (file)
index 0000000..fd49e23
--- /dev/null
@@ -0,0 +1,5 @@
+<!-- only intrinsic width -->
+<svg xmlns="http://www.w3.org/2000/svg"
+  width="60">
+  <rect width="100%" height="100%" fill="red"/>
+</svg>
diff --git a/LayoutTests/fast/backgrounds/size/contain-and-cover-zoomed.html b/LayoutTests/fast/backgrounds/size/contain-and-cover-zoomed.html
new file mode 100644 (file)
index 0000000..961ab5a
--- /dev/null
@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+<style>
+    body {
+        margin: 0;
+        overflow: hidden;
+    }
+
+    div {
+        background-image:
+            url(resources/SquirrelFish.svg),
+            url(../../block/positioning/resources/icon-gold.png),
+            url(resources/flower.jpg),
+            -webkit-gradient(linear, left top, right bottom, from(black), color-stop(50%, transparent), to(black));
+        background-repeat: no-repeat;
+        border: solid;
+        margin: 2px;
+        float: left;
+        background-color: lightblue;
+    }
+
+    div.landscape {
+        width: 390px;
+        height: 140px;
+    }
+
+    div.portrait {
+        width: 190px;
+        height: 290px;
+    }
+
+    div.contain {
+        background-size: contain;
+    }
+
+    div.cover {
+        background-size: cover;
+    }
+
+    div.contain-cover {
+        background-size: contain, cover;
+    }
+
+    div.cover-contain {
+        background-size: cover, contain;
+    }
+
+</style>
+<div class="landscape contain"></div>
+<div class="landscape contain-cover"></div>
+<div class="landscape cover"></div>
+<div class="landscape cover-contain"></div>
+<div class="portrait contain"></div>
+<div class="portrait contain-cover"></div>
+<div class="portrait cover"></div>
+<div class="portrait cover-contain"></div>
+
+<script>
+    if (window.layoutTestController) {
+        for (var i = 0; i < 4; ++i) {
+            eventSender.zoomPageOut();
+        }
+    }
+</script>
index f28430e..d9eb64a 100644 (file)
@@ -1,4 +1,4 @@
 Tests that an image with height 100% inside a floated div keeps its intrinsic height.
 See Bug: http://bugs.webkit.org/show_bug.cgi?id=45439
 
-FAIL: image height was 600 expected 20
+PASS
index f0f7c3a..884041d 100644 (file)
@@ -4,18 +4,23 @@
     See Bug: http://bugs.webkit.org/show_bug.cgi?id=45439</div>\r
 <div style="float: left;">\r
     <!-- src is a 20 x 20 PNG -->\r
-    <img style="height: 100%; width: 100%;" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAMAAAC6V+0/AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAMAUExURQ//W/8AAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPzdRA4AAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjLX7mlDAAAAaUlEQVQoU23QQQ4AIQgDQPD/j5ZSCkYlxsPoSlnzT5mvu8yBjoPcULaAYG60RFxrDHsQVshvY6URsw8WjY2isnuZ3lTfudn5NEVFYmbN0BjWcYWVpU44kbKc2Hbg2KBMMyC85ph/HfipDQwyAn26rjFKAAAAAElFTkSuQmCC"/>\r
+    <img style="height: 100%; width: 100%;" onload="check()" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAMAAAC6V+0/AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAMAUExURQ//W/8AAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPzdRA4AAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjLX7mlDAAAAaUlEQVQoU23QQQ4AIQgDQPD/j5ZSCkYlxsPoSlnzT5mvu8yBjoPcULaAYG60RFxrDHsQVshvY6URsw8WjY2isnuZ3lTfudn5NEVFYmbN0BjWcYWVpU44kbKc2Hbg2KBMMyC85ph/HfipDQwyAn26rjFKAAAAAElFTkSuQmCC"/>\r
 </div>\r
 <pre></pre>\r
 <script>\r
-    if (window.layoutTestController)\r
+    if (window.layoutTestController) {\r
+        layoutTestController.waitUntilDone();\r
         layoutTestController.dumpAsText();\r
+    }\r
 \r
-    var expected = 20;\r
-    var actual = document.querySelector("img").offsetHeight;\r
-    var out = document.querySelector("pre");\r
-    if (actual == expected)\r
-        out.textContent = "PASS";\r
-    else\r
-        out.textContent = "FAIL: image height was " + actual + " expected " + expected;\r
+    function check() {\r
+        var expected = 20;\r
+        var actual = document.querySelector("img").offsetHeight;\r
+        var out = document.querySelector("pre");\r
+        if (actual == expected)\r
+            out.textContent = "PASS";\r
+        else\r
+            out.textContent = "FAIL: image height was " + actual + " expected " + expected;\r
+        layoutTestController.notifyDone();\r
+    }\r
 </script>\r
diff --git a/LayoutTests/platform/mac-snowleopard/svg/zoom/page/relative-sized-document-scrollbars-expected.png b/LayoutTests/platform/mac-snowleopard/svg/zoom/page/relative-sized-document-scrollbars-expected.png
deleted file mode 100644 (file)
index 785d12d..0000000
Binary files a/LayoutTests/platform/mac-snowleopard/svg/zoom/page/relative-sized-document-scrollbars-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/mac-snowleopard/svg/zoom/page/zoom-foreignObject-expected.png b/LayoutTests/platform/mac-snowleopard/svg/zoom/page/zoom-foreignObject-expected.png
deleted file mode 100644 (file)
index a173a92..0000000
Binary files a/LayoutTests/platform/mac-snowleopard/svg/zoom/page/zoom-foreignObject-expected.png and /dev/null differ
index 9d50c15..6e83222 100644 (file)
@@ -172,26 +172,26 @@ layer at (0,0) size 785x4407
         RenderImage {IMG} at (74,122) size 6x20
         RenderText {#text} at (80,122) size 101x22
           text run at (80,122) width 101: " all of which "
-        RenderImage {IMG} at (181,122) size 19x65
-        RenderText {#text} at (200,122) size 5x22
-          text run at (200,122) width 5: " "
+        RenderImage {IMG} at (181,122) size 20x65
+        RenderText {#text} at (201,122) size 5x22
+          text run at (201,122) width 5: " "
         RenderInline {SPAN} at (0,0) size 262x43
-          RenderText {#text} at (205,105) size 262x43
-            text run at (205,105) width 262: "should be aligned"
-        RenderText {#text} at (467,122) size 5x22
-          text run at (467,122) width 5: " "
-        RenderImage {IMG} at (472,122) size 10x35
-        RenderText {#text} at (482,122) size 123x22
-          text run at (482,122) width 123: " with the top of "
-        RenderImage {IMG} at (605,122) size 9x30
-        RenderText {#text} at (614,122) size 5x22
-          text run at (614,122) width 5: " "
-        RenderInline {SPAN} at (0,0) size 731x144
-          RenderText {#text} at (619,114) size 19x32
-            text run at (619,114) width 19: "a "
-          RenderInline {SPAN} at (0,0) size 731x194
-            RenderText {#text} at (638,75) size 731x194
-              text run at (638,75) width 93: "14-"
+          RenderText {#text} at (206,105) size 262x43
+            text run at (206,105) width 262: "should be aligned"
+        RenderText {#text} at (468,122) size 5x22
+          text run at (468,122) width 5: " "
+        RenderImage {IMG} at (473,122) size 11x35
+        RenderText {#text} at (484,122) size 123x22
+          text run at (484,122) width 123: " with the top of "
+        RenderImage {IMG} at (607,122) size 9x30
+        RenderText {#text} at (616,122) size 5x22
+          text run at (616,122) width 5: " "
+        RenderInline {SPAN} at (0,0) size 733x144
+          RenderText {#text} at (621,114) size 19x32
+            text run at (621,114) width 19: "a "
+          RenderInline {SPAN} at (0,0) size 733x194
+            RenderText {#text} at (640,75) size 733x194
+              text run at (640,75) width 93: "14-"
               text run at (0,187) width 143: "point"
           RenderText {#text} at (143,226) size 144x32
             text run at (143,226) width 144: " text element"
@@ -205,15 +205,15 @@ layer at (0,0) size 785x4407
             text run at (312,237) width 189: "regardless of the line in which"
         RenderText {#text} at (501,234) size 5x22
           text run at (501,234) width 5: " "
-        RenderImage {IMG} at (506,234) size 4x15
-        RenderText {#text} at (510,234) size 5x22
-          text run at (510,234) width 5: " "
+        RenderImage {IMG} at (506,234) size 5x15
+        RenderText {#text} at (511,234) size 5x22
+          text run at (511,234) width 5: " "
         RenderInline {BIG} at (0,0) size 156x24
-          RenderText {#text} at (515,232) size 156x24
-            text run at (515,232) width 156: "the images appear."
-        RenderText {#text} at (671,234) size 5x22
-          text run at (671,234) width 5: " "
-        RenderImage {IMG} at (676,234) size 27x90
+          RenderText {#text} at (516,232) size 156x24
+            text run at (516,232) width 156: "the images appear."
+        RenderText {#text} at (672,234) size 5x22
+          text run at (672,234) width 5: " "
+        RenderImage {IMG} at (677,234) size 27x90
         RenderText {#text} at (0,0) size 0x0
       RenderBlock {P} at (0,1784) size 769x36
         RenderText {#text} at (0,0) size 749x36
@@ -245,28 +245,28 @@ layer at (0,0) size 785x4407
         RenderText {#text} at (696,22) size 732x94
           text run at (696,22) width 36: " all of"
           text run at (0,98) width 43: "which "
-        RenderImage {IMG} at (43,77) size 19x65
-        RenderText {#text} at (62,98) size 119x18
-          text run at (62,98) width 119: " should be aligned "
-        RenderImage {IMG} at (181,92) size 10x35
-        RenderText {#text} at (191,98) size 4x18
-          text run at (191,98) width 4: " "
+        RenderImage {IMG} at (43,77) size 20x65
+        RenderText {#text} at (63,98) size 119x18
+          text run at (63,98) width 119: " should be aligned "
+        RenderImage {IMG} at (182,92) size 11x35
+        RenderText {#text} at (193,98) size 4x18
+          text run at (193,98) width 4: " "
         RenderInline {SPAN} at (0,0) size 236x37
-          RenderText {#text} at (195,83) size 236x37
-            text run at (195,83) width 236: "with the middle of"
-        RenderText {#text} at (431,98) size 4x18
-          text run at (431,98) width 4: " "
-        RenderImage {IMG} at (435,84) size 15x50
-        RenderText {#text} at (450,98) size 4x18
-          text run at (450,98) width 4: " "
-        RenderInline {SPAN} at (0,0) size 718x106
-          RenderText {#text} at (454,90) size 17x28
-            text run at (454,90) width 17: "a "
+          RenderText {#text} at (197,83) size 236x37
+            text run at (197,83) width 236: "with the middle of"
+        RenderText {#text} at (433,98) size 4x18
+          text run at (433,98) width 4: " "
+        RenderImage {IMG} at (437,84) size 15x50
+        RenderText {#text} at (452,98) size 4x18
+          text run at (452,98) width 4: " "
+        RenderInline {SPAN} at (0,0) size 720x106
+          RenderText {#text} at (456,90) size 17x28
+            text run at (456,90) width 17: "a "
           RenderInline {SPAN} at (0,0) size 204x69
-            RenderText {#text} at (471,58) size 204x69
-              text run at (471,58) width 204: "14-point"
-          RenderText {#text} at (675,90) size 718x106
-            text run at (675,90) width 43: " text"
+            RenderText {#text} at (473,58) size 204x69
+              text run at (473,58) width 204: "14-point"
+          RenderText {#text} at (677,90) size 720x106
+            text run at (677,90) width 43: " text"
             text run at (0,168) width 78: "element"
         RenderText {#text} at (78,176) size 4x18
           text run at (78,176) width 4: " "
@@ -278,15 +278,15 @@ layer at (0,0) size 785x4407
             text run at (101,176) width 189: "regardless of the line in which"
         RenderText {#text} at (290,176) size 4x18
           text run at (290,176) width 4: " "
-        RenderImage {IMG} at (294,180) size 4x15
-        RenderText {#text} at (298,176) size 4x18
-          text run at (298,176) width 4: " "
+        RenderImage {IMG} at (294,180) size 5x15
+        RenderText {#text} at (299,176) size 4x18
+          text run at (299,176) width 4: " "
         RenderInline {BIG} at (0,0) size 156x24
-          RenderText {#text} at (302,171) size 156x24
-            text run at (302,171) width 156: "the images appear."
-        RenderText {#text} at (458,176) size 4x18
-          text run at (458,176) width 4: " "
-        RenderImage {IMG} at (462,142) size 27x90
+          RenderText {#text} at (303,171) size 156x24
+            text run at (303,171) width 156: "the images appear."
+        RenderText {#text} at (459,176) size 4x18
+          text run at (459,176) width 4: " "
+        RenderImage {IMG} at (463,142) size 27x90
         RenderText {#text} at (0,0) size 0x0
       RenderBlock {P} at (0,2084) size 769x36
         RenderText {#text} at (0,0) size 733x36
@@ -340,36 +340,36 @@ layer at (0,0) size 785x4407
             text run at (71,46) width 75: "all of which"
         RenderText {#text} at (146,46) size 4x18
           text run at (146,46) width 4: " "
-        RenderImage {IMG} at (150,46) size 19x65
-        RenderText {#text} at (169,46) size 4x18
-          text run at (169,46) width 4: " "
+        RenderImage {IMG} at (150,46) size 20x65
+        RenderText {#text} at (170,46) size 4x18
+          text run at (170,46) width 4: " "
         RenderInline {SPAN} at (0,0) size 111x18
-          RenderText {#text} at (173,46) size 111x18
-            text run at (173,46) width 111: "should be aligned"
-        RenderText {#text} at (284,46) size 4x18
-          text run at (284,46) width 4: " "
-        RenderImage {IMG} at (288,46) size 10x35
-        RenderText {#text} at (298,46) size 4x18
-          text run at (298,46) width 4: " "
+          RenderText {#text} at (174,46) size 111x18
+            text run at (174,46) width 111: "should be aligned"
+        RenderText {#text} at (285,46) size 4x18
+          text run at (285,46) width 4: " "
+        RenderImage {IMG} at (289,46) size 11x35
+        RenderText {#text} at (300,46) size 4x18
+          text run at (300,46) width 4: " "
         RenderInline {SPAN} at (0,0) size 188x37
-          RenderText {#text} at (302,46) size 188x37
-            text run at (302,46) width 188: "with the top of"
-        RenderText {#text} at (490,46) size 4x18
-          text run at (490,46) width 4: " "
-        RenderImage {IMG} at (494,46) size 15x50
-        RenderText {#text} at (509,46) size 4x18
-          text run at (509,46) width 4: " "
+          RenderText {#text} at (304,46) size 188x37
+            text run at (304,46) width 188: "with the top of"
+        RenderText {#text} at (492,46) size 4x18
+          text run at (492,46) width 4: " "
+        RenderImage {IMG} at (496,46) size 15x50
+        RenderText {#text} at (511,46) size 4x18
+          text run at (511,46) width 4: " "
         RenderInline {SPAN} at (0,0) size 128x18
-          RenderText {#text} at (513,46) size 128x18
-            text run at (513,46) width 128: "the tallest element in"
-        RenderText {#text} at (641,46) size 4x18
-          text run at (641,46) width 4: " "
-        RenderImage {IMG} at (645,46) size 4x15
-        RenderText {#text} at (649,46) size 4x18
-          text run at (649,46) width 4: " "
-        RenderInline {BIG} at (0,0) size 741x89
-          RenderText {#text} at (653,46) size 741x89
-            text run at (653,46) width 88: "whichever"
+          RenderText {#text} at (515,46) size 128x18
+            text run at (515,46) width 128: "the tallest element in"
+        RenderText {#text} at (643,46) size 4x18
+          text run at (643,46) width 4: " "
+        RenderImage {IMG} at (647,46) size 5x15
+        RenderText {#text} at (652,46) size 4x18
+          text run at (652,46) width 4: " "
+        RenderInline {BIG} at (0,0) size 744x89
+          RenderText {#text} at (656,46) size 744x89
+            text run at (656,46) width 88: "whichever"
             text run at (0,111) width 208: "line the elements appear."
         RenderText {#text} at (208,111) size 4x18
           text run at (208,111) width 4: " "
@@ -516,26 +516,26 @@ layer at (0,0) size 785x4407
                 RenderImage {IMG} at (74,122) size 6x20
                 RenderText {#text} at (80,122) size 101x22
                   text run at (80,122) width 101: " all of which "
-                RenderImage {IMG} at (181,122) size 19x65
-                RenderText {#text} at (200,122) size 5x22
-                  text run at (200,122) width 5: " "
+                RenderImage {IMG} at (181,122) size 20x65
+                RenderText {#text} at (201,122) size 5x22
+                  text run at (201,122) width 5: " "
                 RenderInline {SPAN} at (0,0) size 262x43
-                  RenderText {#text} at (205,105) size 262x43
-                    text run at (205,105) width 262: "should be aligned"
-                RenderText {#text} at (467,122) size 5x22
-                  text run at (467,122) width 5: " "
-                RenderImage {IMG} at (472,122) size 10x35
-                RenderText {#text} at (482,122) size 123x22
-                  text run at (482,122) width 123: " with the top of "
-                RenderImage {IMG} at (605,122) size 9x30
-                RenderText {#text} at (614,122) size 5x22
-                  text run at (614,122) width 5: " "
-                RenderInline {SPAN} at (0,0) size 731x144
-                  RenderText {#text} at (619,114) size 19x32
-                    text run at (619,114) width 19: "a "
-                  RenderInline {SPAN} at (0,0) size 731x194
-                    RenderText {#text} at (638,75) size 731x194
-                      text run at (638,75) width 93: "14-"
+                  RenderText {#text} at (206,105) size 262x43
+                    text run at (206,105) width 262: "should be aligned"
+                RenderText {#text} at (468,122) size 5x22
+                  text run at (468,122) width 5: " "
+                RenderImage {IMG} at (473,122) size 11x35
+                RenderText {#text} at (484,122) size 123x22
+                  text run at (484,122) width 123: " with the top of "
+                RenderImage {IMG} at (607,122) size 9x30
+                RenderText {#text} at (616,122) size 5x22
+                  text run at (616,122) width 5: " "
+                RenderInline {SPAN} at (0,0) size 733x144
+                  RenderText {#text} at (621,114) size 19x32
+                    text run at (621,114) width 19: "a "
+                  RenderInline {SPAN} at (0,0) size 733x194
+                    RenderText {#text} at (640,75) size 733x194
+                      text run at (640,75) width 93: "14-"
                       text run at (0,187) width 143: "point"
                   RenderText {#text} at (143,226) size 144x32
                     text run at (143,226) width 144: " text element"
@@ -549,15 +549,15 @@ layer at (0,0) size 785x4407
                     text run at (312,237) width 189: "regardless of the line in which"
                 RenderText {#text} at (501,234) size 5x22
                   text run at (501,234) width 5: " "
-                RenderImage {IMG} at (506,234) size 4x15
-                RenderText {#text} at (510,234) size 5x22
-                  text run at (510,234) width 5: " "
+                RenderImage {IMG} at (506,234) size 5x15
+                RenderText {#text} at (511,234) size 5x22
+                  text run at (511,234) width 5: " "
                 RenderInline {BIG} at (0,0) size 156x24
-                  RenderText {#text} at (515,232) size 156x24
-                    text run at (515,232) width 156: "the images appear."
-                RenderText {#text} at (671,234) size 5x22
-                  text run at (671,234) width 5: " "
-                RenderImage {IMG} at (676,234) size 27x90
+                  RenderText {#text} at (516,232) size 156x24
+                    text run at (516,232) width 156: "the images appear."
+                RenderText {#text} at (672,234) size 5x22
+                  text run at (672,234) width 5: " "
+                RenderImage {IMG} at (677,234) size 27x90
                 RenderText {#text} at (0,0) size 0x0
               RenderBlock {P} at (4,1453) size 747x36
                 RenderText {#text} at (0,0) size 730x36
@@ -589,28 +589,28 @@ layer at (0,0) size 785x4407
                 RenderText {#text} at (696,22) size 732x94
                   text run at (696,22) width 36: " all of"
                   text run at (0,98) width 43: "which "
-                RenderImage {IMG} at (43,77) size 19x65
-                RenderText {#text} at (62,98) size 119x18
-                  text run at (62,98) width 119: " should be aligned "
-                RenderImage {IMG} at (181,92) size 10x35
-                RenderText {#text} at (191,98) size 4x18
-                  text run at (191,98) width 4: " "
+                RenderImage {IMG} at (43,77) size 20x65
+                RenderText {#text} at (63,98) size 119x18
+                  text run at (63,98) width 119: " should be aligned "
+                RenderImage {IMG} at (182,92) size 11x35
+                RenderText {#text} at (193,98) size 4x18
+                  text run at (193,98) width 4: " "
                 RenderInline {SPAN} at (0,0) size 236x37
-                  RenderText {#text} at (195,83) size 236x37
-                    text run at (195,83) width 236: "with the middle of"
-                RenderText {#text} at (431,98) size 4x18
-                  text run at (431,98) width 4: " "
-                RenderImage {IMG} at (435,84) size 15x50
-                RenderText {#text} at (450,98) size 4x18
-                  text run at (450,98) width 4: " "
-                RenderInline {SPAN} at (0,0) size 718x106
-                  RenderText {#text} at (454,90) size 17x28
-                    text run at (454,90) width 17: "a "
+                  RenderText {#text} at (197,83) size 236x37
+                    text run at (197,83) width 236: "with the middle of"
+                RenderText {#text} at (433,98) size 4x18
+                  text run at (433,98) width 4: " "
+                RenderImage {IMG} at (437,84) size 15x50
+                RenderText {#text} at (452,98) size 4x18
+                  text run at (452,98) width 4: " "
+                RenderInline {SPAN} at (0,0) size 720x106
+                  RenderText {#text} at (456,90) size 17x28
+                    text run at (456,90) width 17: "a "
                   RenderInline {SPAN} at (0,0) size 204x69
-                    RenderText {#text} at (471,58) size 204x69
-                      text run at (471,58) width 204: "14-point"
-                  RenderText {#text} at (675,90) size 718x106
-                    text run at (675,90) width 43: " text"
+                    RenderText {#text} at (473,58) size 204x69
+                      text run at (473,58) width 204: "14-point"
+                  RenderText {#text} at (677,90) size 720x106
+                    text run at (677,90) width 43: " text"
                     text run at (0,168) width 78: "element"
                 RenderText {#text} at (78,176) size 4x18
                   text run at (78,176) width 4: " "
@@ -622,15 +622,15 @@ layer at (0,0) size 785x4407
                     text run at (101,176) width 189: "regardless of the line in which"
                 RenderText {#text} at (290,176) size 4x18
                   text run at (290,176) width 4: " "
-                RenderImage {IMG} at (294,180) size 4x15
-                RenderText {#text} at (298,176) size 4x18
-                  text run at (298,176) width 4: " "
+                RenderImage {IMG} at (294,180) size 5x15
+                RenderText {#text} at (299,176) size 4x18
+                  text run at (299,176) width 4: " "
                 RenderInline {BIG} at (0,0) size 156x24
-                  RenderText {#text} at (302,171) size 156x24
-                    text run at (302,171) width 156: "the images appear."
-                RenderText {#text} at (458,176) size 4x18
-                  text run at (458,176) width 4: " "
-                RenderImage {IMG} at (462,142) size 27x90
+                  RenderText {#text} at (303,171) size 156x24
+                    text run at (303,171) width 156: "the images appear."
+                RenderText {#text} at (459,176) size 4x18
+                  text run at (459,176) width 4: " "
+                RenderImage {IMG} at (463,142) size 27x90
                 RenderText {#text} at (0,0) size 0x0
               RenderBlock {P} at (4,1753) size 747x36
                 RenderText {#text} at (0,0) size 733x36
@@ -684,36 +684,36 @@ layer at (0,0) size 785x4407
                     text run at (71,46) width 75: "all of which"
                 RenderText {#text} at (146,46) size 4x18
                   text run at (146,46) width 4: " "
-                RenderImage {IMG} at (150,46) size 19x65
-                RenderText {#text} at (169,46) size 4x18
-                  text run at (169,46) width 4: " "
+                RenderImage {IMG} at (150,46) size 20x65
+                RenderText {#text} at (170,46) size 4x18
+                  text run at (170,46) width 4: " "
                 RenderInline {SPAN} at (0,0) size 111x18
-                  RenderText {#text} at (173,46) size 111x18
-                    text run at (173,46) width 111: "should be aligned"
-                RenderText {#text} at (284,46) size 4x18
-                  text run at (284,46) width 4: " "
-                RenderImage {IMG} at (288,46) size 10x35
-                RenderText {#text} at (298,46) size 4x18
-                  text run at (298,46) width 4: " "
+                  RenderText {#text} at (174,46) size 111x18
+                    text run at (174,46) width 111: "should be aligned"
+                RenderText {#text} at (285,46) size 4x18
+                  text run at (285,46) width 4: " "
+                RenderImage {IMG} at (289,46) size 11x35
+                RenderText {#text} at (300,46) size 4x18
+                  text run at (300,46) width 4: " "
                 RenderInline {SPAN} at (0,0) size 188x37
-                  RenderText {#text} at (302,46) size 188x37
-                    text run at (302,46) width 188: "with the top of"
-                RenderText {#text} at (490,46) size 4x18
-                  text run at (490,46) width 4: " "
-                RenderImage {IMG} at (494,46) size 15x50
-                RenderText {#text} at (509,46) size 4x18
-                  text run at (509,46) width 4: " "
+                  RenderText {#text} at (304,46) size 188x37
+                    text run at (304,46) width 188: "with the top of"
+                RenderText {#text} at (492,46) size 4x18
+                  text run at (492,46) width 4: " "
+                RenderImage {IMG} at (496,46) size 15x50
+                RenderText {#text} at (511,46) size 4x18
+                  text run at (511,46) width 4: " "
                 RenderInline {SPAN} at (0,0) size 128x18
-                  RenderText {#text} at (513,46) size 128x18
-                    text run at (513,46) width 128: "the tallest element in"
-                RenderText {#text} at (641,46) size 4x18
-                  text run at (641,46) width 4: " "
-                RenderImage {IMG} at (645,46) size 4x15
-                RenderText {#text} at (649,46) size 4x18
-                  text run at (649,46) width 4: " "
-                RenderInline {BIG} at (0,0) size 741x89
-                  RenderText {#text} at (653,46) size 741x89
-                    text run at (653,46) width 88: "whichever"
+                  RenderText {#text} at (515,46) size 128x18
+                    text run at (515,46) width 128: "the tallest element in"
+                RenderText {#text} at (643,46) size 4x18
+                  text run at (643,46) width 4: " "
+                RenderImage {IMG} at (647,46) size 5x15
+                RenderText {#text} at (652,46) size 4x18
+                  text run at (652,46) width 4: " "
+                RenderInline {BIG} at (0,0) size 744x89
+                  RenderText {#text} at (656,46) size 744x89
+                    text run at (656,46) width 88: "whichever"
                     text run at (0,111) width 208: "line the elements appear."
                 RenderText {#text} at (208,111) size 4x18
                   text run at (208,111) width 4: " "
index 6a9ed30..4ee6afd 100644 (file)
Binary files a/LayoutTests/platform/mac/css2.1/20110323/abspos-non-replaced-width-margin-000-expected.png and b/LayoutTests/platform/mac/css2.1/20110323/abspos-non-replaced-width-margin-000-expected.png differ
diff --git a/LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-001-expected.png b/LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-001-expected.png
new file mode 100644 (file)
index 0000000..9eb53c1
Binary files /dev/null and b/LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-001-expected.png differ
diff --git a/LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-001-expected.txt b/LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-001-expected.txt
new file mode 100644 (file)
index 0000000..5eef9ad
--- /dev/null
@@ -0,0 +1,20 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x306
+  RenderBlock {HTML} at (0,0) size 800x306
+    RenderBody {BODY} at (8,16) size 784x282
+      RenderBlock {P} at (0,0) size 784x18
+        RenderText {#text} at (0,0) size 316x18
+          text run at (0,0) width 316: "There must be two green boxes below and no red."
+layer at (16,50) size 120x120
+  RenderBlock (relative positioned) {DIV} at (8,34) size 120x120 [bgcolor=#008000]
+layer at (26,60) size 80x100
+  RenderBlock (positioned) {DIV} at (10,10) size 80x100 [bgcolor=#FF0000]
+layer at (16,50) size 100x120
+  RenderBlock (relative positioned) {DIV} at (0,0) size 100x120 [border: (10px solid #00000000)]
+layer at (16,178) size 120x120
+  RenderBlock (relative positioned) {DIV} at (8,162) size 120x120 [bgcolor=#008000]
+layer at (16,178) size 100x120
+  RenderBlock (relative positioned) {DIV} at (0,0) size 100x120 [border: (10px solid #00000000)]
+layer at (26,188) size 80x100
+  RenderBlock (positioned) {DIV} at (10,10) size 80x100
diff --git a/LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-002-expected.png b/LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-002-expected.png
new file mode 100644 (file)
index 0000000..9eb53c1
Binary files /dev/null and b/LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-002-expected.png differ
diff --git a/LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-002-expected.txt b/LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-002-expected.txt
new file mode 100644 (file)
index 0000000..fd98144
--- /dev/null
@@ -0,0 +1,20 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x306
+  RenderBlock {HTML} at (0,0) size 800x306
+    RenderBody {BODY} at (8,16) size 784x282
+      RenderBlock {P} at (0,0) size 784x18
+        RenderText {#text} at (0,0) size 316x18
+          text run at (0,0) width 316: "There must be two green boxes below and no red."
+layer at (16,50) size 120x120
+  RenderBlock (relative positioned) {DIV} at (8,34) size 120x120 [bgcolor=#008000]
+layer at (26,60) size 60x100
+  RenderBlock (positioned) {DIV} at (10,10) size 60x100 [bgcolor=#FF0000]
+layer at (16,50) size 100x120
+  RenderBlock (relative positioned) {DIV} at (0,0) size 100x120 [border: (10px solid #00000000)]
+layer at (16,178) size 120x120
+  RenderBlock (relative positioned) {DIV} at (8,162) size 120x120 [bgcolor=#008000]
+layer at (16,178) size 100x120
+  RenderBlock (relative positioned) {DIV} at (0,0) size 100x120 [border: (10px solid #00000000)]
+layer at (26,188) size 60x100
+  RenderBlock (positioned) {DIV} at (10,10) size 60x100
diff --git a/LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-003-expected.png b/LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-003-expected.png
new file mode 100644 (file)
index 0000000..9eb53c1
Binary files /dev/null and b/LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-003-expected.png differ
diff --git a/LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-003-expected.txt b/LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-003-expected.txt
new file mode 100644 (file)
index 0000000..193ccac
--- /dev/null
@@ -0,0 +1,20 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x306
+  RenderBlock {HTML} at (0,0) size 800x306
+    RenderBody {BODY} at (8,16) size 784x282
+      RenderBlock {P} at (0,0) size 784x18
+        RenderText {#text} at (0,0) size 316x18
+          text run at (0,0) width 316: "There must be two green boxes below and no red."
+layer at (16,50) size 120x120
+  RenderBlock (relative positioned) {DIV} at (8,34) size 120x120 [bgcolor=#008000]
+layer at (26,60) size 80x60
+  RenderBlock (positioned) {DIV} at (10,10) size 80x60 [bgcolor=#FF0000]
+layer at (16,50) size 100x120
+  RenderBlock (relative positioned) {DIV} at (0,0) size 100x120 [border: (10px solid #00000000)]
+layer at (16,178) size 120x120
+  RenderBlock (relative positioned) {DIV} at (8,162) size 120x120 [bgcolor=#008000]
+layer at (16,178) size 100x120
+  RenderBlock (relative positioned) {DIV} at (0,0) size 100x120 [border: (10px solid #00000000)]
+layer at (26,188) size 80x60
+  RenderBlock (positioned) {DIV} at (10,10) size 80x60
diff --git a/LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-004-expected.png b/LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-004-expected.png
new file mode 100644 (file)
index 0000000..4140a72
Binary files /dev/null and b/LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-004-expected.png differ
diff --git a/LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-004-expected.txt b/LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-004-expected.txt
new file mode 100644 (file)
index 0000000..128e29b
--- /dev/null
@@ -0,0 +1,20 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x306
+  RenderBlock {HTML} at (0,0) size 800x306
+    RenderBody {BODY} at (8,16) size 784x282
+      RenderBlock {P} at (0,0) size 784x18
+        RenderText {#text} at (0,0) size 316x18
+          text run at (0,0) width 316: "There must be two green boxes below and no red."
+layer at (16,50) size 120x120
+  RenderBlock (relative positioned) {DIV} at (8,34) size 120x120 [bgcolor=#008000]
+layer at (26,60) size 66x100
+  RenderBlock (positioned) {DIV} at (10,10) size 66x100 [bgcolor=#FF0000]
+layer at (16,50) size 100x120
+  RenderBlock (relative positioned) {DIV} at (0,0) size 100x120 [border: (10px solid #00000000)]
+layer at (16,178) size 120x120
+  RenderBlock (relative positioned) {DIV} at (8,162) size 120x120 [bgcolor=#008000]
+layer at (16,178) size 100x120
+  RenderBlock (relative positioned) {DIV} at (0,0) size 100x120 [border: (10px solid #00000000)]
+layer at (26,188) size 67x100
+  RenderBlock (positioned) {DIV} at (10,10) size 67x100
diff --git a/LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-005-expected.png b/LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-005-expected.png
new file mode 100644 (file)
index 0000000..2a8bedc
Binary files /dev/null and b/LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-005-expected.png differ
diff --git a/LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-005-expected.txt b/LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-005-expected.txt
new file mode 100644 (file)
index 0000000..f27a023
--- /dev/null
@@ -0,0 +1,20 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x306
+  RenderBlock {HTML} at (0,0) size 800x306
+    RenderBody {BODY} at (8,16) size 784x282
+      RenderBlock {P} at (0,0) size 784x18
+        RenderText {#text} at (0,0) size 316x18
+          text run at (0,0) width 316: "There must be two green boxes below and no red."
+layer at (16,50) size 120x120
+  RenderBlock (relative positioned) {DIV} at (8,34) size 120x120 [bgcolor=#008000]
+layer at (26,60) size 80x53
+  RenderBlock (positioned) {DIV} at (10,10) size 80x53 [bgcolor=#FF0000]
+layer at (16,50) size 100x120
+  RenderBlock (relative positioned) {DIV} at (0,0) size 100x120 [border: (10px solid #00000000)]
+layer at (16,178) size 120x120
+  RenderBlock (relative positioned) {DIV} at (8,162) size 120x120 [bgcolor=#008000]
+layer at (16,178) size 100x120
+  RenderBlock (relative positioned) {DIV} at (0,0) size 100x120 [border: (10px solid #00000000)]
+layer at (26,188) size 80x54
+  RenderBlock (positioned) {DIV} at (10,10) size 80x54
diff --git a/LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-006-expected.png b/LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-006-expected.png
new file mode 100644 (file)
index 0000000..9eb53c1
Binary files /dev/null and b/LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-006-expected.png differ
diff --git a/LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-006-expected.txt b/LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-006-expected.txt
new file mode 100644 (file)
index 0000000..b86448a
--- /dev/null
@@ -0,0 +1,20 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x306
+  RenderBlock {HTML} at (0,0) size 800x306
+    RenderBody {BODY} at (8,16) size 784x282
+      RenderBlock {P} at (0,0) size 784x18
+        RenderText {#text} at (0,0) size 316x18
+          text run at (0,0) width 316: "There must be two green boxes below and no red."
+layer at (16,50) size 120x120
+  RenderBlock (relative positioned) {DIV} at (8,34) size 120x120 [bgcolor=#008000]
+layer at (26,60) size 32x60
+  RenderBlock (positioned) {DIV} at (10,10) size 32x60 [bgcolor=#FF0000]
+layer at (16,50) size 100x120
+  RenderBlock (relative positioned) {DIV} at (0,0) size 100x120 [border: (10px solid #00000000)]
+layer at (16,178) size 120x120
+  RenderBlock (relative positioned) {DIV} at (8,162) size 120x120 [bgcolor=#008000]
+layer at (16,178) size 100x120
+  RenderBlock (relative positioned) {DIV} at (0,0) size 100x120 [border: (10px solid #00000000)]
+layer at (26,188) size 32x60
+  RenderBlock (positioned) {DIV} at (10,10) size 32x60
diff --git a/LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-007-expected.png b/LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-007-expected.png
new file mode 100644 (file)
index 0000000..9eb53c1
Binary files /dev/null and b/LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-007-expected.png differ
diff --git a/LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-007-expected.txt b/LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-007-expected.txt
new file mode 100644 (file)
index 0000000..8130712
--- /dev/null
@@ -0,0 +1,20 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x306
+  RenderBlock {HTML} at (0,0) size 800x306
+    RenderBody {BODY} at (8,16) size 784x282
+      RenderBlock {P} at (0,0) size 784x18
+        RenderText {#text} at (0,0) size 316x18
+          text run at (0,0) width 316: "There must be two green boxes below and no red."
+layer at (16,50) size 120x120
+  RenderBlock (relative positioned) {DIV} at (8,34) size 120x120 [bgcolor=#008000]
+layer at (26,60) size 40x60
+  RenderBlock (positioned) {DIV} at (10,10) size 40x60 [bgcolor=#FF0000]
+layer at (16,50) size 100x120
+  RenderBlock (relative positioned) {DIV} at (0,0) size 100x120 [border: (10px solid #00000000)]
+layer at (16,178) size 120x120
+  RenderBlock (relative positioned) {DIV} at (8,162) size 120x120 [bgcolor=#008000]
+layer at (16,178) size 100x120
+  RenderBlock (relative positioned) {DIV} at (0,0) size 100x120 [border: (10px solid #00000000)]
+layer at (26,188) size 40x60
+  RenderBlock (positioned) {DIV} at (10,10) size 40x60
diff --git a/LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-008-expected.png b/LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-008-expected.png
new file mode 100644 (file)
index 0000000..9eb53c1
Binary files /dev/null and b/LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-008-expected.png differ
diff --git a/LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-008-expected.txt b/LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-008-expected.txt
new file mode 100644 (file)
index 0000000..8130712
--- /dev/null
@@ -0,0 +1,20 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x306
+  RenderBlock {HTML} at (0,0) size 800x306
+    RenderBody {BODY} at (8,16) size 784x282
+      RenderBlock {P} at (0,0) size 784x18
+        RenderText {#text} at (0,0) size 316x18
+          text run at (0,0) width 316: "There must be two green boxes below and no red."
+layer at (16,50) size 120x120
+  RenderBlock (relative positioned) {DIV} at (8,34) size 120x120 [bgcolor=#008000]
+layer at (26,60) size 40x60
+  RenderBlock (positioned) {DIV} at (10,10) size 40x60 [bgcolor=#FF0000]
+layer at (16,50) size 100x120
+  RenderBlock (relative positioned) {DIV} at (0,0) size 100x120 [border: (10px solid #00000000)]
+layer at (16,178) size 120x120
+  RenderBlock (relative positioned) {DIV} at (8,162) size 120x120 [bgcolor=#008000]
+layer at (16,178) size 100x120
+  RenderBlock (relative positioned) {DIV} at (0,0) size 100x120 [border: (10px solid #00000000)]
+layer at (26,188) size 40x60
+  RenderBlock (positioned) {DIV} at (10,10) size 40x60
diff --git a/LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-009-expected.png b/LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-009-expected.png
new file mode 100644 (file)
index 0000000..9eb53c1
Binary files /dev/null and b/LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-009-expected.png differ
diff --git a/LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-009-expected.txt b/LayoutTests/platform/mac/css2.1/20110323/background-intrinsic-009-expected.txt
new file mode 100644 (file)
index 0000000..8130712
--- /dev/null
@@ -0,0 +1,20 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x306
+  RenderBlock {HTML} at (0,0) size 800x306
+    RenderBody {BODY} at (8,16) size 784x282
+      RenderBlock {P} at (0,0) size 784x18
+        RenderText {#text} at (0,0) size 316x18
+          text run at (0,0) width 316: "There must be two green boxes below and no red."
+layer at (16,50) size 120x120
+  RenderBlock (relative positioned) {DIV} at (8,34) size 120x120 [bgcolor=#008000]
+layer at (26,60) size 40x60
+  RenderBlock (positioned) {DIV} at (10,10) size 40x60 [bgcolor=#FF0000]
+layer at (16,50) size 100x120
+  RenderBlock (relative positioned) {DIV} at (0,0) size 100x120 [border: (10px solid #00000000)]
+layer at (16,178) size 120x120
+  RenderBlock (relative positioned) {DIV} at (8,162) size 120x120 [bgcolor=#008000]
+layer at (16,178) size 100x120
+  RenderBlock (relative positioned) {DIV} at (0,0) size 100x120 [border: (10px solid #00000000)]
+layer at (26,188) size 40x60
+  RenderBlock (positioned) {DIV} at (10,10) size 40x60
index 48d05b9..b0c5623 100644 (file)
Binary files a/LayoutTests/platform/mac/css2.1/20110323/block-non-replaced-width-008-expected.png and b/LayoutTests/platform/mac/css2.1/20110323/block-non-replaced-width-008-expected.png differ
index 3184b7c..3061bc3 100644 (file)
Binary files a/LayoutTests/platform/mac/fast/backgrounds/background-leakage-transforms-expected.png and b/LayoutTests/platform/mac/fast/backgrounds/background-leakage-transforms-expected.png differ
index 1460203..ea3f98a 100644 (file)
Binary files a/LayoutTests/platform/mac/fast/backgrounds/size/contain-and-cover-expected.png and b/LayoutTests/platform/mac/fast/backgrounds/size/contain-and-cover-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/backgrounds/size/contain-and-cover-zoomed-expected.png b/LayoutTests/platform/mac/fast/backgrounds/size/contain-and-cover-zoomed-expected.png
new file mode 100644 (file)
index 0000000..052ec47
Binary files /dev/null and b/LayoutTests/platform/mac/fast/backgrounds/size/contain-and-cover-zoomed-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/backgrounds/size/contain-and-cover-zoomed-expected.txt b/LayoutTests/platform/mac/fast/backgrounds/size/contain-and-cover-zoomed-expected.txt
new file mode 100644 (file)
index 0000000..8fba2ce
--- /dev/null
@@ -0,0 +1,13 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x264
+  RenderBlock {HTML} at (0,0) size 800x264
+    RenderBody {BODY} at (0,0) size 800x0
+      RenderBlock (floating) {DIV} at (1,1) size 231x87 [bgcolor=#ADD8E6] [border: (3px solid #000000)]
+      RenderBlock (floating) {DIV} at (234,1) size 231x87 [bgcolor=#ADD8E6] [border: (3px solid #000000)]
+      RenderBlock (floating) {DIV} at (467,1) size 231x87 [bgcolor=#ADD8E6] [border: (3px solid #000000)]
+      RenderBlock (floating) {DIV} at (1,90) size 231x87 [bgcolor=#ADD8E6] [border: (3px solid #000000)]
+      RenderBlock (floating) {DIV} at (234,90) size 115x173 [bgcolor=#ADD8E6] [border: (3px solid #000000)]
+      RenderBlock (floating) {DIV} at (351,90) size 115x173 [bgcolor=#ADD8E6] [border: (3px solid #000000)]
+      RenderBlock (floating) {DIV} at (468,90) size 115x173 [bgcolor=#ADD8E6] [border: (3px solid #000000)]
+      RenderBlock (floating) {DIV} at (585,90) size 115x173 [bgcolor=#ADD8E6] [border: (3px solid #000000)]
index 110cfdb..f808b0a 100644 (file)
Binary files a/LayoutTests/platform/mac/fast/block/float/015-expected.png and b/LayoutTests/platform/mac/fast/block/float/015-expected.png differ
index 1c92158..50f8641 100644 (file)
@@ -10,13 +10,13 @@ layer at (0,0) size 800x600
               RenderText {#text} at (4,4) size 4x18
                 text run at (4,4) width 4: " "
             RenderTableCell {TD} at (12,0) size 657x128 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1]
-              RenderImage {IMG} at (4,4) size 49x50 [bgcolor=#FFA500]
+              RenderImage {IMG} at (4,4) size 50x50 [bgcolor=#FFA500]
               RenderBlock {P} at (4,4) size 649x18
-                RenderText {#text} at (52,0) size 595x18
-                  text run at (52,0) width 595: "This text should be flowing past a tall orange rectangle on the left side of the browser window."
+                RenderText {#text} at (53,0) size 595x18
+                  text run at (53,0) width 595: "This text should be flowing past a tall orange rectangle on the left side of the browser window."
               RenderBlock {DIV} at (4,38) size 649x18 [bgcolor=#008000]
-                RenderBR {BR} at (52,0) size 0x18
-              RenderImage {IMG} at (4,56) size 49x50 [bgcolor=#FFA500]
+                RenderBR {BR} at (53,0) size 0x18
+              RenderImage {IMG} at (4,56) size 50x50 [bgcolor=#FFA500]
               RenderBlock {DIV} at (4,106) size 649x18
                 RenderText {#text} at (0,0) size 649x18
                   text run at (0,0) width 649: "This paragraph should appear below the tall orange rectangle above and to the left, and not flow past it."
index bbd94ae..f8b4de9 100644 (file)
Binary files a/LayoutTests/platform/mac/fast/block/positioning/replaced-inside-fixed-top-bottom-expected.png and b/LayoutTests/platform/mac/fast/block/positioning/replaced-inside-fixed-top-bottom-expected.png differ
index e55ee09..16f3d7e 100644 (file)
@@ -7,6 +7,6 @@ layer at (50,100) size 700x400
   RenderBlock (positioned) {DIV} at (50,100) size 700x400 [border: (1px solid #808080)]
 layer at (51,140) size 560x320
   RenderBlock (positioned) {DIV} at (1,40) size 560x320 [border: (1px solid #FF0000)]
-    RenderImage {IMG} at (1,1) size 392x318
+    RenderImage {IMG} at (1,1) size 393x318
     RenderText {#text} at (0,0) size 0x0
     RenderText {#text} at (0,0) size 0x0
index 7654979..c140a73 100644 (file)
Binary files a/LayoutTests/platform/mac/fast/repaint/block-layout-inline-children-replaced-expected.png and b/LayoutTests/platform/mac/fast/repaint/block-layout-inline-children-replaced-expected.png differ
index cc268c6..11ff3bd 100644 (file)
@@ -11,4 +11,4 @@ layer at (0,0) size 800x600
             text run at (220,0) width 305: "https://bugs.webkit.org/show_bug.cgi?id=40142"
       RenderBlock {DIV} at (0,34) size 800x152
         RenderBlock {DIV} at (0,0) size 402x152 [border: (1px solid #DDDDDD)]
-          RenderImage {IMG} at (155,1) size 92x100
+          RenderImage {IMG} at (155,1) size 93x100
diff --git a/LayoutTests/platform/mac/svg/as-background-image/background-image-preserveaspectRatio-support-expected.png b/LayoutTests/platform/mac/svg/as-background-image/background-image-preserveaspectRatio-support-expected.png
new file mode 100644 (file)
index 0000000..67b2629
Binary files /dev/null and b/LayoutTests/platform/mac/svg/as-background-image/background-image-preserveaspectRatio-support-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/as-background-image/background-image-preserveaspectRatio-support-expected.txt b/LayoutTests/platform/mac/svg/as-background-image/background-image-preserveaspectRatio-support-expected.txt
new file mode 100644 (file)
index 0000000..5a2870b
--- /dev/null
@@ -0,0 +1,94 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x504
+  RenderBlock {HTML} at (0,0) size 800x504
+    RenderBody {BODY} at (8,8) size 784x488
+      RenderTable {TABLE} at (0,0) size 670x488
+        RenderTableSection {TBODY} at (0,0) size 670x488
+          RenderTableRow {TR} at (0,2) size 670x20
+            RenderTableCell {TH} at (2,2) size 93x20 [bgcolor=#DDDD99] [r=0 c=0 rs=1 cs=1]
+              RenderText {#text} at (9,1) size 75x18
+                text run at (9,1) width 75: "viewBox?"
+            RenderTableCell {TH} at (97,2) size 163x20 [bgcolor=#DDDD99] [r=0 c=1 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 161x18
+                text run at (1,1) width 161: "preserve\x{AD}Aspect\x{AD}Ratio"
+            RenderTableCell {TH} at (262,2) size 202x20 [bgcolor=#DDDD99] [r=0 c=2 rs=1 cs=1]
+              RenderText {#text} at (78,1) size 46x18
+                text run at (78,1) width 46: "<img>"
+            RenderTableCell {TH} at (466,2) size 202x20 [bgcolor=#DDDD99] [r=0 c=3 rs=1 cs=1]
+              RenderText {#text} at (80,1) size 42x18
+                text run at (80,1) width 42: "<div>"
+          RenderTableRow {TR} at (0,24) size 670x56
+            RenderTableCell {TH} at (2,129) size 93x20 [bgcolor=#DDDD99] [r=1 c=0 rs=4 cs=1]
+              RenderText {#text} at (1,1) size 91x18
+                text run at (1,1) width 91: "No viewBox"
+            RenderTableCell {TH} at (97,51) size 163x2 [bgcolor=#DDDD99] [r=1 c=1 rs=1 cs=1]
+            RenderTableCell {TD} at (262,24) size 202x56 [r=1 c=2 rs=1 cs=1]
+              RenderImage {IMG} at (1,1) size 200x50 [border: (2px dashed #800000)]
+              RenderText {#text} at (0,0) size 0x0
+            RenderTableCell {TD} at (466,26) size 202x52 [r=1 c=3 rs=1 cs=1]
+              RenderBlock {DIV} at (1,1) size 200x50 [border: (2px dashed #800000)]
+          RenderTableRow {TR} at (0,82) size 670x56
+            RenderTableCell {TH} at (97,100) size 163x20 [bgcolor=#DDDD99] [r=2 c=1 rs=1 cs=1]
+              RenderText {#text} at (62,1) size 39x18
+                text run at (62,1) width 39: "none"
+            RenderTableCell {TD} at (262,82) size 202x56 [r=2 c=2 rs=1 cs=1]
+              RenderImage {IMG} at (1,1) size 200x50 [border: (2px dashed #800000)]
+              RenderText {#text} at (0,0) size 0x0
+            RenderTableCell {TD} at (466,84) size 202x52 [r=2 c=3 rs=1 cs=1]
+              RenderBlock {DIV} at (1,1) size 200x50 [border: (2px dashed #800000)]
+          RenderTableRow {TR} at (0,140) size 670x56
+            RenderTableCell {TH} at (97,158) size 163x20 [bgcolor=#DDDD99] [r=3 c=1 rs=1 cs=1]
+              RenderText {#text} at (63,1) size 37x18
+                text run at (63,1) width 37: "meet"
+            RenderTableCell {TD} at (262,140) size 202x56 [r=3 c=2 rs=1 cs=1]
+              RenderImage {IMG} at (1,1) size 200x50 [border: (2px dashed #800000)]
+              RenderText {#text} at (0,0) size 0x0
+            RenderTableCell {TD} at (466,142) size 202x52 [r=3 c=3 rs=1 cs=1]
+              RenderBlock {DIV} at (1,1) size 200x50 [border: (2px dashed #800000)]
+          RenderTableRow {TR} at (0,198) size 670x56
+            RenderTableCell {TH} at (97,216) size 163x20 [bgcolor=#DDDD99] [r=4 c=1 rs=1 cs=1]
+              RenderText {#text} at (64,1) size 35x18
+                text run at (64,1) width 35: "slice"
+            RenderTableCell {TD} at (262,198) size 202x56 [r=4 c=2 rs=1 cs=1]
+              RenderImage {IMG} at (1,1) size 200x50 [border: (2px dashed #800000)]
+              RenderText {#text} at (0,0) size 0x0
+            RenderTableCell {TD} at (466,200) size 202x52 [r=4 c=3 rs=1 cs=1]
+              RenderBlock {DIV} at (1,1) size 200x50 [border: (2px dashed #800000)]
+          RenderTableRow {TR} at (0,256) size 670x56
+            RenderTableCell {TH} at (2,361) size 93x20 [bgcolor=#DDDD99] [r=5 c=0 rs=4 cs=1]
+              RenderText {#text} at (14,1) size 65x18
+                text run at (14,1) width 65: "viewBox"
+            RenderTableCell {TH} at (97,283) size 163x2 [bgcolor=#DDDD99] [r=5 c=1 rs=1 cs=1]
+            RenderTableCell {TD} at (262,256) size 202x56 [r=5 c=2 rs=1 cs=1]
+              RenderImage {IMG} at (1,1) size 200x50 [border: (2px dashed #800000)]
+              RenderText {#text} at (0,0) size 0x0
+            RenderTableCell {TD} at (466,258) size 202x52 [r=5 c=3 rs=1 cs=1]
+              RenderBlock {DIV} at (1,1) size 200x50 [border: (2px dashed #800000)]
+          RenderTableRow {TR} at (0,314) size 670x56
+            RenderTableCell {TH} at (97,332) size 163x20 [bgcolor=#DDDD99] [r=6 c=1 rs=1 cs=1]
+              RenderText {#text} at (62,1) size 39x18
+                text run at (62,1) width 39: "none"
+            RenderTableCell {TD} at (262,314) size 202x56 [r=6 c=2 rs=1 cs=1]
+              RenderImage {IMG} at (1,1) size 200x50 [border: (2px dashed #800000)]
+              RenderText {#text} at (0,0) size 0x0
+            RenderTableCell {TD} at (466,316) size 202x52 [r=6 c=3 rs=1 cs=1]
+              RenderBlock {DIV} at (1,1) size 200x50 [border: (2px dashed #800000)]
+          RenderTableRow {TR} at (0,372) size 670x56
+            RenderTableCell {TH} at (97,390) size 163x20 [bgcolor=#DDDD99] [r=7 c=1 rs=1 cs=1]
+              RenderText {#text} at (63,1) size 37x18
+                text run at (63,1) width 37: "meet"
+            RenderTableCell {TD} at (262,372) size 202x56 [r=7 c=2 rs=1 cs=1]
+              RenderImage {IMG} at (1,1) size 200x50 [border: (2px dashed #800000)]
+              RenderText {#text} at (0,0) size 0x0
+            RenderTableCell {TD} at (466,374) size 202x52 [r=7 c=3 rs=1 cs=1]
+              RenderBlock {DIV} at (1,1) size 200x50 [border: (2px dashed #800000)]
+          RenderTableRow {TR} at (0,430) size 670x56
+            RenderTableCell {TH} at (97,448) size 163x20 [bgcolor=#DDDD99] [r=8 c=1 rs=1 cs=1]
+              RenderText {#text} at (64,1) size 35x18
+                text run at (64,1) width 35: "slice"
+            RenderTableCell {TD} at (262,430) size 202x56 [r=8 c=2 rs=1 cs=1]
+              RenderImage {IMG} at (1,1) size 200x50 [border: (2px dashed #800000)]
+              RenderText {#text} at (0,0) size 0x0
+            RenderTableCell {TD} at (466,432) size 202x52 [r=8 c=3 rs=1 cs=1]
+              RenderBlock {DIV} at (1,1) size 200x50 [border: (2px dashed #800000)]
diff --git a/LayoutTests/platform/mac/svg/as-background-image/background-image-tiled-expected.png b/LayoutTests/platform/mac/svg/as-background-image/background-image-tiled-expected.png
new file mode 100644 (file)
index 0000000..a16cb01
Binary files /dev/null and b/LayoutTests/platform/mac/svg/as-background-image/background-image-tiled-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/as-background-image/background-image-tiled-expected.txt b/LayoutTests/platform/mac/svg/as-background-image/background-image-tiled-expected.txt
new file mode 100644 (file)
index 0000000..1986e1f
--- /dev/null
@@ -0,0 +1,6 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x118
+  RenderBlock {HTML} at (0,0) size 800x118
+    RenderBody {BODY} at (8,8) size 784x102
+      RenderBlock {DIV} at (0,0) size 786x102 [border: (1px solid #CCCCCC)]
diff --git a/LayoutTests/platform/mac/svg/as-background-image/same-image-two-instances-background-image-expected.png b/LayoutTests/platform/mac/svg/as-background-image/same-image-two-instances-background-image-expected.png
new file mode 100644 (file)
index 0000000..67d5850
Binary files /dev/null and b/LayoutTests/platform/mac/svg/as-background-image/same-image-two-instances-background-image-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/as-background-image/same-image-two-instances-background-image-expected.txt b/LayoutTests/platform/mac/svg/as-background-image/same-image-two-instances-background-image-expected.txt
new file mode 100644 (file)
index 0000000..06009a2
--- /dev/null
@@ -0,0 +1,7 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x116
+  RenderBlock {HTML} at (0,0) size 800x116
+    RenderBody {BODY} at (8,8) size 784x100
+      RenderBlock {DIV} at (0,0) size 200x50 [border: (2px dashed #800000)]
+      RenderBlock {DIV} at (0,50) size 200x50 [border: (2px dashed #800000)]
index be12430..f8f156a 100644 (file)
Binary files a/LayoutTests/platform/mac/svg/as-background-image/svg-as-background-4-expected.png and b/LayoutTests/platform/mac/svg/as-background-image/svg-as-background-4-expected.png differ
index 06b951b..b2a0be3 100644 (file)
Binary files a/LayoutTests/platform/mac/svg/as-border-image/svg-as-border-image-expected.png and b/LayoutTests/platform/mac/svg/as-border-image/svg-as-border-image-expected.png differ
index c4e5042..6ccf849 100644 (file)
Binary files a/LayoutTests/platform/mac/svg/as-image/animated-svg-as-image-expected.png and b/LayoutTests/platform/mac/svg/as-image/animated-svg-as-image-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/as-image/img-preserveAspectRatio-support-1-expected.png b/LayoutTests/platform/mac/svg/as-image/img-preserveAspectRatio-support-1-expected.png
new file mode 100644 (file)
index 0000000..2e90e65
Binary files /dev/null and b/LayoutTests/platform/mac/svg/as-image/img-preserveAspectRatio-support-1-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/as-image/img-preserveAspectRatio-support-1-expected.txt b/LayoutTests/platform/mac/svg/as-image/img-preserveAspectRatio-support-1-expected.txt
new file mode 100644 (file)
index 0000000..1f4b1b9
--- /dev/null
@@ -0,0 +1,156 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x504
+  RenderBlock {HTML} at (0,0) size 800x504
+    RenderBody {BODY} at (8,8) size 784x488
+      RenderTable {TABLE} at (0,0) size 670x488
+        RenderTableSection {TBODY} at (0,0) size 670x488
+          RenderTableRow {TR} at (0,2) size 670x20
+            RenderTableCell {TH} at (2,2) size 93x20 [bgcolor=#DDDD99] [r=0 c=0 rs=1 cs=1]
+              RenderText {#text} at (9,1) size 75x18
+                text run at (9,1) width 75: "viewBox?"
+            RenderTableCell {TH} at (97,2) size 163x20 [bgcolor=#DDDD99] [r=0 c=1 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 161x18
+                text run at (1,1) width 161: "preserve\x{AD}Aspect\x{AD}Ratio"
+            RenderTableCell {TH} at (262,2) size 202x20 [bgcolor=#DDDD99] [r=0 c=2 rs=1 cs=1]
+              RenderText {#text} at (78,1) size 46x18
+                text run at (78,1) width 46: "<img>"
+            RenderTableCell {TH} at (466,2) size 202x20 [bgcolor=#DDDD99] [r=0 c=3 rs=1 cs=1]
+              RenderText {#text} at (68,1) size 66x18
+                text run at (68,1) width 66: "<object>"
+          RenderTableRow {TR} at (0,24) size 670x56
+            RenderTableCell {TH} at (2,129) size 93x20 [bgcolor=#DDDD99] [r=1 c=0 rs=4 cs=1]
+              RenderText {#text} at (1,1) size 91x18
+                text run at (1,1) width 91: "No viewBox"
+            RenderTableCell {TH} at (97,51) size 163x2 [bgcolor=#DDDD99] [r=1 c=1 rs=1 cs=1]
+            RenderTableCell {TD} at (262,24) size 202x56 [r=1 c=2 rs=1 cs=1]
+              RenderImage {IMG} at (1,1) size 200x50 [border: (2px dashed #800000)]
+              RenderText {#text} at (0,0) size 0x0
+            RenderTableCell {TD} at (466,24) size 202x56 [r=1 c=3 rs=1 cs=1]
+              RenderEmbeddedObject {OBJECT} at (1,1) size 200x50 [border: (1px dashed #008000)]
+                layer at (0,0) size 192x42
+                  RenderView at (0,0) size 192x42
+                layer at (0,0) size 192x42
+                  RenderSVGRoot {svg} at (0,0) size 192x42
+                    RenderSVGPath {circle} at (0,0) size 192x42 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#D9BB7A] [fill rule=EVEN-ODD]}] [cx=110.00] [cy=110.00] [r=110.00]
+              RenderText {#text} at (0,0) size 0x0
+          RenderTableRow {TR} at (0,82) size 670x56
+            RenderTableCell {TH} at (97,100) size 163x20 [bgcolor=#DDDD99] [r=2 c=1 rs=1 cs=1]
+              RenderText {#text} at (62,1) size 39x18
+                text run at (62,1) width 39: "none"
+            RenderTableCell {TD} at (262,82) size 202x56 [r=2 c=2 rs=1 cs=1]
+              RenderImage {IMG} at (1,1) size 200x50 [border: (2px dashed #800000)]
+              RenderText {#text} at (0,0) size 0x0
+            RenderTableCell {TD} at (466,82) size 202x56 [r=2 c=3 rs=1 cs=1]
+              RenderEmbeddedObject {OBJECT} at (1,1) size 200x50 [border: (1px dashed #008000)]
+                layer at (0,0) size 192x42
+                  RenderView at (0,0) size 192x42
+                layer at (0,0) size 192x42
+                  RenderSVGRoot {svg} at (0,0) size 192x42
+                    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
+                    RenderSVGContainer {g} at (0,0) size 192x42 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-162.36,-403.29)}]
+                      RenderSVGPath {path} at (0,0) size 192x42 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#D9BB7A] [fill rule=EVEN-ODD]}] [data="M 525.714 585.219 C 525.714 685.419 444.486 766.648 344.286 766.648 C 244.085 766.648 162.857 685.42 162.857 585.219 C 162.857 485.019 244.085 403.791 344.286 403.791 C 444.486 403.791 525.714 485.019 525.714 585.219 Z"]
+              RenderText {#text} at (0,0) size 0x0
+          RenderTableRow {TR} at (0,140) size 670x56
+            RenderTableCell {TH} at (97,158) size 163x20 [bgcolor=#DDDD99] [r=3 c=1 rs=1 cs=1]
+              RenderText {#text} at (63,1) size 37x18
+                text run at (63,1) width 37: "meet"
+            RenderTableCell {TD} at (262,140) size 202x56 [r=3 c=2 rs=1 cs=1]
+              RenderImage {IMG} at (1,1) size 200x50 [border: (2px dashed #800000)]
+              RenderText {#text} at (0,0) size 0x0
+            RenderTableCell {TD} at (466,140) size 202x56 [r=3 c=3 rs=1 cs=1]
+              RenderEmbeddedObject {OBJECT} at (1,1) size 200x50 [border: (1px dashed #008000)]
+                layer at (0,0) size 192x42
+                  RenderView at (0,0) size 192x42
+                layer at (0,0) size 192x42
+                  RenderSVGRoot {svg} at (0,0) size 192x42
+                    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
+                    RenderSVGContainer {g} at (0,0) size 192x42 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-162.36,-403.29)}]
+                      RenderSVGPath {path} at (0,0) size 192x42 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#D9BB7A] [fill rule=EVEN-ODD]}] [data="M 525.714 585.219 C 525.714 685.419 444.486 766.648 344.286 766.648 C 244.085 766.648 162.857 685.42 162.857 585.219 C 162.857 485.019 244.085 403.791 344.286 403.791 C 444.486 403.791 525.714 485.019 525.714 585.219 Z"]
+              RenderText {#text} at (0,0) size 0x0
+          RenderTableRow {TR} at (0,198) size 670x56
+            RenderTableCell {TH} at (97,216) size 163x20 [bgcolor=#DDDD99] [r=4 c=1 rs=1 cs=1]
+              RenderText {#text} at (64,1) size 35x18
+                text run at (64,1) width 35: "slice"
+            RenderTableCell {TD} at (262,198) size 202x56 [r=4 c=2 rs=1 cs=1]
+              RenderImage {IMG} at (1,1) size 200x50 [border: (2px dashed #800000)]
+              RenderText {#text} at (0,0) size 0x0
+            RenderTableCell {TD} at (466,198) size 202x56 [r=4 c=3 rs=1 cs=1]
+              RenderEmbeddedObject {OBJECT} at (1,1) size 200x50 [border: (1px dashed #008000)]
+                layer at (0,0) size 192x42
+                  RenderView at (0,0) size 192x42
+                layer at (0,0) size 192x42
+                  RenderSVGRoot {svg} at (0,0) size 192x42
+                    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
+                    RenderSVGContainer {g} at (0,0) size 192x42 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-162.36,-403.29)}]
+                      RenderSVGPath {path} at (0,0) size 192x42 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#D9BB7A] [fill rule=EVEN-ODD]}] [data="M 525.714 585.219 C 525.714 685.419 444.486 766.648 344.286 766.648 C 244.085 766.648 162.857 685.42 162.857 585.219 C 162.857 485.019 244.085 403.791 344.286 403.791 C 444.486 403.791 525.714 485.019 525.714 585.219 Z"]
+              RenderText {#text} at (0,0) size 0x0
+          RenderTableRow {TR} at (0,256) size 670x56
+            RenderTableCell {TH} at (2,361) size 93x20 [bgcolor=#DDDD99] [r=5 c=0 rs=4 cs=1]
+              RenderText {#text} at (14,1) size 65x18
+                text run at (14,1) width 65: "viewBox"
+            RenderTableCell {TH} at (97,283) size 163x2 [bgcolor=#DDDD99] [r=5 c=1 rs=1 cs=1]
+            RenderTableCell {TD} at (262,256) size 202x56 [r=5 c=2 rs=1 cs=1]
+              RenderImage {IMG} at (1,1) size 200x50 [border: (2px dashed #800000)]
+              RenderText {#text} at (0,0) size 0x0
+            RenderTableCell {TD} at (466,256) size 202x56 [r=5 c=3 rs=1 cs=1]
+              RenderEmbeddedObject {OBJECT} at (1,1) size 200x50 [border: (1px dashed #008000)]
+                layer at (0,0) size 192x42
+                  RenderView at (0,0) size 192x42
+                layer at (0,0) size 192x42
+                  RenderSVGRoot {svg} at (75,0) size 31x31
+                    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
+                    RenderSVGContainer {g} at (74,0) size 32x31 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-162.36,-403.29)}]
+                      RenderSVGPath {path} at (74,0) size 32x31 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#D9BB7A] [fill rule=EVEN-ODD]}] [data="M 525.714 585.219 C 525.714 685.419 444.486 766.648 344.286 766.648 C 244.085 766.648 162.857 685.42 162.857 585.219 C 162.857 485.019 244.085 403.791 344.286 403.791 C 444.486 403.791 525.714 485.019 525.714 585.219 Z"]
+              RenderText {#text} at (0,0) size 0x0
+          RenderTableRow {TR} at (0,314) size 670x56
+            RenderTableCell {TH} at (97,332) size 163x20 [bgcolor=#DDDD99] [r=6 c=1 rs=1 cs=1]
+              RenderText {#text} at (62,1) size 39x18
+                text run at (62,1) width 39: "none"
+            RenderTableCell {TD} at (262,314) size 202x56 [r=6 c=2 rs=1 cs=1]
+              RenderImage {IMG} at (1,1) size 200x50 [border: (2px dashed #800000)]
+              RenderText {#text} at (0,0) size 0x0
+            RenderTableCell {TD} at (466,314) size 202x56 [r=6 c=3 rs=1 cs=1]
+              RenderEmbeddedObject {OBJECT} at (1,1) size 200x50 [border: (1px dashed #008000)]
+                layer at (0,0) size 192x42
+                  RenderView at (0,0) size 192x42
+                layer at (0,0) size 192x42
+                  RenderSVGRoot {svg} at (0,0) size 140x31
+                    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
+                    RenderSVGContainer {g} at (0,0) size 141x31 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-162.36,-403.29)}]
+                      RenderSVGPath {path} at (0,0) size 141x31 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#D9BB7A] [fill rule=EVEN-ODD]}] [data="M 525.714 585.219 C 525.714 685.419 444.486 766.648 344.286 766.648 C 244.085 766.648 162.857 685.42 162.857 585.219 C 162.857 485.019 244.085 403.791 344.286 403.791 C 444.486 403.791 525.714 485.019 525.714 585.219 Z"]
+              RenderText {#text} at (0,0) size 0x0
+          RenderTableRow {TR} at (0,372) size 670x56
+            RenderTableCell {TH} at (97,390) size 163x20 [bgcolor=#DDDD99] [r=7 c=1 rs=1 cs=1]
+              RenderText {#text} at (63,1) size 37x18
+                text run at (63,1) width 37: "meet"
+            RenderTableCell {TD} at (262,372) size 202x56 [r=7 c=2 rs=1 cs=1]
+              RenderImage {IMG} at (1,1) size 200x50 [border: (2px dashed #800000)]
+              RenderText {#text} at (0,0) size 0x0
+            RenderTableCell {TD} at (466,372) size 202x56 [r=7 c=3 rs=1 cs=1]
+              RenderEmbeddedObject {OBJECT} at (1,1) size 200x50 [border: (1px dashed #008000)]
+                layer at (0,0) size 192x42
+                  RenderView at (0,0) size 192x42
+                layer at (0,0) size 192x42
+                  RenderSVGRoot {svg} at (75,0) size 31x31
+                    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
+                    RenderSVGContainer {g} at (74,0) size 32x31 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-162.36,-403.29)}]
+                      RenderSVGPath {path} at (74,0) size 32x31 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#D9BB7A] [fill rule=EVEN-ODD]}] [data="M 525.714 585.219 C 525.714 685.419 444.486 766.648 344.286 766.648 C 244.085 766.648 162.857 685.42 162.857 585.219 C 162.857 485.019 244.085 403.791 344.286 403.791 C 444.486 403.791 525.714 485.019 525.714 585.219 Z"]
+              RenderText {#text} at (0,0) size 0x0
+          RenderTableRow {TR} at (0,430) size 670x56
+            RenderTableCell {TH} at (97,448) size 163x20 [bgcolor=#DDDD99] [r=8 c=1 rs=1 cs=1]
+              RenderText {#text} at (64,1) size 35x18
+                text run at (64,1) width 35: "slice"
+            RenderTableCell {TD} at (262,430) size 202x56 [r=8 c=2 rs=1 cs=1]
+              RenderImage {IMG} at (1,1) size 200x50 [border: (2px dashed #800000)]
+              RenderText {#text} at (0,0) size 0x0
+            RenderTableCell {TD} at (466,430) size 202x56 [r=8 c=3 rs=1 cs=1]
+              RenderEmbeddedObject {OBJECT} at (1,1) size 200x50 [border: (1px dashed #008000)]
+                layer at (0,0) size 192x42
+                  RenderView at (0,0) size 192x42
+                layer at (0,0) size 192x42
+                  RenderSVGRoot {svg} at (0,0) size 140x42
+                    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
+                    RenderSVGContainer {g} at (0,0) size 141x42 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-162.36,-403.29)}]
+                      RenderSVGPath {path} at (0,0) size 141x42 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#D9BB7A] [fill rule=EVEN-ODD]}] [data="M 525.714 585.219 C 525.714 685.419 444.486 766.648 344.286 766.648 C 244.085 766.648 162.857 685.42 162.857 585.219 C 162.857 485.019 244.085 403.791 344.286 403.791 C 444.486 403.791 525.714 485.019 525.714 585.219 Z"]
+              RenderText {#text} at (0,0) size 0x0
diff --git a/LayoutTests/platform/mac/svg/as-image/same-image-two-instances-expected.png b/LayoutTests/platform/mac/svg/as-image/same-image-two-instances-expected.png
new file mode 100644 (file)
index 0000000..bf88125
Binary files /dev/null and b/LayoutTests/platform/mac/svg/as-image/same-image-two-instances-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/as-image/same-image-two-instances-expected.txt b/LayoutTests/platform/mac/svg/as-image/same-image-two-instances-expected.txt
new file mode 100644 (file)
index 0000000..d7646d0
--- /dev/null
@@ -0,0 +1,10 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x120
+  RenderBlock {HTML} at (0,0) size 800x120
+    RenderBody {BODY} at (8,8) size 784x104
+      RenderImage {IMG} at (0,50) size 200x50 [border: (2px dashed #800000)]
+      RenderText {#text} at (200,86) size 4x18
+        text run at (200,86) width 4: " "
+      RenderImage {IMG} at (204,0) size 100x100 [border: (2px dashed #800000)]
+      RenderText {#text} at (0,0) size 0x0
index 022fee5..a9ffee0 100644 (file)
Binary files a/LayoutTests/platform/mac/svg/as-image/svg-as-relative-image-expected.png and b/LayoutTests/platform/mac/svg/as-image/svg-as-relative-image-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/as-image/svg-as-relative-image-with-explicit-size-expected.png b/LayoutTests/platform/mac/svg/as-image/svg-as-relative-image-with-explicit-size-expected.png
new file mode 100644 (file)
index 0000000..a9ffee0
Binary files /dev/null and b/LayoutTests/platform/mac/svg/as-image/svg-as-relative-image-with-explicit-size-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/as-image/svg-as-relative-image-with-explicit-size-expected.txt b/LayoutTests/platform/mac/svg/as-image/svg-as-relative-image-with-explicit-size-expected.txt
new file mode 100644 (file)
index 0000000..1be7b54
--- /dev/null
@@ -0,0 +1,8 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (0,0) size 800x600
+      RenderBlock {DIV} at (0,0) size 100x100 [bgcolor=#FF0000]
+        RenderImage {IMG} at (0,0) size 100x100
+        RenderText {#text} at (0,0) size 0x0
diff --git a/LayoutTests/platform/mac/svg/as-image/svg-image-change-content-size-expected.png b/LayoutTests/platform/mac/svg/as-image/svg-image-change-content-size-expected.png
new file mode 100644 (file)
index 0000000..3a2caa1
Binary files /dev/null and b/LayoutTests/platform/mac/svg/as-image/svg-image-change-content-size-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/as-image/svg-image-change-content-size-expected.txt b/LayoutTests/platform/mac/svg/as-image/svg-image-change-content-size-expected.txt
new file mode 100644 (file)
index 0000000..aec29fd
--- /dev/null
@@ -0,0 +1,11 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x480
+  RenderBlock {html} at (0,0) size 800x480
+    RenderBody {body} at (8,16) size 784x456
+      RenderBlock {p} at (0,0) size 784x18
+        RenderText {#text} at (0,0) size 764x18
+          text run at (0,0) width 764: "The svg image contained in the div element (red box) should not change its appearance when width is resized to be larger"
+      RenderBlock {div} at (0,34) size 602x422 [border: (1px solid #FF0000)]
+        RenderImage {img} at (1,1) size 420x420
+        RenderText {#text} at (0,0) size 0x0
index c0ae9da..2258de7 100644 (file)
Binary files a/LayoutTests/platform/mac/svg/zoom/page/relative-sized-document-scrollbars-expected.png and b/LayoutTests/platform/mac/svg/zoom/page/relative-sized-document-scrollbars-expected.png differ
index 689c3c8..adbd5e2 100644 (file)
@@ -1,6 +1,6 @@
-layer at (0,0) size 1357x1011
-  RenderView at (0,0) size 785x585
-layer at (0,0) size 1357x1011
-  RenderSVGRoot {svg} at (12,8) size 1333x995
-    RenderSVGPath {rect} at (12,8) size 1333x995 [stroke={[type=SOLID] [color=#000000]}] [x=7.85] [y=5.85] [width=769.30] [height=573.30]
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderSVGRoot {svg} at (6,3) size 788x594
+    RenderSVGPath {rect} at (6,3) size 788x594 [stroke={[type=SOLID] [color=#000000]}] [x=4.63] [y=3.47] [width=453.70] [height=340.28]
     RenderSVGHiddenContainer {defs} at (0,0) size 0x0
diff --git a/LayoutTests/platform/mac/svg/zoom/page/zoom-background-image-tiled-expected.png b/LayoutTests/platform/mac/svg/zoom/page/zoom-background-image-tiled-expected.png
new file mode 100644 (file)
index 0000000..0a6f398
Binary files /dev/null and b/LayoutTests/platform/mac/svg/zoom/page/zoom-background-image-tiled-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/zoom/page/zoom-background-image-tiled-expected.txt b/LayoutTests/platform/mac/svg/zoom/page/zoom-background-image-tiled-expected.txt
new file mode 100644 (file)
index 0000000..8af6d30
--- /dev/null
@@ -0,0 +1,6 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x243
+  RenderBlock {HTML} at (0,0) size 800x243
+    RenderBody {BODY} at (16,16) size 768x211
+      RenderBlock {DIV} at (0,0) size 772x211 [border: (2px solid #CCCCCC)]
diff --git a/LayoutTests/platform/mac/svg/zoom/page/zoom-background-images-expected.png b/LayoutTests/platform/mac/svg/zoom/page/zoom-background-images-expected.png
new file mode 100644 (file)
index 0000000..b8d99c2
Binary files /dev/null and b/LayoutTests/platform/mac/svg/zoom/page/zoom-background-images-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/zoom/page/zoom-background-images-expected.txt b/LayoutTests/platform/mac/svg/zoom/page/zoom-background-images-expected.txt
new file mode 100644 (file)
index 0000000..abc62f8
--- /dev/null
@@ -0,0 +1,21 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x161
+  RenderBlock {HTML} at (0,0) size 800x161
+    RenderBody {BODY} at (4,4) size 792x153
+      RenderBlock {DIV} at (11,11) size 129x129 [border: (1px solid #000000)]
+      RenderText {#text} at (151,143) size 2x10
+        text run at (151,143) width 2: " "
+      RenderBlock {DIV} at (164,11) size 129x129 [border: (1px solid #000000)]
+      RenderText {#text} at (304,143) size 2x10
+        text run at (304,143) width 2: " "
+      RenderBlock {DIV} at (317,11) size 129x129 [border: (1px solid #000000)]
+      RenderText {#text} at (457,143) size 2x10
+        text run at (457,143) width 2: " "
+      RenderImage {IMG} at (470,11) size 129x129 [border: (1px solid #000000)]
+      RenderText {#text} at (610,143) size 2x10
+        text run at (610,143) width 2: " "
+      RenderImage {IMG} at (623,11) size 129x129 [border: (1px solid #000000)]
+      RenderText {#text} at (0,0) size 0x0
+      RenderText {#text} at (0,0) size 0x0
+      RenderText {#text} at (0,0) size 0x0
index e4b149d..27790d6 100644 (file)
Binary files a/LayoutTests/platform/mac/svg/zoom/page/zoom-foreignObject-expected.png and b/LayoutTests/platform/mac/svg/zoom/page/zoom-foreignObject-expected.png differ
index 400c30d..57e4cce 100644 (file)
@@ -1,7 +1,7 @@
-layer at (0,0) size 1131x843
-  RenderView at (0,0) size 785x585
-layer at (0,0) size 1131x843
-  RenderSVGRoot {svg} at (12,12) size 1119x831
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderSVGRoot {svg} at (12,12) size 788x588
     RenderSVGForeignObject {foreignObject} at (10,10) size 580x380
       RenderBlock {xhtml:div} at (0,0) size 580x18
         RenderText {#text} at (0,0) size 78x18
@@ -11,5 +11,5 @@ layer at (0,0) size 1131x843
           RenderText {#text} at (0,0) size 66x18
             text run at (0,0) width 66: "and a link."
         RenderBR {xhtml:br} at (66,0) size 0x18
-    RenderSVGPath {rect} at (12,12) size 840x552 [stroke={[type=SOLID] [color=#008000]}] [x=10.00] [y=10.00] [width=580.00] [height=380.00]
+    RenderSVGPath {rect} at (12,12) size 788x552 [stroke={[type=SOLID] [color=#008000]}] [x=10.00] [y=10.00] [width=580.00] [height=380.00]
     RenderSVGHiddenContainer {defs} at (0,0) size 0x0
diff --git a/LayoutTests/platform/mac/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.png b/LayoutTests/platform/mac/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.png
new file mode 100644 (file)
index 0000000..9a1cf3d
Binary files /dev/null and b/LayoutTests/platform/mac/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.txt b/LayoutTests/platform/mac/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.txt
new file mode 100644 (file)
index 0000000..6fc7dd7
--- /dev/null
@@ -0,0 +1,156 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x347
+  RenderBlock {HTML} at (0,0) size 800x347
+    RenderBody {BODY} at (5,5) size 790x337
+      RenderTable {TABLE} at (0,0) size 462x337
+        RenderTableSection {TBODY} at (0,0) size 462x337
+          RenderTableRow {TR} at (0,1) size 462x15
+            RenderTableCell {TH} at (1,1) size 65x15 [bgcolor=#DDDD99] [r=0 c=0 rs=1 cs=1]
+              RenderText {#text} at (6,1) size 53x13
+                text run at (6,1) width 53: "viewBox?"
+            RenderTableCell {TH} at (67,1) size 112x15 [bgcolor=#DDDD99] [r=0 c=1 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 110x13
+                text run at (1,1) width 110: "preserve\x{AD}Aspect\x{AD}Ratio"
+            RenderTableCell {TH} at (180,1) size 140x15 [bgcolor=#DDDD99] [r=0 c=2 rs=1 cs=1]
+              RenderText {#text} at (54,1) size 32x13
+                text run at (54,1) width 32: "<img>"
+            RenderTableCell {TH} at (321,1) size 140x15 [bgcolor=#DDDD99] [r=0 c=3 rs=1 cs=1]
+              RenderText {#text} at (47,1) size 46x13
+                text run at (47,1) width 46: "<object>"
+          RenderTableRow {TR} at (0,17) size 462x39
+            RenderTableCell {TH} at (1,89) size 65x15 [bgcolor=#DDDD99] [r=1 c=0 rs=4 cs=1]
+              RenderText {#text} at (1,1) size 63x13
+                text run at (1,1) width 63: "No viewBox"
+            RenderTableCell {TH} at (67,35) size 112x2 [bgcolor=#DDDD99] [r=1 c=1 rs=1 cs=1]
+            RenderTableCell {TD} at (180,17) size 140x39 [r=1 c=2 rs=1 cs=1]
+              RenderImage {IMG} at (1,1) size 138x34 [border: (1px dashed #800000)]
+              RenderText {#text} at (0,0) size 0x0
+            RenderTableCell {TD} at (321,17) size 140x39 [r=1 c=3 rs=1 cs=1]
+              RenderEmbeddedObject {OBJECT} at (1,1) size 138x34 [border: (1px dashed #008000)]
+                layer at (0,0) size 132x28
+                  RenderView at (0,0) size 132x28
+                layer at (0,0) size 132x28
+                  RenderSVGRoot {svg} at (0,0) size 132x28
+                    RenderSVGPath {circle} at (0,0) size 132x28 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#D9BB7A] [fill rule=EVEN-ODD]}] [cx=110.00] [cy=110.00] [r=110.00]
+              RenderText {#text} at (0,0) size 0x0
+          RenderTableRow {TR} at (0,57) size 462x39
+            RenderTableCell {TH} at (67,69) size 112x15 [bgcolor=#DDDD99] [r=2 c=1 rs=1 cs=1]
+              RenderText {#text} at (42,1) size 28x13
+                text run at (42,1) width 28: "none"
+            RenderTableCell {TD} at (180,57) size 140x39 [r=2 c=2 rs=1 cs=1]
+              RenderImage {IMG} at (1,1) size 138x34 [border: (1px dashed #800000)]
+              RenderText {#text} at (0,0) size 0x0
+            RenderTableCell {TD} at (321,57) size 140x39 [r=2 c=3 rs=1 cs=1]
+              RenderEmbeddedObject {OBJECT} at (1,1) size 138x34 [border: (1px dashed #008000)]
+                layer at (0,0) size 132x28
+                  RenderView at (0,0) size 132x28
+                layer at (0,0) size 132x28
+                  RenderSVGRoot {svg} at (0,0) size 132x28
+                    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
+                    RenderSVGContainer {g} at (0,0) size 132x28 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-162.36,-403.29)}]
+                      RenderSVGPath {path} at (0,0) size 132x28 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#D9BB7A] [fill rule=EVEN-ODD]}] [data="M 525.714 585.219 C 525.714 685.419 444.486 766.648 344.286 766.648 C 244.085 766.648 162.857 685.42 162.857 585.219 C 162.857 485.019 244.085 403.791 344.286 403.791 C 444.486 403.791 525.714 485.019 525.714 585.219 Z"]
+              RenderText {#text} at (0,0) size 0x0
+          RenderTableRow {TR} at (0,97) size 462x39
+            RenderTableCell {TH} at (67,109) size 112x15 [bgcolor=#DDDD99] [r=3 c=1 rs=1 cs=1]
+              RenderText {#text} at (43,1) size 26x13
+                text run at (43,1) width 26: "meet"
+            RenderTableCell {TD} at (180,97) size 140x39 [r=3 c=2 rs=1 cs=1]
+              RenderImage {IMG} at (1,1) size 138x34 [border: (1px dashed #800000)]
+              RenderText {#text} at (0,0) size 0x0
+            RenderTableCell {TD} at (321,97) size 140x39 [r=3 c=3 rs=1 cs=1]
+              RenderEmbeddedObject {OBJECT} at (1,1) size 138x34 [border: (1px dashed #008000)]
+                layer at (0,0) size 132x28
+                  RenderView at (0,0) size 132x28
+                layer at (0,0) size 132x28
+                  RenderSVGRoot {svg} at (0,0) size 132x28
+                    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
+                    RenderSVGContainer {g} at (0,0) size 132x28 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-162.36,-403.29)}]
+                      RenderSVGPath {path} at (0,0) size 132x28 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#D9BB7A] [fill rule=EVEN-ODD]}] [data="M 525.714 585.219 C 525.714 685.419 444.486 766.648 344.286 766.648 C 244.085 766.648 162.857 685.42 162.857 585.219 C 162.857 485.019 244.085 403.791 344.286 403.791 C 444.486 403.791 525.714 485.019 525.714 585.219 Z"]
+              RenderText {#text} at (0,0) size 0x0
+          RenderTableRow {TR} at (0,137) size 462x39
+            RenderTableCell {TH} at (67,149) size 112x15 [bgcolor=#DDDD99] [r=4 c=1 rs=1 cs=1]
+              RenderText {#text} at (44,1) size 24x13
+                text run at (44,1) width 24: "slice"
+            RenderTableCell {TD} at (180,137) size 140x39 [r=4 c=2 rs=1 cs=1]
+              RenderImage {IMG} at (1,1) size 138x34 [border: (1px dashed #800000)]
+              RenderText {#text} at (0,0) size 0x0
+            RenderTableCell {TD} at (321,137) size 140x39 [r=4 c=3 rs=1 cs=1]
+              RenderEmbeddedObject {OBJECT} at (1,1) size 138x34 [border: (1px dashed #008000)]
+                layer at (0,0) size 132x28
+                  RenderView at (0,0) size 132x28
+                layer at (0,0) size 132x28
+                  RenderSVGRoot {svg} at (0,0) size 132x28
+                    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
+                    RenderSVGContainer {g} at (0,0) size 132x28 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-162.36,-403.29)}]
+                      RenderSVGPath {path} at (0,0) size 132x28 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#D9BB7A] [fill rule=EVEN-ODD]}] [data="M 525.714 585.219 C 525.714 685.419 444.486 766.648 344.286 766.648 C 244.085 766.648 162.857 685.42 162.857 585.219 C 162.857 485.019 244.085 403.791 344.286 403.791 C 444.486 403.791 525.714 485.019 525.714 585.219 Z"]
+              RenderText {#text} at (0,0) size 0x0
+          RenderTableRow {TR} at (0,177) size 462x39
+            RenderTableCell {TH} at (1,249) size 65x15 [bgcolor=#DDDD99] [r=5 c=0 rs=4 cs=1]
+              RenderText {#text} at (10,1) size 45x13
+                text run at (10,1) width 45: "viewBox"
+            RenderTableCell {TH} at (67,195) size 112x2 [bgcolor=#DDDD99] [r=5 c=1 rs=1 cs=1]
+            RenderTableCell {TD} at (180,177) size 140x39 [r=5 c=2 rs=1 cs=1]
+              RenderImage {IMG} at (1,1) size 138x34 [border: (1px dashed #800000)]
+              RenderText {#text} at (0,0) size 0x0
+            RenderTableCell {TD} at (321,177) size 140x39 [r=5 c=3 rs=1 cs=1]
+              RenderEmbeddedObject {OBJECT} at (1,1) size 138x34 [border: (1px dashed #008000)]
+                layer at (0,0) size 132x28
+                  RenderView at (0,0) size 132x28
+                layer at (0,0) size 132x28
+                  RenderSVGRoot {svg} at (52,0) size 21x21
+                    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
+                    RenderSVGContainer {g} at (51,0) size 22x21 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-162.36,-403.29)}]
+                      RenderSVGPath {path} at (51,0) size 22x21 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#D9BB7A] [fill rule=EVEN-ODD]}] [data="M 525.714 585.219 C 525.714 685.419 444.486 766.648 344.286 766.648 C 244.085 766.648 162.857 685.42 162.857 585.219 C 162.857 485.019 244.085 403.791 344.286 403.791 C 444.486 403.791 525.714 485.019 525.714 585.219 Z"]
+              RenderText {#text} at (0,0) size 0x0
+          RenderTableRow {TR} at (0,217) size 462x39
+            RenderTableCell {TH} at (67,229) size 112x15 [bgcolor=#DDDD99] [r=6 c=1 rs=1 cs=1]
+              RenderText {#text} at (42,1) size 28x13
+                text run at (42,1) width 28: "none"
+            RenderTableCell {TD} at (180,217) size 140x39 [r=6 c=2 rs=1 cs=1]
+              RenderImage {IMG} at (1,1) size 138x34 [border: (1px dashed #800000)]
+              RenderText {#text} at (0,0) size 0x0
+            RenderTableCell {TD} at (321,217) size 140x39 [r=6 c=3 rs=1 cs=1]
+              RenderEmbeddedObject {OBJECT} at (1,1) size 138x34 [border: (1px dashed #008000)]
+                layer at (0,0) size 132x28
+                  RenderView at (0,0) size 132x28
+                layer at (0,0) size 132x28
+                  RenderSVGRoot {svg} at (0,0) size 97x21
+                    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
+                    RenderSVGContainer {g} at (0,0) size 97x21 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-162.36,-403.29)}]
+                      RenderSVGPath {path} at (0,0) size 97x21 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#D9BB7A] [fill rule=EVEN-ODD]}] [data="M 525.714 585.219 C 525.714 685.419 444.486 766.648 344.286 766.648 C 244.085 766.648 162.857 685.42 162.857 585.219 C 162.857 485.019 244.085 403.791 344.286 403.791 C 444.486 403.791 525.714 485.019 525.714 585.219 Z"]
+              RenderText {#text} at (0,0) size 0x0
+          RenderTableRow {TR} at (0,257) size 462x39
+            RenderTableCell {TH} at (67,269) size 112x15 [bgcolor=#DDDD99] [r=7 c=1 rs=1 cs=1]
+              RenderText {#text} at (43,1) size 26x13
+                text run at (43,1) width 26: "meet"
+            RenderTableCell {TD} at (180,257) size 140x39 [r=7 c=2 rs=1 cs=1]
+              RenderImage {IMG} at (1,1) size 138x34 [border: (1px dashed #800000)]
+              RenderText {#text} at (0,0) size 0x0
+            RenderTableCell {TD} at (321,257) size 140x39 [r=7 c=3 rs=1 cs=1]
+              RenderEmbeddedObject {OBJECT} at (1,1) size 138x34 [border: (1px dashed #008000)]
+                layer at (0,0) size 132x28
+                  RenderView at (0,0) size 132x28
+                layer at (0,0) size 132x28
+                  RenderSVGRoot {svg} at (52,0) size 21x21
+                    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
+                    RenderSVGContainer {g} at (51,0) size 22x21 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-162.36,-403.29)}]
+                      RenderSVGPath {path} at (51,0) size 22x21 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#D9BB7A] [fill rule=EVEN-ODD]}] [data="M 525.714 585.219 C 525.714 685.419 444.486 766.648 344.286 766.648 C 244.085 766.648 162.857 685.42 162.857 585.219 C 162.857 485.019 244.085 403.791 344.286 403.791 C 444.486 403.791 525.714 485.019 525.714 585.219 Z"]
+              RenderText {#text} at (0,0) size 0x0
+          RenderTableRow {TR} at (0,297) size 462x39
+            RenderTableCell {TH} at (67,309) size 112x15 [bgcolor=#DDDD99] [r=8 c=1 rs=1 cs=1]
+              RenderText {#text} at (44,1) size 24x13
+                text run at (44,1) width 24: "slice"
+            RenderTableCell {TD} at (180,297) size 140x39 [r=8 c=2 rs=1 cs=1]
+              RenderImage {IMG} at (1,1) size 138x34 [border: (1px dashed #800000)]
+              RenderText {#text} at (0,0) size 0x0
+            RenderTableCell {TD} at (321,297) size 140x39 [r=8 c=3 rs=1 cs=1]
+              RenderEmbeddedObject {OBJECT} at (1,1) size 138x34 [border: (1px dashed #008000)]
+                layer at (0,0) size 132x28
+                  RenderView at (0,0) size 132x28
+                layer at (0,0) size 132x28
+                  RenderSVGRoot {svg} at (0,0) size 97x28
+                    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
+                    RenderSVGContainer {g} at (0,0) size 97x28 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-162.36,-403.29)}]
+                      RenderSVGPath {path} at (0,0) size 97x28 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#D9BB7A] [fill rule=EVEN-ODD]}] [data="M 525.714 585.219 C 525.714 685.419 444.486 766.648 344.286 766.648 C 244.085 766.648 162.857 685.42 162.857 585.219 C 162.857 485.019 244.085 403.791 344.286 403.791 C 444.486 403.791 525.714 485.019 525.714 585.219 Z"]
+              RenderText {#text} at (0,0) size 0x0
diff --git a/LayoutTests/platform/mac/svg/zoom/page/zoom-svg-as-background-with-relative-size-and-viewBox-expected.png b/LayoutTests/platform/mac/svg/zoom/page/zoom-svg-as-background-with-relative-size-and-viewBox-expected.png
new file mode 100644 (file)
index 0000000..ba5a6cc
Binary files /dev/null and b/LayoutTests/platform/mac/svg/zoom/page/zoom-svg-as-background-with-relative-size-and-viewBox-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/zoom/page/zoom-svg-as-background-with-relative-size-and-viewBox-expected.txt b/LayoutTests/platform/mac/svg/zoom/page/zoom-svg-as-background-with-relative-size-and-viewBox-expected.txt
new file mode 100644 (file)
index 0000000..d280171
--- /dev/null
@@ -0,0 +1,8 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (0,0) size 800x600
+      RenderBlock {DIV} at (0,0) size 666x500 [bgcolor=#008000]
+        RenderText {#text} at (0,0) size 3x15
+          text run at (0,0) width 3: " "
diff --git a/LayoutTests/platform/mac/svg/zoom/page/zoom-svg-as-background-with-relative-size-expected.png b/LayoutTests/platform/mac/svg/zoom/page/zoom-svg-as-background-with-relative-size-expected.png
new file mode 100644 (file)
index 0000000..2aa07e9
Binary files /dev/null and b/LayoutTests/platform/mac/svg/zoom/page/zoom-svg-as-background-with-relative-size-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/zoom/page/zoom-svg-as-background-with-relative-size-expected.txt b/LayoutTests/platform/mac/svg/zoom/page/zoom-svg-as-background-with-relative-size-expected.txt
new file mode 100644 (file)
index 0000000..81f9c06
--- /dev/null
@@ -0,0 +1,8 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (0,0) size 800x600
+      RenderBlock {DIV} at (0,0) size 289x289 [bgcolor=#008000]
+        RenderText {#text} at (0,0) size 2x10
+          text run at (0,0) width 2: " "
diff --git a/LayoutTests/platform/mac/svg/zoom/page/zoom-svg-as-image-expected.png b/LayoutTests/platform/mac/svg/zoom/page/zoom-svg-as-image-expected.png
new file mode 100644 (file)
index 0000000..20ebffc
Binary files /dev/null and b/LayoutTests/platform/mac/svg/zoom/page/zoom-svg-as-image-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/zoom/page/zoom-svg-as-image-expected.txt b/LayoutTests/platform/mac/svg/zoom/page/zoom-svg-as-image-expected.txt
new file mode 100644 (file)
index 0000000..f168607
--- /dev/null
@@ -0,0 +1,8 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (0,0) size 800x600
+      RenderBlock {DIV} at (0,0) size 207x207 [bgcolor=#FF0000]
+        RenderImage {IMG} at (0,0) size 207x207
+        RenderText {#text} at (0,0) size 0x0
diff --git a/LayoutTests/platform/mac/svg/zoom/page/zoom-svg-as-relative-image-expected.png b/LayoutTests/platform/mac/svg/zoom/page/zoom-svg-as-relative-image-expected.png
new file mode 100644 (file)
index 0000000..cfd3dbe
Binary files /dev/null and b/LayoutTests/platform/mac/svg/zoom/page/zoom-svg-as-relative-image-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/zoom/page/zoom-svg-as-relative-image-expected.txt b/LayoutTests/platform/mac/svg/zoom/page/zoom-svg-as-relative-image-expected.txt
new file mode 100644 (file)
index 0000000..09bc926
--- /dev/null
@@ -0,0 +1,8 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (0,0) size 800x600
+      RenderBlock {DIV} at (0,0) size 83x83 [bgcolor=#FF0000]
+        RenderImage {IMG} at (0,0) size 83x83
+        RenderText {#text} at (0,0) size 0x0
diff --git a/LayoutTests/svg/as-background-image/background-image-preserveaspectRatio-support.html b/LayoutTests/svg/as-background-image/background-image-preserveaspectRatio-support.html
new file mode 100644 (file)
index 0000000..1ad016a
--- /dev/null
@@ -0,0 +1,134 @@
+<!DOCTYPE html>\r
+<html>\r
+<head>\r
+    <title>preserveAspectRatio test for background-image</title>\r
+    <style>\r
+        th {\r
+            background-color: #dd9;\r
+            font-family: sans-serif;\r
+        }\r
+\r
+        img, div {\r
+            /* background-color: #EBF; */\r
+            border: 2px dashed maroon;\r
+            height: 50px;\r
+            left: 100px;\r
+            overflow: visible;\r
+            padding: 3px;\r
+            top: 20px;\r
+            width: 200px;\r
+            box-sizing: border-box;\r
+        }\r
+    </style>\r
+</head>\r
+<body>\r
+    <table>\r
+        <tr>\r
+            <th>\r
+                viewBox?\r
+            </th>\r
+            <th>\r
+                preserve&shy;Aspect&shy;Ratio\r
+            </th>\r
+            <th>\r
+                &lt;img&gt;\r
+            </th>\r
+            <th>\r
+                &lt;div&gt;\r
+            </th>\r
+        </tr>\r
+        <tr>\r
+            <th rowspan=4>\r
+                No viewBox\r
+            </th>\r
+            <th>\r
+            </th>\r
+            <td>\r
+                <img src="../as-image/resources/circle-default-default.svg" />\r
+            </td>\r
+            <td>\r
+                <div style="background: url(../as-image/resources/circle-default-default.svg)"></div>\r
+            </td>\r
+        </tr>\r
+        <tr>\r
+            <th>\r
+                none\r
+            </th>\r
+            <td>\r
+                <img src="../as-image/resources/circle-default-none.svg" />\r
+            </td>\r
+            <td>\r
+                <div style="background: url(../as-image/resources/circle-default-none.svg)"></div>\r
+            </td>\r
+        </tr>\r
+        <tr>\r
+            <th>\r
+                meet\r
+            </th>\r
+            <td>\r
+                <img src="../as-image/resources/circle-default-meet.svg" />\r
+            </td>\r
+            <td>\r
+                <div style="background: url(../as-image/resources/circle-default-meet.svg)"></div>\r
+            </td>\r
+        </tr>\r
+        <tr>\r
+            <th>\r
+                slice\r
+            </th>\r
+            <td>\r
+                <img src="../as-image/resources/circle-default-slice.svg" />\r
+            </td>\r
+            <td>\r
+                <div style="background: url(../as-image/resources/circle-default-slice.svg)"></div>\r
+            </td>\r
+        </tr>\r
+        <tr>\r
+            <th rowspan=4>\r
+                viewBox\r
+            </th>\r
+            <th>\r
+            </th>\r
+            <td>\r
+                <img src="../as-image/resources/circle-viewbox-default.svg" />\r
+            </td>\r
+            <td>\r
+                <div style="background: url(../as-image/resources/circle-viewbox-default.svg)"></div>\r
+            </td>\r
+        </tr>\r
+        <tr>\r
+            <th>\r
+                none\r
+            </th>\r
+            <td>\r
+                <img src="../as-image/resources/circle-viewbox-none.svg" />\r
+            </td>\r
+            <td>\r
+                <div style="background: url(../as-image/resources/circle-viewbox-none.svg)"></div>\r
+            </td>\r
+        </tr>\r
+        <tr>\r
+            <th>\r
+                meet\r
+            </th>\r
+            <td>\r
+                <img src="../as-image/resources/circle-viewbox-meet.svg" />\r
+            </td>\r
+            <td>\r
+                <div style="background: url(../as-image/resources/circle-viewbox-meet.svg)"></div>\r
+            </td>\r
+        </tr>\r
+        <tr>\r
+            <th>\r
+                slice\r
+            </th>\r
+            <td>\r
+                <img src="../as-image/resources/circle-viewbox-slice.svg" />\r
+            </td>\r
+            <td>\r
+                <div style="background: url(../as-image/resources/circle-viewbox-slice.svg)"></div>\r
+            </td>\r
+        </tr>\r
+    </table>\r
+</body>\r
+</html>\r
diff --git a/LayoutTests/svg/as-background-image/background-image-tiled.html b/LayoutTests/svg/as-background-image/background-image-tiled.html
new file mode 100644 (file)
index 0000000..a87e92d
--- /dev/null
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+    <title>SVG background-image tiling</title>
+    <style>
+        div{
+            border: 1px solid #ccc;
+            width: 100%;
+            height: 100px;
+            background-image:url('resources/construction-tape.svg');
+            background-size: 100px 100%;
+        }
+    </style>
+</head>
+
+<body>
+<div></div>
+
+</body>
+</html>
diff --git a/LayoutTests/svg/as-background-image/resources/construction-tape.svg b/LayoutTests/svg/as-background-image/resources/construction-tape.svg
new file mode 100644 (file)
index 0000000..8237653
--- /dev/null
@@ -0,0 +1,24 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" 
+"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+
+<svg viewBox="0 0 100 100" preserveAspectRatio="none" version="1.1" 
+xmlns="http://www.w3.org/2000/svg">
+
+<defs>
+<linearGradient id="orange_red" x1="0%" y1="0%" x2="0%" y2="100%">
+<stop offset="0%" style="stop-color:rgb(230,230,0);stop-opacity:1"/>
+<stop offset="100%" style="stop-color:rgb(200,200,0);stop-opacity:1"/>
+</linearGradient>
+</defs>
+
+<rect width="100%" height="100%"
+style="fill:url(#orange_red)"/>
+
+<polygon points="-20,100 20,100 120,0 80,0" fill = "black" />
+<polygon points="80,100 100,80 100,100" fill = "black" />
+<polygon points="0,20 20,0 0,0" fill = "black" />
+
+</svg>
+
+
index 17301c2..38b448f 100644 (file)
@@ -1,4 +1,4 @@
-<svg width="100%" height="100%" viewBox="0 200 200 200" version="1.1" xmlns="http://www.w3.org/2000/svg">
+<svg width="100%" height="100%" preserveAspectRatio="none" viewBox="0 200 200 200" version="1.1" xmlns="http://www.w3.org/2000/svg">
 <title>Suzanne's Hearts V1.0</title><desc>Author: http://richard.warburton.it - Licence: http://creativecommons.org/licenses/publicdomain</desc>
 <rect x="-200" y="0" width="600" height="600" fill="black" />
 <path d="M0 0A10 10 0 1 1 17.0711 7.0711L0 24.142L-17.0711 7.0711A10 10 0 1 1 0 0" transform="translate(100,265) scale(4,5.2)" fill="#500" />
diff --git a/LayoutTests/svg/as-background-image/same-image-two-instances-background-image.html b/LayoutTests/svg/as-background-image/same-image-two-instances-background-image.html
new file mode 100644 (file)
index 0000000..dacb7fd
--- /dev/null
@@ -0,0 +1,23 @@
+<!DOCTYPE html>\r
+<html>\r
+<head>\r
+    <style>\r
+         div {\r
+            /* background-color: #EBF; */\r
+            border: 2px dashed maroon;\r
+            height: 50px;\r
+            left: 100px;\r
+            overflow: visible;\r
+            padding: 3px;\r
+            top: 20px;\r
+            width: 200px;\r
+            box-sizing: border-box;\r
+        }\r
+    </style>\r
+</head>\r
+<body>\r
+    <!-- None of these images must look distorted -->\r
+       <div style="background: url(../as-image/resources/circle-default-default.svg)"></div>\r
+       <div style="background: url(../as-image/resources/circle-default-default.svg)"></div>\r
+</body>\r
+</html>\r
diff --git a/LayoutTests/svg/as-image/img-preserveAspectRatio-support-1.html b/LayoutTests/svg/as-image/img-preserveAspectRatio-support-1.html
new file mode 100644 (file)
index 0000000..7b122bd
--- /dev/null
@@ -0,0 +1,139 @@
+<!DOCTYPE html>\r
+<html>\r
+<head>\r
+    <title>preserveAspectRatio test 1/2</title>\r
+    <style>\r
+        th {\r
+            background-color: #dd9;\r
+            font-family: sans-serif;\r
+        }\r
+\r
+        img, object {\r
+            /* background-color: #EBF; */\r
+            border: 2px dashed maroon;\r
+            height: 50px;\r
+            left: 100px;\r
+            overflow: visible;\r
+            padding: 3px;\r
+            top: 20px;\r
+            width: 200px;\r
+            box-sizing: border-box;\r
+        }\r
+\r
+        object {\r
+            border-color: green;\r
+            border-width: 1px;\r
+        }\r
+    </style>\r
+</head>\r
+<body>\r
+    <table>\r
+        <tr>\r
+            <th>\r
+                viewBox?\r
+            </th>\r
+            <th>\r
+                preserve&shy;Aspect&shy;Ratio\r
+            </th>\r
+            <th>\r
+                &lt;img&gt;\r
+            </th>\r
+            <th>\r
+                &lt;object&gt;\r
+            </th>\r
+        </tr>\r
+        <tr>\r
+            <th rowspan=4>\r
+                No viewBox\r
+            </th>\r
+            <th>\r
+            </th>\r
+            <td>\r
+                <img src="resources/circle-default-default.svg" />\r
+            </td>\r
+            <td>\r
+                <object data="resources/circle-default-default.svg"></object>\r
+            </td>\r
+        </tr>\r
+        <tr>\r
+            <th>\r
+                none\r
+            </th>\r
+            <td>\r
+                <img src="resources/circle-default-none.svg" />\r
+            </td>\r
+            <td>\r
+                <object data="resources/circle-default-none.svg"></object>\r
+            </td>\r
+        </tr>\r
+        <tr>\r
+            <th>\r
+                meet\r
+            </th>\r
+            <td>\r
+                <img src="resources/circle-default-meet.svg" />\r
+            </td>\r
+            <td>\r
+                <object data="resources/circle-default-meet.svg"></object>\r
+            </td>\r
+        </tr>\r
+        <tr>\r
+            <th>\r
+                slice\r
+            </th>\r
+            <td>\r
+                <img src="resources/circle-default-slice.svg" />\r
+            </td>\r
+            <td>\r
+                <object data="resources/circle-default-slice.svg"></object>\r
+            </td>\r
+        </tr>\r
+        <tr>\r
+            <th rowspan=4>\r
+                viewBox\r
+            </th>\r
+            <th>\r
+            </th>\r
+            <td>\r
+                <img src="resources/circle-viewbox-default.svg" />\r
+            </td>\r
+            <td>\r
+                <object data="resources/circle-viewbox-default.svg"></object>\r
+            </td>\r
+        </tr>\r
+        <tr>\r
+            <th>\r
+                none\r
+            </th>\r
+            <td>\r
+                <img src="resources/circle-viewbox-none.svg" />\r
+            </td>\r
+            <td>\r
+                <object data="resources/circle-viewbox-none.svg"></object>\r
+            </td>\r
+        </tr>\r
+        <tr>\r
+            <th>\r
+                meet\r
+            </th>\r
+            <td>\r
+                <img src="resources/circle-viewbox-meet.svg" />\r
+            </td>\r
+            <td>\r
+                <object data="resources/circle-viewbox-meet.svg"></object>\r
+            </td>\r
+        </tr>\r
+        <tr>\r
+            <th>\r
+                slice\r
+            </th>\r
+            <td>\r
+                <img src="resources/circle-viewbox-slice.svg" />\r
+            </td>\r
+            <td>\r
+                <object data="resources/circle-viewbox-slice.svg"></object>\r
+            </td>\r
+        </tr>\r
+    </table>\r
+</body>\r
+</html>\r
diff --git a/LayoutTests/svg/as-image/resources/circle-default-meet.svg b/LayoutTests/svg/as-image/resources/circle-default-meet.svg
new file mode 100644 (file)
index 0000000..4a13119
--- /dev/null
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   preserveAspectRatio="xMidYMid meet"
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="363.85715"
+   height="363.85715"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.46"
+   version="1.0"
+   sodipodi:docname="circle.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape">
+  <defs
+     id="defs4">
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 526.18109 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="744.09448 : 526.18109 : 1"
+       inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+       id="perspective10" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     gridtolerance="10000"
+     guidetolerance="10"
+     objecttolerance="10"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="0.35"
+     inkscape:cx="-199.28571"
+     inkscape:cy="497.14286"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     inkscape:window-width="1123"
+     inkscape:window-height="839"
+     inkscape:window-x="0"
+     inkscape:window-y="48" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(-162.35713,-403.29073)">
+    <path
+       sodipodi:type="arc"
+       style="fill:#d9bb7a;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       id="path2387"
+       sodipodi:cx="344.28571"
+       sodipodi:cy="585.2193"
+       sodipodi:rx="181.42857"
+       sodipodi:ry="181.42857"
+       d="M 525.71428,585.2193 A 181.42857,181.42857 0 1 1 162.85713,585.2193 A 181.42857,181.42857 0 1 1 525.71428,585.2193 z" />
+  </g>
+</svg>
diff --git a/LayoutTests/svg/as-image/resources/circle-default-none.svg b/LayoutTests/svg/as-image/resources/circle-default-none.svg
new file mode 100644 (file)
index 0000000..9a7bc75
--- /dev/null
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   preserveAspectRatio="none"
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="363.85715"
+   height="363.85715"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.46"
+   version="1.0"
+   sodipodi:docname="circle.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape">
+  <defs
+     id="defs4">
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 526.18109 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="744.09448 : 526.18109 : 1"
+       inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+       id="perspective10" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     gridtolerance="10000"
+     guidetolerance="10"
+     objecttolerance="10"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="0.35"
+     inkscape:cx="-199.28571"
+     inkscape:cy="497.14286"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     inkscape:window-width="1123"
+     inkscape:window-height="839"
+     inkscape:window-x="0"
+     inkscape:window-y="48" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(-162.35713,-403.29073)">
+    <path
+       sodipodi:type="arc"
+       style="fill:#d9bb7a;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       id="path2387"
+       sodipodi:cx="344.28571"
+       sodipodi:cy="585.2193"
+       sodipodi:rx="181.42857"
+       sodipodi:ry="181.42857"
+       d="M 525.71428,585.2193 A 181.42857,181.42857 0 1 1 162.85713,585.2193 A 181.42857,181.42857 0 1 1 525.71428,585.2193 z" />
+  </g>
+</svg>
diff --git a/LayoutTests/svg/as-image/resources/circle-default-slice.svg b/LayoutTests/svg/as-image/resources/circle-default-slice.svg
new file mode 100644 (file)
index 0000000..d75f34b
--- /dev/null
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   preserveAspectRatio="xMidYMid slice"
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="363.85715"
+   height="363.85715"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.46"
+   version="1.0"
+   sodipodi:docname="circle.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape">
+  <defs
+     id="defs4">
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 526.18109 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="744.09448 : 526.18109 : 1"
+       inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+       id="perspective10" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     gridtolerance="10000"
+     guidetolerance="10"
+     objecttolerance="10"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="0.35"
+     inkscape:cx="-199.28571"
+     inkscape:cy="497.14286"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     inkscape:window-width="1123"
+     inkscape:window-height="839"
+     inkscape:window-x="0"
+     inkscape:window-y="48" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(-162.35713,-403.29073)">
+    <path
+       sodipodi:type="arc"
+       style="fill:#d9bb7a;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       id="path2387"
+       sodipodi:cx="344.28571"
+       sodipodi:cy="585.2193"
+       sodipodi:rx="181.42857"
+       sodipodi:ry="181.42857"
+       d="M 525.71428,585.2193 A 181.42857,181.42857 0 1 1 162.85713,585.2193 A 181.42857,181.42857 0 1 1 525.71428,585.2193 z" />
+  </g>
+</svg>
diff --git a/LayoutTests/svg/as-image/resources/circle-nosize.svg b/LayoutTests/svg/as-image/resources/circle-nosize.svg
new file mode 100644 (file)
index 0000000..dd342c9
--- /dev/null
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.46"
+   version="1.0"
+   sodipodi:docname="circle.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape">
+  <defs
+     id="defs4">
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 526.18109 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="744.09448 : 526.18109 : 1"
+       inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+       id="perspective10" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     gridtolerance="10000"
+     guidetolerance="10"
+     objecttolerance="10"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="0.35"
+     inkscape:cx="-199.28571"
+     inkscape:cy="497.14286"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     inkscape:window-width="1123"
+     inkscape:window-height="839"
+     inkscape:window-x="0"
+     inkscape:window-y="48" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(-162.35713,-403.29073)">
+    <path
+       sodipodi:type="arc"
+       style="fill:#d9bb7a;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       id="path2387"
+       sodipodi:cx="344.28571"
+       sodipodi:cy="585.2193"
+       sodipodi:rx="181.42857"
+       sodipodi:ry="181.42857"
+       d="M 525.71428,585.2193 A 181.42857,181.42857 0 1 1 162.85713,585.2193 A 181.42857,181.42857 0 1 1 525.71428,585.2193 z" />
+  </g>
+</svg>
diff --git a/LayoutTests/svg/as-image/resources/circle-viewbox-default.svg b/LayoutTests/svg/as-image/resources/circle-viewbox-default.svg
new file mode 100644 (file)
index 0000000..4cd7e56
--- /dev/null
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   viewBox="0 0 500 500"
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="363.85715"
+   height="363.85715"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.46"
+   version="1.0"
+   sodipodi:docname="circle.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape">
+  <defs
+     id="defs4">
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 526.18109 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="744.09448 : 526.18109 : 1"
+       inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+       id="perspective10" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     gridtolerance="10000"
+     guidetolerance="10"
+     objecttolerance="10"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="0.35"
+     inkscape:cx="-199.28571"
+     inkscape:cy="497.14286"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     inkscape:window-width="1123"
+     inkscape:window-height="839"
+     inkscape:window-x="0"
+     inkscape:window-y="48" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(-162.35713,-403.29073)">
+    <path
+       sodipodi:type="arc"
+       style="fill:#d9bb7a;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       id="path2387"
+       sodipodi:cx="344.28571"
+       sodipodi:cy="585.2193"
+       sodipodi:rx="181.42857"
+       sodipodi:ry="181.42857"
+       d="M 525.71428,585.2193 A 181.42857,181.42857 0 1 1 162.85713,585.2193 A 181.42857,181.42857 0 1 1 525.71428,585.2193 z" />
+  </g>
+</svg>
diff --git a/LayoutTests/svg/as-image/resources/circle-viewbox-meet.svg b/LayoutTests/svg/as-image/resources/circle-viewbox-meet.svg
new file mode 100644 (file)
index 0000000..e3c46d3
--- /dev/null
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   viewBox="0 0 500 500"
+   preserveAspectRatio="xMidYMid meet"
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="363.85715"
+   height="363.85715"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.46"
+   version="1.0"
+   sodipodi:docname="circle.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape">
+  <defs
+     id="defs4">
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 526.18109 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="744.09448 : 526.18109 : 1"
+       inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+       id="perspective10" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     gridtolerance="10000"
+     guidetolerance="10"
+     objecttolerance="10"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="0.35"
+     inkscape:cx="-199.28571"
+     inkscape:cy="497.14286"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     inkscape:window-width="1123"
+     inkscape:window-height="839"
+     inkscape:window-x="0"
+     inkscape:window-y="48" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(-162.35713,-403.29073)">
+    <path
+       sodipodi:type="arc"
+       style="fill:#d9bb7a;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       id="path2387"
+       sodipodi:cx="344.28571"
+       sodipodi:cy="585.2193"
+       sodipodi:rx="181.42857"
+       sodipodi:ry="181.42857"
+       d="M 525.71428,585.2193 A 181.42857,181.42857 0 1 1 162.85713,585.2193 A 181.42857,181.42857 0 1 1 525.71428,585.2193 z" />
+  </g>
+</svg>
diff --git a/LayoutTests/svg/as-image/resources/circle-viewbox-none.svg b/LayoutTests/svg/as-image/resources/circle-viewbox-none.svg
new file mode 100644 (file)
index 0000000..9182f40
--- /dev/null
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   viewBox="0 0 500 500"
+   preserveAspectRatio="none"
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="363.85715"
+   height="363.85715"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.46"
+   version="1.0"
+   sodipodi:docname="circle.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape">
+  <defs
+     id="defs4">
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 526.18109 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="744.09448 : 526.18109 : 1"
+       inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+       id="perspective10" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     gridtolerance="10000"
+     guidetolerance="10"
+     objecttolerance="10"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="0.35"
+     inkscape:cx="-199.28571"
+     inkscape:cy="497.14286"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     inkscape:window-width="1123"
+     inkscape:window-height="839"
+     inkscape:window-x="0"
+     inkscape:window-y="48" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(-162.35713,-403.29073)">
+    <path
+       sodipodi:type="arc"
+       style="fill:#d9bb7a;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       id="path2387"
+       sodipodi:cx="344.28571"
+       sodipodi:cy="585.2193"
+       sodipodi:rx="181.42857"
+       sodipodi:ry="181.42857"
+       d="M 525.71428,585.2193 A 181.42857,181.42857 0 1 1 162.85713,585.2193 A 181.42857,181.42857 0 1 1 525.71428,585.2193 z" />
+  </g>
+</svg>
diff --git a/LayoutTests/svg/as-image/resources/circle-viewbox-slice.svg b/LayoutTests/svg/as-image/resources/circle-viewbox-slice.svg
new file mode 100644 (file)
index 0000000..9b41798
--- /dev/null
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   viewBox="0 0 500 500"
+   preserveAspectRatio="xMidYMid slice"
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="363.85715"
+   height="363.85715"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.46"
+   version="1.0"
+   sodipodi:docname="circle.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape">
+  <defs
+     id="defs4">
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 526.18109 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="744.09448 : 526.18109 : 1"
+       inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+       id="perspective10" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     gridtolerance="10000"
+     guidetolerance="10"
+     objecttolerance="10"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="0.35"
+     inkscape:cx="-199.28571"
+     inkscape:cy="497.14286"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     inkscape:window-width="1123"
+     inkscape:window-height="839"
+     inkscape:window-x="0"
+     inkscape:window-y="48" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(-162.35713,-403.29073)">
+    <path
+       sodipodi:type="arc"
+       style="fill:#d9bb7a;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       id="path2387"
+       sodipodi:cx="344.28571"
+       sodipodi:cy="585.2193"
+       sodipodi:rx="181.42857"
+       sodipodi:ry="181.42857"
+       d="M 525.71428,585.2193 A 181.42857,181.42857 0 1 1 162.85713,585.2193 A 181.42857,181.42857 0 1 1 525.71428,585.2193 z" />
+  </g>
+</svg>
index 9eec19d..3ccdc4c 100644 (file)
@@ -1,3 +1,4 @@
 <svg xmlns="http://www.w3.org/2000/svg" width='100%' height='100%'>
-    <rect fill='green' width='100px' height='100px' />
+    <rect fill='green' width='100%' height='100%' />
+    <circle cx="50%" cy="50%" r="10%" fill="navy"/>
 </svg>
diff --git a/LayoutTests/svg/as-image/same-image-two-instances.html b/LayoutTests/svg/as-image/same-image-two-instances.html
new file mode 100644 (file)
index 0000000..6d981ab
--- /dev/null
@@ -0,0 +1,23 @@
+<!DOCTYPE html>\r
+<html>\r
+<head>\r
+    <style>\r
+        img {\r
+            /* background-color: #EBF; */\r
+            border: 2px dashed maroon;\r
+            height: 50px;\r
+            left: 100px;\r
+            overflow: visible;\r
+            padding: 3px;\r
+            top: 20px;\r
+            width: 200px;\r
+            box-sizing: border-box;\r
+        }\r
+    </style>\r
+</head>\r
+<body>\r
+    <!-- None of these images must look distorted -->\r
+    <img src="resources/circle-default-default.svg" />\r
+    <img style="width: 100px; height: 100px" src="resources/circle-default-default.svg"/>\r
+</body>\r
+</html>\r
diff --git a/LayoutTests/svg/as-image/svg-as-relative-image-with-explicit-size.html b/LayoutTests/svg/as-image/svg-as-relative-image-with-explicit-size.html
new file mode 100644 (file)
index 0000000..2277580
--- /dev/null
@@ -0,0 +1,16 @@
+<html>
+<head>
+<style>
+img, div {
+  background: red;
+  height: 100px;
+  width: 100px;
+}
+</style>
+</head>
+<body style='margin: 0px'>
+<div>
+  <img src='resources/green-relative-size-rect.svg'>
+</div>
+</body>
+</html>
diff --git a/LayoutTests/svg/as-image/svg-image-change-content-size.xhtml b/LayoutTests/svg/as-image/svg-image-change-content-size.xhtml
new file mode 100644 (file)
index 0000000..91213b6
--- /dev/null
@@ -0,0 +1,38 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<style>
+    img, div {
+        width: 420px;
+        height: 420px;
+    }
+    div {
+        border: red 1px solid;
+    }
+</style>
+</head>
+<body>
+    <p>The svg image contained in the div element (red box) should not change its appearance when width is resized to be larger</p>
+    <div id="contentBox" onclick="resizeBox()">
+        <img src="../as-background-image/resources/butterfly.svg"/>
+    </div>
+
+    <script type="JavaScript">
+        if (window.layoutTestController)
+            layoutTestController.waitUntilDone();
+
+        if (window.eventSender) {
+            window.setTimeout(function() {
+                eventSender.mouseMoveTo(50, 250);
+                eventSender.mouseDown();
+                eventSender.mouseUp();
+            }, 0);
+        }
+
+        function resizeBox() {
+            document.getElementById("contentBox").style.setProperty("width", "600px");
+            if (window.layoutTestController)
+                layoutTestController.notifyDone();
+        }
+    </script>
+</body>
+</html>
diff --git a/LayoutTests/svg/zoom/page/resources/relative-sized-background-with-viewBox.svg b/LayoutTests/svg/zoom/page/resources/relative-sized-background-with-viewBox.svg
new file mode 100644 (file)
index 0000000..a116964
--- /dev/null
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<svg viewBox="0 0 500 500" xmlns="http://www.w3.org/2000/svg">
+    <rect x="10" y="10" width="478" height="478" rx="5" ry="5" fill="none" stroke="grey" stroke-width="2"/>
+</svg>
diff --git a/LayoutTests/svg/zoom/page/zoom-background-image-tiled.html b/LayoutTests/svg/zoom/page/zoom-background-image-tiled.html
new file mode 100644 (file)
index 0000000..5dd69ea
--- /dev/null
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+    <title>SVG background-image tiling</title>
+    <style>
+        div{
+            border: 1px solid #ccc;
+            width: 100%;
+            height: 100px;
+            background-image:url('../../as-background-image/resources/construction-tape.svg');
+            background-size: 100px 100%;
+        }
+    </style>
+</head>
+
+<body>
+<div></div>
+
+<script>var zoomCount = 4; window.shouldZoomOut = false;</script>
+<script src="../resources/testPageZoom.js"></script>
+
+</body>
+</html>
diff --git a/LayoutTests/svg/zoom/page/zoom-background-images.html b/LayoutTests/svg/zoom/page/zoom-background-images.html
new file mode 100644 (file)
index 0000000..d6fad8a
--- /dev/null
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <style>
+        img, div {
+            display: inline-block;
+            margin: 20px 20px;
+            border: 2px solid black;
+            width: 220px;
+            height: 220px;
+        }
+
+        .png {
+            background-image: url(../../custom/resources/green-checker.png);
+            background-repeat: no-repeat;
+            background-position: center;
+        }
+
+        .svg {
+            background-image: url(resources/circle.svg);
+        }
+
+        .gradient {
+                       background-image: -webkit-repeating-radial-gradient(top left, red, blue 20px, red 40px);
+        }
+    </style>
+</head>
+
+<body>
+<div class="png"></div>
+<div class="svg"></div>
+<div class="gradient"></div>
+<img src="resources/circle.svg"></img>
+<img src="../../custom/resources/green-checker.png"></img>
+
+<script>var zoomCount = 5; window.shouldZoomOut = true;</script>
+<script src="../resources/testPageZoom.js"></script>
+
+</body>
+</html>
diff --git a/LayoutTests/svg/zoom/page/zoom-img-preserveAspectRatio-support-1.html b/LayoutTests/svg/zoom/page/zoom-img-preserveAspectRatio-support-1.html
new file mode 100644 (file)
index 0000000..7a9c45f
--- /dev/null
@@ -0,0 +1,142 @@
+<!DOCTYPE html>\r
+<html>\r
+<head>\r
+    <title>preserveAspectRatio test 1/2</title>\r
+    <style>\r
+        th {\r
+            background-color: #dd9;\r
+            font-family: sans-serif;\r
+        }\r
+\r
+        img, object {\r
+            /* background-color: #EBF; */\r
+            border: 2px dashed maroon;\r
+            height: 50px;\r
+            left: 100px;\r
+            overflow: visible;\r
+            padding: 3px;\r
+            top: 20px;\r
+            width: 200px;\r
+            box-sizing: border-box;\r
+        }\r
+\r
+        object {\r
+            border-color: green;\r
+            border-width: 1px;\r
+        }\r
+    </style>\r
+</head>\r
+<body>\r
+    <table>\r
+        <tr>\r
+            <th>\r
+                viewBox?\r
+            </th>\r
+            <th>\r
+                preserve&shy;Aspect&shy;Ratio\r
+            </th>\r
+            <th>\r
+                &lt;img&gt;\r
+            </th>\r
+            <th>\r
+                &lt;object&gt;\r
+            </th>\r
+        </tr>\r
+        <tr>\r
+            <th rowspan=4>\r
+                No viewBox\r
+            </th>\r
+            <th>\r
+            </th>\r
+            <td>\r
+                <img src="../../as-image/resources/circle-default-default.svg" />\r
+            </td>\r
+            <td>\r
+                <object data="../../as-image/resources/circle-default-default.svg"></object>\r
+            </td>\r
+        </tr>\r
+        <tr>\r
+            <th>\r
+                none\r
+            </th>\r
+            <td>\r
+                <img src="../../as-image/resources/circle-default-none.svg" />\r
+            </td>\r
+            <td>\r
+                <object data="../../as-image/resources/circle-default-none.svg"></object>\r
+            </td>\r
+        </tr>\r
+        <tr>\r
+            <th>\r
+                meet\r
+            </th>\r
+            <td>\r
+                <img src="../../as-image/resources/circle-default-meet.svg" />\r
+            </td>\r
+            <td>\r
+                <object data="../../as-image/resources/circle-default-meet.svg"></object>\r
+            </td>\r
+        </tr>\r
+        <tr>\r
+            <th>\r
+                slice\r
+            </th>\r
+            <td>\r
+                <img src="../../as-image/resources/circle-default-slice.svg" />\r
+            </td>\r
+            <td>\r
+                <object data="../../as-image/resources/circle-default-slice.svg"></object>\r
+            </td>\r
+        </tr>\r
+        <tr>\r
+            <th rowspan=4>\r
+                viewBox\r
+            </th>\r
+            <th>\r
+            </th>\r
+            <td>\r
+                <img src="../../as-image/resources/circle-viewbox-default.svg" />\r
+            </td>\r
+            <td>\r
+                <object data="../../as-image/resources/circle-viewbox-default.svg"></object>\r
+            </td>\r
+        </tr>\r
+        <tr>\r
+            <th>\r
+                none\r
+            </th>\r
+            <td>\r
+                <img src="../../as-image/resources/circle-viewbox-none.svg" />\r
+            </td>\r
+            <td>\r
+                <object data="../../as-image/resources/circle-viewbox-none.svg"></object>\r
+            </td>\r
+        </tr>\r
+        <tr>\r
+            <th>\r
+                meet\r
+            </th>\r
+            <td>\r
+                <img src="../../as-image/resources/circle-viewbox-meet.svg" />\r
+            </td>\r
+            <td>\r
+                <object data="../../as-image/resources/circle-viewbox-meet.svg"></object>\r
+            </td>\r
+        </tr>\r
+        <tr>\r
+            <th>\r
+                slice\r
+            </th>\r
+            <td>\r
+                <img src="../../as-image/resources/circle-viewbox-slice.svg" />\r
+            </td>\r
+            <td>\r
+                <object data="../../as-image/resources/circle-viewbox-slice.svg"></object>\r
+            </td>\r
+        </tr>\r
+    </table>\r
+\r
+    <script>var zoomCount = 2; window.shouldZoomOut = true;</script>\r
+    <script src="../resources/testPageZoom.js"></script>\r
+</body>\r
+</html>\r
diff --git a/LayoutTests/svg/zoom/page/zoom-svg-as-background-with-relative-size-and-viewBox.html b/LayoutTests/svg/zoom/page/zoom-svg-as-background-with-relative-size-and-viewBox.html
new file mode 100644 (file)
index 0000000..621133f
--- /dev/null
@@ -0,0 +1,20 @@
+<html>
+<head>
+<style>
+div {
+  background: green;
+  background-repeat: no-repeat;
+  background-image: url(resources/relative-sized-background-with-viewBox.svg);
+  height: 600px;
+  width: 800px;
+}
+</style>
+</head>
+<!-- The background shouldn't be red in a debug build -->
+<body style='margin: 0px'>
+<div>&nbsp;</div>
+
+<script>var zoomCount = 1; window.shouldZoomOut = true;</script>
+<script src="../resources/testPageZoom.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/svg/zoom/page/zoom-svg-as-background-with-relative-size.html b/LayoutTests/svg/zoom/page/zoom-svg-as-background-with-relative-size.html
new file mode 100644 (file)
index 0000000..f6c3cee
--- /dev/null
@@ -0,0 +1,20 @@
+<html>
+<head>
+<style>
+div {
+  background: green;
+  background-repeat: no-repeat;
+  background-image: url(../../as-background-image/resources/svg-as-background-with-relative-size.svg);
+  height: 500px;
+  width: 500px;
+}
+</style>
+</head>
+<!-- The background shouldn't be red in a debug build -->
+<body style='margin: 0px'>
+<div>&nbsp;</div>
+
+<script>var zoomCount = 4; window.shouldZoomOut = true;</script>
+<script src="../resources/testPageZoom.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/svg/zoom/page/zoom-svg-as-image.html b/LayoutTests/svg/zoom/page/zoom-svg-as-image.html
new file mode 100644 (file)
index 0000000..efe8057
--- /dev/null
@@ -0,0 +1,20 @@
+<html>
+<head>
+<style>
+div {
+  background: red;
+  height: 100px;
+  width: 100px;
+}
+</style>
+</head>
+<body style='margin: 0px'>
+<div>
+  <img src='../../as-image/resources/green-fixed-size-rect.svg'>
+</div>
+
+<script>var zoomCount = 4; window.shouldZoomIn = true;</script>
+<script src="../resources/testPageZoom.js"></script>
+
+</body>
+</html>
diff --git a/LayoutTests/svg/zoom/page/zoom-svg-as-relative-image.html b/LayoutTests/svg/zoom/page/zoom-svg-as-relative-image.html
new file mode 100644 (file)
index 0000000..e9be6fa
--- /dev/null
@@ -0,0 +1,20 @@
+<html>
+<head>
+<style>
+div {
+  background: red;
+  height: 100px;
+  width: 100px;
+}
+</style>
+</head>
+<body style='margin: 0px'>
+<div>
+  <img src='../../as-image/resources/green-relative-size-rect.svg'>
+</div>
+
+<script>var zoomCount = 1; window.shouldZoomOut = true;</script>
+<script src="../resources/testPageZoom.js"></script>
+
+</body>
+</html>
index acc95d4..d7ae954 100644 (file)
@@ -1,3 +1,142 @@
+2011-10-31  Nikolas Zimmermann  <nzimmermann@rim.com>
+
+        CSS 2.1 failure: background-intrinsic-*
+        https://bugs.webkit.org/show_bug.cgi?id=47156
+
+        SVGs do not work as tiled background images
+        https://bugs.webkit.org/show_bug.cgi?id=16281
+
+        Apply preserveAspectRatio and synthesize viewboxes in <img>
+        https://bugs.webkit.org/show_bug.cgi?id=34521
+
+        SVG background doesn't resize properly when dimensions are changed
+        https://bugs.webkit.org/show_bug.cgi?id=42944
+
+        Images with percent height inside a floated div should use intrinsic height.
+        https://bugs.webkit.org/show_bug.cgi?id=45439
+
+        SVG image in HTML changes size as the window is resized
+        https://bugs.webkit.org/show_bug.cgi?id=52045
+
+        Reviewed by Antti Koivisto.
+
+        Implement intrinsic sizing support for SVGImage (svg embedded through <html:img>/<svg:image>/background-image/border-image/...).
+        This is demanded by CSS 2.1, and covered by new layout tests in LayoutTests/css2.1 and several new custom testcases.
+
+        Tests: css2.1/20110323/background-intrinsic-001.htm
+               css2.1/20110323/background-intrinsic-002.htm
+               css2.1/20110323/background-intrinsic-003.htm
+               css2.1/20110323/background-intrinsic-004.htm
+               css2.1/20110323/background-intrinsic-005.htm
+               css2.1/20110323/background-intrinsic-006.htm
+               css2.1/20110323/background-intrinsic-007.htm
+               css2.1/20110323/background-intrinsic-008.htm
+               css2.1/20110323/background-intrinsic-009.htm
+               svg/as-background-image/background-image-preserveaspectRatio-support.html (adapted from testcase from bug 34521)
+               svg/as-background-image/background-image-tiled.html (reduction from bug 16281)
+               svg/as-background-image/same-image-two-instances-background-image.html
+               svg/as-image/img-preserveAspectRatio-support-1.html (reduction from bug 34521)
+               svg/as-image/same-image-two-instances.html
+               svg/as-image/svg-as-relative-image-with-explicit-size.html
+               svg/as-image/svg-image-change-content-size.xhtml (reduction from bug 42944)
+               svg/zoom/page/zoom-img-preserveAspectRatio-support-1.html
+               svg/zoom/page/zoom-svg-as-image.html
+               svg/zoom/page/zoom-svg-as-relative-image.html
+
+        * css/CSSImageGeneratorValue.cpp:
+        (WebCore::CSSImageGeneratorValue::addClient): Pass default zoom factor.
+        (WebCore::CSSImageGeneratorValue::getImage): Ditto.
+        * loader/cache/CachedImage.cpp: Enable SVGImage <-> IntSize cache.
+        (WebCore::CachedImage::lookupImageForSize): Use recently introduced ImageBySizeCache, to lookup an image for a certain size.
+        (WebCore::CachedImage::lookupOrCreateImageForRenderer): Use recently introduced ImageBySizeCache, to dynamically create copies of m_image if needed.
+        (WebCore::CachedImage::imageForRenderer): Lookup image by renderer, which first looks up a size for a renderer, then uses lookupImageForSize().
+        (WebCore::CachedImage::setContainerSizeForRenderer): For SVGImages, pass on container size handling to ImageBySizeCache.
+        (WebCore::CachedImage::imageSizeForRenderer): Figure out the image size, respecting per-renderer overrides, for a certain renderer.
+        (WebCore::CachedImage::computeIntrinsicDimensions): Remove unnecessary RenderObject parameter.
+        * loader/cache/CachedImage.h:
+        * page/ChromeClient.h:
+        (WebCore::ChromeClient::isSVGImageChromeClient): Used to identify whether a RenderSVGRoot is embedded through a SVGImage. Returns false, by default.
+        * platform/graphics/Image.h:
+        (WebCore::Image::setImageObserver): Add helper.
+        * rendering/ImageBySizeCache.cpp: Cleanup code.
+        (WebCore::ImageBySizeCache::addClient): Assert the passed renderer is valid.
+        (WebCore::ImageBySizeCache::removeClient): Ditto. Allow removeClient() to be called w/o prio addClient() usage.
+        (WebCore::ImageBySizeCache::getImage): Add zoom parameter.
+        (WebCore::ImageBySizeCache::getRequestedSizeAndZoom): Add way to get requested size from cache, instead of actual cached sizes.
+        (WebCore::ImageBySizeCache::imageForSize): Respect empty sizes, just return 0, instead of asserting.
+        (WebCore::ImageBySizeCache::imageForRenderer): Added a helper that retrieves an image for a renderer, by lookup up its size and using imageForSize().
+        * rendering/ImageBySizeCache.h: Cleaup code, introduce struct that replaces the std::pair<IntSize, int>.
+        (WebCore::SizeZoomAndCount::SizeZoomAndCount):
+        * rendering/RenderBoxModelObject.cpp: Implement CSS 2.1 intrinsic size negotiation for images.
+        (WebCore::resolveWidthForRatio): New inline helper function used by calculateImageIntrinsicDimensions.
+        (WebCore::resolveHeightForRatio): Ditto.
+        (WebCore::resolveAgainstIntrinsicWidthOrHeightAndRatio): Ditto.
+        (WebCore::resolveAgainstIntrinsicRatio):  Ditto.
+        (WebCore::RenderBoxModelObject::calculateImageIntrinsicDimensions): New helper function, containing the main algorithm, which is a pure transcription of the spec.
+        (WebCore::RenderBoxModelObject::calculateFillTileSize): Use new calculateImageIntrinsicDimensions() helper to figure out the intrinsic size.
+        (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry): Propagate calculateFillTileSize() result to the image resource, via setContainerSizeForRenderer().
+        (WebCore::RenderBoxModelObject::paintNinePieceImage): Use new calculateImageIntrinsicDimensions() helper to figure out the intrinsic size.
+        * rendering/RenderBoxModelObject.h: Clarify some variable names, added calculateImageIntrinsicDimensions().
+        * rendering/RenderImage.cpp:
+        (WebCore::RenderImage::RenderImage): Use IntSize(), instead of IntSize(0, 0).
+        (WebCore::RenderImage::updateIntrinsicSizeIfNeeded): Refactored from imageDimensionsChanged().
+        (WebCore::RenderImage::imageDimensionsChanged): Use updateIntrinsicSizeIfNeeded().
+        (WebCore::RenderImage::computeReplacedLogicalWidth): Use RenderReplaced::computeReplacedLogicalWidth() exclusively. For this to work, the intrinsic size must be correct.
+        (WebCore::RenderImage::computeIntrinsicRatioInformation): Default implementation for non-SVGImages.
+        (WebCore::RenderImage::needsPreferredWidthsRecalculation): Return true, just like RenderPart, if embeddedContentBox is not null.
+        (WebCore::RenderImage::embeddedContentBox): Returns the RenderSVGRoot* renderer of the embedded SVG, if possible.
+        * rendering/RenderImage.h: Remove isLogicalWidth/HeightSpecified() / computeReplacedLogicalHeight() / calcAspectRatioLogicalWidth/Height().
+        * rendering/RenderImageResource.cpp:
+        (WebCore::RenderImageResource::setContainerSizeForRenderer): Pass around new "float containerZoomFactor" parameter.
+        * rendering/RenderImageResourceStyleImage.cpp:
+        (WebCore::RenderImageResourceStyleImage::image): embeddedContentBox() is now calling image() earlier than before. We now have to handle the case that the image is pending.
+        (WebCore::RenderImageResourceStyleImage::setContainerSizeForRenderer): Pass zoom factor.
+        * rendering/RenderImageResourceStyleImage.h:
+        * rendering/RenderListMarker.cpp:
+        (WebCore::RenderListMarker::computePreferredLogicalWidths): Pass effective zoom to setContainerSizeForRenderer().
+        * rendering/RenderReplaced.cpp:
+        (WebCore::RenderReplaced::computeIntrinsicLogicalWidth): Generalized this code, as RenderImage is using it as well now. Marginal changes needed.
+        (WebCore::RenderReplaced::computeIntrinsicLogicalHeight): Ditto.
+        (WebCore::RenderReplaced::computeReplacedLogicalWidth): Ditto.
+        * rendering/style/StyleCachedImage.cpp:
+        (WebCore::StyleCachedImage::computeIntrinsicDimensions): Stop passing m_renderer to CachedImage, it's no longer needed.
+        (WebCore::StyleCachedImage::setContainerSizeForRenderer): Add "float containerZoomFactor" parameter.
+        * rendering/style/StyleCachedImage.h: Add "float containerZoomFactor" parameter to setContainerSizeForRenderer.
+        * rendering/style/StyleGeneratedImage.h:
+        (WebCore::StyleGeneratedImage::setContainerSizeForRenderer): Ditto.
+        * rendering/style/StyleImage.h: Ditto.
+        * rendering/style/StylePendingImage.h:
+        (WebCore::StylePendingImage::setContainerSizeForRenderer): Ditto.
+        * rendering/svg/RenderSVGImage.cpp:
+        (WebCore::RenderSVGImage::layout): Always supply a container size when embedding SVGs in <svg:image>.
+        * rendering/svg/RenderSVGRoot.cpp: Move "override container size" from SVGSVGElement into RenderSVGRoot, where it belongs.
+        (WebCore::RenderSVGRoot::isEmbeddedThroughImageElement): Add helper method to determine whether we're loaded through SVGImage.
+        (WebCore::RenderSVGRoot::computeReplacedLogicalWidth): If we have a valid container size, it has precendence (only supplied via external SVGImages).
+        (WebCore::RenderSVGRoot::computeReplacedLogicalHeight): Ditto.
+        (WebCore::RenderSVGRoot::layout): Remove calcViewport() usage, no need to track/override the viewport size anymore, all done in coputeReplacedLogical* now.
+        (WebCore::RenderSVGRoot::paint): Use borderBoxRect() which now always matches the previously computed m_viewportSize. 
+        (WebCore::RenderSVGRoot::computeRectForRepaint): Ditto.
+        * rendering/svg/RenderSVGRoot.h: Move "override container size" from SVGSVGElement into RenderSVGRoot, where it belongs.
+        (WebCore::RenderSVGRoot::containerSize):
+        (WebCore::RenderSVGRoot::setContainerSize):
+        * svg/SVGLength.cpp:
+        (WebCore::SVGLength::determineViewport): Resolve lengths against override container size in documents embedded through SVGImage.
+        * svg/SVGSVGElement.cpp: Remove "override container size" handling from SVGSVGElement.
+        (WebCore::SVGSVGElement::SVGSVGElement): Ditto.
+        (WebCore::SVGSVGElement::currentViewBoxRect): Always synthesize a viewBox, if we're embedded through SVGImage, as demanded by SVG 1.1 2nd Edition.
+        * svg/SVGSVGElement.h:
+        * svg/graphics/SVGImage.cpp:
+        (WebCore::SVGImageChromeClient::isSVGImageChromeClient): Return true, used to identify whether RenderSVGRoot is embedded through SVGImage.
+        (WebCore::SVGImage::createWithDataAndSize): Add new helper function.
+        (WebCore::SVGImage::setContainerZoom): Forwarded to Page::setPageZoomFactor.
+        (WebCore::SVGImage::setContainerSize): Assert that container size is not empty. We should never receive an empty container size.
+        (WebCore::SVGImage::usesContainerSize): Adapt to override container size changes, it now lives in RenderSVGRoot instead of SVGSVGElement.
+        (WebCore::SVGImage::size): New algorithm to figure out the size of an embedded SVG, as demanded by the CSS/SVG specs.
+        (WebCore::SVGImage::embeddedContentBox): Add helper which returns the RenderSVGRoot of the document.
+        (WebCore::SVGImage::computeIntrinsicDimensions): Implement intrinsic ratio calculation. 
+        (WebCore::SVGImage::dataChanged): Force calling FrameView::setCanHaveScrollbars(false), as SVG images now always synthesize a viewBox, and thus never receive scrollbars.
+        * svg/graphics/SVGImage.h:
+
 2011-10-31  Yury Semikhatsky  <yurys@chromium.org>
 
         Unreviewed. Add ResourcePreviewView.js to the list of inspector front-end
index 48fdeb7..4ef44f0 100644 (file)
@@ -47,7 +47,7 @@ CSSImageGeneratorValue::~CSSImageGeneratorValue()
 void CSSImageGeneratorValue::addClient(RenderObject* renderer, const IntSize& size)
 {
     ref();
-    m_imageCache.addClient(renderer, size);
+    m_imageCache.addClient(renderer, size, 1);
 }
 
 void CSSImageGeneratorValue::removeClient(RenderObject* renderer)
@@ -60,7 +60,7 @@ Image* CSSImageGeneratorValue::getImage(RenderObject* renderer, const IntSize& s
 {
     // If renderer is the only client, make sure we don't delete this, if the size changes (as this will result in addClient/removeClient calls).
     RefPtr<CSSImageGeneratorValue> protect(this);
-    return m_imageCache.getImage(renderer, size);
+    return m_imageCache.getImage(renderer, size, 1);
 }
 
 void CSSImageGeneratorValue::putImage(const IntSize& size, PassRefPtr<Image> image)
index 5a067dd..0cc2d8a 100644 (file)
@@ -34,6 +34,7 @@
 #include "FrameLoaderClient.h"
 #include "FrameLoaderTypes.h"
 #include "FrameView.h"
+#include "RenderObject.h"
 #include "Settings.h"
 #include "SharedBuffer.h"
 #include <wtf/CurrentTime.h>
@@ -130,26 +131,54 @@ bool CachedImage::willPaintBrokenImage() const
     return errorOccurred() && m_shouldPaintBrokenImage;
 }
 
-Image* CachedImage::lookupImageForSize(const IntSize& size) const
+#if ENABLE(SVG)
+inline Image* CachedImage::lookupImageForSize(const IntSize& size) const
 {
-    // FIXME: Add logic for this in webkit.org/b/47156.
-    UNUSED_PARAM(size);
+    if (!m_image)
+        return 0;
+    if (!m_image->isSVGImage())
+        return m_image.get();
+    if (Image* image = m_svgImageCache.imageForSize(size))
+        return image;
     return m_image.get();
 }
 
-Image* CachedImage::lookupImageForRenderer(const RenderObject* renderer) const
+inline Image* CachedImage::lookupOrCreateImageForRenderer(const RenderObject* renderer)
+{
+    if (!m_image)
+        return 0;
+    if (!m_image->isSVGImage())
+        return m_image.get();
+
+    // Request requested size/zoom for this renderer from the cache.
+    IntSize size;
+    float zoom = 1;
+    m_svgImageCache.getRequestedSizeAndZoom(renderer, size, zoom);
+    if (size.isEmpty())
+        return m_image.get();
+
+    if (Image* image = m_svgImageCache.getImage(renderer, size, zoom))
+        return image;
+
+    // Create and cache new image at requested size.
+    RefPtr<Image> newImage = SVGImage::createWithDataAndSize(this, m_data.get(), size, zoom);
+    Image* newImagePtr = newImage.get();
+    m_svgImageCache.addClient(renderer, size, zoom);
+    m_svgImageCache.putImage(size, newImage.release());
+    return newImagePtr;
+}
+
+#else
+inline Image* CachedImage::lookupImageForSize(const IntSize&) const
 {
-    // FIXME: Add logic for this in webkit.org/b/47156.
-    UNUSED_PARAM(renderer);
     return m_image.get();
 }
 
-PassRefPtr<Image> CachedImage::lookupOrCreateImageForRenderer(const RenderObject* renderer)
+inline Image* CachedImage::lookupOrCreateImageForRenderer(const RenderObject*)
 {
-    // FIXME: Add logic for this in webkit.org/b/47156.
-    UNUSED_PARAM(renderer);
-    return m_image;
+    return m_image.get();
 }
+#endif
 
 Image* CachedImage::image()
 {
@@ -180,19 +209,25 @@ Image* CachedImage::imageForRenderer(const RenderObject* renderer)
     }
 
     if (m_image)
-        return lookupOrCreateImageForRenderer(renderer).get();
+        return lookupOrCreateImageForRenderer(renderer);
 
     return Image::nullImage();
 }
 
-void CachedImage::setContainerSizeForRenderer(const RenderObject* renderer, const IntSize& containerSize)
+void CachedImage::setContainerSizeForRenderer(const RenderObject* renderer, const IntSize& containerSize, float containerZoom)
 {
-    if (!m_image)
+    if (!m_image || containerSize.isEmpty())
         return;
-
-    // FIXME: Add logic for this in webkit.org/b/47156.
+#if ENABLE(SVG)
+    if (!m_image->isSVGImage()) {
+        m_image->setContainerSize(containerSize);
+        return;
+    }
+    m_svgImageCache.addClient(renderer, containerSize, containerZoom);
+#else
     UNUSED_PARAM(renderer);
     m_image->setContainerSize(containerSize);
+#endif
 }
 
 bool CachedImage::usesImageContainerSize() const
@@ -223,9 +258,20 @@ IntSize CachedImage::imageSizeForRenderer(const RenderObject* renderer, float mu
 {
     ASSERT(!isPurgeable());
 
-    Image* image = lookupImageForRenderer(renderer);
-    if (!image)
+    if (!m_image)
         return IntSize();
+#if ENABLE(SVG)
+    if (m_image->isSVGImage()) {
+        // SVGImages already includes the zooming in its intrinsic size.
+        IntSize size;
+        float zoom = 1;
+        m_svgImageCache.getRequestedSizeAndZoom(renderer, size, zoom);
+        if (!size.isEmpty())
+            return size;
+        return m_image->size();
+    }
+#endif
+
     if (multiplier == 1.0f)
         return m_image->size();
         
@@ -241,10 +287,10 @@ IntSize CachedImage::imageSizeForRenderer(const RenderObject* renderer, float mu
     return IntSize(width, height);
 }
 
-void CachedImage::computeIntrinsicDimensions(const RenderObject* renderer, Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio)
+void CachedImage::computeIntrinsicDimensions(Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio)
 {
-    if (Image* image = lookupImageForRenderer(renderer))
-        image->computeIntrinsicDimensions(intrinsicWidth, intrinsicHeight, intrinsicRatio);
+    if (m_image)
+        m_image->computeIntrinsicDimensions(intrinsicWidth, intrinsicHeight, intrinsicRatio);
 }
 
 void CachedImage::notifyObservers(const IntRect* changeRect)
index 33b56b9..7cba852 100644 (file)
@@ -58,15 +58,14 @@ public:
 
     bool canRender(const RenderObject* renderer, float multiplier) { return !errorOccurred() && !imageSizeForRenderer(renderer, multiplier).isEmpty(); }
 
-    // These are only used for SVGImage right now
-    void setContainerSizeForRenderer(const RenderObject*, const IntSize&);
+    void setContainerSizeForRenderer(const RenderObject*, const IntSize&, float);
     bool usesImageContainerSize() const;
     bool imageHasRelativeWidth() const;
     bool imageHasRelativeHeight() const;
     
     // This method takes a zoom multiplier that can be used to increase the natural size of the image by the zoom.
     IntSize imageSizeForRenderer(const RenderObject*, float multiplier); // returns the size of the complete image.
-    void computeIntrinsicDimensions(const RenderObject*, Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio);
+    void computeIntrinsicDimensions(Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio);
 
     virtual void didAddClient(CachedResourceClient*);
     
@@ -96,8 +95,7 @@ public:
 
 private:
     Image* lookupImageForSize(const IntSize&) const;
-    Image* lookupImageForRenderer(const RenderObject*) const;
-    PassRefPtr<Image> lookupOrCreateImageForRenderer(const RenderObject*);
+    Image* lookupOrCreateImageForRenderer(const RenderObject*);
 
     void createImage();
     size_t maximumDecodedImageSize();
index d213c60..cde7c42 100644 (file)
@@ -336,6 +336,8 @@ namespace WebCore {
 
         virtual void numWheelEventHandlersChanged(unsigned) = 0;
         
+        virtual bool isSVGImageChromeClient() const { return false; }
+
     protected:
         virtual ~ChromeClient() { }
     };
index dd884a6..bf1a17f 100644 (file)
@@ -129,6 +129,7 @@ public:
     
     // Typically the CachedImage that owns us.
     ImageObserver* imageObserver() const { return m_imageObserver; }
+    void setImageObserver(ImageObserver* observer) { m_imageObserver = observer; }
 
     enum TileRule { StretchTile, RoundTile, SpaceTile, RepeatTile };
 
index 4965bb9..d396610 100644 (file)
@@ -32,47 +32,51 @@ ImageBySizeCache::ImageBySizeCache()
 {
 }
 
-void ImageBySizeCache::addClient(const RenderObject* renderer, const IntSize& size)
+void ImageBySizeCache::addClient(const RenderObject* renderer, const IntSize& size, float zoom)
 {
+    ASSERT(renderer);
     if (!size.isEmpty())
         m_sizes.add(size);
     
     RenderObjectSizeCountMap::iterator it = m_clients.find(renderer);
     if (it == m_clients.end())
-        m_clients.add(renderer, SizeCountPair(size, 1));
+        m_clients.add(renderer, SizeZoomAndCount(size, zoom, 1));
     else {
-        SizeCountPair& sizeCount = it->second;
-        ++sizeCount.second;
+        SizeZoomAndCount& sizeCount = it->second;
+        sizeCount.requestedSize = size;
+        sizeCount.requestedZoom = zoom;
+        ++sizeCount.count;
     }
 }
 
 void ImageBySizeCache::removeClient(const RenderObject* renderer)
 {
+    ASSERT(renderer);
     RenderObjectSizeCountMap::iterator it = m_clients.find(renderer);
     ASSERT(it != m_clients.end());
 
-    SizeCountPair& sizeCount = it->second;
-    IntSize size = sizeCount.first;
+    SizeZoomAndCount& sizeCount = it->second;
+    IntSize size = sizeCount.actualSize;
     if (!size.isEmpty()) {
         m_sizes.remove(size);
         if (!m_sizes.contains(size))
             m_images.remove(size);
     }
     
-    if (!--sizeCount.second)
+    if (!--sizeCount.count)
         m_clients.remove(renderer);
 }
 
-Image* ImageBySizeCache::getImage(const RenderObject* renderer, const IntSize& size)
+Image* ImageBySizeCache::getImage(const RenderObject* renderer, const IntSize& size, float zoom)
 {
     RenderObjectSizeCountMap::iterator it = m_clients.find(renderer);
-    ASSERT(it != m_clients.end());
-
-    SizeCountPair& sizeCount = it->second;
-    IntSize oldSize = sizeCount.first;
-    if (oldSize != size) {
-        removeClient(renderer);
-        addClient(renderer, size);
+    if (it != m_clients.end()) {
+        SizeZoomAndCount& sizeCount = it->second;
+        IntSize oldSize = sizeCount.actualSize;
+        if (oldSize != size) {
+            removeClient(renderer);
+            addClient(renderer, size, zoom);
+        }
     }
 
     // Don't generate an image for empty sizes.
@@ -83,6 +87,16 @@ Image* ImageBySizeCache::getImage(const RenderObject* renderer, const IntSize& s
     return m_images.get(size).get();
 }
 
+void ImageBySizeCache::getRequestedSizeAndZoom(const RenderObject* renderer, IntSize& size, float& zoom)
+{
+    RenderObjectSizeCountMap::iterator it = m_clients.find(renderer);
+    if (it == m_clients.end())
+        return;
+    SizeZoomAndCount& sizeCount = it->second;
+    size = sizeCount.requestedSize;
+    zoom = sizeCount.requestedZoom;
+}
+
 void ImageBySizeCache::putImage(const IntSize& size, PassRefPtr<Image> image)
 {
     m_images.add(size, image);
@@ -97,18 +111,22 @@ void ImageBySizeCache::clear()
 
 Image* ImageBySizeCache::imageForSize(const IntSize& size) const
 {
+    if (size.isEmpty())
+        return 0;
     HashMap<IntSize, RefPtr<Image> >::const_iterator it = m_images.find(size);
     if (it == m_images.end())
         return 0;
     return it->second.get();
 }
 
-IntSize ImageBySizeCache::sizeForClient(const RenderObject* renderer) const
+Image* ImageBySizeCache::imageForRenderer(const RenderObject* renderer) const
 {
+    if (!renderer)
+        return 0;
     RenderObjectSizeCountMap::const_iterator it = m_clients.find(renderer);
     if (it == m_clients.end())
-        return IntSize();
-    return it->second.first;
+        return 0;
+    return imageForSize(it->second.actualSize);
 }
 
 } // namespace WebCore
index 404dba6..0b19864 100644 (file)
@@ -31,23 +31,41 @@ namespace WebCore {
 class Image;
 class RenderObject;
 
-typedef pair<IntSize, int> SizeCountPair;
-typedef HashMap<const RenderObject*, SizeCountPair> RenderObjectSizeCountMap;
+struct SizeZoomAndCount {
+    SizeZoomAndCount(IntSize newSize = IntSize(), float newZoom = 0, int newCount = 0)
+        : actualSize(newSize)
+        , requestedSize(newSize)
+        , actualZoom(newZoom)
+        , requestedZoom(newZoom)
+        , count(newCount)
+    {
+    }
+
+    IntSize actualSize;
+    IntSize requestedSize;
+    float actualZoom;
+    float requestedZoom;
+    int count;
+};
+
+typedef HashMap<const RenderObject*, SizeZoomAndCount> RenderObjectSizeCountMap;
 
 class ImageBySizeCache {
 public:
     ImageBySizeCache();
 
-    void addClient(const RenderObject*, const IntSize&);
+    void addClient(const RenderObject*, const IntSize&, float zoom);
     void removeClient(const RenderObject*);
 
-    Image* getImage(const RenderObject*, const IntSize&);
+    Image* getImage(const RenderObject*, const IntSize&, float zoom);
+    void getRequestedSizeAndZoom(const RenderObject*, IntSize&, float& zoom);
+
     void putImage(const IntSize&, PassRefPtr<Image>);
 
     void clear();
 
     Image* imageForSize(const IntSize&) const;
-    IntSize sizeForClient(const RenderObject*) const;
+    Image* imageForRenderer(const RenderObject*) const;
     const RenderObjectSizeCountMap& clients() const { return m_clients; }
 
 private:
index 516f1be..53caa83 100644 (file)
@@ -782,13 +782,110 @@ void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, co
     }
 }
 
-LayoutSize RenderBoxModelObject::calculateFillTileSize(const FillLayer* fillLayer, LayoutSize positioningAreaSize) const
+static inline LayoutUnit resolveWidthForRatio(LayoutUnit height, const FloatSize& intrinsicRatio)
 {
-    StyleImage* image = fillLayer->image();
-    image->setContainerSizeForRenderer(this, positioningAreaSize); // Use the box established by background-origin.
+    // FIXME: Remove unnecessary rounding when layout is off ints: webkit.org/b/63656
+    return static_cast<LayoutUnit>(ceilf(height * intrinsicRatio.width() / intrinsicRatio.height()));
+}
+
+static inline LayoutUnit resolveHeightForRatio(LayoutUnit width, const FloatSize& intrinsicRatio)
+{
+    // FIXME: Remove unnecessary rounding when layout is off ints: webkit.org/b/63656
+    return static_cast<LayoutUnit>(ceilf(width * intrinsicRatio.height() / intrinsicRatio.width()));
+}
+
+static inline LayoutSize resolveAgainstIntrinsicWidthOrHeightAndRatio(const LayoutSize& size, const FloatSize& intrinsicRatio, LayoutUnit useWidth, LayoutUnit useHeight)
+{
+    if (intrinsicRatio.isEmpty()) {
+        if (useWidth)
+            return LayoutSize(useWidth, size.height());
+        return LayoutSize(size.width(), useHeight);
+    }
+
+    if (useWidth)
+        return LayoutSize(useWidth, resolveHeightForRatio(useWidth, intrinsicRatio));
+    return LayoutSize(resolveWidthForRatio(useHeight, intrinsicRatio), useHeight);
+}
 
+static inline LayoutSize resolveAgainstIntrinsicRatio(const LayoutSize& size, const FloatSize& intrinsicRatio)
+{
+    // Two possible solutions: (size.width(), solutionHeight) or (solutionWidth, size.height())
+    // "... must be assumed to be the largest dimensions..." = easiest answer: the rect with the largest surface area.
+
+    LayoutUnit solutionWidth = resolveWidthForRatio(size.height(), intrinsicRatio);
+    LayoutUnit solutionHeight = resolveHeightForRatio(size.width(), intrinsicRatio);
+    if (solutionWidth <= size.width()) {
+        if (solutionHeight <= size.height()) {
+            // If both solutions fit, choose the one covering the larger area.
+            LayoutUnit areaOne = solutionWidth * size.height();
+            LayoutUnit areaTwo = size.width() * solutionHeight;
+            if (areaOne < areaTwo)
+                return LayoutSize(size.width(), solutionHeight);
+            return LayoutSize(solutionWidth, size.height());
+        }
+
+        // Only the first solution fits.
+        return LayoutSize(solutionWidth, size.height());
+    }
+
+    // Only the second solution fits, assert that.
+    ASSERT(solutionHeight <= size.height());
+    return LayoutSize(size.width(), solutionHeight);
+}
+
+LayoutSize RenderBoxModelObject::calculateImageIntrinsicDimensions(StyleImage* image, const LayoutSize& positioningAreaSize) const
+{
+    LayoutUnit resolvedWidth = 0;
+    LayoutUnit resolvedHeight = 0;
+    FloatSize intrinsicRatio;
+
+    // A generated image without a fixed size, will always return the container size as intrinsic size.
+    if (image->isGeneratedImage() && image->usesImageContainerSize()) {
+        resolvedWidth = positioningAreaSize.width();
+        resolvedHeight = positioningAreaSize.height();
+    } else {
+        Length intrinsicWidth;
+        Length intrinsicHeight;
+        image->computeIntrinsicDimensions(this, intrinsicWidth, intrinsicHeight, intrinsicRatio);
+
+        // FIXME: Remove unnecessary rounding when layout is off ints: webkit.org/b/63656
+        if (intrinsicWidth.isFixed())
+            resolvedWidth = static_cast<LayoutUnit>(ceilf(intrinsicWidth.value() * style()->effectiveZoom()));
+        if (intrinsicHeight.isFixed())
+            resolvedHeight = static_cast<LayoutUnit>(ceilf(intrinsicHeight.value() * style()->effectiveZoom()));
+    }
+
+    // Intrinsic dimensions expressed as percentages must be resolved relative to the dimensions of the rectangle
+    // that establishes the coordinate system for the 'background-position' property. SVG on the other hand
+    // _explicitely_ says that percentage values for the width/height attributes do NOT define intrinsic dimensions.
+    if (resolvedWidth > 0 && resolvedHeight > 0)
+        return LayoutSize(resolvedWidth, resolvedHeight);
+
+    // If the image has one of either an intrinsic width or an intrinsic height:
+    // * and an intrinsic aspect ratio, then the missing dimension is calculated from the given dimension and the ratio.
+    // * and no intrinsic aspect ratio, then the missing dimension is assumed to be the size of the rectangle that
+    //   establishes the coordinate system for the 'background-position' property.
+    if ((resolvedWidth && !resolvedHeight) || (!resolvedWidth && resolvedHeight))
+        return resolveAgainstIntrinsicWidthOrHeightAndRatio(positioningAreaSize, intrinsicRatio, resolvedWidth, resolvedHeight);
+
+    // If the image has no intrinsic dimensions and has an intrinsic ratio the dimensions must be assumed to be the
+    // largest dimensions at that ratio such that neither dimension exceeds the dimensions of the rectangle that
+    // establishes the coordinate system for the 'background-position' property.
+    if (!resolvedWidth && !resolvedHeight && !intrinsicRatio.isEmpty())
+        return resolveAgainstIntrinsicRatio(positioningAreaSize, intrinsicRatio);
+
+    // If the image has no intrinsic ratio either, then the dimensions must be assumed to be the rectangle that
+    // establishes the coordinate system for the 'background-position' property.
+    return positioningAreaSize;
+}
+
+LayoutSize RenderBoxModelObject::calculateFillTileSize(const FillLayer* fillLayer, const LayoutSize& positioningAreaSize) const
+{
+    StyleImage* image = fillLayer->image();
     EFillSizeType type = fillLayer->size().type;
 
+    LayoutSize imageIntrinsicSize = calculateImageIntrinsicDimensions(image, positioningAreaSize);
+
     switch (type) {
         case SizeLength: {
             LayoutUnit w = positioningAreaSize.width();
@@ -810,37 +907,40 @@ LayoutSize RenderBoxModelObject::calculateFillTileSize(const FillLayer* fillLaye
             // If one of the values is auto we have to use the appropriate
             // scale to maintain our aspect ratio.
             if (layerWidth.isAuto() && !layerHeight.isAuto()) {
-                LayoutSize imageIntrinsicSize = image->imageSize(this, style()->effectiveZoom());
                 if (imageIntrinsicSize.height())
                     w = imageIntrinsicSize.width() * h / imageIntrinsicSize.height();        
             } else if (!layerWidth.isAuto() && layerHeight.isAuto()) {
-                LayoutSize imageIntrinsicSize = image->imageSize(this, style()->effectiveZoom());
                 if (imageIntrinsicSize.width())
                     h = imageIntrinsicSize.height() * w / imageIntrinsicSize.width();
             } else if (layerWidth.isAuto() && layerHeight.isAuto()) {
                 // If both width and height are auto, use the image's intrinsic size.
-                LayoutSize imageIntrinsicSize = image->imageSize(this, style()->effectiveZoom());
                 w = imageIntrinsicSize.width();
                 h = imageIntrinsicSize.height();
             }
             
             return LayoutSize(max<LayoutUnit>(1, w), max<LayoutUnit>(1, h));
         }
+        case SizeNone: {
+            // If both values are ‘auto’ then the intrinsic width and/or height of the image should be used, if any.
+            if (!imageIntrinsicSize.isEmpty())
+                return imageIntrinsicSize;
+
+            // If the image has neither an intrinsic width nor an intrinsic height, its size is determined as for ‘contain’.
+            type = Contain;
+        }
         case Contain:
         case Cover: {
-            LayoutSize imageIntrinsicSize = image->imageSize(this, 1);
             float horizontalScaleFactor = imageIntrinsicSize.width()
                 ? static_cast<float>(positioningAreaSize.width()) / imageIntrinsicSize.width() : 1;
             float verticalScaleFactor = imageIntrinsicSize.height()
                 ? static_cast<float>(positioningAreaSize.height()) / imageIntrinsicSize.height() : 1;
             float scaleFactor = type == Contain ? min(horizontalScaleFactor, verticalScaleFactor) : max(horizontalScaleFactor, verticalScaleFactor);
             return LayoutSize(max<LayoutUnit>(1, imageIntrinsicSize.width() * scaleFactor), max<LayoutUnit>(1, imageIntrinsicSize.height() * scaleFactor));
-        }
-        case SizeNone:
-            break;
+       }
     }
 
-    return image->imageSize(this, style()->effectiveZoom());
+    ASSERT_NOT_REACHED();
+    return LayoutSize();
 }
 
 void RenderBoxModelObject::BackgroundImageGeometry::setNoRepeatX(int xOffset)
@@ -927,7 +1027,9 @@ void RenderBoxModelObject::calculateBackgroundImageGeometry(const FillLayer* fil
         positioningAreaSize = geometry.destRect().size();
     }
 
-    geometry.setTileSize(calculateFillTileSize(fillLayer, positioningAreaSize));
+    LayoutSize fillTileSize = calculateFillTileSize(fillLayer, positioningAreaSize);
+    fillLayer->image()->setContainerSizeForRenderer(this, fillTileSize, style()->effectiveZoom());
+    geometry.setTileSize(fillTileSize);
 
     EFillRepeat backgroundRepeatX = fillLayer->repeatX();
     EFillRepeat backgroundRepeatY = fillLayer->repeatY();
@@ -987,8 +1089,12 @@ bool RenderBoxModelObject::paintNinePieceImage(GraphicsContext* graphicsContext,
     LayoutUnit rightWithOutset = rect.maxX() + rightOutset;
     LayoutRect borderImageRect = LayoutRect(leftWithOutset, topWithOutset, rightWithOutset - leftWithOutset, bottomWithOutset - topWithOutset);
 
-    styleImage->setContainerSizeForRenderer(this, borderImageRect.size());
-    LayoutSize imageSize = styleImage->imageSize(this, 1.0f);
+    LayoutSize imageSize = calculateImageIntrinsicDimensions(styleImage, borderImageRect.size());
+
+    // If both values are ‘auto’ then the intrinsic width and/or height of the image should be used, if any.
+    LayoutSize containerSize = imageSize.isEmpty() ? borderImageRect.size() : imageSize;
+    styleImage->setContainerSizeForRenderer(this, containerSize, style->effectiveZoom());
+
     LayoutUnit imageWidth = imageSize.width();
     LayoutUnit imageHeight = imageSize.height();
 
index e6ab70a..3e46254 100644 (file)
@@ -195,7 +195,8 @@ protected:
 private:
     virtual bool isBoxModelObject() const { return true; }
 
-    LayoutSize calculateFillTileSize(const FillLayer*, LayoutSize scaledSize) const;
+    LayoutSize calculateFillTileSize(const FillLayer*, const LayoutSize& scaledPositioningAreaSize) const;
+    LayoutSize calculateImageIntrinsicDimensions(StyleImage*, const LayoutSize& scaledPositioningAreaSize) const;
 
     RoundedRect getBackgroundRoundedRect(const LayoutRect&, InlineFlowBox*, LayoutUnit inlineBoxWidth, LayoutUnit inlineBoxHeight,
         bool includeLogicalLeftEdge, bool includeLogicalRightEdge);
index ccb30f9..48d86db 100644 (file)
@@ -41,6 +41,7 @@
 #include "Page.h"
 #include "RenderLayer.h"
 #include "RenderView.h"
+#include "SVGImage.h"
 #include <wtf/UnusedParam.h>
 
 using namespace std;
@@ -50,7 +51,7 @@ namespace WebCore {
 using namespace HTMLNames;
 
 RenderImage::RenderImage(Node* node)
-    : RenderReplaced(node, IntSize(0, 0))
+    : RenderReplaced(node, IntSize())
     , m_needsToSetSizeForAltText(false)
     , m_didIncrementVisuallyNonEmptyPixelCount(false)
 {
@@ -173,14 +174,20 @@ void RenderImage::imageChanged(WrappedImagePtr newImage, const IntRect* rect)
     imageDimensionsChanged(imageSizeChanged, rect);
 }
 
+bool RenderImage::updateIntrinsicSizeIfNeeded(const LayoutSize& newSize, bool imageSizeChanged)
+{
+    if (newSize == intrinsicSize() && !imageSizeChanged)
+        return false;
+    if (m_imageResource->errorOccurred())
+        return imageSizeChanged;
+    setIntrinsicSize(newSize);
+    return true;
+}
+
 void RenderImage::imageDimensionsChanged(bool imageSizeChanged, const IntRect* rect)
 {
     bool shouldRepaint = true;
-
-    if (m_imageResource->imageSize(style()->effectiveZoom()) != intrinsicSize() || imageSizeChanged) {
-        if (!m_imageResource->errorOccurred())
-            setIntrinsicSize(m_imageResource->imageSize(style()->effectiveZoom()));
-
+    if (updateIntrinsicSizeIfNeeded(m_imageResource->imageSize(style()->effectiveZoom()), imageSizeChanged)) {
         // In the case of generated image content using :before/:after, we might not be in the
         // render tree yet.  In that case, we don't need to worry about check for layout, since we'll get a
         // layout when we get added in to the render tree hierarchy later.
@@ -475,105 +482,73 @@ void RenderImage::updateAltText()
         m_altText = static_cast<HTMLImageElement*>(node())->altText();
 }
 
-bool RenderImage::isLogicalWidthSpecified() const
+LayoutUnit RenderImage::computeReplacedLogicalWidth(bool includeMaxWidth) const
 {
-    switch (style()->logicalWidth().type()) {
-        case Fixed:
-        case Percent:
-            return true;
-        case Auto:
-        case Relative: // FIXME: Shouldn't this case return true?
-        case Intrinsic:
-        case MinIntrinsic:
-            return false;
-        case Undefined:
-            ASSERT_NOT_REACHED();
-            return false;
+    // If we've got an explicit width/height assigned, propagate it to the image resource.    
+    if (style()->logicalWidth().isFixed() && style()->logicalHeight().isFixed()) {
+        LayoutUnit width = RenderReplaced::computeReplacedLogicalWidth(includeMaxWidth);
+        m_imageResource->setContainerSizeForRenderer(IntSize(width, computeReplacedLogicalHeight()));
+        return width;
     }
-    ASSERT_NOT_REACHED();
-    return false;
-}
 
-bool RenderImage::isLogicalHeightSpecified() const
-{
-    switch (style()->logicalHeight().type()) {
-        case Fixed:
-        case Percent:
-            return true;
-        case Auto:
-        case Relative: // FIXME: Shouldn't this case return true?
-        case Intrinsic:
-        case MinIntrinsic:
-            return false;
-        case Undefined:
-            ASSERT_NOT_REACHED();
-            return false;
+    RenderBox* contentRenderer = embeddedContentBox();
+    bool hasRelativeWidth = contentRenderer ? contentRenderer->style()->width().isPercent() : m_imageResource->imageHasRelativeWidth();
+    bool hasRelativeHeight = contentRenderer ? contentRenderer->style()->height().isPercent() : m_imageResource->imageHasRelativeHeight();
+
+    LayoutSize containerSize;
+    if (hasRelativeWidth || hasRelativeHeight) {
+        // Propagate the containing block size to the image resource, otherwhise we can't compute our own intrinsic size, if it's relative.
+        RenderObject* containingBlock = isPositioned() ? container() : this->containingBlock();
+        if (containingBlock->isBox()) {
+            RenderBox* box = toRenderBox(containingBlock);
+            containerSize = LayoutSize(box->availableWidth(), box->availableHeight()); // Already contains zooming information.
+        }
+    } else {
+        // Propagate the current zoomed image size to the image resource, otherwhise the image size will remain the same on-screen.
+        CachedImage* cachedImage = m_imageResource->cachedImage();
+        if (cachedImage && cachedImage->image()) {
+            containerSize = cachedImage->image()->size();
+            // FIXME: Remove unnecessary rounding when layout is off ints: webkit.org/b/63656
+            containerSize.setWidth(static_cast<LayoutUnit>(containerSize.width() * style()->effectiveZoom()));
+            containerSize.setHeight(static_cast<LayoutUnit>(containerSize.height() * style()->effectiveZoom()));
+        }
     }
-    ASSERT_NOT_REACHED();
-    return false;
-}
 
-LayoutUnit RenderImage::computeReplacedLogicalWidth(bool includeMaxWidth) const
-{
-    if (m_imageResource->imageHasRelativeWidth())
-        if (RenderObject* cb = isPositioned() ? container() : containingBlock()) {
-            if (cb->isBox())
-                m_imageResource->setContainerSizeForRenderer(LayoutSize(toRenderBox(cb)->availableWidth(), toRenderBox(cb)->availableHeight()));
-        }
+    if (!containerSize.isEmpty()) {
+        m_imageResource->setContainerSizeForRenderer(containerSize);
+        const_cast<RenderImage*>(this)->updateIntrinsicSizeIfNeeded(containerSize, false);
+    }
 
-    LayoutUnit logicalWidth;
-    if (isLogicalWidthSpecified())
-        logicalWidth = computeReplacedLogicalWidthUsing(style()->logicalWidth());
-    else if (m_imageResource->usesImageContainerSize()) {
-        LayoutSize size = m_imageResource->imageSize(style()->effectiveZoom());
-        logicalWidth = style()->isHorizontalWritingMode() ? size.width() : size.height();
-    } else if (m_imageResource->imageHasRelativeWidth())
-        logicalWidth = 0; // If the image is relatively-sized, set the width to 0 until there is a set container size.
-    else
-        logicalWidth = calcAspectRatioLogicalWidth();
-
-    return computeReplacedLogicalWidthRespectingMinMaxWidth(logicalWidth, includeMaxWidth);
+    return RenderReplaced::computeReplacedLogicalWidth(includeMaxWidth);
 }
 
-LayoutUnit RenderImage::computeReplacedLogicalHeight() const
+void RenderImage::computeIntrinsicRatioInformation(FloatSize& intrinsicRatio, bool& isPercentageIntrinsicSize) const
 {
-    // FIXME: This function should use RenderReplaced::computeReplacedLogicalHeight()
-    LayoutUnit logicalHeight;
-    if (logicalHeightIsAuto() && !style()->logicalWidth().isAuto() && intrinsicLogicalWidth() && intrinsicLogicalHeight())
-        logicalHeight = static_cast<LayoutUnit>(availableLogicalWidth() * intrinsicLogicalHeight() / intrinsicLogicalWidth());
-    else if (isLogicalHeightSpecified())
-        logicalHeight = computeReplacedLogicalHeightUsing(style()->logicalHeight());
-    else if (m_imageResource->usesImageContainerSize()) {
-        LayoutSize size = m_imageResource->imageSize(style()->effectiveZoom());
-        logicalHeight = style()->isHorizontalWritingMode() ? size.height() : size.width();
-    } else if (m_imageResource->imageHasRelativeHeight())
-        logicalHeight = 0; // If the image is relatively-sized, set the height to 0 until there is a set container size.
-    else
-        logicalHeight = calcAspectRatioLogicalHeight();
-
-    return computeReplacedLogicalHeightRespectingMinMaxHeight(logicalHeight);
+    // Assure this method is never used for SVGImages.
+    ASSERT(!embeddedContentBox());
+    isPercentageIntrinsicSize = false;
+    CachedImage* cachedImage = m_imageResource ? m_imageResource->cachedImage() : 0;
+    if (cachedImage && cachedImage->image())
+        intrinsicRatio = cachedImage->image()->size();
 }
 
-int RenderImage::calcAspectRatioLogicalWidth() const
+bool RenderImage::needsPreferredWidthsRecalculation() const
 {
-    int intrinsicWidth = intrinsicLogicalWidth();
-    int intrinsicHeight = intrinsicLogicalHeight();
-    if (!intrinsicHeight)
-        return 0;
-    if (!m_imageResource->hasImage() || m_imageResource->errorOccurred())
-        return intrinsicWidth; // Don't bother scaling.
-    return RenderBox::computeReplacedLogicalHeight() * intrinsicWidth / intrinsicHeight;
+    if (RenderReplaced::needsPreferredWidthsRecalculation())
+        return true;
+    return embeddedContentBox();
 }
 
-int RenderImage::calcAspectRatioLogicalHeight() const
+RenderBox* RenderImage::embeddedContentBox() const
 {
-    int intrinsicWidth = intrinsicLogicalWidth();
-    int intrinsicHeight = intrinsicLogicalHeight();
-    if (!intrinsicWidth)
+    if (!m_imageResource)
         return 0;
-    if (!m_imageResource->hasImage() || m_imageResource->errorOccurred())
-        return intrinsicHeight; // Don't bother scaling.
-    return RenderBox::computeReplacedLogicalWidth() * intrinsicHeight / intrinsicWidth;
+
+    RefPtr<Image> image = m_imageResource->image();
+    if (image && image->isSVGImage())
+        return static_pointer_cast<SVGImage>(image)->embeddedContentBox();
+
+    return 0;
 }
 
 } // namespace WebCore
index da895d2..bcd34d1 100644 (file)
@@ -54,6 +54,10 @@ public:
     void highQualityRepaintTimerFired(Timer<RenderImage>*);
 
 protected:
+    virtual bool needsPreferredWidthsRecalculation() const;
+    virtual RenderBox* embeddedContentBox() const;
+    virtual void computeIntrinsicRatioInformation(FloatSize& intrinsicRatio, bool& isPercentageIntrinsicSize) const;
+
     virtual void styleDidChange(StyleDifference, const RenderStyle*);
 
     virtual void imageChanged(WrappedImagePtr, const IntRect* = 0);
@@ -61,9 +65,6 @@ protected:
     virtual void paintIntoRect(GraphicsContext*, const IntRect&);
     virtual void paint(PaintInfo&, const LayoutPoint&);
 
-    bool isLogicalWidthSpecified() const;
-    bool isLogicalHeightSpecified() const;
-
     virtual void intrinsicSizeChanged()
     {
         if (m_imageResource)
@@ -86,13 +87,10 @@ private:
     virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const LayoutPoint& pointInContainer, const LayoutPoint& accumulatedOffset, HitTestAction);
 
     virtual LayoutUnit computeReplacedLogicalWidth(bool includeMaxWidth = true) const;
-    virtual LayoutUnit computeReplacedLogicalHeight() const;
 
     IntSize imageSizeForError(CachedImage*) const;
     void imageDimensionsChanged(bool imageSizeChanged, const IntRect* = 0);
-
-    int calcAspectRatioLogicalWidth() const;
-    int calcAspectRatioLogicalHeight() const;
+    bool updateIntrinsicSizeIfNeeded(const LayoutSize&, bool imageSizeChanged);
 
     void paintAreaElementFocusRing(PaintInfo&);
 
index eb748f6..0c3a79e 100644 (file)
@@ -93,7 +93,7 @@ void RenderImageResource::setContainerSizeForRenderer(const IntSize& imageContai
 {
     ASSERT(m_renderer);
     if (m_cachedImage)
-        m_cachedImage->setContainerSizeForRenderer(m_renderer, imageContainerSize);
+        m_cachedImage->setContainerSizeForRenderer(m_renderer, imageContainerSize, m_renderer->style()->effectiveZoom());
 }
 
 Image* RenderImageResource::nullImage()
index 7f41984..ddb1344 100644 (file)
@@ -60,4 +60,18 @@ void RenderImageResourceStyleImage::shutdown()
     m_cachedImage = 0;
 }
 
+PassRefPtr<Image> RenderImageResourceStyleImage::image(int width, int height) const
+{
+    // Generated content may trigger calls to image() while we're still pending, don't assert but gracefully exit.
+    if (m_styleImage->isPendingImage())
+        return 0;
+    return m_styleImage->image(m_renderer, IntSize(width, height));
+}
+
+void RenderImageResourceStyleImage::setContainerSizeForRenderer(const IntSize& size)
+{
+    ASSERT(m_renderer);
+    m_styleImage->setContainerSizeForRenderer(m_renderer, size, m_renderer->style()->effectiveZoom());
+}
+
 } // namespace WebCore
index fcad246..6d2f7b6 100644 (file)
@@ -46,10 +46,10 @@ public:
     virtual void shutdown();
 
     virtual bool hasImage() const { return true; }
-    virtual PassRefPtr<Image> image(int width = 0, int height = 0) const { return m_styleImage->image(m_renderer, IntSize(width, height)); }
+    virtual PassRefPtr<Image> image(int width = 0, int height = 0) const;
     virtual bool errorOccurred() const { return m_styleImage->errorOccurred(); }
 
-    virtual void setContainerSizeForRenderer(const IntSize& size) { m_styleImage->setContainerSizeForRenderer(m_renderer, size); }
+    virtual void setContainerSizeForRenderer(const IntSize&);
     virtual bool usesImageContainerSize() const { return m_styleImage->usesImageContainerSize(); }
     virtual bool imageHasRelativeWidth() const { return m_styleImage->imageHasRelativeWidth(); }
     virtual bool imageHasRelativeHeight() const { return m_styleImage->imageHasRelativeHeight(); }
index 876c809..13dad98 100644 (file)
@@ -1350,7 +1350,7 @@ void RenderListMarker::computePreferredLogicalWidths()
         // FIXME: This is a somewhat arbitrary width.  Generated images for markers really won't become particularly useful
         // until we support the CSS3 marker pseudoclass to allow control over the width and height of the marker box.
         LayoutUnit bulletWidth = fontMetrics.ascent() / 2;
-        m_image->setContainerSizeForRenderer(this, LayoutSize(bulletWidth, bulletWidth));
+        m_image->setContainerSizeForRenderer(this, LayoutSize(bulletWidth, bulletWidth), style()->effectiveZoom());
         LayoutSize imageSize = m_image->imageSize(this, style()->effectiveZoom());
         m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = style()->isHorizontalWritingMode() ? imageSize.width() : imageSize.height();
         setPreferredLogicalWidthsDirty(false);
index 66f0d24..c718c39 100644 (file)
@@ -201,8 +201,8 @@ bool RenderReplaced::shouldPaint(PaintInfo& paintInfo, const LayoutPoint& paintO
 int RenderReplaced::computeIntrinsicLogicalWidth(RenderBox* contentRenderer, bool includeMaxWidth) const
 {
     if (m_hasIntrinsicSize) {
-        ASSERT(!contentRenderer);
-        return computeReplacedLogicalWidthRespectingMinMaxWidth(calcAspectRatioLogicalWidth(), includeMaxWidth);
+        if (!contentRenderer || !contentRenderer->style()->logicalWidth().isFixed())
+            return computeReplacedLogicalWidthRespectingMinMaxWidth(calcAspectRatioLogicalWidth(), includeMaxWidth);
     }
     ASSERT(contentRenderer);
     ASSERT(contentRenderer->style());
@@ -212,8 +212,8 @@ int RenderReplaced::computeIntrinsicLogicalWidth(RenderBox* contentRenderer, boo
 int RenderReplaced::computeIntrinsicLogicalHeight(RenderBox* contentRenderer) const
 {
     if (m_hasIntrinsicSize) {
-        ASSERT(!contentRenderer);
-        return computeReplacedLogicalHeightRespectingMinMaxHeight(calcAspectRatioLogicalHeight());
+        if (!contentRenderer || !contentRenderer->style()->logicalHeight().isFixed())
+            return computeReplacedLogicalHeightRespectingMinMaxHeight(calcAspectRatioLogicalHeight());
     }
     ASSERT(contentRenderer);
     ASSERT(contentRenderer->style());
@@ -235,7 +235,8 @@ LayoutUnit RenderReplaced::computeReplacedLogicalWidth(bool includeMaxWidth) con
         contentRenderer->computeIntrinsicRatioInformation(intrinsicRatio, isPercentageIntrinsicSize);
         contentRenderStyle = contentRenderer->style();
         ASSERT(contentRenderStyle);
-    }
+    } else
+        computeIntrinsicRatioInformation(intrinsicRatio, isPercentageIntrinsicSize);
 
     if (style()->logicalWidth().isAuto()) {
         bool heightIsAuto = style()->logicalHeight().isAuto();
index 35c8dc3..4078c49 100644 (file)
@@ -64,9 +64,9 @@ bool StyleCachedImage::imageHasRelativeHeight() const
     return m_image->imageHasRelativeHeight();
 }
 
-void StyleCachedImage::computeIntrinsicDimensions(const RenderObject* renderer, Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio)
+void StyleCachedImage::computeIntrinsicDimensions(const RenderObject*, Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio)
 {
-    m_image->computeIntrinsicDimensions(renderer, intrinsicWidth, intrinsicHeight, intrinsicRatio);
+    m_image->computeIntrinsicDimensions(intrinsicWidth, intrinsicHeight, intrinsicRatio);
 }
 
 bool StyleCachedImage::usesImageContainerSize() const
@@ -74,9 +74,9 @@ bool StyleCachedImage::usesImageContainerSize() const
     return m_image->usesImageContainerSize();
 }
 
-void StyleCachedImage::setContainerSizeForRenderer(const RenderObject* renderer, const IntSize& imageContainerSize)
+void StyleCachedImage::setContainerSizeForRenderer(const RenderObject* renderer, const IntSize& imageContainerSize, float imageContainerZoomFactor)
 {
-    m_image->setContainerSizeForRenderer(renderer, imageContainerSize);
+    m_image->setContainerSizeForRenderer(renderer, imageContainerSize, imageContainerZoomFactor);
 }
 
 void StyleCachedImage::addClient(RenderObject* renderer)
index 05a0c52..06dfb25 100644 (file)
@@ -48,7 +48,7 @@ public:
     virtual bool imageHasRelativeHeight() const;
     virtual void computeIntrinsicDimensions(const RenderObject*, Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio);
     virtual bool usesImageContainerSize() const;
-    virtual void setContainerSizeForRenderer(const RenderObject*, const IntSize&);
+    virtual void setContainerSizeForRenderer(const RenderObject*, const IntSize&, float);
     virtual void addClient(RenderObject*);
     virtual void removeClient(RenderObject*);
     virtual PassRefPtr<Image> image(RenderObject*, const IntSize&) const;
index 089c3ed..7620237 100644 (file)
@@ -47,7 +47,7 @@ public:
     virtual bool imageHasRelativeHeight() const { return !m_fixedSize; }
     virtual void computeIntrinsicDimensions(const RenderObject*, Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio);
     virtual bool usesImageContainerSize() const { return !m_fixedSize; }
-    virtual void setContainerSizeForRenderer(const RenderObject*, const IntSize& containerSize) { m_containerSize = containerSize; }
+    virtual void setContainerSizeForRenderer(const RenderObject*, const IntSize& containerSize, float) { m_containerSize = containerSize; }
     virtual void addClient(RenderObject*);
     virtual void removeClient(RenderObject*);
     virtual PassRefPtr<Image> image(RenderObject*, const IntSize&) const;
index 11c6dd4..0a5766b 100644 (file)
@@ -57,7 +57,7 @@ public:
     virtual bool imageHasRelativeWidth() const = 0;
     virtual bool imageHasRelativeHeight() const = 0;
     virtual bool usesImageContainerSize() const = 0;
-    virtual void setContainerSizeForRenderer(const RenderObject*, const IntSize&) = 0;
+    virtual void setContainerSizeForRenderer(const RenderObject*, const IntSize&, float) = 0;
     virtual void addClient(RenderObject*) = 0;
     virtual void removeClient(RenderObject*) = 0;
     virtual PassRefPtr<Image> image(RenderObject*, const IntSize&) const = 0;
index e379f74..c0ee139 100644 (file)
@@ -49,7 +49,7 @@ public:
     virtual bool imageHasRelativeHeight() const { return false; }
     virtual void computeIntrinsicDimensions(const RenderObject*, Length& /* intrinsicWidth */ , Length& /* intrinsicHeight */, FloatSize& /* intrinsicRatio */) { }
     virtual bool usesImageContainerSize() const { return false; }
-    virtual void setContainerSizeForRenderer(const RenderObject*, const IntSize&) { }
+    virtual void setContainerSizeForRenderer(const RenderObject*, const IntSize&, float) { }
     virtual void addClient(RenderObject*) { }
     virtual void removeClient(RenderObject*) { }
     virtual PassRefPtr<Image> image(RenderObject*, const IntSize&) const
index 2b0b1f9..0935fef 100644 (file)
@@ -66,6 +66,7 @@ void RenderSVGImage::layout()
 
     LayoutRepainter repainter(*this, checkForRepaintDuringLayout() && selfNeedsLayout());
     SVGImageElement* image = static_cast<SVGImageElement*>(node());
+    m_imageResource->setContainerSizeForRenderer(enclosingIntRect(m_objectBoundingBox).size());
 
     bool transformOrBoundariesUpdate = m_needsTransformUpdate || m_updateCachedRepaintRect;
     if (m_needsTransformUpdate) {
index 1d4fc91..9b6b88d 100644 (file)
 #if ENABLE(SVG)
 #include "RenderSVGRoot.h"
 
+#include "Chrome.h"
+#include "ChromeClient.h"
 #include "Frame.h"
 #include "GraphicsContext.h"
 #include "HitTestResult.h"
 #include "LayoutRepainter.h"
+#include "Page.h"
 #include "RenderPart.h"
 #include "RenderSVGContainer.h"
 #include "RenderSVGResource.h"
@@ -114,20 +117,24 @@ void RenderSVGRoot::computePreferredLogicalWidths()
     setPreferredLogicalWidthsDirty(false);
 }
 
-LayoutUnit RenderSVGRoot::computeIntrinsicWidth(LayoutUnit replacedWidth) const
+bool RenderSVGRoot::isEmbeddedThroughImageElement() const
 {
-    if (!style()->width().isPercent())
-        return replacedWidth;
-    // FIXME: Remove unnecessary rounding when layout is off ints: webkit.org/b/63656
-    return static_cast<int>(ceilf(replacedWidth * style()->effectiveZoom()));
-}
+    if (!node())
+        return false;
 
-LayoutUnit RenderSVGRoot::computeIntrinsicHeight(LayoutUnit replacedHeight) const
-{
-    if (!style()->height().isPercent())
-        return replacedHeight;
-    // FIXME: Remove unnecessary rounding when layout is off ints: webkit.org/b/63656
-    return static_cast<int>(ceilf(replacedHeight * style()->effectiveZoom()));
+    Frame* frame = node()->document()->frame();
+    if (!frame)
+        return false;
+
+    // Test whether we're embedded through an img.
+    if (!frame->page() || !frame->page()->chrome())
+        return false;
+
+    ChromeClient* chromeClient = frame->page()->chrome()->client();
+    if (!chromeClient || !chromeClient->isSVGImageChromeClient())
+        return false;
+
+    return true;
 }
 
 static inline bool isEmbeddedThroughFrameContainingSVGDocument(const Frame* frame)
@@ -141,13 +148,18 @@ static inline bool isEmbeddedThroughFrameContainingSVGDocument(const Frame* fram
 
 LayoutUnit RenderSVGRoot::computeReplacedLogicalWidth(bool includeMaxWidth) const
 {
-    LayoutUnit replacedWidth = RenderBox::computeReplacedLogicalWidth(includeMaxWidth);
+    // When we're embedded through SVGImage (border-image/background-image/<html:img>/...) we're forced to resize to a specific size.
+    LayoutUnit replacedWidth = m_containerSize.width();
+    if (replacedWidth > 0)
+        return replacedWidth;
+
+    replacedWidth = RenderBox::computeReplacedLogicalWidth(includeMaxWidth);
     Frame* frame = node() && node()->document() ? node()->document()->frame() : 0;
     if (!frame)
-        return computeIntrinsicWidth(replacedWidth);
+        return replacedWidth;
 
     if (isEmbeddedThroughFrameContainingSVGDocument(frame))
-        return computeIntrinsicWidth(replacedWidth);
+        return replacedWidth;
 
     RenderPart* ownerRenderer = frame->ownerRenderer();
     RenderStyle* ownerRendererStyle = ownerRenderer->style();
@@ -181,14 +193,18 @@ LayoutUnit RenderSVGRoot::computeReplacedLogicalWidth(bool includeMaxWidth) cons
 
 LayoutUnit RenderSVGRoot::computeReplacedLogicalHeight() const
 {
-    LayoutUnit replacedHeight = RenderBox::computeReplacedLogicalHeight();
+    // When we're embedded through SVGImage (border-image/background-image/<html:img>/...) we're forced to resize to a specific size.
+    LayoutUnit replacedHeight = m_containerSize.height();
+    if (replacedHeight > 0)
+        return replacedHeight;
 
+    replacedHeight = RenderBox::computeReplacedLogicalHeight();
     Frame* frame = node() && node()->document() ? node()->document()->frame() : 0;
     if (!frame)
-        return computeIntrinsicHeight(replacedHeight);
+        return replacedHeight;
 
     if (isEmbeddedThroughFrameContainingSVGDocument(frame))
-        return computeIntrinsicHeight(replacedHeight);
+        return replacedHeight;
 
     RenderPart* ownerRenderer = frame->ownerRenderer();
     RenderStyle* ownerRendererStyle = ownerRenderer->style();
@@ -220,11 +236,10 @@ void RenderSVGRoot::layout()
     LayoutSize oldSize(width(), height());
     computeLogicalWidth();
     computeLogicalHeight();
-    calcViewport();
 
     SVGSVGElement* svg = static_cast<SVGSVGElement*>(node());
-    m_isLayoutSizeChanged = svg->hasRelativeLengths() && oldSize != size();
+    m_isLayoutSizeChanged = needsLayout || (svg->hasRelativeLengths() && oldSize != size());
+
     if (view() && view()->frameView() && view()->frameView()->embeddedContentBox()) {
         if (!m_needsSizeNegotiationWithHostDocument)
             m_needsSizeNegotiationWithHostDocument = !m_everHadLayout || oldSize != size();
@@ -270,8 +285,8 @@ void RenderSVGRoot::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
     if (paintInfo.phase == PaintPhaseBlockBackground)
         return;
 
-    // An empty viewport disables rendering.  FIXME: Should we still render filters?
-    if (m_viewportSize.isEmpty())
+    // An empty viewport disables rendering.
+    if (borderBoxRect().isEmpty())
         return;
 
     // Don't paint if we don't have kids, except if we have filters we should paint those.
@@ -330,26 +345,6 @@ void RenderSVGRoot::updateFromElement()
     SVGResourcesCache::clientUpdatedFromElement(this, style());
 }
 
-void RenderSVGRoot::calcViewport()
-{
-    SVGSVGElement* svg = static_cast<SVGSVGElement*>(node());
-
-    if (!svg->hasSetContainerSize()) {
-        // In the normal case of <svg> being stand-alone or in a CSSBoxModel object we use
-        // RenderBox::width()/height() (which pulls data from RenderStyle)
-        m_viewportSize = FloatSize(width(), height());
-        return;
-    }
-
-    // In the SVGImage case grab the SVGLength values off of SVGSVGElement and use
-    // the special relativeWidthValue accessors which respect the specified containerSize
-    // FIXME: Check how SVGImage + zooming is supposed to be handled?
-    SVGLength width = svg->width();
-    SVGLength height = svg->height();
-    m_viewportSize = FloatSize(width.unitType() == LengthTypePercentage ? svg->relativeWidthValue() : width.value(svg),
-                               height.unitType() == LengthTypePercentage ? svg->relativeHeightValue() : height.value(svg));
-}
-
 // RenderBox methods will expect coordinates w/o any transforms in coordinates
 // relative to our borderBox origin.  This method gives us exactly that.
 AffineTransform RenderSVGRoot::localToBorderBoxTransform() const
@@ -398,7 +393,7 @@ void RenderSVGRoot::computeRectForRepaint(RenderBoxModelObject* repaintContainer
     repaintRect = localToBorderBoxTransform().mapRect(repaintRect);
 
     // Apply initial viewport clip - not affected by overflow settings    
-    repaintRect.intersect(enclosingLayoutRect(FloatRect(FloatPoint(), m_viewportSize)));
+    repaintRect.intersect(borderBoxRect());
 
     const SVGRenderStyle* svgStyle = style()->svgStyle();
     if (const ShadowData* shadow = svgStyle->shadow())
index 77ffc76..c0335f6 100644 (file)
 
 namespace WebCore {
 
-class SVGStyledElement;
 class AffineTransform;
+class SVGStyledElement;
 
 class RenderSVGRoot : public RenderBox {
 public:
     explicit RenderSVGRoot(SVGStyledElement*);
     virtual ~RenderSVGRoot();
 
+    bool isEmbeddedThroughImageElement() const;
+
     virtual void computeIntrinsicRatioInformation(FloatSize& intrinsicRatio, bool& isPercentageIntrinsicSize) const;
     const RenderObjectChildList* children() const { return &m_children; }
     RenderObjectChildList* children() { return &m_children; }
@@ -55,10 +57,10 @@ public:
     virtual void setNeedsBoundariesUpdate() { m_needsBoundariesOrTransformUpdate = true; }
     virtual void setNeedsTransformUpdate() { m_needsBoundariesOrTransformUpdate = true; }
 
-private:
-    LayoutUnit computeIntrinsicWidth(LayoutUnit replacedWidth) const;
-    LayoutUnit computeIntrinsicHeight(LayoutUnit replacedHeight) const;
+    IntSize containerSize() const { return m_containerSize; }
+    void setContainerSize(const IntSize& containerSize) { m_containerSize = containerSize; }
 
+private:
     virtual RenderObjectChildList* virtualChildren() { return children(); }
     virtual const RenderObjectChildList* virtualChildren() const { return children(); }
 
@@ -92,8 +94,6 @@ private:
 
     virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool useTransforms, bool fixed, TransformState&, bool* wasFixed = 0) const;
 
-    void calcViewport();
-
     bool selfWillPaint();
     void updateCachedBoundaries();
 
@@ -103,7 +103,7 @@ private:
     AffineTransform localToBorderBoxTransform() const;
 
     RenderObjectChildList m_children;
-    FloatSize m_viewportSize;
+    IntSize m_containerSize;
     FloatRect m_objectBoundingBox;
     FloatRect m_strokeBoundingBox;
     FloatRect m_repaintBoundingBox;
index ad42f5e..d8b42af 100644 (file)
@@ -28,8 +28,8 @@
 #include "FloatConversion.h"
 #include "Frame.h"
 #include "FrameView.h"
-#include "RenderObject.h"
 #include "RenderPart.h"
+#include "RenderSVGRoot.h"
 #include "RenderView.h"
 #include "SVGException.h"
 #include "SVGNames.h"
@@ -360,6 +360,7 @@ bool SVGLength::determineViewport(const SVGElement* context, float& width, float
             if (!frame)
                 return false;
 
+            // SVGs embedded through <object> resolve percentage values against the owner renderer in the host document.
             if (RenderPart* ownerRenderer = frame->ownerRenderer()) {
                 width = ownerRenderer->width();
                 height = ownerRenderer->height();
@@ -371,8 +372,14 @@ bool SVGLength::determineViewport(const SVGElement* context, float& width, float
         if (!view)
             return false;
 
+        // Always resolve percentages against the unscaled viewport, as agreed across browsers.
+        float zoom = view->style()->effectiveZoom();
         width = view->viewWidth();
         height = view->viewHeight();
+        if (zoom != 1) {
+            width /= zoom;
+            height /= zoom;
+        }
         return true;
     }
 
@@ -380,12 +387,13 @@ bool SVGLength::determineViewport(const SVGElement* context, float& width, float
     SVGElement* viewportElement = context->viewportElement();
     if (viewportElement && viewportElement->isSVG()) {
         const SVGSVGElement* svg = static_cast<const SVGSVGElement*>(viewportElement);
-        if (svg->hasAttribute(SVGNames::viewBoxAttr)) {
-            width = svg->viewBox().width();
-            height = svg->viewBox().height();
-        } else {
+        FloatRect viewBox = svg->currentViewBoxRect();
+        if (viewBox.isEmpty()) {
             width = svg->width().value(svg);
             height = svg->height().value(svg);
+        } else {
+            width = viewBox.width();
+            height = viewBox.height();
         }
 
         return true;
index c9240f4..efb2b2b 100644 (file)
@@ -87,8 +87,6 @@ inline SVGSVGElement::SVGSVGElement(const QualifiedName& tagName, Document* doc)
     , m_height(LengthModeHeight, "100%") 
     , m_useCurrentView(false)
     , m_timeContainer(SMILTimeContainer::create(this))
-    , m_containerSize(300, 150)
-    , m_hasSetContainerSize(false)
 {
     ASSERT(hasTagName(SVGNames::svgTag));
     registerAnimatedPropertiesForSVGSVGElement();
@@ -154,24 +152,6 @@ FloatRect SVGSVGElement::viewport() const
     return viewBoxToViewTransform(viewRectangle.width(), viewRectangle.height()).mapRect(viewRectangle);
 }
 
-int SVGSVGElement::relativeWidthValue() const
-{
-    SVGLength w = width();
-    if (w.unitType() != LengthTypePercentage)
-        return 0;
-
-    return static_cast<int>(w.valueAsPercentage() * m_containerSize.width());
-}
-
-int SVGSVGElement::relativeHeightValue() const
-{
-    SVGLength h = height();
-    if (h.unitType() != LengthTypePercentage)
-        return 0;
-
-    return static_cast<int>(h.valueAsPercentage() * m_containerSize.height());
-}
-
 float SVGSVGElement::pixelUnitToMillimeterX() const
 {
     // 2.54 / cssPixelsPerInch gives CM.
@@ -579,7 +559,16 @@ FloatRect SVGSVGElement::currentViewBoxRect() const
         return FloatRect();
     }
 
-    return viewBox();
+    // Synthesize a viewBox if we're embedded through a <img> element, if none is present.
+    FloatRect useViewBox = viewBox();
+    if (useViewBox.isEmpty() && width().unitType() != LengthTypePercentage && height().unitType() != LengthTypePercentage) {
+        if (RenderObject* renderer = this->renderer()) {
+            if (renderer->isSVGRoot() && toRenderSVGRoot(renderer)->isEmbeddedThroughImageElement())
+                useViewBox = FloatRect(0, 0, width().value(this), height().value(this));
+        }
+    }
+
+    return useViewBox;
 }
 
 AffineTransform SVGSVGElement::viewBoxToViewTransform(float viewWidth, float viewHeight) const