Title: [226627] trunk/Source/WebCore
Revision
226627
Author
[email protected]
Date
2018-01-09 05:11:53 -0800 (Tue, 09 Jan 2018)

Log Message

Provide a method to obtain a CSS value from a RenderStyle by CSSPropertyID
https://bugs.webkit.org/show_bug.cgi?id=181429

Patch by Antoine Quint <[email protected]> on 2018-01-09
Reviewed by Antti Koivisto.

The KeyframeEffect.getKeyframes() method from Web Animations requires that we return all styles applied at a given
animation effect keyframe. When we parse keyframes, we create RenderStyle objects that are stored in a KeyframeList,
as well as a list of CSSPropertyIDs that are animated. In order to provide the list of animated properties and their
values when calling getKeyframes(), we need to be able to read back from the RenderStyle we create. As a first step
towards this goal, we factor some code in ComputedStyleExtractor::propertyValue() out into a new method
ComputedStyleExtractor::valueForPropertyinStyle() which takes in an explicit RenderStyle.

No test as this is simply refactoring that doesn't change or add behavior.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
* css/CSSComputedStyleDeclaration.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (226626 => 226627)


--- trunk/Source/WebCore/ChangeLog	2018-01-09 12:48:34 UTC (rev 226626)
+++ trunk/Source/WebCore/ChangeLog	2018-01-09 13:11:53 UTC (rev 226627)
@@ -1,3 +1,24 @@
+2018-01-09  Antoine Quint  <[email protected]>
+
+        Provide a method to obtain a CSS value from a RenderStyle by CSSPropertyID
+        https://bugs.webkit.org/show_bug.cgi?id=181429
+
+        Reviewed by Antti Koivisto.
+
+        The KeyframeEffect.getKeyframes() method from Web Animations requires that we return all styles applied at a given
+        animation effect keyframe. When we parse keyframes, we create RenderStyle objects that are stored in a KeyframeList,
+        as well as a list of CSSPropertyIDs that are animated. In order to provide the list of animated properties and their
+        values when calling getKeyframes(), we need to be able to read back from the RenderStyle we create. As a first step
+        towards this goal, we factor some code in ComputedStyleExtractor::propertyValue() out into a new method
+        ComputedStyleExtractor::valueForPropertyinStyle() which takes in an explicit RenderStyle.
+
+        No test as this is simply refactoring that doesn't change or add behavior.
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::ComputedStyleExtractor::propertyValue):
+        (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
+        * css/CSSComputedStyleDeclaration.h:
+
 2018-01-09  Youenn Fablet  <[email protected]>
 
         SWClientConnection should not keep references to service worker jobs

Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (226626 => 226627)


--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2018-01-09 12:48:34 UTC (rev 226626)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2018-01-09 13:11:53 UTC (rev 226627)
@@ -2700,8 +2700,13 @@
     if (!style)
         return nullptr;
 
+    return valueForPropertyinStyle(*style, propertyID, renderer);
+}
+
+RefPtr<CSSValue> ComputedStyleExtractor::valueForPropertyinStyle(const RenderStyle& style, CSSPropertyID propertyID, RenderElement* renderer)
+{
     auto& cssValuePool = CSSValuePool::singleton();
-    propertyID = CSSProperty::resolveDirectionAwareProperty(propertyID, style->direction(), style->writingMode());
+    propertyID = CSSProperty::resolveDirectionAwareProperty(propertyID, style.direction(), style.writingMode());
 
     switch (propertyID) {
         case CSSPropertyInvalid:
@@ -2708,10 +2713,10 @@
             break;
 
         case CSSPropertyBackgroundColor:
-            return cssValuePool.createColorValue(m_allowVisitedStyle? style->visitedDependentColor(CSSPropertyBackgroundColor) : style->backgroundColor());
+            return cssValuePool.createColorValue(m_allowVisitedStyle? style.visitedDependentColor(CSSPropertyBackgroundColor) : style.backgroundColor());
         case CSSPropertyBackgroundImage:
         case CSSPropertyWebkitMaskImage: {
-            auto& layers = propertyID == CSSPropertyWebkitMaskImage ? style->maskLayers() : style->backgroundLayers();
+            auto& layers = propertyID == CSSPropertyWebkitMaskImage ? style.maskLayers() : style.backgroundLayers();
             if (!layers.next()) {
                 if (layers.image())
                     return layers.image()->cssValue();
@@ -2729,17 +2734,17 @@
         case CSSPropertyBackgroundSize:
         case CSSPropertyWebkitBackgroundSize:
         case CSSPropertyWebkitMaskSize: {
-            auto& layers = propertyID == CSSPropertyWebkitMaskSize ? style->maskLayers() : style->backgroundLayers();
+            auto& layers = propertyID == CSSPropertyWebkitMaskSize ? style.maskLayers() : style.backgroundLayers();
             if (!layers.next())
-                return fillSizeToCSSValue(layers.size(), *style);
+                return fillSizeToCSSValue(layers.size(), style);
             auto list = CSSValueList::createCommaSeparated();
             for (auto* currLayer = &layers; currLayer; currLayer = currLayer->next())
-                list->append(fillSizeToCSSValue(currLayer->size(), *style));
+                list->append(fillSizeToCSSValue(currLayer->size(), style));
             return WTFMove(list);
         }
         case CSSPropertyBackgroundRepeat:
         case CSSPropertyWebkitMaskRepeat: {
-            auto& layers = propertyID == CSSPropertyWebkitMaskRepeat ? style->maskLayers() : style->backgroundLayers();
+            auto& layers = propertyID == CSSPropertyWebkitMaskRepeat ? style.maskLayers() : style.backgroundLayers();
             if (!layers.next())
                 return fillRepeatToCSSValue(layers.repeatX(), layers.repeatY());
             auto list = CSSValueList::createCommaSeparated();
@@ -2748,7 +2753,7 @@
             return WTFMove(list);
         }
         case CSSPropertyWebkitMaskSourceType: {
-            auto& layers = style->maskLayers();
+            auto& layers = style.maskLayers();
             if (!layers.next())
                 return fillSourceTypeToCSSValue(layers.maskSourceType());
             auto list = CSSValueList::createCommaSeparated();
@@ -2758,7 +2763,7 @@
         }
         case CSSPropertyWebkitBackgroundComposite:
         case CSSPropertyWebkitMaskComposite: {
-            auto& layers = propertyID == CSSPropertyWebkitMaskComposite ? style->maskLayers() : style->backgroundLayers();
+            auto& layers = propertyID == CSSPropertyWebkitMaskComposite ? style.maskLayers() : style.backgroundLayers();
             if (!layers.next())
                 return cssValuePool.createValue(layers.composite());
             auto list = CSSValueList::createCommaSeparated();
@@ -2767,7 +2772,7 @@
             return WTFMove(list);
         }
         case CSSPropertyBackgroundAttachment: {
-            auto& layers = style->backgroundLayers();
+            auto& layers = style.backgroundLayers();
             if (!layers.next())
                 return cssValuePool.createValue(layers.attachment());
             auto list = CSSValueList::createCommaSeparated();
@@ -2781,7 +2786,7 @@
         case CSSPropertyWebkitBackgroundOrigin:
         case CSSPropertyWebkitMaskClip:
         case CSSPropertyWebkitMaskOrigin: {
-            auto& layers = (propertyID == CSSPropertyWebkitMaskClip || propertyID == CSSPropertyWebkitMaskOrigin) ? style->maskLayers() : style->backgroundLayers();
+            auto& layers = (propertyID == CSSPropertyWebkitMaskClip || propertyID == CSSPropertyWebkitMaskOrigin) ? style.maskLayers() : style.backgroundLayers();
             bool isClip = propertyID == CSSPropertyBackgroundClip || propertyID == CSSPropertyWebkitBackgroundClip || propertyID == CSSPropertyWebkitMaskClip;
             if (!layers.next())
                 return cssValuePool.createValue(isClip ? layers.clip() : layers.origin());
@@ -2792,18 +2797,18 @@
         }
         case CSSPropertyBackgroundPosition:
         case CSSPropertyWebkitMaskPosition: {
-            auto& layers = propertyID == CSSPropertyWebkitMaskPosition ? style->maskLayers() : style->backgroundLayers();
+            auto& layers = propertyID == CSSPropertyWebkitMaskPosition ? style.maskLayers() : style.backgroundLayers();
             if (!layers.next())
-                return createPositionListForLayer(propertyID, layers, *style);
+                return createPositionListForLayer(propertyID, layers, style);
 
             auto list = CSSValueList::createCommaSeparated();
             for (auto* currLayer = &layers; currLayer; currLayer = currLayer->next())
-                list->append(createPositionListForLayer(propertyID, *currLayer, *style));
+                list->append(createPositionListForLayer(propertyID, *currLayer, style));
             return WTFMove(list);
         }
         case CSSPropertyBackgroundPositionX:
         case CSSPropertyWebkitMaskPositionX: {
-            auto& layers = propertyID == CSSPropertyWebkitMaskPositionX ? style->maskLayers() : style->backgroundLayers();
+            auto& layers = propertyID == CSSPropertyWebkitMaskPositionX ? style.maskLayers() : style.backgroundLayers();
             if (!layers.next())
                 return cssValuePool.createValue(layers.xPosition());
 
@@ -2815,7 +2820,7 @@
         }
         case CSSPropertyBackgroundPositionY:
         case CSSPropertyWebkitMaskPositionY: {
-            auto& layers = propertyID == CSSPropertyWebkitMaskPositionY ? style->maskLayers() : style->backgroundLayers();
+            auto& layers = propertyID == CSSPropertyWebkitMaskPositionY ? style.maskLayers() : style.backgroundLayers();
             if (!layers.next())
                 return cssValuePool.createValue(layers.yPosition());
 
@@ -2826,123 +2831,123 @@
             return WTFMove(list);
         }
         case CSSPropertyBorderCollapse:
-            if (style->borderCollapse())
+            if (style.borderCollapse())
                 return cssValuePool.createIdentifierValue(CSSValueCollapse);
             return cssValuePool.createIdentifierValue(CSSValueSeparate);
         case CSSPropertyBorderSpacing: {
             auto list = CSSValueList::createSpaceSeparated();
-            list->append(zoomAdjustedPixelValue(style->horizontalBorderSpacing(), *style));
-            list->append(zoomAdjustedPixelValue(style->verticalBorderSpacing(), *style));
+            list->append(zoomAdjustedPixelValue(style.horizontalBorderSpacing(), style));
+            list->append(zoomAdjustedPixelValue(style.verticalBorderSpacing(), style));
             return WTFMove(list);
         }
         case CSSPropertyWebkitBorderHorizontalSpacing:
-            return zoomAdjustedPixelValue(style->horizontalBorderSpacing(), *style);
+            return zoomAdjustedPixelValue(style.horizontalBorderSpacing(), style);
         case CSSPropertyWebkitBorderVerticalSpacing:
-            return zoomAdjustedPixelValue(style->verticalBorderSpacing(), *style);
+            return zoomAdjustedPixelValue(style.verticalBorderSpacing(), style);
         case CSSPropertyBorderImageSource:
-            if (style->borderImageSource())
-                return style->borderImageSource()->cssValue();
+            if (style.borderImageSource())
+                return style.borderImageSource()->cssValue();
             return cssValuePool.createIdentifierValue(CSSValueNone);
         case CSSPropertyBorderTopColor:
-            return m_allowVisitedStyle ? cssValuePool.createColorValue(style->visitedDependentColor(CSSPropertyBorderTopColor)) : currentColorOrValidColor(style, style->borderTopColor());
+            return m_allowVisitedStyle ? cssValuePool.createColorValue(style.visitedDependentColor(CSSPropertyBorderTopColor)) : currentColorOrValidColor(&style, style.borderTopColor());
         case CSSPropertyBorderRightColor:
-            return m_allowVisitedStyle ? cssValuePool.createColorValue(style->visitedDependentColor(CSSPropertyBorderRightColor)) : currentColorOrValidColor(style, style->borderRightColor());
+            return m_allowVisitedStyle ? cssValuePool.createColorValue(style.visitedDependentColor(CSSPropertyBorderRightColor)) : currentColorOrValidColor(&style, style.borderRightColor());
         case CSSPropertyBorderBottomColor:
-            return m_allowVisitedStyle ? cssValuePool.createColorValue(style->visitedDependentColor(CSSPropertyBorderBottomColor)) : currentColorOrValidColor(style, style->borderBottomColor());
+            return m_allowVisitedStyle ? cssValuePool.createColorValue(style.visitedDependentColor(CSSPropertyBorderBottomColor)) : currentColorOrValidColor(&style, style.borderBottomColor());
         case CSSPropertyBorderLeftColor:
-            return m_allowVisitedStyle ? cssValuePool.createColorValue(style->visitedDependentColor(CSSPropertyBorderLeftColor)) : currentColorOrValidColor(style, style->borderLeftColor());
+            return m_allowVisitedStyle ? cssValuePool.createColorValue(style.visitedDependentColor(CSSPropertyBorderLeftColor)) : currentColorOrValidColor(&style, style.borderLeftColor());
         case CSSPropertyBorderTopStyle:
-            return cssValuePool.createValue(style->borderTopStyle());
+            return cssValuePool.createValue(style.borderTopStyle());
         case CSSPropertyBorderRightStyle:
-            return cssValuePool.createValue(style->borderRightStyle());
+            return cssValuePool.createValue(style.borderRightStyle());
         case CSSPropertyBorderBottomStyle:
-            return cssValuePool.createValue(style->borderBottomStyle());
+            return cssValuePool.createValue(style.borderBottomStyle());
         case CSSPropertyBorderLeftStyle:
-            return cssValuePool.createValue(style->borderLeftStyle());
+            return cssValuePool.createValue(style.borderLeftStyle());
         case CSSPropertyBorderTopWidth:
-            return zoomAdjustedPixelValue(style->borderTopWidth(), *style);
+            return zoomAdjustedPixelValue(style.borderTopWidth(), style);
         case CSSPropertyBorderRightWidth:
-            return zoomAdjustedPixelValue(style->borderRightWidth(), *style);
+            return zoomAdjustedPixelValue(style.borderRightWidth(), style);
         case CSSPropertyBorderBottomWidth:
-            return zoomAdjustedPixelValue(style->borderBottomWidth(), *style);
+            return zoomAdjustedPixelValue(style.borderBottomWidth(), style);
         case CSSPropertyBorderLeftWidth:
-            return zoomAdjustedPixelValue(style->borderLeftWidth(), *style);
+            return zoomAdjustedPixelValue(style.borderLeftWidth(), style);
         case CSSPropertyBottom:
-            return positionOffsetValue(*style, CSSPropertyBottom, renderer);
+            return positionOffsetValue(style, CSSPropertyBottom, renderer);
         case CSSPropertyWebkitBoxAlign:
-            return cssValuePool.createValue(style->boxAlign());
+            return cssValuePool.createValue(style.boxAlign());
 #if ENABLE(CSS_BOX_DECORATION_BREAK)
         case CSSPropertyWebkitBoxDecorationBreak:
-            if (style->boxDecorationBreak() == DSLICE)
+            if (style.boxDecorationBreak() == DSLICE)
                 return cssValuePool.createIdentifierValue(CSSValueSlice);
         return cssValuePool.createIdentifierValue(CSSValueClone);
 #endif
         case CSSPropertyWebkitBoxDirection:
-            return cssValuePool.createValue(style->boxDirection());
+            return cssValuePool.createValue(style.boxDirection());
         case CSSPropertyWebkitBoxFlex:
-            return cssValuePool.createValue(style->boxFlex(), CSSPrimitiveValue::CSS_NUMBER);
+            return cssValuePool.createValue(style.boxFlex(), CSSPrimitiveValue::CSS_NUMBER);
         case CSSPropertyWebkitBoxFlexGroup:
-            return cssValuePool.createValue(style->boxFlexGroup(), CSSPrimitiveValue::CSS_NUMBER);
+            return cssValuePool.createValue(style.boxFlexGroup(), CSSPrimitiveValue::CSS_NUMBER);
         case CSSPropertyWebkitBoxLines:
-            return cssValuePool.createValue(style->boxLines());
+            return cssValuePool.createValue(style.boxLines());
         case CSSPropertyWebkitBoxOrdinalGroup:
-            return cssValuePool.createValue(style->boxOrdinalGroup(), CSSPrimitiveValue::CSS_NUMBER);
+            return cssValuePool.createValue(style.boxOrdinalGroup(), CSSPrimitiveValue::CSS_NUMBER);
         case CSSPropertyWebkitBoxOrient:
-            return cssValuePool.createValue(style->boxOrient());
+            return cssValuePool.createValue(style.boxOrient());
         case CSSPropertyWebkitBoxPack:
-            return cssValuePool.createValue(style->boxPack());
+            return cssValuePool.createValue(style.boxPack());
         case CSSPropertyWebkitBoxReflect:
-            return valueForReflection(style->boxReflect(), *style);
+            return valueForReflection(style.boxReflect(), style);
         case CSSPropertyBoxShadow:
         case CSSPropertyWebkitBoxShadow:
-            return valueForShadow(style->boxShadow(), propertyID, *style);
+            return valueForShadow(style.boxShadow(), propertyID, style);
         case CSSPropertyCaptionSide:
-            return cssValuePool.createValue(style->captionSide());
+            return cssValuePool.createValue(style.captionSide());
         case CSSPropertyCaretColor:
-            return m_allowVisitedStyle ? cssValuePool.createColorValue(style->visitedDependentColor(CSSPropertyCaretColor)) : currentColorOrValidColor(style, style->caretColor());
+            return m_allowVisitedStyle ? cssValuePool.createColorValue(style.visitedDependentColor(CSSPropertyCaretColor)) : currentColorOrValidColor(&style, style.caretColor());
         case CSSPropertyClear:
-            return cssValuePool.createValue(style->clear());
+            return cssValuePool.createValue(style.clear());
         case CSSPropertyColor:
-            return cssValuePool.createColorValue(m_allowVisitedStyle ? style->visitedDependentColor(CSSPropertyColor) : style->color());
+            return cssValuePool.createColorValue(m_allowVisitedStyle ? style.visitedDependentColor(CSSPropertyColor) : style.color());
         case CSSPropertyWebkitPrintColorAdjust:
-            return cssValuePool.createValue(style->printColorAdjust());
+            return cssValuePool.createValue(style.printColorAdjust());
         case CSSPropertyWebkitColumnAxis:
-            return cssValuePool.createValue(style->columnAxis());
+            return cssValuePool.createValue(style.columnAxis());
         case CSSPropertyColumnCount:
-            if (style->hasAutoColumnCount())
+            if (style.hasAutoColumnCount())
                 return cssValuePool.createIdentifierValue(CSSValueAuto);
-            return cssValuePool.createValue(style->columnCount(), CSSPrimitiveValue::CSS_NUMBER);
+            return cssValuePool.createValue(style.columnCount(), CSSPrimitiveValue::CSS_NUMBER);
         case CSSPropertyColumnFill:
-            return cssValuePool.createValue(style->columnFill());
+            return cssValuePool.createValue(style.columnFill());
         case CSSPropertyColumnGap:
-            if (style->hasNormalColumnGap())
+            if (style.hasNormalColumnGap())
                 return cssValuePool.createIdentifierValue(CSSValueNormal);
-            return zoomAdjustedPixelValue(style->columnGap(), *style);
+            return zoomAdjustedPixelValue(style.columnGap(), style);
         case CSSPropertyWebkitColumnProgression:
-            return cssValuePool.createValue(style->columnProgression());
+            return cssValuePool.createValue(style.columnProgression());
         case CSSPropertyColumnRuleColor:
-            return m_allowVisitedStyle ? cssValuePool.createColorValue(style->visitedDependentColor(CSSPropertyOutlineColor)) : currentColorOrValidColor(style, style->columnRuleColor());
+            return m_allowVisitedStyle ? cssValuePool.createColorValue(style.visitedDependentColor(CSSPropertyOutlineColor)) : currentColorOrValidColor(&style, style.columnRuleColor());
         case CSSPropertyColumnRuleStyle:
-            return cssValuePool.createValue(style->columnRuleStyle());
+            return cssValuePool.createValue(style.columnRuleStyle());
         case CSSPropertyColumnRuleWidth:
-            return zoomAdjustedPixelValue(style->columnRuleWidth(), *style);
+            return zoomAdjustedPixelValue(style.columnRuleWidth(), style);
         case CSSPropertyColumnSpan:
-            return cssValuePool.createIdentifierValue(style->columnSpan() ? CSSValueAll : CSSValueNone);
+            return cssValuePool.createIdentifierValue(style.columnSpan() ? CSSValueAll : CSSValueNone);
         case CSSPropertyWebkitColumnBreakAfter:
-            return cssValuePool.createValue(convertToColumnBreak(style->breakAfter()));
+            return cssValuePool.createValue(convertToColumnBreak(style.breakAfter()));
         case CSSPropertyWebkitColumnBreakBefore:
-            return cssValuePool.createValue(convertToColumnBreak(style->breakBefore()));
+            return cssValuePool.createValue(convertToColumnBreak(style.breakBefore()));
         case CSSPropertyWebkitColumnBreakInside:
-            return cssValuePool.createValue(convertToColumnBreak(style->breakInside()));
+            return cssValuePool.createValue(convertToColumnBreak(style.breakInside()));
         case CSSPropertyColumnWidth:
-            if (style->hasAutoColumnWidth())
+            if (style.hasAutoColumnWidth())
                 return cssValuePool.createIdentifierValue(CSSValueAuto);
-            return zoomAdjustedPixelValue(style->columnWidth(), *style);
+            return zoomAdjustedPixelValue(style.columnWidth(), style);
         case CSSPropertyTabSize:
-            return cssValuePool.createValue(style->tabSize(), CSSPrimitiveValue::CSS_NUMBER);
+            return cssValuePool.createValue(style.tabSize(), CSSPrimitiveValue::CSS_NUMBER);
         case CSSPropertyCursor: {
             RefPtr<CSSValueList> list;
-            auto* cursors = style->cursors();
+            auto* cursors = style.cursors();
             if (cursors && cursors->size() > 0) {
                 list = CSSValueList::createCommaSeparated();
                 for (unsigned i = 0; i < cursors->size(); ++i)
@@ -2949,7 +2954,7 @@
                     if (StyleImage* image = cursors->at(i).image())
                         list->append(image->cssValue());
             }
-            auto value = cssValuePool.createValue(style->cursor());
+            auto value = cssValuePool.createValue(style.cursor());
             if (list) {
                 list->append(WTFMove(value));
                 return list;
@@ -2958,40 +2963,40 @@
         }
 #if ENABLE(CURSOR_VISIBILITY)
         case CSSPropertyWebkitCursorVisibility:
-            return cssValuePool.createValue(style->cursorVisibility());
+            return cssValuePool.createValue(style.cursorVisibility());
 #endif
         case CSSPropertyDirection:
-            return cssValuePool.createValue(style->direction());
+            return cssValuePool.createValue(style.direction());
         case CSSPropertyDisplay:
-            return cssValuePool.createValue(style->display());
+            return cssValuePool.createValue(style.display());
         case CSSPropertyEmptyCells:
-            return cssValuePool.createValue(style->emptyCells());
+            return cssValuePool.createValue(style.emptyCells());
         case CSSPropertyAlignContent:
-            return valueForContentPositionAndDistributionWithOverflowAlignment(style->alignContent(), CSSValueStretch);
+            return valueForContentPositionAndDistributionWithOverflowAlignment(style.alignContent(), CSSValueStretch);
         case CSSPropertyAlignItems:
-            return valueForItemPositionWithOverflowAlignment(style->alignItems());
+            return valueForItemPositionWithOverflowAlignment(style.alignItems());
         case CSSPropertyAlignSelf:
-            return valueForItemPositionWithOverflowAlignment(style->alignSelf());
+            return valueForItemPositionWithOverflowAlignment(style.alignSelf());
         case CSSPropertyFlex:
             return getCSSPropertyValuesForShorthandProperties(flexShorthand());
         case CSSPropertyFlexBasis:
-            return cssValuePool.createValue(style->flexBasis(), *style);
+            return cssValuePool.createValue(style.flexBasis(), style);
         case CSSPropertyFlexDirection:
-            return cssValuePool.createValue(style->flexDirection());
+            return cssValuePool.createValue(style.flexDirection());
         case CSSPropertyFlexFlow:
             return getCSSPropertyValuesForShorthandProperties(flexFlowShorthand());
         case CSSPropertyFlexGrow:
-            return cssValuePool.createValue(style->flexGrow());
+            return cssValuePool.createValue(style.flexGrow());
         case CSSPropertyFlexShrink:
-            return cssValuePool.createValue(style->flexShrink());
+            return cssValuePool.createValue(style.flexShrink());
         case CSSPropertyFlexWrap:
-            return cssValuePool.createValue(style->flexWrap());
+            return cssValuePool.createValue(style.flexWrap());
         case CSSPropertyJustifyContent:
-            return valueForContentPositionAndDistributionWithOverflowAlignment(style->justifyContent(), CSSValueFlexStart);
+            return valueForContentPositionAndDistributionWithOverflowAlignment(style.justifyContent(), CSSValueFlexStart);
         case CSSPropertyJustifyItems:
-            return valueForItemPositionWithOverflowAlignment(style->justifyItems().position() == ItemPositionAuto ? RenderStyle::initialDefaultAlignment() : style->justifyItems());
+            return valueForItemPositionWithOverflowAlignment(style.justifyItems().position() == ItemPositionAuto ? RenderStyle::initialDefaultAlignment() : style.justifyItems());
         case CSSPropertyJustifySelf:
-            return valueForItemPositionWithOverflowAlignment(style->justifySelf());
+            return valueForItemPositionWithOverflowAlignment(style.justifySelf());
         case CSSPropertyPlaceContent:
             return getCSSPropertyValuesForShorthandProperties(placeContentShorthand());
         case CSSPropertyPlaceItems:
@@ -2999,34 +3004,34 @@
         case CSSPropertyPlaceSelf:
             return getCSSPropertyValuesForShorthandProperties(placeSelfShorthand());
         case CSSPropertyOrder:
-            return cssValuePool.createValue(style->order(), CSSPrimitiveValue::CSS_NUMBER);
+            return cssValuePool.createValue(style.order(), CSSPrimitiveValue::CSS_NUMBER);
         case CSSPropertyFloat:
-            if (style->display() != NONE && style->hasOutOfFlowPosition())
+            if (style.display() != NONE && style.hasOutOfFlowPosition())
                 return cssValuePool.createIdentifierValue(CSSValueNone);
-            return cssValuePool.createValue(style->floating());
+            return cssValuePool.createValue(style.floating());
         case CSSPropertyFont: {
-            auto computedFont = fontShorthandValueForSelectionProperties(style->fontDescription());
-            computedFont->size = fontSizeFromStyle(*style);
-            computedFont->lineHeight = lineHeightFromStyle(*style);
-            computedFont->family = fontFamilyListFromStyle(*style);
+            auto computedFont = fontShorthandValueForSelectionProperties(style.fontDescription());
+            computedFont->size = fontSizeFromStyle(style);
+            computedFont->lineHeight = lineHeightFromStyle(style);
+            computedFont->family = fontFamilyListFromStyle(style);
             return WTFMove(computedFont);
         }
         case CSSPropertyFontFamily:
-            return fontFamilyFromStyle(*style);
+            return fontFamilyFromStyle(style);
         case CSSPropertyFontSize:
-            return fontSizeFromStyle(*style);
+            return fontSizeFromStyle(style);
         case CSSPropertyFontStyle:
-            return fontStyleFromStyle(*style);
+            return fontStyleFromStyle(style);
         case CSSPropertyFontStretch:
-            return fontStretchFromStyle(*style);
+            return fontStretchFromStyle(style);
         case CSSPropertyFontVariant:
-            return fontVariantFromStyle(*style);
+            return fontVariantFromStyle(style);
         case CSSPropertyFontWeight:
-            return fontWeightFromStyle(*style);
+            return fontWeightFromStyle(style);
         case CSSPropertyFontSynthesis:
-            return fontSynthesisFromStyle(*style);
+            return fontSynthesisFromStyle(style);
         case CSSPropertyFontFeatureSettings: {
-            const FontFeatureSettings& featureSettings = style->fontDescription().featureSettings();
+            const FontFeatureSettings& featureSettings = style.fontDescription().featureSettings();
             if (!featureSettings.size())
                 return cssValuePool.createIdentifierValue(CSSValueNormal);
             auto list = CSSValueList::createCommaSeparated();
@@ -3036,7 +3041,7 @@
         }
 #if ENABLE(VARIATION_FONTS)
         case CSSPropertyFontVariationSettings: {
-            const FontVariationSettings& variationSettings = style->fontDescription().variationSettings();
+            const FontVariationSettings& variationSettings = style.fontDescription().variationSettings();
             if (variationSettings.isEmpty())
                 return cssValuePool.createIdentifierValue(CSSValueNormal);
             auto list = CSSValueList::createCommaSeparated();
@@ -3045,17 +3050,17 @@
             return WTFMove(list);
         }
         case CSSPropertyFontOpticalSizing:
-            return cssValuePool.createValue(style->fontDescription().opticalSizing());
+            return cssValuePool.createValue(style.fontDescription().opticalSizing());
 #endif
         case CSSPropertyGridAutoFlow: {
             auto list = CSSValueList::createSpaceSeparated();
-            ASSERT(style->isGridAutoFlowDirectionRow() || style->isGridAutoFlowDirectionColumn());
-            if (style->isGridAutoFlowDirectionRow())
+            ASSERT(style.isGridAutoFlowDirectionRow() || style.isGridAutoFlowDirectionColumn());
+            if (style.isGridAutoFlowDirectionRow())
                 list->append(cssValuePool.createIdentifierValue(CSSValueRow));
             else
                 list->append(cssValuePool.createIdentifierValue(CSSValueColumn));
 
-            if (style->isGridAutoFlowAlgorithmDense())
+            if (style.isGridAutoFlowAlgorithmDense())
                 list->append(cssValuePool.createIdentifierValue(CSSValueDense));
 
             return WTFMove(list);
@@ -3067,23 +3072,23 @@
         // depending on the size of the explicit grid or the number of implicit tracks added to the grid. See
         // http://lists.w3.org/Archives/Public/www-style/2013Nov/0014.html
         case CSSPropertyGridAutoColumns:
-            return valueForGridTrackSizeList(ForColumns, *style);
+            return valueForGridTrackSizeList(ForColumns, style);
         case CSSPropertyGridAutoRows:
-            return valueForGridTrackSizeList(ForRows, *style);
+            return valueForGridTrackSizeList(ForRows, style);
 
         case CSSPropertyGridTemplateColumns:
-            return valueForGridTrackList(ForColumns, renderer, *style);
+            return valueForGridTrackList(ForColumns, renderer, style);
         case CSSPropertyGridTemplateRows:
-            return valueForGridTrackList(ForRows, renderer, *style);
+            return valueForGridTrackList(ForRows, renderer, style);
 
         case CSSPropertyGridColumnStart:
-            return valueForGridPosition(style->gridItemColumnStart());
+            return valueForGridPosition(style.gridItemColumnStart());
         case CSSPropertyGridColumnEnd:
-            return valueForGridPosition(style->gridItemColumnEnd());
+            return valueForGridPosition(style.gridItemColumnEnd());
         case CSSPropertyGridRowStart:
-            return valueForGridPosition(style->gridItemRowStart());
+            return valueForGridPosition(style.gridItemRowStart());
         case CSSPropertyGridRowEnd:
-            return valueForGridPosition(style->gridItemRowEnd());
+            return valueForGridPosition(style.gridItemRowEnd());
         case CSSPropertyGridArea:
             return getCSSPropertyValuesForGridShorthand(gridAreaShorthand());
         case CSSPropertyGridTemplate:
@@ -3095,15 +3100,15 @@
         case CSSPropertyGridRow:
             return getCSSPropertyValuesForGridShorthand(gridRowShorthand());
         case CSSPropertyGridTemplateAreas:
-            if (!style->namedGridAreaRowCount()) {
-                ASSERT(!style->namedGridAreaColumnCount());
+            if (!style.namedGridAreaRowCount()) {
+                ASSERT(!style.namedGridAreaColumnCount());
                 return cssValuePool.createIdentifierValue(CSSValueNone);
             }
-            return CSSGridTemplateAreasValue::create(style->namedGridArea(), style->namedGridAreaRowCount(), style->namedGridAreaColumnCount());
+            return CSSGridTemplateAreasValue::create(style.namedGridArea(), style.namedGridAreaRowCount(), style.namedGridAreaColumnCount());
         case CSSPropertyGridColumnGap:
-            return zoomAdjustedPixelValueForLength(style->gridColumnGap(), *style);
+            return zoomAdjustedPixelValueForLength(style.gridColumnGap(), style);
         case CSSPropertyGridRowGap:
-            return zoomAdjustedPixelValueForLength(style->gridRowGap(), *style);
+            return zoomAdjustedPixelValueForLength(style.gridRowGap(), style);
         case CSSPropertyGridGap:
             return getCSSPropertyValuesForGridShorthand(gridGapShorthand());
         case CSSPropertyHeight:
@@ -3112,71 +3117,71 @@
                 // the "height" property does not apply for non-replaced inline elements.
                 if (isNonReplacedInline(*renderer))
                     return cssValuePool.createIdentifierValue(CSSValueAuto);
-                return zoomAdjustedPixelValue(sizingBox(*renderer).height(), *style);
+                return zoomAdjustedPixelValue(sizingBox(*renderer).height(), style);
             }
-            return zoomAdjustedPixelValueForLength(style->height(), *style);
+            return zoomAdjustedPixelValueForLength(style.height(), style);
         case CSSPropertyWebkitHyphens:
-            return cssValuePool.createValue(style->hyphens());
+            return cssValuePool.createValue(style.hyphens());
         case CSSPropertyWebkitHyphenateCharacter:
-            if (style->hyphenationString().isNull())
+            if (style.hyphenationString().isNull())
                 return cssValuePool.createIdentifierValue(CSSValueAuto);
-            return cssValuePool.createValue(style->hyphenationString(), CSSPrimitiveValue::CSS_STRING);
+            return cssValuePool.createValue(style.hyphenationString(), CSSPrimitiveValue::CSS_STRING);
         case CSSPropertyWebkitHyphenateLimitAfter:
-            if (style->hyphenationLimitAfter() < 0)
+            if (style.hyphenationLimitAfter() < 0)
                 return CSSPrimitiveValue::createIdentifier(CSSValueAuto);
-            return CSSPrimitiveValue::create(style->hyphenationLimitAfter(), CSSPrimitiveValue::CSS_NUMBER);
+            return CSSPrimitiveValue::create(style.hyphenationLimitAfter(), CSSPrimitiveValue::CSS_NUMBER);
         case CSSPropertyWebkitHyphenateLimitBefore:
-            if (style->hyphenationLimitBefore() < 0)
+            if (style.hyphenationLimitBefore() < 0)
                 return CSSPrimitiveValue::createIdentifier(CSSValueAuto);
-            return CSSPrimitiveValue::create(style->hyphenationLimitBefore(), CSSPrimitiveValue::CSS_NUMBER);
+            return CSSPrimitiveValue::create(style.hyphenationLimitBefore(), CSSPrimitiveValue::CSS_NUMBER);
         case CSSPropertyWebkitHyphenateLimitLines:
-            if (style->hyphenationLimitLines() < 0)
+            if (style.hyphenationLimitLines() < 0)
                 return CSSPrimitiveValue::createIdentifier(CSSValueNoLimit);
-            return CSSPrimitiveValue::create(style->hyphenationLimitLines(), CSSPrimitiveValue::CSS_NUMBER);
+            return CSSPrimitiveValue::create(style.hyphenationLimitLines(), CSSPrimitiveValue::CSS_NUMBER);
         case CSSPropertyWebkitBorderFit:
-            if (style->borderFit() == BorderFitBorder)
+            if (style.borderFit() == BorderFitBorder)
                 return cssValuePool.createIdentifierValue(CSSValueBorder);
             return cssValuePool.createIdentifierValue(CSSValueLines);
 #if ENABLE(CSS_IMAGE_ORIENTATION)
         case CSSPropertyImageOrientation:
-            return cssValuePool.createValue(style->imageOrientation());
+            return cssValuePool.createValue(style.imageOrientation());
 #endif
         case CSSPropertyImageRendering:
-            return CSSPrimitiveValue::create(style->imageRendering());
+            return CSSPrimitiveValue::create(style.imageRendering());
 #if ENABLE(CSS_IMAGE_RESOLUTION)
         case CSSPropertyImageResolution:
-            return cssValuePool.createValue(style->imageResolution(), CSSPrimitiveValue::CSS_DPPX);
+            return cssValuePool.createValue(style.imageResolution(), CSSPrimitiveValue::CSS_DPPX);
 #endif
         case CSSPropertyLeft:
-            return positionOffsetValue(*style, CSSPropertyLeft, renderer);
+            return positionOffsetValue(style, CSSPropertyLeft, renderer);
         case CSSPropertyLetterSpacing:
-            if (!style->letterSpacing())
+            if (!style.letterSpacing())
                 return cssValuePool.createIdentifierValue(CSSValueNormal);
-            return zoomAdjustedPixelValue(style->letterSpacing(), *style);
+            return zoomAdjustedPixelValue(style.letterSpacing(), style);
         case CSSPropertyWebkitLineClamp:
-            if (style->lineClamp().isNone())
+            if (style.lineClamp().isNone())
                 return cssValuePool.createIdentifierValue(CSSValueNone);
-            return cssValuePool.createValue(style->lineClamp().value(), style->lineClamp().isPercentage() ? CSSPrimitiveValue::CSS_PERCENTAGE : CSSPrimitiveValue::CSS_NUMBER);
+            return cssValuePool.createValue(style.lineClamp().value(), style.lineClamp().isPercentage() ? CSSPrimitiveValue::CSS_PERCENTAGE : CSSPrimitiveValue::CSS_NUMBER);
         case CSSPropertyLineHeight:
-            return lineHeightFromStyle(*style);
+            return lineHeightFromStyle(style);
         case CSSPropertyListStyleImage:
-            if (style->listStyleImage())
-                return style->listStyleImage()->cssValue();
+            if (style.listStyleImage())
+                return style.listStyleImage()->cssValue();
             return cssValuePool.createIdentifierValue(CSSValueNone);
         case CSSPropertyListStylePosition:
-            return cssValuePool.createValue(style->listStylePosition());
+            return cssValuePool.createValue(style.listStylePosition());
         case CSSPropertyListStyleType:
-            return cssValuePool.createValue(style->listStyleType());
+            return cssValuePool.createValue(style.listStyleType());
         case CSSPropertyWebkitLocale:
-            if (style->locale().isNull())
+            if (style.locale().isNull())
                 return cssValuePool.createIdentifierValue(CSSValueAuto);
-            return cssValuePool.createValue(style->locale(), CSSPrimitiveValue::CSS_STRING);
+            return cssValuePool.createValue(style.locale(), CSSPrimitiveValue::CSS_STRING);
         case CSSPropertyMarginTop:
-            return zoomAdjustedPaddingOrMarginPixelValue<&RenderStyle::marginTop, &RenderBoxModelObject::marginTop>(*style, renderer);
+            return zoomAdjustedPaddingOrMarginPixelValue<&RenderStyle::marginTop, &RenderBoxModelObject::marginTop>(style, renderer);
         case CSSPropertyMarginRight: {
-            Length marginRight = style->marginRight();
+            Length marginRight = style.marginRight();
             if (marginRight.isFixed() || !is<RenderBox>(renderer))
-                return zoomAdjustedPixelValueForLength(marginRight, *style);
+                return zoomAdjustedPixelValueForLength(marginRight, style);
             float value;
             if (marginRight.isPercentOrCalculated()) {
                 // RenderBox gives a marginRight() that is the distance between the right-edge of the child box
@@ -3185,148 +3190,150 @@
                 value = minimumValueForLength(marginRight, downcast<RenderBox>(*renderer).containingBlockLogicalWidthForContent());
             } else
                 value = downcast<RenderBox>(*renderer).marginRight();
-            return zoomAdjustedPixelValue(value, *style);
+            return zoomAdjustedPixelValue(value, style);
         }
         case CSSPropertyMarginBottom:
-            return zoomAdjustedPaddingOrMarginPixelValue<&RenderStyle::marginBottom, &RenderBoxModelObject::marginBottom>(*style, renderer);
+            return zoomAdjustedPaddingOrMarginPixelValue<&RenderStyle::marginBottom, &RenderBoxModelObject::marginBottom>(style, renderer);
         case CSSPropertyMarginLeft:
-            return zoomAdjustedPaddingOrMarginPixelValue<&RenderStyle::marginLeft, &RenderBoxModelObject::marginLeft>(*style, renderer);
+            return zoomAdjustedPaddingOrMarginPixelValue<&RenderStyle::marginLeft, &RenderBoxModelObject::marginLeft>(style, renderer);
         case CSSPropertyWebkitMarqueeDirection:
-            return cssValuePool.createValue(style->marqueeDirection());
+            return cssValuePool.createValue(style.marqueeDirection());
         case CSSPropertyWebkitMarqueeIncrement:
-            return cssValuePool.createValue(style->marqueeIncrement());
+            return cssValuePool.createValue(style.marqueeIncrement());
         case CSSPropertyWebkitMarqueeRepetition:
-            if (style->marqueeLoopCount() < 0)
+            if (style.marqueeLoopCount() < 0)
                 return cssValuePool.createIdentifierValue(CSSValueInfinite);
-            return cssValuePool.createValue(style->marqueeLoopCount(), CSSPrimitiveValue::CSS_NUMBER);
+            return cssValuePool.createValue(style.marqueeLoopCount(), CSSPrimitiveValue::CSS_NUMBER);
         case CSSPropertyWebkitMarqueeStyle:
-            return cssValuePool.createValue(style->marqueeBehavior());
+            return cssValuePool.createValue(style.marqueeBehavior());
         case CSSPropertyWebkitUserModify:
-            return cssValuePool.createValue(style->userModify());
+            return cssValuePool.createValue(style.userModify());
         case CSSPropertyMaxHeight: {
-            const Length& maxHeight = style->maxHeight();
+            const Length& maxHeight = style.maxHeight();
             if (maxHeight.isUndefined())
                 return cssValuePool.createIdentifierValue(CSSValueNone);
-            return zoomAdjustedPixelValueForLength(maxHeight, *style);
+            return zoomAdjustedPixelValueForLength(maxHeight, style);
         }
         case CSSPropertyMaxWidth: {
-            const Length& maxWidth = style->maxWidth();
+            const Length& maxWidth = style.maxWidth();
             if (maxWidth.isUndefined())
                 return cssValuePool.createIdentifierValue(CSSValueNone);
-            return zoomAdjustedPixelValueForLength(maxWidth, *style);
+            return zoomAdjustedPixelValueForLength(maxWidth, style);
         }
         case CSSPropertyMinHeight:
-            if (style->minHeight().isAuto()) {
-                if (isFlexOrGrid(styledElement->parentNode()))
+            if (style.minHeight().isAuto()) {
+                auto* styledElement = this->styledElement();
+                if (styledElement && isFlexOrGrid(styledElement->parentNode()))
                     return cssValuePool.createIdentifierValue(CSSValueAuto);
-                return zoomAdjustedPixelValue(0, *style);
+                return zoomAdjustedPixelValue(0, style);
             }
-            return zoomAdjustedPixelValueForLength(style->minHeight(), *style);
+            return zoomAdjustedPixelValueForLength(style.minHeight(), style);
         case CSSPropertyMinWidth:
-            if (style->minWidth().isAuto()) {
-                if (isFlexOrGrid(styledElement->parentNode()))
+            if (style.minWidth().isAuto()) {
+                auto* styledElement = this->styledElement();
+                if (styledElement && isFlexOrGrid(styledElement->parentNode()))
                     return cssValuePool.createIdentifierValue(CSSValueAuto);
-                return zoomAdjustedPixelValue(0, *style);
+                return zoomAdjustedPixelValue(0, style);
             }
-            return zoomAdjustedPixelValueForLength(style->minWidth(), *style);
+            return zoomAdjustedPixelValueForLength(style.minWidth(), style);
         case CSSPropertyObjectFit:
-            return cssValuePool.createValue(style->objectFit());
+            return cssValuePool.createValue(style.objectFit());
         case CSSPropertyObjectPosition: {
             auto list = CSSValueList::createSpaceSeparated();
-            list->append(zoomAdjustedPixelValueForLength(style->objectPosition().x(), *style));
-            list->append(zoomAdjustedPixelValueForLength(style->objectPosition().y(), *style));
+            list->append(zoomAdjustedPixelValueForLength(style.objectPosition().x(), style));
+            list->append(zoomAdjustedPixelValueForLength(style.objectPosition().y(), style));
             return WTFMove(list);
         }
         case CSSPropertyOpacity:
-            return cssValuePool.createValue(style->opacity(), CSSPrimitiveValue::CSS_NUMBER);
+            return cssValuePool.createValue(style.opacity(), CSSPrimitiveValue::CSS_NUMBER);
         case CSSPropertyOrphans:
-            if (style->hasAutoOrphans())
+            if (style.hasAutoOrphans())
                 return cssValuePool.createIdentifierValue(CSSValueAuto);
-            return cssValuePool.createValue(style->orphans(), CSSPrimitiveValue::CSS_NUMBER);
+            return cssValuePool.createValue(style.orphans(), CSSPrimitiveValue::CSS_NUMBER);
         case CSSPropertyOutlineColor:
-            return m_allowVisitedStyle ? cssValuePool.createColorValue(style->visitedDependentColor(CSSPropertyOutlineColor)) : currentColorOrValidColor(style, style->outlineColor());
+            return m_allowVisitedStyle ? cssValuePool.createColorValue(style.visitedDependentColor(CSSPropertyOutlineColor)) : currentColorOrValidColor(&style, style.outlineColor());
         case CSSPropertyOutlineOffset:
-            return zoomAdjustedPixelValue(style->outlineOffset(), *style);
+            return zoomAdjustedPixelValue(style.outlineOffset(), style);
         case CSSPropertyOutlineStyle:
-            if (style->outlineStyleIsAuto())
+            if (style.outlineStyleIsAuto())
                 return cssValuePool.createIdentifierValue(CSSValueAuto);
-            return cssValuePool.createValue(style->outlineStyle());
+            return cssValuePool.createValue(style.outlineStyle());
         case CSSPropertyOutlineWidth:
-            return zoomAdjustedPixelValue(style->outlineWidth(), *style);
+            return zoomAdjustedPixelValue(style.outlineWidth(), style);
         case CSSPropertyOverflow:
-            return cssValuePool.createValue(std::max(style->overflowX(), style->overflowY()));
+            return cssValuePool.createValue(std::max(style.overflowX(), style.overflowY()));
         case CSSPropertyOverflowWrap:
-            return cssValuePool.createValue(style->overflowWrap());
+            return cssValuePool.createValue(style.overflowWrap());
         case CSSPropertyOverflowX:
-            return cssValuePool.createValue(style->overflowX());
+            return cssValuePool.createValue(style.overflowX());
         case CSSPropertyOverflowY:
-            return cssValuePool.createValue(style->overflowY());
+            return cssValuePool.createValue(style.overflowY());
         case CSSPropertyPaddingTop:
-            return zoomAdjustedPaddingOrMarginPixelValue<&RenderStyle::paddingTop, &RenderBoxModelObject::computedCSSPaddingTop>(*style, renderer);
+            return zoomAdjustedPaddingOrMarginPixelValue<&RenderStyle::paddingTop, &RenderBoxModelObject::computedCSSPaddingTop>(style, renderer);
         case CSSPropertyPaddingRight:
-            return zoomAdjustedPaddingOrMarginPixelValue<&RenderStyle::paddingRight, &RenderBoxModelObject::computedCSSPaddingRight>(*style, renderer);
+            return zoomAdjustedPaddingOrMarginPixelValue<&RenderStyle::paddingRight, &RenderBoxModelObject::computedCSSPaddingRight>(style, renderer);
         case CSSPropertyPaddingBottom:
-            return zoomAdjustedPaddingOrMarginPixelValue<&RenderStyle::paddingBottom, &RenderBoxModelObject::computedCSSPaddingBottom>(*style, renderer);
+            return zoomAdjustedPaddingOrMarginPixelValue<&RenderStyle::paddingBottom, &RenderBoxModelObject::computedCSSPaddingBottom>(style, renderer);
         case CSSPropertyPaddingLeft:
-            return zoomAdjustedPaddingOrMarginPixelValue<&RenderStyle::paddingLeft, &RenderBoxModelObject::computedCSSPaddingLeft>(*style, renderer);
+            return zoomAdjustedPaddingOrMarginPixelValue<&RenderStyle::paddingLeft, &RenderBoxModelObject::computedCSSPaddingLeft>(style, renderer);
         case CSSPropertyPageBreakAfter:
-            return cssValuePool.createValue(convertToPageBreak(style->breakAfter()));
+            return cssValuePool.createValue(convertToPageBreak(style.breakAfter()));
         case CSSPropertyPageBreakBefore:
-            return cssValuePool.createValue(convertToPageBreak(style->breakBefore()));
+            return cssValuePool.createValue(convertToPageBreak(style.breakBefore()));
         case CSSPropertyPageBreakInside:
-            return cssValuePool.createValue(convertToPageBreak(style->breakInside()));
+            return cssValuePool.createValue(convertToPageBreak(style.breakInside()));
         case CSSPropertyBreakAfter:
-            return cssValuePool.createValue(style->breakAfter());
+            return cssValuePool.createValue(style.breakAfter());
         case CSSPropertyBreakBefore:
-            return cssValuePool.createValue(style->breakBefore());
+            return cssValuePool.createValue(style.breakBefore());
         case CSSPropertyBreakInside:
-            return cssValuePool.createValue(style->breakInside());
+            return cssValuePool.createValue(style.breakInside());
         case CSSPropertyHangingPunctuation:
-            return hangingPunctuationToCSSValue(style->hangingPunctuation());
+            return hangingPunctuationToCSSValue(style.hangingPunctuation());
         case CSSPropertyPosition:
-            return cssValuePool.createValue(style->position());
+            return cssValuePool.createValue(style.position());
         case CSSPropertyRight:
-            return positionOffsetValue(*style, CSSPropertyRight, renderer);
+            return positionOffsetValue(style, CSSPropertyRight, renderer);
         case CSSPropertyWebkitRubyPosition:
-            return cssValuePool.createValue(style->rubyPosition());
+            return cssValuePool.createValue(style.rubyPosition());
         case CSSPropertyTableLayout:
-            return cssValuePool.createValue(style->tableLayout());
+            return cssValuePool.createValue(style.tableLayout());
         case CSSPropertyTextAlign:
-            return cssValuePool.createValue(style->textAlign());
+            return cssValuePool.createValue(style.textAlign());
         case CSSPropertyTextDecoration:
-            return renderTextDecorationFlagsToCSSValue(style->textDecoration());
+            return renderTextDecorationFlagsToCSSValue(style.textDecoration());
 #if ENABLE(CSS3_TEXT)
         case CSSPropertyWebkitTextAlignLast:
-            return cssValuePool.createValue(style->textAlignLast());
+            return cssValuePool.createValue(style.textAlignLast());
         case CSSPropertyWebkitTextJustify:
-            return cssValuePool.createValue(style->textJustify());
+            return cssValuePool.createValue(style.textJustify());
 #endif // CSS3_TEXT
         case CSSPropertyWebkitTextDecoration:
             return getCSSPropertyValuesForShorthandProperties(webkitTextDecorationShorthand());
         case CSSPropertyWebkitTextDecorationLine:
-            return renderTextDecorationFlagsToCSSValue(style->textDecoration());
+            return renderTextDecorationFlagsToCSSValue(style.textDecoration());
         case CSSPropertyWebkitTextDecorationStyle:
-            return renderTextDecorationStyleFlagsToCSSValue(style->textDecorationStyle());
+            return renderTextDecorationStyleFlagsToCSSValue(style.textDecorationStyle());
         case CSSPropertyWebkitTextDecorationColor:
-            return currentColorOrValidColor(style, style->textDecorationColor());
+            return currentColorOrValidColor(&style, style.textDecorationColor());
         case CSSPropertyWebkitTextDecorationSkip:
-            return renderTextDecorationSkipFlagsToCSSValue(style->textDecorationSkip());
+            return renderTextDecorationSkipFlagsToCSSValue(style.textDecorationSkip());
         case CSSPropertyWebkitTextUnderlinePosition:
-            return cssValuePool.createValue(style->textUnderlinePosition());
+            return cssValuePool.createValue(style.textUnderlinePosition());
         case CSSPropertyWebkitTextDecorationsInEffect:
-            return renderTextDecorationFlagsToCSSValue(style->textDecorationsInEffect());
+            return renderTextDecorationFlagsToCSSValue(style.textDecorationsInEffect());
         case CSSPropertyWebkitTextFillColor:
-            return currentColorOrValidColor(style, style->textFillColor());
+            return currentColorOrValidColor(&style, style.textFillColor());
         case CSSPropertyWebkitTextEmphasisColor:
-            return currentColorOrValidColor(style, style->textEmphasisColor());
+            return currentColorOrValidColor(&style, style.textEmphasisColor());
         case CSSPropertyWebkitTextEmphasisPosition:
-            return renderEmphasisPositionFlagsToCSSValue(style->textEmphasisPosition());
+            return renderEmphasisPositionFlagsToCSSValue(style.textEmphasisPosition());
         case CSSPropertyWebkitTextEmphasisStyle:
-            switch (style->textEmphasisMark()) {
+            switch (style.textEmphasisMark()) {
             case TextEmphasisMarkNone:
                 return cssValuePool.createIdentifierValue(CSSValueNone);
             case TextEmphasisMarkCustom:
-                return cssValuePool.createValue(style->textEmphasisCustomMark(), CSSPrimitiveValue::CSS_STRING);
+                return cssValuePool.createValue(style.textEmphasisCustomMark(), CSSPrimitiveValue::CSS_STRING);
             case TextEmphasisMarkAuto:
                 ASSERT_NOT_REACHED();
 #if ASSERT_DISABLED
@@ -3338,8 +3345,8 @@
             case TextEmphasisMarkTriangle:
             case TextEmphasisMarkSesame:
                 auto list = CSSValueList::createSpaceSeparated();
-                list->append(cssValuePool.createValue(style->textEmphasisFill()));
-                list->append(cssValuePool.createValue(style->textEmphasisMark()));
+                list->append(cssValuePool.createValue(style.textEmphasisFill()));
+                list->append(cssValuePool.createValue(style.textEmphasisMark()));
                 return WTFMove(list);
             }
             RELEASE_ASSERT_NOT_REACHED();
@@ -3346,16 +3353,16 @@
         case CSSPropertyTextIndent: {
             // If CSS3_TEXT is disabled or text-indent has only one value(<length> | <percentage>),
             // getPropertyCSSValue() returns CSSValue.
-            auto textIndent = zoomAdjustedPixelValueForLength(style->textIndent(), *style);
+            auto textIndent = zoomAdjustedPixelValueForLength(style.textIndent(), style);
 #if ENABLE(CSS3_TEXT)
             // If CSS3_TEXT is enabled and text-indent has -webkit-each-line or -webkit-hanging,
             // getPropertyCSSValue() returns CSSValueList.
-            if (style->textIndentLine() == TextIndentEachLine || style->textIndentType() == TextIndentHanging) {
+            if (style.textIndentLine() == TextIndentEachLine || style.textIndentType() == TextIndentHanging) {
                 auto list = CSSValueList::createSpaceSeparated();
                 list->append(WTFMove(textIndent));
-                if (style->textIndentLine() == TextIndentEachLine)
+                if (style.textIndentLine() == TextIndentEachLine)
                     list->append(cssValuePool.createIdentifierValue(CSSValueWebkitEachLine));
-                if (style->textIndentType() == TextIndentHanging)
+                if (style.textIndentType() == TextIndentHanging)
                     list->append(cssValuePool.createIdentifierValue(CSSValueWebkitHanging));
                 return WTFMove(list);
             }
@@ -3363,35 +3370,35 @@
             return WTFMove(textIndent);
         }
         case CSSPropertyTextShadow:
-            return valueForShadow(style->textShadow(), propertyID, *style);
+            return valueForShadow(style.textShadow(), propertyID, style);
         case CSSPropertyTextRendering:
-            return cssValuePool.createValue(style->fontDescription().textRenderingMode());
+            return cssValuePool.createValue(style.fontDescription().textRenderingMode());
         case CSSPropertyTextOverflow:
-            if (style->textOverflow())
+            if (style.textOverflow())
                 return cssValuePool.createIdentifierValue(CSSValueEllipsis);
             return cssValuePool.createIdentifierValue(CSSValueClip);
         case CSSPropertyWebkitTextSecurity:
-            return cssValuePool.createValue(style->textSecurity());
+            return cssValuePool.createValue(style.textSecurity());
 #if ENABLE(TEXT_AUTOSIZING)
         case CSSPropertyWebkitTextSizeAdjust:
-            if (style->textSizeAdjust().isAuto())
+            if (style.textSizeAdjust().isAuto())
                 return cssValuePool.createIdentifierValue(CSSValueAuto);
-            if (style->textSizeAdjust().isNone())
+            if (style.textSizeAdjust().isNone())
                 return cssValuePool.createIdentifierValue(CSSValueNone);
-            return CSSPrimitiveValue::create(style->textSizeAdjust().percentage(), CSSPrimitiveValue::CSS_PERCENTAGE);
+            return CSSPrimitiveValue::create(style.textSizeAdjust().percentage(), CSSPrimitiveValue::CSS_PERCENTAGE);
 #endif
         case CSSPropertyWebkitTextStrokeColor:
-            return currentColorOrValidColor(style, style->textStrokeColor());
+            return currentColorOrValidColor(&style, style.textStrokeColor());
         case CSSPropertyWebkitTextStrokeWidth:
-            return zoomAdjustedPixelValue(style->textStrokeWidth(), *style);
+            return zoomAdjustedPixelValue(style.textStrokeWidth(), style);
         case CSSPropertyTextTransform:
-            return cssValuePool.createValue(style->textTransform());
+            return cssValuePool.createValue(style.textTransform());
         case CSSPropertyTop:
-            return positionOffsetValue(*style, CSSPropertyTop, renderer);
+            return positionOffsetValue(style, CSSPropertyTop, renderer);
         case CSSPropertyUnicodeBidi:
-            return cssValuePool.createValue(style->unicodeBidi());
+            return cssValuePool.createValue(style.unicodeBidi());
         case CSSPropertyVerticalAlign:
-            switch (style->verticalAlign()) {
+            switch (style.verticalAlign()) {
                 case BASELINE:
                     return cssValuePool.createIdentifierValue(CSSValueBaseline);
                 case MIDDLE:
@@ -3411,18 +3418,18 @@
                 case BASELINE_MIDDLE:
                     return cssValuePool.createIdentifierValue(CSSValueWebkitBaselineMiddle);
                 case LENGTH:
-                    return cssValuePool.createValue(style->verticalAlignLength());
+                    return cssValuePool.createValue(style.verticalAlignLength());
             }
             ASSERT_NOT_REACHED();
             return nullptr;
         case CSSPropertyVisibility:
-            return cssValuePool.createValue(style->visibility());
+            return cssValuePool.createValue(style.visibility());
         case CSSPropertyWhiteSpace:
-            return cssValuePool.createValue(style->whiteSpace());
+            return cssValuePool.createValue(style.whiteSpace());
         case CSSPropertyWidows:
-            if (style->hasAutoWidows())
+            if (style.hasAutoWidows())
                 return cssValuePool.createIdentifierValue(CSSValueAuto);
-            return cssValuePool.createValue(style->widows(), CSSPrimitiveValue::CSS_NUMBER);
+            return cssValuePool.createValue(style.widows(), CSSPrimitiveValue::CSS_NUMBER);
         case CSSPropertyWidth:
             if (renderer && !renderer->isRenderSVGModelObject()) {
                 // According to http://www.w3.org/TR/CSS2/visudet.html#the-width-property,
@@ -3429,53 +3436,53 @@
                 // the "width" property does not apply for non-replaced inline elements.
                 if (isNonReplacedInline(*renderer))
                     return cssValuePool.createIdentifierValue(CSSValueAuto);
-                return zoomAdjustedPixelValue(sizingBox(*renderer).width(), *style);
+                return zoomAdjustedPixelValue(sizingBox(*renderer).width(), style);
             }
-            return zoomAdjustedPixelValueForLength(style->width(), *style);
+            return zoomAdjustedPixelValueForLength(style.width(), style);
         case CSSPropertyWillChange:
-            return willChangePropertyValue(style->willChange());
+            return willChangePropertyValue(style.willChange());
         case CSSPropertyWordBreak:
-            return cssValuePool.createValue(style->wordBreak());
+            return cssValuePool.createValue(style.wordBreak());
         case CSSPropertyWordSpacing:
-            return zoomAdjustedPixelValue(style->fontCascade().wordSpacing(), *style);
+            return zoomAdjustedPixelValue(style.fontCascade().wordSpacing(), style);
         case CSSPropertyWordWrap:
-            return cssValuePool.createValue(style->overflowWrap());
+            return cssValuePool.createValue(style.overflowWrap());
         case CSSPropertyLineBreak:
-            return cssValuePool.createValue(style->lineBreak());
+            return cssValuePool.createValue(style.lineBreak());
         case CSSPropertyWebkitNbspMode:
-            return cssValuePool.createValue(style->nbspMode());
+            return cssValuePool.createValue(style.nbspMode());
         case CSSPropertyResize:
-            return cssValuePool.createValue(style->resize());
+            return cssValuePool.createValue(style.resize());
         case CSSPropertyWebkitFontKerning:
-            return cssValuePool.createValue(style->fontDescription().kerning());
+            return cssValuePool.createValue(style.fontDescription().kerning());
         case CSSPropertyWebkitFontSmoothing:
-            return cssValuePool.createValue(style->fontDescription().fontSmoothing());
+            return cssValuePool.createValue(style.fontDescription().fontSmoothing());
         case CSSPropertyFontVariantLigatures:
-            return fontVariantLigaturesPropertyValue(style->fontDescription().variantCommonLigatures(), style->fontDescription().variantDiscretionaryLigatures(), style->fontDescription().variantHistoricalLigatures(), style->fontDescription().variantContextualAlternates());
+            return fontVariantLigaturesPropertyValue(style.fontDescription().variantCommonLigatures(), style.fontDescription().variantDiscretionaryLigatures(), style.fontDescription().variantHistoricalLigatures(), style.fontDescription().variantContextualAlternates());
         case CSSPropertyFontVariantPosition:
-            return fontVariantPositionPropertyValue(style->fontDescription().variantPosition());
+            return fontVariantPositionPropertyValue(style.fontDescription().variantPosition());
         case CSSPropertyFontVariantCaps:
-            return fontVariantCapsPropertyValue(style->fontDescription().variantCaps());
+            return fontVariantCapsPropertyValue(style.fontDescription().variantCaps());
         case CSSPropertyFontVariantNumeric:
-            return fontVariantNumericPropertyValue(style->fontDescription().variantNumericFigure(), style->fontDescription().variantNumericSpacing(), style->fontDescription().variantNumericFraction(), style->fontDescription().variantNumericOrdinal(), style->fontDescription().variantNumericSlashedZero());
+            return fontVariantNumericPropertyValue(style.fontDescription().variantNumericFigure(), style.fontDescription().variantNumericSpacing(), style.fontDescription().variantNumericFraction(), style.fontDescription().variantNumericOrdinal(), style.fontDescription().variantNumericSlashedZero());
         case CSSPropertyFontVariantAlternates:
-            return fontVariantAlternatesPropertyValue(style->fontDescription().variantAlternates());
+            return fontVariantAlternatesPropertyValue(style.fontDescription().variantAlternates());
         case CSSPropertyFontVariantEastAsian:
-            return fontVariantEastAsianPropertyValue(style->fontDescription().variantEastAsianVariant(), style->fontDescription().variantEastAsianWidth(), style->fontDescription().variantEastAsianRuby());
+            return fontVariantEastAsianPropertyValue(style.fontDescription().variantEastAsianVariant(), style.fontDescription().variantEastAsianWidth(), style.fontDescription().variantEastAsianRuby());
         case CSSPropertyZIndex:
-            if (style->hasAutoZIndex())
+            if (style.hasAutoZIndex())
                 return cssValuePool.createIdentifierValue(CSSValueAuto);
-            return cssValuePool.createValue(style->zIndex(), CSSPrimitiveValue::CSS_NUMBER);
+            return cssValuePool.createValue(style.zIndex(), CSSPrimitiveValue::CSS_NUMBER);
         case CSSPropertyZoom:
-            return cssValuePool.createValue(style->zoom(), CSSPrimitiveValue::CSS_NUMBER);
+            return cssValuePool.createValue(style.zoom(), CSSPrimitiveValue::CSS_NUMBER);
         case CSSPropertyBoxSizing:
-            if (style->boxSizing() == CONTENT_BOX)
+            if (style.boxSizing() == CONTENT_BOX)
                 return cssValuePool.createIdentifierValue(CSSValueContentBox);
             return cssValuePool.createIdentifierValue(CSSValueBorderBox);
 #if ENABLE(DASHBOARD_SUPPORT)
         case CSSPropertyWebkitDashboardRegion:
         {
-            const Vector<StyleDashboardRegion>& regions = style->dashboardRegions();
+            const Vector<StyleDashboardRegion>& regions = style.dashboardRegions();
             unsigned count = regions.size();
             if (count == 1 && regions[0].type == StyleDashboardRegion::None)
                 return cssValuePool.createIdentifierValue(CSSValueNone);
@@ -3488,10 +3495,10 @@
 
                 region->m_label = styleRegion.label;
                 LengthBox offset = styleRegion.offset;
-                region->setTop(zoomAdjustedPixelValue(offset.top().value(), *style));
-                region->setRight(zoomAdjustedPixelValue(offset.right().value(), *style));
-                region->setBottom(zoomAdjustedPixelValue(offset.bottom().value(), *style));
-                region->setLeft(zoomAdjustedPixelValue(offset.left().value(), *style));
+                region->setTop(zoomAdjustedPixelValue(offset.top().value(), style));
+                region->setRight(zoomAdjustedPixelValue(offset.right().value(), style));
+                region->setBottom(zoomAdjustedPixelValue(offset.bottom().value(), style));
+                region->setLeft(zoomAdjustedPixelValue(offset.left().value(), style));
                 region->m_isRectangle = (styleRegion.type == StyleDashboardRegion::Rectangle);
                 region->m_isCircle = (styleRegion.type == StyleDashboardRegion::Circle);
 
@@ -3505,10 +3512,10 @@
         }
 #endif
         case CSSPropertyAnimationDelay:
-            return delayValue(style->animations());
+            return delayValue(style.animations());
         case CSSPropertyAnimationDirection: {
             auto list = CSSValueList::createCommaSeparated();
-            const AnimationList* t = style->animations();
+            const AnimationList* t = style.animations();
             if (t) {
                 for (size_t i = 0; i < t->size(); ++i) {
                     switch (t->animation(i).direction()) {
@@ -3531,10 +3538,10 @@
             return WTFMove(list);
         }
         case CSSPropertyAnimationDuration:
-            return durationValue(style->animations());
+            return durationValue(style.animations());
         case CSSPropertyAnimationFillMode: {
             auto list = CSSValueList::createCommaSeparated();
-            const AnimationList* t = style->animations();
+            const AnimationList* t = style.animations();
             if (t) {
                 for (size_t i = 0; i < t->size(); ++i) {
                     switch (t->animation(i).fillMode()) {
@@ -3558,7 +3565,7 @@
         }
         case CSSPropertyAnimationIterationCount: {
             auto list = CSSValueList::createCommaSeparated();
-            const AnimationList* t = style->animations();
+            const AnimationList* t = style.animations();
             if (t) {
                 for (size_t i = 0; i < t->size(); ++i) {
                     double iterationCount = t->animation(i).iterationCount();
@@ -3573,7 +3580,7 @@
         }
         case CSSPropertyAnimationName: {
             auto list = CSSValueList::createCommaSeparated();
-            const AnimationList* t = style->animations();
+            const AnimationList* t = style.animations();
             if (t) {
                 for (size_t i = 0; i < t->size(); ++i)
                     list->append(cssValuePool.createValue(t->animation(i).name(), CSSPrimitiveValue::CSS_STRING));
@@ -3583,7 +3590,7 @@
         }
         case CSSPropertyAnimationPlayState: {
             auto list = CSSValueList::createCommaSeparated();
-            const AnimationList* t = style->animations();
+            const AnimationList* t = style.animations();
             if (t) {
                 for (size_t i = 0; i < t->size(); ++i) {
                     int prop = t->animation(i).playState();
@@ -3597,71 +3604,71 @@
             return WTFMove(list);
         }
         case CSSPropertyAnimationTimingFunction:
-            return timingFunctionValue(style->animations());
+            return timingFunctionValue(style.animations());
 #if ENABLE(CSS_ANIMATIONS_LEVEL_2)
         case CSSPropertyWebkitAnimationTrigger:
-            return animationTriggerValue(style->animations(), *style);
+            return animationTriggerValue(style.animations(), style);
 #endif
         case CSSPropertyWebkitAppearance:
-            return cssValuePool.createValue(style->appearance());
+            return cssValuePool.createValue(style.appearance());
         case CSSPropertyWebkitAspectRatio:
-            if (style->aspectRatioType() == AspectRatioAuto)
+            if (style.aspectRatioType() == AspectRatioAuto)
                 return cssValuePool.createIdentifierValue(CSSValueAuto);
-            if (style->aspectRatioType() == AspectRatioFromDimensions)
+            if (style.aspectRatioType() == AspectRatioFromDimensions)
                 return cssValuePool.createIdentifierValue(CSSValueFromDimensions);
-            if (style->aspectRatioType() == AspectRatioFromIntrinsic)
+            if (style.aspectRatioType() == AspectRatioFromIntrinsic)
                 return cssValuePool.createIdentifierValue(CSSValueFromIntrinsic);
-            return CSSAspectRatioValue::create(style->aspectRatioNumerator(), style->aspectRatioDenominator());
+            return CSSAspectRatioValue::create(style.aspectRatioNumerator(), style.aspectRatioDenominator());
         case CSSPropertyWebkitBackfaceVisibility:
-            return cssValuePool.createIdentifierValue((style->backfaceVisibility() == BackfaceVisibilityHidden) ? CSSValueHidden : CSSValueVisible);
+            return cssValuePool.createIdentifierValue((style.backfaceVisibility() == BackfaceVisibilityHidden) ? CSSValueHidden : CSSValueVisible);
         case CSSPropertyWebkitBorderImage:
-            return valueForNinePieceImage(style->borderImage());
+            return valueForNinePieceImage(style.borderImage());
         case CSSPropertyBorderImageOutset:
-            return valueForNinePieceImageQuad(style->borderImage().outset());
+            return valueForNinePieceImageQuad(style.borderImage().outset());
         case CSSPropertyBorderImageRepeat:
-            return valueForNinePieceImageRepeat(style->borderImage());
+            return valueForNinePieceImageRepeat(style.borderImage());
         case CSSPropertyBorderImageSlice:
-            return valueForNinePieceImageSlice(style->borderImage());
+            return valueForNinePieceImageSlice(style.borderImage());
         case CSSPropertyBorderImageWidth:
-            return valueForNinePieceImageQuad(style->borderImage().borderSlices());
+            return valueForNinePieceImageQuad(style.borderImage().borderSlices());
         case CSSPropertyWebkitMaskBoxImage:
-            return valueForNinePieceImage(style->maskBoxImage());
+            return valueForNinePieceImage(style.maskBoxImage());
         case CSSPropertyWebkitMaskBoxImageOutset:
-            return valueForNinePieceImageQuad(style->maskBoxImage().outset());
+            return valueForNinePieceImageQuad(style.maskBoxImage().outset());
         case CSSPropertyWebkitMaskBoxImageRepeat:
-            return valueForNinePieceImageRepeat(style->maskBoxImage());
+            return valueForNinePieceImageRepeat(style.maskBoxImage());
         case CSSPropertyWebkitMaskBoxImageSlice:
-            return valueForNinePieceImageSlice(style->maskBoxImage());
+            return valueForNinePieceImageSlice(style.maskBoxImage());
         case CSSPropertyWebkitMaskBoxImageWidth:
-            return valueForNinePieceImageQuad(style->maskBoxImage().borderSlices());
+            return valueForNinePieceImageQuad(style.maskBoxImage().borderSlices());
         case CSSPropertyWebkitMaskBoxImageSource:
-            if (style->maskBoxImageSource())
-                return style->maskBoxImageSource()->cssValue();
+            if (style.maskBoxImageSource())
+                return style.maskBoxImageSource()->cssValue();
             return cssValuePool.createIdentifierValue(CSSValueNone);
         case CSSPropertyWebkitFontSizeDelta:
             // Not a real style property -- used by the editing engine -- so has no computed value.
             break;
         case CSSPropertyWebkitInitialLetter: {
-            auto drop = !style->initialLetterDrop() ? cssValuePool.createIdentifierValue(CSSValueNormal) : cssValuePool.createValue(style->initialLetterDrop(), CSSPrimitiveValue::CSS_NUMBER);
-            auto size = !style->initialLetterHeight() ? cssValuePool.createIdentifierValue(CSSValueNormal) : cssValuePool.createValue(style->initialLetterHeight(), CSSPrimitiveValue::CSS_NUMBER);
+            auto drop = !style.initialLetterDrop() ? cssValuePool.createIdentifierValue(CSSValueNormal) : cssValuePool.createValue(style.initialLetterDrop(), CSSPrimitiveValue::CSS_NUMBER);
+            auto size = !style.initialLetterHeight() ? cssValuePool.createIdentifierValue(CSSValueNormal) : cssValuePool.createValue(style.initialLetterHeight(), CSSPrimitiveValue::CSS_NUMBER);
             return cssValuePool.createValue(Pair::create(WTFMove(drop), WTFMove(size)));
         }
         case CSSPropertyWebkitMarginBottomCollapse:
         case CSSPropertyWebkitMarginAfterCollapse:
-            return cssValuePool.createValue(style->marginAfterCollapse());
+            return cssValuePool.createValue(style.marginAfterCollapse());
         case CSSPropertyWebkitMarginTopCollapse:
         case CSSPropertyWebkitMarginBeforeCollapse:
-            return cssValuePool.createValue(style->marginBeforeCollapse());
+            return cssValuePool.createValue(style.marginBeforeCollapse());
 #if ENABLE(ACCELERATED_OVERFLOW_SCROLLING)
         case CSSPropertyWebkitOverflowScrolling:
-            if (!style->useTouchOverflowScrolling())
+            if (!style.useTouchOverflowScrolling())
                 return cssValuePool.createIdentifierValue(CSSValueAuto);
             return cssValuePool.createIdentifierValue(CSSValueTouch);
 #endif
         case CSSPropertyPerspective:
-            if (!style->hasPerspective())
+            if (!style.hasPerspective())
                 return cssValuePool.createIdentifierValue(CSSValueNone);
-            return zoomAdjustedPixelValue(style->perspective(), *style);
+            return zoomAdjustedPixelValue(style.perspective(), style);
         case CSSPropertyPerspectiveOrigin: {
             auto list = CSSValueList::createSpaceSeparated();
             if (renderer) {
@@ -3669,56 +3676,56 @@
                 if (is<RenderBox>(*renderer))
                     box = downcast<RenderBox>(*renderer).borderBoxRect();
 
-                list->append(zoomAdjustedPixelValue(minimumValueForLength(style->perspectiveOriginX(), box.width()), *style));
-                list->append(zoomAdjustedPixelValue(minimumValueForLength(style->perspectiveOriginY(), box.height()), *style));
+                list->append(zoomAdjustedPixelValue(minimumValueForLength(style.perspectiveOriginX(), box.width()), style));
+                list->append(zoomAdjustedPixelValue(minimumValueForLength(style.perspectiveOriginY(), box.height()), style));
             }
             else {
-                list->append(zoomAdjustedPixelValueForLength(style->perspectiveOriginX(), *style));
-                list->append(zoomAdjustedPixelValueForLength(style->perspectiveOriginY(), *style));
+                list->append(zoomAdjustedPixelValueForLength(style.perspectiveOriginX(), style));
+                list->append(zoomAdjustedPixelValueForLength(style.perspectiveOriginY(), style));
 
             }
             return WTFMove(list);
         }
         case CSSPropertyWebkitRtlOrdering:
-            return cssValuePool.createIdentifierValue(style->rtlOrdering() ? CSSValueVisual : CSSValueLogical);
+            return cssValuePool.createIdentifierValue(style.rtlOrdering() ? CSSValueVisual : CSSValueLogical);
 #if ENABLE(TOUCH_EVENTS)
         case CSSPropertyWebkitTapHighlightColor:
-            return currentColorOrValidColor(style, style->tapHighlightColor());
+            return currentColorOrValidColor(&style, style.tapHighlightColor());
         case CSSPropertyTouchAction:
-            return cssValuePool.createValue(style->touchAction());
+            return cssValuePool.createValue(style.touchAction());
 #endif
 #if PLATFORM(IOS)
         case CSSPropertyWebkitTouchCallout:
-            return cssValuePool.createIdentifierValue(style->touchCalloutEnabled() ? CSSValueDefault : CSSValueNone);
+            return cssValuePool.createIdentifierValue(style.touchCalloutEnabled() ? CSSValueDefault : CSSValueNone);
 #endif
         case CSSPropertyWebkitUserDrag:
-            return cssValuePool.createValue(style->userDrag());
+            return cssValuePool.createValue(style.userDrag());
         case CSSPropertyWebkitUserSelect:
-            return cssValuePool.createValue(style->userSelect());
+            return cssValuePool.createValue(style.userSelect());
         case CSSPropertyBorderBottomLeftRadius:
-            return borderRadiusCornerValue(style->borderBottomLeftRadius(), *style);
+            return borderRadiusCornerValue(style.borderBottomLeftRadius(), style);
         case CSSPropertyBorderBottomRightRadius:
-            return borderRadiusCornerValue(style->borderBottomRightRadius(), *style);
+            return borderRadiusCornerValue(style.borderBottomRightRadius(), style);
         case CSSPropertyBorderTopLeftRadius:
-            return borderRadiusCornerValue(style->borderTopLeftRadius(), *style);
+            return borderRadiusCornerValue(style.borderTopLeftRadius(), style);
         case CSSPropertyBorderTopRightRadius:
-            return borderRadiusCornerValue(style->borderTopRightRadius(), *style);
+            return borderRadiusCornerValue(style.borderTopRightRadius(), style);
         case CSSPropertyClip: {
-            if (!style->hasClip())
+            if (!style.hasClip())
                 return cssValuePool.createIdentifierValue(CSSValueAuto);
             auto rect = Rect::create();
-            rect->setTop(autoOrZoomAdjustedValue(style->clip().top(), *style));
-            rect->setRight(autoOrZoomAdjustedValue(style->clip().right(), *style));
-            rect->setBottom(autoOrZoomAdjustedValue(style->clip().bottom(), *style));
-            rect->setLeft(autoOrZoomAdjustedValue(style->clip().left(), *style));
+            rect->setTop(autoOrZoomAdjustedValue(style.clip().top(), style));
+            rect->setRight(autoOrZoomAdjustedValue(style.clip().right(), style));
+            rect->setBottom(autoOrZoomAdjustedValue(style.clip().bottom(), style));
+            rect->setLeft(autoOrZoomAdjustedValue(style.clip().left(), style));
             return cssValuePool.createValue(WTFMove(rect));
         }
         case CSSPropertySpeakAs:
-            return speakAsToCSSValue(style->speakAs());
+            return speakAsToCSSValue(style.speakAs());
         case CSSPropertyTransform:
-            return computedTransform(renderer, *style);
+            return computedTransform(renderer, style);
         case CSSPropertyTransformBox:
-            return CSSPrimitiveValue::create(style->transformBox());
+            return CSSPrimitiveValue::create(style.transformBox());
         case CSSPropertyTransformOrigin: {
             auto list = CSSValueList::createSpaceSeparated();
             if (renderer) {
@@ -3726,31 +3733,31 @@
                 if (is<RenderBox>(*renderer))
                     box = downcast<RenderBox>(*renderer).borderBoxRect();
 
-                list->append(zoomAdjustedPixelValue(minimumValueForLength(style->transformOriginX(), box.width()), *style));
-                list->append(zoomAdjustedPixelValue(minimumValueForLength(style->transformOriginY(), box.height()), *style));
-                if (style->transformOriginZ() != 0)
-                    list->append(zoomAdjustedPixelValue(style->transformOriginZ(), *style));
+                list->append(zoomAdjustedPixelValue(minimumValueForLength(style.transformOriginX(), box.width()), style));
+                list->append(zoomAdjustedPixelValue(minimumValueForLength(style.transformOriginY(), box.height()), style));
+                if (style.transformOriginZ())
+                    list->append(zoomAdjustedPixelValue(style.transformOriginZ(), style));
             } else {
-                list->append(zoomAdjustedPixelValueForLength(style->transformOriginX(), *style));
-                list->append(zoomAdjustedPixelValueForLength(style->transformOriginY(), *style));
-                if (style->transformOriginZ() != 0)
-                    list->append(zoomAdjustedPixelValue(style->transformOriginZ(), *style));
+                list->append(zoomAdjustedPixelValueForLength(style.transformOriginX(), style));
+                list->append(zoomAdjustedPixelValueForLength(style.transformOriginY(), style));
+                if (style.transformOriginZ())
+                    list->append(zoomAdjustedPixelValue(style.transformOriginZ(), style));
             }
             return WTFMove(list);
         }
         case CSSPropertyTransformStyle:
         case CSSPropertyWebkitTransformStyle:
-            return cssValuePool.createIdentifierValue((style->transformStyle3D() == TransformStyle3DPreserve3D) ? CSSValuePreserve3d : CSSValueFlat);
+            return cssValuePool.createIdentifierValue((style.transformStyle3D() == TransformStyle3DPreserve3D) ? CSSValuePreserve3d : CSSValueFlat);
         case CSSPropertyTransitionDelay:
-            return delayValue(style->transitions());
+            return delayValue(style.transitions());
         case CSSPropertyTransitionDuration:
-            return durationValue(style->transitions());
+            return durationValue(style.transitions());
         case CSSPropertyTransitionProperty:
-            return transitionPropertyValue(style->transitions());
+            return transitionPropertyValue(style.transitions());
         case CSSPropertyTransitionTimingFunction:
-            return timingFunctionValue(style->transitions());
+            return timingFunctionValue(style.transitions());
         case CSSPropertyTransition: {
-            if (auto* animationList = style->transitions()) {
+            if (auto* animationList = style.transitions()) {
                 auto transitionsList = CSSValueList::createCommaSeparated();
                 for (size_t i = 0; i < animationList->size(); ++i) {
                     auto list = CSSValueList::createSpaceSeparated();
@@ -3773,33 +3780,33 @@
             return WTFMove(list);
         }
         case CSSPropertyPointerEvents:
-            return cssValuePool.createValue(style->pointerEvents());
+            return cssValuePool.createValue(style.pointerEvents());
         case CSSPropertyWebkitLineGrid:
-            if (style->lineGrid().isNull())
+            if (style.lineGrid().isNull())
                 return cssValuePool.createIdentifierValue(CSSValueNone);
-            return cssValuePool.createValue(style->lineGrid(), CSSPrimitiveValue::CSS_STRING);
+            return cssValuePool.createValue(style.lineGrid(), CSSPrimitiveValue::CSS_STRING);
         case CSSPropertyWebkitLineSnap:
-            return CSSPrimitiveValue::create(style->lineSnap());
+            return CSSPrimitiveValue::create(style.lineSnap());
         case CSSPropertyWebkitLineAlign:
-            return CSSPrimitiveValue::create(style->lineAlign());
+            return CSSPrimitiveValue::create(style.lineAlign());
         case CSSPropertyWritingMode:
-            return cssValuePool.createValue(style->writingMode());
+            return cssValuePool.createValue(style.writingMode());
         case CSSPropertyWebkitTextCombine:
-            return cssValuePool.createValue(style->textCombine());
+            return cssValuePool.createValue(style.textCombine());
         case CSSPropertyWebkitTextOrientation:
-            return CSSPrimitiveValue::create(style->textOrientation());
+            return CSSPrimitiveValue::create(style.textOrientation());
         case CSSPropertyWebkitLineBoxContain:
-            return createLineBoxContainValue(style->lineBoxContain());
+            return createLineBoxContainValue(style.lineBoxContain());
         case CSSPropertyAlt:
-            return altTextToCSSValue(*style);
+            return altTextToCSSValue(style);
         case CSSPropertyContent:
-            return contentToCSSValue(*style);
+            return contentToCSSValue(style);
         case CSSPropertyCounterIncrement:
-            return counterToCSSValue(*style, propertyID);
+            return counterToCSSValue(style, propertyID);
         case CSSPropertyCounterReset:
-            return counterToCSSValue(*style, propertyID);
+            return counterToCSSValue(style, propertyID);
         case CSSPropertyWebkitClipPath: {
-            auto* operation = style->clipPath();
+            auto* operation = style.clipPath();
             if (!operation)
                 return cssValuePool.createIdentifierValue(CSSValueNone);
             if (is<ReferenceClipPathOperation>(*operation))
@@ -3807,7 +3814,7 @@
             auto list = CSSValueList::createSpaceSeparated();
             if (is<ShapeClipPathOperation>(*operation)) {
                 auto& shapeOperation = downcast<ShapeClipPathOperation>(*operation);
-                list->append(valueForBasicShape(*style, shapeOperation.basicShape()));
+                list->append(valueForBasicShape(style, shapeOperation.basicShape()));
                 if (shapeOperation.referenceBox() != BoxMissing)
                     list->append(cssValuePool.createValue(shapeOperation.referenceBox()));
             }
@@ -3816,25 +3823,25 @@
             return WTFMove(list);
         }
         case CSSPropertyShapeMargin:
-            return cssValuePool.createValue(style->shapeMargin(), *style);
+            return cssValuePool.createValue(style.shapeMargin(), style);
         case CSSPropertyShapeImageThreshold:
-            return cssValuePool.createValue(style->shapeImageThreshold(), CSSPrimitiveValue::CSS_NUMBER);
+            return cssValuePool.createValue(style.shapeImageThreshold(), CSSPrimitiveValue::CSS_NUMBER);
         case CSSPropertyShapeOutside:
-            return shapePropertyValue(*style, style->shapeOutside());
+            return shapePropertyValue(style, style.shapeOutside());
         case CSSPropertyFilter:
-            return valueForFilter(*style, style->filter());
+            return valueForFilter(style, style.filter());
 #if ENABLE(FILTERS_LEVEL_2)
         case CSSPropertyWebkitBackdropFilter:
-            return valueForFilter(*style, style->backdropFilter());
+            return valueForFilter(style, style.backdropFilter());
 #endif
 #if ENABLE(CSS_COMPOSITING)
         case CSSPropertyMixBlendMode:
-            return cssValuePool.createValue(style->blendMode());
+            return cssValuePool.createValue(style.blendMode());
         case CSSPropertyIsolation:
-            return cssValuePool.createValue(style->isolation());
+            return cssValuePool.createValue(style.isolation());
 #endif
         case CSSPropertyBackgroundBlendMode: {
-            auto& layers = style->backgroundLayers();
+            auto& layers = style.backgroundLayers();
             if (!layers.next())
                 return cssValuePool.createValue(layers.blendMode());
             auto list = CSSValueList::createCommaSeparated();
@@ -3860,9 +3867,9 @@
         case CSSPropertyBorderLeft:
             return getCSSPropertyValuesForShorthandProperties(borderLeftShorthand());
         case CSSPropertyBorderImage:
-            return valueForNinePieceImage(style->borderImage());
+            return valueForNinePieceImage(style.borderImage());
         case CSSPropertyBorderRadius:
-            return borderRadiusShorthandValue(*style);
+            return borderRadiusShorthandValue(style);
         case CSSPropertyBorderRight:
             return getCSSPropertyValuesForShorthandProperties(borderRightShorthand());
         case CSSPropertyBorderStyle:
@@ -3888,39 +3895,39 @@
         case CSSPropertyScrollSnapMargin:
             return getCSSPropertyValuesForSidesShorthand(scrollSnapMarginShorthand());
         case CSSPropertyScrollSnapMarginBottom:
-            return zoomAdjustedPixelValueForLength(style->scrollSnapMarginBottom(), *style);
+            return zoomAdjustedPixelValueForLength(style.scrollSnapMarginBottom(), style);
         case CSSPropertyScrollSnapMarginTop:
-            return zoomAdjustedPixelValueForLength(style->scrollSnapMarginTop(), *style);
+            return zoomAdjustedPixelValueForLength(style.scrollSnapMarginTop(), style);
         case CSSPropertyScrollSnapMarginRight:
-            return zoomAdjustedPixelValueForLength(style->scrollSnapMarginRight(), *style);
+            return zoomAdjustedPixelValueForLength(style.scrollSnapMarginRight(), style);
         case CSSPropertyScrollSnapMarginLeft:
-            return zoomAdjustedPixelValueForLength(style->scrollSnapMarginLeft(), *style);
+            return zoomAdjustedPixelValueForLength(style.scrollSnapMarginLeft(), style);
         case CSSPropertyScrollPadding:
             return getCSSPropertyValuesForSidesShorthand(scrollPaddingShorthand());
         case CSSPropertyScrollPaddingBottom:
-            return zoomAdjustedPixelValueForLength(style->scrollPaddingBottom(), *style);
+            return zoomAdjustedPixelValueForLength(style.scrollPaddingBottom(), style);
         case CSSPropertyScrollPaddingTop:
-            return zoomAdjustedPixelValueForLength(style->scrollPaddingTop(), *style);
+            return zoomAdjustedPixelValueForLength(style.scrollPaddingTop(), style);
         case CSSPropertyScrollPaddingRight:
-            return zoomAdjustedPixelValueForLength(style->scrollPaddingRight(), *style);
+            return zoomAdjustedPixelValueForLength(style.scrollPaddingRight(), style);
         case CSSPropertyScrollPaddingLeft:
-            return zoomAdjustedPixelValueForLength(style->scrollPaddingLeft(), *style);
+            return zoomAdjustedPixelValueForLength(style.scrollPaddingLeft(), style);
         case CSSPropertyScrollSnapType:
-            return valueForScrollSnapType(style->scrollSnapType());
+            return valueForScrollSnapType(style.scrollSnapType());
         case CSSPropertyScrollSnapAlign:
-            return valueForScrollSnapAlignment(style->scrollSnapAlign());
+            return valueForScrollSnapAlignment(style.scrollSnapAlign());
 #endif
 
 #if ENABLE(CSS_TRAILING_WORD)
         case CSSPropertyAppleTrailingWord:
-            return cssValuePool.createValue(style->trailingWord());
+            return cssValuePool.createValue(style.trailingWord());
 #endif
 
 #if ENABLE(APPLE_PAY)
         case CSSPropertyApplePayButtonStyle:
-            return cssValuePool.createValue(style->applePayButtonStyle());
+            return cssValuePool.createValue(style.applePayButtonStyle());
         case CSSPropertyApplePayButtonType:
-            return cssValuePool.createValue(style->applePayButtonType());
+            return cssValuePool.createValue(style.applePayButtonType());
 #endif
 
         /* Individual properties not part of the spec */
@@ -3930,36 +3937,36 @@
 
         // Length properties for SVG.
         case CSSPropertyCx:
-            return zoomAdjustedPixelValueForLength(style->svgStyle().cx(), *style);
+            return zoomAdjustedPixelValueForLength(style.svgStyle().cx(), style);
         case CSSPropertyCy:
-            return zoomAdjustedPixelValueForLength(style->svgStyle().cy(), *style);
+            return zoomAdjustedPixelValueForLength(style.svgStyle().cy(), style);
         case CSSPropertyR:
-            return zoomAdjustedPixelValueForLength(style->svgStyle().r(), *style);
+            return zoomAdjustedPixelValueForLength(style.svgStyle().r(), style);
         case CSSPropertyRx:
-            return zoomAdjustedPixelValueForLength(style->svgStyle().rx(), *style);
+            return zoomAdjustedPixelValueForLength(style.svgStyle().rx(), style);
         case CSSPropertyRy:
-            return zoomAdjustedPixelValueForLength(style->svgStyle().ry(), *style);
+            return zoomAdjustedPixelValueForLength(style.svgStyle().ry(), style);
         case CSSPropertyStrokeDashoffset:
-            return zoomAdjustedPixelValueForLength(style->svgStyle().strokeDashOffset(), *style);
+            return zoomAdjustedPixelValueForLength(style.svgStyle().strokeDashOffset(), style);
         case CSSPropertyX:
-            return zoomAdjustedPixelValueForLength(style->svgStyle().x(), *style);
+            return zoomAdjustedPixelValueForLength(style.svgStyle().x(), style);
         case CSSPropertyY:
-            return zoomAdjustedPixelValueForLength(style->svgStyle().y(), *style);
+            return zoomAdjustedPixelValueForLength(style.svgStyle().y(), style);
         case CSSPropertyWebkitTextZoom:
-            return cssValuePool.createValue(style->textZoom());
+            return cssValuePool.createValue(style.textZoom());
 
         case CSSPropertyPaintOrder:
-            return paintOrder(style->paintOrder());
+            return paintOrder(style.paintOrder());
         case CSSPropertyStrokeLinecap:
-            return CSSPrimitiveValue::create(style->capStyle());
+            return CSSPrimitiveValue::create(style.capStyle());
         case CSSPropertyStrokeLinejoin:
-            return CSSPrimitiveValue::create(style->joinStyle());
+            return CSSPrimitiveValue::create(style.joinStyle());
         case CSSPropertyStrokeWidth:
-            return zoomAdjustedPixelValueForLength(style->strokeWidth(), *style);
+            return zoomAdjustedPixelValueForLength(style.strokeWidth(), style);
         case CSSPropertyStrokeColor:
-            return currentColorOrValidColor(style, style->strokeColor());
+            return currentColorOrValidColor(&style, style.strokeColor());
         case CSSPropertyStrokeMiterlimit:
-            return CSSPrimitiveValue::create(style->strokeMiterLimit(), CSSPrimitiveValue::CSS_NUMBER);
+            return CSSPrimitiveValue::create(style.strokeMiterLimit(), CSSPrimitiveValue::CSS_NUMBER);
 
         /* Unimplemented CSS 3 properties (including CSS3 shorthand properties) */
         case CSSPropertyAll:

Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.h (226626 => 226627)


--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.h	2018-01-09 12:48:34 UTC (rev 226626)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.h	2018-01-09 13:11:53 UTC (rev 226627)
@@ -55,6 +55,7 @@
     ComputedStyleExtractor(Element*, bool allowVisitedStyle = false, PseudoId = NOPSEUDO);
 
     RefPtr<CSSValue> propertyValue(CSSPropertyID, EUpdateLayout = UpdateLayout);
+    RefPtr<CSSValue> valueForPropertyinStyle(const RenderStyle&, CSSPropertyID, RenderElement* = nullptr);
     String customPropertyText(const String& propertyName);
     RefPtr<CSSValue> customPropertyValue(const String& propertyName);
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to