2011-05-27  Nikolas Zimmermann  <nzimmermann@rim.com>

        Reviewed by Rob Buis.

        embedded SVG object doesn't scale right
        https://bugs.webkit.org/show_bug.cgi?id=10526

        <object> tags should treat width/height on a referenced SVG as intrinsic width/height
        https://bugs.webkit.org/show_bug.cgi?id=11976

        Incorrect handling of percentage values for width/height on embedded elements
        https://bugs.webkit.org/show_bug.cgi?id=14793

        WebKit fails some WICD 1.0 core test cases
        https://bugs.webkit.org/show_bug.cgi?id=15836 (partially fixed, all 'rightsizing' tests are fixed)

        CSS 2.1: Support replaced elements with relative intrinsic sizes
        https://bugs.webkit.org/show_bug.cgai?id=15849 (partially fixed)

        SVG embedded as <object> doesn't respect width/height attributes
        https://bugs.webkit.org/show_bug.cgi?id=34972

        Explicit size of object tag ignored
        https://bugs.webkit.org/show_bug.cgi?id=37086

        * http/tests/misc/object-embedding-svg-delayed-size-negotiation.xhtml: Added.
        * http/tests/misc/resources/embedded.svg: Added.
        * http/tests/misc/resources/svg-slow.pl: Added.
        * platform/mac/http/tests/misc/object-embedding-svg-delayed-size-negotiation-expected.png: Added.
        * platform/mac/http/tests/misc/object-embedding-svg-delayed-size-negotiation-expected.txt: Added.
        * platform/mac/svg/custom/object-no-size-attributes-expected.png: Added.
        * platform/mac/svg/custom/object-no-size-attributes-expected.txt: Added.
        * platform/mac/svg/custom/object-sizing-expected.png: Added.
        * platform/mac/svg/custom/object-sizing-expected.txt: Added.
        * platform/mac/svg/custom/object-sizing-explicit-height-expected.png: Added.
        * platform/mac/svg/custom/object-sizing-explicit-height-expected.txt: Added.
        * platform/mac/svg/custom/object-sizing-explicit-width-expected.png: Added.
        * platform/mac/svg/custom/object-sizing-explicit-width-expected.txt: Added.
        * platform/mac/svg/custom/object-sizing-explicit-width-height-expected.png: Added.
        * platform/mac/svg/custom/object-sizing-explicit-width-height-expected.txt: Added.
        * platform/mac/svg/custom/object-sizing-no-width-height-change-content-box-size-expected.png: Added.
        * platform/mac/svg/custom/object-sizing-no-width-height-change-content-box-size-expected.txt: Added.
        * platform/mac/svg/custom/object-sizing-no-width-height-expected.png: Added.
        * platform/mac/svg/custom/object-sizing-no-width-height-expected.txt: Added.
        * platform/mac/svg/hixie/text/003-expected.png:
        * platform/mac/svg/hixie/text/003-expected.txt:
        * platform/mac/svg/in-html/by-reference-expected.txt:
        * platform/mac/svg/wicd: Added.
        * platform/mac/svg/wicd/rightsizing-grid-expected.png: Added.
        * platform/mac/svg/wicd/rightsizing-grid-expected.txt: Added.
        * platform/mac/svg/wicd/test-rightsizing-a-expected.png: Added.
        * platform/mac/svg/wicd/test-rightsizing-a-expected.txt: Added.
        * platform/mac/svg/wicd/test-rightsizing-b-expected.png: Added.
        * platform/mac/svg/wicd/test-rightsizing-b-expected.txt: Added.
        * platform/mac/svg/zoom/page/relative-sized-document-scrollbars-expected.txt:
        * platform/mac/svg/zoom/page/zoom-foreignObject-expected.png:
        * platform/mac/svg/zoom/page/zoom-foreignObject-expected.txt:
        * platform/mac/svg/zoom/page/zoom-svg-through-object-with-absolute-size-2-expected.png: Added.
        * platform/mac/svg/zoom/page/zoom-svg-through-object-with-absolute-size-2-expected.txt: Added.
        * platform/mac/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.png: Added.
        * platform/mac/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.txt: Added.
        * platform/mac/svg/zoom/page/zoom-svg-through-object-with-huge-size-expected.png: Added.
        * platform/mac/svg/zoom/page/zoom-svg-through-object-with-huge-size-expected.txt: Added.
        * platform/mac/svg/zoom/page/zoom-svg-through-object-with-no-width-height-expected.png: Added.
        * platform/mac/svg/zoom/page/zoom-svg-through-object-with-no-width-height-expected.txt: Added.
        * platform/mac/svg/zoom/page/zoom-svg-through-object-with-override-size-expected.png: Added.
        * platform/mac/svg/zoom/page/zoom-svg-through-object-with-override-size-expected.txt: Added.
        * platform/mac/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.png: Added.
        * platform/mac/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.txt: Added.
        * platform/mac/svg/zoom/page/zoom-svg-through-object-with-text-expected.png: Added.
        * platform/mac/svg/zoom/page/zoom-svg-through-object-with-text-expected.txt: Added.
        * svg/custom/object-no-size-attributes.xhtml: Added.
        * svg/custom/object-sizing-explicit-height.xhtml: Added.
        * svg/custom/object-sizing-explicit-width-height.xhtml: Added.
        * svg/custom/object-sizing-explicit-width.xhtml: Added.
        * svg/custom/object-sizing-no-width-height-change-content-box-size.xhtml: Added.
        * svg/custom/object-sizing-no-width-height.xhtml: Added.
        * svg/custom/object-sizing.xhtml: Added.
        * svg/custom/resources/embedded.svg: Added.
        * svg/custom/resources/red-circle.svg: Added.
        * svg/in-html/by-reference-expected.png:
        * svg/wicd: Added.
        * svg/wicd/resources: Added.
        * svg/wicd/resources/a.svg: Added.
        * svg/wicd/resources/bcde.svg: Added.
        * svg/wicd/resources/empty1.svg: Added.
        * svg/wicd/resources/empty2.svg: Added.
        * svg/wicd/resources/empty3.svg: Added.
        * svg/wicd/resources/f.svg: Added.
        * svg/wicd/resources/g.svg: Added.
        * svg/wicd/resources/h.svg: Added.
        * svg/wicd/resources/i.svg: Added.
        * svg/wicd/resources/j.svg: Added.
        * svg/wicd/resources/k.svg: Added.
        * svg/wicd/resources/l.svg: Added.
        * svg/wicd/resources/main.css: Added.
        (body,html):
        (body):
        (.buttons):
        (h1):
        (h2):
        (h4):
        (p):
        (table):
        (th):
        (td,th):
        (td a):
        (a):
        (a:hover):
        (a:focus):
        (a:visited):
        (a.index):
        (a.index:hover):
        (a.index:focus):
        (a.index:visited):
        (ul):
        (ol):
        (.red):
        (.navi):
        (.navi a):
        (.navi a:hover):
        (.navi a:visited):
        * svg/wicd/resources/mnop.svg: Added.
        * svg/wicd/resources/q.svg: Added.
        * svg/wicd/resources/r.svg: Added.
        * svg/wicd/resources/s.svg: Added.
        * svg/wicd/resources/t.svg: Added.
        * svg/wicd/resources/test-rightsizing-a.css: Added.
        (html,body):
        (div.all):
        (object.w100):
        (object.h100):
        * svg/wicd/resources/test-rightsizing-b.css: Added.
        (html,body):
        (object):
        * svg/wicd/resources/test-svg-child-object-rightsizing.gif: Added.
        * svg/wicd/resources/test-svg-child-object-rightsizing.png: Added.
        * svg/wicd/resources/test-svg-child-object-rightsizing.svg: Added.
        * svg/wicd/resources/test-svg-child-object-rightsizing1.svg: Added.
        * svg/wicd/rightsizing-grid.xhtml: Added.
        * svg/wicd/test-rightsizing-a.xhtml: Added.
        * svg/wicd/test-rightsizing-b.xhtml: Added.
        * svg/zoom/page/resources: Added.
        * svg/zoom/page/resources/absolute-sized-svg.png: Added.
        * svg/zoom/page/resources/absolute-sized-svg.svg: Added.
        * svg/zoom/page/resources/huge-rect.svg: Added.
        * svg/zoom/page/resources/percentage-sized-svg.png: Added.
        * svg/zoom/page/resources/percentage-sized-svg.svg: Added.
        * svg/zoom/page/resources/text.svg: Added.
        * svg/zoom/page/resources/tux.svg: Added.
        * svg/zoom/page/zoom-svg-through-object-with-absolute-size-2.xhtml: Added.
        * svg/zoom/page/zoom-svg-through-object-with-absolute-size.xhtml: Added.
        * svg/zoom/page/zoom-svg-through-object-with-huge-size.xhtml: Added.
        * svg/zoom/page/zoom-svg-through-object-with-override-size.html: Added.
        * svg/zoom/page/zoom-svg-through-object-with-percentage-size.xhtml: Added.
        * svg/zoom/page/zoom-svg-through-object-with-text.xhtml: Added.

