Reviewed by hyatt.
First set of fixes for SVG Tetris:
http://bugzilla.opendarwin.org/show_bug.cgi?id=6889
Tests:
* svg/custom/viewport-update.svg
Key press test not yet possible:
http://bugzilla.opendarwin.org/show_bug.cgi?id=6906
* bridge/mac/MacFrame.mm:
(MacFrame::keyEvent): pass key events to things other than HTML
* ksvg2/svg/SVGSVGElementImpl.cpp:
(WebCore::SVGSVGElementImpl::parseMappedAttribute): update viewport
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@12452
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-01-29 Eric Seidel <eseidel@apple.com>
+
+ Reviewed by hyatt.
+
+ * svg/custom/viewport-update-expected.checksum: Added.
+ * svg/custom/viewport-update-expected.png: Added.
+ * svg/custom/viewport-update-expected.txt: Added.
+ * svg/custom/viewport-update.svg: Added.
+
2006-01-29 Darin Adler <darin@apple.com>
- updated tests for http://bugzilla.opendarwin.org/show_bug.cgi?id=6895
--- /dev/null
+778803df0a824ed8f2c7dfa07c56832e
\ No newline at end of file
--- /dev/null
+layer at (0,0) size 800x600
+ RenderCanvas at (0,0) size 800x600
+ KCanvasContainer {svg} at (-100,-100) size 200x200
+ KCanvasItem {rect} at (-100,-100) size 100x100 [fill={[type=SOLID] [color=#FF0000]}] [data="M-100.00,-100.00L0.00,-100.00L0.00,0.00L-100.00,0.00"]
+ KCanvasItem {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#008000]}] [data="M0.00,0.00L100.00,0.00L100.00,100.00L0.00,100.00"]
--- /dev/null
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="-100 -100 800 600">
+<script>
+document.documentElement.setAttribute("viewBox", "0 0 800 600");
+</script>
+<rect x="-100" y="-100" width="100" height="100" fill="red"/>
+<rect x="0" y="0" width="100" height="100" fill="green"/>
+</svg>
\ No newline at end of file
+2006-01-29 Eric Seidel <eseidel@apple.com>
+
+ Reviewed by hyatt.
+
+ First set of fixes for SVG Tetris:
+ http://bugzilla.opendarwin.org/show_bug.cgi?id=6889
+
+ Tests:
+ * svg/custom/viewport-update.svg
+ Key press test not yet possible:
+ http://bugzilla.opendarwin.org/show_bug.cgi?id=6906
+
+ * bridge/mac/MacFrame.mm:
+ (MacFrame::keyEvent): pass key events to things other than HTML
+ * ksvg2/svg/SVGSVGElementImpl.cpp:
+ (WebCore::SVGSVGElementImpl::parseMappedAttribute): update viewport
+
2006-01-29 Eric Seidel <eseidel@apple.com>
Reviewed by mjs.
}
NodeImpl *node = doc->focusNode();
if (!node) {
- node = doc->body();
- if (!node) {
+ if (doc->isHTMLDocument())
+ node = doc->body();
+ else
+ node = doc->documentElement();
+ if (!node)
return false;
- }
}
if ([event type] == NSKeyDown) {
if(SVGTestsImpl::parseMappedAttribute(attr)) return;
if(SVGLangSpaceImpl::parseMappedAttribute(attr)) return;
if(SVGExternalResourcesRequiredImpl::parseMappedAttribute(attr)) return;
- if(SVGFitToViewBoxImpl::parseMappedAttribute(attr)) return;
+ if (SVGFitToViewBoxImpl::parseMappedAttribute(attr)) {
+ if (renderer())
+ static_cast<KCanvasContainer*>(renderer())->setViewBox(FloatRect(viewBox()->baseVal()->x(), viewBox()->baseVal()->y(), viewBox()->baseVal()->width(), viewBox()->baseVal()->height()));
+ }
if(SVGZoomAndPanImpl::parseMappedAttribute(attr)) return;
SVGStyledLocatableElementImpl::parseMappedAttribute(attr);