From 67ed6768313fb6a0a03054577358bc5aea7ca72e Mon Sep 17 00:00:00 2001 From: Psychpsyo Date: Sat, 18 Jan 2025 20:39:26 +0100 Subject: [PATCH] LibWeb: Implement CSS 'contain' property --- Libraries/LibWeb/CSS/ComputedProperties.cpp | 68 ++++++ Libraries/LibWeb/CSS/ComputedProperties.h | 1 + Libraries/LibWeb/CSS/ComputedValues.h | 16 ++ Libraries/LibWeb/CSS/Display.h | 5 + Libraries/LibWeb/CSS/Enums.json | 10 + Libraries/LibWeb/CSS/Keywords.json | 6 + Libraries/LibWeb/CSS/Properties.json | 10 + Libraries/LibWeb/DOM/Document.cpp | 14 +- Libraries/LibWeb/DOM/Element.cpp | 148 +++++++++++++ Libraries/LibWeb/DOM/Element.h | 10 + Libraries/LibWeb/HTML/HTMLHtmlElement.cpp | 13 ++ Libraries/LibWeb/Layout/Box.cpp | 31 +++ Libraries/LibWeb/Layout/Box.h | 6 +- Libraries/LibWeb/Layout/FormattingContext.cpp | 9 +- Libraries/LibWeb/Layout/Node.cpp | 20 ++ .../css/css-contain/contain-crash.html | 12 + .../contain-style-remove-element-crash.html | 26 +++ .../contain-dynamic-change-crash.html | 25 +++ .../crashtests/contain-nested-crash-001.html | 24 ++ .../crashtests/contain-nested-crash-002.html | 15 ++ .../crashtests/contain-nested-crash-003.html | 18 ++ .../crashtests/contain-nested-crash-004.html | 12 + .../contain-nested-relayout-boundary.html | 11 + .../wpt-import/common/reftest-wait.js | 39 ++++ .../wpt-import/common/rendering-utils.js | 19 ++ ...ontain-inline-size-bfc-floats-001-ref.html | 9 + ...ontain-inline-size-bfc-floats-002-ref.html | 9 + ...out-formatting-context-margin-001-ref.html | 37 ++++ ...layout-ignored-cases-ib-split-001-ref.html | 76 +++++++ ...gnored-cases-no-principal-box-002-ref.html | 33 +++ ...gnored-cases-no-principal-box-003-ref.html | 33 +++ .../css-contain/contain-paint-050-ref.html | 28 +++ ...int-containing-block-absolute-001-ref.html | 19 ++ ...-paint-ignored-cases-ib-split-001-ref.html | 76 +++++++ ...gnored-cases-no-principal-box-001-ref.html | 57 +++++ ...ontain-paint-stacking-context-001-ref.html | 62 ++++++ .../contain-size-replaced-004-ref.html | 25 +++ .../contain-size-replaced-005-ref.html | 26 +++ .../contain-size-replaced-006-ref.html | 24 ++ .../contain-size-select-elem-003-ref.html | 35 +++ .../contain-size-table-caption-001-ref.html | 18 ++ .../contain-body-overflow-001-ref.html | 15 ++ .../reference/contain-content-011-ref.html | 27 +++ .../reference/contain-layout-020-ref.html | 30 +++ .../reference/contain-layout-021-ref.html | 27 +++ .../contain-layout-cell-001-ref.html | 43 ++++ .../reference/contain-layout-ifc-022-ref.html | 36 +++ .../contain-layout-ink-overflow-013-ref.html | 24 ++ .../contain-layout-ink-overflow-014-ref.html | 24 ++ .../contain-layout-ink-overflow-015-ref.html | 11 + .../contain-layout-size-003-ref.html | 37 ++++ .../reference/contain-paint-022-ref.html | 24 ++ .../reference/contain-paint-ifc-011-ref.html | 46 ++++ ...ndependent-formatting-context-001-ref.html | 14 ++ ...ndependent-formatting-context-003-ref.html | 14 ++ .../reference/contain-size-022-ref.html | 11 + .../reference/contain-size-064-ref.html | 25 +++ .../contain-style-counters-002-ref.html | 18 ++ .../contain-style-counters-004-ref.html | 18 ++ .../reference/counter-scoping-001-ref.html | 8 + .../reference/counter-scoping-003-ref.html | 8 + .../reference/counter-scoping-004-ref.html | 15 ++ .../reference/pass_if_pass_below_clipped.html | 13 ++ .../css/css-contain/support/60x60-green.png | Bin 0 -> 86 bytes .../wpt-import/css/reference/nothing.html | 4 + .../css/reference/pass_if_pass_below.html | 11 + .../wpt-import/css/support/swatch-blue.png | Bin 0 -> 83 bytes .../wpt-import/css/support/swatch-orange.png | Bin 0 -> 83 bytes .../input/wpt-import/common/reftest-wait.js | 39 ++++ .../wpt-import/common/rendering-utils.js | 19 ++ .../contain-body-overflow-001.html | 26 +++ .../contain-body-overflow-003.html | 26 +++ .../contain-body-overflow-004.html | 26 +++ .../css/css-contain/contain-content-001.html | 42 ++++ .../css/css-contain/contain-content-003.html | 52 +++++ .../css/css-contain/contain-content-004.html | 62 ++++++ .../contain-html-overflow-001.html | 28 +++ .../contain-html-overflow-002.html | 29 +++ .../contain-html-overflow-003.html | 28 +++ .../contain-html-overflow-004.html | 28 +++ ...-inline-size-grid-stretches-auto-rows.html | 35 +++ .../contain-inline-size-table.html | 14 ++ .../css/css-contain/contain-layout-001.html | 23 ++ .../css/css-contain/contain-layout-006.html | 28 +++ .../css/css-contain/contain-layout-014.html | 30 +++ .../css/css-contain/contain-layout-016.html | 20 ++ .../css/css-contain/contain-layout-017.html | 22 ++ .../css/css-contain/contain-layout-019.html | 37 ++++ .../css/css-contain/contain-layout-020.html | 42 ++++ .../css-contain/contain-layout-cell-001.html | 68 ++++++ .../css-contain/contain-layout-cell-002.html | 62 ++++++ ...-layout-containing-block-absolute-001.html | 35 +++ ...-layout-formatting-context-margin-001.html | 37 ++++ .../css-contain/contain-layout-ifc-022.html | 53 +++++ ...ain-layout-ignored-cases-ib-split-001.html | 77 +++++++ ...ut-ignored-cases-no-principal-box-002.html | 36 +++ ...ut-ignored-cases-no-principal-box-003.html | 36 +++ ...ut-independent-formatting-context-001.html | 19 ++ ...ut-independent-formatting-context-002.html | 19 ++ .../contain-layout-ink-overflow-014.html | 46 ++++ .../contain-layout-ink-overflow-016.html | 46 ++++ .../contain-layout-ink-overflow-017.html | 47 ++++ .../contain-layout-stacking-context-001.html | 66 ++++++ .../css/css-contain/contain-paint-002.html | 23 ++ .../css/css-contain/contain-paint-009.html | 28 +++ .../css/css-contain/contain-paint-011.html | 34 +++ .../css/css-contain/contain-paint-020.html | 20 ++ .../css/css-contain/contain-paint-021.html | 22 ++ .../css/css-contain/contain-paint-024.html | 49 ++++ .../css/css-contain/contain-paint-050.html | 32 +++ .../contain-paint-change-opacity.html | 19 ++ ...n-paint-containing-block-absolute-001.html | 34 +++ ...tain-paint-ignored-cases-ib-split-001.html | 77 +++++++ ...nt-ignored-cases-no-principal-box-001.html | 61 +++++ ...nt-independent-formatting-context-001.html | 19 ++ ...nt-independent-formatting-context-002.html | 19 ++ ...nt-independent-formatting-context-003.html | 19 ++ .../contain-paint-stacking-context-001a.html | 66 ++++++ .../css/css-contain/contain-size-001.html | 17 ++ .../css/css-contain/contain-size-007.html | 21 ++ .../css/css-contain/contain-size-008.html | 21 ++ .../css/css-contain/contain-size-009.html | 21 ++ .../css/css-contain/contain-size-010.html | 21 ++ .../css/css-contain/contain-size-012.html | 17 ++ .../css/css-contain/contain-size-012b.html | 18 ++ .../css/css-contain/contain-size-013.html | 17 ++ .../css/css-contain/contain-size-064.html | 36 +++ .../contain-size-replaced-001.html | 17 ++ .../contain-size-replaced-002.html | 18 ++ .../contain-size-replaced-004.html | 28 +++ .../contain-size-replaced-005.html | 29 +++ .../contain-size-replaced-006.html | 30 +++ .../contain-size-select-elem-003.html | 44 ++++ .../contain-size-table-caption-001.html | 32 +++ .../css/css-contain/support/60x60-green.png | Bin 0 -> 86 bytes .../css/css-contain/support/blue-100x100.png | Bin 0 -> 91 bytes .../css/css-contain/support/blue50wBy46h.png | Bin 0 -> 84 bytes .../css/css-contain/support/swatch-orange.png | Bin 0 -> 83 bytes ...upported-properties-and-default-values.txt | 3 +- ...eclaration-has-indexed-property-getter.txt | 209 +++++++++--------- .../css/getComputedStyle-print-all.txt | 3 +- .../contain-chrome-thcrash-001.txt | 6 + .../css-contain/contain-flexbox-outline.txt | 6 + .../parsing/contain-computed-children.txt | 6 + .../css-contain/parsing/contain-computed.txt | 21 ++ .../css-contain/parsing/contain-invalid.txt | 19 ++ .../css/css-contain/parsing/contain-valid.txt | 19 ++ .../css-flexbox/flex-item-contains-strict.txt | 11 +- .../contain-chrome-thcrash-001.html | 28 +++ .../css-contain/contain-flexbox-outline.html | 24 ++ .../parsing/contain-computed-children.html | 17 ++ .../css-contain/parsing/contain-computed.html | 33 +++ .../css-contain/parsing/contain-invalid.html | 30 +++ .../css-contain/parsing/contain-valid.html | 32 +++ 154 files changed, 4200 insertions(+), 117 deletions(-) create mode 100644 Tests/LibWeb/Crash/wpt-import/css/css-contain/contain-crash.html create mode 100644 Tests/LibWeb/Crash/wpt-import/css/css-contain/contain-style-remove-element-crash.html create mode 100644 Tests/LibWeb/Crash/wpt-import/css/css-contain/crashtests/contain-dynamic-change-crash.html create mode 100644 Tests/LibWeb/Crash/wpt-import/css/css-contain/crashtests/contain-nested-crash-001.html create mode 100644 Tests/LibWeb/Crash/wpt-import/css/css-contain/crashtests/contain-nested-crash-002.html create mode 100644 Tests/LibWeb/Crash/wpt-import/css/css-contain/crashtests/contain-nested-crash-003.html create mode 100644 Tests/LibWeb/Crash/wpt-import/css/css-contain/crashtests/contain-nested-crash-004.html create mode 100644 Tests/LibWeb/Crash/wpt-import/css/css-contain/crashtests/contain-nested-relayout-boundary.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/common/reftest-wait.js create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/common/rendering-utils.js create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-inline-size-bfc-floats-001-ref.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-inline-size-bfc-floats-002-ref.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-layout-formatting-context-margin-001-ref.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-layout-ignored-cases-ib-split-001-ref.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-layout-ignored-cases-no-principal-box-002-ref.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-layout-ignored-cases-no-principal-box-003-ref.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-paint-050-ref.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-paint-containing-block-absolute-001-ref.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-paint-ignored-cases-ib-split-001-ref.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-paint-ignored-cases-no-principal-box-001-ref.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-paint-stacking-context-001-ref.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-size-replaced-004-ref.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-size-replaced-005-ref.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-size-replaced-006-ref.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-size-select-elem-003-ref.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-size-table-caption-001-ref.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-body-overflow-001-ref.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-content-011-ref.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-layout-020-ref.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-layout-021-ref.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-layout-cell-001-ref.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-layout-ifc-022-ref.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-layout-ink-overflow-013-ref.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-layout-ink-overflow-014-ref.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-layout-ink-overflow-015-ref.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-layout-size-003-ref.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-paint-022-ref.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-paint-ifc-011-ref.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-paint-independent-formatting-context-001-ref.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-paint-independent-formatting-context-003-ref.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-size-022-ref.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-size-064-ref.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-style-counters-002-ref.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-style-counters-004-ref.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/counter-scoping-001-ref.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/counter-scoping-003-ref.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/counter-scoping-004-ref.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/pass_if_pass_below_clipped.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/support/60x60-green.png create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/reference/nothing.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/reference/pass_if_pass_below.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/support/swatch-blue.png create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/support/swatch-orange.png create mode 100644 Tests/LibWeb/Ref/input/wpt-import/common/reftest-wait.js create mode 100644 Tests/LibWeb/Ref/input/wpt-import/common/rendering-utils.js create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-body-overflow-001.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-body-overflow-003.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-body-overflow-004.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-content-001.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-content-003.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-content-004.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-html-overflow-001.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-html-overflow-002.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-html-overflow-003.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-html-overflow-004.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-inline-size-grid-stretches-auto-rows.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-inline-size-table.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-001.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-006.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-014.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-016.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-017.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-019.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-020.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-cell-001.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-cell-002.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-containing-block-absolute-001.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-formatting-context-margin-001.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-ifc-022.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-ignored-cases-ib-split-001.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-ignored-cases-no-principal-box-002.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-ignored-cases-no-principal-box-003.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-independent-formatting-context-001.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-independent-formatting-context-002.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-ink-overflow-014.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-ink-overflow-016.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-ink-overflow-017.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-stacking-context-001.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-002.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-009.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-011.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-020.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-021.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-024.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-050.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-change-opacity.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-containing-block-absolute-001.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-ignored-cases-ib-split-001.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-ignored-cases-no-principal-box-001.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-independent-formatting-context-001.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-independent-formatting-context-002.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-independent-formatting-context-003.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-stacking-context-001a.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-001.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-007.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-008.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-009.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-010.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-012.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-012b.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-013.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-064.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-replaced-001.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-replaced-002.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-replaced-004.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-replaced-005.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-replaced-006.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-select-elem-003.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-table-caption-001.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/support/60x60-green.png create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/support/blue-100x100.png create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/support/blue50wBy46h.png create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/css-contain/support/swatch-orange.png create mode 100644 Tests/LibWeb/Text/expected/wpt-import/css/css-contain/contain-chrome-thcrash-001.txt create mode 100644 Tests/LibWeb/Text/expected/wpt-import/css/css-contain/contain-flexbox-outline.txt create mode 100644 Tests/LibWeb/Text/expected/wpt-import/css/css-contain/parsing/contain-computed-children.txt create mode 100644 Tests/LibWeb/Text/expected/wpt-import/css/css-contain/parsing/contain-computed.txt create mode 100644 Tests/LibWeb/Text/expected/wpt-import/css/css-contain/parsing/contain-invalid.txt create mode 100644 Tests/LibWeb/Text/expected/wpt-import/css/css-contain/parsing/contain-valid.txt create mode 100644 Tests/LibWeb/Text/input/wpt-import/css/css-contain/contain-chrome-thcrash-001.html create mode 100644 Tests/LibWeb/Text/input/wpt-import/css/css-contain/contain-flexbox-outline.html create mode 100644 Tests/LibWeb/Text/input/wpt-import/css/css-contain/parsing/contain-computed-children.html create mode 100644 Tests/LibWeb/Text/input/wpt-import/css/css-contain/parsing/contain-computed.html create mode 100644 Tests/LibWeb/Text/input/wpt-import/css/css-contain/parsing/contain-invalid.html create mode 100644 Tests/LibWeb/Text/input/wpt-import/css/css-contain/parsing/contain-valid.html diff --git a/Libraries/LibWeb/CSS/ComputedProperties.cpp b/Libraries/LibWeb/CSS/ComputedProperties.cpp index f7ef0e19030..ada580407af 100644 --- a/Libraries/LibWeb/CSS/ComputedProperties.cpp +++ b/Libraries/LibWeb/CSS/ComputedProperties.cpp @@ -1360,6 +1360,74 @@ Optional ComputedProperties::isolation() const return keyword_to_isolation(value.to_keyword()); } +CSS::Containment ComputedProperties::contain() const +{ + CSS::Containment containment = {}; + auto const& value = property(CSS::PropertyID::Contain); + + switch (value.to_keyword()) { + case Keyword::None: + // This value indicates that the property has no effect. The element renders as normal, with no containment effects applied. + return {}; + case Keyword::Strict: + // This value computes to 'size layout paint style', and thus turns on all forms of containment for the element. + containment.size_containment = true; + containment.layout_containment = true; + containment.paint_containment = true; + containment.style_containment = true; + break; + case Keyword::Content: + // This value computes to 'layout paint style', and thus turns on all forms of containment except size containment for the element. + containment.layout_containment = true; + containment.paint_containment = true; + containment.style_containment = true; + break; + case Keyword::Size: + containment.size_containment = true; + break; + case Keyword::InlineSize: + containment.inline_size_containment = true; + break; + case Keyword::Layout: + containment.layout_containment = true; + break; + case Keyword::Style: + containment.style_containment = true; + break; + case Keyword::Paint: + containment.paint_containment = true; + break; + default: + if (value.is_value_list()) { + auto& values = value.as_value_list().values(); + for (auto const& item : values) { + switch (item->to_keyword()) { + case Keyword::Size: + containment.size_containment = true; + break; + case Keyword::InlineSize: + containment.inline_size_containment = true; + break; + case Keyword::Layout: + containment.layout_containment = true; + break; + case Keyword::Style: + containment.style_containment = true; + break; + case Keyword::Paint: + containment.paint_containment = true; + break; + default: + dbgln("`{}` is not supported in `contain` (yet?)", item->to_string(CSSStyleValue::SerializationMode::Normal)); + break; + } + } + } + } + + return containment; +} + Optional ComputedProperties::mask_type() const { auto const& value = property(CSS::PropertyID::MaskType); diff --git a/Libraries/LibWeb/CSS/ComputedProperties.h b/Libraries/LibWeb/CSS/ComputedProperties.h index 5c8a745bbb5..b8f3cf5eb11 100644 --- a/Libraries/LibWeb/CSS/ComputedProperties.h +++ b/Libraries/LibWeb/CSS/ComputedProperties.h @@ -161,6 +161,7 @@ public: Optional writing_mode() const; Optional user_select() const; Optional isolation() const; + CSS::Containment contain() const; static Vector transformations_for_style_value(CSSStyleValue const& value); Vector transformations() const; diff --git a/Libraries/LibWeb/CSS/ComputedValues.h b/Libraries/LibWeb/CSS/ComputedValues.h index 5f1494b10e0..b2ee38ed598 100644 --- a/Libraries/LibWeb/CSS/ComputedValues.h +++ b/Libraries/LibWeb/CSS/ComputedValues.h @@ -66,6 +66,18 @@ struct ObjectPosition { CSS::LengthPercentage offset_y { Percentage(50) }; }; +// https://drafts.csswg.org/css-contain-2/#containment-types +struct Containment { + // FIXME: It'd be nice if this was a single-byte bitfield instead of some bools. + bool size_containment = false; + bool inline_size_containment = false; + bool layout_containment = false; + bool style_containment = false; + bool paint_containment = false; + + bool is_empty() const { return !(size_containment || inline_size_containment || layout_containment || style_containment || paint_containment); } +}; + class InitialValues { public: static AspectRatio aspect_ratio() { return AspectRatio { true, {} }; } @@ -172,6 +184,7 @@ public: static CSS::WritingMode writing_mode() { return CSS::WritingMode::HorizontalTb; } static CSS::UserSelect user_select() { return CSS::UserSelect::Auto; } static CSS::Isolation isolation() { return CSS::Isolation::Auto; } + static CSS::Containment contain() { return {}; } // https://www.w3.org/TR/SVG/geometry.html static LengthPercentage cx() { return CSS::Length::make_px(0); } @@ -428,6 +441,7 @@ public: CSS::WritingMode writing_mode() const { return m_inherited.writing_mode; } CSS::UserSelect user_select() const { return m_noninherited.user_select; } CSS::Isolation isolation() const { return m_noninherited.isolation; } + CSS::Containment const& contain() const { return m_noninherited.contain; } CSS::LengthBox const& inset() const { return m_noninherited.inset; } const CSS::LengthBox& margin() const { return m_noninherited.margin; } @@ -681,6 +695,7 @@ protected: CSS::UnicodeBidi unicode_bidi { InitialValues::unicode_bidi() }; CSS::UserSelect user_select { InitialValues::user_select() }; CSS::Isolation isolation { InitialValues::isolation() }; + CSS::Containment contain { InitialValues::contain() }; Optional rotate; Optional translate; @@ -855,6 +870,7 @@ public: void set_writing_mode(CSS::WritingMode value) { m_inherited.writing_mode = value; } void set_user_select(CSS::UserSelect value) { m_noninherited.user_select = value; } void set_isolation(CSS::Isolation value) { m_noninherited.isolation = value; } + void set_contain(CSS::Containment value) { m_noninherited.contain = move(value); } void set_fill(SVGPaint value) { m_inherited.fill = move(value); } void set_stroke(SVGPaint value) { m_inherited.stroke = move(value); } diff --git a/Libraries/LibWeb/CSS/Display.h b/Libraries/LibWeb/CSS/Display.h index bae4acc2a13..43fa5978f94 100644 --- a/Libraries/LibWeb/CSS/Display.h +++ b/Libraries/LibWeb/CSS/Display.h @@ -62,6 +62,11 @@ public: bool is_table_cell() const { return is_internal() && internal() == DisplayInternal::TableCell; } bool is_table_column_group() const { return is_internal() && internal() == DisplayInternal::TableColumnGroup; } bool is_table_caption() const { return is_internal() && internal() == DisplayInternal::TableCaption; } + // https://drafts.csswg.org/css-display-3/#internal-table-element + bool is_internal_table() const + { + return is_internal() && (internal() == DisplayInternal::TableRowGroup || internal() == DisplayInternal::TableHeaderGroup || internal() == DisplayInternal::TableFooterGroup || internal() == DisplayInternal::TableRow || internal() == DisplayInternal::TableCell || internal() == DisplayInternal::TableColumnGroup || internal() == DisplayInternal::TableColumn); + } bool is_none() const { return m_type == Type::Box && m_value.box == DisplayBox::None; } bool is_contents() const { return m_type == Type::Box && m_value.box == DisplayBox::Contents; } diff --git a/Libraries/LibWeb/CSS/Enums.json b/Libraries/LibWeb/CSS/Enums.json index 09fe23c2068..1c66608a01b 100644 --- a/Libraries/LibWeb/CSS/Enums.json +++ b/Libraries/LibWeb/CSS/Enums.json @@ -107,6 +107,16 @@ "none", "all" ], + "contain": [ + "none", + "strict", + "content", + "size", + "inline-size", + "layout", + "style", + "paint" + ], "content-visibility": [ "visible", "auto", diff --git a/Libraries/LibWeb/CSS/Keywords.json b/Libraries/LibWeb/CSS/Keywords.json index e95576afa77..c9b30eca833 100644 --- a/Libraries/LibWeb/CSS/Keywords.json +++ b/Libraries/LibWeb/CSS/Keywords.json @@ -210,6 +210,7 @@ "inline-end", "inline-flex", "inline-grid", + "inline-size", "inline-start", "inline-table", "inset", @@ -235,6 +236,7 @@ "landscape", "large", "larger", + "layout", "left", "legacy", "less", @@ -308,6 +310,7 @@ "p3", "padding-box", "paged", + "paint", "paused", "petite-caps", "pixelated", @@ -366,6 +369,7 @@ "sideways-lr", "sideways-rl", "simplified", + "size", "slashed-zero", "slider-horizontal", "slow", @@ -389,7 +393,9 @@ "static", "sticky", "stretch", + "strict", "stroke-box", + "style", "sub", "subtractive", "super", diff --git a/Libraries/LibWeb/CSS/Properties.json b/Libraries/LibWeb/CSS/Properties.json index aa9bfe60252..ab1852dfd22 100644 --- a/Libraries/LibWeb/CSS/Properties.json +++ b/Libraries/LibWeb/CSS/Properties.json @@ -923,6 +923,16 @@ "column-count" ] }, + "contain": { + "__comment": "FIXME: Some values of contain need to be mutually exclusive. The grammar this should adhere to is 'none | strict | content | [ [size | inline-size] || layout || style || paint ]'.", + "affects-stacking-context": true, + "animation-type": "none", + "inherited": false, + "initial": "none", + "valid-types": [ + "contain" + ] + }, "content": { "animation-type": "discrete", "inherited": false, diff --git a/Libraries/LibWeb/DOM/Document.cpp b/Libraries/LibWeb/DOM/Document.cpp index 6eddd9c2806..3c9d5d25da4 100644 --- a/Libraries/LibWeb/DOM/Document.cpp +++ b/Libraries/LibWeb/DOM/Document.cpp @@ -1190,9 +1190,21 @@ static void propagate_scrollbar_width_to_viewport(Element& root_element, Layout: viewport_computed_values.set_scrollbar_width(root_element_computed_values.scrollbar_width()); } +// https://drafts.csswg.org/css-overflow-3/#overflow-propagation static void propagate_overflow_to_viewport(Element& root_element, Layout::Viewport& viewport) { - // https://drafts.csswg.org/css-overflow-3/#overflow-propagation + // https://drafts.csswg.org/css-contain-2/#contain-property + // Additionally, when any containments are active on either the HTML or elements, propagation of + // properties from the element to the initial containing block, the viewport, or the canvas background, is + // disabled. Notably, this affects: + // - 'overflow' and its longhands (see CSS Overflow 3 § 3.3 Overflow Viewport Propagation) + if (root_element.is_html_html_element() && !root_element.computed_properties()->contain().is_empty()) + return; + + auto* body_element = root_element.first_child_of_type(); + if (body_element && !body_element->computed_properties()->contain().is_empty()) + return; + // UAs must apply the overflow-* values set on the root element to the viewport // when the root element’s display value is not none. auto overflow_origin_node = root_element.layout_node(); diff --git a/Libraries/LibWeb/DOM/Element.cpp b/Libraries/LibWeb/DOM/Element.cpp index e501dec6f16..c2eeff851e7 100644 --- a/Libraries/LibWeb/DOM/Element.cpp +++ b/Libraries/LibWeb/DOM/Element.cpp @@ -2741,6 +2741,148 @@ bool Element::is_relevant_to_the_user() return false; } +// https://drafts.csswg.org/css-contain-2/#skips-its-contents +bool Element::skips_its_contents() +{ + // https://drafts.csswg.org/css-contain-2/#valdef-content-visibility-hidden + // The element skips its contents. + if (computed_properties()->content_visibility() == CSS::ContentVisibility::Hidden) + return true; + + // https://drafts.csswg.org/css-contain-2/#valdef-content-visibility-auto + // If the element is not relevant to the user, it also skips its contents. + if (computed_properties()->content_visibility() == CSS::ContentVisibility::Auto && !this->is_relevant_to_the_user()) { + return true; + } + + return false; +} + +// https://drafts.csswg.org/css-contain-2/#containment-size +bool Element::has_size_containment() const +{ + // However, giving an element size containment has no effect if any of the following are true: + + // - if the element does not generate a principal box (as is the case with 'display: contents' or 'display: none') + if (!layout_node()) + return false; + + // - if its inner display type is 'table' + if (layout_node()->display().is_table_inside()) + return false; + + // - if its principal box is an internal table box + if (layout_node()->display().is_internal_table()) + return false; + + // - if its principal box is an internal ruby box or a non-atomic inline-level box + // FIXME: Implement this. + + if (computed_properties()->contain().size_containment) + return true; + + return false; +} +// https://drafts.csswg.org/css-contain-2/#containment-inline-size +bool Element::has_inline_size_containment() const +{ + // Giving an element inline-size containment has no effect if any of the following are true: + + // - if the element does not generate a principal box (as is the case with 'display: contents' or 'display: none') + if (!layout_node()) + return false; + + // - if its inner display type is 'table' + if (layout_node()->display().is_table_inside()) + return false; + + // - if its principal box is an internal table box + if (layout_node()->display().is_internal_table()) + return false; + + // - if its principal box is an internal ruby box or a non-atomic inline-level box + // FIXME: Implement this. + + if (computed_properties()->contain().inline_size_containment) + return true; + + return false; +} +// https://drafts.csswg.org/css-contain-2/#containment-layout +bool Element::has_layout_containment() const +{ + // However, giving an element layout containment has no effect if any of the following are true: + + // - if the element does not generate a principal box (as is the case with 'display: contents' or 'display: none') + if (!layout_node()) + return false; + + // - if its principal box is an internal table box other than 'table-cell' + if (layout_node()->display().is_internal_table() && !layout_node()->display().is_table_cell()) + return false; + + // - if its principal box is an internal ruby box or a non-atomic inline-level box + // FIXME: Implement this. + + if (computed_properties()->contain().layout_containment) + return true; + + // https://drafts.csswg.org/css-contain-2/#valdef-content-visibility-auto + // Changes the used value of the 'contain' property so as to turn on layout containment, style containment, and + // paint containment for the element. + if (computed_properties()->content_visibility() == CSS::ContentVisibility::Auto) + return true; + + return false; +} +// https://drafts.csswg.org/css-contain-2/#containment-style +bool Element::has_style_containment() const +{ + // However, giving an element style containment has no effect if any of the following are true: + + // - if the element does not generate a principal box (as is the case with 'display: contents' or 'display: none') + if (!layout_node()) + return false; + + if (computed_properties()->contain().style_containment) + return true; + + // https://drafts.csswg.org/css-contain-2/#valdef-content-visibility-auto + // Changes the used value of the 'contain' property so as to turn on layout containment, style containment, and + // paint containment for the element. + if (computed_properties()->content_visibility() == CSS::ContentVisibility::Auto) + return true; + + return false; +} +// https://drafts.csswg.org/css-contain-2/#containment-paint +bool Element::has_paint_containment() const +{ + // However, giving an element paint containment has no effect if any of the following are true: + + // - if the element does not generate a principal box (as is the case with 'display: contents' or 'display: none') + if (!layout_node()) + return false; + + // - if its principal box is an internal table box other than 'table-cell' + if (layout_node()->display().is_internal_table() && !layout_node()->display().is_table_cell()) + return false; + + // - if its principal box is an internal ruby box or a non-atomic inline-level box + // FIXME: Implement this + + if (computed_properties()->contain().paint_containment) + return true; + + // https://drafts.csswg.org/css-contain-2/#valdef-content-visibility-auto + // Changes the used value of the 'contain' property so as to turn on layout containment, style containment, and + // paint containment for the element. + if (computed_properties()->content_visibility() == CSS::ContentVisibility::Auto) + return true; + + return false; +} + bool Element::id_reference_exists(String const& id_reference) const { return document().get_element_by_id(id_reference); @@ -3154,6 +3296,12 @@ void Element::resolve_counters(CSS::ComputedProperties& style) for (auto const& counter : counter_reset) ensure_counters_set().instantiate_a_counter(counter.name, unique_id(), counter.is_reversed, counter.value); + // FIXME: Take style containment into account + // https://drafts.csswg.org/css-contain-2/#containment-style + // Giving an element style containment has the following effects: + // 1. The 'counter-increment' and 'counter-set' properties must be scoped to the element’s sub-tree and create a + // new counter. + // 3. Counter values are incremented (counter-increment). auto counter_increment = style.counter_data(CSS::PropertyID::CounterIncrement); for (auto const& counter : counter_increment) diff --git a/Libraries/LibWeb/DOM/Element.h b/Libraries/LibWeb/DOM/Element.h index 71c9778f85b..58c91cf9fba 100644 --- a/Libraries/LibWeb/DOM/Element.h +++ b/Libraries/LibWeb/DOM/Element.h @@ -398,6 +398,16 @@ public: void determine_proximity_to_the_viewport(); bool is_relevant_to_the_user(); + // https://drafts.csswg.org/css-contain-2/#skips-its-contents + bool skips_its_contents(); + + // https://drafts.csswg.org/css-contain-2/#containment-types + bool has_size_containment() const; + bool has_inline_size_containment() const; + bool has_layout_containment() const; + bool has_style_containment() const; + bool has_paint_containment() const; + protected: Element(Document&, DOM::QualifiedName); virtual void initialize(JS::Realm&) override; diff --git a/Libraries/LibWeb/HTML/HTMLHtmlElement.cpp b/Libraries/LibWeb/HTML/HTMLHtmlElement.cpp index 7c300a352d2..966b6534b07 100644 --- a/Libraries/LibWeb/HTML/HTMLHtmlElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLHtmlElement.cpp @@ -6,6 +6,7 @@ #include #include +#include #include #include @@ -28,6 +29,18 @@ void HTMLHtmlElement::initialize(JS::Realm& realm) bool HTMLHtmlElement::should_use_body_background_properties() const { + // https://drafts.csswg.org/css-contain-2/#contain-property + // Additionally, when any containments are active on either the HTML or elements, propagation of + // properties from the element to the initial containing block, the viewport, or the canvas background, is + // disabled. Notably, this affects: + // - 'background' and its longhands (see CSS Backgrounds 3 § 2.11.2 The Canvas Background and the HTML Element) + if (!computed_properties()->contain().is_empty()) + return false; + + auto* body_element = first_child_of_type(); + if (body_element && !body_element->computed_properties()->contain().is_empty()) + return false; + auto background_color = layout_node()->computed_values().background_color(); auto const& background_layers = layout_node()->background_layers(); diff --git a/Libraries/LibWeb/Layout/Box.cpp b/Libraries/LibWeb/Layout/Box.cpp index ad66c92023f..89d7828fafd 100644 --- a/Libraries/LibWeb/Layout/Box.cpp +++ b/Libraries/LibWeb/Layout/Box.cpp @@ -28,6 +28,37 @@ Box::~Box() { } +Optional Box::natural_width() const +{ + // https://drafts.csswg.org/css-contain-2/#containment-size + // Replaced elements must be treated as having a natural width and height of 0 and no natural aspect + // ratio. + if (dom_node() && dom_node()->is_element() && as(dom_node())->has_size_containment()) + return 0; + + return m_natural_width; +} +Optional Box::natural_height() const +{ + // https://drafts.csswg.org/css-contain-2/#containment-size + // Replaced elements must be treated as having a natural width and height of 0 and no natural aspect + // ratio. + if (dom_node() && dom_node()->is_element() && as(dom_node())->has_size_containment()) + return 0; + + return m_natural_height; +} +Optional Box::natural_aspect_ratio() const +{ + // https://drafts.csswg.org/css-contain-2/#containment-size + // Replaced elements must be treated as having a natural width and height of 0 and no natural aspect + // ratio. + if (dom_node() && dom_node()->is_element() && as(dom_node())->has_size_containment()) + return {}; + + return m_natural_aspect_ratio; +} + void Box::visit_edges(Cell::Visitor& visitor) { Base::visit_edges(visitor); diff --git a/Libraries/LibWeb/Layout/Box.h b/Libraries/LibWeb/Layout/Box.h index 549b291fdd7..e1e66472575 100644 --- a/Libraries/LibWeb/Layout/Box.h +++ b/Libraries/LibWeb/Layout/Box.h @@ -25,9 +25,9 @@ public: Painting::PaintableBox* paintable_box(); // https://www.w3.org/TR/css-images-3/#natural-dimensions - Optional natural_width() const { return m_natural_width; } - Optional natural_height() const { return m_natural_height; } - Optional natural_aspect_ratio() const { return m_natural_aspect_ratio; } + Optional natural_width() const; + Optional natural_height() const; + Optional natural_aspect_ratio() const; bool has_natural_width() const { return natural_width().has_value(); } bool has_natural_height() const { return natural_height().has_value(); } diff --git a/Libraries/LibWeb/Layout/FormattingContext.cpp b/Libraries/LibWeb/Layout/FormattingContext.cpp index 8e35f6fc6c6..66ba7c450dc 100644 --- a/Libraries/LibWeb/Layout/FormattingContext.cpp +++ b/Libraries/LibWeb/Layout/FormattingContext.cpp @@ -94,7 +94,14 @@ bool FormattingContext::creates_block_formatting_context(Box const& box) if (box.display().is_flow_root_inside()) return true; - // FIXME: Elements with contain: layout, content, or paint. + // https://drafts.csswg.org/css-contain-2/#containment-types + // 1. The layout containment box establishes an independent formatting context. + // 4. The paint containment box establishes an independent formatting context. + if (box.dom_node() && box.dom_node()->is_element()) { + auto element = as(box.dom_node()); + if (element->has_layout_containment() || element->has_paint_containment()) + return true; + } if (box.parent()) { auto parent_display = box.parent()->display(); diff --git a/Libraries/LibWeb/Layout/Node.cpp b/Libraries/LibWeb/Layout/Node.cpp index 0d6fee21978..fe4935e7027 100644 --- a/Libraries/LibWeb/Layout/Node.cpp +++ b/Libraries/LibWeb/Layout/Node.cpp @@ -89,6 +89,17 @@ bool Node::can_contain_boxes_with_position_absolute() const if (computed_values().scale().has_value()) return true; + // https://drafts.csswg.org/css-contain-2/#containment-types + // 4. The layout containment box establishes an absolute positioning containing block and a fixed positioning + // containing block. + // 4. The paint containment box establishes an absolute positioning containing block and a fixed positioning + // containing block. + if (dom_node() && dom_node()->is_element()) { + auto element = as(dom_node()); + if (element->has_layout_containment() || element->has_paint_containment()) + return true; + } + return false; } @@ -220,6 +231,15 @@ bool Node::establishes_stacking_context() const if (computed_values().isolation() == CSS::Isolation::Isolate) return true; + // https://drafts.csswg.org/css-contain-2/#containment-types + // 5. The layout containment box creates a stacking context. + // 3. The paint containment box creates a stacking context. + if (dom_node() && dom_node()->is_element()) { + auto element = as(dom_node()); + if (element->has_layout_containment() || element->has_paint_containment()) + return true; + } + return computed_values().opacity() < 1.0f; } diff --git a/Tests/LibWeb/Crash/wpt-import/css/css-contain/contain-crash.html b/Tests/LibWeb/Crash/wpt-import/css/css-contain/contain-crash.html new file mode 100644 index 00000000000..373e004c050 --- /dev/null +++ b/Tests/LibWeb/Crash/wpt-import/css/css-contain/contain-crash.html @@ -0,0 +1,12 @@ + + + +
+
+ + diff --git a/Tests/LibWeb/Crash/wpt-import/css/css-contain/contain-style-remove-element-crash.html b/Tests/LibWeb/Crash/wpt-import/css/css-contain/contain-style-remove-element-crash.html new file mode 100644 index 00000000000..cbf079523ff --- /dev/null +++ b/Tests/LibWeb/Crash/wpt-import/css/css-contain/contain-style-remove-element-crash.html @@ -0,0 +1,26 @@ + + +
+
  • + diff --git a/Tests/LibWeb/Crash/wpt-import/css/css-contain/crashtests/contain-dynamic-change-crash.html b/Tests/LibWeb/Crash/wpt-import/css/css-contain/crashtests/contain-dynamic-change-crash.html new file mode 100644 index 00000000000..43d590bf065 --- /dev/null +++ b/Tests/LibWeb/Crash/wpt-import/css/css-contain/crashtests/contain-dynamic-change-crash.html @@ -0,0 +1,25 @@ + + + + + + + + + + + + + +
    + diff --git a/Tests/LibWeb/Crash/wpt-import/css/css-contain/crashtests/contain-nested-crash-001.html b/Tests/LibWeb/Crash/wpt-import/css/css-contain/crashtests/contain-nested-crash-001.html new file mode 100644 index 00000000000..063563c2609 --- /dev/null +++ b/Tests/LibWeb/Crash/wpt-import/css/css-contain/crashtests/contain-nested-crash-001.html @@ -0,0 +1,24 @@ + + + + + + +
    +
    +
    +
    +
    + + diff --git a/Tests/LibWeb/Crash/wpt-import/css/css-contain/crashtests/contain-nested-crash-002.html b/Tests/LibWeb/Crash/wpt-import/css/css-contain/crashtests/contain-nested-crash-002.html new file mode 100644 index 00000000000..42dc06b9938 --- /dev/null +++ b/Tests/LibWeb/Crash/wpt-import/css/css-contain/crashtests/contain-nested-crash-002.html @@ -0,0 +1,15 @@ + + + +
    +
    t
    +
    +
    +
    + diff --git a/Tests/LibWeb/Crash/wpt-import/css/css-contain/crashtests/contain-nested-crash-003.html b/Tests/LibWeb/Crash/wpt-import/css/css-contain/crashtests/contain-nested-crash-003.html new file mode 100644 index 00000000000..a7dbe7dcc31 --- /dev/null +++ b/Tests/LibWeb/Crash/wpt-import/css/css-contain/crashtests/contain-nested-crash-003.html @@ -0,0 +1,18 @@ + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + diff --git a/Tests/LibWeb/Crash/wpt-import/css/css-contain/crashtests/contain-nested-crash-004.html b/Tests/LibWeb/Crash/wpt-import/css/css-contain/crashtests/contain-nested-crash-004.html new file mode 100644 index 00000000000..db29e1424d9 --- /dev/null +++ b/Tests/LibWeb/Crash/wpt-import/css/css-contain/crashtests/contain-nested-crash-004.html @@ -0,0 +1,12 @@ + + + + + diff --git a/Tests/LibWeb/Crash/wpt-import/css/css-contain/crashtests/contain-nested-relayout-boundary.html b/Tests/LibWeb/Crash/wpt-import/css/css-contain/crashtests/contain-nested-relayout-boundary.html new file mode 100644 index 00000000000..ce915728f48 --- /dev/null +++ b/Tests/LibWeb/Crash/wpt-import/css/css-contain/crashtests/contain-nested-relayout-boundary.html @@ -0,0 +1,11 @@ + +
    +
    + +
    +
    + diff --git a/Tests/LibWeb/Ref/expected/wpt-import/common/reftest-wait.js b/Tests/LibWeb/Ref/expected/wpt-import/common/reftest-wait.js new file mode 100644 index 00000000000..80435b0fcf6 --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/common/reftest-wait.js @@ -0,0 +1,39 @@ +/** + * Remove the `reftest-wait` class on the document element. + * The reftest runner will wait with taking a screenshot while + * this class is present. + * + * See https://web-platform-tests.org/writing-tests/reftests.html#controlling-when-comparison-occurs + */ +function takeScreenshot() { + document.documentElement.classList.remove("reftest-wait"); +} + +/** + * Call `takeScreenshot()` after a delay of at least |timeout| milliseconds. + * @param {number} timeout - milliseconds + */ +function takeScreenshotDelayed(timeout) { + setTimeout(function () { + takeScreenshot(); + }, timeout); +} + +/** + * Ensure that a precondition is met before waiting for a screenshot. + * @param {bool} condition - Fail the test if this evaluates to false + * @param {string} msg - Error message to write to the screenshot + */ +function failIfNot(condition, msg) { + const fail = () => { + (document.body || document.documentElement).textContent = `Precondition Failed: ${msg}`; + takeScreenshot(); + }; + if (!condition) { + if (document.readyState == "interactive") { + fail(); + } else { + document.addEventListener("DOMContentLoaded", fail, false); + } + } +} diff --git a/Tests/LibWeb/Ref/expected/wpt-import/common/rendering-utils.js b/Tests/LibWeb/Ref/expected/wpt-import/common/rendering-utils.js new file mode 100644 index 00000000000..90cc16fda9e --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/common/rendering-utils.js @@ -0,0 +1,19 @@ +"use strict"; + +/** + * Waits until we have at least one frame rendered, regardless of the engine. + * + * @returns {Promise} + */ +function waitForAtLeastOneFrame() { + return new Promise(resolve => { + // Different web engines work slightly different on this area but waiting + // for two requestAnimationFrames() to happen, one after another, should be + // sufficient to ensure at least one frame has been generated anywhere. + window.requestAnimationFrame(() => { + window.requestAnimationFrame(() => { + resolve(); + }); + }); + }); +} diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-inline-size-bfc-floats-001-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-inline-size-bfc-floats-001-ref.html new file mode 100644 index 00000000000..383920cc99e --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-inline-size-bfc-floats-001-ref.html @@ -0,0 +1,9 @@ + +CSS Test Reference +

    You should see a wide orange rectangle to the left of the third float, overlapping the float.

    +
    +
    +
    +
    +
    +
    diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-inline-size-bfc-floats-002-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-inline-size-bfc-floats-002-ref.html new file mode 100644 index 00000000000..a7d4bc759aa --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-inline-size-bfc-floats-002-ref.html @@ -0,0 +1,9 @@ + +CSS Test Reference +

    You should see a wide orange rectangle to the left of the first float, overlapping the float.

    +
    +
    +
    +
    +
    +
    diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-layout-formatting-context-margin-001-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-layout-formatting-context-margin-001-ref.html new file mode 100644 index 00000000000..5a6d6538624 --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-layout-formatting-context-margin-001-ref.html @@ -0,0 +1,37 @@ + + + + + CSS Reftest Test + + + + + +
    +
    +
    +
    +
    + + diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-layout-ignored-cases-ib-split-001-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-layout-ignored-cases-ib-split-001-ref.html new file mode 100644 index 00000000000..eb787424ed4 --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-layout-ignored-cases-ib-split-001-ref.html @@ -0,0 +1,76 @@ + + + + + CSS Reftest Reference + + + + + + +
    + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-layout-ignored-cases-no-principal-box-002-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-layout-ignored-cases-no-principal-box-002-ref.html new file mode 100644 index 00000000000..1911bdaca0c --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-layout-ignored-cases-no-principal-box-002-ref.html @@ -0,0 +1,33 @@ + + + + + CSS Reftest Reference + + + + + +
    +
    +
    +
    +
    + + diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-layout-ignored-cases-no-principal-box-003-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-layout-ignored-cases-no-principal-box-003-ref.html new file mode 100644 index 00000000000..46f028c0581 --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-layout-ignored-cases-no-principal-box-003-ref.html @@ -0,0 +1,33 @@ + + + + + CSS Reftest Reference + + + + + +
    +
    +
    +
    +
    + + diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-paint-050-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-paint-050-ref.html new file mode 100644 index 00000000000..191c8dcbe3b --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-paint-050-ref.html @@ -0,0 +1,28 @@ + + +CSS Containment Test: Scrolling overflow works when paint is contained" + + + + + + + + + +
    + + + + + diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-paint-containing-block-absolute-001-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-paint-containing-block-absolute-001-ref.html new file mode 100644 index 00000000000..8861d19f888 --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-paint-containing-block-absolute-001-ref.html @@ -0,0 +1,19 @@ + + + + + CSS Reftest Reference + + + + +
    + + diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-paint-ignored-cases-ib-split-001-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-paint-ignored-cases-ib-split-001-ref.html new file mode 100644 index 00000000000..8a698b9d2ce --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-paint-ignored-cases-ib-split-001-ref.html @@ -0,0 +1,76 @@ + + + + + CSS Reftest Reference + + + + + + +
    + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-paint-ignored-cases-no-principal-box-001-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-paint-ignored-cases-no-principal-box-001-ref.html new file mode 100644 index 00000000000..b4513709e51 --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-paint-ignored-cases-no-principal-box-001-ref.html @@ -0,0 +1,57 @@ + + + + + CSS Reftest Reference + + + + +
    + +
    +
    + +
    +
    + +
    + + diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-paint-stacking-context-001-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-paint-stacking-context-001-ref.html new file mode 100644 index 00000000000..c7553716ab6 --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-paint-stacking-context-001-ref.html @@ -0,0 +1,62 @@ + + + + + CSS Reftest Reference + + + + +
    +

    +
    + +
    +
    +

    +
    + +
    +
    +
    + +
    +

    +
    + + diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-size-replaced-004-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-size-replaced-004-ref.html new file mode 100644 index 00000000000..56ca5d2e50e --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-size-replaced-004-ref.html @@ -0,0 +1,25 @@ + + +CSS Containment Reference: Size containment replaced elements intrinsic size + +
    abc
    +
    +
    +
    + + + +
    +
    +
    + diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-size-replaced-005-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-size-replaced-005-ref.html new file mode 100644 index 00000000000..178e137cb72 --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-size-replaced-005-ref.html @@ -0,0 +1,26 @@ + + +CSS Containment Reference: Size containment replaced elements intrinsic size + +
    abc
    +
    +
    +
    + + + +
    +
    +
    + diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-size-replaced-006-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-size-replaced-006-ref.html new file mode 100644 index 00000000000..d6753c0694b --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-size-replaced-006-ref.html @@ -0,0 +1,24 @@ + + +CSS Containment Reference: Size containment replaced elements intrinsic size + +
    abc
    +
    +
    +
    + + + +
    +
    +
    + diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-size-select-elem-003-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-size-select-elem-003-ref.html new file mode 100644 index 00000000000..214ad1891ba --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-size-select-elem-003-ref.html @@ -0,0 +1,35 @@ + + + + + CSS Reftest Reference + + + + + +
    + + +
    + + + + diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-size-table-caption-001-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-size-table-caption-001-ref.html new file mode 100644 index 00000000000..49b09334f2b --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/contain-size-table-caption-001-ref.html @@ -0,0 +1,18 @@ + + + + + CSS Reftest Reference + + + + + + +
    + + diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-body-overflow-001-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-body-overflow-001-ref.html new file mode 100644 index 00000000000..32bc8b0eafc --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-body-overflow-001-ref.html @@ -0,0 +1,15 @@ + + + + CSS-contain test referemce + + + + +

    Test passes if there is no red. diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-content-011-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-content-011-ref.html new file mode 100644 index 00000000000..00ad302ca42 --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-content-011-ref.html @@ -0,0 +1,27 @@ + + + + + CSS Reference Test + + + + + +

    Test passes if there is a filled green square, no red and the number 17. + +

    + +
    17
    diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-layout-020-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-layout-020-ref.html new file mode 100644 index 00000000000..9a0eab3afe6 --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-layout-020-ref.html @@ -0,0 +1,30 @@ + + +CSS Containment Test: Removing layout containment and contained positioned elements + + + +
    +
    +
    +
    diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-layout-021-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-layout-021-ref.html new file mode 100644 index 00000000000..c29b12e137f --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-layout-021-ref.html @@ -0,0 +1,27 @@ + + +CSS Containment Test: Layout containment fixed positioned descendants + + + +
    +

    Test passes if there is a filled green square and no red.

    +
    + diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-layout-cell-001-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-layout-cell-001-ref.html new file mode 100644 index 00000000000..9ff7f45e39c --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-layout-cell-001-ref.html @@ -0,0 +1,43 @@ + + + + + CSS Reference Test + + + + + +

    Test passes if there is the word PASS and if there is no red. + + + +
       + +
     PASS + +
    diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-layout-ifc-022-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-layout-ifc-022-ref.html new file mode 100644 index 00000000000..682af7d4f44 --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-layout-ifc-022-ref.html @@ -0,0 +1,36 @@ + + + + + CSS Reference Test + + + + + +

    Test passes if the orange rectangle and blue rectangle do not overlap. + +

    Some text in a blue rectangle.
    + +
    Some text in an orange rectangle. Some text in an orange rectangle. Some text in an orange rectangle.
    diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-layout-ink-overflow-013-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-layout-ink-overflow-013-ref.html new file mode 100644 index 00000000000..27041414e4f --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-layout-ink-overflow-013-ref.html @@ -0,0 +1,24 @@ + + + + + CSS Reference Test + + + + + + + +

    Test passes if there is no red. + +

    diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-layout-ink-overflow-014-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-layout-ink-overflow-014-ref.html new file mode 100644 index 00000000000..a2b75db3147 --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-layout-ink-overflow-014-ref.html @@ -0,0 +1,24 @@ + + + + + CSS Reference Test + + + + + + + +

    Test passes if there is no red. + +

    diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-layout-ink-overflow-015-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-layout-ink-overflow-015-ref.html new file mode 100644 index 00000000000..8dbbbbd3ec3 --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-layout-ink-overflow-015-ref.html @@ -0,0 +1,11 @@ + + + + + CSS Reference Test + + + + + +

    Test passes if there is no red. diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-layout-size-003-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-layout-size-003-ref.html new file mode 100644 index 00000000000..e3932a9b05f --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-layout-size-003-ref.html @@ -0,0 +1,37 @@ + + + + + CSS Reference Test + + + + + +

    Test passes if the orange rectangle and blue rectangle do not overlap. + +

    Some text in a blue rectangle.
    + +
    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore.
    diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-paint-022-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-paint-022-ref.html new file mode 100644 index 00000000000..b3bb7576f29 --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-paint-022-ref.html @@ -0,0 +1,24 @@ + + + + + CSS Reference Test + + + + + +

    Test passes if there is a filled green square and no red. + +

    diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-paint-ifc-011-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-paint-ifc-011-ref.html new file mode 100644 index 00000000000..229c8c2d74b --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-paint-ifc-011-ref.html @@ -0,0 +1,46 @@ + + + + + CSS Reference Test + + + + + +

    Test passes if there are 5 horizontal stripes across the page in this order (from top to bottom): an orange stripe, a blue stripe, a bright green stripe, a blue stripe and then an orange stripe. + +

    + +
    + +
    + +
    + +
    diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-paint-independent-formatting-context-001-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-paint-independent-formatting-context-001-ref.html new file mode 100644 index 00000000000..08900b201b1 --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-paint-independent-formatting-context-001-ref.html @@ -0,0 +1,14 @@ + + +CSS Containment Test: Reference file + + +

    Test passes if it has the same output than the reference.

    +
    +
    This text should have 2em top and bottom margins (margins do not collapse).
    +
    diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-paint-independent-formatting-context-003-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-paint-independent-formatting-context-003-ref.html new file mode 100644 index 00000000000..0cef592ba5c --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-paint-independent-formatting-context-003-ref.html @@ -0,0 +1,14 @@ + + +CSS Containment Test: Reference file + + +

    Test passes if it has the same output than the reference.

    +
    +
    This text should have 1em top and bottom margins.
    +
    diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-size-022-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-size-022-ref.html new file mode 100644 index 00000000000..3ca9ac9ee4d --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-size-022-ref.html @@ -0,0 +1,11 @@ + + + + + CSS Reference Test + + + +

    This test passes if the painted blue area is exactly as tall as the orange square. + +

    Image download support must be enabled Image download support must be enabled
    diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-size-064-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-size-064-ref.html new file mode 100644 index 00000000000..f8826e5c95c --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-size-064-ref.html @@ -0,0 +1,25 @@ + + + + test reference + + + +

    This test passes if there are two green rectangles and no red. + +

    +
     
    +
    +
     
    +
    +
    +
     
    +
    +
    diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-style-counters-002-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-style-counters-002-ref.html new file mode 100644 index 00000000000..7a14112c44c --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-style-counters-002-ref.html @@ -0,0 +1,18 @@ + + + + + CSS Reference Test + + + + + +

    Test passes if there is the number 14. + +

    14
    diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-style-counters-004-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-style-counters-004-ref.html new file mode 100644 index 00000000000..c362dbbf533 --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/contain-style-counters-004-ref.html @@ -0,0 +1,18 @@ + + + + + CSS Reference Test + + + + + +

    Test passes if there is the number 13. + +

    13
    diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/counter-scoping-001-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/counter-scoping-001-ref.html new file mode 100644 index 00000000000..cc721c49826 --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/counter-scoping-001-ref.html @@ -0,0 +1,8 @@ + + + + CSS-contain test reference + + +

    Test passes if the text below is "1 1.2" (not including the quotation marks).

    +

    1 1.2
    diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/counter-scoping-003-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/counter-scoping-003-ref.html new file mode 100644 index 00000000000..6ef3db7c89f --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/counter-scoping-003-ref.html @@ -0,0 +1,8 @@ + + + + CSS-contain test reference + + +

    Test passes if the text below is "1 2" (not including the quotation marks).

    +

    1 2
    diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/counter-scoping-004-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/counter-scoping-004-ref.html new file mode 100644 index 00000000000..f6d8e38fd5f --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/counter-scoping-004-ref.html @@ -0,0 +1,15 @@ + + +CSS Test Reference + +
    + [1] A1 +
    [1] B1
    +
    [2] B2
    +
    +
    [2] A2
    +
    [3] A3
    diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/pass_if_pass_below_clipped.html b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/pass_if_pass_below_clipped.html new file mode 100644 index 00000000000..044783d1e54 --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/reference/pass_if_pass_below_clipped.html @@ -0,0 +1,13 @@ + + + + Reference rendering - passes if there is the word "PASS" below + + + +

    Test passes if there is the word "PASS" below.

    +
    PASS
    + + diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/support/60x60-green.png b/Tests/LibWeb/Ref/expected/wpt-import/css/css-contain/support/60x60-green.png new file mode 100644 index 0000000000000000000000000000000000000000..3fdd0b8138c79dcd1fc539458061aebc0db083fa GIT binary patch literal 86 zcmeAS@N?(olHy`uVBq!ia0y~yV6XvUMrH;E1_mQ&cMJV!@xMj_P;4ey{D_6%Q~loCIDbD5G()y literal 0 HcmV?d00001 diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/reference/nothing.html b/Tests/LibWeb/Ref/expected/wpt-import/css/reference/nothing.html new file mode 100644 index 00000000000..98ee818a846 --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/reference/nothing.html @@ -0,0 +1,4 @@ + +CSS Reftest Reference + +

    There should be nothing below.

    diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/reference/pass_if_pass_below.html b/Tests/LibWeb/Ref/expected/wpt-import/css/reference/pass_if_pass_below.html new file mode 100644 index 00000000000..7de44825c06 --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/reference/pass_if_pass_below.html @@ -0,0 +1,11 @@ + + + + Reference rendering - passes if there is the word "PASS" below + + + +

    Test passes if there is the word "PASS" below.

    +
    PASS
    + + diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/support/swatch-blue.png b/Tests/LibWeb/Ref/expected/wpt-import/css/support/swatch-blue.png new file mode 100644 index 0000000000000000000000000000000000000000..1ab9b4e84f8141f21e7fe858074b7895ca10689a GIT binary patch literal 83 zcmeAS@N?(olHy`uVBq!ia0y~yVBiN~MrH;E21W^XP6h@B<^Z1%R|bavT@{zY85kJ2 kJzX3_IAoI*SQ!`?bQu_XI}W^JU|?YIboFyt=akR{00mVKL;wH) literal 0 HcmV?d00001 diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/support/swatch-orange.png b/Tests/LibWeb/Ref/expected/wpt-import/css/support/swatch-orange.png new file mode 100644 index 0000000000000000000000000000000000000000..db967b46e4dffd6c75473aa644cca0e580a1e264 GIT binary patch literal 83 zcmeAS@N?(olHy`uVBq!ia0y~yVBiN~MrH;E21W^XP6h@B<^Z1%*Z)fyPEB&0&A`CG k?djqe!XcZiz{mdKI;Vst03-Jg_5c6? literal 0 HcmV?d00001 diff --git a/Tests/LibWeb/Ref/input/wpt-import/common/reftest-wait.js b/Tests/LibWeb/Ref/input/wpt-import/common/reftest-wait.js new file mode 100644 index 00000000000..64fe9bfd7f5 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/common/reftest-wait.js @@ -0,0 +1,39 @@ +/** + * Remove the `reftest-wait` class on the document element. + * The reftest runner will wait with taking a screenshot while + * this class is present. + * + * See https://web-platform-tests.org/writing-tests/reftests.html#controlling-when-comparison-occurs + */ +function takeScreenshot() { + document.documentElement.classList.remove("reftest-wait"); +} + +/** + * Call `takeScreenshot()` after a delay of at least |timeout| milliseconds. + * @param {number} timeout - milliseconds + */ +function takeScreenshotDelayed(timeout) { + setTimeout(function() { + takeScreenshot(); + }, timeout); +} + +/** + * Ensure that a precondition is met before waiting for a screenshot. + * @param {bool} condition - Fail the test if this evaluates to false + * @param {string} msg - Error message to write to the screenshot + */ +function failIfNot(condition, msg) { + const fail = () => { + (document.body || document.documentElement).textContent = `Precondition Failed: ${msg}`; + takeScreenshot(); + }; + if (!condition) { + if (document.readyState == "interactive") { + fail(); + } else { + document.addEventListener("DOMContentLoaded", fail, false); + } + } +} diff --git a/Tests/LibWeb/Ref/input/wpt-import/common/rendering-utils.js b/Tests/LibWeb/Ref/input/wpt-import/common/rendering-utils.js new file mode 100644 index 00000000000..46283bd5d07 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/common/rendering-utils.js @@ -0,0 +1,19 @@ +"use strict"; + +/** + * Waits until we have at least one frame rendered, regardless of the engine. + * + * @returns {Promise} + */ +function waitForAtLeastOneFrame() { + return new Promise(resolve => { + // Different web engines work slightly different on this area but waiting + // for two requestAnimationFrames() to happen, one after another, should be + // sufficient to ensure at least one frame has been generated anywhere. + window.requestAnimationFrame(() => { + window.requestAnimationFrame(() => { + resolve(); + }); + }); + }); +} diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-body-overflow-001.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-body-overflow-001.html new file mode 100644 index 00000000000..6fbd566ab9f --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-body-overflow-001.html @@ -0,0 +1,26 @@ + + + + CSS-contain test: layout containment on body prevents overflow propagation + + + + + + + + +

    Test passes if there is no red. + +

    diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-body-overflow-003.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-body-overflow-003.html new file mode 100644 index 00000000000..e3921432650 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-body-overflow-003.html @@ -0,0 +1,26 @@ + + + + CSS-contain test: size containment on body prevents overflow propagation + + + + + + + + +

    Test passes if there is no red. + +

    diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-body-overflow-004.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-body-overflow-004.html new file mode 100644 index 00000000000..c353020034e --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-body-overflow-004.html @@ -0,0 +1,26 @@ + + + + CSS-contain test: style containment on body prevents overflow propagation + + + + + + + + +

    Test passes if there is no red. + +

    diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-content-001.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-content-001.html new file mode 100644 index 00000000000..a70d7a966d1 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-content-001.html @@ -0,0 +1,42 @@ + + + + + CSS Containment Test: a block with 'contain: content' alongside a float + + + + + + + + + +

    Test passes if the orange rectangle and blue rectangle do not overlap. + +

    Some text in a blue rectangle.
    + +
    Some text in an orange rectangle. Some text in an orange rectangle. Some text in an orange rectangle.
    diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-content-003.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-content-003.html new file mode 100644 index 00000000000..cf2f24a55e6 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-content-003.html @@ -0,0 +1,52 @@ + + + + + CSS Containment Test: element with 'contain: content' and absolutely positioned descendants + + + + + + + + + + + +

    Test passes if there is a filled green square and no red. + +

    +
    +
    +
    diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-content-004.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-content-004.html new file mode 100644 index 00000000000..31e115c24cd --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-content-004.html @@ -0,0 +1,62 @@ + + + + + CSS Containment Test: 'contain: content' applies to 'table-cell' elements + + + + + + + + + +

    Test passes if there is the word PASS and if there is no red. + + + +
       + +
     FAIL
    PASS
    + +
    diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-html-overflow-001.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-html-overflow-001.html new file mode 100644 index 00000000000..a2688040b2f --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-html-overflow-001.html @@ -0,0 +1,28 @@ + + + + CSS-contain test: layout containment on html prevents overflow propagation + + + + + + + + +

    Test passes if there is no red. + +

    diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-html-overflow-002.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-html-overflow-002.html new file mode 100644 index 00000000000..5f8843aa1da --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-html-overflow-002.html @@ -0,0 +1,29 @@ + + + + CSS-contain test: paint containment on html prevents overflow propagation + + + + + + + + +

    Test passes if there is no red. + +

    diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-html-overflow-003.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-html-overflow-003.html new file mode 100644 index 00000000000..0ec59832c32 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-html-overflow-003.html @@ -0,0 +1,28 @@ + + + + CSS-contain test: size containment on html prevents overflow propagation + + + + + + + + +

    Test passes if there is no red. + +

    diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-html-overflow-004.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-html-overflow-004.html new file mode 100644 index 00000000000..c1ce1afe9a9 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-html-overflow-004.html @@ -0,0 +1,28 @@ + + + + CSS-contain test: style containment on html prevents overflow propagation + + + + + + + + +

    Test passes if there is no red. + +

    diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-inline-size-grid-stretches-auto-rows.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-inline-size-grid-stretches-auto-rows.html new file mode 100644 index 00000000000..1c5f344efce --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-inline-size-grid-stretches-auto-rows.html @@ -0,0 +1,35 @@ + + + + + + + + + + +

    Test passes if there is a filled green square.

    + +
    +
    +
    + + diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-inline-size-table.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-inline-size-table.html new file mode 100644 index 00000000000..80091133dd7 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-inline-size-table.html @@ -0,0 +1,14 @@ + +contain:inline-size on table + + + + +

    Test passes if there is a filled green square and no red.

    + +
    +
    +
    +
    +
    diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-001.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-001.html new file mode 100644 index 00000000000..24aebb7ac32 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-001.html @@ -0,0 +1,23 @@ + + + + CSS-contain test: layout containment on non-atomic inlines + + + + + + + + +

    Test passes if there is the word "PASS" below.

    +
    PASS
    diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-006.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-006.html new file mode 100644 index 00000000000..2e788f67a4f --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-006.html @@ -0,0 +1,28 @@ + + +CSS Containment Test: Layout containment absolutely positioned descendants + + + + + +

    Test passes if there is a filled green square and no red.

    +
    +
    +
    diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-014.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-014.html new file mode 100644 index 00000000000..51777e8984c --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-014.html @@ -0,0 +1,30 @@ + + +CSS Containment Test: Layout containment on table-caption + + + + + + + +

    Test passes if there is a filled green square and no red.

    +
    +
    +
    diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-016.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-016.html new file mode 100644 index 00000000000..7ccc371ee2d --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-016.html @@ -0,0 +1,20 @@ + + +CSS Containment Test: Layout containment stacking context + + + + + + +

    Test passes if there is the word "PASS" below.

    +
    PASS
    diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-017.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-017.html new file mode 100644 index 00000000000..6f718f9f99e --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-017.html @@ -0,0 +1,22 @@ + + +CSS Containment Test: Layout containment stacking context + + + + + + +

    There should be nothing below.

    +FAIL diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-019.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-019.html new file mode 100644 index 00000000000..03ce4c3ef33 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-019.html @@ -0,0 +1,37 @@ + + +CSS Containment Test: Layout containment inside a fit-content element + + + + + +

    Test passes if there is a filled green square and no red.

    +
    +
    +
    +
    +
    + + diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-020.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-020.html new file mode 100644 index 00000000000..3bab564ba56 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-020.html @@ -0,0 +1,42 @@ + + + +CSS Containment Test: Removing layout containment and contained positioned elements + + + + + + +
    +
    +
    +
    + + diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-cell-001.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-cell-001.html new file mode 100644 index 00000000000..a39857a06f4 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-cell-001.html @@ -0,0 +1,68 @@ + + + + + CSS Containment Test: 'contain: layout' applies to 'table-cell' elements + + + + + + + + + +

    Test passes if there is the word PASS and if there is no red. + +

    + +
     
     
    + +
     
    FAIL
    PASS
    + +
    diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-cell-002.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-cell-002.html new file mode 100644 index 00000000000..4864d3c4ceb --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-cell-002.html @@ -0,0 +1,62 @@ + + + + + CSS Containment Test: 'contain: layout' applies to 'table-cell' elements + + + + + + + + + +

    Test passes if there is the word PASS and if there is no red. + + + +
       + +
     FAIL
    PASS
    + +
    diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-containing-block-absolute-001.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-containing-block-absolute-001.html new file mode 100644 index 00000000000..40106858979 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-containing-block-absolute-001.html @@ -0,0 +1,35 @@ + + + + + CSS Test: 'contain: layout' element should contain absolute position elements. + + + + + + + +

    +
    +
    +
    +
    + + diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-formatting-context-margin-001.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-formatting-context-margin-001.html new file mode 100644 index 00000000000..d9cc4f9469b --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-formatting-context-margin-001.html @@ -0,0 +1,37 @@ + + + + + CSS Test: 'contain: layout' with a vertical margin child. Margin collapse should not occur, and neither should overflow clipping. + + + + + + + +
    +
    +
    +
    + + diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-ifc-022.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-ifc-022.html new file mode 100644 index 00000000000..e22df1e34d5 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-ifc-022.html @@ -0,0 +1,53 @@ + + + + + CSS Containment Test: 'contain: layout' and creation of an independent formating context: text no longer flowing around a float + + + + + + + + + +

    Test passes if the orange rectangle and blue rectangle do not overlap. + + + +

    Some text in a blue rectangle.
    + +
    Some text in an orange rectangle. Some text in an orange rectangle. Some text in an orange rectangle.
    diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-ignored-cases-ib-split-001.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-ignored-cases-ib-split-001.html new file mode 100644 index 00000000000..078107a9eb5 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-ignored-cases-ib-split-001.html @@ -0,0 +1,77 @@ + + + + + CSS Test: 'contain: layout' should have no effect on non-atomic inline + (including its block part, if there's a block-in-inline split) + + + + + + + + +
    + + +
    +
    + +
    +
    +
    +
    +
    +
    + + diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-ignored-cases-no-principal-box-002.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-ignored-cases-no-principal-box-002.html new file mode 100644 index 00000000000..5afb457c4df --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-ignored-cases-no-principal-box-002.html @@ -0,0 +1,36 @@ + + + + + CSS Test: 'contain: layout' element should not contain absolute/fixed position elements when no principal box is generated. + + + + + + + +
    +
    +
    +
    +
    + + diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-ignored-cases-no-principal-box-003.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-ignored-cases-no-principal-box-003.html new file mode 100644 index 00000000000..0b0de98463c --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-ignored-cases-no-principal-box-003.html @@ -0,0 +1,36 @@ + + + + + CSS Test: 'contain: layout' element should not contain absolute/fixed position elements when no principal box is generated. + + + + + + + +
    +
    +
    +
    +
    + + diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-independent-formatting-context-001.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-independent-formatting-context-001.html new file mode 100644 index 00000000000..c485d9c2ed6 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-independent-formatting-context-001.html @@ -0,0 +1,19 @@ + + +CSS Containment Test: Layout containment independent formatting context + + + + + +

    Test passes if it has the same output than the reference.

    +
    +
    +
    This text should have 2em top and bottom margins (margins do not collapse).
    +
    +
    diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-independent-formatting-context-002.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-independent-formatting-context-002.html new file mode 100644 index 00000000000..2f2d09dbe97 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-independent-formatting-context-002.html @@ -0,0 +1,19 @@ + + +CSS Containment Test: Layout containment independent formatting context + + + + + +

    Test passes if it has the same output than the reference.

    +
    + +
    This text should have 2em top and bottom margins (margins do not collapse).
    +
    +
    diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-ink-overflow-014.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-ink-overflow-014.html new file mode 100644 index 00000000000..b8429fefc48 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-ink-overflow-014.html @@ -0,0 +1,46 @@ + + + + + CSS Containment Test: 'contain: layout' and ink overflow + + + + + + + + + + + + + + +

    Test passes if there is no red. + +

    +
     
    FAIL
    +
    diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-ink-overflow-016.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-ink-overflow-016.html new file mode 100644 index 00000000000..64fdd51a791 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-ink-overflow-016.html @@ -0,0 +1,46 @@ + + + + + CSS Containment Test: 'contain: layout' and ink overflow + + + + + + + + + + + + + + +

    Test passes if there is no red. + +

    +
     
    FAIL
    +
    diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-ink-overflow-017.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-ink-overflow-017.html new file mode 100644 index 00000000000..b194ae00d27 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-ink-overflow-017.html @@ -0,0 +1,47 @@ + + + + + CSS Containment Test: 'contain: layout' and ink overflow + + + + + + + + + + + + + + +

    Test passes if there is no red. + +

    +

    FAIL
    +
    diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-stacking-context-001.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-stacking-context-001.html new file mode 100644 index 00000000000..e007d9b510b --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-layout-stacking-context-001.html @@ -0,0 +1,66 @@ + + + + + CSS Test: 'contain: layout' with stacking contents. Z-index is defined only for siblings and children. + + + + + + + + +
    +

    +
    + +
    +
    +

    +
    + +
    +
    +
    + +
    +

    +
    + + diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-002.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-002.html new file mode 100644 index 00000000000..7b041d94e2b --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-002.html @@ -0,0 +1,23 @@ + + + + CSS-contain test: paint containment on non-atomic inlines + + + + + + + + +

    Test passes if there is the word "PASS" below.

    +
    diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-009.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-009.html new file mode 100644 index 00000000000..1bb8c2dbe1d --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-009.html @@ -0,0 +1,28 @@ + + +CSS Containment Test: Paint containment absolutely positioned descendants + + + + + +

    Test passes if there is a filled green square and no red.

    +
    +
    +
    diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-011.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-011.html new file mode 100644 index 00000000000..84fe3d429e6 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-011.html @@ -0,0 +1,34 @@ + + +CSS Containment Test: Paint containment absolutely positioned descendants + + + + + +

    Test passes if there is a filled green square and no red.

    +
    + +
    +
    +
    diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-020.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-020.html new file mode 100644 index 00000000000..891aef39083 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-020.html @@ -0,0 +1,20 @@ + + +CSS Containment Test: Paint containment stacking context + + + + + + +

    Test passes if there is the word "PASS" below.

    +
    PASS
    diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-021.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-021.html new file mode 100644 index 00000000000..2099e07e8bd --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-021.html @@ -0,0 +1,22 @@ + + +CSS Containment Test: Paint containment stacking context + + + + + + +

    There should be nothing below.

    +FAIL diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-024.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-024.html new file mode 100644 index 00000000000..34128ad9d2e --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-024.html @@ -0,0 +1,49 @@ + + + + + CSS Containment Test: 'contain: paint' and absolutely positioned descendants + + + + + + + + + +

    Test passes if there is a filled green square and no red. + +

    + +
    + +
    + +
    + +
    diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-050.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-050.html new file mode 100644 index 00000000000..feaef50cda7 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-050.html @@ -0,0 +1,32 @@ + + +CSS Containment Test: Scrolling overflow works when paint is contained" + + + + + + + + + + +
    + + + + + diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-change-opacity.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-change-opacity.html new file mode 100644 index 00000000000..f5413129ed6 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-change-opacity.html @@ -0,0 +1,19 @@ + + + + + + +

    Test passes if there is a filled green square and no red.

    +
    +
    +
    +
    +
    + + diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-containing-block-absolute-001.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-containing-block-absolute-001.html new file mode 100644 index 00000000000..879e9032a4b --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-containing-block-absolute-001.html @@ -0,0 +1,34 @@ + + + + + CSS Test: 'contain: paint' element should contain absolute position elements. + + + + + + +
    +
    +
    +
    +
    + + diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-ignored-cases-ib-split-001.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-ignored-cases-ib-split-001.html new file mode 100644 index 00000000000..ceb89e5a246 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-ignored-cases-ib-split-001.html @@ -0,0 +1,77 @@ + + + + + CSS Test: 'contain: paint' should have no effect on non-atomic inline + (including its block part, if there's a block-in-inline split) + + + + + + + + +
    + + +
    +
    + +
    +
    +
    +
    +
    +
    + + diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-ignored-cases-no-principal-box-001.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-ignored-cases-no-principal-box-001.html new file mode 100644 index 00000000000..c671c5b413e --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-ignored-cases-no-principal-box-001.html @@ -0,0 +1,61 @@ + + + + + CSS Test: 'contain: paint' with 'display: contents'. + + + + + + + +
    + +
    +
    + +
    +
    + +
    + + diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-independent-formatting-context-001.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-independent-formatting-context-001.html new file mode 100644 index 00000000000..796b2a0cb11 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-independent-formatting-context-001.html @@ -0,0 +1,19 @@ + + +CSS Containment Test: Paint containment independent formatting context + + + + + +

    Test passes if it has the same output than the reference.

    +
    +
    +
    This text should have 2em top and bottom margins (margins do not collapse).
    +
    +
    diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-independent-formatting-context-002.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-independent-formatting-context-002.html new file mode 100644 index 00000000000..26d905babe8 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-independent-formatting-context-002.html @@ -0,0 +1,19 @@ + + +CSS Containment Test: Paint containment independent formatting context + + + + + +

    Test passes if it has the same output than the reference.

    +
    + +
    This text should have 2em top and bottom margins (margins do not collapse).
    +
    +
    diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-independent-formatting-context-003.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-independent-formatting-context-003.html new file mode 100644 index 00000000000..d8ad7ee75a0 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-independent-formatting-context-003.html @@ -0,0 +1,19 @@ + + +CSS Containment Test: Paint containment independent formatting context + + + + + +

    Test passes if it has the same output than the reference.

    +
    + +
    This text should have 1em top and bottom margins.
    +
    +
    diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-stacking-context-001a.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-stacking-context-001a.html new file mode 100644 index 00000000000..6d81aa9bd34 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-paint-stacking-context-001a.html @@ -0,0 +1,66 @@ + + + + + CSS Test: 'contain: paint' with stacking contents. Z-index is defined only for siblings and children. + + + + + + + + +
    +

    +
    + +
    +
    +

    +
    + +
    +
    +
    + +
    +

    +
    + + diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-001.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-001.html new file mode 100644 index 00000000000..251dc4c474c --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-001.html @@ -0,0 +1,17 @@ + + + + CSS-contain test: size containment on non-atomic inlines + + + + + + + + +

    Test passes if there is the word "PASS" below.

    +
    PASS
    diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-007.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-007.html new file mode 100644 index 00000000000..8504c927aa8 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-007.html @@ -0,0 +1,21 @@ + + +CSS Containment Test: Size containment on table-row-group + + + + + + +

    Test passes if there is the word "PASS" below.

    +
    +
    PASS
    +
    diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-008.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-008.html new file mode 100644 index 00000000000..ef49974e410 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-008.html @@ -0,0 +1,21 @@ + + +CSS Containment Test: Size containment on table-header-group + + + + + + +

    Test passes if there is the word "PASS" below.

    +
    +
    PASS
    +
    diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-009.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-009.html new file mode 100644 index 00000000000..9402a556dbf --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-009.html @@ -0,0 +1,21 @@ + + +CSS Containment Test: Size containment on table-footer-group + + + + + + +

    Test passes if there is the word "PASS" below.

    +
    +
    PASS
    +
    diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-010.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-010.html new file mode 100644 index 00000000000..5d343c7963f --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-010.html @@ -0,0 +1,21 @@ + + +CSS Containment Test: Size containment on table-row + + + + + + +

    Test passes if there is the word "PASS" below.

    +
    +
    PASS
    +
    diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-012.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-012.html new file mode 100644 index 00000000000..d36633f5073 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-012.html @@ -0,0 +1,17 @@ + + +CSS Containment Test: Size containment on display:table + + + + + + +

    Test passes if there is the word "PASS" below.

    +
    PASS
    diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-012b.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-012b.html new file mode 100644 index 00000000000..3a4c9d63439 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-012b.html @@ -0,0 +1,18 @@ + + +CSS Containment Test: Size containment on display:inline-table + + + + + + + +

    Test passes if there is the word "PASS" below.

    +
    PASS
    diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-013.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-013.html new file mode 100644 index 00000000000..00c3f9c9a03 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-013.html @@ -0,0 +1,17 @@ + + +CSS Containment Test: Size containment replaced elements intrinsic size + + + + + + +

    Test passes if there is a filled green square and no red.

    +Image download support must be enabled diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-064.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-064.html new file mode 100644 index 00000000000..7b144954a45 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-064.html @@ -0,0 +1,36 @@ + + + + CSS-contain test: size containment: layout in place + + + + + + + + +

    This test passes if there are two green rectangles and no red. + +

    +
     
    +
    +
    + +
    +
    +
     
    +
    +
    +
    +
    diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-replaced-001.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-replaced-001.html new file mode 100644 index 00000000000..d74665ffbd6 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-replaced-001.html @@ -0,0 +1,17 @@ + + +CSS Containment Test: Size containment replaced elements intrinsic size + + + + + +

    Test passes if there is a filled green square and no red.

    + + diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-replaced-002.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-replaced-002.html new file mode 100644 index 00000000000..7fe78e9eeaf --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-replaced-002.html @@ -0,0 +1,18 @@ + + +CSS Containment Test: Size containment replaced elements intrinsic size + + + + + +

    Test passes if there is a filled green square and no red.

    + + + diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-replaced-004.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-replaced-004.html new file mode 100644 index 00000000000..2ad8c5c602f --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-replaced-004.html @@ -0,0 +1,28 @@ + + +CSS Containment Test: Size containment replaced elements intrinsic size + + + + +
    abc
    +
    +
    +
    + + + +
    +
    +
    + diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-replaced-005.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-replaced-005.html new file mode 100644 index 00000000000..8c4ff3a8e8c --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-replaced-005.html @@ -0,0 +1,29 @@ + + +CSS Containment Test: Size containment replaced elements intrinsic size + + + + +
    abc
    +
    +
    +
    + + + +
    +
    +
    + diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-replaced-006.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-replaced-006.html new file mode 100644 index 00000000000..88d9c227c5a --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-replaced-006.html @@ -0,0 +1,30 @@ + + +CSS Containment Test: Size containment replaced elements intrinsic size + + + + +
    abc
    +
    +
    +
    + + + +
    +
    +
    + diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-select-elem-003.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-select-elem-003.html new file mode 100644 index 00000000000..6ae5f1f7c6e --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-select-elem-003.html @@ -0,0 +1,44 @@ + + + + + CSS Test: 'contain: size' on select objects should cause them to be sized as if they have no contents. + + + + + + + +
    + + +
    + + + + diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-table-caption-001.html b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-table-caption-001.html new file mode 100644 index 00000000000..d3518e259fa --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/contain-size-table-caption-001.html @@ -0,0 +1,32 @@ + + + + + CSS Test: 'contain: size' on table captions should cause them to be sized as if they had no contents. + + + + + + + + +
    +
    + inner +
    +
    + + diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/support/60x60-green.png b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/support/60x60-green.png new file mode 100644 index 0000000000000000000000000000000000000000..3fdd0b8138c79dcd1fc539458061aebc0db083fa GIT binary patch literal 86 zcmeAS@N?(olHy`uVBq!ia0y~yV6XvUMrH;E1_mQ&cMJV!@xMj_P;4ey{D_6%Q~loCIDbD5G()y literal 0 HcmV?d00001 diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/support/blue-100x100.png b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/support/blue-100x100.png new file mode 100644 index 0000000000000000000000000000000000000000..f5d1aaec5cda9d929d5dc873409c735aff2be687 GIT binary patch literal 91 zcmeAS@N?(olHy`uVBq!ia0y~yU`PRBMrH;E1}`0UaRvqk<^Z1%R|bavT@{zY85kIZ sJzX3_BqWn1SQjUV^fU!JgflR(RxmK$ab=QbU|?YIboFyt=akR{0N#2MK>z>% literal 0 HcmV?d00001 diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/support/blue50wBy46h.png b/Tests/LibWeb/Ref/input/wpt-import/css/css-contain/support/blue50wBy46h.png new file mode 100644 index 0000000000000000000000000000000000000000..79e78b690e482b2b3d72abecbbe44c82f237be49 GIT binary patch literal 84 zcmeAS@N?(olHy`uVBq!ia0y~yU@&4}V9;Y^W?*0lczQ#Kfq{WJz$e6&f#H8w#ieit n1_mBa7sn6@$z%!E5>^Jr0tQCq**&5R3=9mOu6{1-oD!MmdKI;Vst03-Jg_5c6? literal 0 HcmV?d00001 diff --git a/Tests/LibWeb/Text/expected/css/CSSStyleDeclaration-all-supported-properties-and-default-values.txt b/Tests/LibWeb/Text/expected/css/CSSStyleDeclaration-all-supported-properties-and-default-values.txt index b9a5888a54c..9d75b2c2eb5 100644 --- a/Tests/LibWeb/Text/expected/css/CSSStyleDeclaration-all-supported-properties-and-default-values.txt +++ b/Tests/LibWeb/Text/expected/css/CSSStyleDeclaration-all-supported-properties-and-default-values.txt @@ -1,6 +1,6 @@ All supported properties and their default values exposed from CSSStyleDeclaration from getComputedStyle: 'cssText': '' -'length': '214' +'length': '215' 'parentRule': 'null' 'cssFloat': 'none' 'WebkitAlignContent': 'normal' @@ -261,6 +261,7 @@ All supported properties and their default values exposed from CSSStyleDeclarati 'columnWidth': 'auto' 'column-width': 'auto' 'columns': 'auto' +'contain': 'none' 'content': 'normal' 'contentVisibility': 'visible' 'content-visibility': 'visible' diff --git a/Tests/LibWeb/Text/expected/css/CSSStyleDeclaration-has-indexed-property-getter.txt b/Tests/LibWeb/Text/expected/css/CSSStyleDeclaration-has-indexed-property-getter.txt index 8c6069af5a2..e475fa85f01 100644 --- a/Tests/LibWeb/Text/expected/css/CSSStyleDeclaration-has-indexed-property-getter.txt +++ b/Tests/LibWeb/Text/expected/css/CSSStyleDeclaration-has-indexed-property-getter.txt @@ -110,110 +110,111 @@ All properties associated with getComputedStyle(document.body): "107": "column-gap", "108": "column-span", "109": "column-width", - "110": "content", - "111": "content-visibility", - "112": "counter-increment", - "113": "counter-reset", - "114": "counter-set", - "115": "cx", - "116": "cy", - "117": "display", - "118": "filter", - "119": "flex-basis", - "120": "flex-direction", - "121": "flex-grow", - "122": "flex-shrink", - "123": "flex-wrap", - "124": "float", - "125": "grid-auto-columns", - "126": "grid-auto-flow", - "127": "grid-auto-rows", - "128": "grid-column-end", - "129": "grid-column-start", - "130": "grid-row-end", - "131": "grid-row-start", - "132": "grid-template-areas", - "133": "grid-template-columns", - "134": "grid-template-rows", - "135": "height", - "136": "inline-size", - "137": "inset-block-end", - "138": "inset-block-start", - "139": "inset-inline-end", - "140": "inset-inline-start", - "141": "isolation", - "142": "justify-content", - "143": "justify-items", - "144": "justify-self", - "145": "left", - "146": "margin-block-end", - "147": "margin-block-start", - "148": "margin-bottom", - "149": "margin-inline-end", - "150": "margin-inline-start", - "151": "margin-left", - "152": "margin-right", - "153": "margin-top", - "154": "mask", - "155": "mask-image", - "156": "mask-type", - "157": "max-height", - "158": "max-inline-size", - "159": "max-width", - "160": "min-height", - "161": "min-inline-size", - "162": "min-width", - "163": "object-fit", - "164": "object-position", - "165": "opacity", - "166": "order", - "167": "outline-color", - "168": "outline-offset", - "169": "outline-style", - "170": "outline-width", - "171": "overflow-x", - "172": "overflow-y", - "173": "padding-block-end", - "174": "padding-block-start", - "175": "padding-bottom", - "176": "padding-inline-end", - "177": "padding-inline-start", - "178": "padding-left", - "179": "padding-right", - "180": "padding-top", - "181": "position", - "182": "r", - "183": "right", - "184": "rotate", - "185": "row-gap", - "186": "rx", - "187": "ry", - "188": "scale", - "189": "scrollbar-gutter", - "190": "scrollbar-width", - "191": "stop-color", - "192": "stop-opacity", - "193": "table-layout", - "194": "text-decoration-color", - "195": "text-decoration-style", - "196": "text-decoration-thickness", - "197": "text-overflow", - "198": "top", - "199": "transform", - "200": "transform-box", - "201": "transform-origin", - "202": "transition-delay", - "203": "transition-duration", - "204": "transition-property", - "205": "transition-timing-function", - "206": "translate", - "207": "unicode-bidi", - "208": "user-select", - "209": "vertical-align", - "210": "width", - "211": "x", - "212": "y", - "213": "z-index" + "110": "contain", + "111": "content", + "112": "content-visibility", + "113": "counter-increment", + "114": "counter-reset", + "115": "counter-set", + "116": "cx", + "117": "cy", + "118": "display", + "119": "filter", + "120": "flex-basis", + "121": "flex-direction", + "122": "flex-grow", + "123": "flex-shrink", + "124": "flex-wrap", + "125": "float", + "126": "grid-auto-columns", + "127": "grid-auto-flow", + "128": "grid-auto-rows", + "129": "grid-column-end", + "130": "grid-column-start", + "131": "grid-row-end", + "132": "grid-row-start", + "133": "grid-template-areas", + "134": "grid-template-columns", + "135": "grid-template-rows", + "136": "height", + "137": "inline-size", + "138": "inset-block-end", + "139": "inset-block-start", + "140": "inset-inline-end", + "141": "inset-inline-start", + "142": "isolation", + "143": "justify-content", + "144": "justify-items", + "145": "justify-self", + "146": "left", + "147": "margin-block-end", + "148": "margin-block-start", + "149": "margin-bottom", + "150": "margin-inline-end", + "151": "margin-inline-start", + "152": "margin-left", + "153": "margin-right", + "154": "margin-top", + "155": "mask", + "156": "mask-image", + "157": "mask-type", + "158": "max-height", + "159": "max-inline-size", + "160": "max-width", + "161": "min-height", + "162": "min-inline-size", + "163": "min-width", + "164": "object-fit", + "165": "object-position", + "166": "opacity", + "167": "order", + "168": "outline-color", + "169": "outline-offset", + "170": "outline-style", + "171": "outline-width", + "172": "overflow-x", + "173": "overflow-y", + "174": "padding-block-end", + "175": "padding-block-start", + "176": "padding-bottom", + "177": "padding-inline-end", + "178": "padding-inline-start", + "179": "padding-left", + "180": "padding-right", + "181": "padding-top", + "182": "position", + "183": "r", + "184": "right", + "185": "rotate", + "186": "row-gap", + "187": "rx", + "188": "ry", + "189": "scale", + "190": "scrollbar-gutter", + "191": "scrollbar-width", + "192": "stop-color", + "193": "stop-opacity", + "194": "table-layout", + "195": "text-decoration-color", + "196": "text-decoration-style", + "197": "text-decoration-thickness", + "198": "text-overflow", + "199": "top", + "200": "transform", + "201": "transform-box", + "202": "transform-origin", + "203": "transition-delay", + "204": "transition-duration", + "205": "transition-property", + "206": "transition-timing-function", + "207": "translate", + "208": "unicode-bidi", + "209": "user-select", + "210": "vertical-align", + "211": "width", + "212": "x", + "213": "y", + "214": "z-index" } All properties associated with document.body.style by default: {} diff --git a/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt b/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt index f14108f4fa8..e75ecc5b120 100644 --- a/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt +++ b/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt @@ -108,6 +108,7 @@ column-count: auto column-gap: normal column-span: none column-width: auto +contain: none content: normal content-visibility: visible counter-increment: none @@ -133,7 +134,7 @@ grid-row-start: auto grid-template-areas: none grid-template-columns: auto grid-template-rows: auto -height: 2295px +height: 2312px inline-size: auto inset-block-end: auto inset-block-start: auto diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-contain/contain-chrome-thcrash-001.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-contain/contain-chrome-thcrash-001.txt new file mode 100644 index 00000000000..fbb2ca6bed1 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-contain/contain-chrome-thcrash-001.txt @@ -0,0 +1,6 @@ +Harness status: OK + +Found 1 tests + +1 Pass +Pass chrome does not crash with contain \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-contain/contain-flexbox-outline.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-contain/contain-flexbox-outline.txt new file mode 100644 index 00000000000..24ec9aabb4e --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-contain/contain-flexbox-outline.txt @@ -0,0 +1,6 @@ +Harness status: OK + +Found 1 tests + +1 Pass +Pass Pass if no crash \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-contain/parsing/contain-computed-children.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-contain/parsing/contain-computed-children.txt new file mode 100644 index 00000000000..9c517907ae5 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-contain/parsing/contain-computed-children.txt @@ -0,0 +1,6 @@ +Harness status: OK + +Found 1 tests + +1 Pass +Pass computed contain value for children should ignore container contain value \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-contain/parsing/contain-computed.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-contain/parsing/contain-computed.txt new file mode 100644 index 00000000000..0c7b8c2998c --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-contain/parsing/contain-computed.txt @@ -0,0 +1,21 @@ +Harness status: OK + +Found 15 tests + +8 Pass +7 Fail +Pass Property contain value 'none' +Pass Property contain value 'strict' +Pass Property contain value 'content' +Pass Property contain value 'size' +Pass Property contain value 'layout' +Pass Property contain value 'style' +Pass Property contain value 'paint' +Fail Property contain value 'size layout' +Fail Property contain value 'style paint' +Fail Property contain value 'style layout paint' +Fail Property contain value 'size style layout paint' +Fail Property contain value 'size layout paint' +Fail Property contain value 'layout paint' +Pass Property contain value 'inline-size' +Fail Property contain value 'inline-size layout style paint' \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-contain/parsing/contain-invalid.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-contain/parsing/contain-invalid.txt new file mode 100644 index 00000000000..fbe5b7eabf1 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-contain/parsing/contain-invalid.txt @@ -0,0 +1,19 @@ +Harness status: OK + +Found 14 tests + +14 Pass +Pass e.style['contain'] = "auto" should not set the property value +Pass e.style['contain'] = "layout layout" should not set the property value +Pass e.style['contain'] = "strict layout" should not set the property value +Pass e.style['contain'] = "paint strict" should not set the property value +Pass e.style['contain'] = "paint layout style paint" should not set the property value +Pass e.style['contain'] = "none none" should not set the property value +Pass e.style['contain'] = "none strict" should not set the property value +Pass e.style['contain'] = "strict strict" should not set the property value +Pass e.style['contain'] = "strict none" should not set the property value +Pass e.style['contain'] = "strict content" should not set the property value +Pass e.style['contain'] = "size layout size" should not set the property value +Pass e.style['contain'] = "paint content" should not set the property value +Pass e.style['contain'] = "size inline-size" should not set the property value +Pass e.style['contain'] = "inline-size inline-size" should not set the property value \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-contain/parsing/contain-valid.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-contain/parsing/contain-valid.txt new file mode 100644 index 00000000000..dfd31da478e --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-contain/parsing/contain-valid.txt @@ -0,0 +1,19 @@ +Harness status: OK + +Found 13 tests + +8 Pass +5 Fail +Pass e.style['contain'] = "none" should set the property value +Pass e.style['contain'] = "strict" should set the property value +Pass e.style['contain'] = "content" should set the property value +Pass e.style['contain'] = "size" should set the property value +Pass e.style['contain'] = "layout" should set the property value +Pass e.style['contain'] = "style" should set the property value +Pass e.style['contain'] = "paint" should set the property value +Fail e.style['contain'] = "layout size" should set the property value +Fail e.style['contain'] = "paint style" should set the property value +Fail e.style['contain'] = "layout style paint" should set the property value +Fail e.style['contain'] = "layout paint style size" should set the property value +Pass e.style['contain'] = "inline-size" should set the property value +Fail e.style['contain'] = "layout inline-size" should set the property value \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-flexbox/flex-item-contains-strict.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-flexbox/flex-item-contains-strict.txt index b1d1e31eb9a..beff7d1060b 100644 --- a/Tests/LibWeb/Text/expected/wpt-import/css/css-flexbox/flex-item-contains-strict.txt +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-flexbox/flex-item-contains-strict.txt @@ -2,13 +2,12 @@ Harness status: OK Found 8 tests -4 Pass -4 Fail -Fail .inline-flex 1 -Fail .inline-flex 2 +8 Pass +Pass .inline-flex 1 +Pass .inline-flex 2 Pass .inline-flex 3 Pass .inline-flex 4 -Fail .inline-flex 5 -Fail .inline-flex 6 +Pass .inline-flex 5 +Pass .inline-flex 6 Pass .inline-flex 7 Pass .inline-flex 8 \ No newline at end of file diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-contain/contain-chrome-thcrash-001.html b/Tests/LibWeb/Text/input/wpt-import/css/css-contain/contain-chrome-thcrash-001.html new file mode 100644 index 00000000000..e3a913c76d9 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-contain/contain-chrome-thcrash-001.html @@ -0,0 +1,28 @@ + +CSS Overflow and Transforms: css-overflow-3 + + + + + + +text + diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-contain/contain-flexbox-outline.html b/Tests/LibWeb/Text/input/wpt-import/css/css-contain/contain-flexbox-outline.html new file mode 100644 index 00000000000..28c2950cf62 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-contain/contain-flexbox-outline.html @@ -0,0 +1,24 @@ + +Test `contain: strict` to Flexbox does not crash + + + + + +
    +
    + diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-contain/parsing/contain-computed-children.html b/Tests/LibWeb/Text/input/wpt-import/css/css-contain/parsing/contain-computed-children.html new file mode 100644 index 00000000000..83669074131 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-contain/parsing/contain-computed-children.html @@ -0,0 +1,17 @@ + + + +CSS Containment Module Level 1: getComputedStyle().contain + + +
    + + + diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-contain/parsing/contain-computed.html b/Tests/LibWeb/Text/input/wpt-import/css/css-contain/parsing/contain-computed.html new file mode 100644 index 00000000000..dc3f3013224 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-contain/parsing/contain-computed.html @@ -0,0 +1,33 @@ + + + + +CSS Containment Module Level 3: getComputedStyle().contain + + + + + + + +
    + + + diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-contain/parsing/contain-invalid.html b/Tests/LibWeb/Text/input/wpt-import/css/css-contain/parsing/contain-invalid.html new file mode 100644 index 00000000000..c62169313a5 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-contain/parsing/contain-invalid.html @@ -0,0 +1,30 @@ + + + + +CSS Containment Module Level 3: parsing contain with invalid values + + + + + + + + + + diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-contain/parsing/contain-valid.html b/Tests/LibWeb/Text/input/wpt-import/css/css-contain/parsing/contain-valid.html new file mode 100644 index 00000000000..533f75ef2fd --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-contain/parsing/contain-valid.html @@ -0,0 +1,32 @@ + + + + +CSS Containment Module Level 3: parsing contain with valid values + + + + + + + + + + +