Changeset 89745 in webkit
- Timestamp:
- Jun 25, 2011, 11:41:39 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 12 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/platform/mac/svg/W3C-SVG-1.1-SE/linking-uri-01-b-expected.png (added)
-
LayoutTests/platform/mac/svg/W3C-SVG-1.1-SE/linking-uri-01-b-expected.txt (added)
-
LayoutTests/platform/mac/svg/custom/linking-a-03-b-all-expected.png (modified) ( previous)
-
LayoutTests/platform/mac/svg/custom/linking-a-03-b-all-expected.txt (modified) (1 diff)
-
LayoutTests/platform/mac/svg/custom/linking-a-03-b-transform-expected.png (modified) ( previous)
-
LayoutTests/platform/mac/svg/custom/linking-a-03-b-transform-expected.txt (modified) (1 diff)
-
LayoutTests/platform/mac/svg/custom/linking-a-03-b-viewBox-transform-expected.png (modified) ( previous)
-
LayoutTests/platform/mac/svg/custom/linking-a-03-b-viewBox-transform-expected.txt (modified) (1 diff)
-
LayoutTests/platform/mac/svg/custom/linking-uri-01-b-expected.png (added)
-
LayoutTests/platform/mac/svg/custom/linking-uri-01-b-expected.txt (added)
-
LayoutTests/svg/W3C-SVG-1.1-SE/linking-uri-01-b.svg (added)
-
LayoutTests/svg/custom/linking-uri-01-b.svg (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/page/FrameView.cpp (modified) (2 diffs)
-
Source/WebCore/svg/SVGAElement.cpp (modified) (1 diff)
-
Source/WebCore/svg/SVGSVGElement.cpp (modified) (1 diff)
-
Source/WebCore/svg/SVGSVGElement.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r89743 r89745 1 2011-06-25 Rob Buis <rbuis@rim.com> 2 3 Reviewed by Nikolas Zimmermann. 4 5 SVG1.1SE test linking-uri-01-b.svg fails 6 https://bugs.webkit.org/show_bug.cgi?id=63322 7 8 Add a test for navigating to an inner <view> anchor. The changed test results 9 are improvements. 10 11 * platform/mac/svg/W3C-SVG-1.1-SE/linking-uri-01-b-expected.png: Added. 12 * platform/mac/svg/W3C-SVG-1.1-SE/linking-uri-01-b-expected.txt: Added. 13 * platform/mac/svg/custom/linking-a-03-b-all-expected.png: 14 * platform/mac/svg/custom/linking-a-03-b-all-expected.txt: 15 * platform/mac/svg/custom/linking-a-03-b-transform-expected.png: 16 * platform/mac/svg/custom/linking-a-03-b-transform-expected.txt: 17 * platform/mac/svg/custom/linking-a-03-b-viewBox-transform-expected.png: 18 * platform/mac/svg/custom/linking-a-03-b-viewBox-transform-expected.txt: 19 * platform/mac/svg/custom/linking-uri-01-b-expected.png: Added. 20 * platform/mac/svg/custom/linking-uri-01-b-expected.txt: Added. 21 * svg/W3C-SVG-1.1-SE/linking-uri-01-b.svg: Added. 22 * svg/custom/linking-uri-01-b.svg: Added. 23 1 24 2011-06-25 Dimitri Glazkov <dglazkov@chromium.org> 2 25 -
trunk/LayoutTests/platform/mac/svg/custom/linking-a-03-b-all-expected.txt
r77485 r89745 11 11 RenderSVGInlineText {#text} at (0,0) size 40x15 12 12 chunk 1 text run 1 at (203.00,99.00) startOffset 0 endOffset 8 width 40.00: "circle-1" 13 RenderSVGPath {circle} at ( 0,104) size 135x256[stroke={[type=SOLID] [color=#00FF00] [stroke width=4.00]}] [fill={[type=SOLID] [color=#FFFF00]}] [cx=100.00] [cy=260.00] [r=20.00]13 RenderSVGPath {circle} at (5,84) size 239x239 [stroke={[type=SOLID] [color=#00FF00] [stroke width=4.00]}] [fill={[type=SOLID] [color=#FFFF00]}] [cx=100.00] [cy=260.00] [r=20.00] 14 14 RenderSVGText {text} at (80,283) size 40x15 contains 1 chunk(s) 15 15 RenderSVGInlineText {#text} at (0,0) size 40x15 16 16 chunk 1 text run 1 at (80.00,295.00) startOffset 0 endOffset 8 width 40.00: "circle-2" 17 RenderSVGPath {rect} at (0, 32) size 219x328[stroke={[type=SOLID] [color=#000000]}] [x=64.00] [y=227.00] [width=72.00] [height=72.00]17 RenderSVGPath {rect} at (0,18) size 324x342 [stroke={[type=SOLID] [color=#000000]}] [x=64.00] [y=227.00] [width=72.00] [height=72.00] 18 18 RenderSVGPath {circle} at (0,0) size 0x0 [stroke={[type=SOLID] [color=#0000FF] [stroke width=10.00]}] [cx=340.00] [cy=260.00] [r=50.00] 19 19 RenderSVGText {text} at (320,320) size 40x15 contains 1 chunk(s) -
trunk/LayoutTests/platform/mac/svg/custom/linking-a-03-b-transform-expected.txt
r77485 r89745 2 2 RenderView at (0,0) size 800x600 3 3 layer at (0,0) size 480x360 4 RenderSVGRoot {svg} at (0,0) size 47 3x3605 RenderSVGContainer {g} at (3 ,19) size 385x3414 RenderSVGRoot {svg} at (0,0) size 479x360 5 RenderSVGContainer {g} at (33,14) size 360x346 6 6 RenderSVGText {text} at (100,9) size 184x14 contains 1 chunk(s) 7 7 RenderSVGInlineText {#text} at (0,0) size 184x14 8 8 chunk 1 text run 1 at (100.00,20.00) startOffset 0 endOffset 41 width 184.00: "Some circles with ids, for linking tests." 9 RenderSVGPath {circle} at (1 50,134) size 85x84[stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#FF0000]}] [cx=220.00] [cy=140.00] [r=35.00]9 RenderSVGPath {circle} at (167,119) size 79x79 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#FF0000]}] [cx=220.00] [cy=140.00] [r=35.00] 10 10 RenderSVGText {text} at (203,87) size 40x15 contains 1 chunk(s) 11 11 RenderSVGInlineText {#text} at (0,0) size 40x15 12 12 chunk 1 text run 1 at (203.00,99.00) startOffset 0 endOffset 8 width 40.00: "circle-1" 13 RenderSVGPath {circle} at ( 27,247) size 52x52[stroke={[type=SOLID] [color=#00FF00] [stroke width=4.00]}] [fill={[type=SOLID] [color=#FFFF00]}] [cx=100.00] [cy=260.00] [r=20.00]13 RenderSVGPath {circle} at (53,243) size 48x49 [stroke={[type=SOLID] [color=#00FF00] [stroke width=4.00]}] [fill={[type=SOLID] [color=#FFFF00]}] [cx=100.00] [cy=260.00] [r=20.00] 14 14 RenderSVGText {text} at (80,283) size 40x15 contains 1 chunk(s) 15 15 RenderSVGInlineText {#text} at (0,0) size 40x15 16 16 chunk 1 text run 1 at (80.00,295.00) startOffset 0 endOffset 8 width 40.00: "circle-2" 17 RenderSVGPath {rect} at ( 9,233) size 87x87[stroke={[type=SOLID] [color=#000000]}] [x=64.00] [y=227.00] [width=72.00] [height=72.00]18 RenderSVGPath {circle} at (2 25,251) size 129x109[stroke={[type=SOLID] [color=#0000FF] [stroke width=10.00]}] [cx=340.00] [cy=260.00] [r=50.00]17 RenderSVGPath {rect} at (36,230) size 81x81 [stroke={[type=SOLID] [color=#000000]}] [x=64.00] [y=227.00] [width=72.00] [height=72.00] 18 RenderSVGPath {circle} at (256,229) size 120x120 [stroke={[type=SOLID] [color=#0000FF] [stroke width=10.00]}] [cx=340.00] [cy=260.00] [r=50.00] 19 19 RenderSVGText {text} at (320,320) size 40x15 contains 1 chunk(s) 20 20 RenderSVGInlineText {#text} at (0,0) size 40x15 21 21 chunk 1 text run 1 at (320.00,332.00) startOffset 0 endOffset 8 width 40.00: "circle-3" 22 RenderSVGContainer {g} at (0,0) size 47 3x36023 RenderSVGPath {rect} at (0,0) size 47 3x360 [stroke={[type=SOLID] [color=#000000]}] [x=1.00] [y=1.00] [width=478.00] [height=358.00]22 RenderSVGContainer {g} at (0,0) size 479x360 23 RenderSVGPath {rect} at (0,0) size 479x360 [stroke={[type=SOLID] [color=#000000]}] [x=1.00] [y=1.00] [width=478.00] [height=358.00] -
trunk/LayoutTests/platform/mac/svg/custom/linking-a-03-b-viewBox-transform-expected.txt
r77485 r89745 11 11 RenderSVGInlineText {#text} at (0,0) size 40x15 12 12 chunk 1 text run 1 at (203.00,99.00) startOffset 0 endOffset 8 width 40.00: "circle-1" 13 RenderSVGPath {circle} at ( 0,104) size 135x256[stroke={[type=SOLID] [color=#00FF00] [stroke width=4.00]}] [fill={[type=SOLID] [color=#FFFF00]}] [cx=100.00] [cy=260.00] [r=20.00]13 RenderSVGPath {circle} at (5,84) size 239x239 [stroke={[type=SOLID] [color=#00FF00] [stroke width=4.00]}] [fill={[type=SOLID] [color=#FFFF00]}] [cx=100.00] [cy=260.00] [r=20.00] 14 14 RenderSVGText {text} at (80,283) size 40x15 contains 1 chunk(s) 15 15 RenderSVGInlineText {#text} at (0,0) size 40x15 16 16 chunk 1 text run 1 at (80.00,295.00) startOffset 0 endOffset 8 width 40.00: "circle-2" 17 RenderSVGPath {rect} at (0, 32) size 219x328[stroke={[type=SOLID] [color=#000000]}] [x=64.00] [y=227.00] [width=72.00] [height=72.00]17 RenderSVGPath {rect} at (0,18) size 324x342 [stroke={[type=SOLID] [color=#000000]}] [x=64.00] [y=227.00] [width=72.00] [height=72.00] 18 18 RenderSVGPath {circle} at (0,0) size 0x0 [stroke={[type=SOLID] [color=#0000FF] [stroke width=10.00]}] [cx=340.00] [cy=260.00] [r=50.00] 19 19 RenderSVGText {text} at (320,320) size 40x15 contains 1 chunk(s) -
trunk/Source/WebCore/ChangeLog
r89742 r89745 1 2011-06-25 Rob Buis <rbuis@rim.com> 2 3 Reviewed by Nikolas Zimmermann. 4 5 SVG1.1SE test linking-uri-01-b.svg fails 6 https://bugs.webkit.org/show_bug.cgi?id=63322 7 8 Allow navigating to internal <view> targets. When choosing Back ensure 9 the <svg> current view is initialized correctly. 10 11 Tests: svg/W3C-SVG-1.1-SE/linking-uri-01-b.svg 12 svg/custom/linking-uri-01-b.svg 13 14 * page/FrameView.cpp: Delegate to setupInitialView. 15 (WebCore::FrameView::scrollToAnchor): 16 * svg/SVGAElement.cpp: Allow navigating to internal <view> targets. 17 (WebCore::SVGAElement::defaultEventHandler): 18 * svg/SVGSVGElement.cpp: 19 (WebCore::SVGSVGElement::setupInitialView): Initialize current view depending on fragment identifier. 20 (WebCore::SVGSVGElement::inheritViewAttributes): 21 * svg/SVGSVGElement.h: 22 1 23 2011-06-24 Dimitri Glazkov <dglazkov@chromium.org> 2 24 -
trunk/Source/WebCore/page/FrameView.cpp
r89316 r89745 72 72 #if ENABLE(SVG) 73 73 #include "SVGDocument.h" 74 #include "SVGLocatable.h"75 #include "SVGNames.h"76 #include "SVGPreserveAspectRatio.h"77 74 #include "SVGSVGElement.h" 78 #include "SVGViewElement.h"79 #include "SVGViewSpec.h"80 75 #endif 81 76 … … 1463 1458 Element* anchorNode = m_frame->document()->findAnchor(name); 1464 1459 1460 // Setting to null will clear the current target. 1461 m_frame->document()->setCSSTarget(anchorNode); 1462 1465 1463 #if ENABLE(SVG) 1466 1464 if (m_frame->document()->isSVGDocument()) { 1467 if (name.startsWith("xpointer(")) { 1468 // We need to parse the xpointer reference here 1469 } else if (name.startsWith("svgView(")) { 1470 RefPtr<SVGSVGElement> svg = static_cast<SVGDocument*>(m_frame->document())->rootElement(); 1471 if (!svg->currentView()->parseViewSpec(name)) 1472 return false; 1473 svg->setUseCurrentView(true); 1474 } else { 1475 if (anchorNode && anchorNode->hasTagName(SVGNames::viewTag)) { 1476 RefPtr<SVGViewElement> viewElement = anchorNode->hasTagName(SVGNames::viewTag) ? static_cast<SVGViewElement*>(anchorNode) : 0; 1477 if (viewElement.get()) { 1478 SVGElement* element = SVGLocatable::nearestViewportElement(viewElement.get()); 1479 if (element->hasTagName(SVGNames::svgTag)) { 1480 RefPtr<SVGSVGElement> svg = static_cast<SVGSVGElement*>(element); 1481 svg->inheritViewAttributes(viewElement.get()); 1482 } 1483 } 1484 } 1485 } 1486 // FIXME: need to decide which <svg> to focus on, and zoom to that one 1487 // FIXME: need to actually "highlight" the viewTarget(s) 1488 } 1489 #endif 1490 1491 m_frame->document()->setCSSTarget(anchorNode); // Setting to null will clear the current target. 1465 if (SVGSVGElement* svg = static_cast<SVGDocument*>(m_frame->document())->rootElement()) { 1466 svg->setupInitialView(name, anchorNode); 1467 if (!anchorNode) 1468 return true; 1469 } 1470 } 1471 #endif 1492 1472 1493 1473 // Implement the rule that "" and "top" both mean top of page as in other browsers. -
trunk/Source/WebCore/svg/SVGAElement.cpp
r88989 r89745 213 213 static_cast<SVGSMILElement*>(targetElement)->beginByLinkActivation(); 214 214 event->setDefaultHandled(); 215 return; 215 216 } 216 return; 217 // Only allow navigation to internal <view> anchors. 218 if (!targetElement->hasTagName(SVGNames::viewTag)) 219 return; 217 220 } 218 221 #endif -
trunk/Source/WebCore/svg/SVGSVGElement.cpp
r88989 r89745 626 626 } 627 627 628 void SVGSVGElement::setupInitialView(const String& fragmentIdentifier, Element* anchorNode) 629 { 630 bool hadUseCurrentView = m_useCurrentView; 631 setUseCurrentView(false); 632 if (fragmentIdentifier.startsWith("xpointer(")) { 633 // FIXME: XPointer references are ignored (https://bugs.webkit.org/show_bug.cgi?id=17491) 634 return; 635 } 636 if (fragmentIdentifier.startsWith("svgView(")) { 637 if (!currentView()->parseViewSpec(fragmentIdentifier)) 638 return; 639 setUseCurrentView(true); 640 return; 641 } 642 if (anchorNode && anchorNode->hasTagName(SVGNames::viewTag)) { 643 SVGViewElement* viewElement = anchorNode->hasTagName(SVGNames::viewTag) ? static_cast<SVGViewElement*>(anchorNode) : 0; 644 if (viewElement) { 645 SVGElement* element = SVGLocatable::nearestViewportElement(viewElement); 646 if (element->hasTagName(SVGNames::svgTag)) { 647 SVGSVGElement* svg = static_cast<SVGSVGElement*>(element); 648 svg->inheritViewAttributes(viewElement); 649 setUseCurrentView(true); 650 } 651 } 652 return; 653 } 654 if (hadUseCurrentView) { 655 currentView()->setTransform(emptyString()); 656 if (RenderObject* object = renderer()) 657 RenderSVGResource::markForLayoutAndParentResourceInvalidation(object); 658 } 659 // FIXME: We need to decide which <svg> to focus on, and zoom to it. 660 // FIXME: We need to actually "highlight" the viewTarget(s). 661 } 662 628 663 void SVGSVGElement::inheritViewAttributes(SVGViewElement* viewElement) 629 664 { 630 setUseCurrentView(true);631 665 if (viewElement->hasAttribute(SVGNames::viewBoxAttr)) 632 666 currentView()->setViewBoxBaseValue(viewElement->viewBox()); -
trunk/Source/WebCore/svg/SVGSVGElement.h
r88555 r89745 121 121 AffineTransform viewBoxToViewTransform(float viewWidth, float viewHeight) const; 122 122 123 void inheritViewAttributes(SVGViewElement*);123 void setupInitialView(const String& fragmentIdentifier, Element* anchorNode); 124 124 125 125 bool isOutermostSVG() const; … … 151 151 152 152 virtual bool selfHasRelativeLengths() const; 153 154 void inheritViewAttributes(SVGViewElement*); 153 155 154 156 // Animated property declarations
Note:
See TracChangeset
for help on using the changeset viewer.