Commit 827be9c2 authored by akling@apple.com's avatar akling@apple.com

RenderElement::style() should return a reference.

<https://webkit.org/b/123414>

Now that renderers always have style, go ahead and make style()
return a RenderStyle&.

There are countless opportunities for further cleanup enabled by
this change. I'm simply passing &style() in many cases where we
can really do something nicer instead.

Reviewed by Anders Carlsson.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158163 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent a63fb723
2013-10-28 Andreas Kling <akling@apple.com>
RenderElement::style() should return a reference.
<https://webkit.org/b/123414>
Now that renderers always have style, go ahead and make style()
return a RenderStyle&.
There are countless opportunities for further cleanup enabled by
this change. I'm simply passing &style() in many cases where we
can really do something nicer instead.
Reviewed by Anders Carlsson.
2013-10-28 Tim Horton <timothy_horton@apple.com>
Make TileController create the appropriate PlatformCALayer subclasses
......
......@@ -175,7 +175,7 @@ String AccessibilityMediaControl::helpText() const
bool AccessibilityMediaControl::computeAccessibilityIsIgnored() const
{
if (!m_renderer || !m_renderer->style() || m_renderer->style()->visibility() != VISIBLE || controlType() == MediaTimelineContainer)
if (!m_renderer || m_renderer->style().visibility() != VISIBLE || controlType() == MediaTimelineContainer)
return true;
return accessibilityIsIgnoredByDefault();
......@@ -302,10 +302,10 @@ PassRefPtr<AccessibilityObject> AccessibilityMediaTimeDisplay::create(RenderObje
bool AccessibilityMediaTimeDisplay::computeAccessibilityIsIgnored() const
{
if (!m_renderer || !m_renderer->style() || m_renderer->style()->visibility() != VISIBLE)
if (!m_renderer || m_renderer->style().visibility() != VISIBLE)
return true;
if (!m_renderer->style()->width().value())
if (!m_renderer->style().width().value())
return true;
return accessibilityIsIgnoredByDefault();
......
......@@ -566,7 +566,7 @@ IntRect AccessibilityObject::boundingBoxForQuads(RenderObject* obj, const Vector
for (size_t i = 0; i < count; ++i) {
IntRect r = quads[i].enclosingBoundingBox();
if (!r.isEmpty()) {
if (obj->style()->hasAppearance())
if (obj->style().hasAppearance())
obj->theme()->adjustRepaintRect(obj, r);
result.unite(r);
}
......@@ -772,7 +772,7 @@ static VisiblePosition startOfStyleRange(const VisiblePosition& visiblePos)
{
RenderObject* renderer = visiblePos.deepEquivalent().deprecatedNode()->renderer();
RenderObject* startRenderer = renderer;
RenderStyle* style = renderer->style();
RenderStyle* style = &renderer->style();
// traverse backward by renderer to look for style change
for (RenderObject* r = renderer->previousInPreOrder(); r; r = r->previousInPreOrder()) {
......@@ -781,7 +781,7 @@ static VisiblePosition startOfStyleRange(const VisiblePosition& visiblePos)
continue;
// stop at style change
if (r->style() != style)
if (&r->style() != style)
break;
// remember match
......@@ -795,7 +795,7 @@ static VisiblePosition endOfStyleRange(const VisiblePosition& visiblePos)
{
RenderObject* renderer = visiblePos.deepEquivalent().deprecatedNode()->renderer();
RenderObject* endRenderer = renderer;
RenderStyle* style = renderer->style();
const RenderStyle& style = renderer->style();
// traverse forward by renderer to look for style change
for (RenderObject* r = renderer->nextInPreOrder(); r; r = r->nextInPreOrder()) {
......@@ -804,7 +804,7 @@ static VisiblePosition endOfStyleRange(const VisiblePosition& visiblePos)
continue;
// stop at style change
if (r->style() != style)
if (&r->style() != &style)
break;
// remember match
......@@ -2073,8 +2073,8 @@ bool AccessibilityObject::isDOMHidden() const
if (!renderer)
return true;
RenderStyle* style = renderer->style();
return style->display() == NONE || style->visibility() != VISIBLE;
const RenderStyle& style = renderer->style();
return style.display() == NONE || style.visibility() != VISIBLE;
}
AccessibilityObjectInclusion AccessibilityObject::defaultObjectInclusion() const
......
......@@ -917,7 +917,7 @@ ESpeak AccessibilityRenderObject::speakProperty() const
if (!m_renderer)
return AccessibilityObject::speakProperty();
return m_renderer->style()->speak();
return m_renderer->style().speak();
}
void AccessibilityRenderObject::addRadioButtonGroupMembers(AccessibilityChildrenVector& linkedUIElements) const
......@@ -1100,7 +1100,7 @@ AccessibilityObjectInclusion AccessibilityRenderObject::defaultObjectInclusion()
if (!m_renderer)
return IgnoreObject;
if (m_renderer->style()->visibility() != VISIBLE) {
if (m_renderer->style().visibility() != VISIBLE) {
// aria-hidden is meant to override visibility as the determinant in AX hierarchy inclusion.
if (equalIgnoringCase(getAttribute(aria_hiddenAttr), "false"))
return DefaultBehavior;
......@@ -1468,13 +1468,13 @@ URL AccessibilityRenderObject::url() const
bool AccessibilityRenderObject::isUnvisited() const
{
// FIXME: Is it a privacy violation to expose unvisited information to accessibility APIs?
return m_renderer->style()->isLink() && m_renderer->style()->insideLink() == InsideUnvisitedLink;
return m_renderer->style().isLink() && m_renderer->style().insideLink() == InsideUnvisitedLink;
}
bool AccessibilityRenderObject::isVisited() const
{
// FIXME: Is it a privacy violation to expose visited information to accessibility APIs?
return m_renderer->style()->isLink() && m_renderer->style()->insideLink() == InsideVisitedLink;
return m_renderer->style().isLink() && m_renderer->style().insideLink() == InsideVisitedLink;
}
void AccessibilityRenderObject::setElementAttributeValue(const QualifiedName& attributeName, bool value)
......@@ -3185,7 +3185,7 @@ bool AccessibilityRenderObject::hasBoldFont() const
if (!m_renderer)
return false;
return m_renderer->style()->fontDescription().weight() >= FontWeightBold;
return m_renderer->style().fontDescription().weight() >= FontWeightBold;
}
bool AccessibilityRenderObject::hasItalicFont() const
......@@ -3193,7 +3193,7 @@ bool AccessibilityRenderObject::hasItalicFont() const
if (!m_renderer)
return false;
return m_renderer->style()->fontDescription().italic() == FontItalicOn;
return m_renderer->style().fontDescription().italic() == FontItalicOn;
}
bool AccessibilityRenderObject::hasPlainText() const
......@@ -3201,11 +3201,11 @@ bool AccessibilityRenderObject::hasPlainText() const
if (!m_renderer)
return false;
RenderStyle* style = m_renderer->style();
const RenderStyle& style = m_renderer->style();
return style->fontDescription().weight() == FontWeightNormal
&& style->fontDescription().italic() == FontItalicOff
&& style->textDecorationsInEffect() == TextDecorationNone;
return style.fontDescription().weight() == FontWeightNormal
&& style.fontDescription().italic() == FontItalicOff
&& style.textDecorationsInEffect() == TextDecorationNone;
}
bool AccessibilityRenderObject::hasSameFont(RenderObject* renderer) const
......@@ -3213,7 +3213,7 @@ bool AccessibilityRenderObject::hasSameFont(RenderObject* renderer) const
if (!m_renderer || !renderer)
return false;
return m_renderer->style()->fontDescription().families() == renderer->style()->fontDescription().families();
return m_renderer->style().fontDescription().families() == renderer->style().fontDescription().families();
}
bool AccessibilityRenderObject::hasSameFontColor(RenderObject* renderer) const
......@@ -3221,7 +3221,7 @@ bool AccessibilityRenderObject::hasSameFontColor(RenderObject* renderer) const
if (!m_renderer || !renderer)
return false;
return m_renderer->style()->visitedDependentColor(CSSPropertyColor) == renderer->style()->visitedDependentColor(CSSPropertyColor);
return m_renderer->style().visitedDependentColor(CSSPropertyColor) == renderer->style().visitedDependentColor(CSSPropertyColor);
}
bool AccessibilityRenderObject::hasSameStyle(RenderObject* renderer) const
......@@ -3237,7 +3237,7 @@ bool AccessibilityRenderObject::hasUnderline() const
if (!m_renderer)
return false;
return m_renderer->style()->textDecorationsInEffect() & TextDecorationUnderline;
return m_renderer->style().textDecorationsInEffect() & TextDecorationUnderline;
}
String AccessibilityRenderObject::nameForMSAA() const
......
......@@ -56,11 +56,9 @@ AccessibilityOrientation AccessibilitySlider::orientation() const
if (!m_renderer)
return AccessibilityOrientationHorizontal;
RenderStyle* style = m_renderer->style();
if (!style)
return AccessibilityOrientationHorizontal;
ControlPart styleAppearance = style->appearance();
const RenderStyle& style = m_renderer->style();
ControlPart styleAppearance = style.appearance();
switch (styleAppearance) {
case SliderThumbHorizontalPart:
case SliderHorizontalPart:
......
......@@ -149,10 +149,8 @@ bool AccessibilityTable::isDataTable() const
return true;
// Store the background color of the table to check against cell's background colors.
RenderStyle* tableStyle = table->style();
if (!tableStyle)
return false;
Color tableBGColor = tableStyle->visitedDependentColor(CSSPropertyBackgroundColor);
const RenderStyle& tableStyle = table->style();
Color tableBGColor = tableStyle.visitedDependentColor(CSSPropertyBackgroundColor);
// check enough of the cells to find if the table matches our criteria
// Criteria:
......@@ -202,12 +200,10 @@ bool AccessibilityTable::isDataTable() const
|| !cellElement->axis().isEmpty() || !cellElement->scope().isEmpty())
return true;
RenderStyle* renderStyle = cell->style();
if (!renderStyle)
continue;
const RenderStyle& renderStyle = cell->style();
// If the empty-cells style is set, we'll call it a data table.
if (renderStyle->emptyCells() == HIDE)
if (renderStyle.emptyCells() == HIDE)
return true;
// If a cell has matching bordered sides, call it a (fully) bordered cell.
......@@ -228,7 +224,7 @@ bool AccessibilityTable::isDataTable() const
// If the cell has a different color from the table and there is cell spacing,
// then it is probably a data table cell (spacing and colors take the place of borders).
Color cellColor = renderStyle->visitedDependentColor(CSSPropertyBackgroundColor);
Color cellColor = renderStyle.visitedDependentColor(CSSPropertyBackgroundColor);
if (table->hBorderSpacing() > 0 && table->vBorderSpacing() > 0
&& tableBGColor != cellColor && cellColor.alpha() != 1)
backgroundDifferenceCellCount++;
......@@ -242,10 +238,8 @@ bool AccessibilityTable::isDataTable() const
RenderObject* renderRow = cell->parent();
if (!renderRow || !renderRow->isBoxModelObject() || !toRenderBoxModelObject(renderRow)->isTableRow())
continue;
RenderStyle* rowRenderStyle = renderRow->style();
if (!rowRenderStyle)
continue;
Color rowColor = rowRenderStyle->visitedDependentColor(CSSPropertyBackgroundColor);
const RenderStyle& rowRenderStyle = renderRow->style();
Color rowColor = rowRenderStyle.visitedDependentColor(CSSPropertyBackgroundColor);
alternatingRowColors[alternatingRowColorCount] = rowColor;
alternatingRowColorCount++;
}
......
......@@ -129,7 +129,7 @@ static gchar* textForRenderer(RenderObject* renderer)
// Insert the text of the marker for list item in the right place, if present
if (renderer->isListItem()) {
String markerText = toRenderListItem(renderer)->markerTextWithSuffix();
if (renderer->style()->direction() == LTR)
if (renderer->style().direction() == LTR)
g_string_prepend(resultText, markerText.utf8().data());
else
g_string_append(resultText, markerText.utf8().data());
......@@ -171,8 +171,8 @@ static int baselinePositionForRenderObject(RenderObject* renderObject)
// FIXME: This implementation of baselinePosition originates from RenderObject.cpp and was
// removed in r70072. The implementation looks incorrect though, because this is not the
// baseline of the underlying RenderObject, but of the AccessibilityRenderObject.
const FontMetrics& fontMetrics = renderObject->firstLineStyle()->fontMetrics();
return fontMetrics.ascent() + (renderObject->firstLineStyle()->computedLineHeight() - fontMetrics.height()) / 2;
const FontMetrics& fontMetrics = renderObject->firstLineStyle().fontMetrics();
return fontMetrics.ascent() + (renderObject->firstLineStyle().computedLineHeight() - fontMetrics.height()) / 2;
}
static AtkAttributeSet* getAttributeSetForAccessibilityObject(const AccessibilityObject* object)
......@@ -181,7 +181,7 @@ static AtkAttributeSet* getAttributeSetForAccessibilityObject(const Accessibilit
return 0;
RenderObject* renderer = object->renderer();
RenderStyle* style = renderer->style();
RenderStyle* style = &renderer->style();
AtkAttributeSet* result = 0;
GOwnPtr<gchar> buffer(g_strdup_printf("%i", style->fontSize()));
......@@ -460,7 +460,7 @@ static int offsetAdjustmentForListItem(const AccessibilityObject* object)
// We need to adjust the offsets for the list item marker in
// Left-To-Right text, since we expose it together with the text.
RenderObject* renderer = object->renderer();
if (renderer && renderer->isListItem() && renderer->style()->direction() == LTR)
if (renderer && renderer->isListItem() && renderer->style().direction() == LTR)
return toRenderListItem(renderer)->markerTextWithSuffix().length();
return 0;
......@@ -602,7 +602,7 @@ static gchar* webkitAccessibleTextGetText(AtkText* text, gint startOffset, gint
RenderObject* objRenderer = coreObject->renderer();
if (objRenderer && objRenderer->isListItem()) {
String markerText = toRenderListItem(objRenderer)->markerTextWithSuffix();
ret = objRenderer->style()->direction() == LTR ? markerText + ret : ret + markerText;
ret = objRenderer->style().direction() == LTR ? markerText + ret : ret + markerText;
if (endOffset == -1)
actualEndOffset = ret.length() + markerText.length();
}
......@@ -1045,11 +1045,11 @@ static char* webkitAccessibleTextLineForBoundary(AtkText* text, int offset, AtkT
RenderObject* renderer = coreObject->renderer();
if (renderer->isListItem()) {
// For Left-to-Right, the list item marker is at the beginning of the exposed text.
if (renderer->style()->direction() == LTR && isFirstVisiblePositionInNode(selectedLine.visibleStart(), node))
if (renderer->style().direction() == LTR && isFirstVisiblePositionInNode(selectedLine.visibleStart(), node))
*startOffset = 0;
// For Right-to-Left, the list item marker is at the end of the exposed text.
if (renderer->style()->direction() == RTL && isLastVisiblePositionInNode(selectedLine.visibleEnd(), node))
if (renderer->style().direction() == RTL && isLastVisiblePositionInNode(selectedLine.visibleEnd(), node))
*endOffset = accessibilityObjectLength(coreObject);
}
......
......@@ -669,17 +669,17 @@ static void AXAttributeStringSetNumber(NSMutableAttributedString* attrString, NS
static void AXAttributeStringSetStyle(NSMutableAttributedString* attrString, RenderObject* renderer, NSRange range)
{
RenderStyle* style = renderer->style();
const RenderStyle& style = renderer->style();
// set basic font info
AXAttributeStringSetFont(attrString, NSAccessibilityFontTextAttribute, style->font().primaryFont()->getNSFont(), range);
AXAttributeStringSetFont(attrString, NSAccessibilityFontTextAttribute, style.font().primaryFont()->getNSFont(), range);
// set basic colors
AXAttributeStringSetColor(attrString, NSAccessibilityForegroundColorTextAttribute, nsColor(style->visitedDependentColor(CSSPropertyColor)), range);
AXAttributeStringSetColor(attrString, NSAccessibilityBackgroundColorTextAttribute, nsColor(style->visitedDependentColor(CSSPropertyBackgroundColor)), range);
AXAttributeStringSetColor(attrString, NSAccessibilityForegroundColorTextAttribute, nsColor(style.visitedDependentColor(CSSPropertyColor)), range);
AXAttributeStringSetColor(attrString, NSAccessibilityBackgroundColorTextAttribute, nsColor(style.visitedDependentColor(CSSPropertyBackgroundColor)), range);
// set super/sub scripting
EVerticalAlign alignment = style->verticalAlign();
EVerticalAlign alignment = style.verticalAlign();
if (alignment == SUB)
AXAttributeStringSetNumber(attrString, NSAccessibilitySuperscriptTextAttribute, [NSNumber numberWithInt:(-1)], range);
else if (alignment == SUPER)
......@@ -688,13 +688,13 @@ static void AXAttributeStringSetStyle(NSMutableAttributedString* attrString, Ren
[attrString removeAttribute:NSAccessibilitySuperscriptTextAttribute range:range];
// set shadow
if (style->textShadow())
if (style.textShadow())
AXAttributeStringSetNumber(attrString, NSAccessibilityShadowTextAttribute, [NSNumber numberWithBool:YES], range);
else
[attrString removeAttribute:NSAccessibilityShadowTextAttribute range:range];
// set underline and strikethrough
int decor = style->textDecorationsInEffect();
int decor = style.textDecorationsInEffect();
if ((decor & TextDecorationUnderline) == 0) {
[attrString removeAttribute:NSAccessibilityUnderlineTextAttribute range:range];
[attrString removeAttribute:NSAccessibilityUnderlineColorTextAttribute range:range];
......
......@@ -382,7 +382,7 @@ id <DOMEventTarget> kit(WebCore::EventTarget* eventTarget)
auto renderer = core(self)->renderer();
if (!renderer)
return nil;
return renderer->style()->font().primaryFont()->getNSFont();
return renderer->style().font().primaryFont()->getNSFont();
}
- (NSData *)_imageTIFFRepresentation
......
......@@ -780,7 +780,7 @@ static LayoutRect sizingBox(RenderObject* renderer)
return LayoutRect();
RenderBox* box = toRenderBox(renderer);
return box->style()->boxSizing() == BORDER_BOX ? box->borderBoxRect() : box->computedCSSContentBoxRect();
return box->style().boxSizing() == BORDER_BOX ? box->borderBoxRect() : box->computedCSSContentBoxRect();
}
static PassRefPtr<WebKitCSSTransformValue> matrixTransformValue(const TransformationMatrix& transform, const RenderStyle* style)
......
......@@ -128,9 +128,9 @@ PassRefPtr<CSSGradientValue> CSSGradientValue::gradientWithStylesResolved(StyleR
return result.release();
}
void CSSGradientValue::addStops(Gradient* gradient, RenderElement* renderer, RenderStyle* rootStyle, float maxLengthForRepeat)
void CSSGradientValue::addStops(Gradient* gradient, RenderElement* renderer, const RenderStyle& rootStyle, float maxLengthForRepeat)
{
RenderStyle* style = renderer->style();
RenderStyle& style = renderer->style();
if (m_gradientType == CSSDeprecatedLinearGradient || m_gradientType == CSSDeprecatedRadialGradient) {
sortStopsIfNeeded();
......@@ -181,9 +181,9 @@ void CSSGradientValue::addStops(Gradient* gradient, RenderElement* renderer, Ren
}
float length;
if (stop.m_position->isLength())
length = stop.m_position->computeLength<float>(style, rootStyle, style->effectiveZoom());
length = stop.m_position->computeLength<float>(&style, &rootStyle, style.effectiveZoom());
else
length = stop.m_position->cssCalcValue()->toCalcValue(style, rootStyle, style->effectiveZoom())->evaluate(gradientLength);
length = stop.m_position->cssCalcValue()->toCalcValue(&style, &rootStyle, style.effectiveZoom())->evaluate(gradientLength);
stops[i].offset = (gradientLength > 0) ? length / gradientLength : 0;
} else {
ASSERT_NOT_REACHED();
......@@ -390,9 +390,9 @@ void CSSGradientValue::addStops(Gradient* gradient, RenderElement* renderer, Ren
gradient->setStopsSorted(true);
}
static float positionFromValue(CSSPrimitiveValue* value, RenderStyle* style, RenderStyle* rootStyle, const IntSize& size, bool isHorizontal)
static float positionFromValue(CSSPrimitiveValue* value, const RenderStyle& style, const RenderStyle& rootStyle, const IntSize& size, bool isHorizontal)
{
float zoomFactor = style->effectiveZoom();
float zoomFactor = style.effectiveZoom();
if (value->isNumber())
return value->getFloatValue() * zoomFactor;
......@@ -402,7 +402,7 @@ static float positionFromValue(CSSPrimitiveValue* value, RenderStyle* style, Ren
return value->getFloatValue() / 100.f * edgeDistance;
if (value->isCalculatedPercentageWithLength())
return value->cssCalcValue()->toCalcValue(style, rootStyle, style->effectiveZoom())->evaluate(edgeDistance);
return value->cssCalcValue()->toCalcValue(&style, &rootStyle, style.effectiveZoom())->evaluate(edgeDistance);
switch (value->getValueID()) {
case CSSValueTop:
......@@ -421,10 +421,10 @@ static float positionFromValue(CSSPrimitiveValue* value, RenderStyle* style, Ren
break;
}
return value->computeLength<float>(style, rootStyle, zoomFactor);
return value->computeLength<float>(&style, &rootStyle, zoomFactor);
}
FloatPoint CSSGradientValue::computeEndPoint(CSSPrimitiveValue* horizontal, CSSPrimitiveValue* vertical, RenderStyle* style, RenderStyle* rootStyle, const IntSize& size)
FloatPoint CSSGradientValue::computeEndPoint(CSSPrimitiveValue* horizontal, CSSPrimitiveValue* vertical, const RenderStyle& style, const RenderStyle& rootStyle, const IntSize& size)
{
FloatPoint result;
......@@ -643,7 +643,7 @@ PassRefPtr<Gradient> CSSLinearGradientValue::createGradient(RenderElement* rende
{
ASSERT(!size.isEmpty());
RenderStyle* rootStyle = renderer->document().documentElement()->renderStyle();
RenderStyle& rootStyle = *renderer->document().documentElement()->renderStyle();
FloatPoint firstPoint;
FloatPoint secondPoint;
......@@ -887,9 +887,9 @@ String CSSRadialGradientValue::customCSSText() const
return result.toString();
}
float CSSRadialGradientValue::resolveRadius(CSSPrimitiveValue* radius, RenderStyle* style, RenderStyle* rootStyle, float* widthOrHeight)
float CSSRadialGradientValue::resolveRadius(CSSPrimitiveValue* radius, const RenderStyle& style, const RenderStyle& rootStyle, float* widthOrHeight)
{
float zoomFactor = style->effectiveZoom();
float zoomFactor = style.effectiveZoom();
float result = 0;
if (radius->isNumber()) // Can the radius be a percentage?
......@@ -897,7 +897,7 @@ float CSSRadialGradientValue::resolveRadius(CSSPrimitiveValue* radius, RenderSty
else if (widthOrHeight && radius->isPercentage())
result = *widthOrHeight * radius->getFloatValue() / 100;
else
result = radius->computeLength<float>(style, rootStyle, zoomFactor);
result = radius->computeLength<float>(&style, &rootStyle, zoomFactor);
return result;
}
......@@ -983,7 +983,7 @@ PassRefPtr<Gradient> CSSRadialGradientValue::createGradient(RenderElement* rende
{
ASSERT(!size.isEmpty());
RenderStyle* rootStyle = renderer->document().documentElement()->renderStyle();
RenderStyle& rootStyle = *renderer->document().documentElement()->renderStyle();
FloatPoint firstPoint = computeEndPoint(m_firstX.get(), m_firstY.get(), renderer->style(), rootStyle, size);
if (!m_firstX)
......
......@@ -109,10 +109,10 @@ protected:
{
}
void addStops(Gradient*, RenderElement*, RenderStyle* rootStyle, float maxLengthForRepeat = 0);
void addStops(Gradient*, RenderElement*, const RenderStyle& rootStyle, float maxLengthForRepeat = 0);
// Resolve points/radii to front end values.
FloatPoint computeEndPoint(CSSPrimitiveValue*, CSSPrimitiveValue*, RenderStyle*, RenderStyle* rootStyle, const IntSize&);
FloatPoint computeEndPoint(CSSPrimitiveValue*, CSSPrimitiveValue*, const RenderStyle&, const RenderStyle& rootStyle, const IntSize&);
bool isCacheable() const;
......@@ -218,7 +218,7 @@ private:
// Resolve points/radii to front end values.
float resolveRadius(CSSPrimitiveValue*, RenderStyle*, RenderStyle* rootStyle, float* widthOrHeight = 0);
float resolveRadius(CSSPrimitiveValue*, const RenderStyle&, const RenderStyle& rootStyle, float* widthOrHeight = 0);
// These may be null for non-deprecated gradients.
RefPtr<CSSPrimitiveValue> m_firstRadius;
......
......@@ -296,8 +296,8 @@ StyleResolver::StyleResolver(Document& document, bool matchAuthorAndUserStyles)
void StyleResolver::appendAuthorStyleSheets(unsigned firstNew, const Vector<RefPtr<CSSStyleSheet>>& styleSheets)
{
m_ruleSets.appendAuthorStyleSheets(firstNew, styleSheets, m_medium.get(), m_inspectorCSSOMWrappers, document().isViewSource(), this);
if (document().renderView() && document().renderView()->style())
document().renderView()->style()->font().update(fontSelector());
if (auto renderView = document().renderView())
renderView->style().font().update(fontSelector());
#if ENABLE(CSS_DEVICE_ADAPTATION)
viewportStyleResolver()->resolve();
......
......@@ -2162,7 +2162,7 @@ void Document::setVisuallyOrdered()
{
m_visuallyOrdered = true;
if (renderView())
renderView()->style()->setRTLOrdering(VisualOrder);
renderView()->style().setRTLOrdering(VisualOrder);
}
PassRefPtr<DocumentParser> Document::createParser()
......@@ -5221,7 +5221,7 @@ void Document::webkitWillEnterFullScreenForElement(Element* element)
bool shouldCreatePlaceholder = renderer && renderer->isBox();
if (shouldCreatePlaceholder) {
m_savedPlaceholderFrameRect = toRenderBox(renderer)->frameRect();
m_savedPlaceholderRenderStyle = RenderStyle::clone(renderer->style());
m_savedPlaceholderRenderStyle = RenderStyle::clone(&renderer->style());
}
if (m_fullScreenElement != documentElement())
......@@ -5292,7 +5292,7 @@ void Document::setFullScreenRenderer(RenderFullScreen* renderer)
renderer->createPlaceholder(m_savedPlaceholderRenderStyle.releaseNonNull(), m_savedPlaceholderFrameRect);
else if (renderer && m_fullScreenRenderer && m_fullScreenRenderer->placeholder()) {
RenderBlock* placeholder = m_fullScreenRenderer->placeholder();
renderer->createPlaceholder(RenderStyle::clone(placeholder->style()), placeholder->frameRect());
renderer->createPlaceholder(RenderStyle::clone(&placeholder->style()), placeholder->frameRect());
}
if (m_fullScreenRenderer)
......
......@@ -474,7 +474,7 @@ bool Element::isFocusable() const