Eine aufbereitete Darstellung der Quelle

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

Benutzer

Quelle  test_defaultMuted.html   Sprache: HTML

 

 products/Sources/formale Sprachen/C/Firefox/dom/media/test/test_defaultMuted.html


<!DOCTYPE HTML>
<html>
<head>
  <title>Media test: defaultMuted</title>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
  <script type="text/javascript" src="manifest.js"></script>
  <script type="text/javascript" src="../../../dom/html/test/reflect.js"></script>
</head>
<body>
  <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=706731">Mozilla Bug 706731</a>
  <p id="display"></p>
  <div id="content" style="display: none"></div>
  <video id='v1'></video><audio id='a1'></audio>
  <video id='v2' muted></video><audio id='a2' muted></audio>
<pre id="test">
<script class="testbody" type="text/javascript">
    add_setup(async function() {
      await SpecialPowers.pushPrefEnv({
        set: [["dom.media.muted-state.enabled", true]],
      });
    });

    add_task(async function testDefaultMuted() {
      reflectBoolean({
        element: document.createElement("video"),
        attribute: { content: "muted", idl: "defaultMuted" },
      });

      reflectBoolean({
        element: document.createElement("audio"),
        attribute: { content: "muted", idl: "defaultMuted" },
      });

      var v1 = document.getElementById('v1');
      var a1 = document.getElementById('a1');
      var v2 = document.getElementById('v2');
      var a2 = document.getElementById('a2');

      // Check that muted state correspond to the default value.
      is(v1.muted, false, "v1.muted should be false by default");
      is(a1.muted, false, "a1.muted should be false by default");
      is(v2.muted, true, "v2.muted should be true by default");
      is(a2.muted, true, "a2.muted should be true by default");

      // While the muted setter has not been called, the muted state is "default"
      // and the muted content attribute acts as a fallback, so changing
      // defaultMuted (which reflects the content attribute) changes muted.
      // https:// style='color:red'>html.spec.whatwg.org/multipage/media.html#concept-media-muted
      v1.defaultMuted = true;
      a1.defaultMuted = true;
      v2.defaultMuted = false;
      a2.defaultMuted = false;

      is(v1.muted, true, "v1.muted reflects the added muted content attribute");
      is(a1.muted, true, "a1.muted reflects the added muted content attribute");
      is(v2.muted, false, "v2.muted reflects the removed muted content attribute");
      is(a2.muted, false, "a2.muted reflects the removed muted content attribute");

      await new Promise(resolve => mediaTestCleanup(resolve));
    });
</script>
</pre>
</body>
</html>

¤ Dauer der Verarbeitung: 0.12 Sekunden  (vorverarbeitet am  2026-09-27) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

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

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1126864
#Domains=1897691