gecko/layout/reftests/svg/as-image/img-novb-height-all-1-ref.html

46 lines
1.9 KiB
HTML
Raw Normal View History

Bug 614649, patch 3: Add new comprehensive reftests for SVG-as-an-image w/ no viewBox. r=jwatt a=tests --HG-- rename : layout/reftests/svg/as-image/img-height-meet-1-ref.html => layout/reftests/svg/as-image/img-novb-height-all-1-ref.html rename : layout/reftests/svg/as-image/img-height-meet-1.html => layout/reftests/svg/as-image/img-novb-height-meet-1.html rename : layout/reftests/svg/as-image/img-height-slice-1.html => layout/reftests/svg/as-image/img-novb-height-slice-1.html rename : layout/reftests/svg/as-image/img-width-meet-1-ref.html => layout/reftests/svg/as-image/img-novb-width-all-1-ref.html rename : layout/reftests/svg/as-image/img-width-meet-1.html => layout/reftests/svg/as-image/img-novb-width-meet-1.html rename : layout/reftests/svg/as-image/img-width-slice-1.html => layout/reftests/svg/as-image/img-novb-width-slice-1.html rename : layout/reftests/svg/as-image/img-widthAndHeight-slice-1-ref.html => layout/reftests/svg/as-image/img-novb-widthAndHeight-all-1-ref.html rename : layout/reftests/svg/as-image/img-widthAndHeight-meet-1.html => layout/reftests/svg/as-image/img-novb-widthAndHeight-meet-1-em.html rename : layout/reftests/svg/as-image/img-widthAndHeight-meet-1.html => layout/reftests/svg/as-image/img-novb-widthAndHeight-meet-1-px.html rename : layout/reftests/svg/as-image/img-widthAndHeight-slice-1.html => layout/reftests/svg/as-image/img-novb-widthAndHeight-slice-1-em.html rename : layout/reftests/svg/as-image/img-widthAndHeight-slice-1.html => layout/reftests/svg/as-image/img-novb-widthAndHeight-slice-1-px.html
2011-02-09 12:13:18 -08:00
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="svg-image-util.css" />
<script src="svg-image-util.js"></script>
</head>
<body style="width: 600px"><!-- width for pct vals to resolve against -->
<script>
var svgParams = {
viewBox: null, // This gets set on a case-by-case basis below.
width : "10%",
height : "30px",
meetOrSlice: null // This means "use pAR=none"
};
// Descriptions below describe the behavior of the rows of <img> elements
// in the corresponding test cases, which we mimic with specially-crafted
// <embed> elements.
// * FIRST TWO ROWS: <img> has width=auto height=auto
// - Each <img> renders w/ width = 300px (default)
// - Synthesized viewBox has width = 10% * viewport_width = .1*300 = 30
Bug 614649, patch 3: Add new comprehensive reftests for SVG-as-an-image w/ no viewBox. r=jwatt a=tests --HG-- rename : layout/reftests/svg/as-image/img-height-meet-1-ref.html => layout/reftests/svg/as-image/img-novb-height-all-1-ref.html rename : layout/reftests/svg/as-image/img-height-meet-1.html => layout/reftests/svg/as-image/img-novb-height-meet-1.html rename : layout/reftests/svg/as-image/img-height-slice-1.html => layout/reftests/svg/as-image/img-novb-height-slice-1.html rename : layout/reftests/svg/as-image/img-width-meet-1-ref.html => layout/reftests/svg/as-image/img-novb-width-all-1-ref.html rename : layout/reftests/svg/as-image/img-width-meet-1.html => layout/reftests/svg/as-image/img-novb-width-meet-1.html rename : layout/reftests/svg/as-image/img-width-slice-1.html => layout/reftests/svg/as-image/img-novb-width-slice-1.html rename : layout/reftests/svg/as-image/img-widthAndHeight-slice-1-ref.html => layout/reftests/svg/as-image/img-novb-widthAndHeight-all-1-ref.html rename : layout/reftests/svg/as-image/img-widthAndHeight-meet-1.html => layout/reftests/svg/as-image/img-novb-widthAndHeight-meet-1-em.html rename : layout/reftests/svg/as-image/img-widthAndHeight-meet-1.html => layout/reftests/svg/as-image/img-novb-widthAndHeight-meet-1-px.html rename : layout/reftests/svg/as-image/img-widthAndHeight-slice-1.html => layout/reftests/svg/as-image/img-novb-widthAndHeight-slice-1-em.html rename : layout/reftests/svg/as-image/img-widthAndHeight-slice-1.html => layout/reftests/svg/as-image/img-novb-widthAndHeight-slice-1-px.html
2011-02-09 12:13:18 -08:00
// - <img> & viewBox both get height=30px, from <svg> height attr
svgParams.viewBox = [0, 0, 30, 30],
appendSVGSubArrayWithParams(svgParams, "embed", "300px", "30px");
Bug 614649, patch 3: Add new comprehensive reftests for SVG-as-an-image w/ no viewBox. r=jwatt a=tests --HG-- rename : layout/reftests/svg/as-image/img-height-meet-1-ref.html => layout/reftests/svg/as-image/img-novb-height-all-1-ref.html rename : layout/reftests/svg/as-image/img-height-meet-1.html => layout/reftests/svg/as-image/img-novb-height-meet-1.html rename : layout/reftests/svg/as-image/img-height-slice-1.html => layout/reftests/svg/as-image/img-novb-height-slice-1.html rename : layout/reftests/svg/as-image/img-width-meet-1-ref.html => layout/reftests/svg/as-image/img-novb-width-all-1-ref.html rename : layout/reftests/svg/as-image/img-width-meet-1.html => layout/reftests/svg/as-image/img-novb-width-meet-1.html rename : layout/reftests/svg/as-image/img-width-slice-1.html => layout/reftests/svg/as-image/img-novb-width-slice-1.html rename : layout/reftests/svg/as-image/img-widthAndHeight-slice-1-ref.html => layout/reftests/svg/as-image/img-novb-widthAndHeight-all-1-ref.html rename : layout/reftests/svg/as-image/img-widthAndHeight-meet-1.html => layout/reftests/svg/as-image/img-novb-widthAndHeight-meet-1-em.html rename : layout/reftests/svg/as-image/img-widthAndHeight-meet-1.html => layout/reftests/svg/as-image/img-novb-widthAndHeight-meet-1-px.html rename : layout/reftests/svg/as-image/img-widthAndHeight-slice-1.html => layout/reftests/svg/as-image/img-novb-widthAndHeight-slice-1-em.html rename : layout/reftests/svg/as-image/img-widthAndHeight-slice-1.html => layout/reftests/svg/as-image/img-novb-widthAndHeight-slice-1-px.html
2011-02-09 12:13:18 -08:00
// * SECOND TWO ROWS: <img> has width=auto, height=20px
// Calculations are as above, except <img> now imposes height="20px".
appendSVGSubArrayWithParams(svgParams, "embed", "300px", "20px");
Bug 614649, patch 3: Add new comprehensive reftests for SVG-as-an-image w/ no viewBox. r=jwatt a=tests --HG-- rename : layout/reftests/svg/as-image/img-height-meet-1-ref.html => layout/reftests/svg/as-image/img-novb-height-all-1-ref.html rename : layout/reftests/svg/as-image/img-height-meet-1.html => layout/reftests/svg/as-image/img-novb-height-meet-1.html rename : layout/reftests/svg/as-image/img-height-slice-1.html => layout/reftests/svg/as-image/img-novb-height-slice-1.html rename : layout/reftests/svg/as-image/img-width-meet-1-ref.html => layout/reftests/svg/as-image/img-novb-width-all-1-ref.html rename : layout/reftests/svg/as-image/img-width-meet-1.html => layout/reftests/svg/as-image/img-novb-width-meet-1.html rename : layout/reftests/svg/as-image/img-width-slice-1.html => layout/reftests/svg/as-image/img-novb-width-slice-1.html rename : layout/reftests/svg/as-image/img-widthAndHeight-slice-1-ref.html => layout/reftests/svg/as-image/img-novb-widthAndHeight-all-1-ref.html rename : layout/reftests/svg/as-image/img-widthAndHeight-meet-1.html => layout/reftests/svg/as-image/img-novb-widthAndHeight-meet-1-em.html rename : layout/reftests/svg/as-image/img-widthAndHeight-meet-1.html => layout/reftests/svg/as-image/img-novb-widthAndHeight-meet-1-px.html rename : layout/reftests/svg/as-image/img-widthAndHeight-slice-1.html => layout/reftests/svg/as-image/img-novb-widthAndHeight-slice-1-em.html rename : layout/reftests/svg/as-image/img-widthAndHeight-slice-1.html => layout/reftests/svg/as-image/img-novb-widthAndHeight-slice-1-px.html
2011-02-09 12:13:18 -08:00
// * THIRD TWO ROWS: <img> has width=30px height=auto
// - <img> now renders w/ width = 30px (imposed by <img> width attr)
// - Synthesized viewBox has width = 10% * viewport_width = .1*30 = 3
// - <img> & viewBox both get height=30px, from <svg> height attr
svgParams.viewBox = [0, 0, 3, 30];
appendSVGSubArrayWithParams(svgParams, "embed", "30px", "30px");
// * FOURTH TWO ROWS: <img> has width=30px height=20px
// Calculations are as above, except <img> now imposes height="20px".
appendSVGSubArrayWithParams(svgParams, "embed", "30px", "20px");
</script>
<!-- Body gets populated by script -->
</body>
</html>