Changeset 20122 in webkit
- Timestamp:
- Mar 12, 2007 1:17:49 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r20110 r20122 1 2007-03-09 Rob Buis <buis@kde.org> 2 3 Reviewed by Nikolas Zimmermann. 4 5 http://bugs.webkit.org/show_bug.cgi?id=12500 6 SVG fails to correctly handle all link style selectors 7 http://bugs.webkit.org/show_bug.cgi?id=12567 8 <text> elements ignore <a> children 9 10 Updated results because of allowing <a> inside <text>. 11 12 * svg/W3C-SVG-1.1/interact-cursor-01-f-expected.checksum: 13 * svg/W3C-SVG-1.1/interact-cursor-01-f-expected.png: 14 * svg/W3C-SVG-1.1/interact-cursor-01-f-expected.txt: 15 * svg/W3C-SVG-1.1/struct-frag-05-t-expected.checksum: 16 * svg/W3C-SVG-1.1/struct-frag-05-t-expected.png: 17 * svg/W3C-SVG-1.1/struct-frag-05-t-expected.txt: 18 * svg/W3C-SVG-1.1/styling-css-06-b-expected.checksum: 19 * svg/W3C-SVG-1.1/styling-css-06-b-expected.png: 20 * svg/W3C-SVG-1.1/styling-css-06-b-expected.txt: 21 1 22 2007-03-11 Oliver Hunt <oliver@apple.com> 2 23 -
trunk/LayoutTests/svg/W3C-SVG-1.1/interact-cursor-01-f-expected.checksum
r18436 r20122 1 977a31d10cfd3511994f4545baed5d98 1 a74f021740df82f71546d3e7b4f0ca37 -
trunk/LayoutTests/svg/W3C-SVG-1.1/interact-cursor-01-f-expected.txt
r19798 r20122 1 1 layer at (0,0) size 480x360 2 2 RenderView at (0,0) size 480x360 3 RenderSVGContainer {svg} at (0.50,0.50) size 479x3594 RenderSVGContainer {g} at ( 115.29,1) size 294.71x3343 RenderSVGContainer {svg} at (0.50,0.50) size 525.50x359 4 RenderSVGContainer {g} at (97,1) size 429x334 5 5 RenderSVGHiddenContainer {defs} at (0,0) size 0x0 6 6 RenderSVGText {text} at (240,25) size 480x31 7 RenderSVGInlineText {#text} at (-63,-24) size 126x31 8 text run at (-63,-24) width 126: "Text Cursor" 7 RenderSVGInlineText {#text} at (-143,-24) size 143x31 8 text run at (-143,-24) width 133: "Text Cursor " 9 RenderSVGInline {a} at (0,0) size 153x31 10 RenderSVGInlineText {#text} at (133,0) size 153x0 11 text run at (133,0) width 153: "Pointer Cursor" 9 12 RenderSVGInlineText {#text} at (0,0) size 0x0 10 13 RenderPath {rect} at (118.50,38.50) size 243x239 [stroke={[type=SOLID] [color=#666666] [stroke width=3.00]}] [data="M120.00,40.00L360.00,40.00L360.00,276.00L120.00,276.00"] -
trunk/LayoutTests/svg/W3C-SVG-1.1/struct-frag-05-t-expected.checksum
r18436 r20122 1 33ee91d98da4044601a1e1a0d08b251a 1 bce5347ed8dce07767d07bb25183e25f -
trunk/LayoutTests/svg/W3C-SVG-1.1/struct-frag-05-t-expected.txt
r18436 r20122 2 2 RenderView at (0,0) size 480x360 3 3 RenderSVGContainer {svg} at (0.50,0.50) size 479x359 4 RenderSVGContainer {g} at (0,0) size 0x0 5 RenderSVGText {text} at (240,100) size 480x0 4 RenderSVGContainer {g} at (240,64) size 89x46 5 RenderSVGText {text} at (240,100) size 480x46 6 RenderSVGInline {toto:a} at (0,0) size 89x46 7 RenderSVGInlineText {#text} at (0,0) size 89x0 8 text run at (0,0) width 89: "Valid" 9 RenderSVGInlineText {#text} at (0,0) size 0x0 6 10 RenderSVGText {text} at (240,250) size 480x0 7 11 RenderSVGText {text} at (10,340) size 480x46 -
trunk/LayoutTests/svg/W3C-SVG-1.1/styling-css-06-b-expected.checksum
r18436 r20122 1 d014231d5c813e6a1ca0ba1f3e8b55b8 1 b9bcfaa8847a02cffac85f7f4ab01b72 -
trunk/LayoutTests/svg/W3C-SVG-1.1/styling-css-06-b-expected.txt
r18436 r20122 2 2 RenderView at (0,0) size 480x360 3 3 RenderSVGContainer {svg} at (0.50,0.50) size 479x359 4 RenderSVGContainer {g} at (150,142) size 260x106 5 RenderSVGContainer {g} at (150,142) size 260x106 6 RenderSVGText {text} at (50,100) size 480x0 7 RenderSVGText {text} at (250,100) size 480x0 8 RenderSVGText {text} at (50,170) size 480x0 4 RenderSVGContainer {g} at (50,72) size 360x176 5 RenderSVGContainer {g} at (50,72) size 360x176 6 RenderSVGText {text} at (50,100) size 480x36 7 RenderSVGInline {a} at (0,0) size 86x36 8 RenderSVGInlineText {#text} at (0,0) size 86x0 9 text run at (0,0) width 86: "Visited" 10 RenderSVGText {text} at (250,100) size 480x36 11 RenderSVGInline {a} at (0,0) size 116x36 12 RenderSVGInlineText {#text} at (0,0) size 116x0 13 text run at (0,0) width 116: "Unvisited" 14 RenderSVGText {text} at (50,170) size 480x36 15 RenderSVGInline {a} at (0,0) size 119x36 16 RenderSVGInlineText {#text} at (0,0) size 119x0 17 text run at (0,0) width 119: "Hover me" 9 18 RenderSVGText {text} at (250,170) size 480x36 10 19 RenderSVGInlineText {#text} at (0,-28) size 160x36 -
trunk/WebCore/ChangeLog
r20120 r20122 1 2007-03-09 Rob Buis <buis@kde.org> 2 3 Reviewed by Nikolas Zimmermann. 4 5 http://bugs.webkit.org/show_bug.cgi?id=12500 6 SVG fails to correctly handle all link style selectors 7 http://bugs.webkit.org/show_bug.cgi?id=12567 8 <text> elements ignore <a> children 9 10 Allow <a> inside svg text and handle xlink:show. 11 12 * ksvg2/svg/SVGAElement.cpp: 13 (WebCore::SVGAElement::createRenderer): 14 (WebCore::SVGAElement::defaultEventHandler): 15 (WebCore::SVGAElement::childShouldCreateRenderer): 16 * ksvg2/svg/SVGAElement.h: 17 * ksvg2/svg/SVGElement.h: 18 (WebCore::SVGElement::isTextContent): 19 * ksvg2/svg/SVGTextContentElement.h: 20 (WebCore::SVGTextContentElement::isTextContent): 21 * ksvg2/svg/SVGTextElement.cpp: 22 (WebCore::SVGTextElement::childShouldCreateRenderer): 23 * rendering/SVGInlineFlowBox.cpp: 24 (WebCore::translateBox): 25 (WebCore::placePositionedBoxesHorizontally): 26 (WebCore::placeBoxesVerticallyWithAbsBaseline): 27 1 28 2007-03-12 Adele Peterson <adele@apple.com> 2 29 -
trunk/WebCore/ksvg2/svg/SVGAElement.cpp
r19855 r20122 1 1 /* 2 2 Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org> 3 2004, 2005 Rob Buis <buis@kde.org>3 2004, 2005, 2007 Rob Buis <buis@kde.org> 4 4 5 5 This file is part of the KDE project … … 33 33 #include "FrameLoader.h" 34 34 #include "MouseEvent.h" 35 #include "PlatformMouseEvent.h" 36 #include "RenderSVGInline.h" 35 37 #include "RenderSVGContainer.h" 36 38 #include "ResourceRequest.h" … … 85 87 RenderObject* SVGAElement::createRenderer(RenderArena* arena, RenderStyle* style) 86 88 { 89 if (static_cast<SVGElement*>(parent())->isTextContent()) 90 return new (arena) RenderSVGInline(this); 91 87 92 return new (arena) RenderSVGContainer(this); 88 93 } … … 94 99 MouseEvent* e = static_cast<MouseEvent*>(evt); 95 100 96 if (e && e->button() == 2) {101 if (e && e->button() == RightButton) { 97 102 SVGStyledTransformableElement::defaultEventHandler(evt); 98 103 return; 99 104 } 100 105 106 String target = getAttribute(SVGNames::targetAttr); 107 String xlinktarget = getAttribute(XLinkNames::showAttr); 108 if (e && e->button() == MiddleButton) 109 target = "_blank"; 110 else if (xlinktarget == "new" || target == "_blank") 111 target = "_blank"; 112 else // default is replace/_self 113 target = "_self"; 114 101 115 String url = parseURL(href()); 102 103 String target = getAttribute(SVGNames::targetAttr);104 if (e && e->button() == 1)105 target = "_blank";106 107 116 if (!evt->defaultPrevented()) 108 117 if (document() && document()->frame()) … … 115 124 } 116 125 126 bool SVGAElement::childShouldCreateRenderer(Node* child) const 127 { 128 if (static_cast<SVGElement*>(parent())->isTextContent()) 129 return child->isTextNode(); 130 131 return SVGElement::childShouldCreateRenderer(child); 132 } 133 134 117 135 } // namespace WebCore 118 136 -
trunk/WebCore/ksvg2/svg/SVGAElement.h
r19908 r20122 54 54 virtual void defaultEventHandler(Event *evt); 55 55 56 virtual bool childShouldCreateRenderer(Node*) const; 57 56 58 protected: 57 59 virtual const SVGElement* contextElement() const { return this; } -
trunk/WebCore/ksvg2/svg/SVGElement.h
r19855 r20122 204 204 virtual bool isFilterEffect() const { return false; } 205 205 virtual bool isGradientStop() const { return false; } 206 virtual bool isTextContent() const { return false; } 206 207 207 208 virtual bool isShadowNode() const { return m_shadowParent; } -
trunk/WebCore/ksvg2/svg/SVGTextContentElement.h
r19855 r20122 49 49 50 50 virtual bool isValid() const { return SVGTests::isValid(); } 51 virtual bool isTextContent() const { return true; } 51 52 52 53 // 'SVGTextContentElement' functions -
trunk/WebCore/ksvg2/svg/SVGTextElement.cpp
r19855 r20122 122 122 bool SVGTextElement::childShouldCreateRenderer(Node* child) const 123 123 { 124 if (child->isTextNode() || child->hasTagName(SVGNames::tspanTag) || 125 child->hasTagName(SVGNames::trefTag)) 124 if (child->isTextNode() || child->hasTagName(SVGNames::tspanTag) 125 || child->hasTagName(SVGNames::aTag) 126 || child->hasTagName(SVGNames::trefTag)) 126 127 return true; 127 128 return false; -
trunk/WebCore/rendering/SVGInlineFlowBox.cpp
r19855 r20122 32 32 #include "RootInlineBox.h" 33 33 #include "SVGLengthList.h" 34 #include "SVGNames.h" 34 35 #include "SVGPaintServer.h" 35 36 #include "SVGResourceClipper.h" … … 44 45 namespace WebCore { 45 46 47 using namespace SVGNames; 48 46 49 void SVGInlineFlowBox::paint(RenderObject::PaintInfo& paintInfo, int tx, int ty) 47 50 { … … 147 150 box->setXPos(box->xPos() + x); 148 151 box->setYPos(box->yPos() + y); 149 } else {152 } else if (!box->object()->element()->hasTagName(aTag)) { 150 153 InlineFlowBox* flow = static_cast<InlineFlowBox*>(box); 151 154 SVGTextPositioningElement* text = static_cast<SVGTextPositioningElement*>(box->object()->element()); … … 188 191 mx = max(mx, x); 189 192 amx = max(amx, x); 190 } else { 191 ASSERT(curr->object()->isInlineFlow()); 193 } else if (curr->object()->isInlineFlow()) { 192 194 InlineFlowBox* flow = static_cast<InlineFlowBox*>(curr); 193 SVGTextPositioningElement* text = static_cast<SVGTextPositioningElement*>(flow->object()->element()); 194 x += (int)(text->dx()->getFirst().value()); 195 if (text->x()->numberOfItems() > 0) 196 x = (int)(text->x()->getFirst().value() - xPos); 197 if (text->x()->numberOfItems() > 0 || text->y()->numberOfItems() > 0 || 198 text->dx()->numberOfItems() > 0 || text->dy()->numberOfItems() > 0) { 199 seenPositionedElement = true; 200 needsWordSpacing = false; 201 int ignoreX, ignoreY; 202 x = placePositionedBoxesHorizontally(flow, x, mn, mx, ignoreX, ignoreY, needsWordSpacing, xPos, true); 203 } else if (seenPositionedElement) { 204 int ignoreX, ignoreY; 205 x = placePositionedBoxesHorizontally(flow, x, mn, mx, ignoreX, ignoreY, needsWordSpacing, xPos, false); 206 } else 195 if (flow->object()->element()->hasTagName(aTag)) { 207 196 x = placePositionedBoxesHorizontally(flow, x, mn, mx, amn, amx, needsWordSpacing, xPos, false); 197 } else { 198 SVGTextPositioningElement* text = static_cast<SVGTextPositioningElement*>(flow->object()->element()); 199 x += (int)(text->dx()->getFirst().value()); 200 if (text->x()->numberOfItems() > 0) 201 x = (int)(text->x()->getFirst().value() - xPos); 202 if (text->x()->numberOfItems() > 0 || text->y()->numberOfItems() > 0 || 203 text->dx()->numberOfItems() > 0 || text->dy()->numberOfItems() > 0) { 204 seenPositionedElement = true; 205 needsWordSpacing = false; 206 int ignoreX, ignoreY; 207 x = placePositionedBoxesHorizontally(flow, x, mn, mx, ignoreX, ignoreY, needsWordSpacing, xPos, true); 208 } else if (seenPositionedElement) { 209 int ignoreX, ignoreY; 210 x = placePositionedBoxesHorizontally(flow, x, mn, mx, ignoreX, ignoreY, needsWordSpacing, xPos, false); 211 } else 212 x = placePositionedBoxesHorizontally(flow, x, mn, mx, amn, amx, needsWordSpacing, xPos, false); 213 } 208 214 } 209 215 } … … 258 264 { 259 265 for (InlineBox* curr = flow->firstChild(); curr; curr = curr->nextOnLine()) { 260 if (curr->isInlineFlowBox() ) {266 if (curr->isInlineFlowBox() && !curr->object()->element()->hasTagName(aTag)) { 261 267 SVGTextPositioningElement* text = static_cast<SVGTextPositioningElement*>(curr->object()->element()); 262 268 baseline += (int)(text->dy()->getFirst().value());
Note: See TracChangeset
for help on using the changeset viewer.