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


",
                              `${message} (starting with empty caption)`);

  testWithInitialTableContent(callbackFunc, "",
                              `${message} (starting with empty tbody)`);

  testWithInitialTableContent(callbackFunc, "",
                              `${message} (starting with empty tr)`);

  testWithInitialTableContent(callbackFunc, "",
                              `${message} (starting with empty td)`);

  testWithInitialTableContent(callbackFunc,
                              "",
                              `${message} (starting with an empty col)`);

  testWithInitialTableContent(callbackFunc,
                              "",
                              `${message} (starting with an empty colgroup)`);

  testWithInitialTableContent(callbackFunc,
                              "",
                              `${message} (starting with a colgroup/col)`);

  testWithInitialTableContent(callbackFunc,
                              "",
                              `${message} (starting with full subtree)`);
}

// The actual test logic begins here!
// We invoke expectSameReframesForTweak to compare reframe counts between our
// two tables, for various types of dynamic modifications:
expectSameReframesForTweak((elem)=> { elem.textContent = ""; },
  "Reframe count should be the same when clearing table.textContent"
);

expectSameReframesForTweak((elem)=> { elem.textContent = " "; },
  "Reframe count should be the same when setting table.textContent to a space"
);

expectSameReframesForTweak((elem)=> { elem.textContent = "modified"; },
   "Reframe count should be the same when setting table.textContent");

expectSameReframesForTweak(
   (elem) => { elem.innerHTML = ""; },
   "Reframe count should be the same when setting table.innerHTML to " +
   "table subtree with full hierarchy specified");

expectSameReframesForTweak(
   (elem) => { elem.innerHTML = "" +
               ""; },
   "Reframe count should be the same when setting table.innerHTML to " +
   "table subtree with full hierarchy specified, including a caption");

expectSameReframesForTweak(
   (elem) => { elem.innerHTML = "just a tbody"; },
   "Reframe count should be the same when setting table.innerHTML to " +
   "just a tbody");

expectSameReframesForTweak(
   (elem) => { elem.innerHTML = "just a tr"; },
   "Reframe count should be the same when setting table.innerHTML to " +
   "just a tr");

expectSameReframesForTweak(
   (elem) => { elem.innerHTML = ""; },
   "Reframe count should be the same when setting table.innerHTML to " +
   "just a td");

expectSameReframesForTweak(
   (elem) => { elem.innerHTML = ""; },
   "Reframe count should be the same when setting table.innerHTML to " +
   "just a col");

expectSameReframesForTweak(
   (elem) => { elem.innerHTML = ""; },
   "Reframe count should be the same when setting table.innerHTML to " +
   "just a colgroup");
</script>

Quelle  test_reframe_table_in_ib_split.html   Sprache: HTML

 
 products/Sources/formale Sprachen/C/Firefox/layout/style/test/test_reframe_table_in_ib_split.html


<!doctype html>
<meta charset="utf-8">
<title>
Test for bug 1850834: Replacing the contents of a table should reframe the same amount, regardless of whether it's in an IB split.
</title>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css">
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<div id="content">
  <!-- Reference case: Table as child of block-level element -->
  <div>
    <table id="tableInBlock"></table>
  </div>
  <!-- Test case: Table as child of inline-level element (forming IB split) -->
  <span>
    aaa
    <table id="tableInIBSplit"></table>
    bbb
  </span>
</div>
<script>
const utils = SpecialPowers.getDOMWindowUtils(window);

/*
 * This utility function invokes callbackFunc(callbackArg) and returns the
 * number of frames that are reconstructed in the process.
 */
function countReframesForTweak(callbackFunc, callbackArg) {
  document.documentElement.offsetTop;
  const previousConstructCount = utils.framesConstructed;

  callbackFunc(callbackArg)

  document.documentElement.offsetTop;
  return utils.framesConstructed - previousConstructCount;
}

/*
 * Helper for expectSameReframesForTweak, to reduce boilerplate.
 * Sets the provided innerHTML in both tables, and then performs the
 * dynamic-modification-callback on both tables, and asserts that the
 * frame construction counts match.
 */
function testWithInitialTableContent(callbackFunc, startingInnerHTML, message) {
  tableInBlock.innerHTML = tableInIBSplit.innerHTML = startingInnerHTML;

  let actual = countReframesForTweak(callbackFunc, tableInIBSplit);
  let expected = countReframesForTweak(callbackFunc, tableInBlock);
  is(actual, expected, message);
}

/*
 * This utility function runs the provided callback function for both of the
 * tables, from various starting-conditions. In each case, we check that
 * the number of frames that are reconstructed is the same, between the
 * two tables.
 */
function expectSameReframesForTweak(callbackFunc, message) {
  testWithInitialTableContent(callbackFunc, "", /* <-- empty string */
                              `${message} (starting with empty table)`);

  testWithInitialTableContent(callbackFunc, " ", /* <-- two space chars */
                              `${message} (starting with ` +
                              `empty-aside-from-whitespace table)`);

  testWithInitialTableContent(callbackFunc, "Some text",
                              `${message} (starting with text node child)`);

  testWithInitialTableContent(callbackFunc, "
Contents
content
caption
content
just a td
Messung V0.5
C=93 H=94 G=93

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

*© 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
 




Impressum  | Ethik und Gesetz  | Haftungsausschluß  | Kontakt  | Seitenstruktur  | © 2026 JDD |