Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  test_fragments.html   Sprache: HTML

 
 products/Sources/formale Sprachen/C/Firefox/dom/svg/test/test_fragments.html


<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=759124
-->

<head>
  <title>Test for Bug 759124</title>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=759124">Mozilla Bug 759124</a>
<p id="display"></p>
<div id="content" style="display: none"></div>

<iframe id="svg"></iframe>

<pre id="test">
<script class="testbody" type="application/javascript">
var svg = $("svg");

SimpleTest.waitForExplicitFinish();

function Test(svgFragmentIdentifier) {
    this.svgFragmentIdentifier = svgFragmentIdentifier;
}

function runTests() {
  var doc = svg.contentWindow.document;
  var rootElement = doc.documentElement;

  var tests = [
      new Test("svgView(viewBox(0,0,200,200))"),
      new Test("svgView(preserveAspectRatio(xMaxYMin slice))"),
      new Test("svgView(viewBox(1,2,3,4);preserveAspectRatio(xMinYMax))"),
      new Test("svgView(viewBox(none))"),
      new Test("svgView(zoomAndPan(disable))"),
      new Test("svgView(transform(translate(-10,-20) scale(2) rotate(45) translate(5,10)))"),
  ];

  var src = svg.getAttribute("src");

  is(false, rootElement.hasAttribute("viewBox"),
     "expecting to start without a viewBox set");
  is(false, rootElement.hasAttribute("preserveAspectRatio"),
     "expecting to start without preserveAspectRatio set");
  is(false, rootElement.hasAttribute("zoomAndPan"),
     "expecting to start without zoomAndPan set");

  for (var j = 0; j < 2; j++) {
    var initialViewBox = rootElement.getAttribute("viewBox");
    var initialPreserveAspectRatio =
      rootElement.getAttribute("preserveAspectRatio");
    var initialZoomAndPan = rootElement.getAttribute("zoomAndPan");
    var initialTransform = rootElement.getAttribute("transform");

    for (var i = 0; i < tests.length; i++) {
      var test = tests[i];
      svg.setAttribute("src", src + "#" + test.svgFragmentIdentifier);

      // check that assigning a viewSpec does not modify the underlying
      // attribute values.
      is(rootElement.getAttribute("viewBox"),
         initialViewBox, "unexpected viewBox");

      is(rootElement.getAttribute("preserveAspectRatio"),
         initialPreserveAspectRatio, "unexpected preserveAspectRatio");

      is(rootElement.getAttribute("zoomAndPan"),
         initialZoomAndPan, "unexpected zoomAndPan");

      is(rootElement.getAttribute("transform"),
         initialTransform, "unexpected transform");
    }

    // repeat tests with underlying attributes set to values
    rootElement.setAttribute("viewBox""0 0 100 100");
    rootElement.setAttribute("preserveAspectRatio""none");
    rootElement.setAttribute("zoomAndPan""disable");
    rootElement.setAttribute("transform""translate(10,10)");
  }

  SimpleTest.finish();
}

svg.addEventListener("load", runTests);
svg.setAttribute("src""fragments-helper.svg");
</script>
</pre>
</body>
</html>

Messung V0.5
C=96 H=91 G=93

¤ Dauer der Verarbeitung: 0.14 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

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.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge