Skip to content
Permalink
Browse files
[LBSE] Add transform related tests from LBSE downstream
https://bugs.webkit.org/show_bug.cgi?id=247668

Reviewed by Rob Buis.

Add more tests that were written in the past years and haven't
been upstreamed yet. They mostly cover laying out objects with tiny
dimensions, to assure LBSE renderers these kind of documents properly.
In fact it improves over the legacy engine, which had issues with these
kind of documents (see discussion of test results below).

svg/transforms/transform-origin-and-box-getCTM.html deserves to be a
WPT test, since currently all browser deviate. To my understanding
LBSE handles all combinations correctly, whereas the legacy engine
performed worst before.

Test discussion:

- svg/custom/circle-move-invalidation-small-viewBox.svg
  1) Purpose
  Copy from circle-move-invalidation.svg, but with a user coordinate system
  that is two orders of magnitudes smaller -- verify repainting works fine.

  2) Results
  Works fine across FF/Chrome/SafariLegacy/SafariLBSE.
  (Used to have a LBSE-only regression, that's why the test got added)

- svg/transforms/layout-tiny-elements-in-scaled-group.svg
  1) Purpose
  Verifies that using small numbers for e.g. rect dimensions works as expected.
  The test uses four rectangles, with a width/height of 0.0015 - which is an order
  of magnitude smaller than the LayoutUnit epsilon (~1/64 ~ 0.015625), enclosed
  by a group that scales the content by a factor 10000.

  2) Results
    o FF: Layout/rendering is broken - the blue rect covers the whole viewport.
    o Chrome: Works as expected.
    o SafariLegacy: Empty document, nothing rendered.
    o SafariLBSE: Works as expected.

- svg/transforms/layout-tiny-elements.svg, and
  svg/transforms/rotation-tiny-element.svg
  1) Purpose
  Same as layout-tiny-elements-in-scaled-group.svg, however not enclosing the
  rectangles in a scaled group, but transforming the rects themselves.

  2) Results
  Works fine across Chrome/SafariLegacy/SafariLBSE. FF shows the same
  broken behavior as for layout-tiny-elements-in-scaled-group.svg

- svg/transforms/nested-containers.svg, and
  svg/transforms/nested-transforms-rotation-origin-with-viewBox.svg, and
  svg/transforms/nested-transforms-rotation-origin.svg
  1) Purpose
  Basic reftests to check nesting containers with scale/rotation/translation works as intended.

  2) Results
  Works fine across FF/Chrome/SafariLegacy/SafariLBSE.

- svg/transforms/rotation-origin-in-small-units.svg
  1) Purpose
  Testing small units as rotation origins in transform attributes.

  2) Results
    o FF: Layout/rendering is broken - tilted, parallel red/yellow stripes + large blue rect appear.
    o Chrome: Works as expected.
    o SafariLegacy: Empty document, nothing rendered.
    o SafariLBSE: Works as expected.

- svg/transforms/rotation-tiny-element-in-group.svg,
  svg/transforms/translation-tiny-element.svg

  1) Purpose
  Similar to rotation-tiny-element.svg (however the rotation is applied on an enclosing container).

  2) Results
    o FF: Layout/rendering is broken - red rectangle covers the whole viewport (however at right origin, and rotated as expected for the rotation-* test).
    o Chrome: Works as expected.
    o SafariLegacy: Empty document, nothing rendered.
    o SafariLBSE: Works as expected.

- svg/transforms/transform-origin-and-box-getCTM.html, and
  svg/transforms/transform-origin-and-box.svg
  1) Purpose
  transform-origin-and-box.svg checks various transform-box / transform-origin permutations, combined with transform
  defined as SVG transform attribute. The *getCTM.html then queries the SVG JS exposed geometry (getCTM/getBBox/etc.).

  2) Results
  transform-origin-and-box.svg works fine.
  transform-origin-and-box-getCTM.html highlights a number of cross-browser differences:

    o FF: Fails getCTM() / getScreenCTM() (+ getAbsoluteBBoxById()) tests for rect7 / rect8 / rect9.
    o Chrome: Works as expected.
    o SafariLegacy: Fails getCTM() / getScreenCTM() (+ getAbsoluteBBoxById()) for rect3 / rect4 / rect5 / rect6 / rect9.
    o SafariLBSE: Fails all tests -- getCTM is currently not implemented in a LBSE-aware way (patch is ready to fix that -- then we'll pass all tests!)

- svg/transforms/transformed-child-in-container.svg, and
  svg/transforms/transformed-child-in-container-small-units.svg, and
  svg/transforms/transformed-container.svg, and
  svg/transforms/transformed-container-small-units.svg
  1) Purpose
  Basic reftests to check nesting transformed and untransformed containers works fine.
  Used for original LBSE bootstrapping process.

  2) Results:
  Works fine across FF/Chrome/SafariLegacy/SafariLBSE.

No change in functionality, only adding new tests.

* LayoutTests/platform/glib/TestExpectations:
* LayoutTests/platform/ios-wk2/TestExpectations:
* LayoutTests/platform/mac-ventura-wk2-lbse-text/TestExpectations:
* LayoutTests/platform/mac-wk2/TestExpectations:
* LayoutTests/platform/win/TestExpectations:
* LayoutTests/svg/custom/circle-move-invalidation-small-viewBox-expected.svg: Added.
* LayoutTests/svg/custom/circle-move-invalidation-small-viewBox.svg: Added.
* LayoutTests/svg/transforms/layout-tiny-elements-expected.svg: Added.
* LayoutTests/svg/transforms/layout-tiny-elements-in-scaled-group-expected.svg: Added.
* LayoutTests/svg/transforms/layout-tiny-elements-in-scaled-group.svg: Added.
* LayoutTests/svg/transforms/layout-tiny-elements.svg: Added.
* LayoutTests/svg/transforms/nested-containers-expected.svg: Added.
* LayoutTests/svg/transforms/nested-containers.svg: Added.
* LayoutTests/svg/transforms/nested-transforms-rotation-origin-expected.svg: Added.
* LayoutTests/svg/transforms/nested-transforms-rotation-origin-with-viewBox-expected.svg: Added.
* LayoutTests/svg/transforms/nested-transforms-rotation-origin-with-viewBox.svg: Added.
* LayoutTests/svg/transforms/nested-transforms-rotation-origin.svg: Added.
* LayoutTests/svg/transforms/rotation-origin-in-small-units-expected.svg: Added.
* LayoutTests/svg/transforms/rotation-origin-in-small-units.svg: Added.
* LayoutTests/svg/transforms/rotation-tiny-element-expected.svg: Added.
* LayoutTests/svg/transforms/rotation-tiny-element-in-group-expected.svg: Added.
* LayoutTests/svg/transforms/rotation-tiny-element-in-group.svg: Added.
* LayoutTests/svg/transforms/rotation-tiny-element.svg: Added.
* LayoutTests/svg/transforms/transform-origin-and-box-expected.svg: Added.
* LayoutTests/svg/transforms/transform-origin-and-box-getCTM-expected.txt: Added.
* LayoutTests/svg/transforms/transform-origin-and-box-getCTM.html: Added.
* LayoutTests/svg/transforms/transform-origin-and-box.svg: Added.
* LayoutTests/svg/transforms/transformed-child-in-container-expected.svg: Added.
* LayoutTests/svg/transforms/transformed-child-in-container-small-units-expected.svg: Added.
* LayoutTests/svg/transforms/transformed-child-in-container-small-units.svg: Added.
* LayoutTests/svg/transforms/transformed-child-in-container.svg: Added.
* LayoutTests/svg/transforms/transformed-container-expected.svg: Added.
* LayoutTests/svg/transforms/transformed-container-small-units-expected.svg: Added.
* LayoutTests/svg/transforms/transformed-container-small-units.svg: Added.
* LayoutTests/svg/transforms/transformed-container.svg: Added.
* LayoutTests/svg/transforms/translation-tiny-element-expected.svg: Added.
* LayoutTests/svg/transforms/translation-tiny-element.svg: Added.

Canonical link: https://commits.webkit.org/256948@main
  • Loading branch information
nikolaszimmermann committed Nov 22, 2022
1 parent 0ed4e7b commit 4b037413854dfa4e198e32cf46e9a653bbf67724
Show file tree
Hide file tree
Showing 37 changed files with 662 additions and 15 deletions.
@@ -1309,6 +1309,18 @@ imported/w3c/web-platform-tests/css/filter-effects/css-filters-animation-opacity
svg/compositing [ Skip ]
svg/z-index [ Skip ]

