Truly independent web browser
Tests/LibWeb: Remove style tests that only pin engine internals
Andreas Kling2a11f7e45896
diff --git a/Libraries/LibWeb/Internals/Internals.cpp b/Libraries/LibWeb/Internals/Internals.cppindex ef8f0cfc9a1..5f1c97fdcdd 100644--- a/Libraries/LibWeb/Internals/Internals.cpp+++ b/Libraries/LibWeb/Internals/Internals.cpp@@ -2806,29 +2806,6 @@ u64 Internals::layout_style_record_identity(DOM::Element& element)return layout_node ? layout_node->style_record_identity().value() : 0;}-u64 Internals::before_style_record_identity(DOM::Element& element)-{- return element.style_record_identity(CSS::PseudoElement::Before).value();-}--u64 Internals::before_layout_style_record_identity(DOM::Element& element)-{- Layout::ForcedReadScope read { element.document() };- element.document().update_layout(DOM::UpdateLayoutReason::Debugging);- auto const* layout_node = element.pseudo_element_layout_node(read, CSS::PseudoElement::Before);- return layout_node ? layout_node->style_record_identity().value() : 0;-}--u64 Internals::paint_style_record_identity(DOM::Element& element)-{- Layout::ForcedReadScope read { element.document() };- element.document().update_layout(DOM::UpdateLayoutReason::Debugging);- auto const* layout_node = element.layout_node(read);- if (!layout_node || !Painting::has_committed_box(*layout_node))- return 0;- return Painting::style_record_identity(*layout_node).value();-}-u64 Internals::layout_node_identity(DOM::Node& node){Layout::ForcedReadScope read { node.document() };diff --git a/Libraries/LibWeb/Internals/Internals.h b/Libraries/LibWeb/Internals/Internals.hindex 17533b7392a..2a35c16b47d 100644--- a/Libraries/LibWeb/Internals/Internals.h+++ b/Libraries/LibWeb/Internals/Internals.h@@ -322,9 +322,6 @@ public:u64 style_record_identity(DOM::Element&);u64 custom_property_environment_identity(DOM::Element&);u64 layout_style_record_identity(DOM::Element&);- u64 before_style_record_identity(DOM::Element&);- u64 before_layout_style_record_identity(DOM::Element&);- u64 paint_style_record_identity(DOM::Element&);u64 layout_node_identity(DOM::Node&);u64 layout_arena_live_slot_count();void panic_render_state_for_testing();diff --git a/Libraries/LibWeb/Internals/Internals.idl b/Libraries/LibWeb/Internals/Internals.idlindex c3dded58dbb..cb42ba936e4 100644--- a/Libraries/LibWeb/Internals/Internals.idl+++ b/Libraries/LibWeb/Internals/Internals.idl@@ -394,9 +394,6 @@ interface Internals {unsigned long long styleRecordIdentity(Element element);unsigned long long customPropertyEnvironmentIdentity(Element element);unsigned long long layoutStyleRecordIdentity(Element element);- unsigned long long beforeStyleRecordIdentity(Element element);- unsigned long long beforeLayoutStyleRecordIdentity(Element element);- unsigned long long paintStyleRecordIdentity(Element element);// Stable for the lifetime of a layout node, and zero when the DOM node has no principal// layout node. Useful for asserting that incremental tree builds preserve unaffected nodes.unsigned long long layoutNodeIdentity(Node node);diff --git a/Tests/LibWeb/Text/expected/css/style-engine/cold-pass-group-cache.txt b/Tests/LibWeb/Text/expected/css/style-engine/cold-pass-group-cache.txtdeleted file mode 100644index 28fef11af01..00000000000--- a/Tests/LibWeb/Text/expected/css/style-engine/cold-pass-group-cache.txt+++ /dev/null@@ -1,2 +0,0 @@-computed every styled element: true-differences: 0diff --git a/Tests/LibWeb/Text/expected/css/style-engine/cold-pass-keywords.txt b/Tests/LibWeb/Text/expected/css/style-engine/cold-pass-keywords.txtdeleted file mode 100644index 28fef11af01..00000000000--- a/Tests/LibWeb/Text/expected/css/style-engine/cold-pass-keywords.txt+++ /dev/null@@ -1,2 +0,0 @@-computed every styled element: true-differences: 0diff --git a/Tests/LibWeb/Text/expected/css/style-engine/cold-pass-matching.txt b/Tests/LibWeb/Text/expected/css/style-engine/cold-pass-matching.txtdeleted file mode 100644index 1fd3b4d569f..00000000000--- a/Tests/LibWeb/Text/expected/css/style-engine/cold-pass-matching.txt+++ /dev/null@@ -1,5 +0,0 @@-styled elements: true-ancestor filter rejected a candidate: true-computed every styled element: true-computed some directly: true-differences: 0diff --git a/Tests/LibWeb/Text/expected/css/style-engine/cold-pass-pseudo-elements.txt b/Tests/LibWeb/Text/expected/css/style-engine/cold-pass-pseudo-elements.txtdeleted file mode 100644index ae8a1540a43..00000000000--- a/Tests/LibWeb/Text/expected/css/style-engine/cold-pass-pseudo-elements.txt+++ /dev/null@@ -1,3 +0,0 @@-computed every styled element: true-pseudo-elements: 7-differences: 0diff --git a/Tests/LibWeb/Text/expected/css/style-engine/cold-pass-registered-properties.txt b/Tests/LibWeb/Text/expected/css/style-engine/cold-pass-registered-properties.txtdeleted file mode 100644index 28fef11af01..00000000000--- a/Tests/LibWeb/Text/expected/css/style-engine/cold-pass-registered-properties.txt+++ /dev/null@@ -1,2 +0,0 @@-computed every styled element: true-differences: 0diff --git a/Tests/LibWeb/Text/expected/css/style-engine/cold-pass-reuse.txt b/Tests/LibWeb/Text/expected/css/style-engine/cold-pass-reuse.txtdeleted file mode 100644index 381acf74c70..00000000000--- a/Tests/LibWeb/Text/expected/css/style-engine/cold-pass-reuse.txt+++ /dev/null@@ -1,3 +0,0 @@-computed every styled element: true-reused some elements: true-differences: 0diff --git a/Tests/LibWeb/Text/expected/css/style-engine/cold-pass-sharing.txt b/Tests/LibWeb/Text/expected/css/style-engine/cold-pass-sharing.txtdeleted file mode 100644index 40eff793f6d..00000000000--- a/Tests/LibWeb/Text/expected/css/style-engine/cold-pass-sharing.txt+++ /dev/null@@ -1,3 +0,0 @@-computed every styled element: true-shared some elements: true-differences: 0diff --git a/Tests/LibWeb/Text/expected/css/style-engine/cold-pass-substitution.txt b/Tests/LibWeb/Text/expected/css/style-engine/cold-pass-substitution.txtdeleted file mode 100644index 28fef11af01..00000000000--- a/Tests/LibWeb/Text/expected/css/style-engine/cold-pass-substitution.txt+++ /dev/null@@ -1,2 +0,0 @@-computed every styled element: true-differences: 0diff --git a/Tests/LibWeb/Text/expected/css/style-engine/cold-pass-zoom.txt b/Tests/LibWeb/Text/expected/css/style-engine/cold-pass-zoom.txtdeleted file mode 100644index 28fef11af01..00000000000--- a/Tests/LibWeb/Text/expected/css/style-engine/cold-pass-zoom.txt+++ /dev/null@@ -1,2 +0,0 @@-computed every styled element: true-differences: 0diff --git a/Tests/LibWeb/Text/expected/css/style-engine/disconnected-elements-hold-no-record.txt b/Tests/LibWeb/Text/expected/css/style-engine/disconnected-elements-hold-no-record.txtdeleted file mode 100644index 15410b3fcd4..00000000000--- a/Tests/LibWeb/Text/expected/css/style-engine/disconnected-elements-hold-no-record.txt+++ /dev/null@@ -1,4 +0,0 @@-disconnected element holds no record: true-layout metric read stores no record: true-inserting the element materializes a record: true-removing the element drops the record: truediff --git a/Tests/LibWeb/Text/expected/css/style-engine/dom-clears-hidden-style-record-identity.txt b/Tests/LibWeb/Text/expected/css/style-engine/dom-clears-hidden-style-record-identity.txtdeleted file mode 100644index 6bd170fa423..00000000000--- a/Tests/LibWeb/Text/expected/css/style-engine/dom-clears-hidden-style-record-identity.txt+++ /dev/null@@ -1,3 +0,0 @@-initial assignment is retained: true-display-none propagation clears the assignment: true-returning restores the style: truediff --git a/Tests/LibWeb/Text/expected/css/style-engine/early-computed-record-sharing.txt b/Tests/LibWeb/Text/expected/css/style-engine/early-computed-record-sharing.txtindex 9e1266cf38f..704d50d24b0 100644--- a/Tests/LibWeb/Text/expected/css/style-engine/early-computed-record-sharing.txt+++ b/Tests/LibWeb/Text/expected/css/style-engine/early-computed-record-sharing.txt@@ -1,4 +1,3 @@-early sharing used: trueinitial context: truechanged inheritance and winners: truecustom property and box context: truediff --git a/Tests/LibWeb/Text/expected/css/style-engine/font-waits-resolve-within-pass.txt b/Tests/LibWeb/Text/expected/css/style-engine/font-waits-resolve-within-pass.txtindex b1cf196e7ac..9d23612504e 100644--- a/Tests/LibWeb/Text/expected/css/style-engine/font-waits-resolve-within-pass.txt+++ b/Tests/LibWeb/Text/expected/css/style-engine/font-waits-resolve-within-pass.txt@@ -1,3 +1 @@-passes: 1-elements styled: 6deepest font size: 18.75pxdiff --git a/Tests/LibWeb/Text/expected/css/style-engine/hidden-subtree-returns-with-its-style.txt b/Tests/LibWeb/Text/expected/css/style-engine/hidden-subtree-returns-with-its-style.txtnew file mode 100644index 00000000000..856aaf797d7--- /dev/null+++ b/Tests/LibWeb/Text/expected/css/style-engine/hidden-subtree-returns-with-its-style.txt@@ -0,0 +1 @@+returning restores the style: truediff --git a/Tests/LibWeb/Text/expected/css/style-engine/idle-style-update-skips-transaction.txt b/Tests/LibWeb/Text/expected/css/style-engine/idle-style-update-skips-transaction.txtdeleted file mode 100644index 40b9c610995..00000000000--- a/Tests/LibWeb/Text/expected/css/style-engine/idle-style-update-skips-transaction.txt+++ /dev/null@@ -1,6 +0,0 @@-idle passes: 0-unnamed class passes: 0-changed passes: 1-changed color: rgb(0, 128, 0)-animation passes: 0-animated opacity: 0.5diff --git a/Tests/LibWeb/Text/expected/css/style-engine/layout-and-paint-consume-style-record.txt b/Tests/LibWeb/Text/expected/css/style-engine/layout-and-paint-consume-style-record.txtdeleted file mode 100644index bd9911d44ed..00000000000--- a/Tests/LibWeb/Text/expected/css/style-engine/layout-and-paint-consume-style-record.txt+++ /dev/null@@ -1,13 +0,0 @@-initial record is nonzero: true-layout consumes initial record: true-paint consumes initial record: true-layout shares records: true-metadata-only change publishes a new record: true-layout consumes metadata-only record: true-paint consumes metadata-only record: true-style change publishes a new record: true-layout consumes changed record: true-paint consumes changed record: true-pseudo layout consumes changed record: true-pseudo metadata-only change publishes a new record: true-pseudo layout consumes metadata-only record: truediff --git a/Tests/LibWeb/Text/expected/css/style-engine/persistent-style-sharing-cssom-revision.txt b/Tests/LibWeb/Text/expected/css/style-engine/persistent-style-sharing-cssom-revision.txtindex a3cfcd9f2de..529cdd3e0d2 100644--- a/Tests/LibWeb/Text/expected/css/style-engine/persistent-style-sharing-cssom-revision.txt+++ b/Tests/LibWeb/Text/expected/css/style-engine/persistent-style-sharing-cssom-revision.txt@@ -1,4 +1,3 @@-shared or reused across transactions: 1initial colors: rgb(255, 0, 0), rgb(255, 0, 0)CSSOM mutation colors: rgb(0, 128, 0), rgb(0, 128, 0)inline mutation colors: rgb(0, 0, 255), rgb(0, 128, 0)diff --git a/Tests/LibWeb/Text/expected/css/style-engine/rule-index-incremental-updates.txt b/Tests/LibWeb/Text/expected/css/style-engine/rule-index-incremental-updates.txtindex d993c90a0f8..de8b978a074 100644--- a/Tests/LibWeb/Text/expected/css/style-engine/rule-index-incremental-updates.txt+++ b/Tests/LibWeb/Text/expected/css/style-engine/rule-index-incremental-updates.txt@@ -1,16 +1,16 @@-appended sheet: index builds 0, entries indexed 1, full passes 0, hinted <= 2 true+appended sheettarget: rgb(0, 128, 0)-inserted rule: index builds 0, entries indexed 2, full passes 0, hinted <= 2 true+inserted ruleother: rgb(0, 0, 255)-edited rule: index builds 0, entries indexed 1, full passes 0, hinted <= 2 true+edited ruleother: rgb(255, 165, 0)-deleted rule: index builds 0, entries indexed 0, full passes 0, hinted <= 2 true+deleted ruleother: rgb(0, 0, 0)-media off: index builds 0, entries indexed 0, full passes 0, hinted <= 2 true+media offtarget: rgb(0, 0, 0)-media on: index builds 0, entries indexed 1, full passes 0, hinted <= 2 true+media ontarget: rgb(0, 128, 0)-removed sheet: index builds 0, entries indexed 0, full passes 0, hinted <= 2 true+removed sheettarget: rgb(0, 0, 0)-sheet inserted before: index builds 0, entries indexed 1, full passes 0, hinted <= 2 true+sheet inserted beforetarget: rgb(0, 128, 0)diff --git a/Tests/LibWeb/Text/expected/css/style-engine/shadow-trees-with-the-same-sheets-share-rule-entries.txt b/Tests/LibWeb/Text/expected/css/style-engine/shadow-trees-with-the-same-sheets-share-rule-entries.txtindex 0cca67357a0..3ea67340032 100644--- a/Tests/LibWeb/Text/expected/css/style-engine/shadow-trees-with-the-same-sheets-share-rule-entries.txt+++ b/Tests/LibWeb/Text/expected/css/style-engine/shadow-trees-with-the-same-sheets-share-rule-entries.txt@@ -1,15 +1,15 @@-twenty shadow trees with one sheet: entries indexed 3, index builds 0+twenty shadow trees with one sheetfirst: a=rgb(0, 128, 0) b=10px host=blocklast: a=rgb(0, 128, 0) b=10px host=block-one with another sheet: entries indexed 4, index builds 0+one with another sheetother: a=rgb(0, 0, 255) b=10px host=block-one shadow tree takes another sheet: entries indexed 4, index builds 0+one shadow tree takes another sheetdiverged: a=rgb(0, 128, 0) b=20px host=blockunchanged: a=rgb(0, 128, 0) b=10px host=block-it gives the sheet up: entries indexed 0, index builds 0+it gives the sheet uprejoined: a=rgb(0, 128, 0) b=10px host=block-ten shadow trees adopting one sheet: entries indexed 1, index builds 0-rule inserted into the adopted sheet: entries indexed 1, index builds 0+ten shadow trees adopting one sheet+rule inserted into the adopted sheetfirst adopter: a=rgb(0, 0, 128) b=30px host=blocklast adopter: a=rgb(0, 0, 128) b=30px host=blockfirst: a=rgb(0, 128, 0) b=10px host=blockdiff --git a/Tests/LibWeb/Text/expected/css/style-engine/shared-image-declaration-context.txt b/Tests/LibWeb/Text/expected/css/style-engine/shared-image-declaration-context.txtindex 779c761a405..13009c994bc 100644--- a/Tests/LibWeb/Text/expected/css/style-engine/shared-image-declaration-context.txt+++ b/Tests/LibWeb/Text/expected/css/style-engine/shared-image-declaration-context.txt@@ -1,4 +1,3 @@-image styles share within each declaration context: truedistinct stylesheet base URLs: truechanged declaration contexts: truerestored declaration contexts: truediff --git a/Tests/LibWeb/Text/expected/css/style-engine/style-counters-report-work.txt b/Tests/LibWeb/Text/expected/css/style-engine/style-counters-report-work.txtdeleted file mode 100644index 68b462e69d0..00000000000--- a/Tests/LibWeb/Text/expected/css/style-engine/style-counters-report-work.txt+++ /dev/null@@ -1,17 +0,0 @@-keys: passes, fullPasses, styledElements, changedElements, hintedElements, hintedSubtrees, invalidationVisits, invalidationTests, coldPasses, sharedElements, reusedElements, indexBuilds, indexedEntries, compiledSelectors, userAgentIndexBuilds, matchedElements, relativeWalks-reset zeroes every counter: true-one pass: true-no full pass: true-styled <= 1: true-changed <= styled: true-hinted <= 1: true-no cold pass or index build: true-last pass full: false-last pass styled: [target]-last pass changed: [target]-reset zeroes every counter again: true-reset forgets the last pass: true-animation sample composed: true-stylesheet change: no full pass true, no index build true, entries true-stylesheet change last pass targeted: true-stylesheet change changed sibling: truediff --git a/Tests/LibWeb/Text/input/css/style-engine/cold-pass-group-cache.html b/Tests/LibWeb/Text/input/css/style-engine/cold-pass-group-cache.htmldeleted file mode 100644index 1226eb26d27..00000000000--- a/Tests/LibWeb/Text/input/css/style-engine/cold-pass-group-cache.html+++ /dev/null@@ -1,24 +0,0 @@-<!DOCTYPE html>-<style>- .framed { border: 2px solid currentcolor; outline: 1px solid currentcolor; padding: 1em; display: block; }- .red { color: rgb(200, 0, 0); }- .blue { color: rgb(0, 0, 200); }- .small { font-size: 10px; }- .large { font-size: 30px; }- .zoomed { zoom: 2; }-</style>-<div class="red"><span class="framed">a</span><span class="framed">b</span></div>-<div class="blue"><span class="framed">a</span><span class="framed">b</span></div>-<div class="small"><span class="framed">a</span></div>-<div class="large"><span class="framed">a</span></div>-<div class="zoomed"><span class="framed">a</span></div>-<div><span class="framed">a</span></div>-<script src="../../include.js"></script>-<script>- test(() => {- internals.updateStyle();- const report = internals.styleColdPass();- println(`computed every styled element: ${report.computedElements == report.elements}`);- println(`differences: ${report.differences}`);- });-</script>diff --git a/Tests/LibWeb/Text/input/css/style-engine/cold-pass-keywords.html b/Tests/LibWeb/Text/input/css/style-engine/cold-pass-keywords.htmldeleted file mode 100644index 86d871ec997..00000000000--- a/Tests/LibWeb/Text/input/css/style-engine/cold-pass-keywords.html+++ /dev/null@@ -1,19 +0,0 @@-<!DOCTYPE html>-<style>- .parent { color: rgb(10, 20, 30); padding: 3px; scrollbar-width: thin; text-transform: uppercase; }- .initial { color: initial; padding: initial; scrollbar-width: initial; text-transform: initial; }- .inherit { color: inherit; padding: inherit; scrollbar-width: inherit; margin-inline-start: inherit; }- .unset { color: unset; padding: unset; text-transform: unset; border-top-style: unset; }-</style>-<div class="parent" style="margin-inline-start: 7px">- <span class="initial">initial</span><span class="inherit">inherit</span><span class="unset">unset</span>-</div>-<script src="../../include.js"></script>-<script>- test(() => {- internals.updateStyle();- const report = internals.styleColdPass();- println(`computed every styled element: ${report.computedElements == report.elements}`);- println(`differences: ${report.differences}`);- });-</script>diff --git a/Tests/LibWeb/Text/input/css/style-engine/cold-pass-matching.html b/Tests/LibWeb/Text/input/css/style-engine/cold-pass-matching.htmldeleted file mode 100644index 286587c267d..00000000000--- a/Tests/LibWeb/Text/input/css/style-engine/cold-pass-matching.html+++ /dev/null@@ -1,36 +0,0 @@-<!DOCTYPE html>-<style>- .theme .item { color: red; }- .theme > .item { color: green; }- #main .list li:nth-child(2n) { background: blue; }- ul.list > li + li { margin-top: 1px; }- li ~ li.last { font-weight: bold; }- [data-kind="card"] span { padding: 2px; }- :is(h1, h2) .title { text-decoration: underline; }- div:not(.theme) > p { opacity: 0.5; }- section a[href^="https"] { color: purple; }- .unused-ancestor .item { color: orange; }-</style>-<div id="main" class="theme">- <ul class="list">- <li class="item">one</li>- <li class="item">two</li>- <li class="item last">three</li>- </ul>- <div data-kind="card"><span>card</span><p>paragraph</p></div>- <h2><span class="title">title</span></h2>- <section><a href="https://example.com">link</a><a href="http://example.com">plain</a></section>- <p style="color: teal">inline</p>-</div>-<script src="../../include.js"></script>-<script>- test(() => {- internals.updateStyle();- const report = internals.styleColdPass();- println(`styled elements: ${report.elements > 15}`);- println(`ancestor filter rejected a candidate: ${report.bloomRejections > 0}`);- println(`computed every styled element: ${report.computedElements == report.elements}`);- println(`computed some directly: ${report.directlyComputedElements > 0}`);- println(`differences: ${report.differences}`);- });-</script>diff --git a/Tests/LibWeb/Text/input/css/style-engine/cold-pass-pseudo-elements.html b/Tests/LibWeb/Text/input/css/style-engine/cold-pass-pseudo-elements.htmldeleted file mode 100644index 41308ef161f..00000000000--- a/Tests/LibWeb/Text/input/css/style-engine/cold-pass-pseudo-elements.html+++ /dev/null@@ -1,28 +0,0 @@-<!DOCTYPE html>-<style>- .quoted::before { content: "\201C"; color: rgb(100, 0, 0); margin-right: 2px; }- .quoted::after { content: "\201D"; font-weight: bold; }- .empty::before { content: none; color: red; }- .normal::after { content: normal; color: red; }- .themed { --accent: rgb(0, 90, 0); }- .themed::before { --gap: 3px; content: "*"; color: var(--accent); padding-left: var(--gap); }- li::marker { color: rgb(0, 0, 120); width: 100px; padding-left: 7px; }- .not-a-list-item::marker { color: red; }- .no-marker::marker { content: none; color: red; }-</style>-<p class="quoted">quoted</p>-<p class="quoted">quoted again</p>-<p class="empty normal">no generated content</p>-<p class="themed">themed</p>-<ul><li>one</li><li>two</li><li class="no-marker">three</li></ul>-<div class="not-a-list-item">not a list item</div>-<script src="../../include.js"></script>-<script>- test(() => {- internals.updateStyle();- const report = internals.styleColdPass();- println(`computed every styled element: ${report.computedElements == report.elements}`);- println(`pseudo-elements: ${report.pseudoElements}`);- println(`differences: ${report.differences}`);- });-</script>diff --git a/Tests/LibWeb/Text/input/css/style-engine/cold-pass-registered-properties.html b/Tests/LibWeb/Text/input/css/style-engine/cold-pass-registered-properties.htmldeleted file mode 100644index da25c947c4b..00000000000--- a/Tests/LibWeb/Text/input/css/style-engine/cold-pass-registered-properties.html+++ /dev/null@@ -1,19 +0,0 @@-<!DOCTYPE html>-<style>- @property --kept { syntax: "*"; inherits: false; initial-value: 3px; }- @property --passed { syntax: "*"; inherits: true; initial-value: 5px; }- .outer { --kept: 11px; --passed: 13px; padding-left: var(--kept); padding-right: var(--passed); }- .inner { margin-left: var(--kept); margin-right: var(--passed); }- .declares { --kept: 17px; border-left: var(--kept) solid; }-</style>-<div class="outer"><div class="inner">inner</div><div class="inner declares">declares</div></div>-<div class="inner">top level</div>-<script src="../../include.js"></script>-<script>- test(() => {- internals.updateStyle();- const report = internals.styleColdPass();- println(`computed every styled element: ${report.computedElements == report.elements}`);- println(`differences: ${report.differences}`);- });-</script>diff --git a/Tests/LibWeb/Text/input/css/style-engine/cold-pass-reuse.html b/Tests/LibWeb/Text/input/css/style-engine/cold-pass-reuse.htmldeleted file mode 100644index 4998706836c..00000000000--- a/Tests/LibWeb/Text/input/css/style-engine/cold-pass-reuse.html+++ /dev/null@@ -1,29 +0,0 @@-<!DOCTYPE html>-<style>- .box { padding: 1px; }- .a .label { color: rgb(1, 2, 3); }- .b .label { color: rgb(4, 5, 6); }- .framed { border: 2px solid rgb(200, 0, 0); }- .inherits { border: inherit; margin: 3px; }- .contents { display: contents; }- .grid { display: grid; }-</style>-<div class="box a"><span class="label">a</span><span class="label">a</span></div>-<div class="box b"><span class="label">b</span><span class="label">b</span></div>-<div class="framed"><p class="inherits">framed</p></div>-<div><p class="inherits">plain</p></div>-<div class="grid"><span class="box">grid item</span></div>-<div class="contents"><span class="box">contents child</span></div>-<div style="margin: 1px"><div style="margin: 1px"><div style="margin: 1px"><div style="margin: 1px">- <div style="margin: 1px"><div style="margin: 1px">deep</div></div>-</div></div></div></div>-<script src="../../include.js"></script>-<script>- test(() => {- internals.updateStyle();- const report = internals.styleColdPass();- println(`computed every styled element: ${report.computedElements == report.elements}`);- println(`reused some elements: ${report.reusedElements > 0}`);- println(`differences: ${report.differences}`);- });-</script>diff --git a/Tests/LibWeb/Text/input/css/style-engine/cold-pass-sharing.html b/Tests/LibWeb/Text/input/css/style-engine/cold-pass-sharing.htmldeleted file mode 100644index 58e57d4491c..00000000000--- a/Tests/LibWeb/Text/input/css/style-engine/cold-pass-sharing.html+++ /dev/null@@ -1,39 +0,0 @@-<!DOCTYPE html>-<style>- .item { color: rgb(1, 2, 3); padding: 2px; }- .item[data-on] { color: rgb(200, 0, 0); }- .item:nth-child(3n) { margin-left: 5px; }- .item + .item { border-top: 1px solid black; }- .item:first-child { font-weight: bold; }- #named { background-color: rgb(0, 100, 0); }- .group[data-wide] .item { width: 50px; }- .group:has(.marker) .item { height: 7px; }- .item:empty { display: inline-block; }- li { list-style-type: square; }- li:nth-child(2n + 1 of .odd) { text-indent: 3px; }- li:hover { outline: 1px solid red; }-</style>-<div class="group">- <span class="item">a</span><span class="item">b</span><span class="item" data-on>c</span>- <span class="item">d</span><span class="item" id="named">e</span><span class="item" id="untested">f</span>- <span class="item" style="padding: 9px">g</span><span class="item"></span><span class="item">h</span>-</div>-<div class="group" data-wide>- <span class="item">a</span><span class="item">b</span><span class="item">c</span>-</div>-<div class="group">- <span class="item">a</span><span class="item">b</span><span class="marker"></span>-</div>-<ul>- <li class="odd">1</li><li>2</li><li class="odd">3</li><li class="odd">4</li><li>5</li><li class="odd">6</li>-</ul>-<script src="../../include.js"></script>-<script>- test(() => {- internals.updateStyle();- const report = internals.styleColdPass();- println(`computed every styled element: ${report.computedElements == report.elements}`);- println(`shared some elements: ${report.sharedElements > 0}`);- println(`differences: ${report.differences}`);- });-</script>diff --git a/Tests/LibWeb/Text/input/css/style-engine/cold-pass-substitution.html b/Tests/LibWeb/Text/input/css/style-engine/cold-pass-substitution.htmldeleted file mode 100644index 0673aa9cd43..00000000000--- a/Tests/LibWeb/Text/input/css/style-engine/cold-pass-substitution.html+++ /dev/null@@ -1,20 +0,0 @@-<!DOCTYPE html>-<style>- :root { --main: rgb(10, 20, 30); --gap: 4px; --border: 1px solid var(--main); --unset-me: 1px; }- body { color: var(--main); font-family: var(--family, sans-serif); }- .card { border: var(--border); margin: var(--gap) calc(var(--gap) * 2); --unset-me: initial; }- .inner { padding: var(--unset-me, 3px); --main: inherit; background-color: var(--main); }- .invalid { width: var(--missing); height: var(--gap); }- details > p { border-radius: var(--gap); }-</style>-<div class="card"><div class="inner">inner</div><span class="invalid">invalid</span></div>-<details open><summary>summary</summary><p>slotted</p></details>-<script src="../../include.js"></script>-<script>- test(() => {- internals.updateStyle();- const report = internals.styleColdPass();- println(`computed every styled element: ${report.computedElements == report.elements}`);- println(`differences: ${report.differences}`);- });-</script>diff --git a/Tests/LibWeb/Text/input/css/style-engine/cold-pass-zoom.html b/Tests/LibWeb/Text/input/css/style-engine/cold-pass-zoom.htmldeleted file mode 100644index d0e32c63035..00000000000--- a/Tests/LibWeb/Text/input/css/style-engine/cold-pass-zoom.html+++ /dev/null@@ -1,16 +0,0 @@-<!DOCTYPE html>-<style>- .zoomed { zoom: 2; }- .boxed { padding: 1em; border: 2px solid; }-</style>-<div class="zoomed"><span class="boxed">zoomed</span><span>plain</span></div>-<div class="boxed">unzoomed</div>-<script src="../../include.js"></script>-<script>- test(() => {- internals.updateStyle();- const report = internals.styleColdPass();- println(`computed every styled element: ${report.computedElements == report.elements}`);- println(`differences: ${report.differences}`);- });-</script>diff --git a/Tests/LibWeb/Text/input/css/style-engine/disconnected-elements-hold-no-record.html b/Tests/LibWeb/Text/input/css/style-engine/disconnected-elements-hold-no-record.htmldeleted file mode 100644index 1554fae79de..00000000000--- a/Tests/LibWeb/Text/input/css/style-engine/disconnected-elements-hold-no-record.html+++ /dev/null@@ -1,19 +0,0 @@-<!DOCTYPE html>-<script src="../../include.js"></script>-<script>- test(() => {- const element = document.createElement("canvas");- element.getContext("2d").font = "bold 24px serif";- println(`disconnected element holds no record: ${internals.styleRecordIdentity(element) === 0}`);-- element.clientTop;- println(`layout metric read stores no record: ${internals.styleRecordIdentity(element) === 0}`);-- document.body.append(element);- getComputedStyle(element).color;- println(`inserting the element materializes a record: ${internals.styleRecordIdentity(element) !== 0}`);-- element.remove();- println(`removing the element drops the record: ${internals.styleRecordIdentity(element) === 0}`);- });-</script>diff --git a/Tests/LibWeb/Text/input/css/style-engine/dom-clears-hidden-style-record-identity.html b/Tests/LibWeb/Text/input/css/style-engine/dom-clears-hidden-style-record-identity.htmldeleted file mode 100644index 1eb15b1d066..00000000000--- a/Tests/LibWeb/Text/input/css/style-engine/dom-clears-hidden-style-record-identity.html+++ /dev/null@@ -1,23 +0,0 @@-<!DOCTYPE html>-<script src="../../include.js"></script>-<style>- #ancestor.hidden { display: none; }- #target { color: green; }-</style>-<div id="ancestor"><span id="target">target</span></div>-<script>- test(() => {- getComputedStyle(target).color;- const visibleIdentity = internals.styleRecordIdentity(target);- println(`initial assignment is retained: ${visibleIdentity !== 0}`);-- ancestor.classList.add("hidden");- getComputedStyle(ancestor).display;- const hiddenIdentity = internals.styleRecordIdentity(target);- println(`display-none propagation clears the assignment: ${hiddenIdentity === 0}`);-- ancestor.classList.remove("hidden");- // The engine derives the record afresh; it holds the style the element had.- println(`returning restores the style: ${getComputedStyle(target).color === "rgb(0, 128, 0)" && internals.styleRecordIdentity(target) !== 0}`);- });-</script>diff --git a/Tests/LibWeb/Text/input/css/style-engine/early-computed-record-sharing.html b/Tests/LibWeb/Text/input/css/style-engine/early-computed-record-sharing.htmlindex 4fe0e85c3e9..127f86d18c6 100644--- a/Tests/LibWeb/Text/input/css/style-engine/early-computed-record-sharing.html+++ b/Tests/LibWeb/Text/input/css/style-engine/early-computed-record-sharing.html@@ -27,10 +27,7 @@parents.push(parent);container.append(parent);}- internals.resetStyleCounters();internals.updateStyle();- const counters = internals.styleCounters();- println(`early sharing used: ${counters.sharedElements + counters.reusedElements > 0}`);function checkStyles(label, color, background) {let correct = true;diff --git a/Tests/LibWeb/Text/input/css/style-engine/font-waits-resolve-within-pass.html b/Tests/LibWeb/Text/input/css/style-engine/font-waits-resolve-within-pass.htmlindex c17139e0a84..894cf575aef 100644--- a/Tests/LibWeb/Text/input/css/style-engine/font-waits-resolve-within-pass.html+++ b/Tests/LibWeb/Text/input/css/style-engine/font-waits-resolve-within-pass.html@@ -28,11 +28,7 @@parent = element;}- internals.resetStyleCounters();internals.updateStyle();- const counters = internals.styleCounters();- println(`passes: ${counters.passes}`);- println(`elements styled: ${counters.styledElements}`);println(`deepest font size: ${getComputedStyle(parent).fontSize}`);});</script>diff --git a/Tests/LibWeb/Text/input/css/style-engine/hidden-subtree-returns-with-its-style.html b/Tests/LibWeb/Text/input/css/style-engine/hidden-subtree-returns-with-its-style.htmlnew file mode 100644index 00000000000..b98c2f00787--- /dev/null+++ b/Tests/LibWeb/Text/input/css/style-engine/hidden-subtree-returns-with-its-style.html@@ -0,0 +1,18 @@+<!DOCTYPE html>+<script src="../../include.js"></script>+<style>+ #ancestor.hidden { display: none; }+ #target { color: green; }+</style>+<div id="ancestor"><span id="target">target</span></div>+<script>+ test(() => {+ getComputedStyle(target).color;++ ancestor.classList.add("hidden");+ getComputedStyle(ancestor).display;++ ancestor.classList.remove("hidden");+ println(`returning restores the style: ${getComputedStyle(target).color === "rgb(0, 128, 0)"}`);+ });+</script>diff --git a/Tests/LibWeb/Text/input/css/style-engine/idle-style-update-skips-transaction.html b/Tests/LibWeb/Text/input/css/style-engine/idle-style-update-skips-transaction.htmldeleted file mode 100644index 12c2c358770..00000000000--- a/Tests/LibWeb/Text/input/css/style-engine/idle-style-update-skips-transaction.html+++ /dev/null@@ -1,36 +0,0 @@-<!DOCTYPE html>-<script src="../../include.js"></script>-<style>- #target.changed { color: green; }-</style>-<div id="target"></div>-<script>- test(() => {- internals.updateStyle();- internals.resetStyleCounters();-- for (let iteration = 0; iteration < 100; ++iteration)- internals.updateStyle();-- println(`idle passes: ${internals.styleCounters().passes}`);-- target.className = "unnamed";- internals.updateStyle();- println(`unnamed class passes: ${internals.styleCounters().passes}`);-- target.className = "changed";- internals.updateStyle();- println(`changed passes: ${internals.styleCounters().passes}`);- println(`changed color: ${getComputedStyle(target).color}`);-- const animation = target.animate({ opacity: [0, 1] }, 1000);- animation.pause();- internals.updateStyle();- internals.resetStyleCounters();-- animation.currentTime = 500;- internals.updateStyle();- println(`animation passes: ${internals.styleCounters().passes}`);- println(`animated opacity: ${getComputedStyle(target).opacity}`);- });-</script>diff --git a/Tests/LibWeb/Text/input/css/style-engine/layout-and-paint-consume-style-record.html b/Tests/LibWeb/Text/input/css/style-engine/layout-and-paint-consume-style-record.htmldeleted file mode 100644index 88d3e8b2acc..00000000000--- a/Tests/LibWeb/Text/input/css/style-engine/layout-and-paint-consume-style-record.html+++ /dev/null@@ -1,48 +0,0 @@-<!DOCTYPE html>-<script src="../../include.js"></script>-<style>- .shared { color: red; --token: initial; }- .metadata { color: red; --token: changed; }- .changed { color: blue; --token: changed; }- .pseudo::before { content: "before"; color: red; --token: initial; }- .pseudo.changed::before { content: "before"; color: blue; --token: initial; }- .pseudo.changed.metadata::before { content: "before"; color: blue; --token: changed; }-</style>-<div id="first" class="shared"></div>-<div id="second" class="shared"></div>-<div id="pseudo" class="pseudo"></div>-<script>- test(() => {- internals.updateStyle();- const firstRecord = internals.styleRecordIdentity(first);- println(`initial record is nonzero: ${firstRecord !== 0}`);- println(`layout consumes initial record: ${internals.layoutStyleRecordIdentity(first) === firstRecord}`);- println(`paint consumes initial record: ${internals.paintStyleRecordIdentity(first) === firstRecord}`);- println(`layout shares records: ${internals.layoutStyleRecordIdentity(second) === firstRecord}`);- first.className = "metadata";- internals.updateStyle();-- const metadataRecord = internals.styleRecordIdentity(first);- println(`metadata-only change publishes a new record: ${metadataRecord !== firstRecord}`);- println(`layout consumes metadata-only record: ${internals.layoutStyleRecordIdentity(first) === metadataRecord}`);- println(`paint consumes metadata-only record: ${internals.paintStyleRecordIdentity(first) === metadataRecord}`);-- first.className = "changed";- internals.updateStyle();-- const changedRecord = internals.styleRecordIdentity(first);- println(`style change publishes a new record: ${changedRecord !== metadataRecord}`);- println(`layout consumes changed record: ${internals.layoutStyleRecordIdentity(first) === changedRecord}`);- println(`paint consumes changed record: ${internals.paintStyleRecordIdentity(first) === changedRecord}`);-- pseudo.classList.add("changed");- internals.updateStyle();- const changedPseudoRecord = internals.beforeStyleRecordIdentity(pseudo);- println(`pseudo layout consumes changed record: ${internals.beforeLayoutStyleRecordIdentity(pseudo) === changedPseudoRecord}`);- pseudo.classList.add("metadata");- internals.updateStyle();- const metadataPseudoRecord = internals.beforeStyleRecordIdentity(pseudo);- println(`pseudo metadata-only change publishes a new record: ${metadataPseudoRecord !== changedPseudoRecord}`);- println(`pseudo layout consumes metadata-only record: ${internals.beforeLayoutStyleRecordIdentity(pseudo) === metadataPseudoRecord}`);- });-</script>diff --git a/Tests/LibWeb/Text/input/css/style-engine/persistent-style-sharing-cssom-revision.html b/Tests/LibWeb/Text/input/css/style-engine/persistent-style-sharing-cssom-revision.htmlindex 0502149eeea..073bf32e795 100644--- a/Tests/LibWeb/Text/input/css/style-engine/persistent-style-sharing-cssom-revision.html+++ b/Tests/LibWeb/Text/input/css/style-engine/persistent-style-sharing-cssom-revision.html@@ -10,15 +10,11 @@const first = container.firstElementChild;internals.updateStyle();- internals.resetStyleCounters();const second = document.createElement("span");second.className = "shared";container.append(second);internals.updateStyle();- const counters = internals.styleCounters();- // NB: The arriving span takes the record of the one styled in an earlier pass.- println(`shared or reused across transactions: ${counters.sharedElements + counters.reusedElements}`);println(`initial colors: ${getComputedStyle(first).color}, ${getComputedStyle(second).color}`);document.getElementById("sheet").sheet.cssRules[0].style.color = "green";diff --git a/Tests/LibWeb/Text/input/css/style-engine/rule-index-incremental-updates.html b/Tests/LibWeb/Text/input/css/style-engine/rule-index-incremental-updates.htmlindex d62594c3398..5ff52d7470c 100644--- a/Tests/LibWeb/Text/input/css/style-engine/rule-index-incremental-updates.html+++ b/Tests/LibWeb/Text/input/css/style-engine/rule-index-incremental-updates.html@@ -10,11 +10,9 @@}function step(label, change) {- internals.resetStyleCounters();change();internals.updateStyle();- const counters = internals.styleCounters();- println(`${label}: index builds ${counters.indexBuilds}, entries indexed ${counters.indexedEntries}, full passes ${counters.fullPasses}, hinted <= 2 ${counters.hintedElements <= 2}`);+ println(label);}test(() => {diff --git a/Tests/LibWeb/Text/input/css/style-engine/shadow-trees-with-the-same-sheets-share-rule-entries.html b/Tests/LibWeb/Text/input/css/style-engine/shadow-trees-with-the-same-sheets-share-rule-entries.htmlindex a3c62e3b90e..f55603affc7 100644--- a/Tests/LibWeb/Text/input/css/style-engine/shadow-trees-with-the-same-sheets-share-rule-entries.html+++ b/Tests/LibWeb/Text/input/css/style-engine/shadow-trees-with-the-same-sheets-share-rule-entries.html@@ -18,11 +18,9 @@return root;}function step(label, change) {- internals.resetStyleCounters();change();internals.updateStyle();- const counters = internals.styleCounters();- println(`${label}: entries indexed ${counters.indexedEntries}, index builds ${counters.indexBuilds}`);+ println(label);}function report(root) {const a = getComputedStyle(root.querySelector(".a")).color;diff --git a/Tests/LibWeb/Text/input/css/style-engine/shared-image-declaration-context.html b/Tests/LibWeb/Text/input/css/style-engine/shared-image-declaration-context.htmlindex e2d735f9286..297d4190055 100644--- a/Tests/LibWeb/Text/input/css/style-engine/shared-image-declaration-context.html+++ b/Tests/LibWeb/Text/input/css/style-engine/shared-image-declaration-context.html@@ -9,7 +9,6 @@<script>test(() => {internals.updateStyle();- internals.resetStyleCounters();const nodes = [];for (const className of ["local", "imported"]) {for (let index = 0; index < 8; ++index) {@@ -20,8 +19,6 @@}}internals.updateStyle();- const counters = internals.styleCounters();- println(`image styles share within each declaration context: ${counters.sharedElements + counters.reusedElements >= 14}`);function checkImages(label) {const correct = nodes.every(node => {diff --git a/Tests/LibWeb/Text/input/css/style-engine/style-counters-report-work.html b/Tests/LibWeb/Text/input/css/style-engine/style-counters-report-work.htmldeleted file mode 100644index f8f5a1eb1bb..00000000000--- a/Tests/LibWeb/Text/input/css/style-engine/style-counters-report-work.html+++ /dev/null@@ -1,71 +0,0 @@-<!DOCTYPE html>-<script src="../../include.js"></script>-<style>- @keyframes grow {- from { width: 10px; }- to { width: 110px; }- }- #animated {- height: 10px;- animation: grow 10s linear infinite;- }- .on {- color: green;- }-</style>-<div id="list">- <span id="target"></span>- <span id="sibling"></span>- <span></span>-</div>-<div id="animated"></div>-<script>- asyncTest(async done => {- internals.updateStyle();-- internals.resetStyleCounters();- let counters = internals.styleCounters();- println(`keys: ${Object.keys(counters).join(", ")}`);- println(`reset zeroes every counter: ${Object.values(counters).every(value => value === 0)}`);-- // A class change restyles the element it is on, and nothing beside it.- target.classList.add("on");- internals.updateStyle();- counters = internals.styleCounters();- println(`one pass: ${counters.passes === 1}`);- println(`no full pass: ${counters.fullPasses === 0}`);- println(`styled <= 1: ${counters.styledElements >= 1 && counters.styledElements <= 1}`);- println(`changed <= styled: ${counters.changedElements <= counters.styledElements}`);- println(`hinted <= 1: ${counters.hintedElements >= 1 && counters.hintedElements <= 1}`);- println(`no cold pass or index build: ${counters.coldPasses === 0 && counters.indexBuilds === 0}`);-- const lastPass = internals.styleLastPass();- println(`last pass full: ${lastPass.fullPass}`);- println(`last pass styled: [${lastPass.styled.join(", ")}]`);- println(`last pass changed: [${lastPass.changed.join(", ")}]`);-- internals.resetStyleCounters();- counters = internals.styleCounters();- println(`reset zeroes every counter again: ${Object.values(counters).every(value => value === 0)}`);- println(`reset forgets the last pass: ${internals.styleLastPass().styled.length === 0}`);-- // Sampling the running animation composes it over the record of its element.- await new Promise(requestAnimationFrame);- internals.resetStyleInvalidationCounters();- await new Promise(requestAnimationFrame);- animated.getBoundingClientRect();- println(`animation sample composed: ${internals.getStyleInvalidationCounters().animatedStyleOverlayBuilds > 0}`);-- // A stylesheet change restyles the elements its rules match, from a rule index updated in place.- const style = document.createElement("style");- style.textContent = "#sibling { color: blue; }";- document.head.appendChild(style);- internals.updateStyle();- counters = internals.styleCounters();- println(`stylesheet change: no full pass ${counters.fullPasses === 0}, no index build ${counters.indexBuilds === 0}, entries ${counters.indexedEntries >= 1}`);- println(`stylesheet change last pass targeted: ${!internals.styleLastPass().fullPass}`);- println(`stylesheet change changed sibling: ${internals.styleLastPass().changed.includes("sibling")}`);-- done();- });-</script>