| 1 |
<?xml version="1.0" standalone="no"?> |
| 2 |
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20000802//EN" |
| 3 |
"http://www.w3.org/TR/2000/CR-SVG-20000802/DTD/svg-20000802.dtd"> |
| 4 |
|
| 5 |
<!-- |
| 6 |
|
| 7 |
Licensed to the Apache Software Foundation (ASF) under one or more |
| 8 |
contributor license agreements. See the NOTICE file distributed with |
| 9 |
this work for additional information regarding copyright ownership. |
| 10 |
The ASF licenses this file to You under the Apache License, Version 2.0 |
| 11 |
(the "License"); you may not use this file except in compliance with |
| 12 |
the License. You may obtain a copy of the License at |
| 13 |
|
| 14 |
http://www.apache.org/licenses/LICENSE-2.0 |
| 15 |
|
| 16 |
Unless required by applicable law or agreed to in writing, software |
| 17 |
distributed under the License is distributed on an "AS IS" BASIS, |
| 18 |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 19 |
See the License for the specific language governing permissions and |
| 20 |
limitations under the License. |
| 21 |
|
| 22 |
--> |
| 23 |
<!-- ====================================================================== --> |
| 24 |
<!-- Modification of viewbox on outermost svg onLoad --> |
| 25 |
<!-- --> |
| 26 |
<!-- @author [email protected] --> |
| 27 |
<!-- @version $Id$ --> |
| 28 |
<!-- ====================================================================== --> |
| 29 |
|
| 30 |
<?xml-stylesheet type="text/css" href="../../resources/style/test.css" ?> |
| 31 |
<svg id="body" width="450" height="500" viewBox="0 0 450 500" |
| 32 |
onload="setViewBoxTo(evt,'50 25 150 166.7')"> |
| 33 |
|
| 34 |
<title>'viewBox' modification in 'onload'</title> |
| 35 |
|
| 36 |
<script type="text/ecmascript"> |
| 37 |
function setViewBoxTo(evt, val){ |
| 38 |
var svg = evt.getTarget(); |
| 39 |
svg.setAttribute('viewBox', val); |
| 40 |
} |
| 41 |
</script> |
| 42 |
|
| 43 |
<rect x="0" y="0" width="450" height="500" fill="#F88"/> |
| 44 |
|
| 45 |
<rect x="50" y="25" width="150" height="166.7" fill="#AAA"/> |
| 46 |
|
| 47 |
<svg x="75" y="75" width="100" height="100" overflow="visible" |
| 48 |
viewBox="0 0 100 100" |
| 49 |
onload="setViewBoxTo(evt, '-10 -10 120 120')"> |
| 50 |
<rect x="-10" y="-10" width="120" height="120" fill="#F88"/> |
| 51 |
</svg> |
| 52 |
|
| 53 |
<rect x="75" y="75" width="100" height="100" fill="#AAF"/> |
| 54 |
|
| 55 |
<text x="125" y="45" class="title">viewBox modification |
| 56 |
<tspan x="125" dy="1.2em"> in 'onload'</tspan></text> |
| 57 |
|
| 58 |
<text x="125" y="188" class="legend">No red should show</text> |
| 59 |
</svg> |