# SVG tests that are broken in the legacy SVG engine, but pass using LBSE.
svg/custom/circle-move-invalidation-small-viewBox.svg [ ImageOnlyFailure ]
svg/transforms/layout-tiny-elements-in-scaled-group.svg [ ImageOnlyFailure ]
svg/transforms/rotation-origin-in-small-units.svg [ ImageOnlyFailure ]
svg/transforms/rotation-tiny-element-in-group.svg [ ImageOnlyFailure ]
svg/transforms/transform-origin-and-box-getCTM.html [ Failure ]
svg/transforms/transformed-child-in-container-small-units.svg [ ImageOnlyFailure ]
svg/transforms/transformed-child-in-container.svg [ ImageOnlyFailure ]
svg/transforms/transformed-container-small-units.svg [ ImageOnlyFailure ]
svg/transforms/transformed-container.svg [ ImageOnlyFailure ]
svg/transforms/translation-tiny-element.svg [ ImageOnlyFailure ]

#////////////////////////////////////////////////////////////////////////////////////////
# End of SVG-related bugs
#////////////////////////////////////////////////////////////////////////////////////////
@@ -187,6 +187,13 @@ scrollbars/scrollbars-on-positioned-content.html [ Failure ]
css3/scroll-snap/scroll-padding-mainframe-paging.html [ Failure ]
css3/scroll-snap/scroll-padding-overflow-paging.html [ Failure ]

# SVG tests that are broken in the legacy SVG engine, but pass using LBSE.
svg/transforms/layout-tiny-elements-in-scaled-group.svg [ ImageOnlyFailure ]
svg/transforms/rotation-origin-in-small-units.svg [ ImageOnlyFailure ]
svg/transforms/rotation-tiny-element-in-group.svg [ ImageOnlyFailure ]
svg/transforms/transform-origin-and-box-getCTM.html [ Failure ]
svg/transforms/translation-tiny-element.svg [ ImageOnlyFailure ]

# SVG tests that time out (these require EventSender)
svg/animations/animVal-basics.html
svg/animations/animate-calcMode-spline-by.html
@@ -635,18 +635,22 @@ svg/filters/feGaussianBlur-negative-deviation.svg [ ImageOnlyFailure Crash ]
# OVERRIDES #
###############
# Reset results inherited from TestExpectations chaining
svg/W3C-SVG-1.1/fonts-elem-04-b.svg [ Pass ]
svg/W3C-SVG-1.1/text-altglyph-01-b.svg [ Pass ]
svg/W3C-SVG-1.1/text-intro-01-t.svg [ Pass ]
svg/W3C-SVG-1.1/text-intro-02-b.svg [ Pass ]
svg/W3C-SVG-1.1/text-intro-03-b.svg [ Pass ]
svg/W3C-SVG-1.1/text-intro-04-t.svg [ Pass ]
svg/W3C-SVG-1.1/text-text-06-t.svg [ Pass ]
svg/resource-invalidation/mask-resource-invalidation.html [ Pass ]
svg/transforms/animated-path-inside-transformed-html.xhtml [ Pass ]
svg/transforms/layout-tiny-elements-in-scaled-group.svg [ Pass ]
svg/transforms/rotation-origin-in-small-units.svg [ Pass ]
svg/transforms/rotation-tiny-element-in-group.svg [ Pass ]
svg/transforms/transformed-child-in-container.svg [ Pass ImageOnlyFailure ]
svg/transforms/transformed-text-fill-gradient.html [ Pass ]
svg/transforms/translation-tiny-element.svg [ Pass ]
svg/W3C-SVG-1.1/fonts-elem-04-b.svg [ Pass ]
svg/W3C-SVG-1.1/text-altglyph-01-b.svg [ Pass ]
svg/W3C-SVG-1.1/text-intro-01-t.svg [ Pass ]
svg/W3C-SVG-1.1/text-intro-02-b.svg [ Pass ]
svg/W3C-SVG-1.1/text-intro-03-b.svg [ Pass ]
svg/W3C-SVG-1.1/text-intro-04-t.svg [ Pass ]
svg/W3C-SVG-1.1/text-text-06-t.svg [ Pass ]
svg/custom/circle-move-invalidation-small-viewBox.svg [ Pass ]
svg/resource-invalidation/mask-resource-invalidation.html [ Pass ]
svg/transforms/animated-path-inside-transformed-html.xhtml [ Pass ]
svg/transforms/layout-tiny-elements-in-scaled-group.svg [ Pass ]
svg/transforms/rotation-origin-in-small-units.svg [ Pass ]
svg/transforms/rotation-tiny-element-in-group.svg [ Pass ]
svg/transforms/transformed-child-in-container-small-units.svg [ Pass ]
svg/transforms/transformed-child-in-container.svg [ Pass ImageOnlyFailure ]
svg/transforms/transformed-container-small-units.svg [ Pass ]
svg/transforms/transformed-container.svg [ Pass ]
svg/transforms/transformed-text-fill-gradient.html [ Pass ]
svg/transforms/translation-tiny-element.svg [ Pass ]
@@ -2373,6 +2373,14 @@ webkit.org/b/245994 imported/w3c/web-platform-tests/streams/readable-byte-stream
webkit.org/b/214290 [ BigSur Monterey ] imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-overrides-uax-behavior-009.html [ ImageOnlyFailure ]
webkit.org/b/214290 [ BigSur Monterey ] imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-overrides-uax-behavior-010.html [ ImageOnlyFailure ]

