Changeset 12103 in webkit
- Timestamp:
- Jan 14, 2006 9:43:30 PM (18 years ago)
- Location:
- trunk
- Files:
-
- 23 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r12093 r12103 1 2006-01-14 Eric Seidel <eseidel@apple.com> 2 3 Reviewed by darin. 4 5 Implement basic <foreignObject> support: 6 http://bugzilla.opendarwin.org/show_bug.cgi?id=5974 7 Also fixed <image> to support clip, filter and mask 8 Updated <text> to support hit testing and clip, filter, mask 9 10 * svg/W3C-SVG-1.1/filters-light-01-f-expected.checksum: 11 * svg/W3C-SVG-1.1/filters-light-01-f-expected.png: 12 * svg/custom/foreign-object-skew-expected.checksum: Added. 13 * svg/custom/foreign-object-skew-expected.png: Added. 14 * svg/custom/foreign-object-skew-expected.txt: Added. 15 * svg/custom/foreign-object-skew.svg: Added. 16 * svg/custom/image-with-transform-clip-filter-expected.checksum: Added. 17 * svg/custom/image-with-transform-clip-filter-expected.png: Added. 18 * svg/custom/image-with-transform-clip-filter-expected.txt: Added. 19 * svg/custom/image-with-transform-clip-filter.svg: Added. 20 * svg/custom/resources: Added. 21 * svg/custom/resources/green-checker.png: Added. 22 * svg/custom/resources/red-checker.png: Added. 23 * svg/custom/text-clip-expected.checksum: Added. 24 * svg/custom/text-clip-expected.png: Added. 25 * svg/custom/text-clip-expected.txt: Added. 26 * svg/custom/text-clip.svg: Added. 27 * svg/custom/text-filter-expected.checksum: Added. 28 * svg/custom/text-filter-expected.png: Added. 29 * svg/custom/text-filter-expected.txt: Added. 30 * svg/custom/text-filter.svg: Added. 31 1 32 2006-01-14 Eric Seidel <eseidel@apple.com> 2 33 -
trunk/LayoutTests/svg/W3C-SVG-1.1/filters-light-01-f-expected.checksum
r12016 r12103 1 7 141014b9390f0541b05a4d0a61b49011 767cc8c8d32425f9016feba9a49bc0c1 -
trunk/WebCore/ChangeLog
r12102 r12103 121 121 * platform/ArrayImpl.h: 122 122 * platform/Shared.h: Added. 123 124 2006-01-14 Eric Seidel <eseidel@apple.com> 125 126 Reviewed by darin. 127 128 Implement basic <foreignObject> support: 129 http://bugzilla.opendarwin.org/show_bug.cgi?id=5974 130 Also fixed <image> to support clip, filter and mask 131 Updated <text> to support hit testing and clip, filter, mask 132 133 * WebCore.xcodeproj/project.pbxproj: added files. 134 * kcanvas/RenderForeignObject.cpp: Added. 135 (RenderForeignObject::RenderForeignObject): 136 (RenderForeignObject::translationForAttributes): 137 (RenderForeignObject::paint): 138 (RenderForeignObject::nodeAtPoint): 139 * kcanvas/RenderForeignObject.h: Added. 140 (RenderForeignObject::renderName): added. 141 (RenderForeignObject::localTransform): added. 142 (RenderForeignObject::setLocalTransform): added. 143 * kcanvas/RenderSVGImage.cpp: 144 (RenderSVGImage::paint): added filter, clip mask support 145 * kcanvas/RenderSVGImage.h: 146 (KSVG::RenderSVGImage::localTransform): added. 147 (KSVG::RenderSVGImage::setLocalTransform): added. 148 * kcanvas/RenderSVGText.cpp: 149 (RenderSVGText::translationTopToBaseline): return qmatrix 150 (RenderSVGText::translationForAttributes): return qmatrix 151 (RenderSVGText::paint): added filter, clip, mask support 152 (RenderSVGText::nodeAtPoint): added. 153 * kcanvas/RenderSVGText.h: 154 (RenderSVGText::localTransform): added. 155 (RenderSVGText::setLocalTransform): added. 156 * khtml/rendering/render_object.h: 157 (khtml::RenderObject::setLocalTransform): added assert(0) 158 * ksvg2/css/svg.css: added foreignObject display: block 159 * ksvg2/svg/SVGForeignObjectElementImpl.cpp: Added. 160 (KSVG::SVGForeignObjectElementImpl::SVGForeignObjectElementImpl): 161 (KSVG::SVGForeignObjectElementImpl::~SVGForeignObjectElementImpl): 162 (KSVG::SVGForeignObjectElementImpl::x): 163 (KSVG::SVGForeignObjectElementImpl::y): 164 (KSVG::SVGForeignObjectElementImpl::width): 165 (KSVG::SVGForeignObjectElementImpl::height): 166 (KSVG::SVGForeignObjectElementImpl::parseMappedAttribute): 167 (KSVG::SVGForeignObjectElementImpl::createRenderer): 168 (KSVG::SVGForeignObjectElementImpl::childShouldCreateRenderer): 169 * ksvg2/svg/SVGForeignObjectElementImpl.h: Added. 170 (KSVG::SVGForeignObjectElementImpl::isValid): added 171 (KSVG::SVGForeignObjectElementImpl::rendererIsNeeded): added 172 * ksvg2/svg/SVGImageElementImpl.cpp: 173 (SVGImageElementImpl::attach): fixed static_cast 174 * ksvg2/svg/SVGLocatableImpl.cpp: 175 (SVGLocatableImpl::nearestViewportElement): foreignObject support 176 (SVGLocatableImpl::farthestViewportElement): foreignObject support 177 * ksvg2/svg/svgtags.in: added foreignObject 178 * kwq/KWQWMatrix.cpp: 179 (QWMatrix::isInvertible): fixed 123 180 124 181 2006-01-14 Eric Seidel <eseidel@apple.com> -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r12101 r12103 1538 1538 A8FD8B86087CB44C00DC3707 /* KWQWMatrix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A85D7A8C0879EC64006A9172 /* KWQWMatrix.cpp */; }; 1539 1539 A8FD8B87087CB45700DC3707 /* KWQWMatrix.h in Headers */ = {isa = PBXBuildFile; fileRef = A85D7A8D0879EC64006A9172 /* KWQWMatrix.h */; }; 1540 A8FEFB0A0979F472005839FD /* RenderForeignObject.h in Headers */ = {isa = PBXBuildFile; fileRef = A8FEFB080979F472005839FD /* RenderForeignObject.h */; }; 1541 A8FEFB0B0979F472005839FD /* RenderForeignObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8FEFB090979F472005839FD /* RenderForeignObject.cpp */; }; 1542 A8FEFB0C0979F472005839FD /* RenderForeignObject.h in Headers */ = {isa = PBXBuildFile; fileRef = A8FEFB080979F472005839FD /* RenderForeignObject.h */; }; 1543 A8FEFB0D0979F472005839FD /* RenderForeignObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8FEFB090979F472005839FD /* RenderForeignObject.cpp */; }; 1544 A8FEFB310979F4F6005839FD /* SVGForeignObjectElementImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8FEFB2F0979F4F6005839FD /* SVGForeignObjectElementImpl.cpp */; }; 1545 A8FEFB320979F4F6005839FD /* SVGForeignObjectElementImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = A8FEFB300979F4F6005839FD /* SVGForeignObjectElementImpl.h */; }; 1546 A8FEFB330979F4F6005839FD /* SVGForeignObjectElementImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8FEFB2F0979F4F6005839FD /* SVGForeignObjectElementImpl.cpp */; }; 1547 A8FEFB340979F4F6005839FD /* SVGForeignObjectElementImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = A8FEFB300979F4F6005839FD /* SVGForeignObjectElementImpl.h */; }; 1540 1548 BC179892088D975F006068A5 /* render_theme_mac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC17988F088D975F006068A5 /* render_theme_mac.mm */; }; 1541 1549 BC179893088D975F006068A5 /* render_theme.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC179890088D975F006068A5 /* render_theme.cpp */; }; … … 2433 2441 A8C32D89093D8BFA000B9CAC /* xlinkattrs.in */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = text; path = xlinkattrs.in; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 2434 2442 A8C32D96093D8EA4000B9CAC /* XLinkNamesWrapper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XLinkNamesWrapper.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 2443 A8FEFB080979F472005839FD /* RenderForeignObject.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderForeignObject.h; sourceTree = "<group>"; }; 2444 A8FEFB090979F472005839FD /* RenderForeignObject.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RenderForeignObject.cpp; sourceTree = "<group>"; }; 2445 A8FEFB2F0979F4F6005839FD /* SVGForeignObjectElementImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGForeignObjectElementImpl.cpp; sourceTree = "<group>"; }; 2446 A8FEFB300979F4F6005839FD /* SVGForeignObjectElementImpl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGForeignObjectElementImpl.h; sourceTree = "<group>"; }; 2435 2447 BC06F24906D18A7E004A6FA3 /* xsl_stylesheetimpl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; name = xsl_stylesheetimpl.cpp; path = xsl/xsl_stylesheetimpl.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 2436 2448 BC06F24A06D18A7E004A6FA3 /* xsl_stylesheetimpl.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; name = xsl_stylesheetimpl.h; path = xsl/xsl_stylesheetimpl.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; … … 3388 3400 A8C0F86B089701F300BA5114 /* SVGFitToViewBoxImpl.cpp */, 3389 3401 A8C0F86C089701F300BA5114 /* SVGFitToViewBoxImpl.h */, 3402 A8FEFB2F0979F4F6005839FD /* SVGForeignObjectElementImpl.cpp */, 3403 A8FEFB300979F4F6005839FD /* SVGForeignObjectElementImpl.h */, 3390 3404 A8C0F86D089701F300BA5114 /* SVGGElementImpl.cpp */, 3391 3405 A8C0F86E089701F300BA5114 /* SVGGElementImpl.h */, … … 3529 3543 65743B50097076F8001E7CEF /* RenderSVGText.cpp */, 3530 3544 65743B51097076F8001E7CEF /* RenderSVGText.h */, 3545 FAE0418A09759694000540BE /* RenderSVGImage.cpp */, 3531 3546 FAE0418909759694000540BE /* RenderSVGImage.h */, 3532 FAE0418A09759694000540BE /* RenderSVGImage.cpp */, 3547 A8FEFB090979F472005839FD /* RenderForeignObject.cpp */, 3548 A8FEFB080979F472005839FD /* RenderForeignObject.h */, 3533 3549 A8C0FB53089701F700BA5114 /* device */, 3534 3550 A8C0FB7A089701F800BA5114 /* KCanvasContainer.cpp */, … … 4966 4982 BCB16C2F0979C3BD00467741 /* Request.h in Headers */, 4967 4983 BCFB2E5E0979E46400BA703D /* CachedObjectClient.h in Headers */, 4984 A8FEFB0A0979F472005839FD /* RenderForeignObject.h in Headers */, 4985 A8FEFB320979F4F6005839FD /* SVGForeignObjectElementImpl.h in Headers */, 4968 4986 BCFB2E840979FD4F00BA703D /* Shared.h in Headers */, 4969 4987 ); … … 5305 5323 BCB16C480979C3BD00467741 /* Request.h in Headers */, 5306 5324 BCFB2E5F0979E46400BA703D /* CachedObjectClient.h in Headers */, 5325 A8FEFB0C0979F472005839FD /* RenderForeignObject.h in Headers */, 5326 A8FEFB340979F4F6005839FD /* SVGForeignObjectElementImpl.h in Headers */, 5307 5327 BCFB2E850979FD4F00BA703D /* Shared.h in Headers */, 5308 5328 ); … … 6848 6868 BCB16C2C0979C3BD00467741 /* loader.cpp in Sources */, 6849 6869 BCB16C2E0979C3BD00467741 /* Request.cpp in Sources */, 6870 A8FEFB0B0979F472005839FD /* RenderForeignObject.cpp in Sources */, 6871 A8FEFB310979F4F6005839FD /* SVGForeignObjectElementImpl.cpp in Sources */, 6850 6872 ); 6851 6873 runOnlyForDeploymentPostprocessing = 0; … … 7141 7163 BCB16C450979C3BD00467741 /* loader.cpp in Sources */, 7142 7164 BCB16C470979C3BD00467741 /* Request.cpp in Sources */, 7165 A8FEFB0D0979F472005839FD /* RenderForeignObject.cpp in Sources */, 7166 A8FEFB330979F4F6005839FD /* SVGForeignObjectElementImpl.cpp in Sources */, 7143 7167 ); 7144 7168 runOnlyForDeploymentPostprocessing = 0; -
trunk/WebCore/kcanvas/RenderSVGImage.cpp
r12085 r12103 60 60 KRenderingDeviceContext *context = QPainter::renderingDevice()->currentContext(); 61 61 context->concatCTM(QMatrix().translate(parentX, parentY)); 62 context->concatCTM(localTransform()); 62 63 translateForAttributes(); 63 64 64 65 FloatRect boundingBox(0, 0, width(), height()); 66 const KSVG::SVGRenderStyle *svgStyle = style()->svgStyle(); 65 67 66 if (KCanvasClipper *clipper = getClipperById(document(), s tyle()->svgStyle()->clipPath().mid(1)))68 if (KCanvasClipper *clipper = getClipperById(document(), svgStyle->clipPath().mid(1))) 67 69 clipper->applyClip(boundingBox); 68 70 69 if (KCanvasMasker *masker = getMaskerById(document(), s tyle()->svgStyle()->maskElement().mid(1)))71 if (KCanvasMasker *masker = getMaskerById(document(), svgStyle->maskElement().mid(1))) 70 72 masker->applyMask(boundingBox); 71 73 72 KCanvasFilter *filter = getFilterById(document(), s tyle()->svgStyle()->filter().mid(1));74 KCanvasFilter *filter = getFilterById(document(), svgStyle->filter().mid(1)); 73 75 if (filter) 74 76 filter->prepareFilter(boundingBox); -
trunk/WebCore/kcanvas/RenderSVGImage.h
r12017 r12103 33 33 virtual ~RenderSVGImage(); 34 34 35 virtual QMatrix localTransform() const { return m_transform; } 36 virtual void setLocalTransform(const QMatrix& transform) { m_transform = transform; } 37 35 38 virtual void paint(PaintInfo& paintInfo, int parentX, int parentY); 36 39 private: 37 40 void translateForAttributes(); 41 QMatrix m_transform; 38 42 }; 39 43 }; -
trunk/WebCore/kcanvas/RenderSVGText.cpp
r12025 r12103 34 34 } 35 35 36 void RenderSVGText::translateTopToBaseline()36 QMatrix RenderSVGText::translationTopToBaseline() 37 37 { 38 KRenderingDeviceContext *context = QPainter::renderingDevice()->currentContext();39 40 38 int offset = baselinePosition(true, true); 41 context->concatCTM(QMatrix().translate(0, -offset));39 return QMatrix().translate(0, -offset); 42 40 } 43 41 44 void RenderSVGText::translateForAttributes()42 QMatrix RenderSVGText::translationForAttributes() 45 43 { 46 KRenderingDeviceContext *context = QPainter::renderingDevice()->currentContext();47 48 44 KSVG::SVGTextElementImpl *text = static_cast<KSVG::SVGTextElementImpl *>(element()); 49 45 … … 51 47 float yOffset = text->y()->baseVal()->getFirst() ? text->y()->baseVal()->getFirst()->value() : 0; 52 48 53 context->concatCTM(QMatrix().translate(xOffset, yOffset));49 return QMatrix().translate(xOffset, yOffset); 54 50 } 55 51 … … 62 58 63 59 KRenderingDeviceContext *context = QPainter::renderingDevice()->currentContext(); 60 context->concatCTM(localTransform()); 64 61 context->concatCTM(QMatrix().translate(parentX, parentY)); 65 translateForAttributes();66 translateTopToBaseline();62 context->concatCTM(translationForAttributes()); 63 context->concatCTM(translationTopToBaseline()); 67 64 65 FloatRect boundingBox(0, 0, width(), height()); 66 const KSVG::SVGRenderStyle *svgStyle = style()->svgStyle(); 67 68 if (KCanvasClipper *clipper = getClipperById(document(), svgStyle->clipPath().mid(1))) 69 clipper->applyClip(boundingBox); 70 71 if (KCanvasMasker *masker = getMaskerById(document(), svgStyle->maskElement().mid(1))) 72 masker->applyMask(boundingBox); 73 74 KCanvasFilter *filter = getFilterById(document(), svgStyle->filter().mid(1)); 75 if (filter) 76 filter->prepareFilter(boundingBox); 77 68 78 RenderBlock::paint(paintInfo, 0, 0); 79 80 if (filter) 81 filter->applyFilter(boundingBox); 69 82 70 83 paintInfo.p->restore(); 71 84 } 85 86 bool RenderSVGText::nodeAtPoint(NodeInfo& info, int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction) 87 { 88 QMatrix totalTransform = absoluteTransform(); 89 totalTransform *= localTransform(); 90 totalTransform *= translationForAttributes(); 91 totalTransform *= translationTopToBaseline(); 92 double localX, localY; 93 totalTransform.invert().map(_x, _y, &localX, &localY); 94 return RenderBlock::nodeAtPoint(info, (int)localX, (int)localY, _tx, _ty, hitTestAction); 95 } -
trunk/WebCore/kcanvas/RenderSVGText.h
r12022 r12103 36 36 37 37 const char *renderName() const { return "RenderSVGText"; } 38 void paint(PaintInfo& paintInfo, int parentX, int parentY); 38 void paint(PaintInfo&, int parentX, int parentY); 39 40 virtual QMatrix localTransform() const { return m_transform; } 41 virtual void setLocalTransform(const QMatrix& transform) { m_transform = transform; } 42 43 bool nodeAtPoint(NodeInfo&, int _x, int _y, int _tx, int _ty, HitTestAction); 39 44 40 45 private: 41 void translateTopToBaseline(); 42 void translateForAttributes(); 46 QMatrix translationTopToBaseline(); 47 QMatrix translationForAttributes(); 48 QMatrix m_transform; 43 49 }; 44 50 -
trunk/WebCore/khtml/rendering/render_object.h
r12092 r12103 285 285 // We may eventually want to make these non-virtual 286 286 virtual QMatrix localTransform() const { return QMatrix(1, 0, 0, 1, xPos(), yPos()); } 287 virtual void setLocalTransform(const QMatrix&) { }287 virtual void setLocalTransform(const QMatrix&) { assert(false); } 288 288 virtual QMatrix absoluteTransform() const; 289 289 #endif -
trunk/WebCore/ksvg2/css/svg.css
r11962 r12103 41 41 } 42 42 43 text 43 text, foreignObject 44 44 { 45 display: block ;45 display: block !important; 46 46 } -
trunk/WebCore/ksvg2/svg/SVGImageElementImpl.cpp
r12062 r12103 127 127 { 128 128 SVGStyledTransformableElementImpl::attach(); 129 if ( khtml::RenderImage* imageObj = static_cast<khtml::RenderImage*>(renderer()))129 if (KSVG::RenderSVGImage* imageObj = static_cast<KSVG::RenderSVGImage*>(renderer())) 130 130 imageObj->setImage(m_imageLoader.image()); 131 131 } -
trunk/WebCore/ksvg2/svg/SVGLocatableImpl.cpp
r12085 r12103 46 46 while (n && !n->isDocumentNode()) { 47 47 if (n->hasTagName(SVGNames::svgTag) || n->hasTagName(SVGNames::symbolTag) || 48 n->hasTagName(SVGNames::imageTag) ) // FIXME: || n->hasTagName(SVGNames::foreignObjectTag)48 n->hasTagName(SVGNames::imageTag) || n->hasTagName(SVGNames::foreignObjectTag)) 49 49 return static_cast<SVGElementImpl *>(n); 50 50 … … 65 65 while (n && !n->isDocumentNode()) { 66 66 if (n->hasTagName(SVGNames::svgTag) || n->hasTagName(SVGNames::symbolTag) || 67 n->hasTagName(SVGNames::imageTag) ) // FIXME: || n->hasTagName(SVGNames::foreignObjectTag)67 n->hasTagName(SVGNames::imageTag) || n->hasTagName(SVGNames::foreignObjectTag)) 68 68 farthest = static_cast<SVGElementImpl *>(n); 69 69 -
trunk/WebCore/ksvg2/svg/svgtags.in
r11962 r12103 46 46 #font_face_src 47 47 #font_face_uri 48 #foreignObject48 foreignObject 49 49 g 50 50 #glyph -
trunk/WebCore/kwq/KWQWMatrix.cpp
r12085 r12103 109 109 bool QWMatrix::isInvertible() const 110 110 { 111 return det() == 0.0;111 return det() != 0.0; 112 112 } 113 113
Note: See TracChangeset
for help on using the changeset viewer.