Title: [275377] trunk
Revision
275377
Author
[email protected]
Date
2021-04-01 13:52:40 -0700 (Thu, 01 Apr 2021)

Log Message

aspect-ratio not recomputed on hover
https://bugs.webkit.org/show_bug.cgi?id=224028

Patch by Rob Buis <[email protected]> on 2021-04-01
Reviewed by Zalan Bujtas.

LayoutTests/imported/w3c:

Add test for this.

* web-platform-tests/css/css-sizing/aspect-ratio/replaced-element-dynamic-aspect-ratio-expected.xht: Added.
* web-platform-tests/css/css-sizing/aspect-ratio/replaced-element-dynamic-aspect-ratio.html: Added.

Source/WebCore:

Detect change in aspect-ratio on hover.

Test: imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/replaced-element-dynamic-aspect-ratio.html

* rendering/style/RenderStyle.cpp:
(WebCore::rareNonInheritedDataChangeRequiresLayout):

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (275376 => 275377)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2021-04-01 20:43:00 UTC (rev 275376)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2021-04-01 20:52:40 UTC (rev 275377)
@@ -1,3 +1,15 @@
+2021-04-01  Rob Buis  <[email protected]>
+
+        aspect-ratio not recomputed on hover
+        https://bugs.webkit.org/show_bug.cgi?id=224028
+
+        Reviewed by Zalan Bujtas.
+
+        Add test for this.
+
+        * web-platform-tests/css/css-sizing/aspect-ratio/replaced-element-dynamic-aspect-ratio-expected.xht: Added.
+        * web-platform-tests/css/css-sizing/aspect-ratio/replaced-element-dynamic-aspect-ratio.html: Added.
+
 2021-03-31  Antoine Quint  <[email protected]>
 
         Unreviewed. Import WPT test modified in https://github.com/web-platform-tests/wpt/pull/28315

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/replaced-element-dynamic-aspect-ratio-expected.xht (0 => 275377)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/replaced-element-dynamic-aspect-ratio-expected.xht	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/replaced-element-dynamic-aspect-ratio-expected.xht	2021-04-01 20:52:40 UTC (rev 275377)
@@ -0,0 +1,19 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+  <title>CSS Reftest Reference</title>
+  <link rel="author" title="Gérard Talbot" href="" />
+  <style type="text/css"><![CDATA[
+  div
+  {
+  background-color: green;
+  height: 100px;
+  width: 100px;
+  }
+  ]]></style>
+ </head>
+ <body>
+  <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+  <div></div>
+ </body>
+</html>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/replaced-element-dynamic-aspect-ratio.html (0 => 275377)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/replaced-element-dynamic-aspect-ratio.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/replaced-element-dynamic-aspect-ratio.html	2021-04-01 20:52:40 UTC (rev 275377)
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<title>CSS aspect-ratio: img + dynamic aspect-ratio</title>
+<link rel="help" href=""
+<link rel="match" href="" />
+
+<style>
+.applyAspectRatio {
+    aspect-ratio: 1/1;
+}
+</style>
+
+<body _onload_="aspectRatio.classList.add('applyAspectRatio')">
+
+<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+
+<img id="aspectRatio" src="" style="width: 100px">
+
+</body>

Modified: trunk/Source/WebCore/ChangeLog (275376 => 275377)


--- trunk/Source/WebCore/ChangeLog	2021-04-01 20:43:00 UTC (rev 275376)
+++ trunk/Source/WebCore/ChangeLog	2021-04-01 20:52:40 UTC (rev 275377)
@@ -1,3 +1,17 @@
+2021-04-01  Rob Buis  <[email protected]>
+
+        aspect-ratio not recomputed on hover
+        https://bugs.webkit.org/show_bug.cgi?id=224028
+
+        Reviewed by Zalan Bujtas.
+
+        Detect change in aspect-ratio on hover.
+
+        Test: imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/replaced-element-dynamic-aspect-ratio.html
+
+        * rendering/style/RenderStyle.cpp:
+        (WebCore::rareNonInheritedDataChangeRequiresLayout):
+
 2021-04-01  Chris Dumez  <[email protected]>
 
         Have the ServiceWorker process hold on to a file mapped version of the service worker scripts to save dirty memory

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.cpp (275376 => 275377)


--- trunk/Source/WebCore/rendering/style/RenderStyle.cpp	2021-04-01 20:43:00 UTC (rev 275376)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.cpp	2021-04-01 20:52:40 UTC (rev 275377)
@@ -738,6 +738,9 @@
         return true;
 #endif
 
+    if (first.aspectRatioType != second.aspectRatioType || first.aspectRatioWidth != second.aspectRatioWidth || first.aspectRatioWidth != second.aspectRatioHeight)
+        return true;
+
     return false;
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to