Changeset 87779 in webkit
- Timestamp:
- Jun 1, 2011 12:30:10 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 54 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r87778 r87779 1 2011-06-01 Nikolas Zimmermann <nzimmermann@rim.com> 2 3 Reviewed by Rob Buis. 4 5 SVG fails all 3 of Hixie's CSS intrinsic sizing tests 6 https://bugs.webkit.org/show_bug.cgi?id=15473 7 8 Hixies CSS intrinsic sizing tests cover percentage sizes specified on the target SVG document as width/height attributes 9 and using width: auto / height: auto on the <object> that hosts the SVG document. Take percentage sizes of the outermost 10 SVGs width/height attributes into account when determining the intrinsic size of the <object>. 11 12 Added several other testcases demonstrating several scenarios. All tests work exactly the same in WebKit and Firefox now. 13 The *on-target-svg-absolute.xhtml tests look equal to WebKit/FF but Opera fails them, likely a relict of the different 14 interpretation of the intrinsic size of a SVG document in SVG Tiny 1.2. 15 16 * platform/mac/svg/custom/object-sizing-height-50p-on-target-svg-absolute-expected.png: Added. 17 * platform/mac/svg/custom/object-sizing-height-50p-on-target-svg-absolute-expected.txt: Added. 18 * platform/mac/svg/custom/object-sizing-height-50p-on-target-svg-expected.png: Added. 19 * platform/mac/svg/custom/object-sizing-height-50p-on-target-svg-expected.txt: Added. 20 * platform/mac/svg/custom/object-sizing-width-50p-height-50p-on-target-svg-absolute-expected.png: Added. 21 * platform/mac/svg/custom/object-sizing-width-50p-height-50p-on-target-svg-absolute-expected.txt: Added. 22 * platform/mac/svg/custom/object-sizing-width-50p-height-50p-on-target-svg-expected.png: Added. 23 * platform/mac/svg/custom/object-sizing-width-50p-height-50p-on-target-svg-expected.txt: Added. 24 * platform/mac/svg/custom/object-sizing-width-50p-height-75p-on-target-svg-absolute-expected.png: Added. 25 * platform/mac/svg/custom/object-sizing-width-50p-height-75p-on-target-svg-absolute-expected.txt: Added. 26 * platform/mac/svg/custom/object-sizing-width-50p-height-75p-on-target-svg-expected.png: Added. 27 * platform/mac/svg/custom/object-sizing-width-50p-height-75p-on-target-svg-expected.txt: Added. 28 * platform/mac/svg/custom/object-sizing-width-50p-on-target-svg-absolute-expected.png: Added. 29 * platform/mac/svg/custom/object-sizing-width-50p-on-target-svg-absolute-expected.txt: Added. 30 * platform/mac/svg/custom/object-sizing-width-50p-on-target-svg-expected.png: Added. 31 * platform/mac/svg/custom/object-sizing-width-50p-on-target-svg-expected.txt: Added. 32 * platform/mac/svg/custom/object-sizing-width-75p-height-50p-on-target-svg-absolute-expected.png: Added. 33 * platform/mac/svg/custom/object-sizing-width-75p-height-50p-on-target-svg-absolute-expected.txt: Added. 34 * platform/mac/svg/custom/object-sizing-width-75p-height-50p-on-target-svg-expected.png: Added. 35 * platform/mac/svg/custom/object-sizing-width-75p-height-50p-on-target-svg-expected.txt: Added. 36 * platform/mac/svg/hixie/intrinsic: Added. 37 * platform/mac/svg/hixie/intrinsic/001-expected.png: Added. 38 * platform/mac/svg/hixie/intrinsic/001-expected.txt: Added. 39 * platform/mac/svg/hixie/intrinsic/002-expected.png: Added. 40 * platform/mac/svg/hixie/intrinsic/002-expected.txt: Added. 41 * platform/mac/svg/hixie/intrinsic/003-expected.png: Added. 42 * platform/mac/svg/hixie/intrinsic/003-expected.txt: Added. 43 * svg/custom/object-sizing-height-50p-on-target-svg-absolute.xhtml: Added. 44 * svg/custom/object-sizing-height-50p-on-target-svg.xhtml: Added. 45 * svg/custom/object-sizing-width-50p-height-50p-on-target-svg-absolute.xhtml: Added. 46 * svg/custom/object-sizing-width-50p-height-50p-on-target-svg.xhtml: Added. 47 * svg/custom/object-sizing-width-50p-height-75p-on-target-svg-absolute.xhtml: Added. 48 * svg/custom/object-sizing-width-50p-height-75p-on-target-svg.xhtml: Added. 49 * svg/custom/object-sizing-width-50p-on-target-svg-absolute.xhtml: Added. 50 * svg/custom/object-sizing-width-50p-on-target-svg.xhtml: Added. 51 * svg/custom/object-sizing-width-75p-height-50p-on-target-svg-absolute.xhtml: Added. 52 * svg/custom/object-sizing-width-75p-height-50p-on-target-svg.xhtml: Added. 53 * svg/custom/resources/object-sizing-height-50p.svg: Added. 54 * svg/custom/resources/object-sizing-width-50p-height-50p.svg: Added. 55 * svg/custom/resources/object-sizing-width-50p-height-75p.svg: Added. 56 * svg/custom/resources/object-sizing-width-50p.svg: Added. 57 * svg/custom/resources/object-sizing-width-75p-height-50p.svg: Added. 58 * svg/hixie/intrinsic: Added. 59 * svg/hixie/intrinsic/001.html: Added. 60 * svg/hixie/intrinsic/002.html: Added. 61 * svg/hixie/intrinsic/003.html: Added. 62 * svg/hixie/intrinsic/resources: Added. 63 * svg/hixie/intrinsic/resources/001.svg: Added. 64 * svg/hixie/intrinsic/resources/002.svg: Added. 65 * svg/hixie/intrinsic/resources/003.svg: Added. 66 * svg/hixie/intrinsic/resources/test-bl: Added. 67 * svg/hixie/intrinsic/resources/test-br: Added. 68 * svg/hixie/intrinsic/resources/test-tl: Added. 69 * svg/hixie/intrinsic/resources/test-tr: Added. 70 1 71 2011-06-01 Annie Sullivan <sullivan@chromium.org> 2 72 -
trunk/Source/WebCore/ChangeLog
r87776 r87779 1 2011-06-01 Nikolas Zimmermann <nzimmermann@rim.com> 2 3 Reviewed by Rob Buis. 4 5 SVG fails all 3 of Hixie's CSS intrinsic sizing tests 6 https://bugs.webkit.org/show_bug.cgi?id=15473 7 8 Hixies CSS intrinsic sizing tests cover percentage sizes specified on the target SVG document as width/height attributes 9 and using width: auto / height: auto on the <object> that hosts the SVG document. Take percentage sizes of the outermost 10 SVGs width/height attributes into account when determining the intrinsic size of the <object>. 11 12 Added several other testcases demonstrating several scenarios. All tests work exactly the same in WebKit and Firefox now. 13 The *on-target-svg-absolute.xhtml tests look equal to WebKit/FF but Opera fails them, likely a relict of the different 14 interpretation of the intrinsic size of a SVG document in SVG Tiny 1.2. 15 16 Tests: svg/custom/object-sizing-height-50p-on-target-svg-absolute.xhtml 17 svg/custom/object-sizing-height-50p-on-target-svg.xhtml 18 svg/custom/object-sizing-width-50p-height-50p-on-target-svg-absolute.xhtml 19 svg/custom/object-sizing-width-50p-height-50p-on-target-svg.xhtml 20 svg/custom/object-sizing-width-50p-height-75p-on-target-svg-absolute.xhtml 21 svg/custom/object-sizing-width-50p-height-75p-on-target-svg.xhtml 22 svg/custom/object-sizing-width-50p-on-target-svg-absolute.xhtml 23 svg/custom/object-sizing-width-50p-on-target-svg.xhtml 24 svg/custom/object-sizing-width-75p-height-50p-on-target-svg-absolute.xhtml 25 svg/custom/object-sizing-width-75p-height-50p-on-target-svg.xhtml 26 svg/hixie/intrinsic/001.html 27 svg/hixie/intrinsic/002.html 28 svg/hixie/intrinsic/003.html 29 30 * rendering/RenderPart.cpp: 31 (WebCore::RenderPart::computeReplacedLogicalWidth): 32 (WebCore::RenderPart::computeReplacedLogicalHeight): 33 * rendering/svg/RenderSVGRoot.cpp: 34 (WebCore::RenderSVGRoot::computeIntrinsicRatio): 35 * rendering/svg/RenderSVGRoot.h: 36 1 37 2011-05-31 Tonis Tiigi <tonistiigi@gmail.com> 2 38 … … 387 423 (WebCore::XMLDocumentParser::insertErrorMessageBlock): 388 424 389 >>>>>>> .r87747390 425 2011-05-31 Andreas Kling <kling@webkit.org> 391 426 … … 632 667 Include '+' in the list of valid characters. 633 668 669 >>>>>>> .r87778 634 670 2011-05-30 Andrey Petrov <andrey.petrov@gmail.com> 635 671 -
trunk/Source/WebCore/rendering/RenderPart.cpp
r87526 r87779 140 140 141 141 // 10.3.2 Inline, replaced elements: http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-width 142 bool isPercentageIntrinsicSize = false; 143 FloatSize intrinsicRatio; 144 contentRenderer->computeIntrinsicRatioInformation(intrinsicRatio, isPercentageIntrinsicSize); 145 142 146 if (style()->width().isAuto()) { 143 147 bool heightIsAuto = style()->height().isAuto(); … … 149 153 150 154 bool hasIntrinsicHeight = contentRenderStyle->height().isFixed(); 151 FloatSize intrinsicRatio = contentRenderer->computeIntrinsicRatio();152 155 if (!intrinsicRatio.isEmpty()) { 153 156 // If 'height' and 'width' both have computed values of 'auto' and the element has no intrinsic width, but does have an intrinsic height and intrinsic ratio; … … 164 167 // FIXME: Don't ignore padding/margin/border here. 165 168 RenderBlock* containingBlock = this->containingBlock(); 166 if (heightIsAuto && !hasIntrinsicWidth && !hasIntrinsicHeight && containingBlock) 169 if (heightIsAuto && !hasIntrinsicWidth && !hasIntrinsicHeight && containingBlock) { 170 if (isPercentageIntrinsicSize) 171 return static_cast<int>(ceilf(containingBlock->width() * intrinsicRatio.width() / 100)); 167 172 return containingBlock->width(); 173 } 168 174 } 169 175 … … 187 193 188 194 // 10.6.2 Inline, replaced elements: http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height 195 bool isPercentageIntrinsicSize = false; 196 FloatSize intrinsicRatio; 197 contentRenderer->computeIntrinsicRatioInformation(intrinsicRatio, isPercentageIntrinsicSize); 198 189 199 if (style()->height().isAuto()) { 190 200 bool widthIsAuto = style()->width().isAuto(); … … 197 207 // Otherwise, if 'height' has a computed value of 'auto', and the element has an intrinsic ratio then the used value of 'height' is: 198 208 // (used width) / (intrinsic ratio) 199 FloatSize intrinsicRatio = contentRenderer->computeIntrinsicRatio(); 200 if (!intrinsicRatio.isEmpty()) { 209 if (!intrinsicRatio.isEmpty() && !isPercentageIntrinsicSize) { 201 210 int logicalWidth = computeReplacedLogicalWidthUsing(widthIsAuto ? contentRenderStyle->logicalWidth() : style()->logicalWidth()); 202 211 return static_cast<int>(ceilf(logicalWidth * intrinsicRatio.height() / intrinsicRatio.width())); -
trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp
r87526 r87779 63 63 } 64 64 65 FloatSize RenderSVGRoot::computeIntrinsicRatio() const65 void RenderSVGRoot::computeIntrinsicRatioInformation(FloatSize& intrinsicRatio, bool& isPercentageIntrinsicSize) const 66 66 { 67 67 // Spec: http://dev.w3.org/SVG/profiles/1.1F2/publish/coords.html#IntrinsicSizing … … 75 75 // (in, mm, cm, pt, pc, px, em, ex) or in user units, then the aspect ratio is calculated from the 76 76 // ‘width’ and ‘height’ attributes after resolving both values to user units. 77 if (style()->width().isFixed() && style()->height().isFixed()) 78 return FloatSize(width(), height()); 77 isPercentageIntrinsicSize = false; 78 if (style()->width().isFixed() && style()->height().isFixed()) { 79 intrinsicRatio = FloatSize(width(), height()); 80 return; 81 } 79 82 80 83 // If either/both of the ‘width’ and ‘height’ of the rootmost ‘svg’ element are in percentage units (or omitted), … … 82 85 // document fragment. If the ‘viewBox’ is not correctly specified, or set to 'none', the intrinsic aspect ratio 83 86 // cannot be calculated and is considered unspecified. 84 return static_cast<SVGSVGElement*>(node())->currentViewBoxRect().size(); 87 intrinsicRatio = static_cast<SVGSVGElement*>(node())->currentViewBoxRect().size(); 88 89 // Compatibility with authors expectations and Firefox/Opera: when percentage units are used, take them into 90 // account for certain cases of the intrinsic width/height calculation in RenderPart::computeReplacedLogicalWidth/Height. 91 if (intrinsicRatio.isEmpty() && style()->width().isPercent() && style()->height().isPercent()) { 92 isPercentageIntrinsicSize = true; 93 intrinsicRatio = FloatSize(style()->width().percent(), style()->height().percent()); 94 } 85 95 } 86 96 -
trunk/Source/WebCore/rendering/svg/RenderSVGRoot.h
r87526 r87779 40 40 virtual ~RenderSVGRoot(); 41 41 42 FloatSize computeIntrinsicRatio() const;42 void computeIntrinsicRatioInformation(FloatSize& intrinsicRatio, bool& isPercentageIntrinsicSize) const; 43 43 const RenderObjectChildList* children() const { return &m_children; } 44 44 RenderObjectChildList* children() { return &m_children; }
Note: See TracChangeset
for help on using the changeset viewer.