# SVG tests that are broken in the legacy SVG engine, but pass using LBSE.
svg/transforms/layout-tiny-elements-in-scaled-group.svg [ ImageOnlyFailure ]
svg/transforms/rotation-origin-in-small-units.svg [ ImageOnlyFailure ]
svg/transforms/rotation-tiny-element-in-group.svg [ ImageOnlyFailure ]
svg/transforms/transform-origin-and-box-getCTM.html [ Failure ]
svg/transforms/transformed-child-in-container.svg [ ImageOnlyFailure ]
svg/transforms/translation-tiny-element.svg [ ImageOnlyFailure ]

# webkit.org/b/243681 Newly imported tests that fail on BigSur+
[ BigSur+ Debug ] imported/w3c/web-platform-tests/IndexedDB/structured-clone.any.html?101-last [ Failure ]
[ BigSur+ Release ] imported/w3c/web-platform-tests/IndexedDB/structured-clone.any.html?101-last [ Pass Failure ]
@@ -2263,6 +2263,18 @@ svg/animations/svglength-element-removed-crash.svg [ Failure ]
svg/compositing [ Skip ]
svg/z-index [ Skip ]

# SVG tests that are broken in the legacy SVG engine, but pass using LBSE.
svg/custom/circle-move-invalidation-small-viewBox.svg [ ImageOnlyFailure ]
svg/transforms/layout-tiny-elements-in-scaled-group.svg [ ImageOnlyFailure ]
svg/transforms/rotation-origin-in-small-units.svg [ ImageOnlyFailure ]
svg/transforms/rotation-tiny-element-in-group.svg [ ImageOnlyFailure ]
svg/transforms/transform-origin-and-box-getCTM.html [ Failure ]
svg/transforms/transformed-child-in-container-small-units.svg [ ImageOnlyFailure ]
svg/transforms/transformed-child-in-container.svg [ ImageOnlyFailure ]
svg/transforms/transformed-container-small-units.svg [ ImageOnlyFailure ]
svg/transforms/transformed-container.svg [ ImageOnlyFailure ]
svg/transforms/translation-tiny-element.svg [ ImageOnlyFailure ]

################################################################################
################### End SVG Issues #######################
################################################################################
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,47 @@
Tests getCTM/getScreenCTM in combination with CSS transform-origin / transform-box

On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".


