Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/layout/reftests/xul/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 3 kB image not shown  

Quelle  generate-object-fit-xul-tests.sh   Sprache: Shell

 
#!/bin/bash
#
# Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
#
# Script to generate XUL <image> reftest files, from corresponding reftest
# files that use <img>.
#
# This script expects to be run from this working directory:
#  mozilla-central/layout/reftests/w3c-css/submitted/images3

XUL_REFTEST_PATH="../../../xul"

imageFileArr=("colors-16x8.png"            "colors-8x16.png"
              "colors-16x8.svg"            "colors-8x16.svg"
              "colors-16x8-noSize.svg"     "colors-8x16-noSize.svg"
              "colors-16x8-parDefault.svg" "colors-8x16-parDefault.svg")
numImageFiles=${#imageFileArr[@]}

# Copy image files
for ((i = 0; i < $numImageFiles; i++)); do
  imageFileName=${imageFileArr[$i]}
  imageDest=$XUL_REFTEST_PATH/$imageFileName

  echo "Copying $imageDest."
  hg cp support/$imageFileName $imageDest
done

# Add comment to reftest.list in dest directory:
reftestListFileName="$XUL_REFTEST_PATH/reftest.list"
echo "
# Tests for XUL <image> with 'object-fit' & 'object-position':
# These tests should be very similar to tests in our w3c-css/submitted/images3
# reftest directory. They live here because they use XUL, and it
# wouldn't be fair of us to make a W3C testsuite implicitly depend on XUL."\
  >> $reftestListFileName

# Loop across all object-fit tests that use <img> ("i" suffix):
for origTestName in object-fit*i.html; do
  newTestName=$(echo $origTestName |
                sed "s/i.html/.xul/")

  # Find the corresponding reference case:
  referenceName=$(echo $origTestName |
                  sed "s/i.html/-ref.html/")

  # Generate reference file (dropping "support" subdir from image paths):
  echo "Copying $referenceName to $XUL_REFTEST_PATH."
  newReferenceFullPath=$XUL_REFTEST_PATH/$referenceName
  hg cp $referenceName $newReferenceFullPath
  sed -i "s,support/,," $newReferenceFullPath

  # Generate testcase
  # (converting <video poster="support/foo.png"> to <video src="foo.webm">):
  echo "Generating $newTestName from $origTestName."
  newTestFullPath=$XUL_REFTEST_PATH/$newTestName
  hg cp $origTestName $newTestFullPath

  # Replace doctype with XML decl:
  sed -i "s//1.0\"?>/" $newTestFullPath

  # Replace html tags with window tags:
  sed -i "s,,http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul\">," $newTestFullPath
  sed -i "s,,
,"
 $newTestFullPath

  # Delete a bunch of HTML (not XUL) / W3C-testsuite boilerplate:
  sed -i "/head>/d" $newTestFullPath # Delete head open & close tags
  sed -i "/body>/d" $newTestFullPath # Delete body open & close tags
  sed -i "/ $newTestFullPath # Delete meta charset tag
  sed -i "/ $newTestFullPath <span style='color:green'># Delete title line</span><br>   sed -i <span style='color:blue'>"/<link/d"</span> $newTestFullPath <span style='color:green'># Delete link tags</span><br> <br>   <span style='color:green'># Add 4px to all sizes, since in XUL, sizes are for border-box</span><br>   <span style='color:green'># instead of content-box.</span><br>   sed -i <span style='color:blue'>"s/ 48px/ 52px/"</span> $newTestFullPath<br>   sed -i <span style='color:blue'>"s/ 32px/ 36px/"</span> $newTestFullPath<br>   sed -i <span style='color:blue'>"s/ 8px/ 12px/"</span> $newTestFullPath<br> <br>   <span style='color:green'># Fix style open/close tags, and add 8px of padding on outer <window> to</span><br>   <span style='color:green'># match our HTML reference case, and change style rule to target <image>:</span><br>   sed -i <span style='color:blue'>"s, <style type=\"</span>text/css\<span style='color:blue'>">,\<style xmlns=\"</span><a href='http://www.w3.org/1999/xhtml\' target='_blank'>http://www.w3.org/1999/xhtml\</a><span style='color:blue'>"><![CDATA[\n window { padding: 8px; },"</span> $newTestFullPath<br>   sed -i <span style='color:blue'>"s, </style>,]]></style>,"</span> $newTestFullPath<br>   sed -i <span style='color:blue'>"s/img {/image {/"</span> $newTestFullPath<br> <br>   sed -i <span style='color:blue'>"s,support/,,"</span> $newTestFullPath<br>   sed -i <span style='color:blue'>"s,<img\(.*\)>,<image\1/>,"</span> $newTestFullPath<br>   sed -i <span style='color:blue'>"s, <!--,<hbox>\n <!--,"</span> $newTestFullPath<br>   sed -i <span style='color:blue'>"s, <br>,</hbox>,"</span> $newTestFullPath<br> <br>   <span style='color:green'># Update reftest manifest:</span><br>   <span style='color:red'>echo</span> <span style='color:blue'>"== $newTestName $referenceName"</span> \<br>     >> $reftestListFileName<br> <br> <span style='color:red'>done</span><br> </div><div align=center><br><table border=1 style='border: 1px solid black; border-collapse: collapse;'><tr><th colspan=3>Messung V0.5</th></tr><tr><td> <svg height='38' width='38' > <circle cx='19' cy='19' r='16' stroke='grey' fill='purple' fill-opacity='30%' stroke-linecap='round' stroke-width='3' stroke-dasharray='360' stroke-dashoffset='72' /> <text x='12' y='22' fill='red' font-size=6>C=90</text> </svg> </td><td> <svg height='38' width='38' > <circle cx='19' cy='19' r='16' stroke='grey' fill='purple' fill-opacity='30%' stroke-linecap='round' stroke-width='3' stroke-dasharray='360' stroke-dashoffset='7' /> <text x='12' y='22' fill='red' font-size=6>H=99</text> </svg> </td><td> <svg height='56' width='56' > <circle cx='28' cy='28' r='24' stroke='green' fill='purple' fill-opacity='30%' stroke-linecap='round' stroke-width='4' stroke-dasharray='360' stroke-dashoffset='43' /> <text x='18' y='32' fill='red' font-size=8>G=94</text> </svg> </td></tr></table></div></span><br> <h3><b>¤</b> Dauer der Verarbeitung: 0.3 Sekunden  <b>¤</b></h3> <p height="2" colspan="2" align="center"><span style="font-size: 3px;">*© Formatika GbR, Deutschland</span></p> </div> </td> <td valign="top" align="center" class="greenscreensmall"> <br><br><br> <br> <table width="20%"> <tr><td align="center"> <a href="print.jsp?content=directory"> <br>Wurzel<br> <img border="0" src="/Images/penguin.jpg" height=36 alt="" title="Wurzel"> </a> </td> </tr> <tr><td align="center"> <a href="print.jsp?content=search" title="Suchen"> <br>Suchen<br> <img src="/Images/find.png" height="48" alt="" border="0"> </a> </td> </tr> <tr><td align="left"><a href="print.jsp?content=directory&detail=products/Sources/formale%20Sprachen/PVS/" title="Projekt "><br>Beweissystem der NASA</a></td></tr> <tr><td align="left"><a href="print.jsp?content=directory&detail=products/Sources/formale%20Sprachen/Isabelle/" title="Projekt "><br>Beweissystem Isabelle</a></td></tr> <tr><td align="left"><a href="print.jsp?content=directory&detail=products/Sources/formale%20Sprachen/Cobol/Test-Suite/" title="Projekt "><br>NIST Cobol Testsuite</a></td></tr> <tr><td align="left"><a href="print.jsp?content=directory&detail=products/Sources/formale%20Sprachen/Fortran/f90gl-1.2.15/" title="Projekt "><br>Cephes Mathematical Library</a></td></tr> <tr><td align="left"><a href="print.jsp?content=directory&detail=products/Sources/formale%20Sprachen/VDM/" title="Projekt "><br>Wiener Entwicklungsmethode</a></td></tr> <tr><td align="center"> <br> <h2>Haftungshinweis</h2> <div align="justify" class="featuresmall">Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.</div> <br> <h2>Bemerkung:</h2> <div align="justify" class="featuresmall"> Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.</div> <br> </td> </tr> </table> <br><br> <div> <br> <script src="https://formatika.de/base/formcheck.js"></script> <script> function checkform(form) { var res = true; res = res && isnotempty(form.file); res = res && isurl(form.file); return res; } </script> </div><br> <br> </td> </tr> </table> </div> <div class="printelement"> <script> warningpreview(); </script> </div> <p align=right class=hidden>2026-04-04</p> </td></tr> </table> </body> </html>