1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/reftests/image/image-orientation-background.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,48 @@ 1.4 +<!DOCTYPE> 1.5 +<head> 1.6 + <style> 1.7 + body { 1.8 + border: 0px; 1.9 + margin: 0px; 1.10 + padding: 0px; 1.11 + } 1.12 + div { 1.13 + width: 100px; 1.14 + height: 200px; 1.15 + border: 50px solid black; 1.16 + margin: 50px; 1.17 + padding: 50px; 1.18 + 1.19 + /* This is deliberately an image with a non-neutral inherent orientation to */ 1.20 + /* ensure that the inherent orientation is irrelevant. */ 1.21 + background-image: url(image-exif-90-deg-flip.jpg); 1.22 + background-position: center; 1.23 + background-repeat: no-repeat; 1.24 + } 1.25 + </style> 1.26 +</head> 1.27 +<body> 1.28 + <div></div> 1.29 + 1.30 + <script> 1.31 + var orientation = location.search.substring(1).split("&"); 1.32 + var angle = orientation[0]; 1.33 + var flip = orientation[1] == "flip" ? true : false; 1.34 + 1.35 + // Construct a style. "from-image" is special-cased. 1.36 + var style; 1.37 + if (angle == "from-image") { 1.38 + style = "div { image-orientation: from-image; }\n"; 1.39 + } else { 1.40 + style = "div { image-orientation: " 1.41 + + angle + "deg" 1.42 + + (flip ? " flip" : "") 1.43 + + "; }\n"; 1.44 + } 1.45 + 1.46 + // Apply the style to the document. 1.47 + var sheet = document.createElement('style'); 1.48 + sheet.innerHTML = style; 1.49 + document.body.appendChild(sheet); 1.50 + </script> 1.51 +</body>