layout/reftests/image/image-orientation-border-image.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/reftests/image/image-orientation-border-image.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,46 @@
     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:  100px;
    1.15 +      margin:  50px;
    1.16 +
    1.17 +      /* This is deliberately an image with a non-neutral inherent orientation to */
    1.18 +      /* ensure that the inherent orientation is irrelevant. */
    1.19 +      border-style: solid;
    1.20 +      border-width: 20px;
    1.21 +      border-image: url(image-exif-90-deg-flip.jpg) 27 repeat;
    1.22 +    }
    1.23 +  </style>
    1.24 +</head>
    1.25 +<body>
    1.26 +  <div></div>
    1.27 +
    1.28 +  <script>
    1.29 +    var orientation = location.search.substring(1).split("&");
    1.30 +    var angle = orientation[0];
    1.31 +    var flip = orientation[1] == "flip" ? true : false;
    1.32 +
    1.33 +    // Construct a style. "from-image" is special-cased.
    1.34 +    var style;
    1.35 +    if (angle == "from-image") {
    1.36 +      style = "div { image-orientation: from-image; }\n";
    1.37 +    } else {
    1.38 +      style = "div { image-orientation: "
    1.39 +            + angle + "deg"
    1.40 +            + (flip ? " flip" : "")
    1.41 +            + "; }\n";
    1.42 +    }
    1.43 +
    1.44 +    // Apply the style to the document.
    1.45 +    var sheet = document.createElement('style');
    1.46 +    sheet.innerHTML = style;
    1.47 +    document.body.appendChild(sheet);
    1.48 +  </script>
    1.49 +</body>

mercurial