layout/reftests/image/image-orientation-list-style-image.html

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

     1 <!DOCTYPE>
     2 <head>
     3   <style>
     4     body {
     5       border:  0px;
     6       margin:  0px;
     7       padding: 0px;
     8     }
     9     ul {
    10       list-style-position: inside;
    11       list-style-image:    url(image-exif-270-deg-flip.jpg);
    12     }
    13   </style>
    14 </head>
    15 <body>
    16   <ul><li></li></ul>
    18   <script>
    19     var orientation = location.search.substring(1).split("&");
    20     var angle = orientation[0];
    21     var flip = orientation[1] == "flip" ? true : false;
    23     // Construct a style. "from-image" is special-cased.
    24     var style;
    25     if (angle == "from-image") {
    26       style = "ul { image-orientation: from-image; }\n";
    27     } else {
    28       style = "ul { image-orientation: "
    29             + angle + "deg"
    30             + (flip ? " flip" : "")
    31             + "; }\n";
    32     }
    34     // Apply the style to the document.
    35     var sheet = document.createElement('style');
    36     sheet.innerHTML = style;
    37     document.body.appendChild(sheet);
    38   </script>
    39 </body>

mercurial