Bug 1499991 - Ensure no-op will-change changes also get reflected in the change hint. r=heycam,firefox-style-system-reviewers
authorEmilio Cobos Álvarez <emilio@crisal.io>
Thu, 18 Oct 2018 07:53:11 +0000
changeset 500360 b82c3a7696f945a86d775911d22854481ef4a305
parent 500328 638dee1dfab113b0c2333fb62509180cf21c2124
child 500361 32670a4721d4dac1a14315b16db5847a20749027
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam, firefox-style-system-reviewers
bugs1499991
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1499991 - Ensure no-op will-change changes also get reflected in the change hint. r=heycam,firefox-style-system-reviewers Differential Revision: https://phabricator.services.mozilla.com/D9073
layout/style/nsStyleStruct.cpp
testing/web-platform/tests/css/css-will-change/will-change-inherit-dynamic.html
--- a/layout/style/nsStyleStruct.cpp
+++ b/layout/style/nsStyleStruct.cpp
@@ -3903,17 +3903,18 @@ nsStyleDisplay::CalcDifference(const nsS
        mAnimationTimingFunctionCount != aNewData.mAnimationTimingFunctionCount ||
        mAnimationDurationCount != aNewData.mAnimationDurationCount ||
        mAnimationDelayCount != aNewData.mAnimationDelayCount ||
        mAnimationNameCount != aNewData.mAnimationNameCount ||
        mAnimationDirectionCount != aNewData.mAnimationDirectionCount ||
        mAnimationFillModeCount != aNewData.mAnimationFillModeCount ||
        mAnimationPlayStateCount != aNewData.mAnimationPlayStateCount ||
        mAnimationIterationCountCount != aNewData.mAnimationIterationCountCount ||
-       mScrollSnapCoordinate != aNewData.mScrollSnapCoordinate)) {
+       mScrollSnapCoordinate != aNewData.mScrollSnapCoordinate ||
+       mWillChange != aNewData.mWillChange)) {
     hint |= nsChangeHint_NeutralChange;
   }
 
   return hint;
 }
 
 void
 nsStyleDisplay::GenerateCombinedIndividualTransform()
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-will-change/will-change-inherit-dynamic.html
@@ -0,0 +1,21 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>CSS Test: will-change: style changes are properly propagated to children if needed</title>
+<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
+<link rel="author" title="Mozilla" href="https://mozilla.org">
+<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1499991">
+<link rel="help" href="https://drafts.csswg.org/css-will-change/#will-change">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="outer">
+  <div id="inner" style="will-change: inherit"></div>
+</div>
+<script>
+  test(function() {
+    assert_equals(getComputedStyle(outer).willChange, "auto");
+    assert_equals(getComputedStyle(inner).willChange, "auto");
+    outer.style.willChange = "color";
+    assert_equals(getComputedStyle(outer).willChange, "color");
+    assert_equals(getComputedStyle(inner).willChange, "color");
+  }, "will-change change is properly propagated to children if needed");
+</script>