2011-05-27  Nikolas Zimmermann  <nzimmermann@rim.com>

        Reviewed by Rob Buis.

        embedded SVG object doesn't scale right
        https://bugs.webkit.org/show_bug.cgi?id=10526

        <object> tags should treat width/height on a referenced SVG as intrinsic width/height
        https://bugs.webkit.org/show_bug.cgi?id=11976

        Incorrect handling of percentage values for width/height on embedded elements
        https://bugs.webkit.org/show_bug.cgi?id=14793

        WebKit fails some WICD 1.0 core test cases
        https://bugs.webkit.org/show_bug.cgi?id=15836 (partially fixed, all 'rightsizing' tests are fixed)

        CSS 2.1: Support replaced elements with relative intrinsic sizes
        https://bugs.webkit.org/show_bug.cgai?id=15849 (partially fixed)

        SVG embedded as <object> doesn't respect width/height attributes
        https://bugs.webkit.org/show_bug.cgi?id=34972

        Explicit size of object tag ignored
        https://bugs.webkit.org/show_bug.cgi?id=37086

        Add partial support of CSS 2.1 replaced elements with intrinsic size. The feature itself is complete but has only
        been implemented for RenderPart, to support SVG content document size negotiation. It serves as starting point for a generalization, in future.
        The changes in RenderPart are a 1:1 transliteration of the spec (http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-width/height, see code).

        SVG 1.1 says:
        The 'width' attribute on the outermost svg element establishes the viewport's width, unless the following conditions are met:
        ...
        and there are CSS-compatible positioning properties ([CSS2], section 9.3) specified on the referencing element (e.g., the 'object' element)
        or on the containing document's outermost svg element that are sufficient to establish the width of the viewport. Under these conditions,
        the positioning properties establish the viewport's width.

        If an <object> carries width/height attributes, these specify the viewport size of the embedded SVG, instead of its own
        width/height or viewBox properties. If an <object> has no width/height information, its intrinsic size needs to be calculated depending
        on the intrinsic ratio (viewBox width divided by height ratio) and the width/height properties on the outermost referenced <svg> element.
        This requires a negotiation between the host document and the embedded document.
        (There are several more factors that need to be considered, the CSS spec covers this and the RenderPart::computeReplaced* code covers this.)

        Fixes dozens of long-standing bug reports. The number one integration issue when using SVG through <object> is resolved: "right sizing".

        Tests: http/tests/misc/object-embedding-svg-delayed-size-negotiation.xhtml
               svg/custom/object-no-size-attributes.xhtml (bug 11976, from Eric Seidel)
               svg/custom/object-sizing-explicit-height.xhtml (bug 10526, from Ryan Cannon)
               svg/custom/object-sizing-explicit-width-height.xhtml
               svg/custom/object-sizing-explicit-width.xhtml (bug 14793, from Oliver Hunt)
               svg/custom/object-sizing-no-width-height-change-content-box-size.xhtml
               svg/custom/object-sizing-no-width-height.xhtml
               svg/custom/object-sizing.xhtml (bug 37086, from Jeff Schiller)
               svg/wicd/rightsizing-grid.xhtml (bug 15836, WICD rightsizing test now works)
               svg/wicd/test-rightsizing-a.xhtml (ditto)
               svg/wicd/test-rightsizing-b.xhtml (ditto)
               svg/zoom/page/zoom-svg-through-object-with-absolute-size-2.xhtml
               svg/zoom/page/zoom-svg-through-object-with-absolute-size.xhtml
               svg/zoom/page/zoom-svg-through-object-with-huge-size.xhtml
               svg/zoom/page/zoom-svg-through-object-with-override-size.html (bug 34972, from Andreas Kling)
               svg/zoom/page/zoom-svg-through-object-with-percentage-size.xhtml
               svg/zoom/page/zoom-svg-through-object-with-text.xhtml

        * platform/Length.h:
        (WebCore::Length::isSpecified):
        * rendering/RenderPart.cpp:
        (WebCore::RenderPart::embeddedSVGContentRenderer):
        (WebCore::RenderPart::computeEmbeddedDocumentReplacedWidth):
        (WebCore::RenderPart::computeEmbeddedDocumentReplacedHeight):
        (WebCore::RenderPart::computeReplacedLogicalWidth):
        (WebCore::RenderPart::computeReplacedLogicalHeight):
        (WebCore::RenderPart::layout):
        * rendering/RenderPart.h:
        * rendering/RenderReplaced.cpp:
        (WebCore::RenderReplaced::computeReplacedLogicalWidth):
        (WebCore::RenderReplaced::computeReplacedLogicalHeight):
        * rendering/svg/RenderSVGRoot.cpp:
        (WebCore::RenderSVGRoot::RenderSVGRoot):
        (WebCore::RenderSVGRoot::computeIntrinsicRatio):
        (WebCore::RenderSVGRoot::computeIntrinsicWidth):
        (WebCore::RenderSVGRoot::computeIntrinsicHeight):
        (WebCore::RenderSVGRoot::negotiateSizeWithHostDocumentIfNeeded):
        (WebCore::RenderSVGRoot::computeReplacedLogicalWidth):
        (WebCore::RenderSVGRoot::computeReplacedLogicalHeight):
        (WebCore::RenderSVGRoot::layout):
        * rendering/svg/RenderSVGRoot.h:
        * svg/SVGLength.cpp:
        (WebCore::SVGLength::determineViewport):
        * svg/SVGSVGElement.cpp:
        (WebCore::SVGSVGElement::currentScale):
        (WebCore::SVGSVGElement::setCurrentScale):
        (WebCore::SVGSVGElement::currentViewBoxRect):
        (WebCore::SVGSVGElement::viewBoxToViewTransform):
        * svg/SVGSVGElement.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@87526 268f45cc-cd09-0410-ab3c-d52691b4dbfc
106 files changed