Changeset 286591 in webkit
- Timestamp:
- Dec 7, 2021 12:27:13 AM (8 months ago)
- Location:
- trunk
- Files:
-
- 14 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/TestExpectations (modified) (2 diffs)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/animation/transform-interpolation-verify-reftests-expected.txt (modified) (2 diffs)
-
LayoutTests/transforms/3d/general/3dtransform-values-expected.txt (modified) (1 diff)
-
LayoutTests/transforms/3d/general/3dtransform-values.html (modified) (1 diff)
-
LayoutTests/transforms/3d/general/prefixed-3dtransform-values-expected.txt (modified) (1 diff)
-
LayoutTests/transforms/3d/general/prefixed-3dtransform-values.html (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/platform/graphics/transforms/PerspectiveTransformOperation.h (modified) (1 diff)
-
Source/WebCore/rendering/RenderLayer.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderObject.cpp (modified) (1 diff)
-
Source/WebCore/rendering/style/RenderStyle.cpp (modified) (1 diff)
-
Source/WebCore/rendering/style/RenderStyle.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r286589 r286591 1 2021-12-07 Martin Robinson <mrobinson@webkit.org> 2 3 perspective() <= 1px should be clamped to 1px 4 https://bugs.webkit.org/show_bug.cgi?id=232619 5 <rdar://problem/85197362> 6 7 Reviewed by Simon Fraser. 8 9 * TestExpectations: Mark tests as passing. 10 * transforms/3d/general/3dtransform-values.html: 11 * transforms/3d/general/prefixed-3dtransform-values.html: 12 * transforms/3d/general/3dtransform-values-expected.txt: 13 * transforms/3d/general/prefixed-3dtransform-values-expected.txt: 14 1 15 2021-12-06 Said Abou-Hallawa <said@apple.com> 2 16 -
trunk/LayoutTests/TestExpectations
r286546 r286591 3923 3923 webkit.org/b/230080 imported/w3c/web-platform-tests/css/css-transforms/perspective-containing-block-dynamic-1b.html [ ImageOnlyFailure ] 3924 3924 webkit.org/b/230080 imported/w3c/web-platform-tests/css/css-transforms/perspective-transforms-equivalence.html [ ImageOnlyFailure ] 3925 webkit.org/b/230080 imported/w3c/web-platform-tests/css/css-transforms/perspective-zero-2.html [ ImageOnlyFailure ]3926 webkit.org/b/230080 imported/w3c/web-platform-tests/css/css-transforms/perspective-zero-3.html [ ImageOnlyFailure ]3927 webkit.org/b/230080 imported/w3c/web-platform-tests/css/css-transforms/perspective-zero.html [ ImageOnlyFailure ]3928 3925 webkit.org/b/230080 imported/w3c/web-platform-tests/css/css-transforms/preserve3d-and-filter-no-perspective.html [ ImageOnlyFailure ] 3929 3926 webkit.org/b/230080 imported/w3c/web-platform-tests/css/css-transforms/rotateY-180deg-with-overflow-scroll.html [ ImageOnlyFailure ] … … 3988 3985 webkit.org/b/230080 imported/w3c/web-platform-tests/css/css-transforms/transform3d-perspective-003.html [ ImageOnlyFailure ] 3989 3986 webkit.org/b/230080 imported/w3c/web-platform-tests/css/css-transforms/transform3d-perspective-004.html [ ImageOnlyFailure ] 3990 webkit.org/b/230080 imported/w3c/web-platform-tests/css/css-transforms/transform3d-perspective-005.html [ ImageOnlyFailure ]3991 3987 webkit.org/b/230080 imported/w3c/web-platform-tests/css/css-transforms/transform3d-preserve3d-006.html [ Pass ImageOnlyFailure ] 3992 3988 webkit.org/b/230080 imported/w3c/web-platform-tests/css/css-transforms/transform3d-preserve3d-007.html [ Pass ImageOnlyFailure ] -
trunk/LayoutTests/imported/w3c/ChangeLog
r286550 r286591 1 2021-12-07 Martin Robinson <mrobinson@webkit.org> 2 3 perspective() <= 1px should be clamped to 1px 4 https://bugs.webkit.org/show_bug.cgi?id=232619 5 <rdar://problem/85197362> 6 7 Reviewed by Simon Fraser. 8 9 * web-platform-tests/css/css-transforms/animation/transform-interpolation-verify-reftests-expected.txt: Update to show newly passing subtests. 10 1 11 2021-12-06 Tadeu Zagallo <tzagallo@apple.com> 2 12 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/animation/transform-interpolation-verify-reftests-expected.txt
r286289 r286591 156 156 PASS CSS Animations: property <transform> from [perspective(100px) translateZ(15px)] to [perspective(25px) translateZ(15px)] at (0.5) should be [perspective(40px) translateZ(15px)] 157 157 PASS Web Animations: property <transform> from [perspective(100px) translateZ(15px)] to [perspective(25px) translateZ(15px)] at (0.5) should be [perspective(40px) translateZ(15px)] 158 FAIL CSS Transitions: property <transform> from [perspective(0.1px) translateZ(0.25px)] to [perspective(0.1px) translateZ(0.25px)] at (0.5) should be [perspective(1px) translateZ(0.25px)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , - 1 , 0 , 0 , 0.25 , 0.75 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , - 10 , 0 , 0 , 0.25 , - 1.5 ) " 159 FAIL CSS Transitions with transition: all: property <transform> from [perspective(0.1px) translateZ(0.25px)] to [perspective(0.1px) translateZ(0.25px)] at (0.5) should be [perspective(1px) translateZ(0.25px)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , - 1 , 0 , 0 , 0.25 , 0.75 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , - 10 , 0 , 0 , 0.25 , - 1.5 ) " 160 FAIL CSS Animations: property <transform> from [perspective(0.1px) translateZ(0.25px)] to [perspective(0.1px) translateZ(0.25px)] at (0.5) should be [perspective(1px) translateZ(0.25px)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , - 1 , 0 , 0 , 0.25 , 0.75 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , - 10 , 0 , 0 , 0.25 , - 1.5 ) " 161 FAIL Web Animations: property <transform> from [perspective(0.1px) translateZ(0.25px)] to [perspective(0.1px) translateZ(0.25px)] at (0.5) should be [perspective(1px) translateZ(0.25px)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , - 1 , 0 , 0 , 0.25 , 0.75 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , - 10 , 0 , 0 , 0.25 , - 1.5 ) " 162 FAIL CSS Transitions: property <transform> from [perspective(0px) translateZ(0.25px)] to [perspective(0px) translateZ(0.25px)] at (0.5) should be [perspective(1px) translateZ(0.25px)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , - 1 , 0 , 0 , 0.25 , 0.75 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0.25 , 1 ) " 163 FAIL CSS Transitions with transition: all: property <transform> from [perspective(0px) translateZ(0.25px)] to [perspective(0px) translateZ(0.25px)] at (0.5) should be [perspective(1px) translateZ(0.25px)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , - 1 , 0 , 0 , 0.25 , 0.75 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0.25 , 1 ) " 158 PASS CSS Transitions: property <transform> from [perspective(0.1px) translateZ(0.25px)] to [perspective(0.1px) translateZ(0.25px)] at (0.5) should be [perspective(1px) translateZ(0.25px)] 159 PASS CSS Transitions with transition: all: property <transform> from [perspective(0.1px) translateZ(0.25px)] to [perspective(0.1px) translateZ(0.25px)] at (0.5) should be [perspective(1px) translateZ(0.25px)] 160 PASS CSS Animations: property <transform> from [perspective(0.1px) translateZ(0.25px)] to [perspective(0.1px) translateZ(0.25px)] at (0.5) should be [perspective(1px) translateZ(0.25px)] 161 PASS Web Animations: property <transform> from [perspective(0.1px) translateZ(0.25px)] to [perspective(0.1px) translateZ(0.25px)] at (0.5) should be [perspective(1px) translateZ(0.25px)] 162 PASS CSS Transitions: property <transform> from [perspective(0px) translateZ(0.25px)] to [perspective(0px) translateZ(0.25px)] at (0.5) should be [perspective(1px) translateZ(0.25px)] 163 PASS CSS Transitions with transition: all: property <transform> from [perspective(0px) translateZ(0.25px)] to [perspective(0px) translateZ(0.25px)] at (0.5) should be [perspective(1px) translateZ(0.25px)] 164 164 FAIL CSS Animations: property <transform> from [perspective(0px) translateZ(0.25px)] to [perspective(0px) translateZ(0.25px)] at (0.5) should be [perspective(1px) translateZ(0.25px)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , - 1 , 0 , 0 , 0.25 , 0.75 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0.25 , 1 ) " 165 165 FAIL Web Animations: property <transform> from [perspective(0px) translateZ(0.25px)] to [perspective(0px) translateZ(0.25px)] at (0.5) should be [perspective(1px) translateZ(0.25px)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , - 1 , 0 , 0 , 0.25 , 0.75 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0.25 , 1 ) " … … 172 172 PASS CSS Animations: property <transform> from [perspective(10px) translateZ(0.5px)] to [perspective(1px) translateZ(0.5px)] at (-1) should be [translateZ(0.5px)] 173 173 PASS Web Animations: property <transform> from [perspective(10px) translateZ(0.5px)] to [perspective(1px) translateZ(0.5px)] at (-1) should be [translateZ(0.5px)] 174 FAIL CSS Transitions: property <transform> from [perspective(1px) translateZ(0.5px)] to [perspective(10px) translateZ(0.5px)] at (-1) should be [perspective(1px) translateZ(0.5px)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , - 1 , 0 , 0 , 0.5 , 0.5 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , - 1.9 , 0 , 0 , 0.5 , 0.05 ) " 175 FAIL CSS Transitions with transition: all: property <transform> from [perspective(1px) translateZ(0.5px)] to [perspective(10px) translateZ(0.5px)] at (-1) should be [perspective(1px) translateZ(0.5px)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , - 1 , 0 , 0 , 0.5 , 0.5 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , - 1.9 , 0 , 0 , 0.5 , 0.05 ) " 176 FAIL CSS Animations: property <transform> from [perspective(1px) translateZ(0.5px)] to [perspective(10px) translateZ(0.5px)] at (-1) should be [perspective(1px) translateZ(0.5px)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , - 1 , 0 , 0 , 0.5 , 0.5 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , - 1.9 , 0 , 0 , 0.5 , 0.05 ) " 177 FAIL Web Animations: property <transform> from [perspective(1px) translateZ(0.5px)] to [perspective(10px) translateZ(0.5px)] at (-1) should be [perspective(1px) translateZ(0.5px)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , - 1 , 0 , 0 , 0.5 , 0.5 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , - 1.9 , 0 , 0 , 0.5 , 0.05 ) " 174 PASS CSS Transitions: property <transform> from [perspective(1px) translateZ(0.5px)] to [perspective(10px) translateZ(0.5px)] at (-1) should be [perspective(1px) translateZ(0.5px)] 175 PASS CSS Transitions with transition: all: property <transform> from [perspective(1px) translateZ(0.5px)] to [perspective(10px) translateZ(0.5px)] at (-1) should be [perspective(1px) translateZ(0.5px)] 176 PASS CSS Animations: property <transform> from [perspective(1px) translateZ(0.5px)] to [perspective(10px) translateZ(0.5px)] at (-1) should be [perspective(1px) translateZ(0.5px)] 177 PASS Web Animations: property <transform> from [perspective(1px) translateZ(0.5px)] to [perspective(10px) translateZ(0.5px)] at (-1) should be [perspective(1px) translateZ(0.5px)] 178 178 -
trunk/LayoutTests/transforms/3d/general/3dtransform-values-expected.txt
r180441 r286591 16 16 transform "perspective(50%)" expected "none" : PASS 17 17 transform "perspective(-400)" expected "none" : PASS 18 transform "perspective(0)" expected "matrix(1, 0, 0, 1, 0, 0)" : PASS 18 transform "perspective(0)" expected "matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, -1, 0, 0, 0, 1)" : PASS 19 transform "perspective(none)" expected "matrix(1, 0, 0, 1, 0, 0)" : PASS 19 20 transform "perspective(400deg)" expected "none" : PASS 20 21 transform "perspective(banana)" expected "none" : PASS -
trunk/LayoutTests/transforms/3d/general/3dtransform-values.html
r180441 r286591 44 44 { 'transform' : 'perspective(50%)', 'result' : 'none' }, 45 45 { 'transform' : 'perspective(-400)', 'result' : 'none' }, 46 { 'transform' : 'perspective(0)', 'result' : 'matrix(1, 0, 0, 1, 0, 0)' }, 46 { 'transform' : 'perspective(0)', 'result' : 'matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, -1, 0, 0, 0, 1)' }, 47 { 'transform' : 'perspective(none)', 'result' : 'matrix(1, 0, 0, 1, 0, 0)' }, 47 48 { 'transform' : 'perspective(400deg)', 'result' : 'none' }, // unit must be length 48 49 { 'transform' : 'perspective(banana)', 'result' : 'none' }, // unit must be length -
trunk/LayoutTests/transforms/3d/general/prefixed-3dtransform-values-expected.txt
r181832 r286591 16 16 transform "perspective(50%)" expected "none" : PASS 17 17 transform "perspective(-400)" expected "none" : PASS 18 transform "perspective(0)" expected "matrix(1, 0, 0, 1, 0, 0)" : PASS 18 transform "perspective(0)" expected "matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, -1, 0, 0, 0, 1)" : PASS 19 transform "perspective(none)" expected "matrix(1, 0, 0, 1, 0, 0)" : PASS 19 20 transform "perspective(400deg)" expected "none" : PASS 20 21 transform "perspective(banana)" expected "none" : PASS -
trunk/LayoutTests/transforms/3d/general/prefixed-3dtransform-values.html
r181832 r286591 44 44 { 'transform' : 'perspective(50%)', 'result' : 'none' }, 45 45 { 'transform' : 'perspective(-400)', 'result' : 'none' }, 46 { 'transform' : 'perspective(0)', 'result' : 'matrix(1, 0, 0, 1, 0, 0)' }, 46 { 'transform' : 'perspective(0)', 'result' : 'matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, -1, 0, 0, 0, 1)' }, 47 { 'transform' : 'perspective(none)', 'result' : 'matrix(1, 0, 0, 1, 0, 0)' }, 47 48 { 'transform' : 'perspective(400deg)', 'result' : 'none' }, // unit must be length 48 49 { 'transform' : 'perspective(banana)', 'result' : 'none' }, // unit must be length -
trunk/Source/WebCore/ChangeLog
r286589 r286591 1 2021-12-07 Martin Robinson <mrobinson@webkit.org> 2 3 perspective() <= 1px should be clamped to 1px 4 https://bugs.webkit.org/show_bug.cgi?id=232619 5 <rdar://problem/85197362> 6 7 Reviewed by Simon Fraser. 8 9 No new tests. This is covered by the newly passing WPT tests 10 in this change. 11 12 When the CSS 3D transform interoperability experimental feature is turned on, 13 round perspectives that are < 1 pixel to 1 pixel. This behavior is described 14 in the specification, but breaks backward compatibility. The reasoning provided 15 by the specification is: 16 17 As very small <length> values can produce bizarre rendering results and 18 stress the numerical accuracy of transform calculations, values less than 19 1px must be treated as 1px for rendering purposes. 20 21 * platform/graphics/transforms/PerspectiveTransformOperation.h: When getting 22 the floating point perspective value, round to 1px. 23 * rendering/RenderLayer.cpp: 24 (WebCore::RenderLayer::perspectiveTransform const): Use usedPerspective from 25 RenderSTyle. 26 * rendering/RenderObject.cpp: 27 (WebCore::RenderObject::getTransformFromContainer const): Ditto. 28 * rendering/style/RenderStyle.cpp: 29 (WebCore::RenderStyle::usedPerspective const): Added this method which rounds 30 to 1px. 31 * rendering/style/RenderStyle.h: 32 1 33 2021-12-06 Said Abou-Hallawa <said@apple.com> 2 34 -
trunk/Source/WebCore/platform/graphics/transforms/PerspectiveTransformOperation.h
r286289 r286591 61 61 if (!m_p) 62 62 return { }; 63 return floatValueForLength(*m_p, 1.0); 63 64 // From https://www.w3.org/TR/css-transforms-2/#perspective-property: 65 // "As very small <length> values can produce bizarre rendering results and stress the numerical accuracy of 66 // transform calculations, values less than 1px must be treated as 1px for rendering purposes. (This clamping 67 // does not affect the underlying value, so perspective: 0; in a stylesheet will still serialize back as 0.)" 68 return std::max(1.0f, floatValueForLength(*m_p, 1.0)); 64 69 } 65 70 -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r286542 r286591 1765 1765 TransformationMatrix t; 1766 1766 t.translate(perspectiveOrigin.x(), perspectiveOrigin.y()); 1767 t.applyPerspective(style. perspective());1767 t.applyPerspective(style.usedPerspective(renderer())); 1768 1768 t.translate(-perspectiveOrigin.x(), -perspectiveOrigin.y()); 1769 1769 -
trunk/Source/WebCore/rendering/RenderObject.cpp
r286542 r286591 1390 1390 1391 1391 TransformationMatrix perspectiveMatrix; 1392 perspectiveMatrix.applyPerspective(containerObject->style(). perspective());1392 perspectiveMatrix.applyPerspective(containerObject->style().usedPerspective(*this)); 1393 1393 1394 1394 transform.translateRight3d(-perspectiveOrigin.x(), -perspectiveOrigin.y(), 0); -
trunk/Source/WebCore/rendering/style/RenderStyle.cpp
r286085 r286591 1812 1812 m_rareNonInheritedData.access().transitions = AnimationList::create(); 1813 1813 return *m_rareNonInheritedData->transitions; 1814 } 1815 1816 float RenderStyle::usedPerspective(const RenderObject& object) const 1817 { 1818 return object.document().settings().css3DTransformInteroperabilityEnabled() ? std::max(1.0f, perspective()) : perspective(); 1814 1819 } 1815 1820 -
trunk/Source/WebCore/rendering/style/RenderStyle.h
r286085 r286591 731 731 BackfaceVisibility backfaceVisibility() const { return static_cast<BackfaceVisibility>(m_rareNonInheritedData->backfaceVisibility); } 732 732 float perspective() const { return m_rareNonInheritedData->perspective; } 733 float usedPerspective(const RenderObject&) const; 733 734 bool hasPerspective() const { return m_rareNonInheritedData->perspective != initialPerspective(); } 734 735 const Length& perspectiveOriginX() const { return m_rareNonInheritedData->perspectiveOriginX; }
Note: See TracChangeset
for help on using the changeset viewer.