Implement parsing for CSS will-change
[WebKit-https.git] / Source / WebCore / rendering / style / RenderStyle.cpp
index ddf0198..d1326a9 100644 (file)
@@ -40,6 +40,7 @@
 #include "StyleResolver.h"
 #include "StyleScrollSnapPoints.h"
 #include "StyleSelfAlignmentData.h"
+#include "WillChangeData.h"
 #include <wtf/MathExtras.h>
 #include <wtf/StdLibExtras.h>
 #include <algorithm>
@@ -925,6 +926,15 @@ void RenderStyle::setQuotes(PassRefPtr<QuotesData> q)
     rareInheritedData.access()->quotes = q;
 }
 
+void RenderStyle::setWillChange(PassRefPtr<WillChangeData> willChangeData)
+{
+    if (rareNonInheritedData->m_willChange == willChangeData
+        || (rareNonInheritedData->m_willChange && willChangeData && *rareNonInheritedData->m_willChange == *willChangeData))
+        return;
+
+    rareNonInheritedData.access()->m_willChange = WTF::move(willChangeData);
+}
+
 void RenderStyle::clearCursorList()
 {
     if (rareInheritedData->cursorData)