PASS !!iframe.contentDocument is true
PASS iframe.contentDocument.toString() is "[object XMLDocument]"
FAIL getCTMById('rect1') should be [2.0 0.0 0.0 2.0 -40.0 -40.0]. Was [2.0 0.0 0.0 2.0 23.0 73.0].
FAIL getScreenCTMById('rect1') should be [2.0 0.0 0.0 2.0 -37.0 -37.0]. Was [2.0 0.0 0.0 2.0 23.0 73.0].
PASS getBBoxById('rect1') is "[30 55 50 50]"
FAIL getAbsoluteBBoxById('rect1') should be [23 73 100 100]. Was [83 183 100 100].
FAIL getCTMById('rect2') should be [2.0 0.0 0.0 2.0 -70.0 -50.0]. Was [2.0 0.0 0.0 2.0 -10.0 5.0].
FAIL getScreenCTMById('rect2') should be [2.0 0.0 0.0 2.0 -37.0 103.0]. Was [2.0 0.0 0.0 2.0 83.0 213.0].
PASS getBBoxById('rect2') is "[60 55 50 50]"
FAIL getAbsoluteBBoxById('rect2') should be [83 213 100 100]. Was [203 323 100 100].
FAIL getCTMById('rect3') should be [8.0 0.0 0.0 3.0 -280.0 -75.0]. Was [8.0 0.0 0.0 3.0 140.0 35.0].
FAIL getScreenCTMById('rect3') should be [8.0 0.0 0.0 3.0 -247.0 -92.0]. Was [8.0 0.0 0.0 3.0 233.0 73.0].
PASS getBBoxById('rect3') is "[60 55 25 25]"
FAIL getAbsoluteBBoxById('rect3') should be [233 73 200 75]. Was [713 238 200 75].
FAIL getCTMById('rect4') should be [2.0 0.0 0.0 2.0 -40.0 220.0]. Was [2.0 0.0 0.0 2.0 23.0 333.0].
FAIL getScreenCTMById('rect4') should be [2.0 0.0 0.0 2.0 -37.0 223.0]. Was [2.0 0.0 0.0 2.0 23.0 333.0].
PASS getBBoxById('rect4') is "[30 55 50 50]"
FAIL getAbsoluteBBoxById('rect4') should be [23 333 100 100]. Was [83 443 100 100].
FAIL getCTMById('rect5') should be [2.0 0.0 0.0 2.0 10.0 10.0]. Was [2.0 0.0 0.0 2.0 70.0 65.0].
FAIL getScreenCTMById('rect5') should be [2.0 0.0 0.0 2.0 -37.0 363.0]. Was [2.0 0.0 0.0 2.0 83.0 473.0].
PASS getBBoxById('rect5') is "[60 55 50 50]"
FAIL getAbsoluteBBoxById('rect5') should be [83 473 100 100]. Was [203 583 100 100].
FAIL getCTMById('rect6') should be [8.0 0.0 0.0 3.0 -200.0 -15.0]. Was [8.0 0.0 0.0 3.0 220.0 95.0].
FAIL getScreenCTMById('rect6') should be [8.0 0.0 0.0 3.0 -247.0 168.0]. Was [8.0 0.0 0.0 3.0 233.0 333.0].
PASS getBBoxById('rect6') is "[60 55 25 25]"
FAIL getAbsoluteBBoxById('rect6') should be [233 333 200 75]. Was [713 498 200 75].
FAIL getCTMById('rect7') should be [2.0 0.0 0.0 2.0 467.5 17.5]. Was [2.0 0.0 0.0 2.0 530.5 130.5].
FAIL getScreenCTMById('rect7') should be [2.0 0.0 0.0 2.0 470.5 20.5]. Was [2.0 0.0 0.0 2.0 530.5 130.5].
PASS getBBoxById('rect7') is "[30 55 50 50]"
FAIL getAbsoluteBBoxById('rect7') should be [530.5 130.5 100 100]. Was [590.5 240.5 100 100].
FAIL getCTMById('rect8') should be [2.0 0.0 0.0 2.0 -155.0 -130.0]. Was [2.0 0.0 0.0 2.0 -95.0 -75.0].
FAIL getScreenCTMById('rect8') should be [2.0 0.0 0.0 2.0 428.0 123.0]. Was [2.0 0.0 0.0 2.0 548.0 233.0].
PASS getBBoxById('rect8') is "[60 55 50 50]"
FAIL getAbsoluteBBoxById('rect8') should be [548 233 100 100]. Was [668 343 100 100].
FAIL getCTMById('rect9') should be [8.0 0.0 0.0 3.0 -620.0 -195.0]. Was [8.0 0.0 0.0 3.0 -200.0 -85.0].
FAIL getScreenCTMById('rect9') should be [8.0 0.0 0.0 3.0 3.0 -112.0]. Was [8.0 0.0 0.0 3.0 483.0 53.0].
PASS getBBoxById('rect9') is "[60 55 25 25]"
FAIL getAbsoluteBBoxById('rect9') should be [483 53 200 75]. Was [963 218 200 75].
PASS successfullyParsed is true

TEST COMPLETE

0 comments on commit 4b03741

Please sign in to comment.