haikuwebkit/LayoutTests/svg/custom/external-paintserver-refere...

11 lines
645 B
Plaintext
Raw Permalink Normal View History

Adapt inline SVG sizing behavior to Firefox and Blink https://bugs.webkit.org/show_bug.cgi?id=132569 Reviewed by Dean Jackson. Source/WebCore: This patch is ported from Blink CR 308992. Thanks to David Vest for helping with back porting his Blink patch. From the commit message: "The basis of this change is to map explicit width and height attributes to CSS properties, essentially promoting them to presentation attributes. Note that implicit "100%" width and height are not mapped. This enables us to remove the concept of "percentage intrinsic size" and rely on normal CSS rules to resolve percentage values. The change has been approved by the SVG WG and the spec is being updated. Minutes here: http://www.w3.org/2014/04/07-svg-minutes.html#item03" The new model was indeed approved by the SVG WG and is basically following the CSS 2.1 model for replaced elements. With this patch WebKit, Firefox and Blink have the same behavior for inline SVG. This is the first successful approach to unify the sizing behavior of SVG across UAs. Tests: svg/as-object/sizing/svg-in-object-placeholder-height-auto.html svg/as-object/sizing/svg-in-object-placeholder-height-fixed.html svg/as-object/sizing/svg-in-object-placeholder-height-percentage.html svg/in-html/sizing/svg-inline.html * css/svg.css: Root SVG elements still need to be sized with height: 100% and width: 100%. This is necessary since width and height are presentation attributes now. (svg:root): * rendering/RenderBox.h: (WebCore::RenderBox::computeIntrinsicRatioInformation): Remove all special behavior for intrinsic and percentage based sizes in SVG. This simplifies and unifies the code a lot. Most of the logic that is used is in RenderBox and RenderReplaced now. RenderSVGRoot was cleaned up a lot and is much lighter. And so it SVGSVGElement. * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight): (WebCore::RenderBoxModelObject::calculateImageIntrinsicDimensions): * rendering/RenderImage.cpp: (WebCore::RenderImage::computeIntrinsicRatioInformation): * rendering/RenderImage.h: * rendering/RenderReplaced.cpp: (WebCore::RenderReplaced::computeAspectRatioInformationForRenderBox): (WebCore::RenderReplaced::computeIntrinsicRatioInformation): (WebCore::RenderReplaced::computeReplacedLogicalWidth): (WebCore::RenderReplaced::computeReplacedLogicalHeight): (WebCore::RenderReplaced::computePreferredLogicalWidths): * rendering/RenderReplaced.h: * rendering/svg/RenderSVGRoot.cpp: (WebCore::RenderSVGRoot::computeIntrinsicRatioInformation): (WebCore::RenderSVGRoot::computeReplacedLogicalWidth): (WebCore::RenderSVGRoot::computeReplacedLogicalHeight): (WebCore::RenderSVGRoot::hasRelativeDimensions): (WebCore::RenderSVGRoot::hasRelativeIntrinsicLogicalWidth): Deleted. (WebCore::RenderSVGRoot::hasRelativeLogicalHeight): Deleted. * rendering/svg/RenderSVGRoot.h: * svg/SVGElement.h: (WebCore::SVGElement::invalidateSVGPresentationAttributeStyle): * svg/SVGSVGElement.cpp: (WebCore::SVGSVGElement::isPresentationAttribute): (WebCore::SVGSVGElement::collectStyleForPresentationAttribute): (WebCore::SVGSVGElement::svgAttributeChanged): (WebCore::SVGSVGElement::currentViewportSize): (WebCore::SVGSVGElement::hasIntrinsicWidth): (WebCore::SVGSVGElement::hasIntrinsicHeight): (WebCore::SVGSVGElement::intrinsicWidth): (WebCore::SVGSVGElement::intrinsicHeight): (WebCore::SVGSVGElement::widthAttributeEstablishesViewport): Deleted. (WebCore::SVGSVGElement::heightAttributeEstablishesViewport): Deleted. * svg/SVGSVGElement.h: * svg/graphics/SVGImage.cpp: (WebCore::SVGImage::containerSize): * xml/XMLErrors.cpp: If an error occurs in a stand alone SVG file, we create an XHTML document with the error message and append the SVG file. This SVG file now follows the CSS sizing behavior as inline SVG. Therefore, we need to set width and height to 100% explicitly. (WebCore::XMLErrors::insertErrorMessageBlock): LayoutTests: The new sizing behavior for inline SVG causes different DRT outputs for about 40 test cases. This is expected but for most tests an improvement since the SVGs fit into the documents and scrollbars disappear or the general size gets smaller. Some tests needed to be updated. The size was either not set at all or not properly. svg-in-object.js and svg-inline.js contain dozens of new tests to check the correct sizing behavior. The tests were written by David Vest from Opera as part of CR 308992. Many of the -expected updates are caused by SVG size changes in turn affecting where line breaks are inserted. * TestExpectations: * accessibility/svg-image-expected.txt: * css3/flexbox/flexitem.html: * fast/css/infinite-floating-value-expected.txt: * fast/css/remove-fixed-resizer-crash-expected.txt: * fast/css3-text/css3-word-spacing-percentage/word-spacing-crash-expected.txt: * fast/repaint/moving-shadow-on-container.html: * fast/repaint/moving-shadow-on-path.html: * fast/repaint/svg-layout-root-style-attr-update.html: * fast/shapes/shape-outside-floats/shape-outside-relative-size-svg-expected.html: * fast/shapes/shape-outside-floats/shape-outside-relative-size-svg.html: * http/tests/xmlviewer/dumpAsText/svg-expected.txt: * platform/mac/svg/batik/filters/feTile-expected.txt: * platform/mac/svg/batik/masking/maskRegions-expected.txt: * platform/mac/svg/batik/paints/patternRegions-positioned-objects-expected.txt: * platform/mac/svg/batik/text/longTextOnPath-expected.txt: * platform/mac/svg/batik/text/textDecoration-expected.txt: * platform/mac/svg/batik/text/textEffect-expected.txt: * platform/mac/svg/batik/text/textLength-expected.txt: * platform/mac/svg/batik/text/textOnPath-expected.txt: * platform/mac/svg/batik/text/textPosition-expected.txt: * platform/mac/svg/batik/text/verticalText-expected.txt: * platform/mac/svg/batik/text/verticalTextOnPath-expected.txt: * platform/mac/svg/custom/bug45331-expected.txt: * platform/mac/svg/custom/junk-data-expected.txt: * platform/mac/svg/custom/missing-xlink-expected.txt: * platform/mac/svg/custom/object-sizing-height-50p-on-target-svg-absolute-expected.png: Removed. * platform/mac/svg/custom/object-sizing-height-50p-on-target-svg-expected.png: Removed. * platform/mac/svg/custom/object-sizing-width-50p-height-50p-on-target-svg-absolute-expected.png: Removed. * platform/mac/svg/custom/object-sizing-width-50p-height-50p-on-target-svg-expected.png: Removed. * platform/mac/svg/custom/object-sizing-width-50p-height-75p-on-target-svg-absolute-expected.png: Removed. * platform/mac/svg/custom/object-sizing-width-50p-height-75p-on-target-svg-absolute-expected.txt: Removed. * platform/mac/svg/custom/object-sizing-width-50p-height-75p-on-target-svg-expected.png: Removed. * platform/mac/svg/custom/object-sizing-width-50p-height-75p-on-target-svg-expected.txt: Removed. * platform/mac/svg/custom/object-sizing-width-50p-on-target-svg-absolute-expected.png: Removed. * platform/mac/svg/custom/object-sizing-width-50p-on-target-svg-expected.png: Removed. * platform/mac/svg/custom/object-sizing-width-75p-height-50p-on-target-svg-absolute-expected.png: Removed. * platform/mac/svg/custom/object-sizing-width-75p-height-50p-on-target-svg-expected.png: Removed. * platform/mac/svg/custom/object-sizing-width-75p-height-50p-on-target-svg-expected.txt: Removed. * platform/mac/svg/custom/path-bad-data-expected.txt: * platform/mac/svg/custom/svg-fonts-in-html-expected.txt: * platform/mac/svg/custom/use-font-face-crash-expected.txt: * platform/mac/svg/foreignObject/svg-document-in-html-document-expected.txt: * platform/mac/svg/hixie/error/012-expected.txt: * platform/mac/svg/hixie/intrinsic/001-expected.png: Removed. * platform/mac/svg/hixie/intrinsic/001-expected.txt: Removed. * platform/mac/svg/hixie/intrinsic/002-expected.png: Removed. * platform/mac/svg/hixie/intrinsic/002-expected.txt: Removed. * platform/mac/svg/in-html/circle-expected.txt: * platform/mac/svg/text/non-bmp-positioning-lists-expected.txt: * platform/mac/svg/transforms/animated-path-inside-transformed-html-expected.txt: * platform/mac/svg/transforms/text-with-pattern-inside-transformed-html-expected.txt: * platform/mac/svg/wicd/rightsizing-grid-expected.txt: * platform/mac/svg/wicd/test-rightsizing-b-expected.txt: * platform/mac/svg/zoom/page/zoom-background-image-tiled-expected.txt: * platform/mac/svg/zoom/page/zoom-background-images-expected.txt: * platform/mac/svg/zoom/page/zoom-foreignObject-expected.txt: * platform/mac/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.txt: * platform/mac/svg/zoom/page/zoom-svg-as-relative-image-expected.txt: * platform/mac/svg/zoom/page/zoom-svg-float-border-padding-expected.txt: * platform/mac/svg/zoom/page/zoom-svg-through-object-with-absolute-size-2-expected.txt: * platform/mac/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.txt: * platform/mac/svg/zoom/page/zoom-svg-through-object-with-auto-size-expected.txt: * platform/mac/svg/zoom/page/zoom-svg-through-object-with-override-size-expected.txt: * platform/mac/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.txt: * platform/mac/svg/zoom/page/zoom-zoom-coords-expected.txt: * platform/mac/svg/zoom/text/zoom-foreignObject-expected.txt: * svg/animations/animate-css-xml-attributeType-expected.txt: * svg/as-image/image-respects-deviceScaleFactor.html: * svg/as-image/image-respects-pageScaleFactor.html: * svg/as-image/svg-as-image-with-relative-size-expected.html: * svg/as-image/svg-as-relative-image.html: * svg/as-object/sizing/svg-in-object-placeholder-height-auto-expected.txt: Added. * svg/as-object/sizing/svg-in-object-placeholder-height-auto.html: Added. * svg/as-object/sizing/svg-in-object-placeholder-height-fixed-expected.txt: Added. * svg/as-object/sizing/svg-in-object-placeholder-height-fixed.html: Added. * svg/as-object/sizing/svg-in-object-placeholder-height-percentage-expected.txt: Added. * svg/as-object/sizing/svg-in-object-placeholder-height-percentage.html: Added. * svg/as-object/sizing/svg-in-object.js: Added. (.): (.addAttr): (.generateSVGURI): (buildDemo): (.doCombinationTestRecursive): (doCombinationTest): (debugHint): (.debugHint): (testSVGInObjectWithPlaceholderHeightAttr.): (testSVGInObjectWithPlaceholderHeightAttr): * svg/css/composite-shadow-example.html: * svg/css/composite-shadow-with-opacity.html: * svg/css/max-width-2.html: * svg/css/stars-with-shadow.html: * svg/custom/absolute-sized-content-with-resources.xhtml: * svg/custom/altglyph.svg: * svg/custom/document-all-includes-svg-expected.txt: * svg/custom/external-paintserver-reference-expected.txt: * svg/custom/external-paintserver-reference.svg: * svg/custom/get-text-element-transform-crash-expected.txt: * svg/custom/linking-base-external-reference-expected.txt: * svg/custom/linking-base-external-reference.xhtml: * svg/custom/object-sizing-height-50p-on-target-svg-absolute-expected.txt: Removed. * svg/custom/object-sizing-height-50p-on-target-svg-absolute.xhtml: Removed. * svg/custom/object-sizing-height-50p-on-target-svg-expected.txt: Removed. * svg/custom/object-sizing-height-50p-on-target-svg.xhtml: Removed. * svg/custom/object-sizing-width-50p-height-50p-on-target-svg-absolute-expected.txt: Removed. * svg/custom/object-sizing-width-50p-height-50p-on-target-svg-absolute.xhtml: Removed. * svg/custom/object-sizing-width-50p-height-50p-on-target-svg-expected.txt: Removed. * svg/custom/object-sizing-width-50p-height-50p-on-target-svg.xhtml: Removed. * svg/custom/object-sizing-width-50p-height-75p-on-target-svg-absolute-expected.txt: Removed. * svg/custom/object-sizing-width-50p-height-75p-on-target-svg-absolute.xhtml: Removed. * svg/custom/object-sizing-width-50p-height-75p-on-target-svg-expected.txt: Removed. * svg/custom/object-sizing-width-50p-height-75p-on-target-svg.xhtml: Removed. * svg/custom/object-sizing-width-50p-on-target-svg-absolute-expected.txt: Removed. * svg/custom/object-sizing-width-50p-on-target-svg-absolute.xhtml: Removed. * svg/custom/object-sizing-width-50p-on-target-svg-expected.txt: Removed. * svg/custom/object-sizing-width-50p-on-target-svg.xhtml: Removed. * svg/custom/object-sizing-width-75p-height-50p-on-target-svg-absolute-expected.txt: Removed. * svg/custom/object-sizing-width-75p-height-50p-on-target-svg-absolute.xhtml: Removed. * svg/custom/object-sizing-width-75p-height-50p-on-target-svg-expected.txt: Removed. * svg/custom/object-sizing-width-75p-height-50p-on-target-svg.xhtml: Removed. * svg/custom/pending-resource-after-removal.xhtml: * svg/custom/percentage-of-html-parent.xhtml: * svg/custom/relative-sized-content-with-resources.xhtml: * svg/custom/relative-sized-content.xhtml: * svg/custom/relative-sized-deep-shadow-tree-content.xhtml: * svg/custom/relative-sized-image.xhtml: * svg/custom/relative-sized-inner-svg.xhtml: * svg/custom/relative-sized-shadow-tree-content-with-symbol.xhtml: * svg/custom/relative-sized-shadow-tree-content.xhtml: * svg/custom/relative-sized-use-on-symbol.xhtml: * svg/custom/relative-sized-use-without-attributes-on-symbol.xhtml: * svg/custom/tref-with-progress-tag-setpseudo-assert-expected.txt: * svg/custom/unicode-in-tspan-multi-svg-crash-expected.txt: * svg/custom/use-invalid-html-expected.txt: * svg/custom/window-named-item-lookup-expected.txt: * svg/dom/SVGViewSpec-invalid-ref-crash-expected.txt: * svg/dom/parent-view-layout-crash-expected.txt: * svg/dom/stylesheet-candidate-node-crash-main-expected.txt: * svg/dom/svg-root-lengths.html: * svg/foreignObject/absolute-position-foreign-object-child-crash-expected.txt: * svg/hixie/intrinsic/001-expected.png: Removed. * svg/hixie/intrinsic/001-expected.txt: Removed. * svg/hixie/intrinsic/001.html: Removed. * svg/hixie/intrinsic/002-expected.png: Removed. * svg/hixie/intrinsic/002-expected.txt: Removed. * svg/hixie/intrinsic/002.html: Removed. * svg/hixie/intrinsic/resources/001.svg: Removed. * svg/hixie/intrinsic/resources/002.svg: Removed. * svg/in-html/sizing/svg-inline-expected.txt: Added. * svg/in-html/sizing/svg-inline.html: Added. * svg/in-html/sizing/svg-inline.js: Added. (.): (setupSVGElement): (buildDemo): (.doCombinationTestRecursive): (doCombinationTest): (debugHint): (.debugHint): * svg/path-arc-invalid-expected.txt: * svg/repaint/repaint-webkit-svg-shadow-container-expected.txt: * svg/text/append-text-node-to-tspan.html: * svg/text/kerning.svg: * svg/text/modify-text-node-in-tspan.html: * svg/text/multichar-glyph.svg: * svg/text/remove-text-node-from-tspan.html: * svg/text/remove-tspan-from-text.html: * svg/text/svg-rtl-text-crash-expected.txt: * svg/text/text-block-child-crash-expected.txt: * svg/transforms/animated-path-inside-transformed-html.xhtml: * svg/transforms/svg-css-transforms-clip-path.xhtml: * svg/transforms/transform-origin-css-property.xhtml: * svg/zoom/page/zoom-foreignObject.svg: * svg/zoom/page/zoom-svg-as-relative-image.html: * svg/zoom/text/zoom-foreignObject.svg: Canonical link: https://commits.webkit.org/150625@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@168350 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-05-06 06:06:28 +00:00
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {html} at (0,0) size 800x600
2011-07-29 Rob Buis <rbuis@rim.com> URL references are completely broken in SVG https://bugs.webkit.org/show_bug.cgi?id=63283 Reviewed by Nikolas Zimmermann. Change SVGURIElement::getTarget to be more strict about iri resolving and make it serve as a central place to resolve a iri to a SVGElement. The iri can be same-document or external, for now we only handle the former, the latter will be handled in bug 65344. Accept as same-document if the iri combined with the base uri equals the document url (ignoring the fragment identifier). For convenience a method is added to lookup the element, if found. Tests: svg/custom/external-paintserver-reference.svg svg/custom/linking-base-external-reference.xhtml svg/custom/uri-reference-handling.svg * css/CSSCursorImageValue.cpp: (WebCore::resourceReferencedByCursorElement): (WebCore::CSSCursorImageValue::~CSSCursorImageValue): (WebCore::CSSCursorImageValue::updateIfSVGCursorIsUsed): * css/CSSFontFaceSource.cpp: (WebCore::CSSFontFaceSource::getFontData): * css/CSSFontSelector.h: (WebCore::CSSFontSelector::document): * css/SVGCSSStyleSelector.cpp: (WebCore::CSSStyleSelector::applySVGProperty): * rendering/svg/RenderSVGTextPath.cpp: (WebCore::RenderSVGTextPath::layoutPath): * rendering/svg/SVGResources.cpp: (WebCore::targetReferenceFromResource): (WebCore::paintingResourceFromSVGPaint): * svg/SVGAltGlyphElement.cpp: (WebCore::SVGAltGlyphElement::hasValidGlyphElements): * svg/SVGFEImageElement.cpp: (WebCore::SVGFEImageElement::requestImageResource): (WebCore::SVGFEImageElement::build): * svg/SVGGlyphRefElement.cpp: (WebCore::SVGGlyphRefElement::hasValidGlyphElement): * svg/SVGLinearGradientElement.cpp: (WebCore::SVGLinearGradientElement::collectGradientAttributes): * svg/SVGMPathElement.cpp: (WebCore::SVGMPathElement::pathElement): * svg/SVGPaint.cpp: (WebCore::SVGPaint::matchesTargetURI): * svg/SVGPatternElement.cpp: (WebCore::SVGPatternElement::collectPatternAttributes): * svg/SVGRadialGradientElement.cpp: (WebCore::SVGRadialGradientElement::collectGradientAttributes): * svg/SVGTRefElement.cpp: (WebCore::SVGTRefElement::updateReferencedText): (WebCore::SVGTRefElement::svgAttributeChanged): (WebCore::SVGTRefElement::buildPendingResource): * svg/SVGTextPathElement.cpp: (WebCore::SVGTextPathElement::insertedIntoDocument): * svg/SVGURIReference.cpp: (WebCore::SVGURIReference::fragmentIdentifierFromIRIString): (WebCore::SVGURIReference::targetElementFromIRIString): * svg/SVGURIReference.h: * svg/SVGUseElement.cpp: (WebCore::SVGUseElement::buildPendingResource): (WebCore::SVGUseElement::hasCycleUseReferencing): (WebCore::SVGUseElement::expandUseElementsInShadowTree): * svg/animation/SVGSMILElement.cpp: (WebCore::SVGSMILElement::targetElement): Canonical link: https://commits.webkit.org/81190@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@92047 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-07-30 03:22:56 +00:00
RenderSVGRoot {svg} at (0,0) size 100x100
RenderSVGHiddenContainer {defs} at (0,0) size 0x0
RenderSVGResourceLinearGradient {linearGradient} [id="orange_red"] [gradientUnits=objectBoundingBox] [start=(0,0)] [end=(1,0)]
RenderSVGGradientStop {stop} [offset=0.00] [color=#FF0000]
RenderSVGGradientStop {stop} [offset=1.00] [color=#FF0000]
RenderSVGRect {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00]