Truly independent web browser
Tests/LibWeb: Import CSS zoom WPT tests
Andreas Kling15cd2a802c62
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/animations/zoom-interpolation.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/animations/zoom-interpolation.txtnew file mode 100644index 00000000000..ae4bd2a9a46--- /dev/null+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/animations/zoom-interpolation.txt@@ -0,0 +1,207 @@+Harness status: OK++Found 202 tests++202 Fail+Fail CSS Transitions: property <zoom> from neutral to [2] at (-0.3) should be [0.7]+Fail CSS Transitions: property <zoom> from neutral to [2] at (0) should be [1]+Fail CSS Transitions: property <zoom> from neutral to [2] at (0.3) should be [1.3]+Fail CSS Transitions: property <zoom> from neutral to [2] at (0.6) should be [1.6]+Fail CSS Transitions: property <zoom> from neutral to [2] at (1) should be [2]+Fail CSS Transitions: property <zoom> from neutral to [2] at (1.5) should be [2.5]+Fail CSS Transitions with transition: all: property <zoom> from neutral to [2] at (-0.3) should be [0.7]+Fail CSS Transitions with transition: all: property <zoom> from neutral to [2] at (0) should be [1]+Fail CSS Transitions with transition: all: property <zoom> from neutral to [2] at (0.3) should be [1.3]+Fail CSS Transitions with transition: all: property <zoom> from neutral to [2] at (0.6) should be [1.6]+Fail CSS Transitions with transition: all: property <zoom> from neutral to [2] at (1) should be [2]+Fail CSS Transitions with transition: all: property <zoom> from neutral to [2] at (1.5) should be [2.5]+Fail CSS Animations: property <zoom> from neutral to [2] at (-0.3) should be [0.7]+Fail CSS Animations: property <zoom> from neutral to [2] at (0) should be [1]+Fail CSS Animations: property <zoom> from neutral to [2] at (0.3) should be [1.3]+Fail CSS Animations: property <zoom> from neutral to [2] at (0.6) should be [1.6]+Fail CSS Animations: property <zoom> from neutral to [2] at (1) should be [2]+Fail CSS Animations: property <zoom> from neutral to [2] at (1.5) should be [2.5]+Fail Web Animations: property <zoom> from neutral to [2] at (-0.3) should be [0.7]+Fail Web Animations: property <zoom> from neutral to [2] at (0) should be [1]+Fail Web Animations: property <zoom> from neutral to [2] at (0.3) should be [1.3]+Fail Web Animations: property <zoom> from neutral to [2] at (0.6) should be [1.6]+Fail Web Animations: property <zoom> from neutral to [2] at (1) should be [2]+Fail Web Animations: property <zoom> from neutral to [2] at (1.5) should be [2.5]+Fail CSS Transitions: property <zoom> from [initial] to [2] at (-0.3) should be [0.7]+Fail CSS Transitions: property <zoom> from [initial] to [2] at (0) should be [1]+Fail CSS Transitions: property <zoom> from [initial] to [2] at (0.3) should be [1.3]+Fail CSS Transitions: property <zoom> from [initial] to [2] at (0.6) should be [1.6]+Fail CSS Transitions: property <zoom> from [initial] to [2] at (1) should be [2]+Fail CSS Transitions: property <zoom> from [initial] to [2] at (1.5) should be [2.5]+Fail CSS Transitions with transition: all: property <zoom> from [initial] to [2] at (-0.3) should be [0.7]+Fail CSS Transitions with transition: all: property <zoom> from [initial] to [2] at (0) should be [1]+Fail CSS Transitions with transition: all: property <zoom> from [initial] to [2] at (0.3) should be [1.3]+Fail CSS Transitions with transition: all: property <zoom> from [initial] to [2] at (0.6) should be [1.6]+Fail CSS Transitions with transition: all: property <zoom> from [initial] to [2] at (1) should be [2]+Fail CSS Transitions with transition: all: property <zoom> from [initial] to [2] at (1.5) should be [2.5]+Fail CSS Animations: property <zoom> from [initial] to [2] at (-0.3) should be [0.7]+Fail CSS Animations: property <zoom> from [initial] to [2] at (0) should be [1]+Fail CSS Animations: property <zoom> from [initial] to [2] at (0.3) should be [1.3]+Fail CSS Animations: property <zoom> from [initial] to [2] at (0.6) should be [1.6]+Fail CSS Animations: property <zoom> from [initial] to [2] at (1) should be [2]+Fail CSS Animations: property <zoom> from [initial] to [2] at (1.5) should be [2.5]+Fail Web Animations: property <zoom> from [initial] to [2] at (-0.3) should be [0.7]+Fail Web Animations: property <zoom> from [initial] to [2] at (0) should be [1]+Fail Web Animations: property <zoom> from [initial] to [2] at (0.3) should be [1.3]+Fail Web Animations: property <zoom> from [initial] to [2] at (0.6) should be [1.6]+Fail Web Animations: property <zoom> from [initial] to [2] at (1) should be [2]+Fail Web Animations: property <zoom> from [initial] to [2] at (1.5) should be [2.5]+Fail CSS Transitions: property <zoom> from [inherit] to [2] at (-0.3) should be [3.3]+Fail CSS Transitions: property <zoom> from [inherit] to [2] at (0) should be [3]+Fail CSS Transitions: property <zoom> from [inherit] to [2] at (0.3) should be [2.7]+Fail CSS Transitions: property <zoom> from [inherit] to [2] at (0.6) should be [2.4]+Fail CSS Transitions: property <zoom> from [inherit] to [2] at (1) should be [2]+Fail CSS Transitions: property <zoom> from [inherit] to [2] at (1.5) should be [1.5]+Fail CSS Transitions with transition: all: property <zoom> from [inherit] to [2] at (-0.3) should be [3.3]+Fail CSS Transitions with transition: all: property <zoom> from [inherit] to [2] at (0) should be [3]+Fail CSS Transitions with transition: all: property <zoom> from [inherit] to [2] at (0.3) should be [2.7]+Fail CSS Transitions with transition: all: property <zoom> from [inherit] to [2] at (0.6) should be [2.4]+Fail CSS Transitions with transition: all: property <zoom> from [inherit] to [2] at (1) should be [2]+Fail CSS Transitions with transition: all: property <zoom> from [inherit] to [2] at (1.5) should be [1.5]+Fail CSS Animations: property <zoom> from [inherit] to [2] at (-0.3) should be [3.3]+Fail CSS Animations: property <zoom> from [inherit] to [2] at (0) should be [3]+Fail CSS Animations: property <zoom> from [inherit] to [2] at (0.3) should be [2.7]+Fail CSS Animations: property <zoom> from [inherit] to [2] at (0.6) should be [2.4]+Fail CSS Animations: property <zoom> from [inherit] to [2] at (1) should be [2]+Fail CSS Animations: property <zoom> from [inherit] to [2] at (1.5) should be [1.5]+Fail Web Animations: property <zoom> from [inherit] to [2] at (-0.3) should be [3.3]+Fail Web Animations: property <zoom> from [inherit] to [2] at (0) should be [3]+Fail Web Animations: property <zoom> from [inherit] to [2] at (0.3) should be [2.7]+Fail Web Animations: property <zoom> from [inherit] to [2] at (0.6) should be [2.4]+Fail Web Animations: property <zoom> from [inherit] to [2] at (1) should be [2]+Fail Web Animations: property <zoom> from [inherit] to [2] at (1.5) should be [1.5]+Fail CSS Transitions: property <zoom> from [unset] to [2] at (-0.3) should be [0.7]+Fail CSS Transitions: property <zoom> from [unset] to [2] at (0) should be [1]+Fail CSS Transitions: property <zoom> from [unset] to [2] at (0.3) should be [1.3]+Fail CSS Transitions: property <zoom> from [unset] to [2] at (0.6) should be [1.6]+Fail CSS Transitions: property <zoom> from [unset] to [2] at (1) should be [2]+Fail CSS Transitions: property <zoom> from [unset] to [2] at (1.5) should be [2.5]+Fail CSS Transitions with transition: all: property <zoom> from [unset] to [2] at (-0.3) should be [0.7]+Fail CSS Transitions with transition: all: property <zoom> from [unset] to [2] at (0) should be [1]+Fail CSS Transitions with transition: all: property <zoom> from [unset] to [2] at (0.3) should be [1.3]+Fail CSS Transitions with transition: all: property <zoom> from [unset] to [2] at (0.6) should be [1.6]+Fail CSS Transitions with transition: all: property <zoom> from [unset] to [2] at (1) should be [2]+Fail CSS Transitions with transition: all: property <zoom> from [unset] to [2] at (1.5) should be [2.5]+Fail CSS Animations: property <zoom> from [unset] to [2] at (-0.3) should be [0.7]+Fail CSS Animations: property <zoom> from [unset] to [2] at (0) should be [1]+Fail CSS Animations: property <zoom> from [unset] to [2] at (0.3) should be [1.3]+Fail CSS Animations: property <zoom> from [unset] to [2] at (0.6) should be [1.6]+Fail CSS Animations: property <zoom> from [unset] to [2] at (1) should be [2]+Fail CSS Animations: property <zoom> from [unset] to [2] at (1.5) should be [2.5]+Fail Web Animations: property <zoom> from [unset] to [2] at (-0.3) should be [0.7]+Fail Web Animations: property <zoom> from [unset] to [2] at (0) should be [1]+Fail Web Animations: property <zoom> from [unset] to [2] at (0.3) should be [1.3]+Fail Web Animations: property <zoom> from [unset] to [2] at (0.6) should be [1.6]+Fail Web Animations: property <zoom> from [unset] to [2] at (1) should be [2]+Fail Web Animations: property <zoom> from [unset] to [2] at (1.5) should be [2.5]+Fail CSS Transitions: property <zoom> from [1] to [2] at (-5) should be [1]+Fail CSS Transitions: property <zoom> from [1] to [2] at (-0.3) should be [0.7]+Fail CSS Transitions: property <zoom> from [1] to [2] at (0) should be [1]+Fail CSS Transitions: property <zoom> from [1] to [2] at (0.3) should be [1.3]+Fail CSS Transitions: property <zoom> from [1] to [2] at (0.6) should be [1.6]+Fail CSS Transitions: property <zoom> from [1] to [2] at (1) should be [2]+Fail CSS Transitions: property <zoom> from [1] to [2] at (1.5) should be [2.5]+Fail CSS Transitions with transition: all: property <zoom> from [1] to [2] at (-5) should be [1]+Fail CSS Transitions with transition: all: property <zoom> from [1] to [2] at (-0.3) should be [0.7]+Fail CSS Transitions with transition: all: property <zoom> from [1] to [2] at (0) should be [1]+Fail CSS Transitions with transition: all: property <zoom> from [1] to [2] at (0.3) should be [1.3]+Fail CSS Transitions with transition: all: property <zoom> from [1] to [2] at (0.6) should be [1.6]+Fail CSS Transitions with transition: all: property <zoom> from [1] to [2] at (1) should be [2]+Fail CSS Transitions with transition: all: property <zoom> from [1] to [2] at (1.5) should be [2.5]+Fail CSS Animations: property <zoom> from [1] to [2] at (-5) should be [1]+Fail CSS Animations: property <zoom> from [1] to [2] at (-0.3) should be [0.7]+Fail CSS Animations: property <zoom> from [1] to [2] at (0) should be [1]+Fail CSS Animations: property <zoom> from [1] to [2] at (0.3) should be [1.3]+Fail CSS Animations: property <zoom> from [1] to [2] at (0.6) should be [1.6]+Fail CSS Animations: property <zoom> from [1] to [2] at (1) should be [2]+Fail CSS Animations: property <zoom> from [1] to [2] at (1.5) should be [2.5]+Fail Web Animations: property <zoom> from [1] to [2] at (-5) should be [1]+Fail Web Animations: property <zoom> from [1] to [2] at (-0.3) should be [0.7]+Fail Web Animations: property <zoom> from [1] to [2] at (0) should be [1]+Fail Web Animations: property <zoom> from [1] to [2] at (0.3) should be [1.3]+Fail Web Animations: property <zoom> from [1] to [2] at (0.6) should be [1.6]+Fail Web Animations: property <zoom> from [1] to [2] at (1) should be [2]+Fail Web Animations: property <zoom> from [1] to [2] at (1.5) should be [2.5]+Fail CSS Transitions: property <zoom> from [0.5] to [1.5] at (-5) should be [1]+Fail CSS Transitions: property <zoom> from [0.5] to [1.5] at (-0.3) should be [0.2]+Fail CSS Transitions: property <zoom> from [0.5] to [1.5] at (0) should be [0.5]+Fail CSS Transitions: property <zoom> from [0.5] to [1.5] at (0.5) should be [1]+Fail CSS Transitions: property <zoom> from [0.5] to [1.5] at (1) should be [1.5]+Fail CSS Transitions: property <zoom> from [0.5] to [1.5] at (1.5) should be [2]+Fail CSS Transitions with transition: all: property <zoom> from [0.5] to [1.5] at (-5) should be [1]+Fail CSS Transitions with transition: all: property <zoom> from [0.5] to [1.5] at (-0.3) should be [0.2]+Fail CSS Transitions with transition: all: property <zoom> from [0.5] to [1.5] at (0) should be [0.5]+Fail CSS Transitions with transition: all: property <zoom> from [0.5] to [1.5] at (0.5) should be [1]+Fail CSS Transitions with transition: all: property <zoom> from [0.5] to [1.5] at (1) should be [1.5]+Fail CSS Transitions with transition: all: property <zoom> from [0.5] to [1.5] at (1.5) should be [2]+Fail CSS Animations: property <zoom> from [0.5] to [1.5] at (-5) should be [1]+Fail CSS Animations: property <zoom> from [0.5] to [1.5] at (-0.3) should be [0.2]+Fail CSS Animations: property <zoom> from [0.5] to [1.5] at (0) should be [0.5]+Fail CSS Animations: property <zoom> from [0.5] to [1.5] at (0.5) should be [1]+Fail CSS Animations: property <zoom> from [0.5] to [1.5] at (1) should be [1.5]+Fail CSS Animations: property <zoom> from [0.5] to [1.5] at (1.5) should be [2]+Fail Web Animations: property <zoom> from [0.5] to [1.5] at (-5) should be [1]+Fail Web Animations: property <zoom> from [0.5] to [1.5] at (-0.3) should be [0.2]+Fail Web Animations: property <zoom> from [0.5] to [1.5] at (0) should be [0.5]+Fail Web Animations: property <zoom> from [0.5] to [1.5] at (0.5) should be [1]+Fail Web Animations: property <zoom> from [0.5] to [1.5] at (1) should be [1.5]+Fail Web Animations: property <zoom> from [0.5] to [1.5] at (1.5) should be [2]+Fail CSS Transitions: property <zoom> from [normal] to [3] at (-0.5) should be [1]+Fail CSS Transitions: property <zoom> from [normal] to [3] at (0) should be [1]+Fail CSS Transitions: property <zoom> from [normal] to [3] at (0.5) should be [2]+Fail CSS Transitions: property <zoom> from [normal] to [3] at (1) should be [3]+Fail CSS Transitions with transition: all: property <zoom> from [normal] to [3] at (-0.5) should be [1]+Fail CSS Transitions with transition: all: property <zoom> from [normal] to [3] at (0) should be [1]+Fail CSS Transitions with transition: all: property <zoom> from [normal] to [3] at (0.5) should be [2]+Fail CSS Transitions with transition: all: property <zoom> from [normal] to [3] at (1) should be [3]+Fail CSS Animations: property <zoom> from [normal] to [3] at (-0.5) should be [1]+Fail CSS Animations: property <zoom> from [normal] to [3] at (0) should be [1]+Fail CSS Animations: property <zoom> from [normal] to [3] at (0.5) should be [2]+Fail CSS Animations: property <zoom> from [normal] to [3] at (1) should be [3]+Fail Web Animations: property <zoom> from [normal] to [3] at (-0.5) should be [1]+Fail Web Animations: property <zoom> from [normal] to [3] at (0) should be [1]+Fail Web Animations: property <zoom> from [normal] to [3] at (0.5) should be [2]+Fail Web Animations: property <zoom> from [normal] to [3] at (1) should be [3]+Fail CSS Transitions: property <zoom> from [100%] to [300%] at (0) should be [1]+Fail CSS Transitions: property <zoom> from [100%] to [300%] at (0.5) should be [2]+Fail CSS Transitions: property <zoom> from [100%] to [300%] at (1) should be [3]+Fail CSS Transitions with transition: all: property <zoom> from [100%] to [300%] at (0) should be [1]+Fail CSS Transitions with transition: all: property <zoom> from [100%] to [300%] at (0.5) should be [2]+Fail CSS Transitions with transition: all: property <zoom> from [100%] to [300%] at (1) should be [3]+Fail CSS Animations: property <zoom> from [100%] to [300%] at (0) should be [1]+Fail CSS Animations: property <zoom> from [100%] to [300%] at (0.5) should be [2]+Fail CSS Animations: property <zoom> from [100%] to [300%] at (1) should be [3]+Fail Web Animations: property <zoom> from [100%] to [300%] at (0) should be [1]+Fail Web Animations: property <zoom> from [100%] to [300%] at (0.5) should be [2]+Fail Web Animations: property <zoom> from [100%] to [300%] at (1) should be [3]+Fail CSS Transitions: property <zoom> from [50%] to [2] at (0) should be [0.5]+Fail CSS Transitions: property <zoom> from [50%] to [2] at (0.5) should be [1.25]+Fail CSS Transitions: property <zoom> from [50%] to [2] at (1) should be [2]+Fail CSS Transitions with transition: all: property <zoom> from [50%] to [2] at (0) should be [0.5]+Fail CSS Transitions with transition: all: property <zoom> from [50%] to [2] at (0.5) should be [1.25]+Fail CSS Transitions with transition: all: property <zoom> from [50%] to [2] at (1) should be [2]+Fail CSS Animations: property <zoom> from [50%] to [2] at (0) should be [0.5]+Fail CSS Animations: property <zoom> from [50%] to [2] at (0.5) should be [1.25]+Fail CSS Animations: property <zoom> from [50%] to [2] at (1) should be [2]+Fail Web Animations: property <zoom> from [50%] to [2] at (0) should be [0.5]+Fail Web Animations: property <zoom> from [50%] to [2] at (0.5) should be [1.25]+Fail Web Animations: property <zoom> from [50%] to [2] at (1) should be [2]+Fail CSS Transitions: property <zoom> from [calc(sibling-index() * 100%)] to [2] at (0) should be [1]+Fail CSS Transitions: property <zoom> from [calc(sibling-index() * 100%)] to [2] at (0.5) should be [1.5]+Fail CSS Transitions: property <zoom> from [calc(sibling-index() * 100%)] to [2] at (1) should be [2]+Fail CSS Transitions with transition: all: property <zoom> from [calc(sibling-index() * 100%)] to [2] at (0) should be [1]+Fail CSS Transitions with transition: all: property <zoom> from [calc(sibling-index() * 100%)] to [2] at (0.5) should be [1.5]+Fail CSS Transitions with transition: all: property <zoom> from [calc(sibling-index() * 100%)] to [2] at (1) should be [2]+Fail CSS Animations: property <zoom> from [calc(sibling-index() * 100%)] to [2] at (0) should be [1]+Fail CSS Animations: property <zoom> from [calc(sibling-index() * 100%)] to [2] at (0.5) should be [1.5]+Fail CSS Animations: property <zoom> from [calc(sibling-index() * 100%)] to [2] at (1) should be [2]+Fail Web Animations: property <zoom> from [calc(sibling-index() * 100%)] to [2] at (0) should be [1]+Fail Web Animations: property <zoom> from [calc(sibling-index() * 100%)] to [2] at (0.5) should be [1.5]+Fail Web Animations: property <zoom> from [calc(sibling-index() * 100%)] to [2] at (1) should be [2]+Fail Animating zoom affects layout using the interpolated value+Fail transition: all animates zoom changes from :hover\ No newline at end of filediff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/computedStyle-zoom.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/computedStyle-zoom.txtnew file mode 100644index 00000000000..6f4c3027a47--- /dev/null+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/computedStyle-zoom.txt@@ -0,0 +1,12 @@+Harness status: OK++Found 6 tests++1 Pass+5 Fail+Pass getComputedStyle for elements with css zoom+Fail getComputedStyle for elements with css zoom 1+Fail getComputedStyle for elements with css zoom 2+Fail getComputedStyle for elements with css zoom 3+Fail getComputedStyle for elements with css zoom 4+Fail getComputedStyle for elements with css zoom 5\ No newline at end of filediff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/computed-border-width-keywords.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/computed-border-width-keywords.txtnew file mode 100644index 00000000000..ef61138b8ab--- /dev/null+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/computed-border-width-keywords.txt@@ -0,0 +1,8 @@+Harness status: OK++Found 3 tests++3 Pass+Pass border-width: thin+Pass border-width: medium+Pass border-width: thick\ No newline at end of filediff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/computed-column-rule-width-keywords.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/computed-column-rule-width-keywords.txtnew file mode 100644index 00000000000..905b15a301e--- /dev/null+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/computed-column-rule-width-keywords.txt@@ -0,0 +1,8 @@+Harness status: OK++Found 3 tests++3 Pass+Pass column-rule-width: thin+Pass column-rule-width: medium+Pass column-rule-width: thick\ No newline at end of filediff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/computed-initial.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/computed-initial.txtnew file mode 100644index 00000000000..83fbe0e3350--- /dev/null+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/computed-initial.txt@@ -0,0 +1,200 @@+Harness status: OK++Found 195 tests++195 Pass+Pass border-spacing+Pass font-size+Pass stroke-dashoffset+Pass stroke-width+Pass text-indent+Pass word-spacing+Pass baseline-shift+Pass border-block-end-width+Pass border-block-start-width+Pass border-bottom-left-radius+Pass border-bottom-right-radius+Pass border-bottom-width+Pass border-end-end-radius+Pass border-end-start-radius+Pass border-inline-end-width+Pass border-inline-start-width+Pass border-left-width+Pass border-right-width+Pass border-start-end-radius+Pass border-start-start-radius+Pass border-top-left-radius+Pass border-top-right-radius+Pass border-top-width+Pass column-rule-width+Pass cx+Pass cy+Pass margin-block-end+Pass margin-block-start+Pass margin-bottom+Pass margin-inline-end+Pass margin-inline-start+Pass margin-left+Pass margin-right+Pass margin-top+Pass offset-distance+Pass outline-offset+Pass outline-width+Pass overflow-clip-margin-block-end+Pass overflow-clip-margin-block-start+Pass overflow-clip-margin-bottom+Pass overflow-clip-margin-inline-end+Pass overflow-clip-margin-inline-start+Pass overflow-clip-margin-left+Pass overflow-clip-margin-right+Pass overflow-clip-margin-top+Pass padding-block-end+Pass padding-block-start+Pass padding-bottom+Pass padding-inline-end+Pass padding-inline-start+Pass padding-left+Pass padding-right+Pass padding-top+Pass r+Pass scroll-margin-block-end+Pass scroll-margin-block-start+Pass scroll-margin-bottom+Pass scroll-margin-inline-end+Pass scroll-margin-inline-start+Pass scroll-margin-left+Pass scroll-margin-right+Pass scroll-margin-top+Pass shape-margin+Pass x+Pass y+Pass border-spacing: initial;+Pass font-size: initial;+Pass stroke-dashoffset: initial;+Pass stroke-width: initial;+Pass text-indent: initial;+Pass word-spacing: initial;+Pass baseline-shift: initial;+Pass border-block-end-width: initial;+Pass border-block-start-width: initial;+Pass border-bottom-left-radius: initial;+Pass border-bottom-right-radius: initial;+Pass border-bottom-width: initial;+Pass border-end-end-radius: initial;+Pass border-end-start-radius: initial;+Pass border-inline-end-width: initial;+Pass border-inline-start-width: initial;+Pass border-left-width: initial;+Pass border-right-width: initial;+Pass border-start-end-radius: initial;+Pass border-start-start-radius: initial;+Pass border-top-left-radius: initial;+Pass border-top-right-radius: initial;+Pass border-top-width: initial;+Pass column-rule-width: initial;+Pass cx: initial;+Pass cy: initial;+Pass margin-block-end: initial;+Pass margin-block-start: initial;+Pass margin-bottom: initial;+Pass margin-inline-end: initial;+Pass margin-inline-start: initial;+Pass margin-left: initial;+Pass margin-right: initial;+Pass margin-top: initial;+Pass offset-distance: initial;+Pass outline-offset: initial;+Pass outline-width: initial;+Pass overflow-clip-margin-block-end: initial;+Pass overflow-clip-margin-block-start: initial;+Pass overflow-clip-margin-bottom: initial;+Pass overflow-clip-margin-inline-end: initial;+Pass overflow-clip-margin-inline-start: initial;+Pass overflow-clip-margin-left: initial;+Pass overflow-clip-margin-right: initial;+Pass overflow-clip-margin-top: initial;+Pass padding-block-end: initial;+Pass padding-block-start: initial;+Pass padding-bottom: initial;+Pass padding-inline-end: initial;+Pass padding-inline-start: initial;+Pass padding-left: initial;+Pass padding-right: initial;+Pass padding-top: initial;+Pass r: initial;+Pass scroll-margin-block-end: initial;+Pass scroll-margin-block-start: initial;+Pass scroll-margin-bottom: initial;+Pass scroll-margin-inline-end: initial;+Pass scroll-margin-inline-start: initial;+Pass scroll-margin-left: initial;+Pass scroll-margin-right: initial;+Pass scroll-margin-top: initial;+Pass shape-margin: initial;+Pass x: initial;+Pass y: initial;+Pass border-spacing (all: initial)+Pass font-size (all: initial)+Pass stroke-dashoffset (all: initial)+Pass stroke-width (all: initial)+Pass text-indent (all: initial)+Pass word-spacing (all: initial)+Pass baseline-shift (all: initial)+Pass border-block-end-width (all: initial)+Pass border-block-start-width (all: initial)+Pass border-bottom-left-radius (all: initial)+Pass border-bottom-right-radius (all: initial)+Pass border-bottom-width (all: initial)+Pass border-end-end-radius (all: initial)+Pass border-end-start-radius (all: initial)+Pass border-inline-end-width (all: initial)+Pass border-inline-start-width (all: initial)+Pass border-left-width (all: initial)+Pass border-right-width (all: initial)+Pass border-start-end-radius (all: initial)+Pass border-start-start-radius (all: initial)+Pass border-top-left-radius (all: initial)+Pass border-top-right-radius (all: initial)+Pass border-top-width (all: initial)+Pass column-rule-width (all: initial)+Pass cx (all: initial)+Pass cy (all: initial)+Pass margin-block-end (all: initial)+Pass margin-block-start (all: initial)+Pass margin-bottom (all: initial)+Pass margin-inline-end (all: initial)+Pass margin-inline-start (all: initial)+Pass margin-left (all: initial)+Pass margin-right (all: initial)+Pass margin-top (all: initial)+Pass offset-distance (all: initial)+Pass outline-offset (all: initial)+Pass outline-width (all: initial)+Pass overflow-clip-margin-block-end (all: initial)+Pass overflow-clip-margin-block-start (all: initial)+Pass overflow-clip-margin-bottom (all: initial)+Pass overflow-clip-margin-inline-end (all: initial)+Pass overflow-clip-margin-inline-start (all: initial)+Pass overflow-clip-margin-left (all: initial)+Pass overflow-clip-margin-right (all: initial)+Pass overflow-clip-margin-top (all: initial)+Pass padding-block-end (all: initial)+Pass padding-block-start (all: initial)+Pass padding-bottom (all: initial)+Pass padding-inline-end (all: initial)+Pass padding-inline-start (all: initial)+Pass padding-left (all: initial)+Pass padding-right (all: initial)+Pass padding-top (all: initial)+Pass r (all: initial)+Pass scroll-margin-block-end (all: initial)+Pass scroll-margin-block-start (all: initial)+Pass scroll-margin-bottom (all: initial)+Pass scroll-margin-inline-end (all: initial)+Pass scroll-margin-inline-start (all: initial)+Pass scroll-margin-left (all: initial)+Pass scroll-margin-right (all: initial)+Pass scroll-margin-top (all: initial)+Pass shape-margin (all: initial)+Pass x (all: initial)+Pass y (all: initial)\ No newline at end of filediff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/computed-outline-width-keywords.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/computed-outline-width-keywords.txtnew file mode 100644index 00000000000..925cea86679--- /dev/null+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/computed-outline-width-keywords.txt@@ -0,0 +1,8 @@+Harness status: OK++Found 3 tests++3 Pass+Pass outline-width: thin+Pass outline-width: medium+Pass outline-width: thick\ No newline at end of filediff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/explicit-inherit/all-length-properties.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/explicit-inherit/all-length-properties.txtnew file mode 100644index 00000000000..23cdb436018--- /dev/null+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/explicit-inherit/all-length-properties.txt@@ -0,0 +1,151 @@+Harness status: OK++Found 146 tests++146 Pass+Pass border-spacing: 10px; parent=10px; child=10px+Pass font-size: 10px; parent=10px; child=10px+Pass letter-spacing: 10px; parent=10px; child=10px+Pass line-height: 10px; parent=10px; child=10px+Pass list-style-image: linear-gradient(black 10px, white 20px); parent=linear-gradient(rgb(0, 0, 0) 10px, rgb(255, 255, 255) 20px); child=linear-gradient(rgb(0, 0, 0) 10px, rgb(255, 255, 255) 20px)+Pass stroke-dasharray: 10px; parent=10px; child=10px+Pass stroke-dashoffset: 10px; parent=10px; child=10px+Pass stroke-width: 10px; parent=10px; child=10px+Pass tab-size: 10px; parent=10px; child=10px+Pass text-indent: 10px; parent=10px; child=10px+Pass text-shadow: 10px 20px; parent=rgb(0, 0, 0) 10px 20px 0px; child=rgb(0, 0, 0) 10px 20px 0px+Pass text-underline-offset: 10px; parent=10px; child=10px+Pass word-spacing: 10px; parent=10px; child=10px+Pass animation-range-end: 10px; parent=10px; child=10px+Pass animation-range-start: 10px; parent=10px; child=10px+Pass backdrop-filter: blur(10px); parent=blur(10px); child=blur(10px)+Pass background-image: linear-gradient(black 10px, white 20px); parent=linear-gradient(rgb(0, 0, 0) 10px, rgb(255, 255, 255) 20px); child=linear-gradient(rgb(0, 0, 0) 10px, rgb(255, 255, 255) 20px)+Pass background-position-x: 10px; parent=10px; child=10px+Pass background-position-y: 10px; parent=10px; child=10px+Pass background-size: 10px; parent=10px auto; child=10px auto+Pass baseline-shift: 10px; parent=10px; child=10px+Pass block-size: 10px; parent=10px; child=10px+Pass border-block-end-width: 10px; parent=0px; child=0px+Pass border-block-start-width: 10px; parent=0px; child=0px+Pass border-bottom-left-radius: 10px; parent=10px; child=10px+Pass border-bottom-right-radius: 10px; parent=10px; child=10px+Pass border-bottom-width: 10px; parent=0px; child=0px+Pass border-end-end-radius: 10px; parent=10px; child=10px+Pass border-end-start-radius: 10px; parent=10px; child=10px+Pass border-image-outset: 10px; parent=10px; child=10px+Pass border-image-source: linear-gradient(black 10px, white 20px); parent=linear-gradient(rgb(0, 0, 0) 10px, rgb(255, 255, 255) 20px); child=linear-gradient(rgb(0, 0, 0) 10px, rgb(255, 255, 255) 20px)+Pass border-image-width: 10px; parent=10px; child=10px+Pass border-inline-end-width: 10px; parent=0px; child=0px+Pass border-inline-start-width: 10px; parent=0px; child=0px+Pass border-left-width: 10px; parent=0px; child=0px+Pass border-right-width: 10px; parent=0px; child=0px+Pass border-shape: inset(10px); parent=inset(10px); child=inset(10px)+Pass border-start-end-radius: 10px; parent=10px; child=10px+Pass border-start-start-radius: 10px; parent=10px; child=10px+Pass border-top-left-radius: 10px; parent=10px; child=10px+Pass border-top-right-radius: 10px; parent=10px; child=10px+Pass border-top-width: 10px; parent=0px; child=0px+Pass bottom: 10px; parent=10px; child=10px+Pass box-shadow: 10px 20px; parent=rgb(0, 0, 0) 10px 20px 0px 0px; child=rgb(0, 0, 0) 10px 20px 0px 0px+Pass clip: rect(10px 20px 30px 40px); parent=rect(10px, 20px, 30px, 40px); child=rect(10px, 20px, 30px, 40px)+Pass clip-path: inset(10px); parent=inset(10px); child=inset(10px)+Pass column-gap: 10px; parent=10px; child=10px+Pass column-height: 10px; parent=10px; child=10px+Pass column-rule-width: 10px; parent=10px; child=10px+Pass column-width: 10px; parent=10px; child=10px+Pass contain-intrinsic-block-size: 10px; parent=10px; child=10px+Pass contain-intrinsic-height: 10px; parent=10px; child=10px+Pass contain-intrinsic-inline-size: 10px; parent=10px; child=10px+Pass contain-intrinsic-width: 10px; parent=10px; child=10px+Pass content: linear-gradient(black 10px, white 20px); parent=linear-gradient(rgb(0, 0, 0) 10px, rgb(255, 255, 255) 20px); child=linear-gradient(rgb(0, 0, 0) 10px, rgb(255, 255, 255) 20px)+Pass cx: 10px; parent=10px; child=10px+Pass cy: 10px; parent=10px; child=10px+Pass filter: blur(10px); parent=blur(10px); child=blur(10px)+Pass flex-basis: 10px; parent=10px; child=10px+Pass grid-auto-columns: 10px; parent=10px; child=10px+Pass grid-auto-rows: 10px; parent=10px; child=10px+Pass grid-template-columns: 10px; parent=10px; child=10px+Pass grid-template-rows: 10px; parent=10px; child=10px+Pass height: 10px; parent=10px; child=10px+Pass inline-size: 10px; parent=10px; child=10px+Pass inset-block-end: 10px; parent=10px; child=10px+Pass inset-block-start: 10px; parent=10px; child=10px+Pass inset-inline-end: 10px; parent=10px; child=10px+Pass inset-inline-start: 10px; parent=10px; child=10px+Pass left: 10px; parent=10px; child=10px+Pass margin-block-end: 10px; parent=10px; child=10px+Pass margin-block-start: 10px; parent=10px; child=10px+Pass margin-bottom: 10px; parent=10px; child=10px+Pass margin-inline-end: 10px; parent=10px; child=10px+Pass margin-inline-start: 10px; parent=10px; child=10px+Pass margin-left: 10px; parent=10px; child=10px+Pass margin-right: 10px; parent=10px; child=10px+Pass margin-top: 10px; parent=10px; child=10px+Pass mask-image: linear-gradient(black 10px, white 20px); parent=linear-gradient(rgb(0, 0, 0) 10px, rgb(255, 255, 255) 20px); child=linear-gradient(rgb(0, 0, 0) 10px, rgb(255, 255, 255) 20px)+Pass mask-position: 10px; parent=10px 50%; child=10px 50%+Pass mask-size: 10px; parent=10px auto; child=10px auto+Pass max-block-size: 10px; parent=10px; child=10px+Pass max-height: 10px; parent=10px; child=10px+Pass max-inline-size: 10px; parent=10px; child=10px+Pass max-width: 10px; parent=10px; child=10px+Pass min-block-size: 10px; parent=10px; child=10px+Pass min-height: 10px; parent=10px; child=10px+Pass min-inline-size: 10px; parent=10px; child=10px+Pass min-width: 10px; parent=10px; child=10px+Pass object-position: 10px; parent=10px 50%; child=10px 50%+Pass offset-anchor: 10px; parent=10px 50%; child=10px 50%+Pass offset-distance: 10px; parent=10px; child=10px+Pass offset-path: inset(10px); parent=inset(10px); child=inset(10px)+Pass offset-position: 10px; parent=10px 50%; child=10px 50%+Pass outline-offset: 10px; parent=10px; child=10px+Pass outline-width: 10px; parent=10px; child=10px+Pass overflow-clip-margin-block-end: 10px; parent=10px; child=10px+Pass overflow-clip-margin-block-start: 10px; parent=10px; child=10px+Pass overflow-clip-margin-bottom: 10px; parent=10px; child=10px+Pass overflow-clip-margin-inline-end: 10px; parent=10px; child=10px+Pass overflow-clip-margin-inline-start: 10px; parent=10px; child=10px+Pass overflow-clip-margin-left: 10px; parent=10px; child=10px+Pass overflow-clip-margin-right: 10px; parent=10px; child=10px+Pass overflow-clip-margin-top: 10px; parent=10px; child=10px+Pass padding-block-end: 10px; parent=10px; child=10px+Pass padding-block-start: 10px; parent=10px; child=10px+Pass padding-bottom: 10px; parent=10px; child=10px+Pass padding-inline-end: 10px; parent=10px; child=10px+Pass padding-inline-start: 10px; parent=10px; child=10px+Pass padding-left: 10px; parent=10px; child=10px+Pass padding-right: 10px; parent=10px; child=10px+Pass padding-top: 10px; parent=10px; child=10px+Pass perspective: 10px; parent=10px; child=10px+Pass perspective-origin: 10px; parent=10px 0px; child=10px 0px+Pass r: 10px; parent=10px; child=10px+Pass right: 10px; parent=10px; child=10px+Pass row-gap: 10px; parent=10px; child=10px+Pass rx: 10px; parent=10px; child=10px+Pass ry: 10px; parent=10px; child=10px+Pass scroll-margin-block-end: 10px; parent=10px; child=10px+Pass scroll-margin-block-start: 10px; parent=10px; child=10px+Pass scroll-margin-bottom: 10px; parent=10px; child=10px+Pass scroll-margin-inline-end: 10px; parent=10px; child=10px+Pass scroll-margin-inline-start: 10px; parent=10px; child=10px+Pass scroll-margin-left: 10px; parent=10px; child=10px+Pass scroll-margin-right: 10px; parent=10px; child=10px+Pass scroll-margin-top: 10px; parent=10px; child=10px+Pass scroll-padding-block-end: 10px; parent=10px; child=10px+Pass scroll-padding-block-start: 10px; parent=10px; child=10px+Pass scroll-padding-bottom: 10px; parent=10px; child=10px+Pass scroll-padding-inline-end: 10px; parent=10px; child=10px+Pass scroll-padding-inline-start: 10px; parent=10px; child=10px+Pass scroll-padding-left: 10px; parent=10px; child=10px+Pass scroll-padding-right: 10px; parent=10px; child=10px+Pass scroll-padding-top: 10px; parent=10px; child=10px+Pass shape-margin: 10px; parent=10px; child=10px+Pass shape-outside: inset(10px); parent=inset(10px); child=inset(10px)+Pass text-decoration-thickness: 10px; parent=10px; child=10px+Pass top: 10px; parent=10px; child=10px+Pass transform-origin: 10px; parent=10px 0px; child=10px 0px+Pass translate: 10px; parent=10px; child=10px+Pass vertical-align: 10px; parent=10px; child=10px+Pass view-timeline-inset: 10px; parent=10px; child=10px+Pass width: 10px; parent=10px; child=10px+Pass x: 10px; parent=10px; child=10px+Pass y: 10px; parent=10px; child=10px\ No newline at end of filediff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/font-relative-units-with-zoom.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/font-relative-units-with-zoom.txtnew file mode 100644index 00000000000..3791c71926c--- /dev/null+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/font-relative-units-with-zoom.txt@@ -0,0 +1,12 @@+Harness status: OK++Found 7 tests++7 Pass+Pass ic equals em for letter-spacing under CSS zoom 1.5+Pass ic equals em for letter-spacing under CSS zoom 2+Pass ic equals em for line-height under CSS zoom 1.5+Pass cap font-size resolves to identical unzoomed value across CSS zoom levels+Pass ex font-size resolves to identical unzoomed value across CSS zoom levels+Pass ch font-size resolves to identical unzoomed value across CSS zoom levels+Pass ic font-size resolves to identical unzoomed value across CSS zoom levels\ No newline at end of filediff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/font-relative-units.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/font-relative-units.txtnew file mode 100644index 00000000000..a1a7fde1c3f--- /dev/null+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/font-relative-units.txt@@ -0,0 +1,11 @@+Harness status: OK++Found 6 tests++6 Pass+Pass em = rem+Pass lh = rlh+Pass ex = rex+Pass cap = rcap+Pass ch = rch+Pass ic = ric\ No newline at end of filediff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/font-size-keyword-system-font.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/font-size-keyword-system-font.txtnew file mode 100644index 00000000000..c6549051468--- /dev/null+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/font-size-keyword-system-font.txt@@ -0,0 +1,6 @@+Harness status: OK++Found 1 tests++1 Fail+Fail zoom scales font-size set via system font keyword\ No newline at end of filediff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/length-implicit-and-explicit-inheritance.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/length-implicit-and-explicit-inheritance.txtnew file mode 100644index 00000000000..2b1b932a9b8--- /dev/null+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/length-implicit-and-explicit-inheritance.txt@@ -0,0 +1,10 @@+Harness status: OK++Found 5 tests++5 Pass+Pass width: inherit from 100px+Pass height: inherit from 100px+Pass word-spacing: inherit from 100px+Pass word-spacing: unset from 100px+Pass word-spacing: from 100px\ No newline at end of filediff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/line-height-computed.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/line-height-computed.txtnew file mode 100644index 00000000000..4119fcc2b7b--- /dev/null+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/line-height-computed.txt@@ -0,0 +1,11 @@+Harness status: OK++Found 6 tests++6 Pass+Pass element with px line-height+Pass element with percentage line-height+Pass parent with px line-height+Pass parent with percentage line-height+Pass root with px line-height+Pass root with percentage line-height\ No newline at end of filediff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/matrix-zoom-anim-computed.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/matrix-zoom-anim-computed.txtnew file mode 100644index 00000000000..074b877407f--- /dev/null+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/matrix-zoom-anim-computed.txt@@ -0,0 +1,6 @@+Harness status: OK++Found 1 tests++1 Pass+Pass Zoom does not affect the computed transform matrix of an animated element\ No newline at end of filediff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/parsing/zoom-computed-with-sign-expression.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/parsing/zoom-computed-with-sign-expression.txtnew file mode 100644index 00000000000..40f5aa7bc15--- /dev/null+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/parsing/zoom-computed-with-sign-expression.txt@@ -0,0 +1,16 @@+Harness status: OK++Found 11 tests++11 Fail+Fail Property zoom value 'calc(1 + (sign(2cqw - 3cqw) * 0.5))'+Fail Property zoom value 'calc(1 + (sign(5px - 10px) * 0.5))'+Fail Property zoom value 'calc(1 + (sign(5 - 10) * 0.5))'+Fail Property zoom value 'calc(1 + (sign(30deg - 40deg) * 0.5))'+Fail Property zoom value 'calc(1 + (sign(3em - 5em) * 0.5))'+Fail Property zoom value 'calc(1 + (sign(1cm - 1in) * 0.5))'+Fail Property zoom value 'calc(1 + (sign(1deg - 1rad) * 0.5))'+Fail Property zoom value 'calc(1 + (sign(2cqw - 10px) * 0.5))'+Fail Property zoom value 'calc(100% + (sign(2cqw - 10px) * 50%))'+Fail Property zoom value 'calc(100% + (sign(1em - 30px) * 50%))'+Fail Property zoom value 'calc(100% + (sign(2cqw - 1em) * 50%))'\ No newline at end of filediff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/parsing/zoom-computed.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/parsing/zoom-computed.txtnew file mode 100644index 00000000000..a8345b05a99--- /dev/null+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/parsing/zoom-computed.txt@@ -0,0 +1,18 @@+Harness status: OK++Found 13 tests++13 Fail+Fail Property zoom value 'normal'+Fail Property zoom value '1'+Fail Property zoom value '1.5'+Fail Property zoom value '0.75'+Fail Property zoom value 'calc(1 - 0.5)'+Fail Property zoom value 'calc(1 * 0.5)'+Fail Property zoom value '100%'+Fail Property zoom value '150%'+Fail Property zoom value '75%'+Fail Property zoom value 'calc(100% - 50%)'+Fail Property zoom value 'calc(100% * 0.5)'+Fail Property zoom value '0'+Fail Property zoom value '0%'\ No newline at end of filediff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/parsing/zoom-valid.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/parsing/zoom-valid.txtnew file mode 100644index 00000000000..933d3add1e4--- /dev/null+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/parsing/zoom-valid.txt@@ -0,0 +1,22 @@+Harness status: OK++Found 16 tests++7 Pass+9 Fail+Fail e.style['zoom'] = "normal" should set the property value+Fail e.style['zoom'] = "1" should set the property value+Fail e.style['zoom'] = "100%" should set the property value+Fail e.style['zoom'] = "0" should set the property value+Fail e.style['zoom'] = "0%" should set the property value+Fail e.style['zoom'] = "1.5" should set the property value+Fail e.style['zoom'] = "150%" should set the property value+Fail e.style['zoom'] = "75%" should set the property value+Fail e.style['zoom'] = "0.5" should set the property value+Pass e.style['zoom'] = "auto" should not set the property value+Pass e.style['zoom'] = "reset" should not set the property value+Pass e.style['zoom'] = "document" should not set the property value+Pass e.style['zoom'] = "-100%" should not set the property value+Pass e.style['zoom'] = "-200%" should not set the property value+Pass e.style['zoom'] = "-1" should not set the property value+Pass e.style['zoom'] = "-2" should not set the property value\ No newline at end of filediff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/relative-units.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/relative-units.txtnew file mode 100644index 00000000000..8889386cf49--- /dev/null+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/relative-units.txt@@ -0,0 +1,11 @@+Harness status: OK++Found 6 tests++6 Fail+Fail relative-units+Fail relative-units 1+Fail relative-units 2+Fail relative-units 3+Fail relative-units 4+Fail relative-units 5\ No newline at end of filediff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/scroll-top-test-with-zoom.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/scroll-top-test-with-zoom.txtnew file mode 100644index 00000000000..ba13e064e6b--- /dev/null+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/scroll-top-test-with-zoom.txt@@ -0,0 +1,7 @@+Harness status: OK++Found 2 tests++2 Pass+Pass Initial scrollTop with no zoom+Pass scrollTop after resetting zoom\ No newline at end of filediff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/text-indent-computed.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/text-indent-computed.txtnew file mode 100644index 00000000000..cd01a9e2346--- /dev/null+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/text-indent-computed.txt@@ -0,0 +1,15 @@+Harness status: OK++Found 10 tests++10 Pass+Pass Property text-indent value '1px' single value no zoom+Pass Property text-indent value '1rem' rem value no zoom+Pass Property text-indent value 'inherit' inherit no zoom+Pass Property text-indent value '5px' explicit px value no zoom+Pass Property text-indent value '0' zero value no zoom+Pass Property text-indent value '1px' single value with zoom: 2+Pass Property text-indent value '1rem' rem value with zoom: 2+Pass Property text-indent value 'inherit' inherit with zoom: 2+Pass Property text-indent value '5px' explicit px value with zoom: 2+Pass Property text-indent value '0' zero value with zoom: 2\ No newline at end of filediff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/translate-zoom-anim-computed.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/translate-zoom-anim-computed.txtnew file mode 100644index 00000000000..d9de9daeab6--- /dev/null+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/translate-zoom-anim-computed.txt@@ -0,0 +1,7 @@+Harness status: OK++Found 2 tests++2 Pass+Pass Zoom does not affect the computed transform matrix of a translated animated element.+Pass Zoom does not affect the computed transform matrix of a translated animated element that uses mixed px/percentage values.\ No newline at end of filediff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/widget.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/widget.txtnew file mode 100644index 00000000000..82c682758d8--- /dev/null+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/widget.txt@@ -0,0 +1,7 @@+Harness status: OK++Found 2 tests++2 Fail+Fail checkbox+Fail radio\ No newline at end of filediff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/word-spacing-inherited-computed.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/word-spacing-inherited-computed.txtnew file mode 100644index 00000000000..90b4e117b06--- /dev/null+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/word-spacing-inherited-computed.txt@@ -0,0 +1,8 @@+Harness status: OK++Found 3 tests++3 Pass+Pass computed inherited word-spacing+Pass computed zoomed word-spacing+Pass computed zoomed inherited word-spacing\ No newline at end of filediff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/zoom-with-sign-function.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/zoom-with-sign-function.txtnew file mode 100644index 00000000000..c9705c9673a--- /dev/null+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-viewport/zoom/zoom-with-sign-function.txt@@ -0,0 +1,7 @@+Harness status: OK++Found 2 tests++2 Fail+Fail calc(sign(1em - 1px) * 2) should be used-value-equivalent to 2+Fail calc(sign(1em - 1px) * 2%) should be used-value-equivalent to 2%\ No newline at end of filediff --git a/Tests/LibWeb/Text/expected/wpt-import/css/cssom-view/Element-currentCSSZoom.txt b/Tests/LibWeb/Text/expected/wpt-import/css/cssom-view/Element-currentCSSZoom.txtnew file mode 100644index 00000000000..a90c3127a3a--- /dev/null+++ b/Tests/LibWeb/Text/expected/wpt-import/css/cssom-view/Element-currentCSSZoom.txt@@ -0,0 +1,7 @@+Harness status: OK++Found 2 tests++2 Fail+Fail Element.currentCSSZoom basic test+Fail Element.currentCSSZoom reacts to style changes\ No newline at end of filediff --git a/Tests/LibWeb/Text/expected/wpt-import/css/cssom-view/getBoundingClientRect-zoom.txt b/Tests/LibWeb/Text/expected/wpt-import/css/cssom-view/getBoundingClientRect-zoom.txtnew file mode 100644index 00000000000..f9493849533--- /dev/null+++ b/Tests/LibWeb/Text/expected/wpt-import/css/cssom-view/getBoundingClientRect-zoom.txt@@ -0,0 +1,11 @@+Harness status: OK++Found 5 tests++2 Pass+3 Fail+Pass getBoundingClientRect for elements with css zoom+Pass getBoundingClientRect for elements with css zoom 1+Fail getBoundingClientRect for elements with css zoom 2+Fail getBoundingClientRect for elements with css zoom 3+Fail getBoundingClientRect for elements with css zoom 4\ No newline at end of filediff --git a/Tests/LibWeb/Text/expected/wpt-import/css/cssom-view/getClientRects-zoom.txt b/Tests/LibWeb/Text/expected/wpt-import/css/cssom-view/getClientRects-zoom.txtnew file mode 100644index 00000000000..f9493849533--- /dev/null+++ b/Tests/LibWeb/Text/expected/wpt-import/css/cssom-view/getClientRects-zoom.txt@@ -0,0 +1,11 @@+Harness status: OK++Found 5 tests++2 Pass+3 Fail+Pass getBoundingClientRect for elements with css zoom+Pass getBoundingClientRect for elements with css zoom 1+Fail getBoundingClientRect for elements with css zoom 2+Fail getBoundingClientRect for elements with css zoom 3+Fail getBoundingClientRect for elements with css zoom 4\ No newline at end of filediff --git a/Tests/LibWeb/Text/expected/wpt-import/css/cssom-view/image-x-y-zoom.txt b/Tests/LibWeb/Text/expected/wpt-import/css/cssom-view/image-x-y-zoom.txtnew file mode 100644index 00000000000..10dc4912077--- /dev/null+++ b/Tests/LibWeb/Text/expected/wpt-import/css/cssom-view/image-x-y-zoom.txt@@ -0,0 +1,8 @@+Harness status: OK++Found 2 tests++1 Pass+1 Fail+Pass x and y properties for image elements with css zoom+Fail x and y properties for image elements with css zoom 1\ No newline at end of filediff --git a/Tests/LibWeb/Text/expected/wpt-import/css/cssom-view/offsetTop-offsetLeft-with-zoom.txt b/Tests/LibWeb/Text/expected/wpt-import/css/cssom-view/offsetTop-offsetLeft-with-zoom.txtnew file mode 100644index 00000000000..7e3a2439565--- /dev/null+++ b/Tests/LibWeb/Text/expected/wpt-import/css/cssom-view/offsetTop-offsetLeft-with-zoom.txt@@ -0,0 +1,8 @@+Harness status: OK++Found 2 tests++1 Pass+1 Fail+Fail Verifies that offsetTop and offsetLeft find the right OffsetParent and return values excluding the target zoom+Pass check that offset is equal between elements when one of them has css zoom\ No newline at end of filediff --git a/Tests/LibWeb/Text/expected/wpt-import/css/cssom-view/scroll-offsets-fractional-zoom.txt b/Tests/LibWeb/Text/expected/wpt-import/css/cssom-view/scroll-offsets-fractional-zoom.txtnew file mode 100644index 00000000000..7784ee19689--- /dev/null+++ b/Tests/LibWeb/Text/expected/wpt-import/css/cssom-view/scroll-offsets-fractional-zoom.txt@@ -0,0 +1,77 @@+Harness status: OK++Found 72 tests++72 Pass+Pass scrollLeft after scrollTo(0, 0) with 'zoom: 0.75'+Pass scrollTop after scrollTo(0, 0) with 'zoom: 0.75'+Pass scrollLeft after scrollTo(1, 2) with 'zoom: 0.75'+Pass scrollTop after scrollTo(1, 2) with 'zoom: 0.75'+Pass scrollLeft after scrollTo(13, 61) with 'zoom: 0.75'+Pass scrollTop after scrollTo(13, 61) with 'zoom: 0.75'+Pass scrollLeft after scrollTo(75, 100) with 'zoom: 0.75'+Pass scrollTop after scrollTo(75, 100) with 'zoom: 0.75'+Pass scrollLeft after scrollTo(0, 0) with 'zoom: 0.9'+Pass scrollTop after scrollTo(0, 0) with 'zoom: 0.9'+Pass scrollLeft after scrollTo(1, 2) with 'zoom: 0.9'+Pass scrollTop after scrollTo(1, 2) with 'zoom: 0.9'+Pass scrollLeft after scrollTo(13, 61) with 'zoom: 0.9'+Pass scrollTop after scrollTo(13, 61) with 'zoom: 0.9'+Pass scrollLeft after scrollTo(75, 100) with 'zoom: 0.9'+Pass scrollTop after scrollTo(75, 100) with 'zoom: 0.9'+Pass scrollLeft after scrollTo(0, 0) with 'zoom: 1'+Pass scrollTop after scrollTo(0, 0) with 'zoom: 1'+Pass scrollLeft after scrollTo(1, 2) with 'zoom: 1'+Pass scrollTop after scrollTo(1, 2) with 'zoom: 1'+Pass scrollLeft after scrollTo(13, 61) with 'zoom: 1'+Pass scrollTop after scrollTo(13, 61) with 'zoom: 1'+Pass scrollLeft after scrollTo(75, 100) with 'zoom: 1'+Pass scrollTop after scrollTo(75, 100) with 'zoom: 1'+Pass scrollLeft after scrollTo(0, 0) with 'zoom: 1.13'+Pass scrollTop after scrollTo(0, 0) with 'zoom: 1.13'+Pass scrollLeft after scrollTo(1, 2) with 'zoom: 1.13'+Pass scrollTop after scrollTo(1, 2) with 'zoom: 1.13'+Pass scrollLeft after scrollTo(13, 61) with 'zoom: 1.13'+Pass scrollTop after scrollTo(13, 61) with 'zoom: 1.13'+Pass scrollLeft after scrollTo(75, 100) with 'zoom: 1.13'+Pass scrollTop after scrollTo(75, 100) with 'zoom: 1.13'+Pass scrollLeft after scrollTo(0, 0) with 'zoom: 1.25'+Pass scrollTop after scrollTo(0, 0) with 'zoom: 1.25'+Pass scrollLeft after scrollTo(1, 2) with 'zoom: 1.25'+Pass scrollTop after scrollTo(1, 2) with 'zoom: 1.25'+Pass scrollLeft after scrollTo(13, 61) with 'zoom: 1.25'+Pass scrollTop after scrollTo(13, 61) with 'zoom: 1.25'+Pass scrollLeft after scrollTo(75, 100) with 'zoom: 1.25'+Pass scrollTop after scrollTo(75, 100) with 'zoom: 1.25'+Pass scrollLeft after scrollTo(0, 0) with 'zoom: 1.5'+Pass scrollTop after scrollTo(0, 0) with 'zoom: 1.5'+Pass scrollLeft after scrollTo(1, 2) with 'zoom: 1.5'+Pass scrollTop after scrollTo(1, 2) with 'zoom: 1.5'+Pass scrollLeft after scrollTo(13, 61) with 'zoom: 1.5'+Pass scrollTop after scrollTo(13, 61) with 'zoom: 1.5'+Pass scrollLeft after scrollTo(75, 100) with 'zoom: 1.5'+Pass scrollTop after scrollTo(75, 100) with 'zoom: 1.5'+Pass scrollLeft after scrollTo(0, 0) with 'zoom: 1.9'+Pass scrollTop after scrollTo(0, 0) with 'zoom: 1.9'+Pass scrollLeft after scrollTo(1, 2) with 'zoom: 1.9'+Pass scrollTop after scrollTo(1, 2) with 'zoom: 1.9'+Pass scrollLeft after scrollTo(13, 61) with 'zoom: 1.9'+Pass scrollTop after scrollTo(13, 61) with 'zoom: 1.9'+Pass scrollLeft after scrollTo(75, 100) with 'zoom: 1.9'+Pass scrollTop after scrollTo(75, 100) with 'zoom: 1.9'+Pass scrollLeft after scrollTo(0, 0) with 'zoom: 2'+Pass scrollTop after scrollTo(0, 0) with 'zoom: 2'+Pass scrollLeft after scrollTo(1, 2) with 'zoom: 2'+Pass scrollTop after scrollTo(1, 2) with 'zoom: 2'+Pass scrollLeft after scrollTo(13, 61) with 'zoom: 2'+Pass scrollTop after scrollTo(13, 61) with 'zoom: 2'+Pass scrollLeft after scrollTo(75, 100) with 'zoom: 2'+Pass scrollTop after scrollTo(75, 100) with 'zoom: 2'+Pass scrollLeft after scrollTo(0, 0) with 'zoom: 3.33'+Pass scrollTop after scrollTo(0, 0) with 'zoom: 3.33'+Pass scrollLeft after scrollTo(1, 2) with 'zoom: 3.33'+Pass scrollTop after scrollTo(1, 2) with 'zoom: 3.33'+Pass scrollLeft after scrollTo(13, 61) with 'zoom: 3.33'+Pass scrollTop after scrollTo(13, 61) with 'zoom: 3.33'+Pass scrollLeft after scrollTo(75, 100) with 'zoom: 3.33'+Pass scrollTop after scrollTo(75, 100) with 'zoom: 3.33'\ No newline at end of filediff --git a/Tests/LibWeb/Text/expected/wpt-import/css/cssom-view/scroll-zoom.txt b/Tests/LibWeb/Text/expected/wpt-import/css/cssom-view/scroll-zoom.txtnew file mode 100644index 00000000000..3d9f88d3bbd--- /dev/null+++ b/Tests/LibWeb/Text/expected/wpt-import/css/cssom-view/scroll-zoom.txt@@ -0,0 +1,9 @@+Harness status: OK++Found 3 tests++2 Pass+1 Fail+Pass scroll properties for elements with css zoom+Fail scroll{Width, Height}+Pass scroll{Top, Left}\ No newline at end of filediff --git a/Tests/LibWeb/Text/expected/wpt-import/css/cssom-view/scrollWidthHeight-not-scrollable-fractional-zoom.txt b/Tests/LibWeb/Text/expected/wpt-import/css/cssom-view/scrollWidthHeight-not-scrollable-fractional-zoom.txtnew file mode 100644index 00000000000..3d2da93c7e3--- /dev/null+++ b/Tests/LibWeb/Text/expected/wpt-import/css/cssom-view/scrollWidthHeight-not-scrollable-fractional-zoom.txt@@ -0,0 +1,10 @@+Harness status: OK++Found 5 tests++5 Pass+Pass scrollWidth equals clientWidth for a non-scrollable 203.2px box with 'zoom: 1.25'+Pass scrollWidth equals clientWidth for a non-scrollable 307.2px box with 'zoom: 1.25'+Pass scrollWidth equals clientWidth for a non-scrollable 202.30769231px box with 'zoom: 1.3'+Pass scrollWidth equals clientWidth for a non-scrollable 203.33333333px box with 'zoom: 1.5'+Pass scrollWidth equals clientWidth for a non-scrollable 202.66666667px box with 'zoom: 0.75'\ No newline at end of filediff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/animations/zoom-interpolation.html b/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/animations/zoom-interpolation.htmlnew file mode 100644index 00000000000..1ac850d8a69--- /dev/null+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/animations/zoom-interpolation.html@@ -0,0 +1,206 @@+<!DOCTYPE html>+<meta charset="UTF-8">+<title>zoom interpolation</title>+<link rel="help" href="https://drafts.csswg.org/css-viewport/#zoom-property">+<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/10872">+<meta name="assert" content="zoom is animated by computed value (number).">++<script src="../../../resources/testharness.js"></script>+<script src="../../../resources/testharnessreport.js"></script>+<script src="../../../resources/testdriver.js"></script>+<script src="../../../resources/testdriver-actions.js"></script>+<script src="../../../resources/testdriver-vendor.js"></script>+<script src="../../../css/support/interpolation-testcommon.js"></script>++<style>+.parent {+ zoom: 3;+}+.target {+ width: 10px;+ height: 10px;+ background: black;+ zoom: 1;+}+</style>++<body>+<template id="target-template">+ <div class="parent">+ <div class="target"></div>+ </div>+</template>+</body>++<script>+test_interpolation({+ property: 'zoom',+ from: neutralKeyframe,+ to: '2',+}, [+ {at: -0.3, expect: '0.7'},+ {at: 0, expect: '1'},+ {at: 0.3, expect: '1.3'},+ {at: 0.6, expect: '1.6'},+ {at: 1, expect: '2'},+ {at: 1.5, expect: '2.5'},+]);++test_interpolation({+ property: 'zoom',+ from: 'initial',+ to: '2',+}, [+ {at: -0.3, expect: '0.7'},+ {at: 0, expect: '1'},+ {at: 0.3, expect: '1.3'},+ {at: 0.6, expect: '1.6'},+ {at: 1, expect: '2'},+ {at: 1.5, expect: '2.5'},+]);++test_interpolation({+ property: 'zoom',+ from: 'inherit',+ to: '2',+}, [+ {at: -0.3, expect: '3.3'},+ {at: 0, expect: '3'},+ {at: 0.3, expect: '2.7'},+ {at: 0.6, expect: '2.4'},+ {at: 1, expect: '2'},+ {at: 1.5, expect: '1.5'},+]);++test_interpolation({+ property: 'zoom',+ from: 'unset',+ to: '2',+}, [+ {at: -0.3, expect: '0.7'},+ {at: 0, expect: '1'},+ {at: 0.3, expect: '1.3'},+ {at: 0.6, expect: '1.6'},+ {at: 1, expect: '2'},+ {at: 1.5, expect: '2.5'},+]);++test_interpolation({+ property: 'zoom',+ from: '1',+ to: '2',+}, [+ // at: -5 yields a raw value of -4; zoom is clamped to >= 0, and the legacy+ // `zoom: 0` -> 1 conversion then folds that to 1.+ {at: -5, expect: '1'},+ {at: -0.3, expect: '0.7'},+ {at: 0, expect: '1'},+ {at: 0.3, expect: '1.3'},+ {at: 0.6, expect: '1.6'},+ {at: 1, expect: '2'},+ {at: 1.5, expect: '2.5'},+]);++test_interpolation({+ property: 'zoom',+ from: '0.5',+ to: '1.5',+}, [+ {at: -5, expect: '1'},+ {at: -0.3, expect: '0.2'},+ {at: 0, expect: '0.5'},+ {at: 0.5, expect: '1'},+ {at: 1, expect: '1.5'},+ {at: 1.5, expect: '2'},+]);++test_interpolation({+ property: 'zoom',+ from: 'normal',+ to: '3',+}, [+ {at: -0.5, expect: '1'},+ {at: 0, expect: '1'},+ {at: 0.5, expect: '2'},+ {at: 1, expect: '3'},+]);++test_interpolation({+ property: 'zoom',+ from: '100%',+ to: '300%',+}, [+ {at: 0, expect: '1'},+ {at: 0.5, expect: '2'},+ {at: 1, expect: '3'},+]);++test_interpolation({+ property: 'zoom',+ from: '50%',+ to: '2',+}, [+ {at: 0, expect: '0.5'},+ {at: 0.5, expect: '1.25'},+ {at: 1, expect: '2'},+]);++// Element-dependent percentage: sibling-index() == 1 inside the test+// template, so calc(sibling-index() * 100%) resolves to 1. This exercises+// the TreeCountingChecker path in CSSZoomInterpolationType::MaybeConvertValue.+test_interpolation({+ property: 'zoom',+ from: 'calc(sibling-index() * 100%)',+ to: '2',+}, [+ {at: 0, expect: '1'},+ {at: 0.5, expect: '1.5'},+ {at: 1, expect: '2'},+]);++test(() => {+ const target = document.createElement('div');+ target.style.width = '10px';+ target.style.height = '10px';+ document.body.appendChild(target);++ const animation = target.animate(+ [{zoom: '1'}, {zoom: '2'}],+ {duration: 1000, fill: 'both'});+ animation.pause();+ animation.currentTime = 500;++ assert_approx_equals(parseFloat(getComputedStyle(target).zoom), 1.5, 0.01);+ assert_approx_equals(target.getBoundingClientRect().width, 15, 0.01);++ target.remove();+}, 'Animating zoom affects layout using the interpolated value');++promise_test(async () => {+ const target = document.createElement('div');+ target.id = 'hover-target';+ // 100s duration with -50s delay puts the transition at 50% progress on the+ // first frame after :hover takes effect, so the sample is deterministic.+ target.style.cssText = `+ width: 100px;+ height: 100px;+ transition: all 100s linear -50s;+ `;+ document.body.appendChild(target);++ const style = document.createElement('style');+ style.textContent = '#hover-target:hover { zoom: 2; }';+ document.head.appendChild(style);++ await new test_driver.Actions()+ .pointerMove(0, 0, {origin: target})+ .send();++ assert_true(target.matches(':hover'));+ assert_approx_equals(parseFloat(getComputedStyle(target).zoom), 1.5, 0.01);+ assert_approx_equals(target.getBoundingClientRect().width, 150, 1);++ target.remove();+ style.remove();+}, 'transition: all animates zoom changes from :hover');+</script>diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/computedStyle-zoom.html b/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/computedStyle-zoom.htmlnew file mode 100644index 00000000000..92c90b9154f--- /dev/null+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/computedStyle-zoom.html@@ -0,0 +1,83 @@+<!DOCTYPE html>+<title>getComputedStyle for elements with css zoom</title>+<link rel="author" title="Yotam Hacohen" href="mailto:[email protected]">+<link rel="author" title="Google" href="http://www.google.com/">+<link rel="help" href="https://drafts.csswg.org/css-viewport/">+<script src="../../resources/testharness.js"></script>+<script src="../../resources/testharnessreport.js"></script>+<style>+ div {+ width: 64px;+ height: 64px;+ font-size: 64px;+ line-height: 64px;+ text-indent: 64px;+ background-color: blue+ }+ div.x4_zoom {+ zoom: 4.0;+ background-color: blueviolet;+ }+ div.x2_zoom {+ background-color: chartreuse;+ zoom: 2.0;+ }+</style>+</head>+<body>+ <div id="no_zoom"></div>+ <div class="x4_zoom" id="with_zoom"></div>+ <div class="x2_zoom" id="parent_div">+ <div class="x4_zoom" id="nested_zoom"></div>+ </div>+ <div class="x2_zoom" id="testing_set_style"></div>+ <script>+ const LENGTH_PROPS = [+ "width",+ "height",+ "line-height",+ "text-indent",+ "font-size",+ ];+ test(function() {+ assert_true(!!no_zoom, "no zoom target exists");+ assert_true(!!with_zoom, "zoom target exists");+ assert_true(!!nested_zoom, "zoom target exists");+ assert_true(!!parent_div, "parent div with zoom exists")+ });+ function assert_length_props(style, expected) {+ for (let prop of LENGTH_PROPS) {+ assert_equals(style.getPropertyValue(prop), expected, prop);+ }+ }+ test(function(){+ let noZoomStyle = getComputedStyle(no_zoom);+ assert_length_props(noZoomStyle, "64px");+ assert_equals(noZoomStyle.getPropertyValue("zoom"), "1");+ });+ test(function(){+ let withZoomStyle = getComputedStyle(with_zoom);+ assert_length_props(withZoomStyle, "64px");+ assert_equals(withZoomStyle.getPropertyValue("zoom"), "4");+ });+ test(function(){+ let parentWithZoomStyle = getComputedStyle(parent_div);+ assert_length_props(parentWithZoomStyle, "64px");+ assert_equals(parentWithZoomStyle.getPropertyValue("zoom"), "2");+ });+ test(function(){+ nestedZoomStyle = getComputedStyle(nested_zoom);+ assert_length_props(nestedZoomStyle, "64px");+ assert_equals(nestedZoomStyle.getPropertyValue("zoom"), "4");+ });+ test(function(){+ testDivStyle = getComputedStyle(testing_set_style);+ testing_set_style.setAttribute("style", LENGTH_PROPS.map(p => p + ": 1px").join(";"));+ assert_length_props(testDivStyle, "1px");+ assert_equals(testDivStyle.getPropertyValue("zoom"), "2");+ testing_set_style.setAttribute("style", LENGTH_PROPS.map(p => p + ": 64px").join(";"));+ assert_length_props(testDivStyle, "64px");+ assert_equals(testDivStyle.getPropertyValue("zoom"), "2");+ });+ </script>+</body>diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/computed-border-width-keywords.html b/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/computed-border-width-keywords.htmlnew file mode 100644index 00000000000..fa42f6b7231--- /dev/null+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/computed-border-width-keywords.html@@ -0,0 +1,67 @@+<!DOCTYPE html>+<meta charset="utf-8">+<title>CSS-viewport test: border-width keyword values returned by getComputedStyle() are unscaled</title>+<link rel="author" title="Ibrahim Bendebka" href="https://github.com/sb3nder">+<meta name="assert" content="This test verifies that zoom does not scale border-width keyword values returned by getComputedStyle()">+<link rel="help" href="https://drafts.csswg.org/css-viewport/#zoom-om">+<script src='../../../resources/testharness.js'></script>+<script src='../../../resources/testharnessreport.js'></script>+<style>+ .thin, .medium, .thick {+ border-style: solid;++ width: 10px;+ height: 10px;+ margin: 5px;+ }++ .thin {+ border-width: thin;+ }++ .medium {+ border-width: medium;+ }++ .thick {+ border-width: thick;+ }++ .zoomed {+ zoom: 10;+ border-color: blue;+ }++ #container {+ /* needed for lengths snapped as a border width */+ zoom: calc(1 / var(--device-pixel-ratio, 1));+ }+</style>++<div id="container">+ <div class="thin"></div>+ <div class="medium"></div>+ <div class="thick"></div>++ <div class="thin zoomed"></div>+ <div class="medium zoomed"></div>+ <div class="thick zoomed"></div>+</div>++<script>+ container.style.setProperty('--device-pixel-ratio', window.devicePixelRatio);++ const keywords = ['thin', 'medium', 'thick'];+ const propSuffixes = ['width', 'top-width', 'right-width', 'bottom-width', 'left-width', 'inline-start-width', 'inline-end-width', 'block-start-width', 'block-end-width'];+ for (const keyword of keywords) {+ const cs = getComputedStyle(document.querySelector(`.${keyword}`));+ const csZoomed = getComputedStyle(document.querySelector(`.${keyword}.zoomed`));++ test(() => {+ for (const propSuffix of propSuffixes) {+ const prop = `border-${propSuffix}`;+ assert_equals(csZoomed[prop], cs[prop], `${prop}: ${keyword}`);+ }+ }, `border-width: ${keyword}`);+ }+</script>diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/computed-column-rule-width-keywords.html b/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/computed-column-rule-width-keywords.htmlnew file mode 100644index 00000000000..92f95994da2--- /dev/null+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/computed-column-rule-width-keywords.html@@ -0,0 +1,61 @@+<!DOCTYPE html>+<meta charset="utf-8">+<title>CSS-viewport test: column-rule-width keyword values returned by getComputedStyle() are unscaled</title>+<link rel="author" title="Ibrahim Bendebka" href="https://github.com/sb3nder">+<meta name="assert" content="This test verifies that zoom does not scale column-rule-width keyword values returned by getComputedStyle()">+<link rel="help" href="https://drafts.csswg.org/css-viewport/#zoom-om">+<script src='../../../resources/testharness.js'></script>+<script src='../../../resources/testharnessreport.js'></script>+<style>+ .thin, .medium, .thick {+ column-rule-style: solid;+ column-count: 2;+ max-width: min-content;+ }++ .thin {+ column-rule-width: thin;+ }++ .medium {+ column-rule-width: medium;+ }++ .thick {+ column-rule-width: thick;+ }++ .zoomed {+ zoom: 10;+ column-rule-color: blue;+ }++ #container {+ /* needed for lengths snapped as a border width */+ zoom: calc(1 / var(--device-pixel-ratio, 1));+ }+</style>++<div id="container">+ <div class="thin">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore</div>+ <div class="medium">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore</div>+ <div class="thick">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore</div>++ <div class="thin zoomed">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore</div>+ <div class="medium zoomed">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore</div>+ <div class="thick zoomed">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore</div>+</div>++<script>+ container.style.setProperty('--device-pixel-ratio', window.devicePixelRatio);++ const keywords = ['thin', 'medium', 'thick'];+ for (const keyword of keywords) {+ const cs = getComputedStyle(document.querySelector(`.${keyword}`));+ const csZoomed = getComputedStyle(document.querySelector(`.${keyword}.zoomed`));++ test(() => {+ assert_equals(csZoomed['column-rule-width'], cs['column-rule-width']);+ }, `column-rule-width: ${keyword}`);+ }+</script>diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/computed-initial.html b/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/computed-initial.htmlnew file mode 100644index 00000000000..732a6302df8--- /dev/null+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/computed-initial.html@@ -0,0 +1,127 @@+<!DOCTYPE html>++<meta charset="utf-8">+<title>CSS-viewport test: initial property values returned by getComputedStyle() are unscaled</title>+<link rel="author" title="Ibrahim Bendebka" href="https://github.com/sb3nder">+<meta name="assert" content="This test verifies that zoom does not scale values returned by getComputedStyle() when properties are at their initial values.">+<link rel="help" href="https://drafts.csswg.org/css-viewport/#zoom-om">+<script src="../../../resources/testharness.js"></script>+<script src="../../../resources/testharnessreport.js"></script>+<style>+ .initial {+ /* populated by script */+ }+</style>+<style>+ .all-initial {+ all: initial;+ }++ .zoomed {+ zoom: 10;+ }++ .none, .all-initial, .initial {+ /* allows testing border-related properties */+ border-style: solid;+ border-color: gray;+ }++ #container {+ /* needed for lengths snapped as a border width */+ zoom: calc(1 / var(--device-pixel-ratio, 1));+ }+</style>++<div id="container">+ <div class="none"></div>+ <div class="initial"></div>+ <div class="all-initial"></div>++ <div class="none zoomed"></div>+ <div class="initial zoomed"></div>+ <div class="all-initial zoomed"></div>++ <div class="zoomed">+ <div class="none"></div>+ <div class="initial"></div>+ <div class="all-initial"></div>+ </div>++ <div class="zoomed">+ <div class="none zoomed"></div>+ <div class="initial zoomed"></div>+ <div class="all-initial zoomed"></div>+ </div>+</div>++<script>+ container.style.setProperty('--device-pixel-ratio', window.devicePixelRatio);++ const excludedProps = [+ 'zoom',+ '--device-pixel-ratio',+ // exclude properties whose initial value is 'auto' or a percentage,+ // and which return the 'used value' in getComputedStyle().+ 'width', 'height',+ 'inline-size', 'block-size',+ 'top', 'left', 'bottom', 'right',+ 'inset-inline-start', 'inset-inline-end', 'inset-block-start', 'inset-block-end',+ 'transform-origin', 'perspective-origin',+ 'min-width', 'min-height',+ 'min-inline-size', 'min-block-size'+ ];++ function isExcludedProp(prop, value) {+ if (excludedProps.includes(prop)) return true;+ // skip non-length props+ if (!value.includes('px')) return true;+ return false;+ }++ function populateInitialClass() {+ const cs = getComputedStyle(document.querySelector('.none'));+ let style = '.initial {';+ for (let i = 0; i < cs.length; i++) {+ const prop = cs.item(i);+ const value = cs[prop];+ if (isExcludedProp(prop, value)) continue;++ style += prop + ': initial;';+ }+ style += '}';+ document.querySelector('style').innerHTML = style;+ }+ populateInitialClass();++ const testClasses = ['none', 'initial', 'all-initial'];+ const testNameSuffixes = ['', ': initial;', ' (all: initial)'];++ for (let t = 0; t < testClasses.length; t++) {+ const el = document.querySelector(`.${testClasses[t]}`);+ const elZoomed = document.querySelector(`.${testClasses[t]}.zoomed`);+ const elParentZoomed = document.querySelector(`.zoomed .${testClasses[t]}`);+ const elDoubleZoomed = document.querySelector(`.zoomed .${testClasses[t]}.zoomed`);++ const cs = getComputedStyle(el);+ const csZoomed = getComputedStyle(elZoomed);+ const csParentZoomed = getComputedStyle(elParentZoomed);+ const csDoubleZoomed = getComputedStyle(elDoubleZoomed);++ for (let i = 0; i < cs.length; i++) {+ const prop = cs.item(i);+ const value = cs[prop];+ const valueZoomed = csZoomed[prop];+ const valueParentZoomed = csParentZoomed[prop];+ const valueDoubleZoomed = csDoubleZoomed[prop];++ if (isExcludedProp(prop, value) && isExcludedProp(prop, valueZoomed)) continue;++ test(() => {+ assert_equals(valueZoomed, value);+ assert_equals(valueParentZoomed, value);+ assert_equals(valueDoubleZoomed, value);+ }, prop + testNameSuffixes[t]);+ }+ }+</script>diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/computed-outline-width-keywords.html b/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/computed-outline-width-keywords.htmlnew file mode 100644index 00000000000..e291cbd5cc1--- /dev/null+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/computed-outline-width-keywords.html@@ -0,0 +1,63 @@+<!DOCTYPE html>+<meta charset="utf-8">+<title>CSS-viewport test: outline-width keyword values returned by getComputedStyle() are unscaled</title>+<link rel="author" title="Ibrahim Bendebka" href="https://github.com/sb3nder">+<meta name="assert" content="This test verifies that zoom does not scale outline-width keyword values returned by getComputedStyle()">+<link rel="help" href="https://drafts.csswg.org/css-viewport/#zoom-om">+<script src='../../../resources/testharness.js'></script>+<script src='../../../resources/testharnessreport.js'></script>+<style>+ .thin, .medium, .thick {+ outline-style: solid;++ width: 10px;+ height: 10px;+ margin: 10px;+ }++ .thin {+ outline-width: thin;+ }++ .medium {+ outline-width: medium;+ }++ .thick {+ outline-width: thick;+ }++ .zoomed {+ zoom: 10;+ outline-color: blue;+ }++ #container {+ /* needed for lengths snapped as a border width */+ zoom: calc(1 / var(--device-pixel-ratio, 1));+ }+</style>++<div id="container">+ <div class="thin"></div>+ <div class="medium"></div>+ <div class="thick"></div>++ <div class="thin zoomed"></div>+ <div class="medium zoomed"></div>+ <div class="thick zoomed"></div>+</div>++<script>+ container.style.setProperty('--device-pixel-ratio', window.devicePixelRatio);++ const keywords = ['thin', 'medium', 'thick'];+ for (const keyword of keywords) {+ const cs = getComputedStyle(document.querySelector(`.${keyword}`));+ const csZoomed = getComputedStyle(document.querySelector(`.${keyword}.zoomed`));++ test(() => {+ assert_equals(csZoomed['outline-width'], cs['outline-width']);+ }, `outline-width: ${keyword}`);+ }+</script>diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/explicit-inherit/all-length-properties.html b/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/explicit-inherit/all-length-properties.htmlnew file mode 100644index 00000000000..8e0c992cb0f--- /dev/null+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/explicit-inherit/all-length-properties.html@@ -0,0 +1,105 @@+<!doctype html>+<meta charset="utf-8">+<title>Explicit inheritance of length properties under zoom</title>+<link rel="help" href="https://drafts.csswg.org/css-viewport/#zoom-property">+<meta name="assert"+ content="Explicitly inherited computed lengths are unchanged when the effective zoom changes.">+<script src="../../../../resources/testharness.js"></script>+<script src="../../../../resources/testharnessreport.js"></script>+<div id="parent"><div id="child"></div></div>+<script>+const candidates = [+ '10px',+ '10px 20px',+ '10px 20px 30px',+ '10px 20px 30px 40px',+ '10px / 20px',+ '10px 20px / 30px 40px',+ '10px auto',+ 'auto 10px',+ '10px normal',+ 'normal 10px',+ '10px solid black',+ 'solid 10px black',+ 'translate(10px, 20px)',+ 'translateX(10px)',+ 'perspective(10px)',+ 'blur(10px)',+ 'drop-shadow(10px 20px 30px black)',+ '10px 20px 30px black',+ 'inset 10px 20px 30px black',+ 'inset(10px)',+ 'circle(10px at 20px 30px)',+ 'ellipse(10px 20px at 30px 40px)',+ 'rect(10px 20px 30px 40px)',+ 'xywh(10px 20px 30px 40px)',+ 'polygon(10px 20px, 30px 40px, 50px 60px)',+ 'linear-gradient(black 10px, white 20px)',+ 'radial-gradient(circle 10px at 20px 30px, black, white)',+ 'below 10px',+];+const parentElement = document.querySelector('#parent');+const childElement = document.querySelector('#child');+const properties = [...getComputedStyle(parentElement)];+for (const property of properties) {+ for (const candidate of candidates) {+ parentElement.style.cssText = '';+ childElement.style.cssText = 'zoom: 3';+ parentElement.style.setProperty(property, candidate);+ if (!parentElement.style.getPropertyValue(property)) {+ continue;+ }+ childElement.style.setProperty(property, 'inherit');+ const parentValue =+ getComputedStyle(parentElement).getPropertyValue(property);+ if (!parentValue.includes('px')) {+ continue;+ }++ childElement.style.zoom = 1;+ const inheritedValue =+ getComputedStyle(childElement).getPropertyValue(property);+ if (inheritedValue !== parentValue) {+ continue;+ }++ childElement.style.zoom = 3;+ const zoomedInheritedValue =+ getComputedStyle(childElement).getPropertyValue(property);+ test(() => assert_equals(zoomedInheritedValue, parentValue),+ `${property}: ${candidate}; parent=${parentValue}; ` ++ `child=${zoomedInheritedValue}`);+ break;+ }+}++const legacyProperties = [+ ['-webkit-perspective-origin-x', 'perspective-origin', '10px'],+ ['-webkit-perspective-origin-y', 'perspective-origin', '10px'],+ ['-webkit-transform-origin-x', 'transform-origin', '10px'],+ ['-webkit-transform-origin-y', 'transform-origin', '10px'],+ ['-webkit-transform-origin-z', 'transform-origin', '10px'],+];+for (const [property, computedProperty, value] of legacyProperties) {+ if (!CSS.supports(property, value)) {+ continue;+ }+ test(() => {+ parentElement.style.cssText = 'width: 100px; height: 100px';+ childElement.style.cssText = 'width: 100px; height: 100px';+ parentElement.style.setProperty(property, value);+ childElement.style.setProperty(property, 'inherit');++ const parentValue =+ getComputedStyle(parentElement).getPropertyValue(computedProperty);+ assert_equals(+ getComputedStyle(childElement).getPropertyValue(computedProperty),+ parentValue, 'inherited value without zoom');++ childElement.style.zoom = 3;+ assert_equals(+ getComputedStyle(childElement).getPropertyValue(computedProperty),+ parentValue, 'inherited value under zoom');+ }, property);+}+</script>diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/font-relative-units-with-zoom.html b/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/font-relative-units-with-zoom.htmlnew file mode 100644index 00000000000..d958bf305b0--- /dev/null+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/font-relative-units-with-zoom.html@@ -0,0 +1,93 @@+<!DOCTYPE html>+<script src="../../../resources/testharness.js"></script>+<script src="../../../resources/testharnessreport.js"></script>+<link rel="author" title="WebKit" href="https://webkit.org">+<link rel="help" href="https://drafts.csswg.org/css-values-4/#font-relative-lengths">+<link rel="help" href="https://drafts.csswg.org/css-viewport/#zoom-property">+<style>+.zoom-1-5 { zoom: 1.5; font-size: 20px; }+.zoom-2 { zoom: 2; font-size: 20px; }+</style>++<div class="zoom-1-5">+ <div id="ls-ic-zoom-1-5" style="letter-spacing: 1ic">ic letter-spacing with zoom 1.5</div>+ <div id="ls-em-zoom-1-5" style="letter-spacing: 1em">em letter-spacing with zoom 1.5</div>+</div>++<div class="zoom-2">+ <div id="ls-ic-zoom-2" style="letter-spacing: 1ic">ic letter-spacing with zoom 2</div>+ <div id="ls-em-zoom-2" style="letter-spacing: 1em">em letter-spacing with zoom 2</div>+</div>++<div class="zoom-1-5">+ <div id="lh-ic-zoom-1-5" style="line-height: 1ic">ic line-height with zoom 1.5</div>+ <div id="lh-em-zoom-1-5" style="line-height: 1em">em line-height with zoom 1.5</div>+</div>++<div class="zoom-1-5">+ <div id="fs-cap-zoom-1-5" style="font-size: 1cap">cap font-size with zoom 1.5</div>+ <div id="fs-ex-zoom-1-5" style="font-size: 1ex">ex font-size with zoom 1.5</div>+ <div id="fs-ch-zoom-1-5" style="font-size: 1ch">ch font-size with zoom 1.5</div>+ <div id="fs-ic-zoom-1-5" style="font-size: 1ic">ic font-size with zoom 1.5</div>+</div>++<div class="zoom-2">+ <div id="fs-cap-zoom-2" style="font-size: 1cap">cap font-size with zoom 2</div>+ <div id="fs-ex-zoom-2" style="font-size: 1ex">ex font-size with zoom 2</div>+ <div id="fs-ch-zoom-2" style="font-size: 1ch">ch font-size with zoom 2</div>+ <div id="fs-ic-zoom-2" style="font-size: 1ic">ic font-size with zoom 2</div>+</div>++<script>+test(() => {+ assert_equals(+ getComputedStyle(document.getElementById("ls-ic-zoom-1-5")).letterSpacing,+ getComputedStyle(document.getElementById("ls-em-zoom-1-5")).letterSpacing,+ "1ic should equal 1em for letter-spacing under zoom: 1.5"+ );+}, "ic equals em for letter-spacing under CSS zoom 1.5");++test(() => {+ assert_equals(+ getComputedStyle(document.getElementById("ls-ic-zoom-2")).letterSpacing,+ getComputedStyle(document.getElementById("ls-em-zoom-2")).letterSpacing,+ "1ic should equal 1em for letter-spacing under zoom: 2"+ );+}, "ic equals em for letter-spacing under CSS zoom 2");++test(() => {+ assert_equals(+ getComputedStyle(document.getElementById("lh-ic-zoom-1-5")).lineHeight,+ getComputedStyle(document.getElementById("lh-em-zoom-1-5")).lineHeight,+ "1ic should equal 1em for line-height under zoom: 1.5"+ );+}, "ic equals em for line-height under CSS zoom 1.5");++test(() => {+ let zoom15 = parseFloat(getComputedStyle(document.getElementById("fs-cap-zoom-1-5")).fontSize);+ let zoom2 = parseFloat(getComputedStyle(document.getElementById("fs-cap-zoom-2")).fontSize);+ assert_approx_equals(zoom2, zoom15, 0.05,+ "1cap font-size should resolve to the same unzoomed value regardless of CSS zoom (got " + zoom15 + "px at zoom 1.5, " + zoom2 + "px at zoom 2)");+}, "cap font-size resolves to identical unzoomed value across CSS zoom levels");++test(() => {+ let zoom15 = parseFloat(getComputedStyle(document.getElementById("fs-ex-zoom-1-5")).fontSize);+ let zoom2 = parseFloat(getComputedStyle(document.getElementById("fs-ex-zoom-2")).fontSize);+ assert_approx_equals(zoom2, zoom15, 0.05,+ "1ex font-size should resolve to the same unzoomed value regardless of CSS zoom (got " + zoom15 + "px at zoom 1.5, " + zoom2 + "px at zoom 2)");+}, "ex font-size resolves to identical unzoomed value across CSS zoom levels");++test(() => {+ let zoom15 = parseFloat(getComputedStyle(document.getElementById("fs-ch-zoom-1-5")).fontSize);+ let zoom2 = parseFloat(getComputedStyle(document.getElementById("fs-ch-zoom-2")).fontSize);+ assert_approx_equals(zoom2, zoom15, 0.05,+ "1ch font-size should resolve to the same unzoomed value regardless of CSS zoom (got " + zoom15 + "px at zoom 1.5, " + zoom2 + "px at zoom 2)");+}, "ch font-size resolves to identical unzoomed value across CSS zoom levels");++test(() => {+ let zoom15 = parseFloat(getComputedStyle(document.getElementById("fs-ic-zoom-1-5")).fontSize);+ let zoom2 = parseFloat(getComputedStyle(document.getElementById("fs-ic-zoom-2")).fontSize);+ assert_approx_equals(zoom2, zoom15, 0.05,+ "1ic font-size should resolve to the same unzoomed value regardless of CSS zoom (got " + zoom15 + "px at zoom 1.5, " + zoom2 + "px at zoom 2)");+}, "ic font-size resolves to identical unzoomed value across CSS zoom levels");+</script>diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/font-relative-units.html b/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/font-relative-units.htmlnew file mode 100644index 00000000000..10bc88d09d9--- /dev/null+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/font-relative-units.html@@ -0,0 +1,59 @@+<!DOCTYPE html>+<html>+<head>+ <meta charset="utf-8">+ <link rel="help" href="https://drafts.csswg.org/css-viewport/#zoom-property">+ <script src="../../../resources/testharness.js"></script>+ <script src="../../../resources/testharnessreport.js"></script>+ <meta name="assert" content="test font-relative units and zoom">+ <style>+ html {+ font-size: 20px;+ line-height: 1;+ zoom: 2;+ }++ .unit {+ height: 20px;+ outline: 1px solid black;+ outline-offset: -1px;+ }++ .unit::after {+ content: attr(id);+ font-size: 10px;+ }+ </style>+</head>+<body>+ <div id="div"></div>+ <script>+ const units = [+ ['em', 'rem'],+ ['lh', 'rlh'],+ ['ex', 'rex'],+ ['cap', 'rcap'],+ ['ch', 'rch'],+ ['ic', 'ric'],+ ];++ for (const pair of units) {+ for (const unit of pair) {+ div.insertAdjacentHTML("beforeend", `<div class="unit" id="${unit}" style="width: 5${unit}"></div>`);+ }+ }++ setup({ explicit_done: true });+ document.fonts.ready.then(() => {+ for (const [localUnit, rootUnit] of units) {+ test(() => {+ let localUnitWidth = document.getElementById(localUnit).getBoundingClientRect().width;+ let rootUnitWidth = document.getElementById(rootUnit).getBoundingClientRect().width;+ assert_equals(localUnitWidth, rootUnitWidth, `expect 1${localUnit} = 1${rootUnit} at the same effective zoom`);+ }, `${localUnit} = ${rootUnit}`);+ }+ done();+ });+ </script>+</body>+</html>\ No newline at end of filediff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/font-size-keyword-system-font.html b/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/font-size-keyword-system-font.htmlnew file mode 100644index 00000000000..2d304776ac8--- /dev/null+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/font-size-keyword-system-font.html@@ -0,0 +1,31 @@+<!DOCTYPE html>+<title>CSS zoom applies to font-size when specified via system font keyword</title>+<link rel="author" title="Emilio Cobos Álvarez" href="mailto:[email protected]">+<link rel="author" title="Mozilla" href="https://mozilla.org">+<link rel="help" href="https://drafts.csswg.org/css-viewport/">+<script src="../../../resources/testharness.js"></script>+<script src="../../../resources/testharnessreport.js"></script>+<style>+#ref, #target {+ font: menu;+ width: 1em;+ height: 1em;+}+#target {+ zoom: 2;+}+</style>+<div id="ref">Reference</div>+<div id="target">Target</div>+<script>+test(function() {+ const unzoomedComputedSize = parseFloat(getComputedStyle(ref).fontSize);+ assert_greater_than(unzoomedComputedSize, 0, "system font should have a positive font-size");+ const zoomedComputedSize = parseFloat(getComputedStyle(target).fontSize);+ assert_equals(zoomedComputedSize, unzoomedComputedSize, "computed style should be the same");++ const unzoomedWidth = ref.getBoundingClientRect().width;+ const zoomedWidth = target.getBoundingClientRect().width;+ assert_approx_equals(zoomedWidth, 2 * unzoomedWidth, 0.1);+}, "zoom scales font-size set via system font keyword");+</script>diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/length-implicit-and-explicit-inheritance.html b/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/length-implicit-and-explicit-inheritance.htmlnew file mode 100644index 00000000000..290556565d6--- /dev/null+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/length-implicit-and-explicit-inheritance.html@@ -0,0 +1,38 @@+<!doctype html>+<meta charset="utf-8">+<link rel="author" href="mailto:[email protected]" title="Emilio Cobos Álvarez">+<link rel="author" href="https://mozilla.org" title="Mozilla">+<link rel="help" href="https://drafts.csswg.org/css-viewport/#zoom-property">+<script src="../../../resources/testharness.js"></script>+<script src="../../../resources/testharnessreport.js"></script>+<div style="zoom: 2">+ <div style="zoom: 2" id="parent">+ <!-- effective zoom of 8, inherited zoom (4) times specified zoom (2) -->+ <div style="zoom: 2" id="target"></div>+ </div>+</div>+<script>+ const kTestCases = [+ // Explicitly inherited reset properties.+ ["width", "100px", "inherit", "100px"],+ ["height", "100px", "inherit", "100px"],+ // Explicitly inherited properties.+ ["word-spacing", "100px", "inherit", "100px"],+ ["word-spacing", "100px", "unset", "100px"],+ // Implicitly inherited properties.+ ["word-spacing", "100px", "", "100px"],+ ];++ const parent = document.getElementById("parent");+ const target = document.getElementById("target");+ for (const [prop, parentValue, childValue, expected] of kTestCases) {+ test(function(t) {+ parent.style[prop] = parentValue;+ target.style[prop] = childValue;+ t.add_cleanup(function() {+ parent.style[prop] = target.style[prop] = "";+ });+ assert_equals(getComputedStyle(target).getPropertyValue(prop), expected);+ }, `${prop}: ${childValue} from ${parentValue}`);+ }+</script>diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/line-height-computed.html b/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/line-height-computed.htmlnew file mode 100644index 00000000000..a5ebcf6f2db--- /dev/null+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/line-height-computed.html@@ -0,0 +1,164 @@+<!DOCTYPE html>+<link rel="author" title="Sam Weinig" href="mailto:[email protected]">+<link rel="help" href="https://drafts.csswg.org/css-viewport/">+<script src="../../../resources/testharness.js"></script>+<script src="../../../resources/testharnessreport.js"></script>+<body>+<script>+test(() => {+ const target1 = document.createElement("div");+ document.body.append(target1);+ const target2 = document.createElement("div");+ document.body.append(target2);++ try {+ target1.style = "line-height: 20px; tab-size: 1lh;";+ target2.style = "line-height: 20px; tab-size: 1lh; zoom: 2;";++ assert_equals(getComputedStyle(target1).tabSize, getComputedStyle(target2).tabSize);+ assert_equals(getComputedStyle(target1).tabSize, "20px");+ assert_equals(getComputedStyle(target2).tabSize, "20px");+ } finally {+ target1.remove();+ target2.remove();+ }+}, "element with px line-height");++test(() => {+ const target1 = document.createElement("div");+ document.body.append(target1);+ const target2 = document.createElement("div");+ document.body.append(target2);++ try {+ target1.style = "font-size: 100px; line-height: 20%; tab-size: 1lh;";+ target2.style = "font-size: 100px; line-height: 20%; tab-size: 1lh; zoom: 2;";++ assert_equals(getComputedStyle(target1).tabSize, getComputedStyle(target2).tabSize);+ assert_equals(getComputedStyle(target1).tabSize, "20px");+ assert_equals(getComputedStyle(target2).tabSize, "20px");+ } finally {+ target1.remove();+ target2.remove();+ }+}, "element with percentage line-height");++test(() => {+ const container1 = document.createElement("div");+ const target1 = document.createElement("div");+ container1.appendChild(target1);+ document.body.append(container1);++ const container2 = document.createElement("div");+ const target2 = document.createElement("div");+ container2.appendChild(target2);+ document.body.append(container2);++ try {+ container1.style = "line-height: 20px;";+ target1.style = "font-size: 1lh; line-height: 1lh;";++ container2.style = "line-height: 20px; zoom: 2;";+ target2.style = "font-size: 1lh; line-height: 1lh;";++ assert_equals(getComputedStyle(target1).fontSize, getComputedStyle(target2).fontSize);+ assert_equals(getComputedStyle(target1).lineHeight, getComputedStyle(target2).fontSize);++ assert_equals(getComputedStyle(target1).fontSize, '20px');+ assert_equals(getComputedStyle(target1).lineHeight, '20px');+ assert_equals(getComputedStyle(target2).fontSize, '20px');+ assert_equals(getComputedStyle(target2).lineHeight, '20px');+ } finally {+ container1.remove();+ container2.remove()+ }+}, "parent with px line-height");++test(() => {+ const container1 = document.createElement("div");+ const target1 = document.createElement("div");+ container1.appendChild(target1);+ document.body.append(container1);++ const container2 = document.createElement("div");+ const target2 = document.createElement("div");+ container2.appendChild(target2);+ document.body.append(container2);++ try {+ container1.style = "font-size: 100px; line-height: 20%;";+ target1.style = "font-size: 1lh; line-height: 1lh;";++ container2.style = "font-size: 100px; line-height: 20%; zoom: 2;";+ target2.style = "font-size: 1lh; line-height: 1lh;";++ assert_equals(getComputedStyle(target1).fontSize, getComputedStyle(target2).fontSize);+ assert_equals(getComputedStyle(target1).lineHeight, getComputedStyle(target2).fontSize);++ assert_equals(getComputedStyle(target1).fontSize, '20px');+ assert_equals(getComputedStyle(target1).lineHeight, '20px');+ assert_equals(getComputedStyle(target2).fontSize, '20px');+ assert_equals(getComputedStyle(target2).lineHeight, '20px');+ } finally {+ container1.remove();+ container2.remove()+ }+}, "parent with percentage line-height");++test(() => {+ const target = document.createElement("div");+ document.body.append(target);++ document.documentElement.style = "line-height: 20px;"++ try {+ target.style = "font-size: 1rlh; line-height: 1rlh;";++ const unzoomedRootFontSize = getComputedStyle(target).fontSize;+ const unzoomedRootLineHeight = getComputedStyle(target).lineHeight;++ assert_equals(getComputedStyle(target).fontSize, '20px');+ assert_equals(getComputedStyle(target).lineHeight, '20px');++ document.documentElement.style = "line-height: 20px; zoom: 2";++ assert_equals(getComputedStyle(target).fontSize, '20px');+ assert_equals(getComputedStyle(target).lineHeight, '20px');++ assert_equals(getComputedStyle(target).fontSize, unzoomedRootFontSize);+ assert_equals(getComputedStyle(target).lineHeight, unzoomedRootLineHeight);+ } finally {+ document.documentElement.style = "";+ target.remove();+ }+}, "root with px line-height");++test(() => {+ const target = document.createElement("div");+ document.body.append(target);++ document.documentElement.style = "font-size: 100px; line-height: 20%;"++ try {+ target.style = "font-size: 1rlh; line-height: 1rlh;";++ const unzoomedRootFontSize = getComputedStyle(target).fontSize;+ const unzoomedRootLineHeight = getComputedStyle(target).lineHeight;++ assert_equals(getComputedStyle(target).fontSize, '20px');+ assert_equals(getComputedStyle(target).lineHeight, '20px');++ document.documentElement.style = "font-size: 100px; line-height: 20%; zoom: 2";++ assert_equals(getComputedStyle(target).fontSize, '20px');+ assert_equals(getComputedStyle(target).lineHeight, '20px');++ assert_equals(getComputedStyle(target).fontSize, unzoomedRootFontSize);+ assert_equals(getComputedStyle(target).lineHeight, unzoomedRootLineHeight);+ } finally {+ document.documentElement.style = "";+ target.remove();+ }+}, "root with percentage line-height");+</script>+</body>diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/matrix-zoom-anim-computed.html b/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/matrix-zoom-anim-computed.htmlnew file mode 100644index 00000000000..c20e2297fae--- /dev/null+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/matrix-zoom-anim-computed.html@@ -0,0 +1,33 @@+<!DOCTYPE html>+<meta charset="utf-8">+<title>Zoom property on computed values of transform with a transformation matrix and animation used</title>+<link rel="author" href="mailto:[email protected]" title="Seva Alipov">+<link rel="author" href="https://mozilla.com" title="Mozilla">+<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1927186">++<script src="../../../resources/testharness.js"></script>+<script src="../../../resources/testharnessreport.js"></script>++<style>+@keyframes kf {+ from { transform: matrix(1, 0, 0, 1, 50, 50); }+ to { transform: matrix(1, 0, 0, 1, 0, 0); }+}++#foo {+ width: 50px;+ height: 50px;+ background: purple;+ animation: kf 99999s steps(5) infinite alternate;+}+</style>++<div style="zoom: 2">+ <div id="foo"></div>+</div>++<script>+test(() => {+ assert_equals(getComputedStyle(foo).transform, "matrix(1, 0, 0, 1, 50, 50)");+}, "Zoom does not affect the computed transform matrix of an animated element");+</script>diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/parsing/zoom-computed-with-sign-expression.html b/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/parsing/zoom-computed-with-sign-expression.htmlnew file mode 100644index 00000000000..bbccdec7bc2--- /dev/null+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/parsing/zoom-computed-with-sign-expression.html@@ -0,0 +1,38 @@+<!DOCTYPE html>+<meta charset="utf-8">+<title>CSS Test: getComputedStyle().zoom, with a specified value that includes a sign() expression</title>+<link rel="help" href="https://drafts.csswg.org/css-viewport/#zoom-property">+<link rel="help" href="https://drafts.csswg.org/css-viewport/#zoom-property">+<script src="../../../../resources/testharness.js"></script>+<script src="../../../../resources/testharnessreport.js"></script>+<script src="../../../../css/support/computed-testcommon.js"></script>+<style>+ #container {+ container-type: inline-size;+ width: 100px;+ font-size: 20px;+ }+</style>+<div id="container">+ <div id="target"></div>+</div>+<script>+// The sign() expressions below are all expected to resolve to -1.++// Same units:+test_computed_value("zoom", 'calc(1 + (sign(2cqw - 3cqw) * 0.5))', '0.5');+test_computed_value("zoom", 'calc(1 + (sign(5px - 10px) * 0.5))', '0.5');+test_computed_value("zoom", 'calc(1 + (sign(5 - 10) * 0.5))', '0.5');+test_computed_value("zoom", 'calc(1 + (sign(30deg - 40deg) * 0.5))', '0.5');+test_computed_value("zoom", 'calc(1 + (sign(3em - 5em) * 0.5))', '0.5');++// Mixed absolute units:+test_computed_value("zoom", 'calc(1 + (sign(1cm - 1in) * 0.5))', '0.5');+test_computed_value("zoom", 'calc(1 + (sign(1deg - 1rad) * 0.5))', '0.5');++// Mixed units, one or more of which is context-dependent:+test_computed_value("zoom", 'calc(1 + (sign(2cqw - 10px) * 0.5))', '0.5');+test_computed_value("zoom", 'calc(100% + (sign(2cqw - 10px) * 50%))', '0.5');+test_computed_value("zoom", 'calc(100% + (sign(1em - 30px) * 50%))', '0.5');+test_computed_value("zoom", 'calc(100% + (sign(2cqw - 1em) * 50%))', '0.5');+</script>diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/parsing/zoom-computed.html b/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/parsing/zoom-computed.htmlnew file mode 100644index 00000000000..bc57b43a306--- /dev/null+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/parsing/zoom-computed.html@@ -0,0 +1,29 @@+<!DOCTYPE html>+<meta charset="utf-8">+<title>CSS Test: getComputedStyle().zoom</title>+<link rel="help" href="https://drafts.csswg.org/css-viewport/#zoom-property">+<script src="../../../../resources/testharness.js"></script>+<script src="../../../../resources/testharnessreport.js"></script>+<script src="../../../../css/support/computed-testcommon.js"></script>+<div id="container">+ <div id="target"></div>+</div>+<script>+test_computed_value("zoom", "normal", "1");++test_computed_value("zoom", "1", "1");+test_computed_value("zoom", "1.5", "1.5");+test_computed_value("zoom", "0.75", "0.75");+test_computed_value("zoom", 'calc(1 - 0.5)', '0.5');+test_computed_value("zoom", 'calc(1 * 0.5)', '0.5');++test_computed_value("zoom", "100%", "1");+test_computed_value("zoom", "150%", "1.5");+test_computed_value("zoom", "75%", "0.75");+test_computed_value("zoom", 'calc(100% - 50%)', '0.5');+test_computed_value("zoom", 'calc(100% * 0.5)', '0.5');++// Legacy crap, wat+test_computed_value("zoom", "0", "1");+test_computed_value("zoom", "0%", "1");+</script>diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/parsing/zoom-valid.html b/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/parsing/zoom-valid.htmlnew file mode 100644index 00000000000..a5cfff55cd9--- /dev/null+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/parsing/zoom-valid.html@@ -0,0 +1,29 @@+<!DOCTYPE html>+<meta charset="utf-8">+<title>CSS Test: parsing zoom with valid and invalid values</title>+<link rel="author" title="Emilio Cobos Álvarez" href="mailto:[email protected]">+<link rel="author" title="Mozilla" href="https://mozilla.com">+<link rel="help" href="https://drafts.csswg.org/css-viewport/#zoom-property">+<script src="../../../../resources/testharness.js"></script>+<script src="../../../../resources/testharnessreport.js"></script>+<script src="../../../../css/support/parsing-testcommon.js"></script>+<body>+<script>+test_valid_value("zoom", "normal");+test_valid_value("zoom", "1");+test_valid_value("zoom", "100%");+test_valid_value("zoom", "0");+test_valid_value("zoom", "0%");+test_valid_value("zoom", "1.5");+test_valid_value("zoom", "150%")+test_valid_value("zoom", "75%");+test_valid_value("zoom", "0.5");++test_invalid_value("zoom", "auto");+test_invalid_value("zoom", "reset");+test_invalid_value("zoom", "document");+test_invalid_value("zoom", "-100%");+test_invalid_value("zoom", "-200%");+test_invalid_value("zoom", "-1");+test_invalid_value("zoom", "-2");+</script>diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/relative-units.html b/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/relative-units.htmlnew file mode 100644index 00000000000..f58354fe9ec--- /dev/null+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/relative-units.html@@ -0,0 +1,42 @@+<!doctype html>+<meta charset="utf-8">+<meta name="viewport" content="width=device-width">+<link rel="author" title="Emilio Cobos Álvarez" href="mailto:[email protected]">+<link rel="author" title="Mozilla" href="https://mozilla.org">+<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1892676">+<link rel="help" href="https://drafts.csswg.org/css-viewport/#zoom-property">+<script src="../../../resources/testharness.js"></script>+<script src="../../../resources/testharnessreport.js"></script>+<style>+ :root,+ #zoomed {+ font-size: 10px;+ line-height: 10px;+ zoom: 2;+ }+</style>+<div id="outside"></div>+<div id="zoomed">+ <div id="inside"></div>+</div>+<script>+ function test_unit(unit, outside, zoomed, inside = zoomed) {+ test(function() {+ let values = { outside, zoomed, inside };+ for (let id of ["outside", "zoomed", "inside"]) {+ let el = document.getElementById(id);+ el.style.height = "1" + unit;+ // approx_equals is needed because innerHeight / innerWidth round.+ assert_approx_equals(el.getBoundingClientRect().height, values[id], 1, `${unit} in ${id}`);+ el.style.height = "";+ }+ });+ }++ test_unit("em", 20, 40);+ test_unit("rem", 20, 40);+ test_unit("lh", 20, 40);+ test_unit("rlh", 20, 40);+ test_unit("vh", 2 * innerHeight / 100, 4 * innerHeight / 100);+ test_unit("vw", 2 * innerWidth / 100, 4 * innerWidth / 100);+</script>diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/scroll-top-test-with-zoom.html b/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/scroll-top-test-with-zoom.htmlnew file mode 100644index 00000000000..a5811ac6857--- /dev/null+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/scroll-top-test-with-zoom.html@@ -0,0 +1,33 @@+<!doctype html>+<title>Scroll Top Test with Zoom</title>+<link rel="help" href="https://drafts.csswg.org/css-viewport/#zoom-property">+<script src="../../../resources/testharness.js"></script>+<script src="../../../resources/testharnessreport.js"></script>+<style>+ #container {+ width: 200px;+ height: 100px;+ border: solid thick;+ overflow: auto;+ }+</style>+<div id="container">+ <div style="width: 100px; height: 2000px"></div>+</div>++<script>+ var container = document.getElementById('container');+ container.scrollTop = 77;+ test(function() {+ assert_equals(container.scrollTop, 77, "Initial scrollTop should be 77");+ }, "Initial scrollTop with no zoom");++ document.body.style.zoom = 1.2;+ document.body.offsetTop;++ document.body.style.zoom = 1;+ test(function() {+ assert_equals(container.scrollTop, 77, "scrollTop should remain consistent after resetting zoom");+ }, "scrollTop after resetting zoom");+ done();+</script>diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/text-indent-computed.html b/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/text-indent-computed.htmlnew file mode 100644index 00000000000..1b7c8c957e3--- /dev/null+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/text-indent-computed.html@@ -0,0 +1,35 @@+<!DOCTYPE html>+<html>+<head>+<meta charset="utf-8">+<title>CSS Text: text-indent computed values under zoom</title>+<link rel="help" href="https://www.w3.org/TR/CSS22/text.html#indentation-prop">+<link rel="help" href="https://drafts.csswg.org/css-text-3/#text-indent-property">+<script src="../../../resources/testharness.js"></script>+<script src="../../../resources/testharnessreport.js"></script>+<script src="../../../css/support/computed-testcommon.js"></script>+</head>+<body>+<div style="text-indent: 2rem;">+ <p id="target">Test paragraph</p>+</div>+<script>+const target = document.getElementById("target");++test_computed_value("text-indent", "1px", "1px", "single value no zoom");+test_computed_value("text-indent", "1rem", "16px", "rem value no zoom");+test_computed_value("text-indent", "inherit", "32px", "inherit no zoom");+test_computed_value("text-indent", "5px", "5px", "explicit px value no zoom");+test_computed_value("text-indent", "0", "0px", "zero value no zoom");++const parent = target.parentElement;+parent.style.zoom = "2";++test_computed_value("text-indent", "1px", "1px", "single value with zoom: 2");+test_computed_value("text-indent", "1rem", "16px", "rem value with zoom: 2");+test_computed_value("text-indent", "inherit", "32px", "inherit with zoom: 2");+test_computed_value("text-indent", "5px", "5px", "explicit px value with zoom: 2");+test_computed_value("text-indent", "0", "0px", "zero value with zoom: 2");+</script>+</body>+</html>diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/translate-zoom-anim-computed.html b/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/translate-zoom-anim-computed.htmlnew file mode 100644index 00000000000..5fbce2ab4fd--- /dev/null+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/translate-zoom-anim-computed.html@@ -0,0 +1,55 @@+<!DOCTYPE html>+<meta charset="utf-8">+<title>Zoom property on computed values of transform with a translation and animation used</title>+<link rel="author" href="mailto:[email protected]" title="Seva Alipov">+<link rel="author" href="https://mozilla.com" title="Mozilla">+<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1927186">++<script src="../../../resources/testharness.js"></script>+<script src="../../../resources/testharnessreport.js"></script>++<style>+@keyframes kf {+ from { transform: translate(50px, 100%); }+ to { transform: translate(0px, 0px); }+}+@keyframes kf2 {+ from { transform: translate(50px, calc(50% + 25px)); }+ to { transform: translate(0px, 0px); }+}++.container {+ zoom: 2;+ width: 100px;+ height: 100px;+ border: 1px solid;+}+#foo {+ width: 50px;+ height: 50px;+ background: purple;+ animation: kf 99999s steps(5) infinite alternate;+}+#bar {+ width: 50px;+ height: 50px;+ background: orange;+ animation: kf2 99999s steps(5) infinite alternate;+}+</style>++<div class="container">+ <div id="foo"></div>+</div>+<div class="container">+ <div id="bar"></div>+</div>++<script>+test(() => {+ assert_equals(getComputedStyle(foo).transform, "matrix(1, 0, 0, 1, 50, 50)");+}, "Zoom does not affect the computed transform matrix of a translated animated element.");+test(() => {+ assert_equals(getComputedStyle(bar).transform, "matrix(1, 0, 0, 1, 50, 50)");+}, "Zoom does not affect the computed transform matrix of a translated animated element that uses mixed px/percentage values.")+</script>diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/widget.html b/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/widget.htmlnew file mode 100644index 00000000000..5ef6f808d2b--- /dev/null+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/widget.html@@ -0,0 +1,19 @@+<!doctype html>+<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1918838">+<link rel="help" href="https://drafts.csswg.org/css-viewport/#zoom-property">+<link rel="author" href="mailto:[email protected]" title="Emilio Cobos Álvarez">+<link rel="author" href="https://mozilla.org" title="Mozilla">+<script src="../../../resources/testharness.js"></script>+<script src="../../../resources/testharnessreport.js"></script>+<input type=checkbox>+<input type=radio>+<script>+for (let i of document.querySelectorAll("input")) {+ test(function() {+ let unzoomed = i.getBoundingClientRect().width;+ i.style.zoom = "2";+ let zoomed = i.getBoundingClientRect().width;+ assert_not_equals(unzoomed, zoomed, "Zoom should be applied");+ }, i.type);+}+</script>diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/word-spacing-inherited-computed.html b/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/word-spacing-inherited-computed.htmlnew file mode 100644index 00000000000..cbd6bc32f1f--- /dev/null+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/word-spacing-inherited-computed.html@@ -0,0 +1,38 @@+<!DOCTYPE html>+<script src="../../../resources/testharness.js"></script>+<script src="../../../resources/testharnessreport.js"></script>+<link rel="author" title="Vitor Roriz" href="https://github.com/vitorroriz">+<!-- Based on css/css-viewport/zoom/word-spacing.html by Stefan Zager -->+<link rel="help" href="https://drafts.csswg.org/css-viewport/">+<style>+.spacing {+ word-spacing: 2rem;+}+.zoom {+ zoom: 2;+}+</style>++<div class="spacing">+ <div id="inherited-word-spacing">unzoomed lorem ipsum</div>+</div>++<div class="zoom">+ <div id="zoomed-word-spacing" class="spacing">zoomed lorem ipsum</div>+</div>++<div class="spacing">+ <div id="zoomed-inherited-word-spacing" class="zoom">zoomed inherited lorem ipsum</div>+</div>++<script>+test(() => {+ assert_equals(getComputedStyle(document.getElementById("inherited-word-spacing")).wordSpacing, '32px');+}, "computed inherited word-spacing");+test(() => {+ assert_equals(getComputedStyle(document.getElementById("zoomed-word-spacing")).wordSpacing, '32px');+}, "computed zoomed word-spacing");+test(() => {+ assert_equals(getComputedStyle(document.getElementById("zoomed-inherited-word-spacing")).wordSpacing, '32px');+}, "computed zoomed inherited word-spacing");+</script>diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/zoom-with-sign-function.html b/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/zoom-with-sign-function.htmlnew file mode 100644index 00000000000..c778e30958a--- /dev/null+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-viewport/zoom/zoom-with-sign-function.html@@ -0,0 +1,15 @@+<!DOCTYPE html>+<link rel="help" href="https://drafts.csswg.org/css-values-4/#sign-funcs">+<script src="../../../resources/testharness.js"></script>+<script src="../../../resources/testharnessreport.js"></script>+<script src="../../support/numeric-testcommon.js"></script>+<style>+#target {+ font-size: 10px;+}+</style>+<div id="target"></div>+<script>+ test_math_used('calc(sign(1em - 1px) * 2)', '2', {prop:'zoom'});+ test_math_used('calc(sign(1em - 1px) * 2%)', '2%', {prop:'zoom'});+</script>diff --git a/Tests/LibWeb/Text/input/wpt-import/css/cssom-view/Element-currentCSSZoom.html b/Tests/LibWeb/Text/input/wpt-import/css/cssom-view/Element-currentCSSZoom.htmlnew file mode 100644index 00000000000..340cc225b71--- /dev/null+++ b/Tests/LibWeb/Text/input/wpt-import/css/cssom-view/Element-currentCSSZoom.html@@ -0,0 +1,32 @@+<!doctype html>+<meta charset="utf-8">+<title>Element.currentCSSZoom</title>+<link rel="author" title="Emilio Cobos Álvarez" href="mailto:[email protected]">+<link rel="author" title="Mozilla" href="https://mozilla.org">+<link rel="help" href="https://drafts.csswg.org/cssom-view/#dom-element-currentcsszoom">+<script src="../../resources/testharness.js"></script>+<script src="../../resources/testharnessreport.js"></script>+<div id="unzoomed">+ <div id="unzoomedChild"></div>+</div>+<div style="zoom: 2" id="outer">+ <div style="zoom: 2" id="inner">+ <div id="renderedChild"></div>+ <div style="display: none" id="nonRenderedChild"></div>+ </div>+</div>+<script>+test(() => {+ assert_equals(unzoomed.currentCSSZoom, 1, "Unzoomed content");+ assert_equals(outer.currentCSSZoom, 2, "Zoomed content");+ assert_equals(inner.currentCSSZoom, 4, "Effective zoom gets multiplied properly");+ assert_equals(renderedChild.currentCSSZoom, 4, "Effective zoom gets propagated to children");+ assert_equals(nonRenderedChild.currentCSSZoom, 1, "Non-rendered elements return 1 for currentCSSZoom");+}, "Element.currentCSSZoom basic test");++test(() => {+ unzoomed.style.zoom = 2;+ assert_equals(unzoomed.currentCSSZoom, 2, "currentCSSZoom reacts to style changes");+ assert_equals(unzoomedChild.currentCSSZoom, 2, "currentCSSZoom propagates to descendants after style changes");+}, "Element.currentCSSZoom reacts to style changes");+</script>diff --git a/Tests/LibWeb/Text/input/wpt-import/css/cssom-view/getBoundingClientRect-zoom.html b/Tests/LibWeb/Text/input/wpt-import/css/cssom-view/getBoundingClientRect-zoom.htmlnew file mode 100644index 00000000000..d57c7078860--- /dev/null+++ b/Tests/LibWeb/Text/input/wpt-import/css/cssom-view/getBoundingClientRect-zoom.html@@ -0,0 +1,81 @@+<!DOCTYPE html>+<title>getBoundingClientRect for elements with css zoom</title>+<link rel="author" title="Yotam Hacohen" href="mailto:[email protected]">+<link rel="author" title="Google" href="http://www.google.com/">+<link rel="help" href="https://drafts.csswg.org/css-viewport/">+<script src="../../resources/testharness.js"></script>+<script src="../../resources/testharnessreport.js"></script>+ <head>+ <style>+ div {+ width: 64px;+ height: 64px;+ background-color: blue+ }+ div.x4_zoom {+ zoom: 4.0;+ background-color: blueviolet;+ }+ div.x2_zoom {+ background-color: chartreuse;+ zoom: 2.0;+ }++ div.transform {+ transform: scale(2);+ transform-origin: top left;+ }+++ </style>+ </head>+ <body>+ <div id="no_zoom"></div>+ <div class="x4_zoom" id="with_zoom">+ </div>+ <div class="x2_zoom">+ <div class="x4_zoom" id="nested_zoom"></div>+ </div>+ <div id="transform_and_zoom" class="x4_zoom transform"></div>+ <script>+ setup(() => {+ window.noZoom = document.getElementById("no_zoom");+ window.withZoom = document.getElementById("with_zoom");+ window.nestedZoom = document.getElementById("nested_zoom");+ window.transformAndZoom = document.getElementById("transform_and_zoom");+ });+ test(function() {+ assert_true(!!noZoom, "no zoom target exists");+ assert_true(!!withZoom, "zoom target exists");+ });+ test(function() {+ let noZoomRect = noZoom.getBoundingClientRect();+ assert_equals(noZoomRect.left, 8, 'no zoom left');+ assert_equals(noZoomRect.top, 8, 'no zoom top');+ assert_equals(noZoomRect.width, 64, 'no zoom width');+ assert_equals(noZoomRect.height, 64, 'no zoom height');+ });+ test(function() {+ let ZoomRect = withZoom.getBoundingClientRect();+ assert_equals(ZoomRect.left, 8, 'x4 zoom left');+ assert_equals(ZoomRect.top, 8 + 64, 'x4 zoom top');+ assert_equals(ZoomRect.width, 256, 'x4 zoom width');+ assert_equals(ZoomRect.height, 256, 'x4 zoom height');+ });+ test(function() {+ let nestedZoomRect = nestedZoom.getBoundingClientRect();+ assert_equals(nestedZoomRect.left, 8, 'nested zoom left');+ assert_equals(nestedZoomRect.top, 8 + 64 + 256, 'nested zoom top');+ assert_equals(nestedZoomRect.width, 512, 'nested zoom width');+ assert_equals(nestedZoomRect.height, 512, 'nested zoom height');+ });+ test(function() {+ let transformAndZoomRect = transformAndZoom.getBoundingClientRect();+ assert_equals(transformAndZoomRect.left, 8, 'transform and zoom left');+ assert_equals(transformAndZoomRect.top, 8 + 64 + 256 + 128, 'transform and zoom top');+ assert_equals(transformAndZoomRect.width, 512, 'transform and zoom width');+ assert_equals(transformAndZoomRect.height, 512, 'transform and zoom height');+ });+ </script>+ </body>+`\ No newline at end of filediff --git a/Tests/LibWeb/Text/input/wpt-import/css/cssom-view/getClientRects-zoom.html b/Tests/LibWeb/Text/input/wpt-import/css/cssom-view/getClientRects-zoom.htmlnew file mode 100644index 00000000000..06b81e21b23--- /dev/null+++ b/Tests/LibWeb/Text/input/wpt-import/css/cssom-view/getClientRects-zoom.html@@ -0,0 +1,80 @@+<!DOCTYPE html>+<title>getBoundingClientRect for elements with css zoom</title>+<link rel="author" title="Yotam Hacohen" href="mailto:[email protected]">+<link rel="author" title="Google" href="http://www.google.com/">+<link rel="help" href="https://drafts.csswg.org/css-viewport/">+<script src="../../resources/testharness.js"></script>+<script src="../../resources/testharnessreport.js"></script>+<style>+ .test_content div {+ width: 64px;+ height: 64px;+ background-color: blue+ }+ .test_content div.x4_zoom {+ zoom: 4.0;+ background-color: blueviolet;+ }+ .test_content div.x2_zoom {+ background-color: chartreuse;+ zoom: 2.0;+ }++ .test_content div.transform {+ transform: scale(2);+ transform-origin: top left;+ }+++</style>+<body>+ <div class="test_content">+ <div id="no_zoom"></div>+ <div class="x4_zoom" id="with_zoom">+ </div>+ <div class="x2_zoom">+ <div class="x4_zoom" id="nested_zoom"></div>+ </div>+ <div id="transform_and_zoom" class="x4_zoom transform"></div>+ </div>+ <script>+ setup(() => {+ window.noZoom = document.getElementById("no_zoom");+ window.withZoom = document.getElementById("with_zoom");+ window.nestedZoom = document.getElementById("nested_zoom");+ window.transformAndZoom = document.getElementById("transform_and_zoom");+ });+ test(function() {+ assert_true(!!noZoom, "no zoom target exists");+ assert_true(!!withZoom, "zoom target exists");+ });+ test(function() {+ let noZoomRect = noZoom.getClientRects()[0];+ assert_equals(noZoomRect.left, 8, 'no zoom left');+ assert_equals(noZoomRect.top, 8, 'no zoom top');+ assert_equals(noZoomRect.width, 64, 'no zoom width');+ assert_equals(noZoomRect.height, 64, 'no zoom height');+ });+ test(function() {+ let ZoomRect = withZoom.getClientRects()[0];+ assert_equals(ZoomRect.left, 8, 'x4 zoom left');+ assert_equals(ZoomRect.top, 8 + 64, 'x4 zoom top');+ assert_equals(ZoomRect.width, 256, 'x4 zoom width');+ assert_equals(ZoomRect.height, 256, 'x4 zoom height');+ });+ test(function() {+ let nestedZoomRect = nestedZoom.getClientRects()[0];+ assert_equals(nestedZoomRect.left, 8, 'nested zoom left');+ assert_equals(nestedZoomRect.top, 8 + 64 + 256, 'nested zoom top');+ assert_equals(nestedZoomRect.width, 512, 'nested zoom width');+ assert_equals(nestedZoomRect.height, 512, 'nested zoom height');+ });+ test(function() {+ let transformAndZoomRect = transformAndZoom.getClientRects()[0];+ assert_equals(transformAndZoomRect.left, 8, 'transform and zoom left');+ assert_equals(transformAndZoomRect.top, 8 + 64 + 256 + 128, 'transform and zoom top');+ assert_equals(transformAndZoomRect.width, 512, 'transform and zoom width');+ assert_equals(transformAndZoomRect.height, 512, 'transform and zoom height');+ });+ </script>+</body>diff --git a/Tests/LibWeb/Text/input/wpt-import/css/cssom-view/image-x-y-zoom.html b/Tests/LibWeb/Text/input/wpt-import/css/cssom-view/image-x-y-zoom.htmlnew file mode 100644index 00000000000..8acba66484b--- /dev/null+++ b/Tests/LibWeb/Text/input/wpt-import/css/cssom-view/image-x-y-zoom.html@@ -0,0 +1,66 @@+<!DOCTYPE html>+<title>x and y properties for image elements with css zoom</title>+<link rel="author" title="Yotam Hacohen" href="mailto:[email protected]">+<link rel="author" title="Google" href="http://www.google.com/">+<link rel="help" href="https://drafts.csswg.org/cssom-view/#dom-element-scroll">+<script src="../../resources/testharness.js"></script>+<script src="../../resources/testharnessreport.js"></script>+ <head>+ <style>+ img {+ display: block;+ }+ .container {+ height: 100px;+ width: 100px;+ }++ #x4_zoom_container {+ zoom: 4;+ }++ </style>+ </head>+ <body>+ <div class="container" id="no_zoom_container">+ <img src="support/1x1-green.png" id="no_zoom_image_no_zoom_container">+ <img src="support/1x1-navy.png" style="zoom: 2;" id="x2_zoom_image_no_zoom_container">+ </div>++ <div class="container" id="x4_zoom_container">+ <img style="position: relative; top: 10px;" src="support/1x1-maroon.png" id="no_zoom_image_x4_zoom_container">+ <img src="support/1x1-navy.png" style="zoom: 2;" id="x2_zoom_image_x4_zoom_container">+ <img src="support/1x1-red.png" style="transform: scale(5);" id="transformed_and_zoomed_image">+ </div>+ <script>+ function compareXYCoordinatesToBoundingBox(object, object_name){+ assert_equals(object.x, object.getBoundingClientRect().left, object_name + ' x');+ assert_equals(object.y, object.getBoundingClientRect().top, object_name + ' y');+ }++ window.onload = function() {+ test(function() {+ // Values should be same as values of getBoundingClientRect+ compareXYCoordinatesToBoundingBox(no_zoom_image_no_zoom_container, 'no-zoom image in a no-zoom container');+ compareXYCoordinatesToBoundingBox(x2_zoom_image_no_zoom_container, 'image with css zoom in a no zoom container');+ compareXYCoordinatesToBoundingBox(no_zoom_image_x4_zoom_container, 'no-zoom image in a container with css zoom');+ compareXYCoordinatesToBoundingBox(x2_zoom_image_x4_zoom_container, 'both image and container have css zoom');+ });+ test(function() {+ // Values should be in the root coordinate system, and affected by zoom+ assert_equals(no_zoom_image_no_zoom_container.x, 8, 'no zoom image no zoom container x');+ assert_equals(no_zoom_image_no_zoom_container.y, 8, 'no zoom image no zoom container y');+ assert_equals(x2_zoom_image_no_zoom_container.x, 8, 'x2 zoom image no zoom container x');+ assert_equals(x2_zoom_image_no_zoom_container.y, 9, 'x2 zoom image no zoom container y');+ assert_equals(no_zoom_image_x4_zoom_container.x, 8, 'no zoom image x4 zoom container x');+ // This element also has a position-top, which is affected by zoom+ assert_equals(no_zoom_image_x4_zoom_container.y, 148, 'no zoom image x4 zoom container y');+ assert_equals(x2_zoom_image_x4_zoom_container.x, 8, 'x2 zoom image x4 zoom container x');+ assert_equals(x2_zoom_image_x4_zoom_container.y, 112, 'x2 zoom image x4 zoom container y');+ assert_equals(transformed_and_zoomed_image.x, 8, 'image with transform properties x');+ assert_equals(transformed_and_zoomed_image.y, 120, 'image with transform properties y');+ });+ };++ </script>+ </body>diff --git a/Tests/LibWeb/Text/input/wpt-import/css/cssom-view/offsetTop-offsetLeft-with-zoom.html b/Tests/LibWeb/Text/input/wpt-import/css/cssom-view/offsetTop-offsetLeft-with-zoom.htmlnew file mode 100644index 00000000000..8be5d2a5640--- /dev/null+++ b/Tests/LibWeb/Text/input/wpt-import/css/cssom-view/offsetTop-offsetLeft-with-zoom.html@@ -0,0 +1,100 @@+<!DOCTYPE html>+<title>OffsetTop and OffsetLeft for elements with css zoom</title>+<link rel="author" title="Yotam Hacohen" href="mailto:[email protected]">+<link rel="author" title="Google" href="http://www.google.com/">+<link rel="help" href="https://drafts.csswg.org/css-viewport/">"+<meta name="viewport" content="width=device-width,initial-scale=1">+<script src="../../resources/testharness.js"></script>+<script src="../../resources/testharnessreport.js"></script>++<!DOCTYPE html>++<style>+ .outer_div {+ width: 100px;+ height: 100px;+ border: 1px solid black;+ position: relative;+ margin: 10px;+ }+ .square {+ width: 10px;+ height: 10px;+ background-color: green;+ margin: 1px;+ top:10x;+ left: 10x;+ }+ .one {+ position: relative;+ top: 10px;+ left: 10px;+ }+ .two {+ position: absolute;+ top: 20px;+ left: 20px;+ zoom: 2;+ }++ .three {+ position: absolute;+ top: 10px;+ left: 50px;+ zoom: 0.5;+ }+ span.square {+ display: inline-block;+ }+</style>++<div class="outer_div">+ <div id="unzoomed_one" class="square one"></div>+ <div id="unzoomed_two" class="square two"></div>+ <div id="unzoomed_three" class="square three"></div>+</div>+<div style="zoom:3" class="outer_div">+ <div id="zoomed_one" class="square one"></div>+ <div id="zoomed_two" class="square two"></div>+ <div id="zoomed_three" class="square three"></div>+</div>++<div class="outer_div" style="margin: 30px;" id="outer_div">+ <div id="zoomed_middle" style="margin: 10px; zoom:2">+ <div class="square" id="unzoomed_inner"></div>+ </div>+</div>+<div class="outer_div" style="margin: 30px;">+ <div id="unzoomed_middle">+ <div class="square" id="zoomed_inner" style="zoom:2; width: 100px; height: 100px; border: 1px solid black;"></div>+ </div>+</div>+++<script>+test(() => {+ assert_equals(unzoomed_one.offsetTop, 11, 'unzoomed_one.offsetTop');+ assert_equals(unzoomed_one.offsetLeft, 11, 'unzoomed_one.offsetLeft');+ assert_equals(unzoomed_two.offsetTop, 21, 'unzoomed_two.offsetTop');+ assert_equals(unzoomed_two.offsetLeft, 21, 'unzoomed_two.offsetLeft');+ assert_equals(unzoomed_three.offsetTop, 11, 'unzoomed_three.offsetTop');+ assert_equals(unzoomed_three.offsetLeft, 51, 'unzoomed_three.offsetLeft');+ assert_equals(zoomed_one.offsetTop, 11, 'zoomed_one.offsetTop');+ assert_equals(zoomed_one.offsetLeft, 11, 'zoomed_one.offsetLeft');+ assert_equals(zoomed_two.offsetTop, 21, 'zoomed_two.offsetTop');+ assert_equals(zoomed_two.offsetLeft, 21, 'zoomed_two.offsetLeft');+ assert_equals(zoomed_three.offsetTop, 11, 'zoomed_three.offsetTop');+ assert_equals(zoomed_three.offsetLeft, 51, 'zoomed_three.offsetLeft');+ assert_equals(unzoomed_inner.offsetTop, 10, 'unzoomed_inner.offsetTop');+ assert_equals(unzoomed_inner.offsetLeft, 11, 'unzoomed_inner.offsetLeft');+ assert_equals(zoomed_inner.offsetTop, 0, 'zoomed_inner.offsetTop');+ assert_equals(zoomed_inner.offsetLeft, 1, 'zoomed_inner.offsetLeft');+}, 'Verifies that offsetTop and offsetLeft find the right OffsetParent and return values excluding the target zoom');++test(() => {+ assert_equals(unzoomed_one.offsetWidth, zoomed_one.offsetWidth, "offsetWidth");+ assert_equals(unzoomed_one.offsetHeight, zoomed_one.offsetHeight, "offsetHeight");+ assert_equals(zoomed_inner.offsetWidth, outer_div.offsetWidth, "offsetWidth for nested element");+ assert_equals(zoomed_inner.offsetHeight, outer_div.offsetHeight, "offsetHeight for nested element");+}, 'check that offset is equal between elements when one of them has css zoom');+</script>diff --git a/Tests/LibWeb/Text/input/wpt-import/css/cssom-view/scroll-offsets-fractional-zoom.html b/Tests/LibWeb/Text/input/wpt-import/css/cssom-view/scroll-offsets-fractional-zoom.htmlnew file mode 100644index 00000000000..c9d8f03de47--- /dev/null+++ b/Tests/LibWeb/Text/input/wpt-import/css/cssom-view/scroll-offsets-fractional-zoom.html@@ -0,0 +1,58 @@+<!DOCTYPE html>+<meta charset="utf-8">+<meta name="viewport" content="width=device-width, initial-scale=1">+<link rel="author" title="Manuel Rego Casasnovas" href="mailto:[email protected]">+<link rel="help" href="https://drafts.csswg.org/cssom-view/#extension-to-the-element-interface">+<meta name="assert" content="This test checks that the scroll offsets behave as expected on fractional zoom situations.">+<script src="../../resources/testharness.js"></script>+<script src="../../resources/testharnessreport.js"></script>+<style>+ .scrollable-area {+ width: 100px;+ height: 100px;+ overflow: scroll;+ }+ .content {+ width: 500px;+ height: 500px;+ background: lightgrey;+ }+</style>+<div id="target" class="scrollable-area">+ <div class="content"></div>+</div>+<script>+ function runTest(zoom, x, y) {+ // Scroll offsets might be snapped to device pixels for performance or+ // rendering quality. Since scroll{Top,Left} round, we need to allow up to+ // 1px of difference with the expected value.+ const EPSILON = 1;++ target.scrollTo(x, y);+ test(() => {+ assert_approx_equals(target.scrollLeft, x, EPSILON, `scrollLeft should be ${x}`);+ }, `scrollLeft after scrollTo(${x}, ${y}) with 'zoom: ${zoom}'`);+ test(() => {+ assert_approx_equals(target.scrollTop, y, EPSILON, `scrollTop should be ${y}`);+ }, `scrollTop after scrollTo(${x}, ${y}) with 'zoom: ${zoom}'`);+ }++ function runTests(zoom) {+ target.style.zoom = zoom;++ runTest(zoom, 0, 0);+ runTest(zoom, 1, 2);+ runTest(zoom, 13, 61);+ runTest(zoom, 75, 100);+ }++ runTests(0.75);+ runTests(0.9);+ runTests(1);+ runTests(1.13);+ runTests(1.25);+ runTests(1.5);+ runTests(1.9);+ runTests(2);+ runTests(3.33);+</script>diff --git a/Tests/LibWeb/Text/input/wpt-import/css/cssom-view/scroll-zoom.html b/Tests/LibWeb/Text/input/wpt-import/css/cssom-view/scroll-zoom.htmlnew file mode 100644index 00000000000..fa0e7f7a46b--- /dev/null+++ b/Tests/LibWeb/Text/input/wpt-import/css/cssom-view/scroll-zoom.html@@ -0,0 +1,87 @@+<!DOCTYPE html>+<title>scroll properties for elements with css zoom</title>+<meta name="viewport" content="width=device-width,initial-scale=1">+<link rel="author" title="Yotam Hacohen" href="mailto:[email protected]">+<link rel="author" title="Google" href="http://www.google.com/">+<link rel="help" href="https://drafts.csswg.org/cssom-view/#dom-element-scroll">+<script src="../../resources/testharness.js"></script>+<script src="../../resources/testharnessreport.js"></script>+ <head>+ <style>+ .container {+ height: 100px;+ width: 100px;+ overflow: scroll;+ }+ .content {+ height: 250px;+ width: 250px;+ background-image: linear-gradient(red, yellow);+ }+ #x4_zoom_container {+ zoom: 4;+ }+ </style>+ </head>+ <body>+ <div class="container" id="no_zoom_container">+ <div class="content"></div>+ </div>+ <div class="container" id="x4_zoom_container">+ <div class="content"></div>+ </div>+ <div class="container" id="container_with_zoomed_content">+ <div class="content" style="zoom: 2;"></div>+ </div>+ <div style="zoom: 2;">+ <div class="container" id="scroller_in_zoomed_element">+ <div class="content"></div>+ </div>+ </div>+ <script>+ setup(() => {+ window.noZoom = document.getElementById("no_zoom_container");+ window.withZoom = document.getElementById("x4_zoom_container");+ window.scrollerWithZoomContent = document.getElementById("container_with_zoomed_content");+ window.scrollerInZoomedElement = document.getElementById("scroller_in_zoomed_element");+ });+ test(function() {+ assert_true(!!noZoom, "no zoom target exists");+ assert_true(!!withZoom, "zoom target exists");+ });+ test(function() {+ // We remove zoom effects for scroll height and scroll width so values+ // should be same for elements with and without zoom+ // However scroll values should be changed by zoom on content+ assert_equals(noZoom.scrollHeight, withZoom.scrollHeight, 'scrollHeight');+ assert_equals(noZoom.scrollWidth, withZoom.scrollWidth, 'scrollWidth');+ assert_equals(noZoom.scrollHeight*2, scrollerWithZoomContent.scrollHeight, 'scroll height for zoomed content');+ assert_equals(noZoom.scrollWidth*2, scrollerWithZoomContent.scrollWidth, 'scroll width for zoomed content');+ assert_equals(noZoom.scrollHeight, scrollerInZoomedElement.scrollHeight, 'scroll height for scroller in zoomed element');+ assert_equals(noZoom.scrollWidth, scrollerInZoomedElement.scrollWidth, 'scroll width for scroller in zoomed element');+ }, `scroll{Width, Height}`);++ test(function() {+ assert_equals(noZoom.scrollTop, 0, 'scrollTop should be 0');+ assert_equals(noZoom.scrollLeft, 0, 'scrollLeft should be 0');++ assert_equals(noZoom.scrollTop, withZoom.scrollTop, 'scrollTop');+ assert_equals(noZoom.scrollLeft, withZoom.scrollLeft, 'scrollLeft');++ noZoom.scrollTo(noZoom.scrollWidth / 2, noZoom.scrollHeight / 2);+ withZoom.scrollTo(withZoom.scrollWidth / 2, withZoom.scrollHeight / 2);++ assert_not_equals(noZoom.scrollTop, 0, 'scrollTop should not be 0');+ assert_not_equals(noZoom.scrollLeft, 0, 'scrollLeft should not be 0');++ assert_equals(noZoom.scrollTop, withZoom.scrollTop, 'scrollTop after scrollTo');+ assert_equals(noZoom.scrollLeft, withZoom.scrollLeft, 'scrollLeft after scrollTo');++ noZoom.scrollBy(2, 2);+ withZoom.scrollBy(2, 2);++ assert_equals(noZoom.scrollTop, withZoom.scrollTop, 'scrollTop after scrollBy');+ assert_equals(noZoom.scrollLeft, withZoom.scrollLeft, 'scrollLeft after scrollBy');+ }, `scroll{Top, Left}`);+ </script>+ </body>diff --git a/Tests/LibWeb/Text/input/wpt-import/css/cssom-view/scrollWidthHeight-not-scrollable-fractional-zoom.html b/Tests/LibWeb/Text/input/wpt-import/css/cssom-view/scrollWidthHeight-not-scrollable-fractional-zoom.htmlnew file mode 100644index 00000000000..d3d9b7b6150--- /dev/null+++ b/Tests/LibWeb/Text/input/wpt-import/css/cssom-view/scrollWidthHeight-not-scrollable-fractional-zoom.html@@ -0,0 +1,49 @@+<!DOCTYPE html>+<meta charset="utf-8">+<title>scrollWidth equals clientWidth for a non-scrollable element with a fractional used width under CSS zoom</title>+<link rel="author" title="Brent Fulgham" href="mailto:[email protected]">+<link rel="help" href="https://drafts.csswg.org/cssom-view/#dom-element-scrollwidth">+<link rel="help" href="https://drafts.csswg.org/cssom-view/#dom-element-clientwidth">+<meta name="assert" content="An element with no overflow reports the same integer for scrollWidth and clientWidth, even when CSS zoom makes its used border-box width fractional in unzoomed CSS pixels.">+<script src="../../resources/testharness.js"></script>+<script src="../../resources/testharnessreport.js"></script>+<style>+/* Each width is chosen so that width * zoom is an exact integer: the used+ border-box width is device-pixel aligned, while the unzoomed CSS-pixel value+ is fractional. That is what exposes a size getter that rounds differently+ from its siblings. See subpixel-sizes-and-offsets.tentative.html for the+ unzoomed form of the same rule. */+.box {+ box-sizing: border-box;+ height: 20px;+ background: silver;+}+#zoom125a { zoom: 1.25; width: 203.2px; }+#zoom125b { zoom: 1.25; width: 307.2px; }+#zoom130 { zoom: 1.3; width: 202.30769231px; }+#zoom150 { zoom: 1.5; width: 203.33333333px; }+#zoom075 { zoom: 0.75; width: 202.66666667px; }+</style>+<div id="zoom125a" class="box"></div>+<div id="zoom125b" class="box"></div>+<div id="zoom130" class="box"></div>+<div id="zoom150" class="box"></div>+<div id="zoom075" class="box"></div>+<script>+const cases = [+ { id: "zoom125a", zoom: "1.25", width: "203.2px" },+ { id: "zoom125b", zoom: "1.25", width: "307.2px" },+ { id: "zoom130", zoom: "1.3", width: "202.30769231px" },+ { id: "zoom150", zoom: "1.5", width: "203.33333333px" },+ { id: "zoom075", zoom: "0.75", width: "202.66666667px" },+];++for (const testCase of cases) {+ test(() => {+ const box = document.getElementById(testCase.id);+ // Pages detect scrollability with `elm.scrollWidth !== elm.clientWidth`.+ assert_equals(box.scrollWidth, box.clientWidth,+ "scrollWidth must equal clientWidth when there is nothing to overflow");+ }, `scrollWidth equals clientWidth for a non-scrollable ${testCase.width} box with 'zoom: ${testCase.zoom}'`);+}+</script>diff --git a/Tests/LibWeb/Text/input/wpt-import/css/cssom-view/support/1x1-green.png b/Tests/LibWeb/Text/input/wpt-import/css/cssom-view/support/1x1-green.pngnew file mode 100644index 00000000000..b98ca0ba0a0Binary files /dev/null and b/Tests/LibWeb/Text/input/wpt-import/css/cssom-view/support/1x1-green.png differdiff --git a/Tests/LibWeb/Text/input/wpt-import/css/cssom-view/support/1x1-maroon.png b/Tests/LibWeb/Text/input/wpt-import/css/cssom-view/support/1x1-maroon.pngnew file mode 100644index 00000000000..3f86b072195Binary files /dev/null and b/Tests/LibWeb/Text/input/wpt-import/css/cssom-view/support/1x1-maroon.png differdiff --git a/Tests/LibWeb/Text/input/wpt-import/css/cssom-view/support/1x1-navy.png b/Tests/LibWeb/Text/input/wpt-import/css/cssom-view/support/1x1-navy.pngnew file mode 100644index 00000000000..9b9a03955baBinary files /dev/null and b/Tests/LibWeb/Text/input/wpt-import/css/cssom-view/support/1x1-navy.png differdiff --git a/Tests/LibWeb/Text/input/wpt-import/css/cssom-view/support/1x1-red.png b/Tests/LibWeb/Text/input/wpt-import/css/cssom-view/support/1x1-red.pngnew file mode 100644index 00000000000..6bd73ac1018Binary files /dev/null and b/Tests/LibWeb/Text/input/wpt-import/css/cssom-view/support/1x1-red.png differ