Changeset 98508 in webkit


Ignore:
Timestamp:
Oct 26, 2011 11:58:59 AM (13 years ago)
Author:
jchaffraix@webkit.org
Message:

Unreviewed, rolling out r98483.
http://trac.webkit.org/changeset/98483
https://bugs.webkit.org/show_bug.cgi?id=47156

Change is causing some crashes and ASSERTs.

Source/WebCore:

  • loader/cache/CachedImage.cpp:

(WebCore::CachedImage::lookupImageForSize):
(WebCore::CachedImage::lookupImageForRenderer):
(WebCore::CachedImage::lookupOrCreateImageForRenderer):
(WebCore::CachedImage::setContainerSizeForRenderer):
(WebCore::CachedImage::imageSizeForRenderer):
(WebCore::CachedImage::computeIntrinsicDimensions):
(WebCore::CachedImage::createImage):

  • loader/cache/CachedImage.h:
  • page/ChromeClient.h:
  • rendering/ImageBySizeCache.cpp:

(WebCore::ImageBySizeCache::addClient):
(WebCore::ImageBySizeCache::removeClient):
(WebCore::ImageBySizeCache::imageForSize):
(WebCore::ImageBySizeCache::sizeForClient):

  • rendering/ImageBySizeCache.h:
  • rendering/RenderBoxModelObject.cpp:

(WebCore::RenderBoxModelObject::calculateFillTileSize):
(WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
(WebCore::RenderBoxModelObject::paintNinePieceImage):

  • rendering/RenderBoxModelObject.h:
  • rendering/RenderImage.cpp:

(WebCore::RenderImage::RenderImage):
(WebCore::RenderImage::imageDimensionsChanged):
(WebCore::RenderImage::isLogicalWidthSpecified):
(WebCore::RenderImage::isLogicalHeightSpecified):
(WebCore::RenderImage::computeReplacedLogicalWidth):
(WebCore::RenderImage::computeReplacedLogicalHeight):
(WebCore::RenderImage::calcAspectRatioLogicalWidth):
(WebCore::RenderImage::calcAspectRatioLogicalHeight):

  • rendering/RenderImage.h:
  • rendering/RenderImageResource.cpp:

(WebCore::RenderImageResource::setContainerSizeForRenderer):

  • rendering/RenderImageResourceStyleImage.cpp:
  • rendering/RenderImageResourceStyleImage.h:

(WebCore::RenderImageResourceStyleImage::image):
(WebCore::RenderImageResourceStyleImage::setContainerSizeForRenderer):

  • rendering/RenderListMarker.cpp:

(WebCore::RenderListMarker::computePreferredLogicalWidths):

  • rendering/RenderReplaced.cpp:

(WebCore::RenderReplaced::computeIntrinsicLogicalWidth):
(WebCore::RenderReplaced::computeIntrinsicLogicalHeight):
(WebCore::RenderReplaced::computeReplacedLogicalWidth):

  • rendering/style/StyleCachedImage.cpp:

(WebCore::StyleCachedImage::computeIntrinsicDimensions):
(WebCore::StyleCachedImage::setContainerSizeForRenderer):
(WebCore::StyleCachedImage::addClient):
(WebCore::StyleCachedImage::removeClient):

  • rendering/style/StyleCachedImage.h:
  • rendering/style/StyleGeneratedImage.h:

(WebCore::StyleGeneratedImage::setContainerSizeForRenderer):

  • rendering/style/StyleImage.h:
  • rendering/style/StylePendingImage.h:

(WebCore::StylePendingImage::setContainerSizeForRenderer):

  • rendering/svg/RenderSVGImage.cpp:

(WebCore::RenderSVGImage::layout):

  • rendering/svg/RenderSVGRoot.cpp:

(WebCore::RenderSVGRoot::computeIntrinsicWidth):
(WebCore::RenderSVGRoot::computeIntrinsicHeight):
(WebCore::RenderSVGRoot::computeReplacedLogicalWidth):
(WebCore::RenderSVGRoot::computeReplacedLogicalHeight):
(WebCore::RenderSVGRoot::layout):
(WebCore::RenderSVGRoot::paint):
(WebCore::RenderSVGRoot::calcViewport):
(WebCore::RenderSVGRoot::computeRectForRepaint):

  • rendering/svg/RenderSVGRoot.h:
  • svg/SVGLength.cpp:

(WebCore::SVGLength::determineViewport):

  • svg/SVGSVGElement.cpp:

(WebCore::SVGSVGElement::SVGSVGElement):
(WebCore::SVGSVGElement::relativeWidthValue):
(WebCore::SVGSVGElement::relativeHeightValue):
(WebCore::SVGSVGElement::currentViewBoxRect):

  • svg/SVGSVGElement.h:

(WebCore::SVGSVGElement::setContainerSize):
(WebCore::SVGSVGElement::containerSize):
(WebCore::SVGSVGElement::hasSetContainerSize):

  • svg/graphics/SVGImage.cpp:

(WebCore::SVGImage::setContainerSize):
(WebCore::SVGImage::usesContainerSize):
(WebCore::SVGImage::size):
(WebCore::SVGImage::hasRelativeWidth):
(WebCore::SVGImage::hasRelativeHeight):
(WebCore::SVGImage::draw):
(WebCore::SVGImage::computeIntrinsicDimensions):
(WebCore::SVGImage::dataChanged):

  • svg/graphics/SVGImage.h:

LayoutTests:

  • css2.1/20110323/background-intrinsic-001.htm: Removed.
  • css2.1/20110323/background-intrinsic-002.htm: Removed.
  • css2.1/20110323/background-intrinsic-003.htm: Removed.
  • css2.1/20110323/background-intrinsic-004.htm: Removed.
  • css2.1/20110323/background-intrinsic-005.htm: Removed.
  • css2.1/20110323/background-intrinsic-006.htm: Removed.
  • css2.1/20110323/background-intrinsic-007.htm: Removed.
  • css2.1/20110323/background-intrinsic-008.htm: Removed.
  • css2.1/20110323/background-intrinsic-009.htm: Removed.
  • css2.1/20110323/resources/green-intrinsic-height-ratio.svg: Removed.
  • css2.1/20110323/resources/green-intrinsic-height.svg: Removed.
  • css2.1/20110323/resources/green-intrinsic-none.svg: Removed.
  • css2.1/20110323/resources/green-intrinsic-ratio-landscape.svg: Removed.
  • css2.1/20110323/resources/green-intrinsic-ratio-portrait.svg: Removed.
  • css2.1/20110323/resources/green-intrinsic-width-height.svg: Removed.
  • css2.1/20110323/resources/green-intrinsic-width-pc-height-pc.svg: Removed.
  • css2.1/20110323/resources/green-intrinsic-width-ratio.svg: Removed.
  • css2.1/20110323/resources/green-intrinsic-width.svg: Removed.
  • css2.1/20110323/resources/red-intrinsic-height-ratio.svg: Removed.
  • css2.1/20110323/resources/red-intrinsic-height.svg: Removed.
  • css2.1/20110323/resources/red-intrinsic-none.svg: Removed.
  • css2.1/20110323/resources/red-intrinsic-ratio-landscape.svg: Removed.
  • css2.1/20110323/resources/red-intrinsic-ratio-portrait.svg: Removed.
  • css2.1/20110323/resources/red-intrinsic-width-height.svg: Removed.
  • css2.1/20110323/resources/red-intrinsic-width-pc-height-pc.svg: Removed.
  • css2.1/20110323/resources/red-intrinsic-width-ratio.svg: Removed.
  • css2.1/20110323/resources/red-intrinsic-width.svg: Removed.
  • fast/backgrounds/size/contain-and-cover-zoomed.html: Removed.
  • fast/images/percent-height-image-expected.txt:
  • fast/images/percent-height-image.html:
  • platform/mac-snowleopard/svg/zoom/page/relative-sized-document-scrollbars-expected.png: Added.
  • platform/mac-snowleopard/svg/zoom/page/zoom-foreignObject-expected.png: Added.
  • platform/mac/css1/text_properties/vertical_align-expected.txt:
  • platform/mac/css2.1/20110323/background-intrinsic-001-expected.png: Removed.
  • platform/mac/css2.1/20110323/background-intrinsic-001-expected.txt: Removed.
  • platform/mac/css2.1/20110323/background-intrinsic-002-expected.png: Removed.
  • platform/mac/css2.1/20110323/background-intrinsic-002-expected.txt: Removed.
  • platform/mac/css2.1/20110323/background-intrinsic-003-expected.png: Removed.
  • platform/mac/css2.1/20110323/background-intrinsic-003-expected.txt: Removed.
  • platform/mac/css2.1/20110323/background-intrinsic-004-expected.png: Removed.
  • platform/mac/css2.1/20110323/background-intrinsic-004-expected.txt: Removed.
  • platform/mac/css2.1/20110323/background-intrinsic-005-expected.png: Removed.
  • platform/mac/css2.1/20110323/background-intrinsic-005-expected.txt: Removed.
  • platform/mac/css2.1/20110323/background-intrinsic-006-expected.png: Removed.
  • platform/mac/css2.1/20110323/background-intrinsic-006-expected.txt: Removed.
  • platform/mac/css2.1/20110323/background-intrinsic-007-expected.png: Removed.
  • platform/mac/css2.1/20110323/background-intrinsic-007-expected.txt: Removed.
  • platform/mac/css2.1/20110323/background-intrinsic-008-expected.png: Removed.
  • platform/mac/css2.1/20110323/background-intrinsic-008-expected.txt: Removed.
  • platform/mac/css2.1/20110323/background-intrinsic-009-expected.png: Removed.
  • platform/mac/css2.1/20110323/background-intrinsic-009-expected.txt: Removed.
  • platform/mac/fast/backgrounds/size/contain-and-cover-expected.png:
  • platform/mac/fast/backgrounds/size/contain-and-cover-zoomed-expected.png: Removed.
  • platform/mac/fast/backgrounds/size/contain-and-cover-zoomed-expected.txt: Removed.
  • platform/mac/fast/block/float/015-expected.png:
  • platform/mac/fast/block/float/015-expected.txt:
  • platform/mac/fast/block/positioning/replaced-inside-fixed-top-bottom-expected.png:
  • platform/mac/fast/block/positioning/replaced-inside-fixed-top-bottom-expected.txt:
  • platform/mac/fast/repaint/block-layout-inline-children-replaced-expected.png:
  • platform/mac/fast/repaint/block-layout-inline-children-replaced-expected.txt:
  • platform/mac/svg/as-background-image/background-image-preserveaspectRatio-support-expected.png: Removed.
  • platform/mac/svg/as-background-image/background-image-preserveaspectRatio-support-expected.txt: Removed.
  • platform/mac/svg/as-background-image/background-image-tiled-expected.png: Removed.
  • platform/mac/svg/as-background-image/background-image-tiled-expected.txt: Removed.
  • platform/mac/svg/as-background-image/same-image-two-instances-background-image-expected.png: Removed.
  • platform/mac/svg/as-background-image/same-image-two-instances-background-image-expected.txt: Removed.
  • platform/mac/svg/as-background-image/svg-as-background-4-expected.png:
  • platform/mac/svg/as-border-image/svg-as-border-image-expected.png:
  • platform/mac/svg/as-image/animated-svg-as-image-expected.png:
  • platform/mac/svg/as-image/img-preserveAspectRatio-support-1-expected.png: Removed.
  • platform/mac/svg/as-image/img-preserveAspectRatio-support-1-expected.txt: Removed.
  • platform/mac/svg/as-image/same-image-two-instances-expected.png: Removed.
  • platform/mac/svg/as-image/same-image-two-instances-expected.txt: Removed.
  • platform/mac/svg/as-image/svg-as-relative-image-expected.png:
  • platform/mac/svg/as-image/svg-as-relative-image-with-explicit-size-expected.png: Removed.
  • platform/mac/svg/as-image/svg-as-relative-image-with-explicit-size-expected.txt: Removed.
  • platform/mac/svg/as-image/svg-image-change-content-size-expected.png: Removed.
  • platform/mac/svg/as-image/svg-image-change-content-size-expected.txt: Removed.
  • platform/mac/svg/zoom/page/relative-sized-document-scrollbars-expected.png:
  • platform/mac/svg/zoom/page/relative-sized-document-scrollbars-expected.txt:
  • platform/mac/svg/zoom/page/zoom-background-image-tiled-expected.png: Removed.
  • platform/mac/svg/zoom/page/zoom-background-image-tiled-expected.txt: Removed.
  • platform/mac/svg/zoom/page/zoom-background-images-expected.png: Removed.
  • platform/mac/svg/zoom/page/zoom-background-images-expected.txt: Removed.
  • platform/mac/svg/zoom/page/zoom-foreignObject-expected.png:
  • platform/mac/svg/zoom/page/zoom-foreignObject-expected.txt:
  • platform/mac/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.png: Removed.
  • platform/mac/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.txt: Removed.
  • platform/mac/svg/zoom/page/zoom-svg-as-background-with-relative-size-and-viewBox-expected.png: Removed.
  • platform/mac/svg/zoom/page/zoom-svg-as-background-with-relative-size-and-viewBox-expected.txt: Removed.
  • platform/mac/svg/zoom/page/zoom-svg-as-background-with-relative-size-expected.png: Removed.
  • platform/mac/svg/zoom/page/zoom-svg-as-background-with-relative-size-expected.txt: Removed.
  • svg/as-background-image/background-image-preserveaspectRatio-support.html: Removed.
  • svg/as-background-image/background-image-tiled.html: Removed.
  • svg/as-background-image/resources/construction-tape.svg: Removed.
  • svg/as-background-image/resources/hearts.svg:
  • svg/as-background-image/same-image-two-instances-background-image.html: Removed.
  • svg/as-image/img-preserveAspectRatio-support-1.html: Removed.
  • svg/as-image/resources/circle-default-meet.svg: Removed.
  • svg/as-image/resources/circle-default-none.svg: Removed.
  • svg/as-image/resources/circle-default-slice.svg: Removed.
  • svg/as-image/resources/circle-nosize.svg: Removed.
  • svg/as-image/resources/circle-viewbox-default.svg: Removed.
  • svg/as-image/resources/circle-viewbox-meet.svg: Removed.
  • svg/as-image/resources/circle-viewbox-none.svg: Removed.
  • svg/as-image/resources/circle-viewbox-slice.svg: Removed.
  • svg/as-image/resources/green-relative-size-rect.svg:
  • svg/as-image/same-image-two-instances.html: Removed.
  • svg/as-image/svg-as-relative-image-with-explicit-size.html: Removed.
  • svg/as-image/svg-image-change-content-size.xhtml: Removed.
  • svg/zoom/page/resources/relative-sized-background-with-viewBox.svg: Removed.
  • svg/zoom/page/zoom-background-image-tiled.html: Removed.
  • svg/zoom/page/zoom-background-images.html: Removed.
  • svg/zoom/page/zoom-img-preserveAspectRatio-support-1.html: Removed.
  • svg/zoom/page/zoom-svg-as-background-with-relative-size-and-viewBox.html: Removed.
  • svg/zoom/page/zoom-svg-as-background-with-relative-size.html: Removed.
Location:
trunk
Files:
2 added
94 deleted
49 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r98507 r98508  
     12011-10-26  Julien Chaffraix  <jchaffraix@webkit.org>
     2
     3        Unreviewed, rolling out r98483.
     4        http://trac.webkit.org/changeset/98483
     5        https://bugs.webkit.org/show_bug.cgi?id=47156
     6
     7        Change is causing some crashes and ASSERTs.
     8
     9        * css2.1/20110323/background-intrinsic-001.htm: Removed.
     10        * css2.1/20110323/background-intrinsic-002.htm: Removed.
     11        * css2.1/20110323/background-intrinsic-003.htm: Removed.
     12        * css2.1/20110323/background-intrinsic-004.htm: Removed.
     13        * css2.1/20110323/background-intrinsic-005.htm: Removed.
     14        * css2.1/20110323/background-intrinsic-006.htm: Removed.
     15        * css2.1/20110323/background-intrinsic-007.htm: Removed.
     16        * css2.1/20110323/background-intrinsic-008.htm: Removed.
     17        * css2.1/20110323/background-intrinsic-009.htm: Removed.
     18        * css2.1/20110323/resources/green-intrinsic-height-ratio.svg: Removed.
     19        * css2.1/20110323/resources/green-intrinsic-height.svg: Removed.
     20        * css2.1/20110323/resources/green-intrinsic-none.svg: Removed.
     21        * css2.1/20110323/resources/green-intrinsic-ratio-landscape.svg: Removed.
     22        * css2.1/20110323/resources/green-intrinsic-ratio-portrait.svg: Removed.
     23        * css2.1/20110323/resources/green-intrinsic-width-height.svg: Removed.
     24        * css2.1/20110323/resources/green-intrinsic-width-pc-height-pc.svg: Removed.
     25        * css2.1/20110323/resources/green-intrinsic-width-ratio.svg: Removed.
     26        * css2.1/20110323/resources/green-intrinsic-width.svg: Removed.
     27        * css2.1/20110323/resources/red-intrinsic-height-ratio.svg: Removed.
     28        * css2.1/20110323/resources/red-intrinsic-height.svg: Removed.
     29        * css2.1/20110323/resources/red-intrinsic-none.svg: Removed.
     30        * css2.1/20110323/resources/red-intrinsic-ratio-landscape.svg: Removed.
     31        * css2.1/20110323/resources/red-intrinsic-ratio-portrait.svg: Removed.
     32        * css2.1/20110323/resources/red-intrinsic-width-height.svg: Removed.
     33        * css2.1/20110323/resources/red-intrinsic-width-pc-height-pc.svg: Removed.
     34        * css2.1/20110323/resources/red-intrinsic-width-ratio.svg: Removed.
     35        * css2.1/20110323/resources/red-intrinsic-width.svg: Removed.
     36        * fast/backgrounds/size/contain-and-cover-zoomed.html: Removed.
     37        * fast/images/percent-height-image-expected.txt:
     38        * fast/images/percent-height-image.html:
     39        * platform/mac-snowleopard/svg/zoom/page/relative-sized-document-scrollbars-expected.png: Added.
     40        * platform/mac-snowleopard/svg/zoom/page/zoom-foreignObject-expected.png: Added.
     41        * platform/mac/css1/text_properties/vertical_align-expected.txt:
     42        * platform/mac/css2.1/20110323/background-intrinsic-001-expected.png: Removed.
     43        * platform/mac/css2.1/20110323/background-intrinsic-001-expected.txt: Removed.
     44        * platform/mac/css2.1/20110323/background-intrinsic-002-expected.png: Removed.
     45        * platform/mac/css2.1/20110323/background-intrinsic-002-expected.txt: Removed.
     46        * platform/mac/css2.1/20110323/background-intrinsic-003-expected.png: Removed.
     47        * platform/mac/css2.1/20110323/background-intrinsic-003-expected.txt: Removed.
     48        * platform/mac/css2.1/20110323/background-intrinsic-004-expected.png: Removed.
     49        * platform/mac/css2.1/20110323/background-intrinsic-004-expected.txt: Removed.
     50        * platform/mac/css2.1/20110323/background-intrinsic-005-expected.png: Removed.
     51        * platform/mac/css2.1/20110323/background-intrinsic-005-expected.txt: Removed.
     52        * platform/mac/css2.1/20110323/background-intrinsic-006-expected.png: Removed.
     53        * platform/mac/css2.1/20110323/background-intrinsic-006-expected.txt: Removed.
     54        * platform/mac/css2.1/20110323/background-intrinsic-007-expected.png: Removed.
     55        * platform/mac/css2.1/20110323/background-intrinsic-007-expected.txt: Removed.
     56        * platform/mac/css2.1/20110323/background-intrinsic-008-expected.png: Removed.
     57        * platform/mac/css2.1/20110323/background-intrinsic-008-expected.txt: Removed.
     58        * platform/mac/css2.1/20110323/background-intrinsic-009-expected.png: Removed.
     59        * platform/mac/css2.1/20110323/background-intrinsic-009-expected.txt: Removed.
     60        * platform/mac/fast/backgrounds/size/contain-and-cover-expected.png:
     61        * platform/mac/fast/backgrounds/size/contain-and-cover-zoomed-expected.png: Removed.
     62        * platform/mac/fast/backgrounds/size/contain-and-cover-zoomed-expected.txt: Removed.
     63        * platform/mac/fast/block/float/015-expected.png:
     64        * platform/mac/fast/block/float/015-expected.txt:
     65        * platform/mac/fast/block/positioning/replaced-inside-fixed-top-bottom-expected.png:
     66        * platform/mac/fast/block/positioning/replaced-inside-fixed-top-bottom-expected.txt:
     67        * platform/mac/fast/repaint/block-layout-inline-children-replaced-expected.png:
     68        * platform/mac/fast/repaint/block-layout-inline-children-replaced-expected.txt:
     69        * platform/mac/svg/as-background-image/background-image-preserveaspectRatio-support-expected.png: Removed.
     70        * platform/mac/svg/as-background-image/background-image-preserveaspectRatio-support-expected.txt: Removed.
     71        * platform/mac/svg/as-background-image/background-image-tiled-expected.png: Removed.
     72        * platform/mac/svg/as-background-image/background-image-tiled-expected.txt: Removed.
     73        * platform/mac/svg/as-background-image/same-image-two-instances-background-image-expected.png: Removed.
     74        * platform/mac/svg/as-background-image/same-image-two-instances-background-image-expected.txt: Removed.
     75        * platform/mac/svg/as-background-image/svg-as-background-4-expected.png:
     76        * platform/mac/svg/as-border-image/svg-as-border-image-expected.png:
     77        * platform/mac/svg/as-image/animated-svg-as-image-expected.png:
     78        * platform/mac/svg/as-image/img-preserveAspectRatio-support-1-expected.png: Removed.
     79        * platform/mac/svg/as-image/img-preserveAspectRatio-support-1-expected.txt: Removed.
     80        * platform/mac/svg/as-image/same-image-two-instances-expected.png: Removed.
     81        * platform/mac/svg/as-image/same-image-two-instances-expected.txt: Removed.
     82        * platform/mac/svg/as-image/svg-as-relative-image-expected.png:
     83        * platform/mac/svg/as-image/svg-as-relative-image-with-explicit-size-expected.png: Removed.
     84        * platform/mac/svg/as-image/svg-as-relative-image-with-explicit-size-expected.txt: Removed.
     85        * platform/mac/svg/as-image/svg-image-change-content-size-expected.png: Removed.
     86        * platform/mac/svg/as-image/svg-image-change-content-size-expected.txt: Removed.
     87        * platform/mac/svg/zoom/page/relative-sized-document-scrollbars-expected.png:
     88        * platform/mac/svg/zoom/page/relative-sized-document-scrollbars-expected.txt:
     89        * platform/mac/svg/zoom/page/zoom-background-image-tiled-expected.png: Removed.
     90        * platform/mac/svg/zoom/page/zoom-background-image-tiled-expected.txt: Removed.
     91        * platform/mac/svg/zoom/page/zoom-background-images-expected.png: Removed.
     92        * platform/mac/svg/zoom/page/zoom-background-images-expected.txt: Removed.
     93        * platform/mac/svg/zoom/page/zoom-foreignObject-expected.png:
     94        * platform/mac/svg/zoom/page/zoom-foreignObject-expected.txt:
     95        * platform/mac/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.png: Removed.
     96        * platform/mac/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.txt: Removed.
     97        * platform/mac/svg/zoom/page/zoom-svg-as-background-with-relative-size-and-viewBox-expected.png: Removed.
     98        * platform/mac/svg/zoom/page/zoom-svg-as-background-with-relative-size-and-viewBox-expected.txt: Removed.
     99        * platform/mac/svg/zoom/page/zoom-svg-as-background-with-relative-size-expected.png: Removed.
     100        * platform/mac/svg/zoom/page/zoom-svg-as-background-with-relative-size-expected.txt: Removed.
     101        * svg/as-background-image/background-image-preserveaspectRatio-support.html: Removed.
     102        * svg/as-background-image/background-image-tiled.html: Removed.
     103        * svg/as-background-image/resources/construction-tape.svg: Removed.
     104        * svg/as-background-image/resources/hearts.svg:
     105        * svg/as-background-image/same-image-two-instances-background-image.html: Removed.
     106        * svg/as-image/img-preserveAspectRatio-support-1.html: Removed.
     107        * svg/as-image/resources/circle-default-meet.svg: Removed.
     108        * svg/as-image/resources/circle-default-none.svg: Removed.
     109        * svg/as-image/resources/circle-default-slice.svg: Removed.
     110        * svg/as-image/resources/circle-nosize.svg: Removed.
     111        * svg/as-image/resources/circle-viewbox-default.svg: Removed.
     112        * svg/as-image/resources/circle-viewbox-meet.svg: Removed.
     113        * svg/as-image/resources/circle-viewbox-none.svg: Removed.
     114        * svg/as-image/resources/circle-viewbox-slice.svg: Removed.
     115        * svg/as-image/resources/green-relative-size-rect.svg:
     116        * svg/as-image/same-image-two-instances.html: Removed.
     117        * svg/as-image/svg-as-relative-image-with-explicit-size.html: Removed.
     118        * svg/as-image/svg-image-change-content-size.xhtml: Removed.
     119        * svg/zoom/page/resources/relative-sized-background-with-viewBox.svg: Removed.
     120        * svg/zoom/page/zoom-background-image-tiled.html: Removed.
     121        * svg/zoom/page/zoom-background-images.html: Removed.
     122        * svg/zoom/page/zoom-img-preserveAspectRatio-support-1.html: Removed.
     123        * svg/zoom/page/zoom-svg-as-background-with-relative-size-and-viewBox.html: Removed.
     124        * svg/zoom/page/zoom-svg-as-background-with-relative-size.html: Removed.
     125
    11262011-10-26  Eric Carlson  <eric.carlson@apple.com>
    2127
  • trunk/LayoutTests/fast/images/percent-height-image-expected.txt

    r98483 r98508  
    22See Bug: http://bugs.webkit.org/show_bug.cgi?id=45439
    33
    4 PASS
     4FAIL: image height was 600 expected 20
  • trunk/LayoutTests/fast/images/percent-height-image.html

    r98483 r98508  
    55<div style="float: left;">
    66    <!-- src is a 20 x 20 PNG -->
    7     <img style="height: 100%; width: 100%;" onload="check()" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAMAAAC6V+0/AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAMAUExURQ//W/8AAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPzdRA4AAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjLX7mlDAAAAaUlEQVQoU23QQQ4AIQgDQPD/j5ZSCkYlxsPoSlnzT5mvu8yBjoPcULaAYG60RFxrDHsQVshvY6URsw8WjY2isnuZ3lTfudn5NEVFYmbN0BjWcYWVpU44kbKc2Hbg2KBMMyC85ph/HfipDQwyAn26rjFKAAAAAElFTkSuQmCC"/>
     7    <img style="height: 100%; width: 100%;" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAMAAAC6V+0/AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAMAUExURQ//W/8AAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPzdRA4AAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjLX7mlDAAAAaUlEQVQoU23QQQ4AIQgDQPD/j5ZSCkYlxsPoSlnzT5mvu8yBjoPcULaAYG60RFxrDHsQVshvY6URsw8WjY2isnuZ3lTfudn5NEVFYmbN0BjWcYWVpU44kbKc2Hbg2KBMMyC85ph/HfipDQwyAn26rjFKAAAAAElFTkSuQmCC"/>
    88</div>
    99<pre></pre>
    1010<script>
    11     if (window.layoutTestController) {
    12         layoutTestController.waitUntilDone();
     11    if (window.layoutTestController)
    1312        layoutTestController.dumpAsText();
    14     }
    1513
    16     function check() {
    17         var expected = 20;
    18         var actual = document.querySelector("img").offsetHeight;
    19         var out = document.querySelector("pre");
    20         if (actual == expected)
    21             out.textContent = "PASS";
    22         else
    23             out.textContent = "FAIL: image height was " + actual + " expected " + expected;
    24         layoutTestController.notifyDone();
    25     }
     14    var expected = 20;
     15    var actual = document.querySelector("img").offsetHeight;
     16    var out = document.querySelector("pre");
     17    if (actual == expected)
     18        out.textContent = "PASS";
     19    else
     20        out.textContent = "FAIL: image height was " + actual + " expected " + expected;
    2621</script>
  • trunk/LayoutTests/platform/mac/css1/text_properties/vertical_align-expected.txt

    r98483 r98508  
    173173        RenderText {#text} at (80,122) size 101x22
    174174          text run at (80,122) width 101: " all of which "
    175         RenderImage {IMG} at (181,122) size 20x65
    176         RenderText {#text} at (201,122) size 5x22
    177           text run at (201,122) width 5: " "
     175        RenderImage {IMG} at (181,122) size 19x65
     176        RenderText {#text} at (200,122) size 5x22
     177          text run at (200,122) width 5: " "
    178178        RenderInline {SPAN} at (0,0) size 262x43
    179           RenderText {#text} at (206,105) size 262x43
    180             text run at (206,105) width 262: "should be aligned"
    181         RenderText {#text} at (468,122) size 5x22
    182           text run at (468,122) width 5: " "
    183         RenderImage {IMG} at (473,122) size 11x35
    184         RenderText {#text} at (484,122) size 123x22
    185           text run at (484,122) width 123: " with the top of "
    186         RenderImage {IMG} at (607,122) size 9x30
    187         RenderText {#text} at (616,122) size 5x22
    188           text run at (616,122) width 5: " "
    189         RenderInline {SPAN} at (0,0) size 733x144
    190           RenderText {#text} at (621,114) size 19x32
    191             text run at (621,114) width 19: "a "
    192           RenderInline {SPAN} at (0,0) size 733x194
    193             RenderText {#text} at (640,75) size 733x194
    194               text run at (640,75) width 93: "14-"
     179          RenderText {#text} at (205,105) size 262x43
     180            text run at (205,105) width 262: "should be aligned"
     181        RenderText {#text} at (467,122) size 5x22
     182          text run at (467,122) width 5: " "
     183        RenderImage {IMG} at (472,122) size 10x35
     184        RenderText {#text} at (482,122) size 123x22
     185          text run at (482,122) width 123: " with the top of "
     186        RenderImage {IMG} at (605,122) size 9x30
     187        RenderText {#text} at (614,122) size 5x22
     188          text run at (614,122) width 5: " "
     189        RenderInline {SPAN} at (0,0) size 731x144
     190          RenderText {#text} at (619,114) size 19x32
     191            text run at (619,114) width 19: "a "
     192          RenderInline {SPAN} at (0,0) size 731x194
     193            RenderText {#text} at (638,75) size 731x194
     194              text run at (638,75) width 93: "14-"
    195195              text run at (0,187) width 143: "point"
    196196          RenderText {#text} at (143,226) size 144x32
     
    206206        RenderText {#text} at (501,234) size 5x22
    207207          text run at (501,234) width 5: " "
    208         RenderImage {IMG} at (506,234) size 5x15
    209         RenderText {#text} at (511,234) size 5x22
    210           text run at (511,234) width 5: " "
     208        RenderImage {IMG} at (506,234) size 4x15
     209        RenderText {#text} at (510,234) size 5x22
     210          text run at (510,234) width 5: " "
    211211        RenderInline {BIG} at (0,0) size 156x24
    212           RenderText {#text} at (516,232) size 156x24
    213             text run at (516,232) width 156: "the images appear."
    214         RenderText {#text} at (672,234) size 5x22
    215           text run at (672,234) width 5: " "
    216         RenderImage {IMG} at (677,234) size 27x90
     212          RenderText {#text} at (515,232) size 156x24
     213            text run at (515,232) width 156: "the images appear."
     214        RenderText {#text} at (671,234) size 5x22
     215          text run at (671,234) width 5: " "
     216        RenderImage {IMG} at (676,234) size 27x90
    217217        RenderText {#text} at (0,0) size 0x0
    218218      RenderBlock {P} at (0,1784) size 769x36
     
    246246          text run at (696,22) width 36: " all of"
    247247          text run at (0,98) width 43: "which "
    248         RenderImage {IMG} at (43,77) size 20x65
    249         RenderText {#text} at (63,98) size 119x18
    250           text run at (63,98) width 119: " should be aligned "
    251         RenderImage {IMG} at (182,92) size 11x35
    252         RenderText {#text} at (193,98) size 4x18
    253           text run at (193,98) width 4: " "
     248        RenderImage {IMG} at (43,77) size 19x65
     249        RenderText {#text} at (62,98) size 119x18
     250          text run at (62,98) width 119: " should be aligned "
     251        RenderImage {IMG} at (181,92) size 10x35
     252        RenderText {#text} at (191,98) size 4x18
     253          text run at (191,98) width 4: " "
    254254        RenderInline {SPAN} at (0,0) size 236x37
    255           RenderText {#text} at (197,83) size 236x37
    256             text run at (197,83) width 236: "with the middle of"
    257         RenderText {#text} at (433,98) size 4x18
    258           text run at (433,98) width 4: " "
    259         RenderImage {IMG} at (437,84) size 15x50
    260         RenderText {#text} at (452,98) size 4x18
    261           text run at (452,98) width 4: " "
    262         RenderInline {SPAN} at (0,0) size 720x106
    263           RenderText {#text} at (456,90) size 17x28
    264             text run at (456,90) width 17: "a "
     255          RenderText {#text} at (195,83) size 236x37
     256            text run at (195,83) width 236: "with the middle of"
     257        RenderText {#text} at (431,98) size 4x18
     258          text run at (431,98) width 4: " "
     259        RenderImage {IMG} at (435,84) size 15x50
     260        RenderText {#text} at (450,98) size 4x18
     261          text run at (450,98) width 4: " "
     262        RenderInline {SPAN} at (0,0) size 718x106
     263          RenderText {#text} at (454,90) size 17x28
     264            text run at (454,90) width 17: "a "
    265265          RenderInline {SPAN} at (0,0) size 204x69
    266             RenderText {#text} at (473,58) size 204x69
    267               text run at (473,58) width 204: "14-point"
    268           RenderText {#text} at (677,90) size 720x106
    269             text run at (677,90) width 43: " text"
     266            RenderText {#text} at (471,58) size 204x69
     267              text run at (471,58) width 204: "14-point"
     268          RenderText {#text} at (675,90) size 718x106
     269            text run at (675,90) width 43: " text"
    270270            text run at (0,168) width 78: "element"
    271271        RenderText {#text} at (78,176) size 4x18
     
    279279        RenderText {#text} at (290,176) size 4x18
    280280          text run at (290,176) width 4: " "
    281         RenderImage {IMG} at (294,180) size 5x15
    282         RenderText {#text} at (299,176) size 4x18
    283           text run at (299,176) width 4: " "
     281        RenderImage {IMG} at (294,180) size 4x15
     282        RenderText {#text} at (298,176) size 4x18
     283          text run at (298,176) width 4: " "
    284284        RenderInline {BIG} at (0,0) size 156x24
    285           RenderText {#text} at (303,171) size 156x24
    286             text run at (303,171) width 156: "the images appear."
    287         RenderText {#text} at (459,176) size 4x18
    288           text run at (459,176) width 4: " "
    289         RenderImage {IMG} at (463,142) size 27x90
     285          RenderText {#text} at (302,171) size 156x24
     286            text run at (302,171) width 156: "the images appear."
     287        RenderText {#text} at (458,176) size 4x18
     288          text run at (458,176) width 4: " "
     289        RenderImage {IMG} at (462,142) size 27x90
    290290        RenderText {#text} at (0,0) size 0x0
    291291      RenderBlock {P} at (0,2084) size 769x36
     
    341341        RenderText {#text} at (146,46) size 4x18
    342342          text run at (146,46) width 4: " "
    343         RenderImage {IMG} at (150,46) size 20x65
    344         RenderText {#text} at (170,46) size 4x18
    345           text run at (170,46) width 4: " "
     343        RenderImage {IMG} at (150,46) size 19x65
     344        RenderText {#text} at (169,46) size 4x18
     345          text run at (169,46) width 4: " "
    346346        RenderInline {SPAN} at (0,0) size 111x18
    347           RenderText {#text} at (174,46) size 111x18
    348             text run at (174,46) width 111: "should be aligned"
    349         RenderText {#text} at (285,46) size 4x18
    350           text run at (285,46) width 4: " "
    351         RenderImage {IMG} at (289,46) size 11x35
    352         RenderText {#text} at (300,46) size 4x18
    353           text run at (300,46) width 4: " "
     347          RenderText {#text} at (173,46) size 111x18
     348            text run at (173,46) width 111: "should be aligned"
     349        RenderText {#text} at (284,46) size 4x18
     350          text run at (284,46) width 4: " "
     351        RenderImage {IMG} at (288,46) size 10x35
     352        RenderText {#text} at (298,46) size 4x18
     353          text run at (298,46) width 4: " "
    354354        RenderInline {SPAN} at (0,0) size 188x37
    355           RenderText {#text} at (304,46) size 188x37
    356             text run at (304,46) width 188: "with the top of"
    357         RenderText {#text} at (492,46) size 4x18
    358           text run at (492,46) width 4: " "
    359         RenderImage {IMG} at (496,46) size 15x50
    360         RenderText {#text} at (511,46) size 4x18
    361           text run at (511,46) width 4: " "
     355          RenderText {#text} at (302,46) size 188x37
     356            text run at (302,46) width 188: "with the top of"
     357        RenderText {#text} at (490,46) size 4x18
     358          text run at (490,46) width 4: " "
     359        RenderImage {IMG} at (494,46) size 15x50
     360        RenderText {#text} at (509,46) size 4x18
     361          text run at (509,46) width 4: " "
    362362        RenderInline {SPAN} at (0,0) size 128x18
    363           RenderText {#text} at (515,46) size 128x18
    364             text run at (515,46) width 128: "the tallest element in"
    365         RenderText {#text} at (643,46) size 4x18
    366           text run at (643,46) width 4: " "
    367         RenderImage {IMG} at (647,46) size 5x15
    368         RenderText {#text} at (652,46) size 4x18
    369           text run at (652,46) width 4: " "
    370         RenderInline {BIG} at (0,0) size 744x89
    371           RenderText {#text} at (656,46) size 744x89
    372             text run at (656,46) width 88: "whichever"
     363          RenderText {#text} at (513,46) size 128x18
     364            text run at (513,46) width 128: "the tallest element in"
     365        RenderText {#text} at (641,46) size 4x18
     366          text run at (641,46) width 4: " "
     367        RenderImage {IMG} at (645,46) size 4x15
     368        RenderText {#text} at (649,46) size 4x18
     369          text run at (649,46) width 4: " "
     370        RenderInline {BIG} at (0,0) size 741x89
     371          RenderText {#text} at (653,46) size 741x89
     372            text run at (653,46) width 88: "whichever"
    373373            text run at (0,111) width 208: "line the elements appear."
    374374        RenderText {#text} at (208,111) size 4x18
     
    517517                RenderText {#text} at (80,122) size 101x22
    518518                  text run at (80,122) width 101: " all of which "
    519                 RenderImage {IMG} at (181,122) size 20x65
    520                 RenderText {#text} at (201,122) size 5x22
    521                   text run at (201,122) width 5: " "
     519                RenderImage {IMG} at (181,122) size 19x65
     520                RenderText {#text} at (200,122) size 5x22
     521                  text run at (200,122) width 5: " "
    522522                RenderInline {SPAN} at (0,0) size 262x43
    523                   RenderText {#text} at (206,105) size 262x43
    524                     text run at (206,105) width 262: "should be aligned"
    525                 RenderText {#text} at (468,122) size 5x22
    526                   text run at (468,122) width 5: " "
    527                 RenderImage {IMG} at (473,122) size 11x35
    528                 RenderText {#text} at (484,122) size 123x22
    529                   text run at (484,122) width 123: " with the top of "
    530                 RenderImage {IMG} at (607,122) size 9x30
    531                 RenderText {#text} at (616,122) size 5x22
    532                   text run at (616,122) width 5: " "
    533                 RenderInline {SPAN} at (0,0) size 733x144
    534                   RenderText {#text} at (621,114) size 19x32
    535                     text run at (621,114) width 19: "a "
    536                   RenderInline {SPAN} at (0,0) size 733x194
    537                     RenderText {#text} at (640,75) size 733x194
    538                       text run at (640,75) width 93: "14-"
     523                  RenderText {#text} at (205,105) size 262x43
     524                    text run at (205,105) width 262: "should be aligned"
     525                RenderText {#text} at (467,122) size 5x22
     526                  text run at (467,122) width 5: " "
     527                RenderImage {IMG} at (472,122) size 10x35
     528                RenderText {#text} at (482,122) size 123x22
     529                  text run at (482,122) width 123: " with the top of "
     530                RenderImage {IMG} at (605,122) size 9x30
     531                RenderText {#text} at (614,122) size 5x22
     532                  text run at (614,122) width 5: " "
     533                RenderInline {SPAN} at (0,0) size 731x144
     534                  RenderText {#text} at (619,114) size 19x32
     535                    text run at (619,114) width 19: "a "
     536                  RenderInline {SPAN} at (0,0) size 731x194
     537                    RenderText {#text} at (638,75) size 731x194
     538                      text run at (638,75) width 93: "14-"
    539539                      text run at (0,187) width 143: "point"
    540540                  RenderText {#text} at (143,226) size 144x32
     
    550550                RenderText {#text} at (501,234) size 5x22
    551551                  text run at (501,234) width 5: " "
    552                 RenderImage {IMG} at (506,234) size 5x15
    553                 RenderText {#text} at (511,234) size 5x22
    554                   text run at (511,234) width 5: " "
     552                RenderImage {IMG} at (506,234) size 4x15
     553                RenderText {#text} at (510,234) size 5x22
     554                  text run at (510,234) width 5: " "
    555555                RenderInline {BIG} at (0,0) size 156x24
    556                   RenderText {#text} at (516,232) size 156x24
    557                     text run at (516,232) width 156: "the images appear."
    558                 RenderText {#text} at (672,234) size 5x22
    559                   text run at (672,234) width 5: " "
    560                 RenderImage {IMG} at (677,234) size 27x90
     556                  RenderText {#text} at (515,232) size 156x24
     557                    text run at (515,232) width 156: "the images appear."
     558                RenderText {#text} at (671,234) size 5x22
     559                  text run at (671,234) width 5: " "
     560                RenderImage {IMG} at (676,234) size 27x90
    561561                RenderText {#text} at (0,0) size 0x0
    562562              RenderBlock {P} at (4,1453) size 747x36
     
    590590                  text run at (696,22) width 36: " all of"
    591591                  text run at (0,98) width 43: "which "
    592                 RenderImage {IMG} at (43,77) size 20x65
    593                 RenderText {#text} at (63,98) size 119x18
    594                   text run at (63,98) width 119: " should be aligned "
    595                 RenderImage {IMG} at (182,92) size 11x35
    596                 RenderText {#text} at (193,98) size 4x18
    597                   text run at (193,98) width 4: " "
     592                RenderImage {IMG} at (43,77) size 19x65
     593                RenderText {#text} at (62,98) size 119x18
     594                  text run at (62,98) width 119: " should be aligned "
     595                RenderImage {IMG} at (181,92) size 10x35
     596                RenderText {#text} at (191,98) size 4x18
     597                  text run at (191,98) width 4: " "
    598598                RenderInline {SPAN} at (0,0) size 236x37
    599                   RenderText {#text} at (197,83) size 236x37
    600                     text run at (197,83) width 236: "with the middle of"
    601                 RenderText {#text} at (433,98) size 4x18
    602                   text run at (433,98) width 4: " "
    603                 RenderImage {IMG} at (437,84) size 15x50
    604                 RenderText {#text} at (452,98) size 4x18
    605                   text run at (452,98) width 4: " "
    606                 RenderInline {SPAN} at (0,0) size 720x106
    607                   RenderText {#text} at (456,90) size 17x28
    608                     text run at (456,90) width 17: "a "
     599                  RenderText {#text} at (195,83) size 236x37
     600                    text run at (195,83) width 236: "with the middle of"
     601                RenderText {#text} at (431,98) size 4x18
     602                  text run at (431,98) width 4: " "
     603                RenderImage {IMG} at (435,84) size 15x50
     604                RenderText {#text} at (450,98) size 4x18
     605                  text run at (450,98) width 4: " "
     606                RenderInline {SPAN} at (0,0) size 718x106
     607                  RenderText {#text} at (454,90) size 17x28
     608                    text run at (454,90) width 17: "a "
    609609                  RenderInline {SPAN} at (0,0) size 204x69
    610                     RenderText {#text} at (473,58) size 204x69
    611                       text run at (473,58) width 204: "14-point"
    612                   RenderText {#text} at (677,90) size 720x106
    613                     text run at (677,90) width 43: " text"
     610                    RenderText {#text} at (471,58) size 204x69
     611                      text run at (471,58) width 204: "14-point"
     612                  RenderText {#text} at (675,90) size 718x106
     613                    text run at (675,90) width 43: " text"
    614614                    text run at (0,168) width 78: "element"
    615615                RenderText {#text} at (78,176) size 4x18
     
    623623                RenderText {#text} at (290,176) size 4x18
    624624                  text run at (290,176) width 4: " "
    625                 RenderImage {IMG} at (294,180) size 5x15
    626                 RenderText {#text} at (299,176) size 4x18
    627                   text run at (299,176) width 4: " "
     625                RenderImage {IMG} at (294,180) size 4x15
     626                RenderText {#text} at (298,176) size 4x18
     627                  text run at (298,176) width 4: " "
    628628                RenderInline {BIG} at (0,0) size 156x24
    629                   RenderText {#text} at (303,171) size 156x24
    630                     text run at (303,171) width 156: "the images appear."
    631                 RenderText {#text} at (459,176) size 4x18
    632                   text run at (459,176) width 4: " "
    633                 RenderImage {IMG} at (463,142) size 27x90
     629                  RenderText {#text} at (302,171) size 156x24
     630                    text run at (302,171) width 156: "the images appear."
     631                RenderText {#text} at (458,176) size 4x18
     632                  text run at (458,176) width 4: " "
     633                RenderImage {IMG} at (462,142) size 27x90
    634634                RenderText {#text} at (0,0) size 0x0
    635635              RenderBlock {P} at (4,1753) size 747x36
     
    685685                RenderText {#text} at (146,46) size 4x18
    686686                  text run at (146,46) width 4: " "
    687                 RenderImage {IMG} at (150,46) size 20x65
    688                 RenderText {#text} at (170,46) size 4x18
    689                   text run at (170,46) width 4: " "
     687                RenderImage {IMG} at (150,46) size 19x65
     688                RenderText {#text} at (169,46) size 4x18
     689                  text run at (169,46) width 4: " "
    690690                RenderInline {SPAN} at (0,0) size 111x18
    691                   RenderText {#text} at (174,46) size 111x18
    692                     text run at (174,46) width 111: "should be aligned"
    693                 RenderText {#text} at (285,46) size 4x18
    694                   text run at (285,46) width 4: " "
    695                 RenderImage {IMG} at (289,46) size 11x35
    696                 RenderText {#text} at (300,46) size 4x18
    697                   text run at (300,46) width 4: " "
     691                  RenderText {#text} at (173,46) size 111x18
     692                    text run at (173,46) width 111: "should be aligned"
     693                RenderText {#text} at (284,46) size 4x18
     694                  text run at (284,46) width 4: " "
     695                RenderImage {IMG} at (288,46) size 10x35
     696                RenderText {#text} at (298,46) size 4x18
     697                  text run at (298,46) width 4: " "
    698698                RenderInline {SPAN} at (0,0) size 188x37
    699                   RenderText {#text} at (304,46) size 188x37
    700                     text run at (304,46) width 188: "with the top of"
    701                 RenderText {#text} at (492,46) size 4x18
    702                   text run at (492,46) width 4: " "
    703                 RenderImage {IMG} at (496,46) size 15x50
    704                 RenderText {#text} at (511,46) size 4x18
    705                   text run at (511,46) width 4: " "
     699                  RenderText {#text} at (302,46) size 188x37
     700                    text run at (302,46) width 188: "with the top of"
     701                RenderText {#text} at (490,46) size 4x18
     702                  text run at (490,46) width 4: " "
     703                RenderImage {IMG} at (494,46) size 15x50
     704                RenderText {#text} at (509,46) size 4x18
     705                  text run at (509,46) width 4: " "
    706706                RenderInline {SPAN} at (0,0) size 128x18
    707                   RenderText {#text} at (515,46) size 128x18
    708                     text run at (515,46) width 128: "the tallest element in"
    709                 RenderText {#text} at (643,46) size 4x18
    710                   text run at (643,46) width 4: " "
    711                 RenderImage {IMG} at (647,46) size 5x15
    712                 RenderText {#text} at (652,46) size 4x18
    713                   text run at (652,46) width 4: " "
    714                 RenderInline {BIG} at (0,0) size 744x89
    715                   RenderText {#text} at (656,46) size 744x89
    716                     text run at (656,46) width 88: "whichever"
     707                  RenderText {#text} at (513,46) size 128x18
     708                    text run at (513,46) width 128: "the tallest element in"
     709                RenderText {#text} at (641,46) size 4x18
     710                  text run at (641,46) width 4: " "
     711                RenderImage {IMG} at (645,46) size 4x15
     712                RenderText {#text} at (649,46) size 4x18
     713                  text run at (649,46) width 4: " "
     714                RenderInline {BIG} at (0,0) size 741x89
     715                  RenderText {#text} at (653,46) size 741x89
     716                    text run at (653,46) width 88: "whichever"
    717717                    text run at (0,111) width 208: "line the elements appear."
    718718                RenderText {#text} at (208,111) size 4x18
  • trunk/LayoutTests/platform/mac/fast/block/float/015-expected.txt

    r98483 r98508  
    1111                text run at (4,4) width 4: " "
    1212            RenderTableCell {TD} at (12,0) size 657x128 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1]
    13               RenderImage {IMG} at (4,4) size 50x50 [bgcolor=#FFA500]
     13              RenderImage {IMG} at (4,4) size 49x50 [bgcolor=#FFA500]
    1414              RenderBlock {P} at (4,4) size 649x18
    15                 RenderText {#text} at (53,0) size 595x18
    16                   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."
     15                RenderText {#text} at (52,0) size 595x18
     16                  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."
    1717              RenderBlock {DIV} at (4,38) size 649x18 [bgcolor=#008000]
    18                 RenderBR {BR} at (53,0) size 0x18
    19               RenderImage {IMG} at (4,56) size 50x50 [bgcolor=#FFA500]
     18                RenderBR {BR} at (52,0) size 0x18
     19              RenderImage {IMG} at (4,56) size 49x50 [bgcolor=#FFA500]
    2020              RenderBlock {DIV} at (4,106) size 649x18
    2121                RenderText {#text} at (0,0) size 649x18
  • trunk/LayoutTests/platform/mac/fast/block/positioning/replaced-inside-fixed-top-bottom-expected.txt

    r98483 r98508  
    88layer at (51,140) size 560x320
    99  RenderBlock (positioned) {DIV} at (1,40) size 560x320 [border: (1px solid #FF0000)]
    10     RenderImage {IMG} at (1,1) size 393x318
     10    RenderImage {IMG} at (1,1) size 392x318
    1111    RenderText {#text} at (0,0) size 0x0
    1212    RenderText {#text} at (0,0) size 0x0
  • trunk/LayoutTests/platform/mac/fast/repaint/block-layout-inline-children-replaced-expected.txt

    r98483 r98508  
    1212      RenderBlock {DIV} at (0,34) size 800x152
    1313        RenderBlock {DIV} at (0,0) size 402x152 [border: (1px solid #DDDDDD)]
    14           RenderImage {IMG} at (155,1) size 93x100
     14          RenderImage {IMG} at (155,1) size 92x100
  • trunk/LayoutTests/platform/mac/svg/zoom/page/relative-sized-document-scrollbars-expected.txt

    r98483 r98508  
    1 layer at (0,0) size 800x600
    2   RenderView at (0,0) size 800x600
    3 layer at (0,0) size 800x600
    4   RenderSVGRoot {svg} at (6,3) size 788x594
    5     RenderSVGPath {rect} at (6,3) size 788x594 [stroke={[type=SOLID] [color=#000000]}] [x=4.63] [y=3.47] [width=453.70] [height=340.28]
     1layer at (0,0) size 1357x1011
     2  RenderView at (0,0) size 785x585
     3layer at (0,0) size 1357x1011
     4  RenderSVGRoot {svg} at (12,8) size 1333x995
     5    RenderSVGPath {rect} at (12,8) size 1333x995 [stroke={[type=SOLID] [color=#000000]}] [x=7.85] [y=5.85] [width=769.30] [height=573.30]
    66    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
  • trunk/LayoutTests/platform/mac/svg/zoom/page/zoom-foreignObject-expected.txt

    r98483 r98508  
    1 layer at (0,0) size 800x600
    2   RenderView at (0,0) size 800x600
    3 layer at (0,0) size 800x600
    4   RenderSVGRoot {svg} at (12,12) size 788x588
     1layer at (0,0) size 1131x843
     2  RenderView at (0,0) size 785x585
     3layer at (0,0) size 1131x843
     4  RenderSVGRoot {svg} at (12,12) size 1119x831
    55    RenderSVGForeignObject {foreignObject} at (10,10) size 580x380
    66      RenderBlock {xhtml:div} at (0,0) size 580x18
     
    1212            text run at (0,0) width 66: "and a link."
    1313        RenderBR {xhtml:br} at (66,0) size 0x18
    14     RenderSVGPath {rect} at (12,12) size 788x552 [stroke={[type=SOLID] [color=#008000]}] [x=10.00] [y=10.00] [width=580.00] [height=380.00]
     14    RenderSVGPath {rect} at (12,12) size 840x552 [stroke={[type=SOLID] [color=#008000]}] [x=10.00] [y=10.00] [width=580.00] [height=380.00]
    1515    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
  • trunk/LayoutTests/svg/as-background-image/resources/hearts.svg

    r98483 r98508  
    1 <svg width="100%" height="100%" preserveAspectRatio="none" viewBox="0 200 200 200" version="1.1" xmlns="http://www.w3.org/2000/svg">
     1<svg width="100%" height="100%" viewBox="0 200 200 200" version="1.1" xmlns="http://www.w3.org/2000/svg">
    22<title>Suzanne's Hearts V1.0</title><desc>Author: http://richard.warburton.it - Licence: http://creativecommons.org/licenses/publicdomain</desc>
    33<rect x="-200" y="0" width="600" height="600" fill="black" />
  • trunk/LayoutTests/svg/as-image/resources/green-relative-size-rect.svg

    r98483 r98508  
    11<svg xmlns="http://www.w3.org/2000/svg" width='100%' height='100%'>
    2     <rect fill='green' width='100%' height='100%' />
    3     <circle cx="50%" cy="50%" r="10%" fill="navy"/>
     2    <rect fill='green' width='100px' height='100px' />
    43</svg>
  • trunk/Source/WebCore/ChangeLog

    r98507 r98508  
     12011-10-26  Julien Chaffraix  <jchaffraix@webkit.org>
     2
     3        Unreviewed, rolling out r98483.
     4        http://trac.webkit.org/changeset/98483
     5        https://bugs.webkit.org/show_bug.cgi?id=47156
     6
     7        Change is causing some crashes and ASSERTs.
     8
     9        * loader/cache/CachedImage.cpp:
     10        (WebCore::CachedImage::lookupImageForSize):
     11        (WebCore::CachedImage::lookupImageForRenderer):
     12        (WebCore::CachedImage::lookupOrCreateImageForRenderer):
     13        (WebCore::CachedImage::setContainerSizeForRenderer):
     14        (WebCore::CachedImage::imageSizeForRenderer):
     15        (WebCore::CachedImage::computeIntrinsicDimensions):
     16        (WebCore::CachedImage::createImage):
     17        * loader/cache/CachedImage.h:
     18        * page/ChromeClient.h:
     19        * rendering/ImageBySizeCache.cpp:
     20        (WebCore::ImageBySizeCache::addClient):
     21        (WebCore::ImageBySizeCache::removeClient):
     22        (WebCore::ImageBySizeCache::imageForSize):
     23        (WebCore::ImageBySizeCache::sizeForClient):
     24        * rendering/ImageBySizeCache.h:
     25        * rendering/RenderBoxModelObject.cpp:
     26        (WebCore::RenderBoxModelObject::calculateFillTileSize):
     27        (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
     28        (WebCore::RenderBoxModelObject::paintNinePieceImage):
     29        * rendering/RenderBoxModelObject.h:
     30        * rendering/RenderImage.cpp:
     31        (WebCore::RenderImage::RenderImage):
     32        (WebCore::RenderImage::imageDimensionsChanged):
     33        (WebCore::RenderImage::isLogicalWidthSpecified):
     34        (WebCore::RenderImage::isLogicalHeightSpecified):
     35        (WebCore::RenderImage::computeReplacedLogicalWidth):
     36        (WebCore::RenderImage::computeReplacedLogicalHeight):
     37        (WebCore::RenderImage::calcAspectRatioLogicalWidth):
     38        (WebCore::RenderImage::calcAspectRatioLogicalHeight):
     39        * rendering/RenderImage.h:
     40        * rendering/RenderImageResource.cpp:
     41        (WebCore::RenderImageResource::setContainerSizeForRenderer):
     42        * rendering/RenderImageResourceStyleImage.cpp:
     43        * rendering/RenderImageResourceStyleImage.h:
     44        (WebCore::RenderImageResourceStyleImage::image):
     45        (WebCore::RenderImageResourceStyleImage::setContainerSizeForRenderer):
     46        * rendering/RenderListMarker.cpp:
     47        (WebCore::RenderListMarker::computePreferredLogicalWidths):
     48        * rendering/RenderReplaced.cpp:
     49        (WebCore::RenderReplaced::computeIntrinsicLogicalWidth):
     50        (WebCore::RenderReplaced::computeIntrinsicLogicalHeight):
     51        (WebCore::RenderReplaced::computeReplacedLogicalWidth):
     52        * rendering/style/StyleCachedImage.cpp:
     53        (WebCore::StyleCachedImage::computeIntrinsicDimensions):
     54        (WebCore::StyleCachedImage::setContainerSizeForRenderer):
     55        (WebCore::StyleCachedImage::addClient):
     56        (WebCore::StyleCachedImage::removeClient):
     57        * rendering/style/StyleCachedImage.h:
     58        * rendering/style/StyleGeneratedImage.h:
     59        (WebCore::StyleGeneratedImage::setContainerSizeForRenderer):
     60        * rendering/style/StyleImage.h:
     61        * rendering/style/StylePendingImage.h:
     62        (WebCore::StylePendingImage::setContainerSizeForRenderer):
     63        * rendering/svg/RenderSVGImage.cpp:
     64        (WebCore::RenderSVGImage::layout):
     65        * rendering/svg/RenderSVGRoot.cpp:
     66        (WebCore::RenderSVGRoot::computeIntrinsicWidth):
     67        (WebCore::RenderSVGRoot::computeIntrinsicHeight):
     68        (WebCore::RenderSVGRoot::computeReplacedLogicalWidth):
     69        (WebCore::RenderSVGRoot::computeReplacedLogicalHeight):
     70        (WebCore::RenderSVGRoot::layout):
     71        (WebCore::RenderSVGRoot::paint):
     72        (WebCore::RenderSVGRoot::calcViewport):
     73        (WebCore::RenderSVGRoot::computeRectForRepaint):
     74        * rendering/svg/RenderSVGRoot.h:
     75        * svg/SVGLength.cpp:
     76        (WebCore::SVGLength::determineViewport):
     77        * svg/SVGSVGElement.cpp:
     78        (WebCore::SVGSVGElement::SVGSVGElement):
     79        (WebCore::SVGSVGElement::relativeWidthValue):
     80        (WebCore::SVGSVGElement::relativeHeightValue):
     81        (WebCore::SVGSVGElement::currentViewBoxRect):
     82        * svg/SVGSVGElement.h:
     83        (WebCore::SVGSVGElement::setContainerSize):
     84        (WebCore::SVGSVGElement::containerSize):
     85        (WebCore::SVGSVGElement::hasSetContainerSize):
     86        * svg/graphics/SVGImage.cpp:
     87        (WebCore::SVGImage::setContainerSize):
     88        (WebCore::SVGImage::usesContainerSize):
     89        (WebCore::SVGImage::size):
     90        (WebCore::SVGImage::hasRelativeWidth):
     91        (WebCore::SVGImage::hasRelativeHeight):
     92        (WebCore::SVGImage::draw):
     93        (WebCore::SVGImage::computeIntrinsicDimensions):
     94        (WebCore::SVGImage::dataChanged):
     95        * svg/graphics/SVGImage.h:
     96
    1972011-10-26  Eric Carlson  <eric.carlson@apple.com>
    298
  • trunk/Source/WebCore/loader/cache/CachedImage.cpp

    r98483 r98508  
    3535#include "FrameLoaderTypes.h"
    3636#include "FrameView.h"
    37 #include "RenderObject.h"
    3837#include "Settings.h"
    3938#include "SharedBuffer.h"
     
    132131}
    133132
    134 #if ENABLE(SVG)
    135 inline Image* CachedImage::lookupImageForSize(const IntSize& size) const
    136 {
    137     if (!m_image)
    138         return 0;
    139     if (!m_image->isSVGImage())
    140         return m_image.get();
    141     if (Image* image = m_svgImageCache.imageForSize(size))
    142         return image;
     133Image* CachedImage::lookupImageForSize(const IntSize& size) const
     134{
     135    // FIXME: Add logic for this in webkit.org/b/47156.
     136    UNUSED_PARAM(size);
    143137    return m_image.get();
    144138}
    145139
    146 inline Image* CachedImage::lookupImageForRenderer(const RenderObject* renderer) const
    147 {
    148     if (!m_image)
    149         return 0;
    150     if (!m_image->isSVGImage())
    151         return m_image.get();
    152     if (Image* image = m_svgImageCache.imageForRenderer(renderer))
    153         return image;
     140Image* CachedImage::lookupImageForRenderer(const RenderObject* renderer) const
     141{
     142    // FIXME: Add logic for this in webkit.org/b/47156.
     143    UNUSED_PARAM(renderer);
    154144    return m_image.get();
    155145}
    156146
    157 inline PassRefPtr<Image> createSVGImage(CachedImage* image, const IntSize& size, SharedBuffer* data)
    158 {
    159     if (size.isEmpty() || !data)
    160         return SVGImage::create(image);
    161 
    162     RefPtr<Image> newImage = SVGImage::create(image);
    163     newImage->setData(data, true);
    164     newImage->setContainerSize(size);
    165     return newImage.release();
    166 }
    167 
    168 inline PassRefPtr<Image> CachedImage::lookupOrCreateImageForRenderer(const RenderObject* renderer)
    169 {
    170     if (!m_image)
    171         return 0;
    172     if (!m_image->isSVGImage())
    173         return m_image;
    174 
    175     IntSize size;
    176     if (Image* result = m_svgImageCache.imageForRenderer(renderer, &size))
    177         return result;
    178 
    179     if (size.isEmpty())
    180         return m_image;
    181 
    182     // Create and cache new image at desired size.
    183     RefPtr<Image> newImage = createSVGImage(this, size, m_data.get());
    184     m_svgImageCache.putImage(size, newImage);
    185     return newImage.release();
    186 }
    187 #else
    188 inline Image* CachedImage::lookupImageForSize(const IntSize&) const
    189 {
    190     return m_image.get();
    191 }
    192 
    193 inline Image* CachedImage::lookupImageForRenderer(const RenderObject*) const
    194 {
    195     return m_image.get();
    196 }
    197 
    198 inline PassRefPtr<Image> CachedImage::lookupOrCreateImageForRenderer(const RenderObject*)
    199 {
     147PassRefPtr<Image> CachedImage::lookupOrCreateImageForRenderer(const RenderObject* renderer)
     148{
     149    // FIXME: Add logic for this in webkit.org/b/47156.
     150    UNUSED_PARAM(renderer);
    200151    return m_image;
    201152}
    202 #endif
    203153
    204154Image* CachedImage::image()
     
    236186}
    237187
    238 void CachedImage::setContainerSizeForRenderer(const RenderObject* renderer, const IntSize& containerSize, float containerZoom)
     188void CachedImage::setContainerSizeForRenderer(const RenderObject* renderer, const IntSize& containerSize)
    239189{
    240190    if (!m_image)
    241191        return;
    242 #if ENABLE(SVG)
    243     if (!m_image->isSVGImage()) {
    244         m_image->setContainerSize(containerSize);
    245         return;
    246     }
    247     m_svgImageCache.setClient(renderer, containerSize);
    248 
    249     Image* image = lookupOrCreateImageForRenderer(renderer).get();
    250     if (image && image != m_image) {
    251         ASSERT(image->isSVGImage());
    252         static_cast<SVGImage*>(image)->setContainerZoom(containerZoom);
    253     }
    254 #else
     192
     193    // FIXME: Add logic for this in webkit.org/b/47156.
    255194    UNUSED_PARAM(renderer);
    256195    m_image->setContainerSize(containerSize);
    257 #endif
    258196}
    259197
     
    286224    ASSERT(!isPurgeable());
    287225
    288     if (!m_image)
     226    Image* image = lookupImageForRenderer(renderer);
     227    if (!image)
    289228        return IntSize();
    290 #if ENABLE(SVG)
    291     // SVGImages already includes the zooming in its intrinsic size.
    292     if (m_image->isSVGImage())
    293         return lookupImageForRenderer(renderer)->size();
    294 #endif
    295 
    296229    if (multiplier == 1.0f)
    297230        return m_image->size();
     
    309242}
    310243
    311 void CachedImage::computeIntrinsicDimensions(Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio)
    312 {
    313     if (m_image)
    314         m_image->computeIntrinsicDimensions(intrinsicWidth, intrinsicHeight, intrinsicRatio);
    315 }
    316 
    317 void CachedImage::addClientForRenderer(RenderObject* renderer)
    318 {
    319     ASSERT(renderer);
    320 #if ENABLE(SVG)
    321     m_svgImageCache.addClient(renderer, IntSize());
    322 #endif
    323     addClient(renderer);
    324 }
    325 
    326 void CachedImage::removeClientForRenderer(RenderObject* renderer)
    327 {
    328     ASSERT(renderer);
    329 #if ENABLE(SVG)
    330     m_svgImageCache.removeClient(renderer);
    331 #endif
    332     removeClient(renderer);
     244void CachedImage::computeIntrinsicDimensions(const RenderObject* renderer, Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio)
     245{
     246    if (Image* image = lookupImageForRenderer(renderer))
     247        image->computeIntrinsicDimensions(intrinsicWidth, intrinsicHeight, intrinsicRatio);
    333248}
    334249
     
    370285#if ENABLE(SVG)
    371286    if (m_response.mimeType() == "image/svg+xml") {
    372         m_image = createSVGImage(this, IntSize(), 0);
     287        m_image = SVGImage::create(this);
    373288        return;
    374289    }
  • trunk/Source/WebCore/loader/cache/CachedImage.h

    r98483 r98508  
    5858
    5959    bool canRender(const RenderObject* renderer, float multiplier) { return !errorOccurred() && !imageSizeForRenderer(renderer, multiplier).isEmpty(); }
    60     void addClientForRenderer(RenderObject*);
    61     void removeClientForRenderer(RenderObject*);
    6260
    63     void setContainerSizeForRenderer(const RenderObject*, const IntSize&, float);
     61    // These are only used for SVGImage right now
     62    void setContainerSizeForRenderer(const RenderObject*, const IntSize&);
    6463    bool usesImageContainerSize() const;
    6564    bool imageHasRelativeWidth() const;
     
    6867    // This method takes a zoom multiplier that can be used to increase the natural size of the image by the zoom.
    6968    IntSize imageSizeForRenderer(const RenderObject*, float multiplier); // returns the size of the complete image.
    70     void computeIntrinsicDimensions(Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio);
     69    void computeIntrinsicDimensions(const RenderObject*, Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio);
    7170
    7271    virtual void didAddClient(CachedResourceClient*);
  • trunk/Source/WebCore/page/ChromeClient.h

    r98483 r98508  
    337337        virtual void numWheelEventHandlersChanged(unsigned) = 0;
    338338       
    339         virtual bool isSVGImageChromeClient() const { return false; }
    340 
    341339    protected:
    342340        virtual ~ChromeClient() { }
  • trunk/Source/WebCore/rendering/ImageBySizeCache.cpp

    r98483 r98508  
    3535void ImageBySizeCache::addClient(const RenderObject* renderer, const IntSize& size)
    3636{
    37     ASSERT(renderer);
    3837    if (!size.isEmpty())
    3938        m_sizes.add(size);
     
    5049void ImageBySizeCache::removeClient(const RenderObject* renderer)
    5150{
    52     ASSERT(renderer);
    5351    RenderObjectSizeCountMap::iterator it = m_clients.find(renderer);
    54     if (it == m_clients.end())
    55         return;
     52    ASSERT(it != m_clients.end());
    5653
    5754    SizeCountPair& sizeCount = it->second;
     
    6562    if (!--sizeCount.second)
    6663        m_clients.remove(renderer);
    67 }
    68 
    69 void ImageBySizeCache::setClient(const RenderObject* renderer, const IntSize& size)
    70 {
    71     ASSERT(renderer);
    72     RenderObjectSizeCountMap::iterator it = m_clients.find(renderer);
    73     if (it != m_clients.end()) {
    74         IntSize currentSize = it->second.first;
    75         if (currentSize == size)
    76             return;
    77         removeClient(renderer);
    78     }
    79 
    80     if (!size.isEmpty())
    81         addClient(renderer, size);
    8264}
    8365
     
    11698Image* ImageBySizeCache::imageForSize(const IntSize& size) const
    11799{
    118     if (size.isEmpty())
    119         return 0;
    120100    HashMap<IntSize, RefPtr<Image> >::const_iterator it = m_images.find(size);
    121101    if (it == m_images.end())
     
    124104}
    125105
    126 Image* ImageBySizeCache::imageForRenderer(const RenderObject* renderer, IntSize* size) const
     106IntSize ImageBySizeCache::sizeForClient(const RenderObject* renderer) const
    127107{
    128     if (!renderer)
    129         return 0;
    130108    RenderObjectSizeCountMap::const_iterator it = m_clients.find(renderer);
    131109    if (it == m_clients.end())
    132         return 0;
    133     if (size)
    134         *size = it->second.first;
    135     return imageForSize(it->second.first);
     110        return IntSize();
     111    return it->second.first;
    136112}
    137113
  • trunk/Source/WebCore/rendering/ImageBySizeCache.h

    r98483 r98508  
    4141    void addClient(const RenderObject*, const IntSize&);
    4242    void removeClient(const RenderObject*);
    43     void setClient(const RenderObject*, const IntSize&);
    4443
    4544    Image* getImage(const RenderObject*, const IntSize&);
     
    4948
    5049    Image* imageForSize(const IntSize&) const;
    51     Image* imageForRenderer(const RenderObject*, IntSize* lookedUpSize = 0) const;
     50    IntSize sizeForClient(const RenderObject*) const;
    5251    const RenderObjectSizeCountMap& clients() const { return m_clients; }
    5352
  • trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp

    r98483 r98508  
    783783}
    784784
    785 static inline LayoutUnit resolveWidthForRatio(LayoutUnit height, const FloatSize& intrinsicRatio)
    786 {
    787     // FIXME: Remove unnecessary rounding when layout is off ints: webkit.org/b/63656
    788     return static_cast<LayoutUnit>(ceilf(height * intrinsicRatio.width() / intrinsicRatio.height()));
    789 }
    790 
    791 static inline LayoutUnit resolveHeightForRatio(LayoutUnit width, const FloatSize& intrinsicRatio)
    792 {
    793     // FIXME: Remove unnecessary rounding when layout is off ints: webkit.org/b/63656
    794     return static_cast<LayoutUnit>(ceilf(width * intrinsicRatio.height() / intrinsicRatio.width()));
    795 }
    796 
    797 static inline LayoutSize resolveAgainstIntrinsicWidthOrHeightAndRatio(const LayoutSize& size, const FloatSize& intrinsicRatio, LayoutUnit useWidth, LayoutUnit useHeight)
    798 {
    799     if (intrinsicRatio.isEmpty()) {
    800         if (useWidth)
    801             return LayoutSize(useWidth, size.height());
    802         return LayoutSize(size.width(), useHeight);
    803     }
    804 
    805     if (useWidth)
    806         return LayoutSize(useWidth, resolveHeightForRatio(useWidth, intrinsicRatio));
    807     return LayoutSize(resolveWidthForRatio(useHeight, intrinsicRatio), useHeight);
    808 }
    809 
    810 static inline LayoutSize resolveAgainstIntrinsicRatio(const LayoutSize& size, const FloatSize& intrinsicRatio)
    811 {
    812     // Two possible solutions: (size.width(), solutionHeight) or (solutionWidth, size.height())
    813     // "... must be assumed to be the largest dimensions..." = easiest answer: the rect with the largest surface area.
    814 
    815     LayoutUnit solutionWidth = resolveWidthForRatio(size.height(), intrinsicRatio);
    816     LayoutUnit solutionHeight = resolveHeightForRatio(size.width(), intrinsicRatio);
    817     if (solutionWidth <= size.width()) {
    818         if (solutionHeight <= size.height()) {
    819             // If both solutions fit, choose the one covering the larger area.
    820             LayoutUnit areaOne = solutionWidth * size.height();
    821             LayoutUnit areaTwo = size.width() * solutionHeight;
    822             if (areaOne < areaTwo)
    823                 return LayoutSize(size.width(), solutionHeight);
    824             return LayoutSize(solutionWidth, size.height());
    825         }
    826 
    827         // Only the first solution fits.
    828         return LayoutSize(solutionWidth, size.height());
    829     }
    830 
    831     // Only the second solution fits, assert that.
    832     ASSERT(solutionHeight <= size.height());
    833     return LayoutSize(size.width(), solutionHeight);
    834 }
    835 
    836 LayoutSize RenderBoxModelObject::calculateImageIntrinsicDimensions(StyleImage* image, const LayoutSize& positioningAreaSize) const
    837 {
    838     // This implements http://www.w3.org/TR/css3-background/#background-size.
    839     LayoutUnit resolvedWidth = 0;
    840     LayoutUnit resolvedHeight = 0;
    841     FloatSize intrinsicRatio;
    842 
    843     // A generated image without a fixed size, will always return the container size as intrinsic size.
    844     if (image->isGeneratedImage() && image->usesImageContainerSize()) {
    845         resolvedWidth = positioningAreaSize.width();
    846         resolvedHeight = positioningAreaSize.height();
    847     } else {
    848         Length intrinsicWidth;
    849         Length intrinsicHeight;
    850         image->computeIntrinsicDimensions(this, intrinsicWidth, intrinsicHeight, intrinsicRatio);
    851 
    852         // FIXME: Remove unnecessary rounding when layout is off ints: webkit.org/b/63656
    853         if (intrinsicWidth.isFixed())
    854             resolvedWidth = static_cast<LayoutUnit>(ceilf(intrinsicWidth.value() * style()->effectiveZoom()));
    855         if (intrinsicHeight.isFixed())
    856             resolvedHeight = static_cast<LayoutUnit>(ceilf(intrinsicHeight.value() * style()->effectiveZoom()));
    857     }
    858 
    859     // Intrinsic dimensions expressed as percentages must be resolved relative to the dimensions of the rectangle
    860     // that establishes the coordinate system for the 'background-position' property. SVG on the other hand
    861     // _explicitely_ says that percentage values for the width/height attributes do NOT define intrinsic dimensions.
    862     if (resolvedWidth > 0 && resolvedHeight > 0)
    863         return LayoutSize(resolvedWidth, resolvedHeight);
    864 
    865     // If the image has one of either an intrinsic width or an intrinsic height:
    866     // * and an intrinsic aspect ratio, then the missing dimension is calculated from the given dimension and the ratio.
    867     // * and no intrinsic aspect ratio, then the missing dimension is assumed to be the size of the rectangle that
    868     //   establishes the coordinate system for the 'background-position' property.
    869     if ((resolvedWidth && !resolvedHeight) || (!resolvedWidth && resolvedHeight))
    870         return resolveAgainstIntrinsicWidthOrHeightAndRatio(positioningAreaSize, intrinsicRatio, resolvedWidth, resolvedHeight);
    871 
    872     // If the image has no intrinsic dimensions and has an intrinsic ratio the dimensions must be assumed to be the
    873     // largest dimensions at that ratio such that neither dimension exceeds the dimensions of the rectangle that
    874     // establishes the coordinate system for the 'background-position' property.
    875     if (!resolvedWidth && !resolvedHeight && !intrinsicRatio.isEmpty())
    876         return resolveAgainstIntrinsicRatio(positioningAreaSize, intrinsicRatio);
    877 
    878     // If the image has no intrinsic ratio either, then the dimensions must be assumed to be the rectangle that
    879     // establishes the coordinate system for the 'background-position' property.
    880     return positioningAreaSize;
    881 }
    882 
    883 LayoutSize RenderBoxModelObject::calculateFillTileSize(const FillLayer* fillLayer, const LayoutSize& positioningAreaSize) const
     785LayoutSize RenderBoxModelObject::calculateFillTileSize(const FillLayer* fillLayer, LayoutSize positioningAreaSize) const
    884786{
    885787    StyleImage* image = fillLayer->image();
     788    image->setContainerSizeForRenderer(this, positioningAreaSize); // Use the box established by background-origin.
     789
    886790    EFillSizeType type = fillLayer->size().type;
    887 
    888     LayoutSize imageIntrinsicSize = calculateImageIntrinsicDimensions(image, positioningAreaSize);
    889791
    890792    switch (type) {
     
    909811            // scale to maintain our aspect ratio.
    910812            if (layerWidth.isAuto() && !layerHeight.isAuto()) {
     813                LayoutSize imageIntrinsicSize = image->imageSize(this, style()->effectiveZoom());
    911814                if (imageIntrinsicSize.height())
    912815                    w = imageIntrinsicSize.width() * h / imageIntrinsicSize.height();       
    913816            } else if (!layerWidth.isAuto() && layerHeight.isAuto()) {
     817                LayoutSize imageIntrinsicSize = image->imageSize(this, style()->effectiveZoom());
    914818                if (imageIntrinsicSize.width())
    915819                    h = imageIntrinsicSize.height() * w / imageIntrinsicSize.width();
    916820            } else if (layerWidth.isAuto() && layerHeight.isAuto()) {
    917821                // If both width and height are auto, use the image's intrinsic size.
     822                LayoutSize imageIntrinsicSize = image->imageSize(this, style()->effectiveZoom());
    918823                w = imageIntrinsicSize.width();
    919824                h = imageIntrinsicSize.height();
     
    922827            return LayoutSize(max<LayoutUnit>(1, w), max<LayoutUnit>(1, h));
    923828        }
    924         case SizeNone: {
    925             // If both values are ‘auto’ then the intrinsic width and/or height of the image should be used, if any.
    926             if (!imageIntrinsicSize.isEmpty())
    927                 return imageIntrinsicSize;
    928 
    929             // If the image has neither an intrinsic width nor an intrinsic height, its size is determined as for ‘contain’.
    930             type = Contain;
    931         }
    932829        case Contain:
    933830        case Cover: {
     831            LayoutSize imageIntrinsicSize = image->imageSize(this, 1);
    934832            float horizontalScaleFactor = imageIntrinsicSize.width()
    935833                ? static_cast<float>(positioningAreaSize.width()) / imageIntrinsicSize.width() : 1;
     
    938836            float scaleFactor = type == Contain ? min(horizontalScaleFactor, verticalScaleFactor) : max(horizontalScaleFactor, verticalScaleFactor);
    939837            return LayoutSize(max<LayoutUnit>(1, imageIntrinsicSize.width() * scaleFactor), max<LayoutUnit>(1, imageIntrinsicSize.height() * scaleFactor));
    940        }
    941     }
    942 
    943     ASSERT_NOT_REACHED();
    944     return LayoutSize();
     838        }
     839        case SizeNone:
     840            break;
     841    }
     842
     843    return image->imageSize(this, style()->effectiveZoom());
    945844}
    946845
     
    1029928    }
    1030929
    1031     LayoutSize fillTileSize = calculateFillTileSize(fillLayer, positioningAreaSize);
    1032     fillLayer->image()->setContainerSizeForRenderer(this, fillTileSize, style()->effectiveZoom());
    1033     geometry.setTileSize(fillTileSize);
     930    geometry.setTileSize(calculateFillTileSize(fillLayer, positioningAreaSize));
    1034931
    1035932    EFillRepeat backgroundRepeatX = fillLayer->repeatX();
     
    1091988    LayoutRect borderImageRect = LayoutRect(leftWithOutset, topWithOutset, rightWithOutset - leftWithOutset, bottomWithOutset - topWithOutset);
    1092989
    1093     LayoutSize imageSize = calculateImageIntrinsicDimensions(styleImage, borderImageRect.size());
    1094 
    1095     // If both values are ‘auto’ then the intrinsic width and/or height of the image should be used, if any.
    1096     LayoutSize containerSize = imageSize.isEmpty() ? borderImageRect.size() : imageSize;
    1097     styleImage->setContainerSizeForRenderer(this, containerSize, style->effectiveZoom());
    1098 
     990    styleImage->setContainerSizeForRenderer(this, borderImageRect.size());
     991    LayoutSize imageSize = styleImage->imageSize(this, 1.0f);
    1099992    LayoutUnit imageWidth = imageSize.width();
    1100993    LayoutUnit imageHeight = imageSize.height();
  • trunk/Source/WebCore/rendering/RenderBoxModelObject.h

    r98483 r98508  
    196196    virtual bool isBoxModelObject() const { return true; }
    197197
    198     LayoutSize calculateFillTileSize(const FillLayer*, const LayoutSize& scaledPositioningAreaSize) const;
    199     LayoutSize calculateImageIntrinsicDimensions(StyleImage*, const LayoutSize& scaledPositioningAreaSize) const;
     198    LayoutSize calculateFillTileSize(const FillLayer*, LayoutSize scaledSize) const;
    200199
    201200    RoundedRect getBackgroundRoundedRect(const LayoutRect&, InlineFlowBox*, LayoutUnit inlineBoxWidth, LayoutUnit inlineBoxHeight,
  • trunk/Source/WebCore/rendering/RenderImage.cpp

    r98483 r98508  
    4242#include "RenderLayer.h"
    4343#include "RenderView.h"
    44 #include "SVGImage.h"
    4544#include <wtf/UnusedParam.h>
    4645
     
    5251
    5352RenderImage::RenderImage(Node* node)
    54     : RenderReplaced(node, IntSize())
     53    : RenderReplaced(node, IntSize(0, 0))
    5554    , m_needsToSetSizeForAltText(false)
    5655    , m_didIncrementVisuallyNonEmptyPixelCount(false)
     
    175174}
    176175
    177 bool RenderImage::updateIntrinsicSizeIfNeeded(bool imageSizeChanged)
    178 {
    179     if (m_imageResource->imageSize(style()->effectiveZoom()) == intrinsicSize() && !imageSizeChanged)
    180         return false;
    181     if (m_imageResource->errorOccurred())
    182         return imageSizeChanged;
    183     setIntrinsicSize(m_imageResource->imageSize(style()->effectiveZoom()));
    184     return true;
    185 }
    186 
    187176void RenderImage::imageDimensionsChanged(bool imageSizeChanged, const IntRect* rect)
    188177{
    189178    bool shouldRepaint = true;
    190     if (updateIntrinsicSizeIfNeeded(imageSizeChanged)) {
     179
     180    if (m_imageResource->imageSize(style()->effectiveZoom()) != intrinsicSize() || imageSizeChanged) {
     181        if (!m_imageResource->errorOccurred())
     182            setIntrinsicSize(m_imageResource->imageSize(style()->effectiveZoom()));
     183
    191184        // In the case of generated image content using :before/:after, we might not be in the
    192185        // render tree yet.  In that case, we don't need to worry about check for layout, since we'll get a
     
    483476}
    484477
     478bool RenderImage::isLogicalWidthSpecified() const
     479{
     480    switch (style()->logicalWidth().type()) {
     481        case Fixed:
     482        case Percent:
     483            return true;
     484        case Auto:
     485        case Relative: // FIXME: Shouldn't this case return true?
     486        case Intrinsic:
     487        case MinIntrinsic:
     488            return false;
     489        case Undefined:
     490            ASSERT_NOT_REACHED();
     491            return false;
     492    }
     493    ASSERT_NOT_REACHED();
     494    return false;
     495}
     496
     497bool RenderImage::isLogicalHeightSpecified() const
     498{
     499    switch (style()->logicalHeight().type()) {
     500        case Fixed:
     501        case Percent:
     502            return true;
     503        case Auto:
     504        case Relative: // FIXME: Shouldn't this case return true?
     505        case Intrinsic:
     506        case MinIntrinsic:
     507            return false;
     508        case Undefined:
     509            ASSERT_NOT_REACHED();
     510            return false;
     511    }
     512    ASSERT_NOT_REACHED();
     513    return false;
     514}
     515
    485516LayoutUnit RenderImage::computeReplacedLogicalWidth(bool includeMaxWidth) const
    486517{
    487     // If we've got an explicit width/height assigned, propagate it to the image resource.   
    488     if (style()->logicalWidth().isFixed() && style()->logicalHeight().isFixed()) {
    489         LayoutUnit width = RenderReplaced::computeReplacedLogicalWidth(includeMaxWidth);
    490         m_imageResource->setContainerSizeForRenderer(IntSize(width, computeReplacedLogicalHeight()));
    491         return width;
    492     }
    493 
    494     // Propagate the containing block size to the image resource, otherwhise we can't compute our own intrinsic size, if it's relative.
    495     RenderBox* contentRenderer = embeddedContentBox();
    496     bool hasRelativeWidth = contentRenderer ? contentRenderer->style()->width().isPercent() : m_imageResource->imageHasRelativeWidth();
    497     bool hasRelativeHeight = contentRenderer ? contentRenderer->style()->height().isPercent() : m_imageResource->imageHasRelativeHeight();
    498 
    499     if (hasRelativeWidth || hasRelativeHeight) {
    500         RenderObject* containingBlock = isPositioned() ? container() : this->containingBlock();
    501         if (containingBlock->isBox()) {
    502             RenderBox* box = toRenderBox(containingBlock);
    503             m_imageResource->setContainerSizeForRenderer(IntSize(box->availableWidth(), box->availableHeight())); // Already contains zooming information.
    504             const_cast<RenderImage*>(this)->updateIntrinsicSizeIfNeeded(false);
     518    if (m_imageResource->imageHasRelativeWidth())
     519        if (RenderObject* cb = isPositioned() ? container() : containingBlock()) {
     520            if (cb->isBox())
     521                m_imageResource->setContainerSizeForRenderer(LayoutSize(toRenderBox(cb)->availableWidth(), toRenderBox(cb)->availableHeight()));
    505522        }
    506     }
    507 
    508     return RenderReplaced::computeReplacedLogicalWidth(includeMaxWidth);
    509 }
    510 
    511 void RenderImage::computeIntrinsicRatioInformation(FloatSize& intrinsicRatio, bool& isPercentageIntrinsicSize) const
    512 {
    513     // Assure this method is never used for SVGImages.
    514     ASSERT(!embeddedContentBox());
    515     isPercentageIntrinsicSize = false;
    516     if (m_imageResource && m_imageResource->image())
    517         intrinsicRatio = m_imageResource->image()->size();
    518 }
    519 
    520 bool RenderImage::needsPreferredWidthsRecalculation() const
    521 {
    522     if (RenderReplaced::needsPreferredWidthsRecalculation())
    523         return true;
    524     return embeddedContentBox();
    525 }
    526 
    527 RenderBox* RenderImage::embeddedContentBox() const
    528 {
    529     if (!m_imageResource)
     523
     524    LayoutUnit logicalWidth;
     525    if (isLogicalWidthSpecified())
     526        logicalWidth = computeReplacedLogicalWidthUsing(style()->logicalWidth());
     527    else if (m_imageResource->usesImageContainerSize()) {
     528        LayoutSize size = m_imageResource->imageSize(style()->effectiveZoom());
     529        logicalWidth = style()->isHorizontalWritingMode() ? size.width() : size.height();
     530    } else if (m_imageResource->imageHasRelativeWidth())
     531        logicalWidth = 0; // If the image is relatively-sized, set the width to 0 until there is a set container size.
     532    else
     533        logicalWidth = calcAspectRatioLogicalWidth();
     534
     535    return computeReplacedLogicalWidthRespectingMinMaxWidth(logicalWidth, includeMaxWidth);
     536}
     537
     538LayoutUnit RenderImage::computeReplacedLogicalHeight() const
     539{
     540    // FIXME: This function should use RenderReplaced::computeReplacedLogicalHeight()
     541    LayoutUnit logicalHeight;
     542    if (logicalHeightIsAuto() && !style()->logicalWidth().isAuto() && intrinsicLogicalWidth() && intrinsicLogicalHeight())
     543        logicalHeight = static_cast<LayoutUnit>(availableLogicalWidth() * intrinsicLogicalHeight() / intrinsicLogicalWidth());
     544    else if (isLogicalHeightSpecified())
     545        logicalHeight = computeReplacedLogicalHeightUsing(style()->logicalHeight());
     546    else if (m_imageResource->usesImageContainerSize()) {
     547        LayoutSize size = m_imageResource->imageSize(style()->effectiveZoom());
     548        logicalHeight = style()->isHorizontalWritingMode() ? size.height() : size.width();
     549    } else if (m_imageResource->imageHasRelativeHeight())
     550        logicalHeight = 0; // If the image is relatively-sized, set the height to 0 until there is a set container size.
     551    else
     552        logicalHeight = calcAspectRatioLogicalHeight();
     553
     554    return computeReplacedLogicalHeightRespectingMinMaxHeight(logicalHeight);
     555}
     556
     557int RenderImage::calcAspectRatioLogicalWidth() const
     558{
     559    int intrinsicWidth = intrinsicLogicalWidth();
     560    int intrinsicHeight = intrinsicLogicalHeight();
     561    if (!intrinsicHeight)
    530562        return 0;
    531 
    532     RefPtr<Image> image = m_imageResource->image();
    533     if (image && image->isSVGImage())
    534         return static_pointer_cast<SVGImage>(image)->embeddedContentBox();
    535 
    536     return 0;
     563    if (!m_imageResource->hasImage() || m_imageResource->errorOccurred())
     564        return intrinsicWidth; // Don't bother scaling.
     565    return RenderBox::computeReplacedLogicalHeight() * intrinsicWidth / intrinsicHeight;
     566}
     567
     568int RenderImage::calcAspectRatioLogicalHeight() const
     569{
     570    int intrinsicWidth = intrinsicLogicalWidth();
     571    int intrinsicHeight = intrinsicLogicalHeight();
     572    if (!intrinsicWidth)
     573        return 0;
     574    if (!m_imageResource->hasImage() || m_imageResource->errorOccurred())
     575        return intrinsicHeight; // Don't bother scaling.
     576    return RenderBox::computeReplacedLogicalWidth() * intrinsicHeight / intrinsicWidth;
    537577}
    538578
  • trunk/Source/WebCore/rendering/RenderImage.h

    r98483 r98508  
    5555
    5656protected:
    57     virtual bool needsPreferredWidthsRecalculation() const;
    58     virtual RenderBox* embeddedContentBox() const;
    59     virtual void computeIntrinsicRatioInformation(FloatSize& intrinsicRatio, bool& isPercentageIntrinsicSize) const;
    60 
    6157    virtual void styleDidChange(StyleDifference, const RenderStyle*);
    6258
     
    6561    virtual void paintIntoRect(GraphicsContext*, const IntRect&);
    6662    virtual void paint(PaintInfo&, const LayoutPoint&);
     63
     64    bool isLogicalWidthSpecified() const;
     65    bool isLogicalHeightSpecified() const;
    6766
    6867    virtual void intrinsicSizeChanged()
     
    8887
    8988    virtual LayoutUnit computeReplacedLogicalWidth(bool includeMaxWidth = true) const;
     89    virtual LayoutUnit computeReplacedLogicalHeight() const;
    9090
    9191    IntSize imageSizeForError(CachedImage*) const;
    9292    void imageDimensionsChanged(bool imageSizeChanged, const IntRect* = 0);
    93     bool updateIntrinsicSizeIfNeeded(bool imageSizeChanged);
     93
     94    int calcAspectRatioLogicalWidth() const;
     95    int calcAspectRatioLogicalHeight() const;
    9496
    9597    void paintAreaElementFocusRing(PaintInfo&);
  • trunk/Source/WebCore/rendering/RenderImageResource.cpp

    r98483 r98508  
    9494    ASSERT(m_renderer);
    9595    if (m_cachedImage)
    96         m_cachedImage->setContainerSizeForRenderer(m_renderer, imageContainerSize, m_renderer->style()->effectiveZoom());
     96        m_cachedImage->setContainerSizeForRenderer(m_renderer, imageContainerSize);
    9797}
    9898
  • trunk/Source/WebCore/rendering/RenderImageResourceStyleImage.cpp

    r98483 r98508  
    6161}
    6262
    63 PassRefPtr<Image> RenderImageResourceStyleImage::image(int width, int height) const
    64 {
    65     // Generated content may trigger calls to image() while we're still pending, don't assert but gracefully exit.
    66     if (m_styleImage->isPendingImage())
    67         return 0;
    68     return m_styleImage->image(m_renderer, IntSize(width, height));
    69 }
    70 
    71 void RenderImageResourceStyleImage::setContainerSizeForRenderer(const IntSize& size)
    72 {
    73     ASSERT(m_renderer);
    74     m_styleImage->setContainerSizeForRenderer(m_renderer, size, m_renderer->style()->effectiveZoom());
    75 }
    76 
    7763} // namespace WebCore
  • trunk/Source/WebCore/rendering/RenderImageResourceStyleImage.h

    r98483 r98508  
    4747
    4848    virtual bool hasImage() const { return true; }
    49     virtual PassRefPtr<Image> image(int width = 0, int height = 0) const;
     49    virtual PassRefPtr<Image> image(int width = 0, int height = 0) const { return m_styleImage->image(m_renderer, IntSize(width, height)); }
    5050    virtual bool errorOccurred() const { return m_styleImage->errorOccurred(); }
    5151
    52     virtual void setContainerSizeForRenderer(const IntSize&);
     52    virtual void setContainerSizeForRenderer(const IntSize& size) { m_styleImage->setContainerSizeForRenderer(m_renderer, size); }
    5353    virtual bool usesImageContainerSize() const { return m_styleImage->usesImageContainerSize(); }
    5454    virtual bool imageHasRelativeWidth() const { return m_styleImage->imageHasRelativeWidth(); }
  • trunk/Source/WebCore/rendering/RenderListMarker.cpp

    r98483 r98508  
    13511351        // until we support the CSS3 marker pseudoclass to allow control over the width and height of the marker box.
    13521352        LayoutUnit bulletWidth = fontMetrics.ascent() / 2;
    1353         m_image->setContainerSizeForRenderer(this, LayoutSize(bulletWidth, bulletWidth), style()->effectiveZoom());
     1353        m_image->setContainerSizeForRenderer(this, LayoutSize(bulletWidth, bulletWidth));
    13541354        LayoutSize imageSize = m_image->imageSize(this, style()->effectiveZoom());
    13551355        m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = style()->isHorizontalWritingMode() ? imageSize.width() : imageSize.height();
  • trunk/Source/WebCore/rendering/RenderReplaced.cpp

    r98483 r98508  
    202202{
    203203    if (m_hasIntrinsicSize) {
    204         if (!contentRenderer || !contentRenderer->style()->logicalWidth().isFixed())
    205             return computeReplacedLogicalWidthRespectingMinMaxWidth(calcAspectRatioLogicalWidth(), includeMaxWidth);
     204        ASSERT(!contentRenderer);
     205        return computeReplacedLogicalWidthRespectingMinMaxWidth(calcAspectRatioLogicalWidth(), includeMaxWidth);
    206206    }
    207207    ASSERT(contentRenderer);
     
    213213{
    214214    if (m_hasIntrinsicSize) {
    215         if (!contentRenderer || !contentRenderer->style()->logicalHeight().isFixed())
    216             return computeReplacedLogicalHeightRespectingMinMaxHeight(calcAspectRatioLogicalHeight());
     215        ASSERT(!contentRenderer);
     216        return computeReplacedLogicalHeightRespectingMinMaxHeight(calcAspectRatioLogicalHeight());
    217217    }
    218218    ASSERT(contentRenderer);
     
    236236        contentRenderStyle = contentRenderer->style();
    237237        ASSERT(contentRenderStyle);
    238     } else
    239         computeIntrinsicRatioInformation(intrinsicRatio, isPercentageIntrinsicSize);
     238    }
    240239
    241240    if (style()->logicalWidth().isAuto()) {
  • trunk/Source/WebCore/rendering/style/StyleCachedImage.cpp

    r98483 r98508  
    6565}
    6666
    67 void StyleCachedImage::computeIntrinsicDimensions(const RenderObject*, Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio)
     67void StyleCachedImage::computeIntrinsicDimensions(const RenderObject* renderer, Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio)
    6868{
    69     m_image->computeIntrinsicDimensions(intrinsicWidth, intrinsicHeight, intrinsicRatio);
     69    m_image->computeIntrinsicDimensions(renderer, intrinsicWidth, intrinsicHeight, intrinsicRatio);
    7070}
    7171
     
    7575}
    7676
    77 void StyleCachedImage::setContainerSizeForRenderer(const RenderObject* renderer, const IntSize& imageContainerSize, float imageContainerZoomFactor)
     77void StyleCachedImage::setContainerSizeForRenderer(const RenderObject* renderer, const IntSize& imageContainerSize)
    7878{
    79     m_image->setContainerSizeForRenderer(renderer, imageContainerSize, imageContainerZoomFactor);
     79    m_image->setContainerSizeForRenderer(renderer, imageContainerSize);
    8080}
    8181
    8282void StyleCachedImage::addClient(RenderObject* renderer)
    8383{
    84     m_image->addClientForRenderer(renderer);
     84    m_image->addClient(renderer);
    8585}
    8686
    8787void StyleCachedImage::removeClient(RenderObject* renderer)
    8888{
    89     m_image->removeClientForRenderer(renderer);
     89    m_image->removeClient(renderer);
    9090}
    9191
  • trunk/Source/WebCore/rendering/style/StyleCachedImage.h

    r98483 r98508  
    4949    virtual void computeIntrinsicDimensions(const RenderObject*, Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio);
    5050    virtual bool usesImageContainerSize() const;
    51     virtual void setContainerSizeForRenderer(const RenderObject*, const IntSize&, float);
     51    virtual void setContainerSizeForRenderer(const RenderObject*, const IntSize&);
    5252    virtual void addClient(RenderObject*);
    5353    virtual void removeClient(RenderObject*);
  • trunk/Source/WebCore/rendering/style/StyleGeneratedImage.h

    r98483 r98508  
    4848    virtual void computeIntrinsicDimensions(const RenderObject*, Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio);
    4949    virtual bool usesImageContainerSize() const { return !m_fixedSize; }
    50     virtual void setContainerSizeForRenderer(const RenderObject*, const IntSize& containerSize, float) { m_containerSize = containerSize; }
     50    virtual void setContainerSizeForRenderer(const RenderObject*, const IntSize& containerSize) { m_containerSize = containerSize; }
    5151    virtual void addClient(RenderObject*);
    5252    virtual void removeClient(RenderObject*);
  • trunk/Source/WebCore/rendering/style/StyleImage.h

    r98483 r98508  
    5858    virtual bool imageHasRelativeHeight() const = 0;
    5959    virtual bool usesImageContainerSize() const = 0;
    60     virtual void setContainerSizeForRenderer(const RenderObject*, const IntSize&, float) = 0;
     60    virtual void setContainerSizeForRenderer(const RenderObject*, const IntSize&) = 0;
    6161    virtual void addClient(RenderObject*) = 0;
    6262    virtual void removeClient(RenderObject*) = 0;
  • trunk/Source/WebCore/rendering/style/StylePendingImage.h

    r98483 r98508  
    5050    virtual void computeIntrinsicDimensions(const RenderObject*, Length& /* intrinsicWidth */ , Length& /* intrinsicHeight */, FloatSize& /* intrinsicRatio */) { }
    5151    virtual bool usesImageContainerSize() const { return false; }
    52     virtual void setContainerSizeForRenderer(const RenderObject*, const IntSize&, float) { }
     52    virtual void setContainerSizeForRenderer(const RenderObject*, const IntSize&) { }
    5353    virtual void addClient(RenderObject*) { }
    5454    virtual void removeClient(RenderObject*) { }
  • trunk/Source/WebCore/rendering/svg/RenderSVGImage.cpp

    r98483 r98508  
    6767    LayoutRepainter repainter(*this, checkForRepaintDuringLayout() && selfNeedsLayout());
    6868    SVGImageElement* image = static_cast<SVGImageElement*>(node());
    69     m_imageResource->setContainerSizeForRenderer(enclosingIntRect(m_objectBoundingBox).size());
    7069
    7170    bool transformOrBoundariesUpdate = m_needsTransformUpdate || m_updateCachedRepaintRect;
  • trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp

    r98483 r98508  
    2727#include "RenderSVGRoot.h"
    2828
    29 #include "Chrome.h"
    30 #include "ChromeClient.h"
    3129#include "Frame.h"
    3230#include "GraphicsContext.h"
    3331#include "HitTestResult.h"
    3432#include "LayoutRepainter.h"
    35 #include "Page.h"
    3633#include "RenderPart.h"
    3734#include "RenderSVGContainer.h"
     
    118115}
    119116
    120 bool RenderSVGRoot::isEmbeddedThroughImageElement() const
    121 {
    122     if (!node())
    123         return false;
    124 
    125     Frame* frame = node()->document()->frame();
    126     if (!frame)
    127         return false;
    128 
    129     // Test whether we're embedded through an img.
    130     if (!frame->page() || !frame->page()->chrome())
    131         return false;
    132 
    133     ChromeClient* chromeClient = frame->page()->chrome()->client();
    134     if (!chromeClient || !chromeClient->isSVGImageChromeClient())
    135         return false;
    136 
    137     return true;
     117LayoutUnit RenderSVGRoot::computeIntrinsicWidth(LayoutUnit replacedWidth) const
     118{
     119    if (!style()->width().isPercent())
     120        return replacedWidth;
     121    // FIXME: Remove unnecessary rounding when layout is off ints: webkit.org/b/63656
     122    return static_cast<int>(ceilf(replacedWidth * style()->effectiveZoom()));
     123}
     124
     125LayoutUnit RenderSVGRoot::computeIntrinsicHeight(LayoutUnit replacedHeight) const
     126{
     127    if (!style()->height().isPercent())
     128        return replacedHeight;
     129    // FIXME: Remove unnecessary rounding when layout is off ints: webkit.org/b/63656
     130    return static_cast<int>(ceilf(replacedHeight * style()->effectiveZoom()));
    138131}
    139132
     
    149142LayoutUnit RenderSVGRoot::computeReplacedLogicalWidth(bool includeMaxWidth) const
    150143{
    151     // When we're embedded through SVGImage (border-image/background-image/<html:img>/...) we're forced to resize to a specific size.
    152     LayoutUnit replacedWidth = m_containerSize.width();
    153     if (replacedWidth > 0)
    154         return replacedWidth;
    155 
    156     replacedWidth = RenderBox::computeReplacedLogicalWidth(includeMaxWidth);
     144    LayoutUnit replacedWidth = RenderBox::computeReplacedLogicalWidth(includeMaxWidth);
    157145    Frame* frame = node() && node()->document() ? node()->document()->frame() : 0;
    158146    if (!frame)
    159         return replacedWidth;
     147        return computeIntrinsicWidth(replacedWidth);
    160148
    161149    if (isEmbeddedThroughFrameContainingSVGDocument(frame))
    162         return replacedWidth;
     150        return computeIntrinsicWidth(replacedWidth);
    163151
    164152    RenderPart* ownerRenderer = frame->ownerRenderer();
     
    194182LayoutUnit RenderSVGRoot::computeReplacedLogicalHeight() const
    195183{
    196     // When we're embedded through SVGImage (border-image/background-image/<html:img>/...) we're forced to resize to a specific size.
    197     LayoutUnit replacedHeight = m_containerSize.height();
    198     if (replacedHeight > 0)
    199         return replacedHeight;
    200 
    201     replacedHeight = RenderBox::computeReplacedLogicalHeight();
     184    LayoutUnit replacedHeight = RenderBox::computeReplacedLogicalHeight();
     185
    202186    Frame* frame = node() && node()->document() ? node()->document()->frame() : 0;
    203187    if (!frame)
    204         return replacedHeight;
     188        return computeIntrinsicHeight(replacedHeight);
    205189
    206190    if (isEmbeddedThroughFrameContainingSVGDocument(frame))
    207         return replacedHeight;
     191        return computeIntrinsicHeight(replacedHeight);
    208192
    209193    RenderPart* ownerRenderer = frame->ownerRenderer();
     
    237221    computeLogicalWidth();
    238222    computeLogicalHeight();
     223    calcViewport();
    239224
    240225    SVGSVGElement* svg = static_cast<SVGSVGElement*>(node());
    241     m_isLayoutSizeChanged = needsLayout || (svg->hasRelativeLengths() && oldSize != size());
    242 
     226    m_isLayoutSizeChanged = svg->hasRelativeLengths() && oldSize != size();
     227 
    243228    if (view() && view()->frameView() && view()->frameView()->embeddedContentBox()) {
    244229        if (!m_needsSizeNegotiationWithHostDocument)
     
    286271        return;
    287272
    288     // An empty viewport disables rendering.
    289     if (borderBoxRect().isEmpty())
     273    // An empty viewport disables rendering.  FIXME: Should we still render filters?
     274    if (m_viewportSize.isEmpty())
    290275        return;
    291276
     
    344329    RenderBox::updateFromElement();
    345330    SVGResourcesCache::clientUpdatedFromElement(this, style());
     331}
     332
     333void RenderSVGRoot::calcViewport()
     334{
     335    SVGSVGElement* svg = static_cast<SVGSVGElement*>(node());
     336
     337    if (!svg->hasSetContainerSize()) {
     338        // In the normal case of <svg> being stand-alone or in a CSSBoxModel object we use
     339        // RenderBox::width()/height() (which pulls data from RenderStyle)
     340        m_viewportSize = FloatSize(width(), height());
     341        return;
     342    }
     343
     344    // In the SVGImage case grab the SVGLength values off of SVGSVGElement and use
     345    // the special relativeWidthValue accessors which respect the specified containerSize
     346    // FIXME: Check how SVGImage + zooming is supposed to be handled?
     347    SVGLength width = svg->width();
     348    SVGLength height = svg->height();
     349    m_viewportSize = FloatSize(width.unitType() == LengthTypePercentage ? svg->relativeWidthValue() : width.value(svg),
     350                               height.unitType() == LengthTypePercentage ? svg->relativeHeightValue() : height.value(svg));
    346351}
    347352
     
    394399
    395400    // Apply initial viewport clip - not affected by overflow settings   
    396     repaintRect.intersect(borderBoxRect());
     401    repaintRect.intersect(enclosingLayoutRect(FloatRect(FloatPoint(), m_viewportSize)));
    397402
    398403    const SVGRenderStyle* svgStyle = style()->svgStyle();
  • trunk/Source/WebCore/rendering/svg/RenderSVGRoot.h

    r98483 r98508  
    3232namespace WebCore {
    3333
     34class SVGStyledElement;
    3435class AffineTransform;
    35 class SVGStyledElement;
    3636
    3737class RenderSVGRoot : public RenderBox {
     
    3939    explicit RenderSVGRoot(SVGStyledElement*);
    4040    virtual ~RenderSVGRoot();
    41 
    42     bool isEmbeddedThroughImageElement() const;
    4341
    4442    virtual void computeIntrinsicRatioInformation(FloatSize& intrinsicRatio, bool& isPercentageIntrinsicSize) const;
     
    5856    virtual void setNeedsTransformUpdate() { m_needsBoundariesOrTransformUpdate = true; }
    5957
    60     IntSize containerSize() const { return m_containerSize; }
    61     void setContainerSize(const IntSize& containerSize) { m_containerSize = containerSize; }
     58private:
     59    LayoutUnit computeIntrinsicWidth(LayoutUnit replacedWidth) const;
     60    LayoutUnit computeIntrinsicHeight(LayoutUnit replacedHeight) const;
    6261
    63 private:
    6462    virtual RenderObjectChildList* virtualChildren() { return children(); }
    6563    virtual const RenderObjectChildList* virtualChildren() const { return children(); }
     
    9593    virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool useTransforms, bool fixed, TransformState&, bool* wasFixed = 0) const;
    9694
     95    void calcViewport();
     96
    9797    bool selfWillPaint();
    9898    void updateCachedBoundaries();
     
    104104
    105105    RenderObjectChildList m_children;
    106     IntSize m_containerSize;
     106    FloatSize m_viewportSize;
    107107    FloatRect m_objectBoundingBox;
    108108    FloatRect m_strokeBoundingBox;
  • trunk/Source/WebCore/svg/SVGLength.cpp

    r98483 r98508  
    2929#include "Frame.h"
    3030#include "FrameView.h"
     31#include "RenderObject.h"
    3132#include "RenderPart.h"
    32 #include "RenderSVGRoot.h"
    3333#include "RenderView.h"
    3434#include "SVGException.h"
     
    361361                return false;
    362362
    363             // SVGs embedded through <object> resolve percentage values against the owner renderer in the host document.
    364363            if (RenderPart* ownerRenderer = frame->ownerRenderer()) {
    365364                width = ownerRenderer->width();
     
    373372            return false;
    374373
    375         // Always resolve percentages against the unscaled viewport, as agreed across browsers.
    376         float zoom = view->style()->effectiveZoom();
    377374        width = view->viewWidth();
    378375        height = view->viewHeight();
    379         if (zoom != 1) {
    380             width /= zoom;
    381             height /= zoom;
    382         }
    383376        return true;
    384377    }
     
    388381    if (viewportElement && viewportElement->isSVG()) {
    389382        const SVGSVGElement* svg = static_cast<const SVGSVGElement*>(viewportElement);
    390         FloatRect viewBox = svg->currentViewBoxRect();
    391         if (viewBox.isEmpty()) {
     383        if (svg->hasAttribute(SVGNames::viewBoxAttr)) {
     384            width = svg->viewBox().width();
     385            height = svg->viewBox().height();
     386        } else {
    392387            width = svg->width().value(svg);
    393388            height = svg->height().value(svg);
    394         } else {
    395             width = viewBox.width();
    396             height = viewBox.height();
    397389        }
    398390
  • trunk/Source/WebCore/svg/SVGSVGElement.cpp

    r98483 r98508  
    8888    , m_useCurrentView(false)
    8989    , m_timeContainer(SMILTimeContainer::create(this))
     90    , m_containerSize(300, 150)
     91    , m_hasSetContainerSize(false)
    9092{
    9193    ASSERT(hasTagName(SVGNames::svgTag));
     
    151153    viewRectangle.setSize(FloatSize(width().value(this), height().value(this)));   
    152154    return viewBoxToViewTransform(viewRectangle.width(), viewRectangle.height()).mapRect(viewRectangle);
     155}
     156
     157int SVGSVGElement::relativeWidthValue() const
     158{
     159    SVGLength w = width();
     160    if (w.unitType() != LengthTypePercentage)
     161        return 0;
     162
     163    return static_cast<int>(w.valueAsPercentage() * m_containerSize.width());
     164}
     165
     166int SVGSVGElement::relativeHeightValue() const
     167{
     168    SVGLength h = height();
     169    if (h.unitType() != LengthTypePercentage)
     170        return 0;
     171
     172    return static_cast<int>(h.valueAsPercentage() * m_containerSize.height());
    153173}
    154174
     
    560580    }
    561581
    562     // Synthesize a viewBox if we're embedded through a <img> element, if none is present.
    563     FloatRect useViewBox = viewBox();
    564     if (useViewBox.isEmpty() && width().unitType() != LengthTypePercentage && height().unitType() != LengthTypePercentage) {
    565         if (RenderObject* renderer = this->renderer()) {
    566             if (renderer->isSVGRoot() && toRenderSVGRoot(renderer)->isEmbeddedThroughImageElement())
    567                 useViewBox = FloatRect(0, 0, width().value(this), height().value(this));
    568         }
    569     }
    570 
    571     return useViewBox;
     582    return viewBox();
    572583}
    573584
  • trunk/Source/WebCore/svg/SVGSVGElement.h

    r98483 r98508  
    6363
    6464    FloatRect viewport() const;
     65
     66    void setContainerSize(const LayoutSize& containerSize) { m_containerSize = containerSize; m_hasSetContainerSize = true; }
     67    LayoutSize containerSize() const { return m_containerSize; }
     68    bool hasSetContainerSize() const { return m_hasSetContainerSize; }
     69    int relativeWidthValue() const;
     70    int relativeHeightValue() const;
    6571
    6672    float pixelUnitToMillimeterX() const;
     
    176182    FloatPoint m_translation;
    177183    mutable OwnPtr<SVGViewSpec> m_viewSpec;
     184    LayoutSize m_containerSize;
     185    bool m_hasSetContainerSize;
    178186};
    179187
  • trunk/Source/WebCore/svg/graphics/SVGImage.cpp

    r98483 r98508  
    4444#include "ImageBuffer.h"
    4545#include "ImageObserver.h"
    46 #include "Length.h"
    4746#include "Page.h"
    48 #include "RenderSVGRoot.h"
    4947#include "RenderView.h"
    5048#include "ResourceError.h"
     
    6563    }
    6664
    67     void setObserver(SVGImage* image) { m_image = image; }
    68     virtual bool isSVGImageChromeClient() const { return true; }
    6965    SVGImage* image() const { return m_image; }
    7066   
     
    104100}
    105101
    106 void SVGImage::setContainerZoom(float containerZoom)
    107 {
    108     if (!m_page)
    109         return;
    110     m_chromeClient->setObserver(0);
    111     m_page->mainFrame()->setPageZoomFactor(containerZoom);
    112     m_chromeClient->setObserver(this);
    113 }
    114 
    115102void SVGImage::setContainerSize(const IntSize& containerSize)
    116103{
    117     ASSERT(!containerSize.isEmpty());
    118    
     104    if (containerSize.isEmpty())
     105        return;
     106
    119107    if (!m_page)
    120108        return;
     
    124112        return;
    125113
    126     RenderSVGRoot* renderer = toRenderSVGRoot(rootElement->renderer());
    127     if (!renderer)
    128         return;
    129     renderer->setContainerSize(containerSize);
    130 
    131     frame->view()->resize(size());
    132     if (frame->view()->needsLayout())
    133         frame->view()->layout();
     114    rootElement->setContainerSize(containerSize);
    134115}
    135116
     
    142123    if (!rootElement)
    143124        return false;
    144     if (RenderSVGRoot* renderer = toRenderSVGRoot(rootElement->renderer()))
    145         return !renderer->containerSize().isEmpty();
    146     return false;
     125
     126    return rootElement->hasSetContainerSize();
    147127}
    148128
     
    155135    if (!rootElement)
    156136        return IntSize();
    157 
    158     RenderSVGRoot* renderer = toRenderSVGRoot(rootElement->renderer());
    159     if (!renderer)
    160         return IntSize();
    161 
    162     // If a container size is available it has precedence.
    163     IntSize containerSize = renderer->containerSize();
    164     if (!containerSize.isEmpty())
    165         return containerSize;
    166 
    167     // Otherwise fallback to the viewBox size.
    168     IntSize size = enclosingIntRect(rootElement->currentViewBoxRect()).size();
    169     if (!size.isEmpty())
    170         return size;
    171 
    172     // As last resort, use CSS default intrinsic size.
    173     return IntSize(300, 150);
     137   
     138    SVGLength width = rootElement->width();
     139    SVGLength height = rootElement->height();
     140   
     141    IntSize svgSize;
     142    if (width.unitType() == LengthTypePercentage)
     143        svgSize.setWidth(rootElement->relativeWidthValue());
     144    else
     145        svgSize.setWidth(static_cast<int>(width.value(rootElement)));
     146
     147    if (height.unitType() == LengthTypePercentage)
     148        svgSize.setHeight(rootElement->relativeHeightValue());
     149    else
     150        svgSize.setHeight(static_cast<int>(height.value(rootElement)));
     151
     152    return svgSize;
     153}
     154
     155bool SVGImage::hasRelativeWidth() const
     156{
     157    if (!m_page)
     158        return false;
     159    SVGSVGElement* rootElement = static_cast<SVGDocument*>(m_page->mainFrame()->document())->rootElement();
     160    if (!rootElement)
     161        return false;
     162
     163    return rootElement->width().unitType() == LengthTypePercentage;
     164}
     165
     166bool SVGImage::hasRelativeHeight() const
     167{
     168    if (!m_page)
     169        return false;
     170    SVGSVGElement* rootElement = static_cast<SVGDocument*>(m_page->mainFrame()->document())->rootElement();
     171    if (!rootElement)
     172        return false;
     173
     174    return rootElement->height().unitType() == LengthTypePercentage;
    174175}
    175176
     
    197198    context->scale(scale);
    198199
     200    view->resize(size());
     201
     202    if (view->needsLayout())
     203        view->layout();
     204
    199205    view->paint(context, IntRect(0, 0, view->width(), view->height()));
    200206
     
    208214}
    209215
    210 RenderBox* SVGImage::embeddedContentBox() const
    211 {
    212     if (!m_page)
    213         return 0;
     216void SVGImage::computeIntrinsicDimensions(Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio)
     217{
     218    if (!m_page)
     219        return;
    214220    Frame* frame = m_page->mainFrame();
    215221    SVGSVGElement* rootElement = static_cast<SVGDocument*>(frame->document())->rootElement();
    216222    if (!rootElement)
    217         return 0;
    218     return toRenderBox(rootElement->renderer());
    219 }
    220 
    221 void SVGImage::computeIntrinsicDimensions(Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio)
    222 {
    223     if (!m_page)
    224         return;
    225     Frame* frame = m_page->mainFrame();
    226     SVGSVGElement* rootElement = static_cast<SVGDocument*>(frame->document())->rootElement();
    227     if (!rootElement)
    228223        return;
    229224    RenderBox* renderer = toRenderBox(rootElement->renderer());
     
    233228    intrinsicWidth = renderer->style()->width();
    234229    intrinsicHeight = renderer->style()->height();
    235     if (rootElement->preserveAspectRatio().align() != SVGPreserveAspectRatio::SVG_PRESERVEASPECTRATIO_NONE)
    236         intrinsicRatio = rootElement->currentViewBoxRect().size();
     230    // FIXME: Add intrinsicRatio calculation from webkit.org/b/47156.
     231    intrinsicRatio = FloatSize();
    237232}
    238233
     
    301296        FrameLoader* loader = frame->loader();
    302297        loader->setForcedSandboxFlags(SandboxAll);
    303 
    304         frame->view()->setCanHaveScrollbars(false); // SVG Images will always synthesize a viewBox, if it's not available, and thus never see scrollbars.
    305         frame->view()->setTransparent(true); // SVG Images are transparent.
    306 
    307298        ASSERT(loader->activeDocumentLoader()); // DocumentLoader should have been created by frame->init().
    308299        loader->activeDocumentLoader()->writer()->setMIMEType("image/svg+xml");
     
    310301        loader->activeDocumentLoader()->writer()->addData(data()->data(), data()->size());
    311302        loader->activeDocumentLoader()->writer()->end();
    312    
    313         frame->view()->resize(size());
    314 
    315         if (frame->view()->needsLayout())
    316             frame->view()->layout();
     303        frame->view()->setTransparent(true); // SVG Images are transparent.
    317304    }
    318305
  • trunk/Source/WebCore/svg/graphics/SVGImage.h

    r98483 r98508  
    3636
    3737class Page;
    38 class RenderBox;
    3938class SVGImageChromeClient;
    4039
     
    4544        return adoptRef(new SVGImage(observer));
    4645    }
    47 
    48     RenderBox* embeddedContentBox() const;
    49     void setContainerZoom(float);
    5046
    5147    virtual bool isSVGImage() const { return true; }
     
    5854    virtual void setContainerSize(const IntSize&);
    5955    virtual bool usesContainerSize() const;
     56    virtual bool hasRelativeWidth() const;
     57    virtual bool hasRelativeHeight() const;
    6058    virtual void computeIntrinsicDimensions(Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio);
    6159
Note: See TracChangeset for help on using the changeset viewer.