Title: [273314] trunk
Revision
273314
Author
[email protected]
Date
2021-02-23 09:50:31 -0800 (Tue, 23 Feb 2021)

Log Message

aspect-ratio shows in computed style when disabled
https://bugs.webkit.org/show_bug.cgi?id=222286

Patch by Rob Buis <[email protected]> on 2021-02-23
Reviewed by Simon Fraser.

Source/WebCore:

Make aspect-ratio invisible from style when disabled.

Test: fast/css/aspect-ratio-invalidate-if-disabled.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
* css/CSSProperties.json:

Tools:

Add support for disabling aspect-ratio in wk1.

* DumpRenderTree/TestOptions.cpp:
(WTR::TestOptions::defaults):

LayoutTests:

Add test.

* fast/css/aspect-ratio-invalidate-if-disabled-expected.txt: Added.
* fast/css/aspect-ratio-invalidate-if-disabled.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (273313 => 273314)


--- trunk/LayoutTests/ChangeLog	2021-02-23 17:37:54 UTC (rev 273313)
+++ trunk/LayoutTests/ChangeLog	2021-02-23 17:50:31 UTC (rev 273314)
@@ -1,3 +1,15 @@
+2021-02-23  Rob Buis  <[email protected]>
+
+        aspect-ratio shows in computed style when disabled
+        https://bugs.webkit.org/show_bug.cgi?id=222286
+
+        Reviewed by Simon Fraser.
+
+        Add test.
+
+        * fast/css/aspect-ratio-invalidate-if-disabled-expected.txt: Added.
+        * fast/css/aspect-ratio-invalidate-if-disabled.html: Added.
+
 2021-02-23  Philippe Normand  <[email protected]>
 
         [GStreamer] fast/mediastream/captureStream/canvas2d.html is flaky timing out since GStreamer 1.18 update

Added: trunk/LayoutTests/fast/css/aspect-ratio-invalidate-if-disabled-expected.txt (0 => 273314)


--- trunk/LayoutTests/fast/css/aspect-ratio-invalidate-if-disabled-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/css/aspect-ratio-invalidate-if-disabled-expected.txt	2021-02-23 17:50:31 UTC (rev 273314)
@@ -0,0 +1,14 @@
+Tests that aspect-ratio is not exposed when the feature is disabled
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS 'aspectRatio' in document.documentElement.style is false
+PASS 'aspect-ratio' in getComputedStyle(document.documentElement) is false
+PASS CSS.supports('aspect-ratio: 1 / 1') is false
+FAIL CSS.supports('aspect-ratio: inherit') should be false. Was true.
+PASS successfullyParsed is true
+Some tests failed.
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/css/aspect-ratio-invalidate-if-disabled.html (0 => 273314)


--- trunk/LayoutTests/fast/css/aspect-ratio-invalidate-if-disabled.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/aspect-ratio-invalidate-if-disabled.html	2021-02-23 17:50:31 UTC (rev 273314)
@@ -0,0 +1,18 @@
+<!DOCTYPE html><!-- webkit-test-runner [ AspectRatioEnabled=false ] -->
+<html>
+<head>
+<meta charset="utf-8">
+<script src=""
+</head>
+<body>
+<script>
+description("Tests that aspect-ratio is not exposed when the feature is disabled");
+
+shouldBeFalse("'aspectRatio' in document.documentElement.style");
+shouldBeFalse("'aspect-ratio' in getComputedStyle(document.documentElement)");
+shouldBeFalse("CSS.supports('aspect-ratio: 1 / 1')");
+shouldBeFalse("CSS.supports('aspect-ratio: inherit')");
+
+</script>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (273313 => 273314)


--- trunk/Source/WebCore/ChangeLog	2021-02-23 17:37:54 UTC (rev 273313)
+++ trunk/Source/WebCore/ChangeLog	2021-02-23 17:50:31 UTC (rev 273314)
@@ -1,3 +1,18 @@
+2021-02-23  Rob Buis  <[email protected]>
+
+        aspect-ratio shows in computed style when disabled
+        https://bugs.webkit.org/show_bug.cgi?id=222286
+
+        Reviewed by Simon Fraser.
+
+        Make aspect-ratio invisible from style when disabled.
+
+        Test: fast/css/aspect-ratio-invalidate-if-disabled.html
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
+        * css/CSSProperties.json:
+
 2021-02-23  Xabier Rodriguez Calvar  <[email protected]>
 
         [GStreamer][EME][Thunder] Initialize decryptor lazily

Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (273313 => 273314)


--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2021-02-23 17:37:54 UTC (rev 273313)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2021-02-23 17:50:31 UTC (rev 273314)
@@ -3461,6 +3461,8 @@
         case CSSPropertyWebkitAppearance:
             return cssValuePool.createValue(style.appearance());
         case CSSPropertyAspectRatio:
+            if (renderer && !renderer->settings().aspectRatioEnabled())
+                return nullptr;
             switch (style.aspectRatioType()) {
             case AspectRatioType::Auto:
                 return cssValuePool.createIdentifierValue(CSSValueAuto);

Modified: trunk/Source/WebCore/css/CSSProperties.json (273313 => 273314)


--- trunk/Source/WebCore/css/CSSProperties.json	2021-02-23 17:37:54 UTC (rev 273313)
+++ trunk/Source/WebCore/css/CSSProperties.json	2021-02-23 17:50:31 UTC (rev 273314)
@@ -4556,7 +4556,8 @@
         },
         "aspect-ratio": {
             "codegen-properties": {
-                "custom": "All"
+                "custom": "All",
+                "settings-flag": "aspectRatio"
             },
             "status": {
                 "status": "experimental"

Modified: trunk/Tools/ChangeLog (273313 => 273314)


--- trunk/Tools/ChangeLog	2021-02-23 17:37:54 UTC (rev 273313)
+++ trunk/Tools/ChangeLog	2021-02-23 17:50:31 UTC (rev 273314)
@@ -1,3 +1,15 @@
+2021-02-23  Rob Buis  <[email protected]>
+
+        aspect-ratio shows in computed style when disabled
+        https://bugs.webkit.org/show_bug.cgi?id=222286
+
+        Reviewed by Simon Fraser.
+
+        Add support for disabling aspect-ratio in wk1.
+
+        * DumpRenderTree/TestOptions.cpp:
+        (WTR::TestOptions::defaults):
+
 2021-02-23  Chris Dumez  <[email protected]>
 
         Use adoptNS() as soon as we [[ObjcClass alloc] init] to avoid leaks in Tools/

Modified: trunk/Tools/DumpRenderTree/TestOptions.cpp (273313 => 273314)


--- trunk/Tools/DumpRenderTree/TestOptions.cpp	2021-02-23 17:37:54 UTC (rev 273313)
+++ trunk/Tools/DumpRenderTree/TestOptions.cpp	2021-02-23 17:50:31 UTC (rev 273314)
@@ -71,6 +71,7 @@
             { "AllowTopNavigationToDataURLs", true },
             { "AllowUniversalAccessFromFileURLs", true },
             { "AspectRatioOfImgFromWidthAndHeightEnabled", false },
+            { "AspectRatioEnabled", true },
             { "AsyncClipboardAPIEnabled", false },
             { "AttachmentElementEnabled", false },
             { "CSSLogicalEnabled", false },
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to