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
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index a808229..7bf7925 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,17 @@
+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
diff --git a/Source/WebCore/accessibility/AccessibilityMediaControls.cpp b/Source/WebCore/accessibility/AccessibilityMediaControls.cpp
index ff5c4ae..92fe221 100644
--- a/Source/WebCore/accessibility/AccessibilityMediaControls.cpp
+++ b/Source/WebCore/accessibility/AccessibilityMediaControls.cpp
@@ -175,7 +175,7 @@
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 @@
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();
diff --git a/Source/WebCore/accessibility/AccessibilityObject.cpp b/Source/WebCore/accessibility/AccessibilityObject.cpp
index fa314ad..bd648e8 100644
--- a/Source/WebCore/accessibility/AccessibilityObject.cpp
+++ b/Source/WebCore/accessibility/AccessibilityObject.cpp
@@ -566,7 +566,7 @@
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 @@
{
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 @@
continue;
// stop at style change
- if (r->style() != style)
+ if (&r->style() != style)
break;
// remember match
@@ -795,7 +795,7 @@
{
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 @@
continue;
// stop at style change
- if (r->style() != style)
+ if (&r->style() != &style)
break;
// remember match
@@ -2073,8 +2073,8 @@
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
diff --git a/Source/WebCore/accessibility/AccessibilityRenderObject.cpp b/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
index 5c044a2..aec885e 100644
--- a/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
+++ b/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
@@ -917,7 +917,7 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
if (!m_renderer)
return false;
- return m_renderer->style()->textDecorationsInEffect() & TextDecorationUnderline;
+ return m_renderer->style().textDecorationsInEffect() & TextDecorationUnderline;
}
String AccessibilityRenderObject::nameForMSAA() const
diff --git a/Source/WebCore/accessibility/AccessibilitySlider.cpp b/Source/WebCore/accessibility/AccessibilitySlider.cpp
index 5c80d5d..0cadd8d 100644
--- a/Source/WebCore/accessibility/AccessibilitySlider.cpp
+++ b/Source/WebCore/accessibility/AccessibilitySlider.cpp
@@ -56,11 +56,9 @@
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:
diff --git a/Source/WebCore/accessibility/AccessibilityTable.cpp b/Source/WebCore/accessibility/AccessibilityTable.cpp
index 4c40470..c856886 100644
--- a/Source/WebCore/accessibility/AccessibilityTable.cpp
+++ b/Source/WebCore/accessibility/AccessibilityTable.cpp
@@ -149,10 +149,8 @@
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 @@
|| !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 @@
// 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 @@
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++;
}
diff --git a/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp b/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp
index a772ae0..991ced4 100644
--- a/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp
+++ b/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp
@@ -129,7 +129,7 @@
// 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 @@
// 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 @@
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 @@
// 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 @@
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 @@
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);
}
diff --git a/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm b/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
index a8a2d19..ae865ff 100644
--- a/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
+++ b/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
@@ -669,17 +669,17 @@
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 @@
[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];
diff --git a/Source/WebCore/bindings/objc/DOM.mm b/Source/WebCore/bindings/objc/DOM.mm
index 29ccbe9..cc03655 100644
--- a/Source/WebCore/bindings/objc/DOM.mm
+++ b/Source/WebCore/bindings/objc/DOM.mm
@@ -382,7 +382,7 @@
auto renderer = core(self)->renderer();
if (!renderer)
return nil;
- return renderer->style()->font().primaryFont()->getNSFont();
+ return renderer->style().font().primaryFont()->getNSFont();
}
- (NSData *)_imageTIFFRepresentation
diff --git a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
index d37dbfa..8b2d3df2 100644
--- a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
+++ b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
@@ -780,7 +780,7 @@
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)
diff --git a/Source/WebCore/css/CSSGradientValue.cpp b/Source/WebCore/css/CSSGradientValue.cpp
index e33de3d..151740f 100644
--- a/Source/WebCore/css/CSSGradientValue.cpp
+++ b/Source/WebCore/css/CSSGradientValue.cpp
@@ -128,9 +128,9 @@
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 @@
}
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 @@
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 @@
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 @@
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 @@
{
ASSERT(!size.isEmpty());
- RenderStyle* rootStyle = renderer->document().documentElement()->renderStyle();
+ RenderStyle& rootStyle = *renderer->document().documentElement()->renderStyle();
FloatPoint firstPoint;
FloatPoint secondPoint;
@@ -887,9 +887,9 @@
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 @@
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 @@
{
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)
diff --git a/Source/WebCore/css/CSSGradientValue.h b/Source/WebCore/css/CSSGradientValue.h
index 43e1b4d..217d2b9 100644
--- a/Source/WebCore/css/CSSGradientValue.h
+++ b/Source/WebCore/css/CSSGradientValue.h
@@ -109,10 +109,10 @@
{
}
- 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 @@
// 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;
diff --git a/Source/WebCore/css/StyleResolver.cpp b/Source/WebCore/css/StyleResolver.cpp
index f7ba67f..16942cc 100644
--- a/Source/WebCore/css/StyleResolver.cpp
+++ b/Source/WebCore/css/StyleResolver.cpp
@@ -296,8 +296,8 @@
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();
diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp
index 0732e0c..572a706 100644
--- a/Source/WebCore/dom/Document.cpp
+++ b/Source/WebCore/dom/Document.cpp
@@ -2162,7 +2162,7 @@
{
m_visuallyOrdered = true;
if (renderView())
- renderView()->style()->setRTLOrdering(VisualOrder);
+ renderView()->style().setRTLOrdering(VisualOrder);
}
PassRefPtr<DocumentParser> Document::createParser()
@@ -5221,7 +5221,7 @@
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 @@
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)
diff --git a/Source/WebCore/dom/Element.cpp b/Source/WebCore/dom/Element.cpp
index ee406e5..18c1ed5 100644
--- a/Source/WebCore/dom/Element.cpp
+++ b/Source/WebCore/dom/Element.cpp
@@ -474,7 +474,7 @@
while (e && !e->hasLocalName(canvasTag))
e = e->parentElement();
ASSERT(e);
- return e->renderer() && e->renderer()->style()->visibility() == VISIBLE;
+ return e->renderer() && e->renderer()->style().visibility() == VISIBLE;
}
if (renderer())
@@ -487,7 +487,7 @@
// FIXME: Even if we are not visible, we might have a child that is visible.
// Hyatt wants to fix that some day with a "has visible content" flag or the like.
- if (!renderer() || renderer()->style()->visibility() != VISIBLE)
+ if (!renderer() || renderer()->style().visibility() != VISIBLE)
return false;
return true;
@@ -531,7 +531,7 @@
if (reactsToPress)
setNeedsStyleRecalc();
- if (renderer()->style()->hasAppearance() && renderer()->theme()->stateChanged(renderer(), PressedState))
+ if (renderer()->style().hasAppearance() && renderer()->theme()->stateChanged(renderer(), PressedState))
reactsToPress = true;
// The rest of this function implements a feature that only works if the
@@ -593,10 +593,10 @@
return;
}
- if (renderer()->style()->affectedByHover() || childrenAffectedByHover())
+ if (renderer()->style().affectedByHover() || childrenAffectedByHover())
setNeedsStyleRecalc();
- if (renderer()->style()->hasAppearance())
+ if (renderer()->style().hasAppearance())
renderer()->theme()->stateChanged(renderer(), HoverState);
}
@@ -664,19 +664,19 @@
// other out, but the alternative is that we'd have to crawl up the whole render tree every
// time (or store an additional bit in the RenderStyle to indicate that a zoom was specified).
float zoomFactor = 1;
- if (renderer->style()->effectiveZoom() != 1) {
+ if (renderer->style().effectiveZoom() != 1) {
// Need to find the nearest enclosing RenderElement that set up
// a differing zoom, and then we divide our result by it to eliminate the zoom.
RenderElement* prev = renderer;
for (RenderElement* curr = prev->parent(); curr; curr = curr->parent()) {
- if (curr->style()->effectiveZoom() != prev->style()->effectiveZoom()) {
- zoomFactor = prev->style()->zoom();
+ if (curr->style().effectiveZoom() != prev->style().effectiveZoom()) {
+ zoomFactor = prev->style().zoom();
break;
}
prev = curr;
}
if (prev->isRenderView())
- zoomFactor = prev->style()->zoom();
+ zoomFactor = prev->style().zoom();
}
return zoomFactor;
}
@@ -870,13 +870,13 @@
if (document().documentElement() == this) {
RenderView& renderView = *document().renderView();
- int zoom = renderView.style()->effectiveZoom();
+ int zoom = renderView.style().effectiveZoom();
renderView.frameView().setScrollPosition(IntPoint(newLeft * zoom, renderView.frameView().scrollY() * zoom));
return;
}
if (RenderBox* rend = renderBox())
- rend->setScrollLeft(static_cast<int>(newLeft * rend->style()->effectiveZoom()));
+ rend->setScrollLeft(static_cast<int>(newLeft * rend->style().effectiveZoom()));
}
void Element::setScrollTop(int newTop)
@@ -891,13 +891,13 @@
if (document().documentElement() == this) {
RenderView& renderView = *document().renderView();
- int zoom = renderView.style()->effectiveZoom();
+ int zoom = renderView.style().effectiveZoom();
renderView.frameView().setScrollPosition(IntPoint(renderView.frameView().scrollX() * zoom, newTop * zoom));
return;
}
if (RenderBox* rend = renderBox())
- rend->setScrollTop(static_cast<int>(newTop * rend->style()->effectiveZoom()));
+ rend->setScrollTop(static_cast<int>(newTop * rend->style().effectiveZoom()));
}
int Element::scrollWidth()
@@ -964,7 +964,7 @@
Vector<FloatQuad> quads;
renderBoxModelObject->absoluteQuads(quads);
- document().adjustFloatQuadsForScrollAndAbsoluteZoomAndFrameScale(quads, *renderBoxModelObject->style());
+ document().adjustFloatQuadsForScrollAndAbsoluteZoomAndFrameScale(quads, renderBoxModelObject->style());
return ClientRectList::create(quads);
}
@@ -995,7 +995,7 @@
for (size_t i = 1; i < quads.size(); ++i)
result.unite(quads[i].boundingBox());
- document().adjustFloatRectForScrollAndAbsoluteZoomAndFrameScale(result, *renderer()->style());
+ document().adjustFloatRectForScrollAndAbsoluteZoomAndFrameScale(result, renderer()->style());
return ClientRect::create(result);
}
diff --git a/Source/WebCore/dom/Node.cpp b/Source/WebCore/dom/Node.cpp
index 6e338da..4ddd5b7 100644
--- a/Source/WebCore/dom/Node.cpp
+++ b/Source/WebCore/dom/Node.cpp
@@ -602,12 +602,12 @@
#if ENABLE(USERSELECT_ALL)
// Elements with user-select: all style are considered atomic
// therefore non editable.
- if (treatment == UserSelectAllIsAlwaysNonEditable && node->renderer()->style()->userSelect() == SELECT_ALL)
+ if (treatment == UserSelectAllIsAlwaysNonEditable && node->renderer()->style().userSelect() == SELECT_ALL)
return false;
#else
UNUSED_PARAM(treatment);
#endif
- switch (node->renderer()->style()->userModify()) {
+ switch (node->renderer()->style().userModify()) {
case READ_ONLY:
return false;
case READ_WRITE:
@@ -933,10 +933,10 @@
return true;
if (renderer()) {
- RenderStyle* style = renderer()->style();
+ const RenderStyle& style = renderer()->style();
// We allow selections to begin within an element that has -webkit-user-select: none set,
// but if the element is draggable then dragging should take priority over selection.
- if (style->userDrag() == DRAG_ELEMENT && style->userSelect() == SELECT_NONE)
+ if (style.userDrag() == DRAG_ELEMENT && style.userSelect() == SELECT_NONE)
return false;
}
return parentOrShadowHostNode() ? parentOrShadowHostNode()->canStartSelection() : true;
diff --git a/Source/WebCore/dom/NodeRenderStyle.h b/Source/WebCore/dom/NodeRenderStyle.h
index cf6a58b..a84565f 100644
--- a/Source/WebCore/dom/NodeRenderStyle.h
+++ b/Source/WebCore/dom/NodeRenderStyle.h
@@ -36,7 +36,7 @@
// Using a ternary here confuses the Solaris Studio 12/12.1/12.2 compilers:
// Bug is CR 6569194, "Problem with question operator binding in inline function"
if (RenderObject* renderer = this->renderer())
- return renderer->style();
+ return &renderer->style();
return nonRendererStyle();
}
diff --git a/Source/WebCore/dom/Position.cpp b/Source/WebCore/dom/Position.cpp
index 7948197..62c43d6 100644
--- a/Source/WebCore/dom/Position.cpp
+++ b/Source/WebCore/dom/Position.cpp
@@ -619,7 +619,7 @@
// skip position in unrendered or invisible node
RenderObject* renderer = currentNode->renderer();
- if (!renderer || renderer->style()->visibility() != VISIBLE)
+ if (!renderer || renderer->style().visibility() != VISIBLE)
continue;
if (rule == CanCrossEditingBoundary && boundaryCrossed) {
@@ -756,7 +756,7 @@
// skip position in unrendered or invisible node
RenderObject* renderer = currentNode->renderer();
- if (!renderer || renderer->style()->visibility() != VISIBLE)
+ if (!renderer || renderer->style().visibility() != VISIBLE)
continue;
if (rule == CanCrossEditingBoundary && boundaryCrossed) {
@@ -832,7 +832,7 @@
static int boundingBoxLogicalHeight(RenderObject *o, const IntRect &rect)
{
- return o->style()->isHorizontalWritingMode() ? rect.height() : rect.width();
+ return o->style().isHorizontalWritingMode() ? rect.height() : rect.width();
}
bool Position::hasRenderedNonAnonymousDescendantsWithHeight(const RenderElement& renderer)
@@ -868,7 +868,7 @@
bool Position::nodeIsUserSelectNone(Node* node)
{
- return node && node->renderer() && node->renderer()->style()->userSelect() == SELECT_NONE;
+ return node && node->renderer() && node->renderer()->style().userSelect() == SELECT_NONE;
}
ContainerNode* Position::findParent(const Node* node)
@@ -886,7 +886,7 @@
#if ENABLE(USERSELECT_ALL)
bool Position::nodeIsUserSelectAll(const Node* node)
{
- return node && node->renderer() && node->renderer()->style()->userSelect() == SELECT_ALL;
+ return node && node->renderer() && node->renderer()->style().userSelect() == SELECT_ALL;
}
Node* Position::rootUserSelectAllForNode(Node* node)
@@ -921,7 +921,7 @@
if (!renderer)
return false;
- if (renderer->style()->visibility() != VISIBLE)
+ if (renderer->style().visibility() != VISIBLE)
return false;
if (renderer->isBR())
@@ -980,8 +980,8 @@
if (!posRenderer)
return false;
- if (renderer->style()->visibility() != VISIBLE ||
- posRenderer->style()->visibility() != VISIBLE)
+ if (renderer->style().visibility() != VISIBLE ||
+ posRenderer->style().visibility() != VISIBLE)
return false;
if (deprecatedNode() == pos.deprecatedNode()) {
@@ -1313,7 +1313,7 @@
TextDirection primaryDirection = LTR;
for (const RenderObject* r = m_anchorNode->renderer(); r; r = r->parent()) {
if (r->isRenderBlockFlow()) {
- primaryDirection = r->style()->direction();
+ primaryDirection = toRenderBlockFlow(r)->style().direction();
break;
}
}
diff --git a/Source/WebCore/dom/PositionIterator.cpp b/Source/WebCore/dom/PositionIterator.cpp
index d9b5c20..9aa4943 100644
--- a/Source/WebCore/dom/PositionIterator.cpp
+++ b/Source/WebCore/dom/PositionIterator.cpp
@@ -148,7 +148,7 @@
if (!renderer)
return false;
- if (renderer->style()->visibility() != VISIBLE)
+ if (renderer->style().visibility() != VISIBLE)
return false;
if (renderer->isBR())
diff --git a/Source/WebCore/dom/PseudoElement.cpp b/Source/WebCore/dom/PseudoElement.cpp
index a75632b..5d383d9 100644
--- a/Source/WebCore/dom/PseudoElement.cpp
+++ b/Source/WebCore/dom/PseudoElement.cpp
@@ -80,15 +80,15 @@
void PseudoElement::didAttachRenderers()
{
RenderElement* renderer = this->renderer();
- if (!renderer || renderer->style()->hasFlowFrom())
+ if (!renderer || renderer->style().hasFlowFrom())
return;
- RenderStyle* style = renderer->style();
- ASSERT(style->contentData());
+ RenderStyle& style = renderer->style();
+ ASSERT(style.contentData());
- for (const ContentData* content = style->contentData(); content; content = content->next()) {
- RenderObject* child = content->createRenderer(document(), *style);
- if (renderer->isChildAllowed(*child, *style)) {
+ for (const ContentData* content = style.contentData(); content; content = content->next()) {
+ RenderObject* child = content->createRenderer(document(), style);
+ if (renderer->isChildAllowed(*child, style)) {
renderer->addChild(child);
if (child->isQuote())
toRenderQuote(child)->attachQuote();
@@ -114,7 +114,7 @@
// We only manage the style for the generated content which must be images or text.
if (!child->isImage())
continue;
- toRenderImage(child)->setPseudoStyle(renderer->style());
+ toRenderImage(child)->setPseudoStyle(&renderer->style());
}
}
diff --git a/Source/WebCore/dom/Range.cpp b/Source/WebCore/dom/Range.cpp
index 7aba175..8677da0 100644
--- a/Source/WebCore/dom/Range.cpp
+++ b/Source/WebCore/dom/Range.cpp
@@ -1931,7 +1931,7 @@
if (RenderBoxModelObject* renderBoxModelObject = toElement(node)->renderBoxModelObject()) {
Vector<FloatQuad> elementQuads;
renderBoxModelObject->absoluteQuads(elementQuads);
- ownerDocument().adjustFloatQuadsForScrollAndAbsoluteZoomAndFrameScale(elementQuads, *renderBoxModelObject->style());
+ ownerDocument().adjustFloatQuadsForScrollAndAbsoluteZoomAndFrameScale(elementQuads, renderBoxModelObject->style());
quads.appendVector(elementQuads);
}
@@ -1942,7 +1942,7 @@
int endOffset = (node == endContainer) ? m_end.offset() : INT_MAX;
auto textQuads = renderText.absoluteQuadsForRange(startOffset, endOffset);
- ownerDocument().adjustFloatQuadsForScrollAndAbsoluteZoomAndFrameScale(textQuads, *renderText.style());
+ ownerDocument().adjustFloatQuadsForScrollAndAbsoluteZoomAndFrameScale(textQuads, renderText.style());
quads.appendVector(textQuads);
}
diff --git a/Source/WebCore/editing/ApplyBlockElementCommand.cpp b/Source/WebCore/editing/ApplyBlockElementCommand.cpp
index 548a4af..cdd2fc7 100644
--- a/Source/WebCore/editing/ApplyBlockElementCommand.cpp
+++ b/Source/WebCore/editing/ApplyBlockElementCommand.cpp
@@ -182,7 +182,7 @@
if (!renderer)
return 0;
- return renderer->style();
+ return &renderer->style();
}
void ApplyBlockElementCommand::rangeForParagraphSplittingTextNodesIfNeeded(const VisiblePosition& endOfCurrentParagraph, Position& start, Position& end)
diff --git a/Source/WebCore/editing/ApplyStyleCommand.cpp b/Source/WebCore/editing/ApplyStyleCommand.cpp
index f618ada..7c9e67d 100644
--- a/Source/WebCore/editing/ApplyStyleCommand.cpp
+++ b/Source/WebCore/editing/ApplyStyleCommand.cpp
@@ -1021,7 +1021,7 @@
if (node->renderer()->isText() && static_cast<RenderText*>(node->renderer())->isAllCollapsibleWhitespace())
return;
- if (node->renderer()->isBR() && !node->renderer()->style()->preserveNewline())
+ if (node->renderer()->isBR() && !node->renderer()->style().preserveNewline())
return;
// We can't wrap node with the styled element here because new styled element will never be removed if we did.
diff --git a/Source/WebCore/editing/CompositeEditCommand.cpp b/Source/WebCore/editing/CompositeEditCommand.cpp
index 51ce98b..9f20ebb 100644
--- a/Source/WebCore/editing/CompositeEditCommand.cpp
+++ b/Source/WebCore/editing/CompositeEditCommand.cpp
@@ -627,7 +627,7 @@
return false;
RenderObject* renderer = textNode->renderer();
- if (renderer && !renderer->style()->collapseWhiteSpace())
+ if (renderer && !renderer->style().collapseWhiteSpace())
return false;
return true;
@@ -696,7 +696,7 @@
if (textNode->length() == 0)
return;
RenderObject* renderer = textNode->renderer();
- if (renderer && !renderer->style()->collapseWhiteSpace())
+ if (renderer && !renderer->style().collapseWhiteSpace())
return;
// Delete collapsed whitespace so that inserting nbsps doesn't uncollapse it.
@@ -1365,7 +1365,7 @@
Position caretPos(caret.deepEquivalent().downstream());
// A line break is either a br or a preserved newline.
- ASSERT(caretPos.deprecatedNode()->hasTagName(brTag) || (caretPos.deprecatedNode()->isTextNode() && caretPos.deprecatedNode()->renderer()->style()->preserveNewline()));
+ ASSERT(caretPos.deprecatedNode()->hasTagName(brTag) || (caretPos.deprecatedNode()->isTextNode() && caretPos.deprecatedNode()->renderer()->style().preserveNewline()));
if (caretPos.deprecatedNode()->hasTagName(brTag))
removeNodeAndPruneAncestors(caretPos.deprecatedNode());
diff --git a/Source/WebCore/editing/DeleteButtonController.cpp b/Source/WebCore/editing/DeleteButtonController.cpp
index 7b088b4..1fa104c 100644
--- a/Source/WebCore/editing/DeleteButtonController.cpp
+++ b/Source/WebCore/editing/DeleteButtonController.cpp
@@ -112,20 +112,18 @@
return true;
if (box->isRenderBlock() && !box->isTableCell()) {
- RenderStyle* style = box->style();
- if (!style)
- return false;
+ const RenderStyle& style = box->style();
// Allow blocks that have background images
- if (style->hasBackgroundImage()) {
- for (const FillLayer* background = style->backgroundLayers(); background; background = background->next()) {
+ if (style.hasBackgroundImage()) {
+ for (const FillLayer* background = style.backgroundLayers(); background; background = background->next()) {
if (background->image() && background->image()->canRender(box, 1))
return true;
}
}
// Allow blocks with a minimum number of non-transparent borders
- unsigned visibleBorders = style->borderTop().isVisible() + style->borderBottom().isVisible() + style->borderLeft().isVisible() + style->borderRight().isVisible();
+ unsigned visibleBorders = style.borderTop().isVisible() + style.borderBottom().isVisible() + style.borderLeft().isVisible() + style.borderRight().isVisible();
if (visibleBorders >= minimumVisibleBorders)
return true;
@@ -138,11 +136,9 @@
if (!parentRenderer)
return false;
- RenderStyle* parentStyle = parentRenderer->style();
- if (!parentStyle)
- return false;
+ const RenderStyle& parentStyle = parentRenderer->style();
- if (box->hasBackground() && (!parentRenderer->hasBackground() || style->visitedDependentColor(CSSPropertyBackgroundColor) != parentStyle->visitedDependentColor(CSSPropertyBackgroundColor)))
+ if (box->hasBackground() && (!parentRenderer->hasBackground() || style.visitedDependentColor(CSSPropertyBackgroundColor) != parentStyle.visitedDependentColor(CSSPropertyBackgroundColor)))
return true;
}
@@ -310,12 +306,12 @@
return;
}
- if (m_target->renderer()->style()->position() == StaticPosition) {
+ if (m_target->renderer()->style().position() == StaticPosition) {
m_target->setInlineStyleProperty(CSSPropertyPosition, CSSValueRelative);
m_wasStaticPositioned = true;
}
- if (m_target->renderer()->style()->hasAutoZIndex()) {
+ if (m_target->renderer()->style().hasAutoZIndex()) {
m_target->setInlineStyleProperty(CSSPropertyZIndex, ASCIILiteral("0"));
m_wasAutoZIndex = true;
}
diff --git a/Source/WebCore/editing/DeleteSelectionCommand.cpp b/Source/WebCore/editing/DeleteSelectionCommand.cpp
index 0c411f8..f62e5b5 100644
--- a/Source/WebCore/editing/DeleteSelectionCommand.cpp
+++ b/Source/WebCore/editing/DeleteSelectionCommand.cpp
@@ -577,12 +577,12 @@
// FIXME: isRenderedCharacter should be removed, and we should use VisiblePosition::characterAfter and VisiblePosition::characterBefore
if (m_leadingWhitespace.isNotNull() && !m_leadingWhitespace.isRenderedCharacter() && m_leadingWhitespace.deprecatedNode()->isTextNode()) {
Text* textNode = toText(m_leadingWhitespace.deprecatedNode());
- ASSERT(!textNode->renderer() || textNode->renderer()->style()->collapseWhiteSpace());
+ ASSERT(!textNode->renderer() || textNode->renderer()->style().collapseWhiteSpace());
replaceTextInNodePreservingMarkers(textNode, m_leadingWhitespace.deprecatedEditingOffset(), 1, nonBreakingSpaceString());
}
if (m_trailingWhitespace.isNotNull() && !m_trailingWhitespace.isRenderedCharacter() && m_trailingWhitespace.deprecatedNode()->isTextNode()) {
Text* textNode = toText(m_trailingWhitespace.deprecatedNode());
- ASSERT(!textNode->renderer() ||textNode->renderer()->style()->collapseWhiteSpace());
+ ASSERT(!textNode->renderer() || textNode->renderer()->style().collapseWhiteSpace());
replaceTextInNodePreservingMarkers(textNode, m_trailingWhitespace.deprecatedEditingOffset(), 1, nonBreakingSpaceString());
}
}
diff --git a/Source/WebCore/editing/Editor.cpp b/Source/WebCore/editing/Editor.cpp
index 19f5cb0..ad66a9d 100644
--- a/Source/WebCore/editing/Editor.cpp
+++ b/Source/WebCore/editing/Editor.cpp
@@ -590,8 +590,7 @@
if (!renderer)
return false;
- RenderStyle* style = renderer->style();
- if (!style->isLeftToRightDirection())
+ if (!renderer->style().isLeftToRightDirection())
return true;
return toRenderBlockFlow(renderer)->containsNonZeroBidiLevel();
@@ -1449,11 +1448,7 @@
return result;
}
- RenderStyle* style = renderer->style();
- if (!style)
- return result;
-
- switch (style->direction()) {
+ switch (renderer->style().direction()) {
case LTR:
return LeftToRightWritingDirection;
case RTL:
diff --git a/Source/WebCore/editing/EditorCommand.cpp b/Source/WebCore/editing/EditorCommand.cpp
index 0a19276..a34bb6d 100644
--- a/Source/WebCore/editing/EditorCommand.cpp
+++ b/Source/WebCore/editing/EditorCommand.cpp
@@ -256,10 +256,8 @@
auto renderer = focusedElement->renderer();
if (!renderer || !renderer->isBox())
return 0;
- RenderStyle* style = renderer->style();
- if (!style)
- return 0;
- if (!(style->overflowY() == OSCROLL || style->overflowY() == OAUTO || focusedElement->rendererIsEditable()))
+ const RenderStyle& style = renderer->style();
+ if (!(style.overflowY() == OSCROLL || style.overflowY() == OAUTO || focusedElement->rendererIsEditable()))
return 0;
int height = std::min<int>(toRenderBox(renderer)->clientHeight(), frame.view()->visibleHeight());
return static_cast<unsigned>(std::max(std::max<int>(height * Scrollbar::minFractionToStepWhenPaging(), height - Scrollbar::maxOverlapBetweenPages()), 1));
diff --git a/Source/WebCore/editing/FrameSelection.cpp b/Source/WebCore/editing/FrameSelection.cpp
index a5dbe31..93b69de 100644
--- a/Source/WebCore/editing/FrameSelection.cpp
+++ b/Source/WebCore/editing/FrameSelection.cpp
@@ -1451,8 +1451,8 @@
Element* element = node->isElementNode() ? toElement(node) : node->parentElement();
if (element && element->renderer()) {
- caretColor = element->renderer()->style()->visitedDependentColor(CSSPropertyColor);
- colorSpace = element->renderer()->style()->colorSpace();
+ caretColor = element->renderer()->style().visitedDependentColor(CSSPropertyColor);
+ colorSpace = element->renderer()->style().colorSpace();
}
context->fillRect(caret, caretColor, colorSpace);
@@ -1704,7 +1704,7 @@
if (Element* element = m_frame->document()->focusedElement()) {
element->setNeedsStyleRecalc();
if (RenderObject* renderer = element->renderer())
- if (renderer && renderer->style()->hasAppearance())
+ if (renderer && renderer->style().hasAppearance())
renderer->theme()->stateChanged(renderer, FocusState);
}
}
diff --git a/Source/WebCore/editing/HTMLInterchange.cpp b/Source/WebCore/editing/HTMLInterchange.cpp
index e71a0c8..2f72951 100644
--- a/Source/WebCore/editing/HTMLInterchange.cpp
+++ b/Source/WebCore/editing/HTMLInterchange.cpp
@@ -38,7 +38,7 @@
String convertHTMLTextToInterchangeFormat(const String& in, const Text* node)
{
// Assume all the text comes from node.
- if (node->renderer() && node->renderer()->style()->preserveNewline())
+ if (node->renderer() && node->renderer()->style().preserveNewline())
return in;
const char convertedSpaceString[] = "<span class=\"" AppleConvertedSpace "\">\xA0</span>";
diff --git a/Source/WebCore/editing/InsertLineBreakCommand.cpp b/Source/WebCore/editing/InsertLineBreakCommand.cpp
index b3afb06..3cd05a2 100644
--- a/Source/WebCore/editing/InsertLineBreakCommand.cpp
+++ b/Source/WebCore/editing/InsertLineBreakCommand.cpp
@@ -86,7 +86,7 @@
// the input element, and in that case we need to check the input element's
// parent's renderer.
Position p(insertionPos.parentAnchoredEquivalent());
- return p.deprecatedNode()->renderer() && !p.deprecatedNode()->renderer()->style()->preserveNewline();
+ return p.deprecatedNode()->renderer() && !p.deprecatedNode()->renderer()->style().preserveNewline();
}
void InsertLineBreakCommand::doApply()
@@ -152,7 +152,7 @@
Position positionBeforeTextNode(positionInParentBeforeNode(textNode));
// Clear out all whitespace and insert one non-breaking space
deleteInsignificantTextDownstream(endingPosition);
- ASSERT(!textNode->renderer() || textNode->renderer()->style()->collapseWhiteSpace());
+ ASSERT(!textNode->renderer() || textNode->renderer()->style().collapseWhiteSpace());
// Deleting insignificant whitespace will remove textNode if it contains nothing but insignificant whitespace.
if (textNode->inDocument())
insertTextIntoNode(textNode, 0, nonBreakingSpaceString());
diff --git a/Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp b/Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp
index e4ed8cb..2481559 100644
--- a/Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp
+++ b/Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp
@@ -334,7 +334,7 @@
// after the preserved newline, causing the newline to be turned into a nbsp.
if (leadingWhitespace.isNotNull() && leadingWhitespace.deprecatedNode()->isTextNode()) {
Text* textNode = toText(leadingWhitespace.deprecatedNode());
- ASSERT(!textNode->renderer() || textNode->renderer()->style()->collapseWhiteSpace());
+ ASSERT(!textNode->renderer() || textNode->renderer()->style().collapseWhiteSpace());
replaceTextInNodePreservingMarkers(textNode, leadingWhitespace.deprecatedEditingOffset(), 1, nonBreakingSpaceString());
}
@@ -398,7 +398,7 @@
document().updateLayoutIgnorePendingStylesheets();
if (!positionAfterSplit.isRenderedCharacter()) {
// Clear out all whitespace and insert one non-breaking space
- ASSERT(!positionAfterSplit.containerNode()->renderer() || positionAfterSplit.containerNode()->renderer()->style()->collapseWhiteSpace());
+ ASSERT(!positionAfterSplit.containerNode()->renderer() || positionAfterSplit.containerNode()->renderer()->style().collapseWhiteSpace());
deleteInsignificantTextDownstream(positionAfterSplit);
if (positionAfterSplit.deprecatedNode()->isTextNode())
insertTextIntoNode(toText(positionAfterSplit.containerNode()), 0, nonBreakingSpaceString());
diff --git a/Source/WebCore/editing/ReplaceSelectionCommand.cpp b/Source/WebCore/editing/ReplaceSelectionCommand.cpp
index 6d27f90..ecaaa6c 100644
--- a/Source/WebCore/editing/ReplaceSelectionCommand.cpp
+++ b/Source/WebCore/editing/ReplaceSelectionCommand.cpp
@@ -560,7 +560,7 @@
// Mutate using the CSSOM wrapper so we get the same event behavior as a script.
if (isBlock(element))
element->style()->setPropertyInternal(CSSPropertyDisplay, "inline", false, IGNORE_EXCEPTION);
- if (element->renderer() && element->renderer()->style()->isFloating())
+ if (element->renderer() && element->renderer()->style().isFloating())
element->style()->setPropertyInternal(CSSPropertyFloat, "none", false, IGNORE_EXCEPTION);
}
}
@@ -910,8 +910,8 @@
return;
// We can skip matching the style if the selection is plain text.
- if ((selection.start().deprecatedNode()->renderer() && selection.start().deprecatedNode()->renderer()->style()->userModify() == READ_WRITE_PLAINTEXT_ONLY)
- && (selection.end().deprecatedNode()->renderer() && selection.end().deprecatedNode()->renderer()->style()->userModify() == READ_WRITE_PLAINTEXT_ONLY))
+ if ((selection.start().deprecatedNode()->renderer() && selection.start().deprecatedNode()->renderer()->style().userModify() == READ_WRITE_PLAINTEXT_ONLY)
+ && (selection.end().deprecatedNode()->renderer() && selection.end().deprecatedNode()->renderer()->style().userModify() == READ_WRITE_PLAINTEXT_ONLY))
m_matchStyle = false;
if (m_matchStyle) {
@@ -1288,7 +1288,7 @@
bool needsTrailingSpace = !isEndOfParagraph(endOfInsertedContent) && !isCharacterSmartReplaceExemptConsideringNonBreakingSpace(endOfInsertedContent.characterAfter(), false);
if (needsTrailingSpace && endNode) {
- bool collapseWhiteSpace = !endNode->renderer() || endNode->renderer()->style()->collapseWhiteSpace();
+ bool collapseWhiteSpace = !endNode->renderer() || endNode->renderer()->style().collapseWhiteSpace();
if (endNode->isTextNode()) {
insertTextIntoNode(toText(endNode), endOffset, collapseWhiteSpace ? nonBreakingSpaceString() : " ");
if (m_endOfInsertedContent.containerNode() == endNode)
@@ -1312,7 +1312,7 @@
bool needsLeadingSpace = !isStartOfParagraph(startOfInsertedContent) && !isCharacterSmartReplaceExemptConsideringNonBreakingSpace(startOfInsertedContent.previous().characterAfter(), true);
if (needsLeadingSpace && startNode) {
- bool collapseWhiteSpace = !startNode->renderer() || startNode->renderer()->style()->collapseWhiteSpace();
+ bool collapseWhiteSpace = !startNode->renderer() || startNode->renderer()->style().collapseWhiteSpace();
if (startNode->isTextNode()) {
insertTextIntoNode(toText(startNode), startOffset, collapseWhiteSpace ? nonBreakingSpaceString() : " ");
if (m_endOfInsertedContent.containerNode() == startNode && m_endOfInsertedContent.offsetInContainerNode())
diff --git a/Source/WebCore/editing/TextIterator.cpp b/Source/WebCore/editing/TextIterator.cpp
index 323693e..06a76f7 100644
--- a/Source/WebCore/editing/TextIterator.cpp
+++ b/Source/WebCore/editing/TextIterator.cpp
@@ -217,7 +217,7 @@
RenderObject* renderer = node->renderer();
if (!renderer || renderer->isTextOrLineBreak())
return false;
- return renderer->style()->hasOutOfFlowPosition();
+ return renderer->style().hasOutOfFlowPosition();
}
static void pushFullyClippedState(BitStack& stack, Node* node)
@@ -491,7 +491,7 @@
String str = renderer->text();
// handle pre-formatted text
- if (!renderer->style()->collapseWhiteSpace()) {
+ if (!renderer->style().collapseWhiteSpace()) {
int runStart = m_offset;
if (m_lastTextNodeEndedWithCollapsedSpace && hasVisibleTextNode(renderer)) {
emitCharacter(' ', m_node, 0, runStart, runStart);
@@ -507,7 +507,7 @@
return false;
}
}
- if (renderer->style()->visibility() != VISIBLE && !m_ignoresStyleVisibility)
+ if (renderer->style().visibility() != VISIBLE && !m_ignoresStyleVisibility)
return false;
int strLength = str.length();
int end = (m_node == m_endContainer) ? m_endOffset : INT_MAX;
@@ -521,7 +521,7 @@
}
if (renderer->simpleLineLayout()) {
- if (renderer->style()->visibility() != VISIBLE && !m_ignoresStyleVisibility)
+ if (renderer->style().visibility() != VISIBLE && !m_ignoresStyleVisibility)
return true;
// This code aims to produce same results as handleTextBox() below so test results don't change. It does not make much logical sense.
unsigned runEnd = m_offset;
@@ -558,7 +558,7 @@
handleTextNodeFirstLetter(static_cast<RenderTextFragment*>(renderer));
if (!renderer->firstTextBox() && str.length() > 0 && !shouldHandleFirstLetter) {
- if (renderer->style()->visibility() != VISIBLE && !m_ignoresStyleVisibility)
+ if (renderer->style().visibility() != VISIBLE && !m_ignoresStyleVisibility)
return false;
m_lastTextNodeEndedWithCollapsedSpace = true; // entire block is collapsed space
return true;
@@ -585,7 +585,7 @@
void TextIterator::handleTextBox()
{
RenderText* renderer = m_firstLetterText ? m_firstLetterText : toRenderText(m_node->renderer());
- if (renderer->style()->visibility() != VISIBLE && !m_ignoresStyleVisibility) {
+ if (renderer->style().visibility() != VISIBLE && !m_ignoresStyleVisibility) {
m_textBox = 0;
return;
}
@@ -683,7 +683,7 @@
{
if (renderer->firstLetter()) {
RenderObject* r = renderer->firstLetter();
- if (r->style()->visibility() != VISIBLE && !m_ignoresStyleVisibility)
+ if (r->style().visibility() != VISIBLE && !m_ignoresStyleVisibility)
return;
if (RenderText* firstLetter = firstRenderTextInFirstLetter(r)) {
m_handledFirstLetter = true;
@@ -702,7 +702,7 @@
return false;
RenderObject* renderer = m_node->renderer();
- if (renderer->style()->visibility() != VISIBLE && !m_ignoresStyleVisibility)
+ if (renderer->style().visibility() != VISIBLE && !m_ignoresStyleVisibility)
return false;
if (m_lastTextNodeEndedWithCollapsedSpace) {
@@ -757,11 +757,11 @@
bool TextIterator::hasVisibleTextNode(RenderText* renderer)
{
- if (renderer->style()->visibility() == VISIBLE)
+ if (renderer->style().visibility() == VISIBLE)
return true;
if (renderer->isTextFragment()) {
RenderTextFragment* fragment = static_cast<RenderTextFragment*>(renderer);
- if (fragment->firstLetter() && fragment->firstLetter()->style()->visibility() == VISIBLE)
+ if (fragment->firstLetter() && fragment->firstLetter()->style().visibility() == VISIBLE)
return true;
}
return false;
@@ -871,13 +871,10 @@
|| node->hasTagName(h5Tag)
|| node->hasTagName(h6Tag)
|| node->hasTagName(pTag)) {
- RenderStyle* style = r->style();
- if (style) {
- int bottomMargin = toRenderBox(r)->collapsedMarginAfter();
- int fontSize = style->fontDescription().computedPixelSize();
- if (bottomMargin * 2 >= fontSize)
- return true;
- }
+ int bottomMargin = toRenderBox(r)->collapsedMarginAfter();
+ int fontSize = toRenderBox(r)->style().fontDescription().computedPixelSize();
+ if (bottomMargin * 2 >= fontSize)
+ return true;
}
return false;
@@ -888,7 +885,7 @@
const UChar* characters = renderer->text()->characters();
int length = renderer->text()->length();
for (int i = textEnd; i < length; ++i) {
- if (!renderer->style()->isCollapsibleWhiteSpace(characters[i]))
+ if (!renderer->style().isCollapsibleWhiteSpace(characters[i]))
return i - textEnd;
}
@@ -949,7 +946,7 @@
// If this node is unrendered or invisible the VisiblePosition checks below won't have much meaning.
// Additionally, if the range we are iterating over contains huge sections of unrendered content,
// we would create VisiblePositions on every call to this function without this check.
- if (!m_node->renderer() || m_node->renderer()->style()->visibility() != VISIBLE
+ if (!m_node->renderer() || m_node->renderer()->style().visibility() != VISIBLE
|| (m_node->renderer()->isRenderBlockFlow() && !toRenderBlock(m_node->renderer())->height() && !m_node->hasTagName(bodyTag)))
return false;
@@ -1217,10 +1214,10 @@
RenderObject* renderer = m_node->renderer();
if (renderer && renderer->isText() && m_node->nodeType() == Node::TEXT_NODE) {
// FIXME: What about CDATA_SECTION_NODE?
- if (renderer->style()->visibility() == VISIBLE && m_offset > 0)
+ if (renderer->style().visibility() == VISIBLE && m_offset > 0)
m_handledNode = handleTextNode();
} else if (renderer && (renderer->isImage() || renderer->isWidget())) {
- if (renderer->style()->visibility() == VISIBLE && m_offset > 0)
+ if (renderer->style().visibility() == VISIBLE && m_offset > 0)
m_handledNode = handleReplacedElement();
} else
m_handledNode = handleNonTextNode();
diff --git a/Source/WebCore/editing/VisibleUnits.cpp b/Source/WebCore/editing/VisibleUnits.cpp
index 5e7fcb6..4122bfa 100644
--- a/Source/WebCore/editing/VisibleUnits.cpp
+++ b/Source/WebCore/editing/VisibleUnits.cpp
@@ -489,7 +489,7 @@
SimplifiedBackwardsTextIterator it(searchRange.get());
unsigned next = 0;
- bool inTextSecurityMode = start.deprecatedNode() && start.deprecatedNode()->renderer() && start.deprecatedNode()->renderer()->style()->textSecurity() != TSNONE;
+ bool inTextSecurityMode = start.deprecatedNode() && start.deprecatedNode()->renderer() && start.deprecatedNode()->renderer()->style().textSecurity() != TSNONE;
bool needMoreContext = false;
while (!it.atEnd()) {
// iterate to get chunks until the searchFunction returns a non-zero value.
@@ -562,7 +562,7 @@
searchRange->setStart(start.deprecatedNode(), start.deprecatedEditingOffset(), IGNORE_EXCEPTION);
TextIterator it(searchRange.get(), TextIteratorEmitsCharactersBetweenAllVisiblePositions);
unsigned next = 0;
- bool inTextSecurityMode = start.deprecatedNode() && start.deprecatedNode()->renderer() && start.deprecatedNode()->renderer()->style()->textSecurity() != TSNONE;
+ bool inTextSecurityMode = start.deprecatedNode() && start.deprecatedNode()->renderer() && start.deprecatedNode()->renderer()->style().textSecurity() != TSNONE;
bool needMoreContext = false;
while (!it.atEnd()) {
// Keep asking the iterator for chunks until the search function
@@ -1120,8 +1120,8 @@
n = NodeTraversal::previousPostOrder(n, startBlock);
continue;
}
- RenderStyle* style = r->style();
- if (style->visibility() != VISIBLE) {
+ const RenderStyle& style = r->style();
+ if (style.visibility() != VISIBLE) {
n = NodeTraversal::previousPostOrder(n, startBlock);
continue;
}
@@ -1132,7 +1132,7 @@
if (r->isText() && toRenderText(r)->hasRenderedText()) {
ASSERT_WITH_SECURITY_IMPLICATION(n->isTextNode());
type = Position::PositionIsOffsetInAnchor;
- if (style->preserveNewline()) {
+ if (style.preserveNewline()) {
const UChar* chars = toRenderText(r)->characters();
int i = toRenderText(r)->textLength();
int o = offset;
@@ -1201,8 +1201,8 @@
n = NodeTraversal::next(n, stayInsideBlock);
continue;
}
- RenderStyle* style = r->style();
- if (style->visibility() != VISIBLE) {
+ const RenderStyle& style = r->style();
+ if (style.visibility() != VISIBLE) {
n = NodeTraversal::next(n, stayInsideBlock);
continue;
}
@@ -1215,7 +1215,7 @@
ASSERT_WITH_SECURITY_IMPLICATION(n->isTextNode());
int length = toRenderText(r)->textLength();
type = Position::PositionIsOffsetInAnchor;
- if (style->preserveNewline()) {
+ if (style.preserveNewline()) {
const UChar* chars = toRenderText(r)->characters();
int o = n == startNode ? offset : 0;
for (int i = o; i < length; ++i) {
diff --git a/Source/WebCore/editing/htmlediting.cpp b/Source/WebCore/editing/htmlediting.cpp
index eff4585..dca47cc 100644
--- a/Source/WebCore/editing/htmlediting.cpp
+++ b/Source/WebCore/editing/htmlediting.cpp
@@ -330,7 +330,7 @@
auto renderer = block->renderer();
if (!renderer)
return LTR;
- return renderer->style()->direction();
+ return renderer->style().direction();
}
// This method is used to create positions in the DOM. It returns the maximum valid offset
@@ -408,13 +408,13 @@
if (!renderer)
return false;
- if (renderer->style()->display() == TABLE || renderer->style()->display() == INLINE_TABLE)
+ if (renderer->style().display() == TABLE || renderer->style().display() == INLINE_TABLE)
return true;
- if (renderer->style()->isFloating())
+ if (renderer->style().isFloating())
return true;
- if (renderer->style()->position() != StaticPosition)
+ if (renderer->style().position() != StaticPosition)
return true;
return false;
@@ -818,7 +818,7 @@
return false;
RenderObject* renderer = n->renderer();
- return (renderer && (renderer->style()->display() == TABLE || renderer->style()->display() == INLINE_TABLE));
+ return (renderer && (renderer->style().display() == TABLE || renderer->style().display() == INLINE_TABLE));
}
bool isTableCell(const Node* node)
@@ -972,7 +972,7 @@
if (!renderer)
return false;
- return renderer->style()->visibility() == VISIBLE;
+ return renderer->style().visibility() == VISIBLE;
}
unsigned numEnclosingMailBlockquotes(const Position& p)
@@ -1057,7 +1057,7 @@
if (!position.anchorNode()->renderer())
return false;
- if (!position.anchorNode()->isTextNode() || !position.anchorNode()->renderer()->style()->preserveNewline())
+ if (!position.anchorNode()->isTextNode() || !position.anchorNode()->renderer()->style().preserveNewline())
return false;
Text* textNode = toText(position.anchorNode());
diff --git a/Source/WebCore/editing/ios/EditorIOS.mm b/Source/WebCore/editing/ios/EditorIOS.mm
index fe670b9..2f75dc4 100644
--- a/Source/WebCore/editing/ios/EditorIOS.mm
+++ b/Source/WebCore/editing/ios/EditorIOS.mm
@@ -248,7 +248,7 @@
if (!renderer)
continue;
// FIXME: Are there any node types that have renderers, but that we should be skipping?
- const SimpleFontData* primaryFont = renderer->style()->font().primaryFont();
+ const SimpleFontData* primaryFont = renderer->style().font().primaryFont();
if (!font)
font = primaryFont;
else if (font != primaryFont) {
diff --git a/Source/WebCore/editing/mac/EditorMac.mm b/Source/WebCore/editing/mac/EditorMac.mm
index ddc425e..d397676 100644
--- a/Source/WebCore/editing/mac/EditorMac.mm
+++ b/Source/WebCore/editing/mac/EditorMac.mm
@@ -118,7 +118,7 @@
RefPtr<EditingStyle> typingStyle = frame->selection().typingStyle();
if (!typingStyle || !typingStyle->style())
- return position.deprecatedNode()->renderer()->style();
+ return &position.deprecatedNode()->renderer()->style();
RefPtr<Element> styleElement = frame->document()->createElement(spanTag, false);
@@ -130,7 +130,7 @@
position.deprecatedNode()->parentNode()->appendChild(styleElement, ASSERT_NO_EXCEPTION);
nodeToRemove = styleElement.get();
- return styleElement->renderer() ? styleElement->renderer()->style() : 0;
+ return styleElement->renderer() ? &styleElement->renderer()->style() : 0;
}
const SimpleFontData* Editor::fontForSelection(bool& hasMultipleFonts) const
@@ -163,7 +163,7 @@
if (!renderer)
continue;
// FIXME: Are there any node types that have renderers, but that we should be skipping?
- const SimpleFontData* primaryFont = renderer->style()->font().primaryFont();
+ const SimpleFontData* primaryFont = renderer->style().font().primaryFont();
if (!font)
font = primaryFont;
else if (font != primaryFont) {
diff --git a/Source/WebCore/editing/markup.cpp b/Source/WebCore/editing/markup.cpp
index e838a43..5e62009 100644
--- a/Source/WebCore/editing/markup.cpp
+++ b/Source/WebCore/editing/markup.cpp
@@ -748,7 +748,7 @@
if (!container || !container->renderer())
return false;
- return container->renderer()->style()->preserveNewline();
+ return container->renderer()->style().preserveNewline();
}
PassRefPtr<DocumentFragment> createFragmentFromText(Range& context, const String& text)
diff --git a/Source/WebCore/html/HTMLAppletElement.cpp b/Source/WebCore/html/HTMLAppletElement.cpp
index ff04fe3..4df7efc 100644
--- a/Source/WebCore/html/HTMLAppletElement.cpp
+++ b/Source/WebCore/html/HTMLAppletElement.cpp
@@ -110,9 +110,9 @@
RenderEmbeddedObject* renderer = renderEmbeddedObject();
- LayoutUnit contentWidth = renderer->style()->width().isFixed() ? LayoutUnit(renderer->style()->width().value()) :
+ LayoutUnit contentWidth = renderer->style().width().isFixed() ? LayoutUnit(renderer->style().width().value()) :
renderer->width() - renderer->borderAndPaddingWidth();
- LayoutUnit contentHeight = renderer->style()->height().isFixed() ? LayoutUnit(renderer->style()->height().value()) :
+ LayoutUnit contentHeight = renderer->style().height().isFixed() ? LayoutUnit(renderer->style().height().value()) :
renderer->height() - renderer->borderAndPaddingHeight();
Vector<String> paramNames;
diff --git a/Source/WebCore/html/HTMLAreaElement.cpp b/Source/WebCore/html/HTMLAreaElement.cpp
index ef09dfd..9846bfd 100644
--- a/Source/WebCore/html/HTMLAreaElement.cpp
+++ b/Source/WebCore/html/HTMLAreaElement.cpp
@@ -106,7 +106,7 @@
size = obj->absoluteOutlineBounds().size();
Path p = getRegion(size);
- float zoomFactor = obj->style()->effectiveZoom();
+ float zoomFactor = obj->style().effectiveZoom();
if (zoomFactor != 1.0f) {
AffineTransform zoomTransform;
zoomTransform.scale(zoomFactor);
@@ -201,7 +201,7 @@
bool HTMLAreaElement::isFocusable() const
{
HTMLImageElement* image = imageElement();
- if (!image || !image->renderer() || image->renderer()->style()->visibility() != VISIBLE)
+ if (!image || !image->renderer() || image->renderer()->style().visibility() != VISIBLE)
return false;
return supportsFocus() && Element::tabIndex() >= 0;
diff --git a/Source/WebCore/html/HTMLCanvasElement.cpp b/Source/WebCore/html/HTMLCanvasElement.cpp
index 6fbb875..4f51b7e 100644
--- a/Source/WebCore/html/HTMLCanvasElement.cpp
+++ b/Source/WebCore/html/HTMLCanvasElement.cpp
@@ -407,7 +407,7 @@
if (m_presentedImage) {
ImageOrientationDescription orientationDescription;
#if ENABLE(CSS_IMAGE_ORIENTATION)
- orientationDescription.setImageOrientationEnum(renderer()->style()->imageOrientation());
+ orientationDescription.setImageOrientationEnum(renderer()->style().imageOrientation());
#endif
context->drawImage(m_presentedImage.get(), ColorSpaceDeviceRGB, pixelSnappedIntRect(r), CompositeSourceOver, orientationDescription, useLowQualityScale);
} else
diff --git a/Source/WebCore/html/HTMLElement.cpp b/Source/WebCore/html/HTMLElement.cpp
index 1b00425..62170fe 100644
--- a/Source/WebCore/html/HTMLElement.cpp
+++ b/Source/WebCore/html/HTMLElement.cpp
@@ -461,7 +461,7 @@
// FIXME: Can the renderer be out of date here? Do we need to call updateStyleIfNeeded?
// For example, for the contents of textarea elements that are display:none?
auto r = renderer();
- if (r && r->style()->preserveNewline()) {
+ if (r && r->style().preserveNewline()) {
if (!text.contains('\r')) {
replaceChildrenWithText(*this, text, ec);
return;
@@ -906,7 +906,7 @@
Node* strongDirectionalityTextNode;
TextDirection textDirection = directionality(&strongDirectionalityTextNode);
setHasDirAutoFlagRecursively(child, false);
- if (!renderer() || !renderer()->style() || renderer()->style()->direction() == textDirection)
+ if (!renderer() || renderer()->style().direction() == textDirection)
return;
auto lineage = elementLineage(this);
for (auto elementToAdjust = lineage.begin(), end = lineage.end(); elementToAdjust != end; ++elementToAdjust) {
@@ -922,7 +922,7 @@
Node* strongDirectionalityTextNode;
TextDirection textDirection = directionality(&strongDirectionalityTextNode);
setHasDirAutoFlagRecursively(this, true, strongDirectionalityTextNode);
- if (renderer() && renderer()->style() && renderer()->style()->direction() != textDirection)
+ if (renderer() && renderer()->style().direction() != textDirection)
setNeedsStyleRecalc();
}
diff --git a/Source/WebCore/html/HTMLFormControlElement.cpp b/Source/WebCore/html/HTMLFormControlElement.cpp
index 0f576c2..7d4ce8d 100644
--- a/Source/WebCore/html/HTMLFormControlElement.cpp
+++ b/Source/WebCore/html/HTMLFormControlElement.cpp
@@ -136,7 +136,7 @@
if (wasReadOnly != m_isReadOnly) {
setNeedsWillValidateCheck();
setNeedsStyleRecalc();
- if (renderer() && renderer()->style()->hasAppearance())
+ if (renderer() && renderer()->style().hasAppearance())
renderer()->theme()->stateChanged(renderer(), ReadOnlyState);
}
} else if (name == requiredAttr) {
@@ -156,7 +156,7 @@
{
setNeedsWillValidateCheck();
didAffectSelector(AffectedSelectorDisabled | AffectedSelectorEnabled);
- if (renderer() && renderer()->style()->hasAppearance())
+ if (renderer() && renderer()->style().hasAppearance())
renderer()->theme()->stateChanged(renderer(), EnabledState);
}
diff --git a/Source/WebCore/html/HTMLInputElement.cpp b/Source/WebCore/html/HTMLInputElement.cpp
index f3cb50d..3e8cb43 100644
--- a/Source/WebCore/html/HTMLInputElement.cpp
+++ b/Source/WebCore/html/HTMLInputElement.cpp
@@ -885,7 +885,7 @@
if (CheckedRadioButtons* buttons = checkedRadioButtons())
buttons->updateCheckedState(this);
- if (renderer() && renderer()->style()->hasAppearance())
+ if (renderer() && renderer()->style().hasAppearance())
renderer()->theme()->stateChanged(renderer(), CheckedState);
setNeedsValidityCheck();
@@ -919,7 +919,7 @@
didAffectSelector(AffectedSelectorIndeterminate);
- if (renderer() && renderer()->style()->hasAppearance())
+ if (renderer() && renderer()->style().hasAppearance())
renderer()->theme()->stateChanged(renderer(), CheckedState);
}
diff --git a/Source/WebCore/html/HTMLMediaElement.cpp b/Source/WebCore/html/HTMLMediaElement.cpp
index 10f7da0..d754de7 100644
--- a/Source/WebCore/html/HTMLMediaElement.cpp
+++ b/Source/WebCore/html/HTMLMediaElement.cpp
@@ -3502,7 +3502,7 @@
goto check_again;
if (source->fastHasAttribute(mediaAttr)) {
- MediaQueryEvaluator screenEval("screen", document().frame(), renderer() ? renderer()->style() : 0);
+ MediaQueryEvaluator screenEval("screen", document().frame(), renderer() ? &renderer()->style() : nullptr);
RefPtr<MediaQuerySet> media = MediaQuerySet::createAllowingDescriptionSyntax(source->media());
#if !LOG_DISABLED
if (shouldLog)
diff --git a/Source/WebCore/html/HTMLOptionElement.cpp b/Source/WebCore/html/HTMLOptionElement.cpp
index 3560f57..a654354 100644
--- a/Source/WebCore/html/HTMLOptionElement.cpp
+++ b/Source/WebCore/html/HTMLOptionElement.cpp
@@ -196,7 +196,7 @@
m_disabled = !value.isNull();
if (oldDisabled != m_disabled) {
didAffectSelector(AffectedSelectorDisabled | AffectedSelectorEnabled);
- if (renderer() && renderer()->style()->hasAppearance())
+ if (renderer() && renderer()->style().hasAppearance())
renderer()->theme()->stateChanged(renderer(), EnabledState);
}
} else if (name == selectedAttr) {
diff --git a/Source/WebCore/html/HTMLPlugInImageElement.cpp b/Source/WebCore/html/HTMLPlugInImageElement.cpp
index 9e1d354..8a2bd22 100644
--- a/Source/WebCore/html/HTMLPlugInImageElement.cpp
+++ b/Source/WebCore/html/HTMLPlugInImageElement.cpp
@@ -663,8 +663,8 @@
}
RenderBox* renderEmbeddedObject = toRenderBox(renderer());
- Length styleWidth = renderEmbeddedObject->style()->width();
- Length styleHeight = renderEmbeddedObject->style()->height();
+ Length styleWidth = renderEmbeddedObject->style().width();
+ Length styleHeight = renderEmbeddedObject->style().height();
LayoutRect contentBoxRect = renderEmbeddedObject->contentBoxRect();
int contentWidth = contentBoxRect.width();
int contentHeight = contentBoxRect.height();
diff --git a/Source/WebCore/html/HTMLTextFormControlElement.cpp b/Source/WebCore/html/HTMLTextFormControlElement.cpp
index c7770d3..9957109 100644
--- a/Source/WebCore/html/HTMLTextFormControlElement.cpp
+++ b/Source/WebCore/html/HTMLTextFormControlElement.cpp
@@ -153,7 +153,7 @@
&& isEmptySuggestedValue()
&& !isPlaceholderEmpty()
&& (document().focusedElement() != this || (renderer() && renderer()->theme()->shouldShowPlaceholderWhenFocused()))
- && (!renderer() || renderer()->style()->visibility() == VISIBLE);
+ && (!renderer() || renderer()->style().visibility() == VISIBLE);
}
void HTMLTextFormControlElement::updatePlaceholderVisibility(bool placeholderValueChanged)
@@ -206,7 +206,7 @@
static inline bool hasVisibleTextArea(RenderElement& textControl, TextControlInnerTextElement* innerText)
{
- return textControl.style()->visibility() != HIDDEN && innerText && innerText->renderer() && innerText->renderBox()->height();
+ return textControl.style().visibility() != HIDDEN && innerText && innerText->renderer() && innerText->renderBox()->height();
}
void HTMLTextFormControlElement::setRangeText(const String& replacement, ExceptionCode& ec)
diff --git a/Source/WebCore/html/RangeInputType.cpp b/Source/WebCore/html/RangeInputType.cpp
index 021492f..692b1f1 100644
--- a/Source/WebCore/html/RangeInputType.cpp
+++ b/Source/WebCore/html/RangeInputType.cpp
@@ -210,7 +210,7 @@
bool isVertical = false;
if (element().renderer()) {
- ControlPart part = element().renderer()->style()->appearance();
+ ControlPart part = element().renderer()->style().appearance();
isVertical = part == SliderVerticalPart || part == MediaVolumeSliderPart;
}
diff --git a/Source/WebCore/html/TextFieldInputType.cpp b/Source/WebCore/html/TextFieldInputType.cpp
index 42dd60f..df81b4b 100644
--- a/Source/WebCore/html/TextFieldInputType.cpp
+++ b/Source/WebCore/html/TextFieldInputType.cpp
@@ -177,7 +177,7 @@
if (event->type() == eventNames().blurEvent) {
if (RenderTextControlInnerBlock* innerTextRenderer = innerTextElement()->renderer()) {
if (RenderLayer* innerLayer = innerTextRenderer->layer()) {
- IntSize scrollOffset(!renderTextControl->style()->isLeftToRightDirection() ? innerLayer->scrollWidth() : 0, 0);
+ IntSize scrollOffset(!renderTextControl->style().isLeftToRightDirection() ? innerLayer->scrollWidth() : 0, 0);
innerLayer->scrollToOffset(scrollOffset, RenderLayer::ScrollOffsetClamped);
}
}
diff --git a/Source/WebCore/html/parser/HTMLResourcePreloader.cpp b/Source/WebCore/html/parser/HTMLResourcePreloader.cpp
index 23b1e22..6bc3fc8 100644
--- a/Source/WebCore/html/parser/HTMLResourcePreloader.cpp
+++ b/Source/WebCore/html/parser/HTMLResourcePreloader.cpp
@@ -81,8 +81,7 @@
{
ASSERT(m_document.frame());
ASSERT(m_document.renderView());
- ASSERT(m_document.renderView()->style());
- if (!preload->media().isEmpty() && !mediaAttributeMatches(m_document.frame(), m_document.renderView()->style(), preload->media()))
+ if (!preload->media().isEmpty() && !mediaAttributeMatches(m_document.frame(), &m_document.renderView()->style(), preload->media()))
return;
CachedResourceRequest request = preload->resourceRequest(m_document);
diff --git a/Source/WebCore/html/shadow/MeterShadowElement.cpp b/Source/WebCore/html/shadow/MeterShadowElement.cpp
index 178f164..d264414 100644
--- a/Source/WebCore/html/shadow/MeterShadowElement.cpp
+++ b/Source/WebCore/html/shadow/MeterShadowElement.cpp
@@ -57,7 +57,7 @@
bool MeterShadowElement::rendererIsNeeded(const RenderStyle& style)
{
auto render = meterElement()->renderer();
- return render && !render->theme()->supportsMeter(render->style()->appearance()) && HTMLDivElement::rendererIsNeeded(style);
+ return render && !render->theme()->supportsMeter(render->style().appearance()) && HTMLDivElement::rendererIsNeeded(style);
}
MeterInnerElement::MeterInnerElement(Document& document)
@@ -73,7 +73,7 @@
return HTMLDivElement::rendererIsNeeded(style);
auto render = meterElement()->renderer();
- return render && !render->theme()->supportsMeter(render->style()->appearance()) && HTMLDivElement::rendererIsNeeded(style);
+ return render && !render->theme()->supportsMeter(render->style().appearance()) && HTMLDivElement::rendererIsNeeded(style);
}
RenderElement* MeterInnerElement::createRenderer(PassRef<RenderStyle> style)
diff --git a/Source/WebCore/html/shadow/ProgressShadowElement.cpp b/Source/WebCore/html/shadow/ProgressShadowElement.cpp
index b4c4bfa..ccfd4fd 100644
--- a/Source/WebCore/html/shadow/ProgressShadowElement.cpp
+++ b/Source/WebCore/html/shadow/ProgressShadowElement.cpp
@@ -53,7 +53,7 @@
bool ProgressShadowElement::rendererIsNeeded(const RenderStyle& style)
{
RenderObject* progressRenderer = progressElement()->renderer();
- return progressRenderer && !progressRenderer->style()->hasAppearance() && HTMLDivElement::rendererIsNeeded(style);
+ return progressRenderer && !progressRenderer->style().hasAppearance() && HTMLDivElement::rendererIsNeeded(style);
}
ProgressInnerElement::ProgressInnerElement(Document& document)
@@ -72,7 +72,7 @@
return HTMLDivElement::rendererIsNeeded(style);
RenderObject* progressRenderer = progressElement()->renderer();
- return progressRenderer && !progressRenderer->style()->hasAppearance() && HTMLDivElement::rendererIsNeeded(style);
+ return progressRenderer && !progressRenderer->style().hasAppearance() && HTMLDivElement::rendererIsNeeded(style);
}
ProgressBarElement::ProgressBarElement(Document& document)
diff --git a/Source/WebCore/html/shadow/SliderThumbElement.cpp b/Source/WebCore/html/shadow/SliderThumbElement.cpp
index 0c5234f..ceab492 100644
--- a/Source/WebCore/html/shadow/SliderThumbElement.cpp
+++ b/Source/WebCore/html/shadow/SliderThumbElement.cpp
@@ -60,14 +60,14 @@
inline static bool hasVerticalAppearance(HTMLInputElement* input)
{
ASSERT(input->renderer());
- RenderStyle* sliderStyle = input->renderer()->style();
+ const RenderStyle& sliderStyle = input->renderer()->style();
#if ENABLE(VIDEO)
- if (sliderStyle->appearance() == MediaVolumeSliderPart && input->renderer()->theme()->usesVerticalVolumeSlider())
+ if (sliderStyle.appearance() == MediaVolumeSliderPart && input->renderer()->theme()->usesVerticalVolumeSlider())
return true;
#endif
- return sliderStyle->appearance() == SliderVerticalPart;
+ return sliderStyle.appearance() == SliderVerticalPart;
}
// --------------------------------
@@ -80,17 +80,17 @@
void RenderSliderThumb::updateAppearance(RenderStyle* parentStyle)
{
if (parentStyle->appearance() == SliderVerticalPart)
- style()->setAppearance(SliderThumbVerticalPart);
+ style().setAppearance(SliderThumbVerticalPart);
else if (parentStyle->appearance() == SliderHorizontalPart)
- style()->setAppearance(SliderThumbHorizontalPart);
+ style().setAppearance(SliderThumbHorizontalPart);
else if (parentStyle->appearance() == MediaSliderPart)
- style()->setAppearance(MediaSliderThumbPart);
+ style().setAppearance(MediaSliderThumbPart);
else if (parentStyle->appearance() == MediaVolumeSliderPart)
- style()->setAppearance(MediaVolumeSliderThumbPart);
+ style().setAppearance(MediaVolumeSliderThumbPart);
else if (parentStyle->appearance() == MediaFullScreenVolumeSliderPart)
- style()->setAppearance(MediaFullScreenVolumeSliderThumbPart);
- if (style()->hasAppearance())
- theme()->adjustSliderThumbSize(style(), element());
+ style().setAppearance(MediaFullScreenVolumeSliderThumbPart);
+ if (style().hasAppearance())
+ theme()->adjustSliderThumbSize(&style(), element());
}
bool RenderSliderThumb::isSliderThumb() const
@@ -131,7 +131,7 @@
int tickLength = theme()->sliderTickSize().height();
trackHeight = 2 * (offsetFromCenter + tickLength);
}
- float zoomFactor = style()->effectiveZoom();
+ float zoomFactor = style().effectiveZoom();
if (zoomFactor != 1.0)
trackHeight *= zoomFactor;
@@ -148,13 +148,13 @@
{
HTMLInputElement* input = element()->shadowHost()->toInputElement();
bool isVertical = hasVerticalAppearance(input);
- style()->setFlexDirection(isVertical ? FlowColumn : FlowRow);
- TextDirection oldTextDirection = style()->direction();
+ style().setFlexDirection(isVertical ? FlowColumn : FlowRow);
+ TextDirection oldTextDirection = style().direction();
if (isVertical) {
// FIXME: Work around rounding issues in RTL vertical sliders. We want them to
// render identically to LTR vertical sliders. We can remove this work around when
// subpixel rendering is enabled on all ports.
- style()->setDirection(LTR);
+ style().setDirection(LTR);
}
RenderBox* thumb = input->sliderThumbElement() ? input->sliderThumbElement()->renderBox() : 0;
@@ -166,7 +166,7 @@
RenderFlexibleBox::layout();
- style()->setDirection(oldTextDirection);
+ style().setDirection(oldTextDirection);
// These should always exist, unless someone mutates the shadow DOM (e.g., in the inspector).
if (!thumb || !track)
return;
@@ -178,7 +178,7 @@
LayoutPoint thumbLocation = thumb->location();
if (isVertical)
thumbLocation.setY(thumbLocation.y() + track->contentHeight() - thumb->height() - offset);
- else if (style()->isLeftToRightDirection())
+ else if (style().isLeftToRightDirection())
thumbLocation.setX(thumbLocation.x() + offset);
else
thumbLocation.setX(thumbLocation.x() - offset);
@@ -254,7 +254,7 @@
RenderBox& trackRenderer = *trackElement->renderBox();
bool isVertical = hasVerticalAppearance(input.get());
- bool isLeftToRightDirection = renderBox()->style()->isLeftToRightDirection();
+ bool isLeftToRightDirection = renderBox()->style().isLeftToRightDirection();
LayoutPoint offset = roundedLayoutPoint(inputRenderer.absoluteToLocal(absolutePoint, UseTransforms));
FloatRect trackBoundingBox = trackRenderer.localToContainerQuad(FloatRect(0, 0, trackRenderer.width(), trackRenderer.height()), &inputRenderer).enclosingBoundingBox();
@@ -411,8 +411,8 @@
if (!input)
return sliderThumbShadowPseudoId();
- RenderStyle* sliderStyle = input->renderer()->style();
- switch (sliderStyle->appearance()) {
+ const RenderStyle& sliderStyle = input->renderer()->style();
+ switch (sliderStyle.appearance()) {
case MediaSliderPart:
case MediaSliderThumbPart:
case MediaVolumeSliderPart:
@@ -456,8 +456,8 @@
if (!input)
return sliderContainer;
- RenderStyle* sliderStyle = input->renderer()->style();
- switch (sliderStyle->appearance()) {
+ const RenderStyle& sliderStyle = input->renderer()->style();
+ switch (sliderStyle.appearance()) {
case MediaSliderPart:
case MediaSliderThumbPart:
case MediaVolumeSliderPart:
diff --git a/Source/WebCore/html/shadow/TextControlInnerElements.cpp b/Source/WebCore/html/shadow/TextControlInnerElements.cpp
index 08c38d9..8f3ff77 100644
--- a/Source/WebCore/html/shadow/TextControlInnerElements.cpp
+++ b/Source/WebCore/html/shadow/TextControlInnerElements.cpp
@@ -77,7 +77,7 @@
PassRefPtr<RenderStyle> TextControlInnerElement::customStyleForRenderer()
{
RenderTextControlSingleLine* parentRenderer = toRenderTextControlSingleLine(shadowHost()->renderer());
- return parentRenderer->createInnerBlockStyle(parentRenderer->style());
+ return parentRenderer->createInnerBlockStyle(&parentRenderer->style());
}
// ---------------------------
@@ -125,7 +125,7 @@
PassRefPtr<RenderStyle> TextControlInnerTextElement::customStyleForRenderer()
{
RenderTextControl* parentRenderer = toRenderTextControl(shadowHost()->renderer());
- return parentRenderer->createInnerTextStyle(parentRenderer->style());
+ return parentRenderer->createInnerTextStyle(&parentRenderer->style());
}
// ----------------------------
diff --git a/Source/WebCore/inspector/InspectorLayerTreeAgent.cpp b/Source/WebCore/inspector/InspectorLayerTreeAgent.cpp
index aa3d2e2..380cdb4 100644
--- a/Source/WebCore/inspector/InspectorLayerTreeAgent.cpp
+++ b/Source/WebCore/inspector/InspectorLayerTreeAgent.cpp
@@ -205,12 +205,11 @@
// FIXME: RenderView is now really anonymous but don't tell about it to the frontend before making sure it can handle it.
if (isAnonymous && !renderer->isRenderView()) {
layerObject->setIsAnonymous(true);
- if (RenderStyle* style = renderer->style()) {
- if (style->styleType() == FIRST_LETTER)
- layerObject->setPseudoElement("first-letter");
- else if (style->styleType() == FIRST_LINE)
- layerObject->setPseudoElement("first-line");
- }
+ const RenderStyle& style = renderer->style();
+ if (style.styleType() == FIRST_LETTER)
+ layerObject->setPseudoElement("first-letter");
+ else if (style.styleType() == FIRST_LINE)
+ layerObject->setPseudoElement("first-line");
}
return layerObject;
diff --git a/Source/WebCore/inspector/InspectorOverlay.cpp b/Source/WebCore/inspector/InspectorOverlay.cpp
index a3be3fd..af3f26e 100644
--- a/Source/WebCore/inspector/InspectorOverlay.cpp
+++ b/Source/WebCore/inspector/InspectorOverlay.cpp
@@ -142,8 +142,8 @@
if (!renderBox->isOutOfFlowPositioned() && region) {
RenderBox::LogicalExtentComputedValues computedValues;
renderBox->computeLogicalWidthInRegion(computedValues, region);
- margins.mutableLogicalLeft(renderBox->style()->writingMode()) = computedValues.m_margins.m_start;
- margins.mutableLogicalRight(renderBox->style()->writingMode()) = computedValues.m_margins.m_end;
+ margins.mutableLogicalLeft(renderBox->style().writingMode()) = computedValues.m_margins.m_start;
+ margins.mutableLogicalRight(renderBox->style().writingMode()) = computedValues.m_margins.m_end;
}
paddingBox = renderBox->clientBoxRectInRegion(region);
diff --git a/Source/WebCore/loader/cache/CachedImage.cpp b/Source/WebCore/loader/cache/CachedImage.cpp
index 99d1e89..61f0500 100644
--- a/Source/WebCore/loader/cache/CachedImage.cpp
+++ b/Source/WebCore/loader/cache/CachedImage.cpp
@@ -264,7 +264,7 @@
return IntSize();
ImageOrientationDescription orientationDescription(renderer->shouldRespectImageOrientation());
- orientationDescription.setImageOrientationEnum(renderer->style()->imageOrientation());
+ orientationDescription.setImageOrientationEnum(renderer->style().imageOrientation());
if (m_image->isBitmapImage()
&& (orientationDescription.respectImageOrientation() == RespectImageOrientation && orientationDescription.imageOrientation() != DefaultImageOrientation))
diff --git a/Source/WebCore/page/Chrome.cpp b/Source/WebCore/page/Chrome.cpp
index c71464f..a328ea9 100644
--- a/Source/WebCore/page/Chrome.cpp
+++ b/Source/WebCore/page/Chrome.cpp
@@ -404,7 +404,7 @@
if (HTMLFormElement* form = input->form()) {
toolTip = form->action();
if (form->renderer())
- toolTipDirection = form->renderer()->style()->direction();
+ toolTipDirection = form->renderer()->style().direction();
else
toolTipDirection = LTR;
}
diff --git a/Source/WebCore/page/DragController.cpp b/Source/WebCore/page/DragController.cpp
index 693795f..df7cc54 100644
--- a/Source/WebCore/page/DragController.cpp
+++ b/Source/WebCore/page/DragController.cpp
@@ -627,7 +627,7 @@
// for the purposes of finding a draggable element.
continue;
}
- EUserDrag dragMode = renderer->style()->userDrag();
+ EUserDrag dragMode = renderer->style().userDrag();
if ((m_dragSourceAction & DragSourceActionDHTML) && dragMode == DRAG_ELEMENT) {
state.type = static_cast<DragSourceAction>(state.type | DragSourceActionDHTML);
return element;
@@ -859,7 +859,7 @@
ImageOrientationDescription orientationDescription(element.renderer()->shouldRespectImageOrientation());
#if ENABLE(CSS_IMAGE_ORIENTATION)
- orientationDescription.setImageOrientationEnum(element.renderer()->style()->imageOrientation());
+ orientationDescription.setImageOrientationEnum(element.renderer()->style().imageOrientation());
#endif
Image* image = getImage(element);
diff --git a/Source/WebCore/page/EventHandler.cpp b/Source/WebCore/page/EventHandler.cpp
index 1bc732b..f8d359c 100644
--- a/Source/WebCore/page/EventHandler.cpp
+++ b/Source/WebCore/page/EventHandler.cpp
@@ -1282,7 +1282,7 @@
return NoCursorChange;
auto renderer = node->renderer();
- RenderStyle* style = renderer ? renderer->style() : 0;
+ RenderStyle* style = renderer ? &renderer->style() : nullptr;
bool horizontalText = !style || style->isHorizontalWritingMode();
const Cursor& iBeam = horizontalText ? iBeamCursor() : verticalTextCursor();
diff --git a/Source/WebCore/page/Frame.cpp b/Source/WebCore/page/Frame.cpp
index 1242917..636cefe 100644
--- a/Source/WebCore/page/Frame.cpp
+++ b/Source/WebCore/page/Frame.cpp
@@ -342,7 +342,7 @@
// search within the above cell we found for a match
size_t lengthSearched = 0;
for (Text* textNode = TextNodeTraversal::firstWithin(aboveCell); textNode; textNode = TextNodeTraversal::next(textNode, aboveCell)) {
- if (!textNode->renderer() || textNode->renderer()->style()->visibility() != VISIBLE)
+ if (!textNode->renderer() || textNode->renderer()->style().visibility() != VISIBLE)
continue;
// For each text chunk, run the regexp
String nodeString = textNode->data();
@@ -397,7 +397,7 @@
return result;
}
searchedCellAbove = true;
- } else if (n->isTextNode() && n->renderer() && n->renderer()->style()->visibility() == VISIBLE) {
+ } else if (n->isTextNode() && n->renderer() && n->renderer()->style().visibility() == VISIBLE) {
// For each text chunk, run the regexp
String nodeString = n->nodeValue();
// add 100 for slop, to make it more likely that we'll search whole nodes
@@ -510,7 +510,7 @@
if (!contentRenderer())
return FloatSize();
- if (contentRenderer()->style()->isHorizontalWritingMode()) {
+ if (contentRenderer()->style().isHorizontalWritingMode()) {
ASSERT(fabs(originalSize.width()) > numeric_limits<float>::epsilon());
float ratio = originalSize.height() / originalSize.width();
resultSize.setWidth(floorf(expectedSize.width()));
@@ -1036,7 +1036,7 @@
ImageOrientationDescription orientationDescription(renderer->shouldRespectImageOrientation());
#if ENABLE(CSS_IMAGE_ORIENTATION)
- orientationDescription.setImageOrientationEnum(renderer->style()->imageOrientation());
+ orientationDescription.setImageOrientationEnum(renderer->style().imageOrientation());
#endif
return createDragImageFromImage(image.get(), orientationDescription);
}
diff --git a/Source/WebCore/page/FrameView.cpp b/Source/WebCore/page/FrameView.cpp
index c111ac7..a7f18f3 100644
--- a/Source/WebCore/page/FrameView.cpp
+++ b/Source/WebCore/page/FrameView.cpp
@@ -539,17 +539,17 @@
// Try the <body> element first as a scrollbar source.
Element* body = doc ? doc->body() : 0;
- if (body && body->renderer() && body->renderer()->style()->hasPseudoStyle(SCROLLBAR))
+ if (body && body->renderer() && body->renderer()->style().hasPseudoStyle(SCROLLBAR))
return RenderScrollbar::createCustomScrollbar(this, orientation, body);
// If the <body> didn't have a custom style, then the root element might.
Element* docElement = doc ? doc->documentElement() : 0;
- if (docElement && docElement->renderer() && docElement->renderer()->style()->hasPseudoStyle(SCROLLBAR))
+ if (docElement && docElement->renderer() && docElement->renderer()->style().hasPseudoStyle(SCROLLBAR))
return RenderScrollbar::createCustomScrollbar(this, orientation, docElement);
// If we have an owning iframe/frame element, then it can set the custom scrollbar also.
RenderWidget* frameRenderer = frame().ownerRenderer();
- if (frameRenderer && frameRenderer->style()->hasPseudoStyle(SCROLLBAR))
+ if (frameRenderer && frameRenderer->style().hasPseudoStyle(SCROLLBAR))
return RenderScrollbar::createCustomScrollbar(this, orientation, 0, &frame());
// Nobody set a custom style, so we just use a native scrollbar.
@@ -609,8 +609,8 @@
bool overrideHidden = frame().isMainFrame() && ((frame().frameScaleFactor() > 1) || headerHeight() || footerHeight());
- EOverflow overflowX = o->style()->overflowX();
- EOverflow overflowY = o->style()->overflowY();
+ EOverflow overflowX = o->style().overflowX();
+ EOverflow overflowY = o->style().overflowY();
#if ENABLE(SVG)
if (o->isSVGRoot()) {
@@ -670,7 +670,7 @@
auto body = document->body();
if (body && body->renderer()) {
if (body->hasTagName(bodyTag))
- documentOrBodyRenderer = documentRenderer->style()->overflowX() == OVISIBLE && documentElement->hasTagName(htmlTag) ? body->renderer() : documentRenderer;
+ documentOrBodyRenderer = documentRenderer->style().overflowX() == OVISIBLE && documentElement->hasTagName(htmlTag) ? body->renderer() : documentRenderer;
}
Pagination pagination;
@@ -680,10 +680,10 @@
return;
}
- EOverflow overflowY = documentOrBodyRenderer->style()->overflowY();
+ EOverflow overflowY = documentOrBodyRenderer->style().overflowY();
if (overflowY == OPAGEDX || overflowY == OPAGEDY) {
- pagination.mode = WebCore::paginationModeForRenderStyle(documentOrBodyRenderer->style());
- pagination.gap = static_cast<unsigned>(documentOrBodyRenderer->style()->columnGap());
+ pagination.mode = WebCore::paginationModeForRenderStyle(&documentOrBodyRenderer->style());
+ pagination.gap = static_cast<unsigned>(documentOrBodyRenderer->style().columnGap());
}
setPagination(pagination);
@@ -724,7 +724,7 @@
} else if (body->hasTagName(bodyTag)) {
// It's sufficient to just check the X overflow,
// since it's illegal to have visible in only one direction.
- RenderElement* o = rootRenderer->style()->overflowX() == OVISIBLE && document->documentElement()->hasTagName(htmlTag) ? body->renderer() : rootRenderer;
+ RenderElement* o = rootRenderer->style().overflowX() == OVISIBLE && document->documentElement()->hasTagName(htmlTag) ? body->renderer() : rootRenderer;
applyOverflowToViewport(o, hMode, vMode);
}
} else if (rootRenderer)
@@ -1206,7 +1206,7 @@
m_lastViewportSize = fixedLayoutSize();
else
m_lastViewportSize = visibleContentRect(IncludeScrollbars).size();
- m_lastZoomFactor = root->style()->zoom();
+ m_lastZoomFactor = root->style().zoom();
// Set the initial vMode to AlwaysOn if we're auto.
if (vMode == ScrollbarAuto)
@@ -1630,7 +1630,7 @@
Region regionToUpdate;
for (auto it = m_viewportConstrainedObjects->begin(), end = m_viewportConstrainedObjects->end(); it != end; ++it) {
RenderElement* renderer = *it;
- if (!renderer->style()->hasViewportConstrainedPosition())
+ if (!renderer->style().hasViewportConstrainedPosition())
continue;
#if USE(ACCELERATED_COMPOSITING)
if (renderer->isComposited())
@@ -2767,7 +2767,7 @@
else
currentSize = visibleContentRect(IncludeScrollbars).size();
- float currentZoomFactor = renderView->style()->zoom();
+ float currentZoomFactor = renderView->style().zoom();
bool shouldSendResizeEvent = !m_firstLayout && (currentSize != m_lastViewportSize || currentZoomFactor != m_lastZoomFactor);
m_lastViewportSize = currentSize;
@@ -3196,7 +3196,7 @@
Element* body = doc ? doc->body() : 0;
if (body && body->renderer()) {
renderer = body->renderer();
- cornerStyle = renderer->getUncachedPseudoStyle(PseudoStyleRequest(SCROLLBAR_CORNER), renderer->style());
+ cornerStyle = renderer->getUncachedPseudoStyle(PseudoStyleRequest(SCROLLBAR_CORNER), &renderer->style());
}
if (!cornerStyle) {
@@ -3204,14 +3204,14 @@
Element* docElement = doc ? doc->documentElement() : 0;
if (docElement && docElement->renderer()) {
renderer = docElement->renderer();
- cornerStyle = renderer->getUncachedPseudoStyle(PseudoStyleRequest(SCROLLBAR_CORNER), renderer->style());
+ cornerStyle = renderer->getUncachedPseudoStyle(PseudoStyleRequest(SCROLLBAR_CORNER), &renderer->style());
}
}
if (!cornerStyle) {
// If we have an owning iframe/frame element, then it can set the custom scrollbar also.
if (RenderWidget* renderer = frame().ownerRenderer())
- cornerStyle = renderer->getUncachedPseudoStyle(PseudoStyleRequest(SCROLLBAR_CORNER), renderer->style());
+ cornerStyle = renderer->getUncachedPseudoStyle(PseudoStyleRequest(SCROLLBAR_CORNER), &renderer->style());
}
}
@@ -3275,9 +3275,9 @@
Color htmlBackgroundColor;
Color bodyBackgroundColor;
if (htmlElement && htmlElement->renderer())
- htmlBackgroundColor = htmlElement->renderer()->style()->visitedDependentColor(CSSPropertyBackgroundColor);
+ htmlBackgroundColor = htmlElement->renderer()->style().visitedDependentColor(CSSPropertyBackgroundColor);
if (bodyElement && bodyElement->renderer())
- bodyBackgroundColor = bodyElement->renderer()->style()->visitedDependentColor(CSSPropertyBackgroundColor);
+ bodyBackgroundColor = bodyElement->renderer()->style().visitedDependentColor(CSSPropertyBackgroundColor);
if (!bodyBackgroundColor.isValid()) {
if (!htmlBackgroundColor.isValid())
@@ -3705,8 +3705,8 @@
// Dumping externalRepresentation(frame().renderer()).ascii() is a good trick to see
// the state of things before and after the layout
if (RenderView* renderView = this->renderView()) {
- float pageLogicalWidth = renderView->style()->isHorizontalWritingMode() ? pageSize.width() : pageSize.height();
- float pageLogicalHeight = renderView->style()->isHorizontalWritingMode() ? pageSize.height() : pageSize.width();
+ float pageLogicalWidth = renderView->style().isHorizontalWritingMode() ? pageSize.width() : pageSize.height();
+ float pageLogicalHeight = renderView->style().isHorizontalWritingMode() ? pageSize.height() : pageSize.width();
LayoutUnit flooredPageLogicalWidth = static_cast<LayoutUnit>(pageLogicalWidth);
LayoutUnit flooredPageLogicalHeight = static_cast<LayoutUnit>(pageLogicalHeight);
@@ -3719,7 +3719,7 @@
// page width when shrunk, we will lay out at maximum shrink and clip extra content.
// FIXME: We are assuming a shrink-to-fit printing implementation. A cropping
// implementation should not do this!
- bool horizontalWritingMode = renderView->style()->isHorizontalWritingMode();
+ bool horizontalWritingMode = renderView->style().isHorizontalWritingMode();
const LayoutRect& documentRect = renderView->documentRect();
LayoutUnit docLogicalWidth = horizontalWritingMode ? documentRect.width() : documentRect.height();
if (docLogicalWidth > pageLogicalWidth) {
@@ -3741,7 +3741,7 @@
LayoutUnit docLogicalTop = horizontalWritingMode ? updatedDocumentRect.y() : updatedDocumentRect.x();
LayoutUnit docLogicalRight = horizontalWritingMode ? updatedDocumentRect.maxX() : updatedDocumentRect.maxY();
LayoutUnit clippedLogicalLeft = 0;
- if (!renderView->style()->isLeftToRightDirection())
+ if (!renderView->style().isLeftToRightDirection())
clippedLogicalLeft = docLogicalRight - pageLogicalWidth;
LayoutRect overflow(clippedLogicalLeft, docLogicalTop, pageLogicalWidth, docLogicalHeight);
@@ -4059,7 +4059,7 @@
if (!renderView)
return true;
- return renderView->style()->isHorizontalWritingMode();
+ return renderView->style().isHorizontalWritingMode();
}
bool FrameView::isFlippedDocument() const
@@ -4068,7 +4068,7 @@
if (!renderView)
return false;
- return renderView->style()->isFlippedBlocksWritingMode();
+ return renderView->style().isFlippedBlocksWritingMode();
}
void FrameView::notifyWidgetsInAllFrames(WidgetNotification notification)
diff --git a/Source/WebCore/page/PrintContext.cpp b/Source/WebCore/page/PrintContext.cpp
index 14c78a0..e3fddb0 100644
--- a/Source/WebCore/page/PrintContext.cpp
+++ b/Source/WebCore/page/PrintContext.cpp
@@ -104,7 +104,7 @@
int pageWidth = pageSizeInPixels.width();
int pageHeight = pageSizeInPixels.height();
- bool isHorizontal = view->style()->isHorizontalWritingMode();
+ bool isHorizontal = view->style().isHorizontalWritingMode();
int docLogicalHeight = isHorizontal ? docRect.height() : docRect.width();
int pageLogicalHeight = isHorizontal ? pageHeight : pageWidth;
@@ -115,25 +115,25 @@
int blockDirectionStart;
int blockDirectionEnd;
if (isHorizontal) {
- if (view->style()->isFlippedBlocksWritingMode()) {
+ if (view->style().isFlippedBlocksWritingMode()) {
blockDirectionStart = docRect.maxY();
blockDirectionEnd = docRect.y();
} else {
blockDirectionStart = docRect.y();
blockDirectionEnd = docRect.maxY();
}
- inlineDirectionStart = view->style()->isLeftToRightDirection() ? docRect.x() : docRect.maxX();
- inlineDirectionEnd = view->style()->isLeftToRightDirection() ? docRect.maxX() : docRect.x();
+ inlineDirectionStart = view->style().isLeftToRightDirection() ? docRect.x() : docRect.maxX();
+ inlineDirectionEnd = view->style().isLeftToRightDirection() ? docRect.maxX() : docRect.x();
} else {
- if (view->style()->isFlippedBlocksWritingMode()) {
+ if (view->style().isFlippedBlocksWritingMode()) {
blockDirectionStart = docRect.maxX();
blockDirectionEnd = docRect.x();
} else {
blockDirectionStart = docRect.x();
blockDirectionEnd = docRect.maxX();
}
- inlineDirectionStart = view->style()->isLeftToRightDirection() ? docRect.y() : docRect.maxY();
- inlineDirectionEnd = view->style()->isLeftToRightDirection() ? docRect.maxY() : docRect.y();
+ inlineDirectionStart = view->style().isLeftToRightDirection() ? docRect.y() : docRect.maxY();
+ inlineDirectionEnd = view->style().isLeftToRightDirection() ? docRect.maxY() : docRect.y();
}
unsigned pageCount = ceilf((float)docLogicalHeight / pageLogicalHeight);
@@ -180,7 +180,7 @@
bool useViewWidth = true;
if (m_frame->document() && m_frame->document()->renderView())
- useViewWidth = m_frame->document()->renderView()->style()->isHorizontalWritingMode();
+ useViewWidth = m_frame->document()->renderView()->style().isHorizontalWritingMode();
float viewLogicalWidth = useViewWidth ? m_frame->view()->contentsWidth() : m_frame->view()->contentsHeight();
if (viewLogicalWidth < 1)
diff --git a/Source/WebCore/page/SpatialNavigation.cpp b/Source/WebCore/page/SpatialNavigation.cpp
index 93f5ffb..53f7c37 100644
--- a/Source/WebCore/page/SpatialNavigation.cpp
+++ b/Source/WebCore/page/SpatialNavigation.cpp
@@ -459,13 +459,13 @@
switch (direction) {
case FocusDirectionLeft:
- return (container->renderer()->style()->overflowX() != OHIDDEN && container->renderBox()->scrollLeft() > 0);
+ return (container->renderer()->style().overflowX() != OHIDDEN && container->renderBox()->scrollLeft() > 0);
case FocusDirectionUp:
- return (container->renderer()->style()->overflowY() != OHIDDEN && container->renderBox()->scrollTop() > 0);
+ return (container->renderer()->style().overflowY() != OHIDDEN && container->renderBox()->scrollTop() > 0);
case FocusDirectionRight:
- return (container->renderer()->style()->overflowX() != OHIDDEN && container->renderBox()->scrollLeft() + container->renderBox()->clientWidth() < container->renderBox()->scrollWidth());
+ return (container->renderer()->style().overflowX() != OHIDDEN && container->renderBox()->scrollLeft() + container->renderBox()->clientWidth() < container->renderBox()->scrollWidth());
case FocusDirectionDown:
- return (container->renderer()->style()->overflowY() != OHIDDEN && container->renderBox()->scrollTop() + container->renderBox()->clientHeight() < container->renderBox()->scrollHeight());
+ return (container->renderer()->style().overflowY() != OHIDDEN && container->renderBox()->scrollTop() + container->renderBox()->clientHeight() < container->renderBox()->scrollHeight());
default:
ASSERT_NOT_REACHED();
return false;
@@ -527,9 +527,9 @@
// For authors that use border instead of outline in their CSS, we compensate by ignoring the border when calculating
// the rect of the focused element.
if (ignoreBorder) {
- rect.move(node->renderer()->style()->borderLeftWidth(), node->renderer()->style()->borderTopWidth());
- rect.setWidth(rect.width() - node->renderer()->style()->borderLeftWidth() - node->renderer()->style()->borderRightWidth());
- rect.setHeight(rect.height() - node->renderer()->style()->borderTopWidth() - node->renderer()->style()->borderBottomWidth());
+ rect.move(node->renderer()->style().borderLeftWidth(), node->renderer()->style().borderTopWidth());
+ rect.setWidth(rect.width() - node->renderer()->style().borderLeftWidth() - node->renderer()->style().borderRightWidth());
+ rect.setHeight(rect.height() - node->renderer()->style().borderTopWidth() - node->renderer()->style().borderBottomWidth());
}
return rect;
}
@@ -707,8 +707,8 @@
for (Node* parentNode = candidate.visibleNode->parentNode(); parentNode; parentNode = parentNode->parentNode()) {
LayoutRect parentRect = nodeRectInAbsoluteCoordinates(parentNode);
if (!candidateRect.intersects(parentRect)) {
- if (((direction == FocusDirectionLeft || direction == FocusDirectionRight) && parentNode->renderer()->style()->overflowX() == OHIDDEN)
- || ((direction == FocusDirectionUp || direction == FocusDirectionDown) && parentNode->renderer()->style()->overflowY() == OHIDDEN))
+ if (((direction == FocusDirectionLeft || direction == FocusDirectionRight) && parentNode->renderer()->style().overflowX() == OHIDDEN)
+ || ((direction == FocusDirectionUp || direction == FocusDirectionDown) && parentNode->renderer()->style().overflowY() == OHIDDEN))
return false;
}
if (parentNode == candidate.enclosingScrollableBox)
diff --git a/Source/WebCore/page/animation/AnimationController.cpp b/Source/WebCore/page/animation/AnimationController.cpp
index dbeb78c..1f6ad4e 100644
--- a/Source/WebCore/page/animation/AnimationController.cpp
+++ b/Source/WebCore/page/animation/AnimationController.cpp
@@ -368,11 +368,11 @@
const CompositeAnimation* rendererAnimations = m_compositeAnimations.get(renderer);
if (!rendererAnimations)
- return renderer->style();
+ return &renderer->style();
RefPtr<RenderStyle> animatingStyle = rendererAnimations->getAnimatedStyle();
if (!animatingStyle)
- animatingStyle = renderer->style();
+ animatingStyle = &renderer->style();
return animatingStyle.release();
}
@@ -495,7 +495,7 @@
if (renderer.document().inPageCache())
return newStyle;
- RenderStyle* oldStyle = renderer.hasInitializedStyle() ? renderer.style() : nullptr;
+ RenderStyle* oldStyle = renderer.hasInitializedStyle() ? &renderer.style() : nullptr;
if ((!oldStyle || (!oldStyle->animations() && !oldStyle->transitions())) && (!newStyle.get().animations() && !newStyle.get().transitions()))
return newStyle;
diff --git a/Source/WebCore/page/animation/CSSPropertyAnimation.cpp b/Source/WebCore/page/animation/CSSPropertyAnimation.cpp
index f9a1aa4..73b9602 100644
--- a/Source/WebCore/page/animation/CSSPropertyAnimation.cpp
+++ b/Source/WebCore/page/animation/CSSPropertyAnimation.cpp
@@ -217,7 +217,7 @@
RefPtr<StyleCachedImage> styledImage = StyleCachedImage::create(image);
RefPtr<CSSImageValue> imageValue = CSSImageValue::create(image->url(), styledImage.get());
- RefPtr<CSSValue> filterValue = ComputedStyleExtractor::valueForFilter(anim->renderer(), anim->renderer()->style(), filterResult, DoNotAdjustPixelValues);
+ RefPtr<CSSValue> filterValue = ComputedStyleExtractor::valueForFilter(anim->renderer(), &anim->renderer()->style(), filterResult, DoNotAdjustPixelValues);
RefPtr<CSSFilterImageValue> result = CSSFilterImageValue::create(imageValue, filterValue);
result->setFilterOperations(filterResult);
diff --git a/Source/WebCore/page/animation/KeyframeAnimation.cpp b/Source/WebCore/page/animation/KeyframeAnimation.cpp
index 27c5143..67c5688 100644
--- a/Source/WebCore/page/animation/KeyframeAnimation.cpp
+++ b/Source/WebCore/page/animation/KeyframeAnimation.cpp
@@ -207,7 +207,7 @@
return;
if (!animatedStyle)
- animatedStyle = RenderStyle::clone(m_object->style());
+ animatedStyle = RenderStyle::clone(&m_object->style());
HashSet<CSSPropertyID>::const_iterator endProperties = m_keyframes.endProperties();
for (HashSet<CSSPropertyID>::const_iterator it = m_keyframes.beginProperties(); it != endProperties; ++it) {
diff --git a/Source/WebCore/platform/efl/RenderThemeEfl.cpp b/Source/WebCore/platform/efl/RenderThemeEfl.cpp
index 1a77090..5aae253 100755
--- a/Source/WebCore/platform/efl/RenderThemeEfl.cpp
+++ b/Source/WebCore/platform/efl/RenderThemeEfl.cpp
@@ -337,7 +337,7 @@
// grows from the end of the slider or from the beginning. On vertical
// sliders, it should always be the same and will not be affected by
// text direction settings.
- if (object->style()->direction() == RTL || type == SliderVertical)
+ if (object->style().direction() == RTL || type == SliderVertical)
msg->val[0] = 1;
else
msg->val[0] = 0;
@@ -354,7 +354,7 @@
OwnPtr<Edje_Message_Float_Set> msg = adoptPtr(static_cast<Edje_Message_Float_Set*>(::operator new (sizeof(Edje_Message_Float_Set) + sizeof(double))));
msg->count = 2;
- if (object->style()->direction() == RTL)
+ if (object->style().direction() == RTL)
msg->val[0] = (1.0 - value) * max;
else
msg->val[0] = 0;
@@ -380,7 +380,7 @@
if (!entry)
return false;
- bool haveBackgroundColor = isControlStyled(object->style(), object->style()->border(), *object->style()->backgroundLayers(), Color::white);
+ bool haveBackgroundColor = isControlStyled(&object->style(), object->style().border(), *object->style().backgroundLayers(), Color::white);
applyEdjeStateFromForm(entry->edje(), controlStatesForRenderer(object), haveBackgroundColor);
applyEdjeRTLState(entry->edje(), object, type, rect);
@@ -661,8 +661,8 @@
if (!object->isBox())
return 0;
- if (object->style()->appearance() == CheckboxPart
- || object->style()->appearance() == RadioPart)
+ if (object->style().appearance() == CheckboxPart
+ || object->style().appearance() == RadioPart)
return toRenderBox(object)->marginTop() + toRenderBox(object)->height() - 3;
return RenderTheme::baselinePosition(object);
@@ -706,7 +706,7 @@
bool RenderThemeEfl::paintSliderTrack(RenderObject* object, const PaintInfo& info, const IntRect& rect)
{
- if (object->style()->appearance() == SliderHorizontalPart)
+ if (object->style().appearance() == SliderHorizontalPart)
paintThemePart(object, SliderHorizontal, info, rect);
else
paintThemePart(object, SliderVertical, info, rect);
@@ -782,7 +782,7 @@
bool RenderThemeEfl::paintSliderThumb(RenderObject* object, const PaintInfo& info, const IntRect& rect)
{
- if (object->style()->appearance() == SliderThumbHorizontalPart)
+ if (object->style().appearance() == SliderThumbHorizontalPart)
paintThemePart(object, SliderThumbHorizontal, info, rect);
else
paintThemePart(object, SliderThumbVertical, info, rect);
@@ -1193,7 +1193,7 @@
context->fillRect(FloatRect(IntRect(rect.x(), rect.y() + (rect.height() - mediaSliderHeight) / 2,
rect.width(), mediaSliderHeight)), m_mediaSliderColor, ColorSpaceDeviceRGB);
- RenderStyle* style = object->style();
+ RenderStyle* style = &object->style();
HTMLMediaElement* mediaElement = parentMediaElement(*object);
if (!mediaElement)
diff --git a/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp b/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp
index 07dcbda..556c85d 100644
--- a/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp
+++ b/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp
@@ -43,7 +43,7 @@
public:
static bool isNeeded(RenderText* text, const Font& font)
{
- TextRun run = RenderBlock::constructTextRun(text, font, text, *text->style());
+ TextRun run = RenderBlock::constructTextRun(text, font, text, text->style());
return font.codePath(run) == Font::Complex;
}
@@ -68,7 +68,7 @@
private:
static TextRun constructTextRun(RenderText* text, const Font& font, float xPos)
{
- TextRun run = RenderBlock::constructTextRun(text, font, text, *text->style());
+ TextRun run = RenderBlock::constructTextRun(text, font, text, text->style());
run.setCharactersLength(text->textLength());
ASSERT(run.charactersLength() >= run.length());
diff --git a/Source/WebCore/platform/gtk/RenderThemeGtk.cpp b/Source/WebCore/platform/gtk/RenderThemeGtk.cpp
index 75231f6..bb4dddd 100644
--- a/Source/WebCore/platform/gtk/RenderThemeGtk.cpp
+++ b/Source/WebCore/platform/gtk/RenderThemeGtk.cpp
@@ -166,8 +166,8 @@
return 0;
// FIXME: This strategy is possibly incorrect for the GTK+ port.
- if (o->style()->appearance() == CheckboxPart
- || o->style()->appearance() == RadioPart) {
+ if (o->style().appearance() == CheckboxPart
+ || o->style().appearance() == RadioPart) {
const RenderBox* box = toRenderBox(o);
return box->marginTop() + box->height() - 2;
}
@@ -335,7 +335,7 @@
return false;
GRefPtr<GdkPixbuf> icon = getStockIconForWidgetType(GTK_TYPE_ENTRY, GTK_STOCK_FIND,
- gtkTextDirection(renderObject->style()->direction()),
+ gtkTextDirection(renderObject->style().direction()),
gtkIconState(this, renderObject),
getIconSizeForPixelSize(rect.height()));
paintGdkPixbuf(paintInfo.context, icon.get(), iconRect);
@@ -354,7 +354,7 @@
return false;
GRefPtr<GdkPixbuf> icon = getStockIconForWidgetType(GTK_TYPE_ENTRY, GTK_STOCK_CLEAR,
- gtkTextDirection(renderObject->style()->direction()),
+ gtkTextDirection(renderObject->style().direction()),
gtkIconState(this, renderObject),
getIconSizeForPixelSize(rect.height()));
paintGdkPixbuf(paintInfo.context, icon.get(), iconRect);
@@ -382,7 +382,7 @@
int iconSize = std::min(rect.width(), rect.height());
GRefPtr<GdkPixbuf> icon = getStockIconForWidgetType(GTK_TYPE_ENTRY, GTK_STOCK_CAPS_LOCK_WARNING,
- gtkTextDirection(renderObject->style()->direction()),
+ gtkTextDirection(renderObject->style().direction()),
0, getIconSizeForPixelSize(iconSize));
// Only re-scale the icon when it's smaller than the minimum icon size.
@@ -493,7 +493,7 @@
rect.y() + (rect.height() - m_mediaIconSize) / 2,
m_mediaIconSize, m_mediaIconSize);
GRefPtr<GdkPixbuf> icon = getStockSymbolicIconForWidgetType(GTK_TYPE_CONTAINER, symbolicIconName, fallbackStockIconName,
- gtkTextDirection(renderObject->style()->direction()), gtkIconState(this, renderObject), iconRect.width());
+ gtkTextDirection(renderObject->style().direction()), gtkIconState(this, renderObject), iconRect.width());
paintGdkPixbuf(context, icon.get(), iconRect);
return false;
}
@@ -565,7 +565,7 @@
float mediaDuration = mediaElement->duration();
float totalTrackWidth = r.width();
- RenderStyle* style = o->style();
+ RenderStyle* style = &o->style();
RefPtr<TimeRanges> timeRanges = mediaElement->buffered();
for (unsigned index = 0; index < timeRanges->length(); ++index) {
float start = timeRanges->start(index, IGNORE_EXCEPTION);
@@ -588,7 +588,7 @@
bool RenderThemeGtk::paintMediaSliderThumb(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
{
- RenderStyle* style = o->style();
+ RenderStyle* style = &o->style();
paintInfo.context->fillRoundedRect(RoundedRect(r, borderRadiiFromStyle(style)), style->visitedDependentColor(CSSPropertyColor), style->colorSpace());
return false;
}
@@ -614,7 +614,7 @@
int rectHeight = rect.height();
float trackHeight = rectHeight * volume;
- RenderStyle* style = renderObject->style();
+ RenderStyle* style = &renderObject->style();
IntRect volumeRect(rect);
volumeRect.move(0, rectHeight - trackHeight);
volumeRect.setHeight(ceil(trackHeight));
@@ -668,7 +668,7 @@
RenderProgress* renderProgress = toRenderProgress(renderObject);
if (renderProgress->isDeterminate()) {
int progressWidth = progressRect.width() * renderProgress->position();
- if (renderObject->style()->direction() == RTL)
+ if (renderObject->style().direction() == RTL)
progressRect.setX(progressRect.x() + progressRect.width() - progressWidth);
progressRect.setWidth(progressWidth);
return progressRect;
diff --git a/Source/WebCore/platform/gtk/RenderThemeGtk2.cpp b/Source/WebCore/platform/gtk/RenderThemeGtk2.cpp
index 832c2d2..df19da9 100644
--- a/Source/WebCore/platform/gtk/RenderThemeGtk2.cpp
+++ b/Source/WebCore/platform/gtk/RenderThemeGtk2.cpp
@@ -112,7 +112,7 @@
void RenderThemeGtk::adjustRepaintRect(const RenderObject* renderObject, IntRect& rect)
{
- ControlPart part = renderObject->style()->appearance();
+ ControlPart part = renderObject->style().appearance();
switch (part) {
case CheckboxPart:
case RadioPart: {
@@ -163,7 +163,7 @@
// checked state. Every GTK+ theme I tested merely looks at the shadow type (and not the
// 'active' property) to determine whether or not to draw the check.
gtk_widget_set_sensitive(widget, theme->isEnabled(renderObject) && !theme->isReadOnlyControl(renderObject));
- gtk_widget_set_direction(widget, gtkTextDirection(renderObject->style()->direction()));
+ gtk_widget_set_direction(widget, gtkTextDirection(renderObject->style().direction()));
bool indeterminate = theme->isIndeterminate(renderObject);
gtk_toggle_button_set_inconsistent(GTK_TOGGLE_BUTTON(widget), indeterminate);
@@ -238,7 +238,7 @@
GtkStateType state = getGtkStateType(this, object);
gtk_widget_set_state(widget, state);
- gtk_widget_set_direction(widget, gtkTextDirection(object->style()->direction()));
+ gtk_widget_set_direction(widget, gtkTextDirection(object->style().direction()));
if (isFocused(object)) {
setWidgetHasFocus(widget, TRUE);
@@ -378,7 +378,7 @@
int leftBorder = 0, rightBorder = 0, bottomBorder = 0, topBorder = 0;
getButtonInnerBorder(gtkComboBoxButton(), leftBorder, topBorder, rightBorder, bottomBorder);
- RenderStyle* style = object->style();
+ RenderStyle* style = &object->style();
int arrowSize = comboBoxArrowSize(style);
GtkStyle* buttonStyle = gtk_widget_get_style(gtkComboBoxButton());
@@ -429,7 +429,7 @@
bool enabled = isEnabled(renderObject) && !isReadOnlyControl(renderObject);
GtkStateType backgroundState = enabled ? GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE;
gtk_widget_set_sensitive(widget, enabled);
- gtk_widget_set_direction(widget, gtkTextDirection(renderObject->style()->direction()));
+ gtk_widget_set_direction(widget, gtkTextDirection(renderObject->style().direction()));
setWidgetHasFocus(widget, isFocused(renderObject));
WidgetRenderingContext widgetContext(info.context, rect);
@@ -470,7 +470,7 @@
if (info.context->paintingDisabled())
return false;
- ControlPart part = object->style()->appearance();
+ ControlPart part = object->style().appearance();
ASSERT(part == SliderHorizontalPart || part == SliderVerticalPart || part == MediaVolumeSliderPart);
// We shrink the trough rect slightly to make room for the focus indicator.
@@ -483,7 +483,7 @@
widget = gtkVScale();
troughRect.inflateY(-gtk_widget_get_style(widget)->ythickness);
}
- gtk_widget_set_direction(widget, gtkTextDirection(object->style()->direction()));
+ gtk_widget_set_direction(widget, gtkTextDirection(object->style().direction()));
WidgetRenderingContext widgetContext(info.context, rect);
widgetContext.gtkPaintBox(troughRect, widget, GTK_STATE_ACTIVE, GTK_SHADOW_OUT, "trough");
@@ -498,7 +498,7 @@
if (info.context->paintingDisabled())
return false;
- ControlPart part = object->style()->appearance();
+ ControlPart part = object->style().appearance();
ASSERT(part == SliderThumbHorizontalPart || part == SliderThumbVerticalPart || part == MediaVolumeSliderThumbPart);
GtkWidget* widget = 0;
@@ -513,7 +513,7 @@
detail = "vscale";
orientation = GTK_ORIENTATION_VERTICAL;
}
- gtk_widget_set_direction(widget, gtkTextDirection(object->style()->direction()));
+ gtk_widget_set_direction(widget, gtkTextDirection(object->style().direction()));
// Only some themes have slider thumbs respond to clicks and some don't. This information is
// gathered via the 'activate-slider' property, but it's deprecated in GTK+ 2.22 and removed in
@@ -552,7 +552,7 @@
bool RenderThemeGtk::paintProgressBar(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
{
GtkWidget* widget = gtkProgressBar();
- gtk_widget_set_direction(widget, gtkTextDirection(renderObject->style()->direction()));
+ gtk_widget_set_direction(widget, gtkTextDirection(renderObject->style().direction()));
WidgetRenderingContext widgetContext(paintInfo.context, rect);
IntRect fullProgressBarRect(IntPoint(), rect.size());
@@ -597,7 +597,7 @@
WidgetRenderingContext widgetContext(paintInfo.context, expandedRect);
GtkWidget* widget = gtkSpinButton();
- gtk_widget_set_direction(widget, gtkTextDirection(renderObject->style()->direction()));
+ gtk_widget_set_direction(widget, gtkTextDirection(renderObject->style().direction()));
IntRect fullSpinButtonRect(IntPoint(), expandedRect.size());
widgetContext.gtkPaintBox(fullSpinButtonRect, widget, GTK_STATE_NORMAL, GTK_SHADOW_IN, "spinbutton");
diff --git a/Source/WebCore/platform/gtk/RenderThemeGtk3.cpp b/Source/WebCore/platform/gtk/RenderThemeGtk3.cpp
index 2528773..b7a0554 100644
--- a/Source/WebCore/platform/gtk/RenderThemeGtk3.cpp
+++ b/Source/WebCore/platform/gtk/RenderThemeGtk3.cpp
@@ -161,7 +161,7 @@
{
GtkStyleContext* context = 0;
bool checkInteriorFocus = false;
- ControlPart part = renderObject->style()->appearance();
+ ControlPart part = renderObject->style().appearance();
switch (part) {
case CheckboxPart:
case RadioPart:
@@ -242,7 +242,7 @@
rect.setHeight(indicatorSize); // In case rect.height() was equal to indicatorSize + 1.
}
- gtk_style_context_set_direction(context, static_cast<GtkTextDirection>(gtkTextDirection(renderObject->style()->direction())));
+ gtk_style_context_set_direction(context, static_cast<GtkTextDirection>(gtkTextDirection(renderObject->style().direction())));
gtk_style_context_add_class(context, widgetType == GTK_TYPE_CHECK_BUTTON ? GTK_STYLE_CLASS_CHECK : GTK_STYLE_CLASS_RADIO);
guint flags = 0;
@@ -368,7 +368,7 @@
GtkStyleContext* context = getStyleContext(GTK_TYPE_BUTTON);
gtk_style_context_save(context);
- gtk_style_context_set_direction(context, static_cast<GtkTextDirection>(gtkTextDirection(renderObject->style()->direction())));
+ gtk_style_context_set_direction(context, static_cast<GtkTextDirection>(gtkTextDirection(renderObject->style().direction())));
gtk_style_context_add_class(context, GTK_STYLE_CLASS_BUTTON);
renderButton(this, context, renderObject, paintInfo, rect);
@@ -467,7 +467,7 @@
bool RenderThemeGtk::paintMenuList(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
{
cairo_t* cairoContext = paintInfo.context->platformContext()->cr();
- GtkTextDirection direction = static_cast<GtkTextDirection>(gtkTextDirection(renderObject->style()->direction()));
+ GtkTextDirection direction = static_cast<GtkTextDirection>(gtkTextDirection(renderObject->style().direction()));
// Paint the button.
GtkStyleContext* buttonStyleContext = getStyleContext(GTK_TYPE_BUTTON);
@@ -600,7 +600,7 @@
GtkStyleContext* context = getStyleContext(GTK_TYPE_ENTRY);
gtk_style_context_save(context);
- gtk_style_context_set_direction(context, static_cast<GtkTextDirection>(gtkTextDirection(renderObject->style()->direction())));
+ gtk_style_context_set_direction(context, static_cast<GtkTextDirection>(gtkTextDirection(renderObject->style().direction())));
gtk_style_context_add_class(context, GTK_STYLE_CLASS_ENTRY);
guint flags = 0;
@@ -645,13 +645,13 @@
bool RenderThemeGtk::paintSliderTrack(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
{
- ControlPart part = renderObject->style()->appearance();
+ ControlPart part = renderObject->style().appearance();
ASSERT_UNUSED(part, part == SliderHorizontalPart || part == SliderVerticalPart || part == MediaVolumeSliderPart);
GtkStyleContext* context = getStyleContext(GTK_TYPE_SCALE);
gtk_style_context_save(context);
- gtk_style_context_set_direction(context, gtkTextDirection(renderObject->style()->direction()));
+ gtk_style_context_set_direction(context, gtkTextDirection(renderObject->style().direction()));
applySliderStyleContextClasses(context, part);
gtk_style_context_add_class(context, GTK_STYLE_CLASS_TROUGH);
@@ -680,13 +680,13 @@
bool RenderThemeGtk::paintSliderThumb(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
{
- ControlPart part = renderObject->style()->appearance();
+ ControlPart part = renderObject->style().appearance();
ASSERT(part == SliderThumbHorizontalPart || part == SliderThumbVerticalPart || part == MediaVolumeSliderThumbPart);
GtkStyleContext* context = getStyleContext(GTK_TYPE_SCALE);
gtk_style_context_save(context);
- gtk_style_context_set_direction(context, gtkTextDirection(renderObject->style()->direction()));
+ gtk_style_context_set_direction(context, gtkTextDirection(renderObject->style().direction()));
applySliderStyleContextClasses(context, part);
gtk_style_context_add_class(context, GTK_STYLE_CLASS_SLIDER);
@@ -857,7 +857,7 @@
GtkStyleContext* context = getStyleContext(GTK_TYPE_SPIN_BUTTON);
gtk_style_context_save(context);
- GtkTextDirection direction = static_cast<GtkTextDirection>(gtkTextDirection(renderObject->style()->direction()));
+ GtkTextDirection direction = static_cast<GtkTextDirection>(gtkTextDirection(renderObject->style().direction()));
gtk_style_context_set_direction(context, direction);
guint flags = 0;
diff --git a/Source/WebCore/platform/mac/HTMLConverter.mm b/Source/WebCore/platform/mac/HTMLConverter.mm
index d13678e..55d57b3 100644
--- a/Source/WebCore/platform/mac/HTMLConverter.mm
+++ b/Source/WebCore/platform/mac/HTMLConverter.mm
@@ -2487,21 +2487,21 @@
ASSERT(renderer);
if (!renderer)
continue;
- RenderStyle* style = renderer->style();
- if (style->textDecorationsInEffect() & TextDecorationUnderline)
+ const RenderStyle& style = renderer->style();
+ if (style.textDecorationsInEffect() & TextDecorationUnderline)
[attrs.get() setObject:[NSNumber numberWithInteger:NSUnderlineStyleSingle] forKey:NSUnderlineStyleAttributeName];
- if (style->textDecorationsInEffect() & TextDecorationLineThrough)
+ if (style.textDecorationsInEffect() & TextDecorationLineThrough)
[attrs.get() setObject:[NSNumber numberWithInteger:NSUnderlineStyleSingle] forKey:NSStrikethroughStyleAttributeName];
- if (NSFont *font = style->font().primaryFont()->getNSFont())
+ if (NSFont *font = style.font().primaryFont()->getNSFont())
[attrs.get() setObject:font forKey:NSFontAttributeName];
else
- [attrs.get() setObject:[fontManager convertFont:WebDefaultFont() toSize:style->font().primaryFont()->platformData().size()] forKey:NSFontAttributeName];
- if (style->visitedDependentColor(CSSPropertyColor).alpha())
- [attrs.get() setObject:nsColor(style->visitedDependentColor(CSSPropertyColor)) forKey:NSForegroundColorAttributeName];
+ [attrs.get() setObject:[fontManager convertFont:WebDefaultFont() toSize:style.font().primaryFont()->platformData().size()] forKey:NSFontAttributeName];
+ if (style.visitedDependentColor(CSSPropertyColor).alpha())
+ [attrs.get() setObject:nsColor(style.visitedDependentColor(CSSPropertyColor)) forKey:NSForegroundColorAttributeName];
else
[attrs.get() removeObjectForKey:NSForegroundColorAttributeName];
- if (style->visitedDependentColor(CSSPropertyBackgroundColor).alpha())
- [attrs.get() setObject:nsColor(style->visitedDependentColor(CSSPropertyBackgroundColor)) forKey:NSBackgroundColorAttributeName];
+ if (style.visitedDependentColor(CSSPropertyBackgroundColor).alpha())
+ [attrs.get() setObject:nsColor(style.visitedDependentColor(CSSPropertyBackgroundColor)) forKey:NSBackgroundColorAttributeName];
else
[attrs.get() removeObjectForKey:NSBackgroundColorAttributeName];
diff --git a/Source/WebCore/rendering/AutoTableLayout.cpp b/Source/WebCore/rendering/AutoTableLayout.cpp
index cd11f25..95c63fd 100644
--- a/Source/WebCore/rendering/AutoTableLayout.cpp
+++ b/Source/WebCore/rendering/AutoTableLayout.cpp
@@ -65,7 +65,7 @@
if (current.inColSpan || !cell)
continue;
- bool cellHasContent = cell->firstChild() || cell->style()->hasBorder() || cell->style()->hasPadding();
+ bool cellHasContent = cell->firstChild() || cell->style().hasBorder() || cell->style().hasPadding();
if (cellHasContent)
columnLayout.emptyCellsOnly = false;
@@ -154,9 +154,9 @@
unsigned currentColumn = 0;
for (RenderTableCol* column = m_table->firstColumn(); column; column = column->nextColumn()) {
if (column->isTableColumnGroupWithColumnChildren())
- groupLogicalWidth = column->style()->logicalWidth();
+ groupLogicalWidth = column->style().logicalWidth();
else {
- Length colLogicalWidth = column->style()->logicalWidth();
+ Length colLogicalWidth = column->style().logicalWidth();
if (colLogicalWidth.isAuto())
colLogicalWidth = groupLogicalWidth;
if ((colLogicalWidth.isFixed() || colLogicalWidth.isPercent()) && colLogicalWidth.isZero())
@@ -187,18 +187,18 @@
// a cell, then don't bloat the maxwidth by examining percentage growth.
bool scale = true;
while (table) {
- Length tw = table->style()->width();
+ Length tw = table->style().width();
if ((tw.isAuto() || tw.isPercent()) && !table->isOutOfFlowPositioned()) {
RenderBlock* cb = table->containingBlock();
while (cb && !cb->isRenderView() && !cb->isTableCell() &&
- cb->style()->width().isAuto() && !cb->isOutOfFlowPositioned())
+ cb->style().width().isAuto() && !cb->isOutOfFlowPositioned())
cb = cb->containingBlock();
table = 0;
if (cb && cb->isTableCell() &&
- (cb->style()->width().isAuto() || cb->style()->width().isPercent())) {
+ (cb->style().width().isAuto() || cb->style().width().isPercent())) {
RenderTableCell* cell = toRenderTableCell(cb);
- if (cell->colSpan() > 1 || cell->table()->style()->width().isAuto())
+ if (cell->colSpan() > 1 || cell->table()->style().width().isAuto())
scale = false;
else
table = cell->table();
@@ -251,7 +251,7 @@
void AutoTableLayout::applyPreferredLogicalWidthQuirks(LayoutUnit& minWidth, LayoutUnit& maxWidth) const
{
- Length tableLogicalWidth = m_table->style()->logicalWidth();
+ Length tableLogicalWidth = m_table->style().logicalWidth();
if (tableLogicalWidth.isFixed() && tableLogicalWidth.isPositive())
minWidth = maxWidth = max<int>(minWidth, tableLogicalWidth.value());
}
diff --git a/Source/WebCore/rendering/EllipsisBox.cpp b/Source/WebCore/rendering/EllipsisBox.cpp
index b3b7497..4e34317 100644
--- a/Source/WebCore/rendering/EllipsisBox.cpp
+++ b/Source/WebCore/rendering/EllipsisBox.cpp
@@ -89,7 +89,7 @@
// If the last line-box on the last line of a block is a link, -webkit-line-clamp paints that box after the ellipsis.
// It does not actually move the link.
InlineBox* anchorBox = lastLine->lastChild();
- if (!anchorBox || !anchorBox->renderer().style()->isLink())
+ if (!anchorBox || !anchorBox->renderer().style().isLink())
return 0;
return anchorBox;
diff --git a/Source/WebCore/rendering/FilterEffectRenderer.cpp b/Source/WebCore/rendering/FilterEffectRenderer.cpp
index a8804f2..ad9ceb5 100644
--- a/Source/WebCore/rendering/FilterEffectRenderer.cpp
+++ b/Source/WebCore/rendering/FilterEffectRenderer.cpp
@@ -512,7 +512,7 @@
LayoutRect destRect = filter->outputRect();
destRect.move(m_paintOffset.x(), m_paintOffset.y());
- destinationContext->drawImageBuffer(filter->output(), m_renderLayer->renderer().style()->colorSpace(), pixelSnappedIntRect(destRect), CompositeSourceOver);
+ destinationContext->drawImageBuffer(filter->output(), m_renderLayer->renderer().style().colorSpace(), pixelSnappedIntRect(destRect), CompositeSourceOver);
filter->clearIntermediateResults();
}
diff --git a/Source/WebCore/rendering/FixedTableLayout.cpp b/Source/WebCore/rendering/FixedTableLayout.cpp
index 2af4d0f..e4447ae 100644
--- a/Source/WebCore/rendering/FixedTableLayout.cpp
+++ b/Source/WebCore/rendering/FixedTableLayout.cpp
@@ -98,7 +98,7 @@
if (col->isTableColumnGroupWithColumnChildren())
continue;
- Length colStyleLogicalWidth = col->style()->logicalWidth();
+ Length colStyleLogicalWidth = col->style().logicalWidth();
int effectiveColWidth = 0;
if (colStyleLogicalWidth.isFixed() && colStyleLogicalWidth.value() > 0)
effectiveColWidth = colStyleLogicalWidth.value();
@@ -178,7 +178,7 @@
void FixedTableLayout::applyPreferredLogicalWidthQuirks(LayoutUnit& minWidth, LayoutUnit& maxWidth) const
{
- Length tableLogicalWidth = m_table->style()->logicalWidth();
+ Length tableLogicalWidth = m_table->style().logicalWidth();
if (tableLogicalWidth.isFixed() && tableLogicalWidth.isPositive())
minWidth = maxWidth = max<int>(minWidth, tableLogicalWidth.value() - m_table->bordersPaddingAndSpacingInRowDirection());
@@ -194,7 +194,7 @@
// In this example, the two inner tables should be as large as the outer table.
// We can achieve this effect by making the maxwidth of fixed tables with percentage
// widths be infinite.
- if (m_table->style()->logicalWidth().isPercent() && maxWidth < tableMaxWidth)
+ if (m_table->style().logicalWidth().isPercent() && maxWidth < tableMaxWidth)
maxWidth = tableMaxWidth;
}
diff --git a/Source/WebCore/rendering/FloatingObjects.cpp b/Source/WebCore/rendering/FloatingObjects.cpp
index a4adfe1..01146dc 100644
--- a/Source/WebCore/rendering/FloatingObjects.cpp
+++ b/Source/WebCore/rendering/FloatingObjects.cpp
@@ -53,7 +53,7 @@
, m_isInPlacedTree(false)
#endif
{
- EFloat type = renderer.style()->floating();
+ EFloat type = renderer.style().floating();
ASSERT(type != NoFloat);
if (type == LeftFloat)
m_type = FloatLeft;
diff --git a/Source/WebCore/rendering/FlowThreadController.cpp b/Source/WebCore/rendering/FlowThreadController.cpp
index 32528d5..e8101ae 100644
--- a/Source/WebCore/rendering/FlowThreadController.cpp
+++ b/Source/WebCore/rendering/FlowThreadController.cpp
@@ -75,7 +75,7 @@
// Sanity check for the absence of a named flow in the "CREATED" state with the same name.
ASSERT(!namedFlows->flowByName(name));
- auto flowRenderer = new RenderNamedFlowThread(m_view->document(), RenderFlowThread::createFlowThreadStyle(m_view->style()), namedFlows->ensureFlowWithName(name));
+ auto flowRenderer = new RenderNamedFlowThread(m_view->document(), RenderFlowThread::createFlowThreadStyle(&m_view->style()), namedFlows->ensureFlowWithName(name));
flowRenderer->initializeStyle();
m_renderNamedFlowThreadList->add(flowRenderer);
@@ -89,10 +89,10 @@
void FlowThreadController::styleDidChange()
{
- RenderStyle* viewStyle = m_view->style();
+ RenderStyle& viewStyle = m_view->style();
for (RenderNamedFlowThreadList::iterator iter = m_renderNamedFlowThreadList->begin(); iter != m_renderNamedFlowThreadList->end(); ++iter) {
RenderNamedFlowThread* flowRenderer = *iter;
- flowRenderer->setStyle(RenderFlowThread::createFlowThreadStyle(viewStyle));
+ flowRenderer->setStyle(RenderFlowThread::createFlowThreadStyle(&viewStyle));
}
}
diff --git a/Source/WebCore/rendering/HitTestResult.cpp b/Source/WebCore/rendering/HitTestResult.cpp
index 24f8727..62925e8 100644
--- a/Source/WebCore/rendering/HitTestResult.cpp
+++ b/Source/WebCore/rendering/HitTestResult.cpp
@@ -201,7 +201,7 @@
return String();
if (auto renderer = m_innerNonSharedNode->renderer())
- dir = renderer->style()->direction();
+ dir = renderer->style().direction();
return marker->description();
}
@@ -229,7 +229,7 @@
String title = toElement(titleNode)->title();
if (!title.isEmpty()) {
if (auto renderer = titleNode->renderer())
- dir = renderer->style()->direction();
+ dir = renderer->style().direction();
return title;
}
}
@@ -246,10 +246,10 @@
if (auto renderer = toElement(truncatedNode)->renderer()) {
if (renderer->isRenderBlockFlow()) {
RenderBlockFlow* block = toRenderBlockFlow(renderer);
- if (block->style()->textOverflow()) {
+ if (block->style().textOverflow()) {
for (RootInlineBox* line = block->firstRootBox(); line; line = line->nextRootBox()) {
if (line->hasEllipsisBox()) {
- dir = block->style()->direction();
+ dir = block->style().direction();
return toElement(truncatedNode)->innerText();
}
}
diff --git a/Source/WebCore/rendering/ImageQualityController.cpp b/Source/WebCore/rendering/ImageQualityController.cpp
index cce3e1d..fd6c5dd 100644
--- a/Source/WebCore/rendering/ImageQualityController.cpp
+++ b/Source/WebCore/rendering/ImageQualityController.cpp
@@ -106,7 +106,7 @@
if (!image || !(image->isBitmapImage() || image->isPDFDocumentImage()) || context->paintingDisabled())
return false;
- switch (object->style()->imageRendering()) {
+ switch (object->style().imageRendering()) {
case ImageRenderingOptimizeSpeed:
case ImageRenderingCrispEdges:
return true;
diff --git a/Source/WebCore/rendering/InlineBox.cpp b/Source/WebCore/rendering/InlineBox.cpp
index f2c82e5..8f2772f 100644
--- a/Source/WebCore/rendering/InlineBox.cpp
+++ b/Source/WebCore/rendering/InlineBox.cpp
@@ -231,7 +231,7 @@
return;
LayoutPoint childPoint = paintOffset;
- if (parent()->renderer().style()->isFlippedBlocksWritingMode() && renderer.isBox()) // Faster than calling containingBlock().
+ if (parent()->renderer().style().isFlippedBlocksWritingMode() && renderer.isBox()) // Faster than calling containingBlock().
childPoint = m_renderer.containingBlock()->flipForWritingModeForChild(&toRenderBox(renderer), childPoint);
// Paint all phases of replaced elements atomically, as though the replaced element established its
@@ -259,7 +259,7 @@
// own stacking context. (See Appendix E.2, section 6.4 on inline block/table elements in the CSS2.1
// specification.)
LayoutPoint childPoint = accumulatedOffset;
- if (parent()->renderer().style()->isFlippedBlocksWritingMode() && !renderer().isLineBreak()) // Faster than calling containingBlock().
+ if (parent()->renderer().style().isFlippedBlocksWritingMode() && !renderer().isLineBreak()) // Faster than calling containingBlock().
childPoint = m_renderer.containingBlock()->flipForWritingModeForChild(&toRenderBox(renderer()), childPoint);
return m_renderer.hitTest(request, result, locationInContainer, childPoint);
@@ -364,10 +364,10 @@
FloatPoint InlineBox::locationIncludingFlipping()
{
- if (!m_renderer.style()->isFlippedBlocksWritingMode())
+ if (!m_renderer.style().isFlippedBlocksWritingMode())
return FloatPoint(x(), y());
RenderBlockFlow& block = root().blockFlow();
- if (block.style()->isHorizontalWritingMode())
+ if (block.style().isHorizontalWritingMode())
return FloatPoint(x(), block.height() - height() - y());
else
return FloatPoint(block.width() - width() - x(), y());
@@ -375,28 +375,28 @@
void InlineBox::flipForWritingMode(FloatRect& rect)
{
- if (!m_renderer.style()->isFlippedBlocksWritingMode())
+ if (!m_renderer.style().isFlippedBlocksWritingMode())
return;
root().blockFlow().flipForWritingMode(rect);
}
FloatPoint InlineBox::flipForWritingMode(const FloatPoint& point)
{
- if (!m_renderer.style()->isFlippedBlocksWritingMode())
+ if (!m_renderer.style().isFlippedBlocksWritingMode())
return point;
return root().blockFlow().flipForWritingMode(point);
}
void InlineBox::flipForWritingMode(LayoutRect& rect)
{
- if (!m_renderer.style()->isFlippedBlocksWritingMode())
+ if (!m_renderer.style().isFlippedBlocksWritingMode())
return;
root().blockFlow().flipForWritingMode(rect);
}
LayoutPoint InlineBox::flipForWritingMode(const LayoutPoint& point)
{
- if (!m_renderer.style()->isFlippedBlocksWritingMode())
+ if (!m_renderer.style().isFlippedBlocksWritingMode())
return point;
return root().blockFlow().flipForWritingMode(point);
}
diff --git a/Source/WebCore/rendering/InlineBox.h b/Source/WebCore/rendering/InlineBox.h
index ae7037a..1e2dad7 100644
--- a/Source/WebCore/rendering/InlineBox.h
+++ b/Source/WebCore/rendering/InlineBox.h
@@ -279,9 +279,9 @@
int expansion() const { return m_bitfields.expansion(); }
- bool visibleToHitTesting() const { return renderer().style()->visibility() == VISIBLE && renderer().style()->pointerEvents() != PE_NONE; }
+ bool visibleToHitTesting() const { return renderer().style().visibility() == VISIBLE && renderer().style().pointerEvents() != PE_NONE; }
- const RenderStyle& lineStyle() const { return m_bitfields.firstLine() ? *renderer().firstLineStyle() : *renderer().style(); }
+ const RenderStyle& lineStyle() const { return m_bitfields.firstLine() ? renderer().firstLineStyle() : renderer().style(); }
EVerticalAlign verticalAlign() const { return lineStyle().verticalAlign(); }
diff --git a/Source/WebCore/rendering/InlineFlowBox.cpp b/Source/WebCore/rendering/InlineFlowBox.cpp
index 8df4604..775fd2e 100644
--- a/Source/WebCore/rendering/InlineFlowBox.cpp
+++ b/Source/WebCore/rendering/InlineFlowBox.cpp
@@ -312,14 +312,14 @@
// The root inline box never has borders/margins/padding.
if (parent()) {
- bool ltr = renderer().style()->isLeftToRightDirection();
+ bool ltr = renderer().style().isLeftToRightDirection();
// Check to see if all initial lines are unconstructed. If so, then
// we know the inline began on this line (unless we are a continuation).
RenderLineBoxList& lineBoxList = rendererLineBoxes();
if (!lineBoxList.firstLineBox()->isConstructed() && !renderer().isInlineElementContinuation()) {
#if ENABLE(CSS_BOX_DECORATION_BREAK)
- if (renderer().style()->boxDecorationBreak() == DCLONE)
+ if (renderer().style().boxDecorationBreak() == DCLONE)
includeLeftEdge = includeRightEdge = true;
else
#endif
@@ -339,7 +339,7 @@
// (3) The logicallyLastRun is a descendant of this renderer, but it is the last child of this renderer and it does not wrap to the next line.
#if ENABLE(CSS_BOX_DECORATION_BREAK)
// (4) The decoration break is set to clone therefore there will be borders on every sides.
- if (renderer().style()->boxDecorationBreak() == DCLONE)
+ if (renderer().style().boxDecorationBreak() == DCLONE)
includeLeftEdge = includeRightEdge = true;
else
#endif
@@ -403,7 +403,7 @@
maxLogicalRight = max(logicalLeft, maxLogicalRight);
} else {
if (curr->renderer().isOutOfFlowPositioned()) {
- if (curr->renderer().parent()->style()->isLeftToRightDirection())
+ if (curr->renderer().parent()->style().isLeftToRightDirection())
curr->setLogicalLeft(logicalLeft);
else
// Our offset that we cache needs to be from the edge of the right border box and
@@ -688,7 +688,7 @@
// Treat the leading on the first and last lines of ruby runs as not being part of the overall lineTop/lineBottom.
// Really this is a workaround hack for the fact that ruby should have been done as line layout and not done using
// inline-block.
- if (renderer().style()->isFlippedLinesWritingMode() == (curr->renderer().style()->rubyPosition() == RubyPositionAfter))
+ if (renderer().style().isFlippedLinesWritingMode() == (curr->renderer().style().rubyPosition() == RubyPositionAfter))
hasAnnotationsBefore = true;
else
hasAnnotationsAfter = true;
@@ -697,7 +697,7 @@
if (RenderRubyBase* rubyBase = rubyRun.rubyBase()) {
LayoutUnit bottomRubyBaseLeading = (curr->logicalHeight() - rubyBase->logicalBottom()) + rubyBase->logicalHeight() - (rubyBase->lastRootBox() ? rubyBase->lastRootBox()->lineBottom() : LayoutUnit());
LayoutUnit topRubyBaseLeading = rubyBase->logicalTop() + (rubyBase->firstRootBox() ? rubyBase->firstRootBox()->lineTop() : LayoutUnit());
- newLogicalTop += !renderer().style()->isFlippedLinesWritingMode() ? topRubyBaseLeading : bottomRubyBaseLeading;
+ newLogicalTop += !renderer().style().isFlippedLinesWritingMode() ? topRubyBaseLeading : bottomRubyBaseLeading;
boxHeight -= (topRubyBaseLeading + bottomRubyBaseLeading);
}
}
@@ -745,7 +745,7 @@
lineBottomIncludingMargins = max(lineBottom, lineBottomIncludingMargins);
}
- if (renderer().style()->isFlippedLinesWritingMode())
+ if (renderer().style().isFlippedLinesWritingMode())
flipLinesInBlockDirection(lineTopIncludingMargins, lineBottomIncludingMargins);
}
}
@@ -921,7 +921,7 @@
// transforms or relative positioning (since those objects always have self-painting layers), but it does need to be adjusted
// for writing-mode differences.
if (!box.hasSelfPaintingLayer()) {
- LayoutRect childLogicalVisualOverflow = box.logicalVisualOverflowRectForPropagation(renderer().style());
+ LayoutRect childLogicalVisualOverflow = box.logicalVisualOverflowRectForPropagation(&renderer().style());
childLogicalVisualOverflow.move(inlineBox->logicalLeft(), inlineBox->logicalTop());
logicalVisualOverflow.unite(childLogicalVisualOverflow);
}
@@ -929,7 +929,7 @@
// Layout overflow internal to the child box only propagates if the child box doesn't have overflow clip set.
// Otherwise the child border box propagates as layout overflow. This rectangle must include transforms and relative positioning
// and be adjusted for writing-mode differences.
- LayoutRect childLogicalLayoutOverflow = box.logicalLayoutOverflowRectForPropagation(renderer().style());
+ LayoutRect childLogicalLayoutOverflow = box.logicalLayoutOverflowRectForPropagation(&renderer().style());
childLogicalLayoutOverflow.move(inlineBox->logicalLeft(), inlineBox->logicalTop());
logicalLayoutOverflow.unite(childLogicalLayoutOverflow);
}
@@ -1063,7 +1063,7 @@
LayoutRect boundsRect(roundedFrameRect());
if (isHorizontal())
- renderer().style()->isLeftToRightDirection() ? boundsRect.shiftXEdgeTo(ellipsisBox->right()) : boundsRect.setWidth(ellipsisBox->left() - left());
+ renderer().style().isLeftToRightDirection() ? boundsRect.shiftXEdgeTo(ellipsisBox->right()) : boundsRect.setWidth(ellipsisBox->left() - left());
else
boundsRect.shiftYEdgeTo(ellipsisBox->right());
@@ -1119,7 +1119,7 @@
if (paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSelfOutline) {
// Add ourselves to the paint info struct's list of inlines that need to paint their
// outlines.
- if (renderer().style()->visibility() == VISIBLE && renderer().hasOutline() && !isRootInlineBox()) {
+ if (renderer().style().visibility() == VISIBLE && renderer().hasOutline() && !isRootInlineBox()) {
RenderInline& inlineFlow = toRenderInline(renderer());
RenderBlock* cb = 0;
@@ -1188,18 +1188,18 @@
// The checks here match how paintFillLayer() decides whether to clip (if it does, the shadow
// would be clipped out, so it has to be drawn separately).
StyleImage* image = lastBackgroundLayer.image();
- bool hasFillImage = image && image->canRender(&renderer(), renderer().style()->effectiveZoom());
- return (!hasFillImage && !renderer().style()->hasBorderRadius()) || (!prevLineBox() && !nextLineBox()) || !parent();
+ bool hasFillImage = image && image->canRender(&renderer(), renderer().style().effectiveZoom());
+ return (!hasFillImage && !renderer().style().hasBorderRadius()) || (!prevLineBox() && !nextLineBox()) || !parent();
}
void InlineFlowBox::paintFillLayer(const PaintInfo& paintInfo, const Color& c, const FillLayer* fillLayer, const LayoutRect& rect, CompositeOperator op)
{
StyleImage* img = fillLayer->image();
- bool hasFillImage = img && img->canRender(&renderer(), renderer().style()->effectiveZoom());
- if ((!hasFillImage && !renderer().style()->hasBorderRadius()) || (!prevLineBox() && !nextLineBox()) || !parent())
+ bool hasFillImage = img && img->canRender(&renderer(), renderer().style().effectiveZoom());
+ if ((!hasFillImage && !renderer().style().hasBorderRadius()) || (!prevLineBox() && !nextLineBox()) || !parent())
boxModelObject()->paintFillLayerExtended(paintInfo, c, fillLayer, rect, BackgroundBleedNone, this, rect.size(), op);
#if ENABLE(CSS_BOX_DECORATION_BREAK)
- else if (renderer().style()->boxDecorationBreak() == DCLONE) {
+ else if (renderer().style().boxDecorationBreak() == DCLONE) {
GraphicsContextStateSaver stateSaver(*paintInfo.context);
paintInfo.context->clip(LayoutRect(rect.x(), rect.y(), width(), height()));
boxModelObject()->paintFillLayerExtended(paintInfo, c, fillLayer, rect, BackgroundBleedNone, this, rect.size(), op);
@@ -1214,7 +1214,7 @@
// the previous line left off.
LayoutUnit logicalOffsetOnLine = 0;
LayoutUnit totalLogicalWidth;
- if (renderer().style()->direction() == LTR) {
+ if (renderer().style().direction() == LTR) {
for (InlineFlowBox* curr = prevLineBox(); curr; curr = curr->prevLineBox())
logicalOffsetOnLine += curr->logicalWidth();
totalLogicalWidth = logicalOffsetOnLine;
@@ -1272,8 +1272,8 @@
static LayoutRect clipRectForNinePieceImageStrip(InlineFlowBox* box, const NinePieceImage& image, const LayoutRect& paintRect)
{
LayoutRect clipRect(paintRect);
- RenderStyle* style = box->renderer().style();
- LayoutBoxExtent outsets = style->imageOutsets(image);
+ RenderStyle& style = box->renderer().style();
+ LayoutBoxExtent outsets = style.imageOutsets(image);
if (box->isHorizontal()) {
clipRect.setY(paintRect.y() - outsets.top());
clipRect.setHeight(paintRect.height() + outsets.top() + outsets.bottom());
@@ -1298,7 +1298,7 @@
void InlineFlowBox::paintBoxDecorations(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
- if (!paintInfo.shouldPaintWithinRoot(renderer()) || renderer().style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseForeground)
+ if (!paintInfo.shouldPaintWithinRoot(renderer()) || renderer().style().visibility() != VISIBLE || paintInfo.phase != PaintPhaseForeground)
return;
// Pixel snap background/border painting.
@@ -1315,7 +1315,7 @@
if (parent() && !renderer().hasBoxDecorations())
return;
const RenderStyle& lineStyle = this->lineStyle();
- if (!parent() && (!isFirstLine() || &lineStyle == renderer().style()))
+ if (!parent() && (!isFirstLine() || &lineStyle == &renderer().style()))
return;
LayoutPoint adjustedPaintoffset = paintOffset + localRect.location();
@@ -1331,9 +1331,9 @@
// :first-line cannot be used to put borders on a line. Always paint borders with our
// non-first-line style.
- if (!parent() || !renderer().style()->hasBorder())
+ if (!parent() || !renderer().style().hasBorder())
return;
- const NinePieceImage& borderImage = renderer().style()->borderImage();
+ const NinePieceImage& borderImage = renderer().style().borderImage();
StyleImage* borderImageSource = borderImage.image();
bool hasBorderImage = borderImageSource && borderImageSource->canRender(&renderer(), lineStyle.effectiveZoom());
if (hasBorderImage && !borderImageSource->isLoaded())
@@ -1372,7 +1372,7 @@
void InlineFlowBox::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
- if (!paintInfo.shouldPaintWithinRoot(renderer()) || renderer().style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask)
+ if (!paintInfo.shouldPaintWithinRoot(renderer()) || renderer().style().visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask)
return;
// Pixel snap mask painting.
@@ -1385,8 +1385,8 @@
flipForWritingMode(localRect);
LayoutPoint adjustedPaintOffset = paintOffset + localRect.location();
- const NinePieceImage& maskNinePieceImage = renderer().style()->maskBoxImage();
- StyleImage* maskBoxImage = renderer().style()->maskBoxImage().image();
+ const NinePieceImage& maskNinePieceImage = renderer().style().maskBoxImage();
+ StyleImage* maskBoxImage = renderer().style().maskBoxImage().image();
// Figure out if we need to push a transparency layer to render our mask.
bool pushTransparencyLayer = false;
@@ -1394,7 +1394,7 @@
bool flattenCompositingLayers = renderer().view().frameView().paintBehavior() & PaintBehaviorFlattenCompositingLayers;
CompositeOperator compositeOp = CompositeSourceOver;
if (!compositedMask || flattenCompositingLayers) {
- if ((maskBoxImage && renderer().style()->maskLayers()->hasImage()) || renderer().style()->maskLayers()->next())
+ if ((maskBoxImage && renderer().style().maskLayers()->hasImage()) || renderer().style().maskLayers()->next())
pushTransparencyLayer = true;
compositeOp = CompositeDestinationIn;
@@ -1406,9 +1406,9 @@
}
LayoutRect paintRect = LayoutRect(adjustedPaintOffset, frameRect.size());
- paintFillLayers(paintInfo, Color(), renderer().style()->maskLayers(), paintRect, compositeOp);
+ paintFillLayers(paintInfo, Color(), renderer().style().maskLayers(), paintRect, compositeOp);
- bool hasBoxImage = maskBoxImage && maskBoxImage->canRender(&renderer(), renderer().style()->effectiveZoom());
+ bool hasBoxImage = maskBoxImage && maskBoxImage->canRender(&renderer(), renderer().style().effectiveZoom());
if (!hasBoxImage || !maskBoxImage->isLoaded()) {
if (pushTransparencyLayer)
paintInfo.context->endTransparencyLayer();
@@ -1418,7 +1418,7 @@
// The simple case is where we are the only box for this object. In those
// cases only a single call to draw is required.
if (!prevLineBox() && !nextLineBox()) {
- boxModelObject()->paintNinePieceImage(paintInfo.context, LayoutRect(adjustedPaintOffset, frameRect.size()), renderer().style(), maskNinePieceImage, compositeOp);
+ boxModelObject()->paintNinePieceImage(paintInfo.context, LayoutRect(adjustedPaintOffset, frameRect.size()), &renderer().style(), maskNinePieceImage, compositeOp);
} else {
// We have a mask image that spans multiple lines.
// We need to adjust _tx and _ty by the width of all previous lines.
@@ -1436,7 +1436,7 @@
LayoutRect clipRect = clipRectForNinePieceImageStrip(this, maskNinePieceImage, paintRect);
GraphicsContextStateSaver stateSaver(*paintInfo.context);
paintInfo.context->clip(clipRect);
- boxModelObject()->paintNinePieceImage(paintInfo.context, LayoutRect(stripX, stripY, stripWidth, stripHeight), renderer().style(), maskNinePieceImage, compositeOp);
+ boxModelObject()->paintNinePieceImage(paintInfo.context, LayoutRect(stripX, stripY, stripWidth, stripHeight), &renderer().style(), maskNinePieceImage, compositeOp);
}
if (pushTransparencyLayer)
@@ -1519,13 +1519,13 @@
if (curr->isInlineFlowBox())
result = max(result, toInlineFlowBox(curr)->computeOverAnnotationAdjustment(allowedPosition));
- if (curr->renderer().isReplaced() && curr->renderer().isRubyRun() && curr->renderer().style()->rubyPosition() == RubyPositionBefore) {
+ if (curr->renderer().isReplaced() && curr->renderer().isRubyRun() && curr->renderer().style().rubyPosition() == RubyPositionBefore) {
RenderRubyRun& rubyRun = toRenderRubyRun(curr->renderer());
RenderRubyText* rubyText = rubyRun.rubyText();
if (!rubyText)
continue;
- if (!rubyRun.style()->isFlippedLinesWritingMode()) {
+ if (!rubyRun.style().isFlippedLinesWritingMode()) {
LayoutUnit topOfFirstRubyTextLine = rubyText->logicalTop() + (rubyText->firstRootBox() ? rubyText->firstRootBox()->lineTop() : LayoutUnit());
if (topOfFirstRubyTextLine >= 0)
continue;
@@ -1567,13 +1567,13 @@
if (curr->isInlineFlowBox())
result = max(result, toInlineFlowBox(curr)->computeUnderAnnotationAdjustment(allowedPosition));
- if (curr->renderer().isReplaced() && curr->renderer().isRubyRun() && curr->renderer().style()->rubyPosition() == RubyPositionAfter) {
+ if (curr->renderer().isReplaced() && curr->renderer().isRubyRun() && curr->renderer().style().rubyPosition() == RubyPositionAfter) {
RenderRubyRun& rubyRun = toRenderRubyRun(curr->renderer());
RenderRubyText* rubyText = rubyRun.rubyText();
if (!rubyText)
continue;
- if (rubyRun.style()->isFlippedLinesWritingMode()) {
+ if (rubyRun.style().isFlippedLinesWritingMode()) {
LayoutUnit topOfFirstRubyTextLine = rubyText->logicalTop() + (rubyText->firstRootBox() ? rubyText->firstRootBox()->lineTop() : LayoutUnit());
if (topOfFirstRubyTextLine >= 0)
continue;
@@ -1620,7 +1620,7 @@
leafBoxesInLogicalOrder.append(leaf);
}
- if (renderer().style()->rtlOrdering() == VisualOrder)
+ if (renderer().style().rtlOrdering() == VisualOrder)
return;
// Reverse of reordering of the line (L2 according to Bidi spec):
diff --git a/Source/WebCore/rendering/InlineFlowBox.h b/Source/WebCore/rendering/InlineFlowBox.h
index 9a40fc7..1ce3e18 100644
--- a/Source/WebCore/rendering/InlineFlowBox.h
+++ b/Source/WebCore/rendering/InlineFlowBox.h
@@ -61,7 +61,7 @@
// an invisible marker exists. The side effect of having an invisible marker is that the quirks mode behavior of shrinking lines with no
// text children must not apply. This change also means that gaps will exist between image bullet list items. Even when the list bullet
// is an image, the line is still considered to be immune from the quirk.
- m_hasTextChildren = renderer.style()->display() == LIST_ITEM;
+ m_hasTextChildren = renderer.style().display() == LIST_ITEM;
m_hasTextDescendants = m_hasTextChildren;
}
@@ -73,7 +73,7 @@
#endif
RenderBoxModelObject& renderer() const { return toRenderBoxModelObject(InlineBox::renderer()); }
- const RenderStyle& lineStyle() const { return isFirstLine() ? *renderer().firstLineStyle() : *renderer().style(); }
+ const RenderStyle& lineStyle() const { return isFirstLine() ? renderer().firstLineStyle() : renderer().style(); }
InlineFlowBox* prevLineBox() const { return m_prevLineBox; }
InlineFlowBox* nextLineBox() const { return m_nextLineBox; }
diff --git a/Source/WebCore/rendering/InlineIterator.h b/Source/WebCore/rendering/InlineIterator.h
index bc309ff..2082dae 100644
--- a/Source/WebCore/rendering/InlineIterator.h
+++ b/Source/WebCore/rendering/InlineIterator.h
@@ -124,8 +124,8 @@
if (!observer || !object || !object->isRenderInline())
return;
- RenderStyle* style = object->style();
- EUnicodeBidi unicodeBidi = style->unicodeBidi();
+ const RenderStyle& style = object->style();
+ EUnicodeBidi unicodeBidi = style.unicodeBidi();
if (unicodeBidi == UBNormal) {
// http://dev.w3.org/csswg/css3-writing-modes/#unicode-bidi
// "The element does not open an additional level of embedding with respect to the bidirectional algorithm."
@@ -142,7 +142,7 @@
}
if (!observer->inIsolate())
- observer->embed(embedCharFromDirection(style->direction(), unicodeBidi), FromStyleOrDOM);
+ observer->embed(embedCharFromDirection(style.direction(), unicodeBidi), FromStyleOrDOM);
}
template <class Observer>
@@ -151,7 +151,7 @@
if (!observer || !object || !object->isRenderInline())
return;
- EUnicodeBidi unicodeBidi = object->style()->unicodeBidi();
+ EUnicodeBidi unicodeBidi = object->style().unicodeBidi();
if (unicodeBidi == UBNormal)
return; // Nothing to do for unicode-bidi: normal
if (isIsolated(unicodeBidi)) {
@@ -399,7 +399,7 @@
return u_charDirection(character);
if (m_obj && m_obj->isListMarker())
- return m_obj->style()->isLeftToRightDirection() ? U_LEFT_TO_RIGHT : U_RIGHT_TO_LEFT;
+ return m_obj->style().isLeftToRightDirection() ? U_LEFT_TO_RIGHT : U_RIGHT_TO_LEFT;
return U_OTHER_NEUTRAL;
}
@@ -413,7 +413,7 @@
static inline bool isIsolatedInline(RenderObject* object)
{
ASSERT(object);
- return object->isRenderInline() && isIsolated(object->style()->unicodeBidi());
+ return object->isRenderInline() && isIsolated(object->style().unicodeBidi());
}
static inline RenderObject* containingIsolate(RenderObject* object, RenderObject* root)
diff --git a/Source/WebCore/rendering/InlineTextBox.cpp b/Source/WebCore/rendering/InlineTextBox.cpp
index 347036d..29ea203 100644
--- a/Source/WebCore/rendering/InlineTextBox.cpp
+++ b/Source/WebCore/rendering/InlineTextBox.cpp
@@ -335,7 +335,7 @@
bool InlineTextBox::isLineBreak() const
{
- return renderer().style()->preserveNewline() && len() == 1 && (*renderer().text())[start()] == '\n';
+ return renderer().style().preserveNewline() && len() == 1 && (*renderer().text())[start()] == '\n';
}
bool InlineTextBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit /* lineTop */, LayoutUnit /*lineBottom*/)
@@ -355,7 +355,7 @@
LayoutUnit widthOfVisibleText = renderer().width(m_start, m_truncation, textPos(), isFirstLine());
if (isHorizontal())
- renderer().style()->isLeftToRightDirection() ? rect.setWidth(widthOfVisibleText) : rect.shiftXEdgeTo(right() - widthOfVisibleText);
+ renderer().style().isLeftToRightDirection() ? rect.setWidth(widthOfVisibleText) : rect.shiftXEdgeTo(right() - widthOfVisibleText);
else
rect.setHeight(widthOfVisibleText);
}
@@ -478,7 +478,7 @@
void InlineTextBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset, LayoutUnit /*lineTop*/, LayoutUnit /*lineBottom*/)
{
- if (isLineBreak() || !paintInfo.shouldPaintWithinRoot(renderer()) || renderer().style()->visibility() != VISIBLE
+ if (isLineBreak() || !paintInfo.shouldPaintWithinRoot(renderer()) || renderer().style().visibility() != VISIBLE
|| m_truncation == cFullTruncation || paintInfo.phase == PaintPhaseOutline || !m_len)
return;
@@ -506,7 +506,7 @@
return;
if (m_truncation != cNoTruncation) {
- if (renderer().containingBlock()->style()->isLeftToRightDirection() != isLeftToRightDirection()) {
+ if (renderer().containingBlock()->style().isLeftToRightDirection() != isLeftToRightDirection()) {
// Make the visible fragment of text hug the edge closest to the rest of the run by moving the origin
// at which we start drawing text.
// e.g. In the case of LTR text truncated in an RTL Context, the correct behavior is:
@@ -794,7 +794,7 @@
LayoutUnit selectionBottom = rootBox.selectionBottom();
LayoutUnit selectionTop = rootBox.selectionTopAdjustedForPrecedingBlock();
- int deltaY = roundToInt(renderer().style()->isFlippedLinesWritingMode() ? selectionBottom - logicalBottom() : logicalTop() - selectionTop);
+ int deltaY = roundToInt(renderer().style().isFlippedLinesWritingMode() ? selectionBottom - logicalBottom() : logicalTop() - selectionTop);
int selHeight = max(0, roundToInt(selectionBottom - selectionTop));
FloatPoint localOrigin(boxOrigin.x(), boxOrigin.y() - deltaY);
@@ -821,7 +821,7 @@
updateGraphicsContext(*context, TextPaintStyle(c, style.colorSpace())); // Don't draw text at all!
- int deltaY = renderer().style()->isFlippedLinesWritingMode() ? selectionBottom() - logicalBottom() : logicalTop() - selectionTop();
+ int deltaY = renderer().style().isFlippedLinesWritingMode() ? selectionBottom() - logicalBottom() : logicalTop() - selectionTop();
int selHeight = selectionHeight();
FloatPoint localOrigin(boxOrigin.x(), boxOrigin.y() - deltaY);
context->drawHighlightForText(font, constructTextRun(style, font), localOrigin, selHeight, c, style.colorSpace(), sPos, ePos);
@@ -1074,7 +1074,7 @@
setClip = true;
}
- ColorSpace colorSpace = renderer().style()->colorSpace();
+ ColorSpace colorSpace = renderer().style().colorSpace();
bool setShadow = false;
do {
@@ -1213,7 +1213,7 @@
endPosition = min<int>(endPosition, m_truncation);
// Calculate start & width
- int deltaY = renderer().style()->isFlippedLinesWritingMode() ? selectionBottom() - logicalBottom() : logicalTop() - selectionTop();
+ int deltaY = renderer().style().isFlippedLinesWritingMode() ? selectionBottom() - logicalBottom() : logicalTop() - selectionTop();
int selHeight = selectionHeight();
FloatPoint startPoint(boxOrigin.x(), boxOrigin.y() - deltaY);
TextRun run = constructTextRun(style, font);
@@ -1256,7 +1256,7 @@
{
// Use same y positioning and height as for selection, so that when the selection and this highlight are on
// the same word there are no pieces sticking out.
- int deltaY = renderer().style()->isFlippedLinesWritingMode() ? selectionBottom() - logicalBottom() : logicalTop() - selectionTop();
+ int deltaY = renderer().style().isFlippedLinesWritingMode() ? selectionBottom() - logicalBottom() : logicalTop() - selectionTop();
int selHeight = selectionHeight();
int sPos = max(marker->startOffset() - m_start, (unsigned)0);
@@ -1400,7 +1400,7 @@
start += 1;
width -= 2;
- ctx->setStrokeColor(underline.color, renderer().style()->colorSpace());
+ ctx->setStrokeColor(underline.color, renderer().style().colorSpace());
ctx->setStrokeThickness(lineThickness);
ctx->drawLineForText(FloatPoint(boxOrigin.x() + start, boxOrigin.y() + logicalHeight() - lineThickness), width, renderer().document().printing());
}
diff --git a/Source/WebCore/rendering/InlineTextBox.h b/Source/WebCore/rendering/InlineTextBox.h
index 3440e13a..e8c1de3 100644
--- a/Source/WebCore/rendering/InlineTextBox.h
+++ b/Source/WebCore/rendering/InlineTextBox.h
@@ -55,7 +55,7 @@
}
RenderText& renderer() const { return toRenderText(InlineBox::renderer()); }
- const RenderStyle& lineStyle() const { return isFirstLine() ? *renderer().firstLineStyle() : *renderer().style(); }
+ const RenderStyle& lineStyle() const { return isFirstLine() ? renderer().firstLineStyle() : renderer().style(); }
virtual void destroy(RenderArena&) OVERRIDE FINAL;
diff --git a/Source/WebCore/rendering/LayoutState.cpp b/Source/WebCore/rendering/LayoutState.cpp
index 613ed57..e050df2 100644
--- a/Source/WebCore/rendering/LayoutState.cpp
+++ b/Source/WebCore/rendering/LayoutState.cpp
@@ -47,7 +47,7 @@
{
ASSERT(m_next);
- bool fixed = renderer->isOutOfFlowPositioned() && renderer->style()->position() == FixedPosition;
+ bool fixed = renderer->isOutOfFlowPositioned() && renderer->style().position() == FixedPosition;
if (fixed) {
// FIXME: This doesn't work correctly with transforms.
FloatPoint fixedOffset = renderer->view().localToAbsolute(FloatPoint(), IsFixed);
@@ -87,7 +87,7 @@
// We can compare this later on to figure out what part of the page we're actually on,
if (pageLogicalHeight || m_columnInfo || renderer->isRenderFlowThread()) {
m_pageLogicalHeight = pageLogicalHeight;
- bool isFlipped = renderer->style()->isFlippedBlocksWritingMode();
+ bool isFlipped = renderer->style().isFlippedBlocksWritingMode();
m_pageOffset = LayoutSize(m_layoutOffset.width() + (!isFlipped ? renderer->borderLeft() + renderer->paddingLeft() : renderer->borderRight() + renderer->paddingRight()),
m_layoutOffset.height() + (!isFlipped ? renderer->borderTop() + renderer->paddingTop() : renderer->borderBottom() + renderer->paddingBottom()));
m_pageLogicalHeightChanged = pageLogicalHeightChanged;
@@ -126,11 +126,11 @@
m_isPaginated = m_pageLogicalHeight || m_columnInfo || renderer->isRenderFlowThread();
- if (lineGrid() && renderer->hasColumns() && renderer->style()->hasInlineColumnAxis())
+ if (lineGrid() && renderer->hasColumns() && renderer->style().hasInlineColumnAxis())
computeLineGridPaginationOrigin(renderer);
// If we have a new grid to track, then add it to our set.
- if (renderer->style()->lineGrid() != RenderStyle::initialLineGrid() && renderer->isRenderBlockFlow())
+ if (renderer->style().lineGrid() != RenderStyle::initialLineGrid() && renderer->isRenderBlockFlow())
establishLineGrid(toRenderBlockFlow(renderer));
// FIXME: <http://bugs.webkit.org/show_bug.cgi?id=13443> Apply control clip if present.
@@ -202,7 +202,7 @@
{
// First check to see if this grid has been established already.
if (m_lineGrid) {
- if (m_lineGrid->style()->lineGrid() == block->style()->lineGrid())
+ if (m_lineGrid->style().lineGrid() == block->style().lineGrid())
return;
RenderBlockFlow* currentGrid = m_lineGrid;
for (LayoutState* currentState = m_next.get(); currentState; currentState = currentState->m_next.get()) {
@@ -211,7 +211,7 @@
currentGrid = currentState->m_lineGrid;
if (!currentGrid)
break;
- if (currentGrid->style()->lineGrid() == block->style()->lineGrid()) {
+ if (currentGrid->style().lineGrid() == block->style().lineGrid()) {
m_lineGrid = currentGrid;
m_lineGridOffset = currentState->m_lineGridOffset;
return;
@@ -229,7 +229,7 @@
// We need to cache a line grid pagination origin so that we understand how to reset the line grid
// at the top of each column.
// Get the current line grid and offset.
- if (!lineGrid() || lineGrid()->style()->writingMode() != renderer->style()->writingMode())
+ if (!lineGrid() || lineGrid()->style().writingMode() != renderer->style().writingMode())
return;
// Get the hypothetical line box used to establish the grid.
diff --git a/Source/WebCore/rendering/LineWidth.cpp b/Source/WebCore/rendering/LineWidth.cpp
index 2830bb5..4f488a9 100644
--- a/Source/WebCore/rendering/LineWidth.cpp
+++ b/Source/WebCore/rendering/LineWidth.cpp
@@ -130,7 +130,7 @@
newLeft += shapeOutsideInfo->rightMarginBoxDelta();
#endif
- if (shouldIndentText() && m_block.style()->isLeftToRightDirection())
+ if (shouldIndentText() && m_block.style().isLeftToRightDirection())
newLeft += floorToInt(m_block.textIndentOffset());
m_left = std::max<float>(m_left, newLeft);
} else {
@@ -142,7 +142,7 @@
newRight += shapeOutsideInfo->leftMarginBoxDelta();
#endif
- if (shouldIndentText() && !m_block.style()->isLeftToRightDirection())
+ if (shouldIndentText() && !m_block.style().isLeftToRightDirection())
newRight -= floorToInt(m_block.textIndentOffset());
m_right = std::min<float>(m_right, newRight);
}
diff --git a/Source/WebCore/rendering/LogicalSelectionOffsetCaches.h b/Source/WebCore/rendering/LogicalSelectionOffsetCaches.h
index 0225b24..c5abc3d 100644
--- a/Source/WebCore/rendering/LogicalSelectionOffsetCaches.h
+++ b/Source/WebCore/rendering/LogicalSelectionOffsetCaches.h
@@ -27,7 +27,7 @@
static inline bool isContainingBlockCandidateForAbsolutelyPositionedObject(RenderElement& object)
{
- return object.style()->position() != StaticPosition
+ return object.style().position() != StaticPosition
|| (object.hasTransform() && object.isRenderBlock())
#if ENABLE(SVG)
|| object.isSVGForeignObject()
@@ -159,7 +159,7 @@
const ContainingBlockInfo& containingBlockInfo(RenderBlock& block) const
{
- EPosition position = block.style()->position();
+ EPosition position = block.style().position();
if (position == FixedPosition) {
ASSERT(block.containingBlock() == m_containingBlockForFixedPosition.block());
return m_containingBlockForFixedPosition;
diff --git a/Source/WebCore/rendering/OrderIterator.cpp b/Source/WebCore/rendering/OrderIterator.cpp
index bfbcc97b..e09924f 100644
--- a/Source/WebCore/rendering/OrderIterator.cpp
+++ b/Source/WebCore/rendering/OrderIterator.cpp
@@ -83,7 +83,7 @@
m_orderIndex = 0;
m_currentChild = m_containerBox.firstChildBox();
- } while (!m_currentChild || m_currentChild->style()->order() != m_orderValues[m_orderIndex]);
+ } while (!m_currentChild || m_currentChild->style().order() != m_orderValues[m_orderIndex]);
return m_currentChild;
}
diff --git a/Source/WebCore/rendering/RenderBlock.cpp b/Source/WebCore/rendering/RenderBlock.cpp
index aed2e57..025d1ba 100644
--- a/Source/WebCore/rendering/RenderBlock.cpp
+++ b/Source/WebCore/rendering/RenderBlock.cpp
@@ -239,7 +239,7 @@
void RenderBlock::styleWillChange(StyleDifference diff, const RenderStyle& newStyle)
{
- RenderStyle* oldStyle = hasInitializedStyle() ? style() : nullptr;
+ const RenderStyle* oldStyle = hasInitializedStyle() ? &style() : nullptr;
setReplaced(newStyle.isDisplayInlineType());
@@ -252,8 +252,8 @@
// Remove our absolutely positioned descendants from their current containing block.
// They will be inserted into our positioned objects list during layout.
auto cb = parent();
- while (cb && (cb->style()->position() == StaticPosition || (cb->isInline() && !cb->isReplaced())) && !cb->isRenderView()) {
- if (cb->style()->position() == RelativePosition && cb->isInline() && !cb->isReplaced()) {
+ while (cb && (cb->style().position() == StaticPosition || (cb->isInline() && !cb->isReplaced())) && !cb->isRenderView()) {
+ if (cb->style().position() == RelativePosition && cb->isInline() && !cb->isReplaced()) {
cb = cb->containingBlock();
break;
}
@@ -286,10 +286,10 @@
{
RenderBox::styleDidChange(diff, oldStyle);
- RenderStyle* newStyle = style();
+ RenderStyle& newStyle = style();
#if ENABLE(CSS_SHAPES)
- updateShapeInsideInfoAfterStyleChange(newStyle->resolvedShapeInside(), oldStyle ? oldStyle->resolvedShapeInside() : 0);
+ updateShapeInsideInfoAfterStyleChange(newStyle.resolvedShapeInside(), oldStyle ? oldStyle->resolvedShapeInside() : 0);
#endif
if (!isAnonymousBlock()) {
@@ -297,7 +297,7 @@
for (RenderBlock* currCont = blockElementContinuation(); currCont; currCont = currCont->blockElementContinuation()) {
RenderBoxModelObject* nextCont = currCont->continuation();
currCont->setContinuation(0);
- currCont->setStyle(*newStyle);
+ currCont->setStyle(newStyle);
currCont->setContinuation(nextCont);
}
}
@@ -307,7 +307,7 @@
// It's possible for our border/padding to change, but for the overall logical width of the block to
// end up being the same. We keep track of this change so in layoutBlock, we can know to set relayoutChildren=true.
- m_hasBorderOrPaddingLogicalWidthChanged = oldStyle && diff == StyleDifferenceLayout && needsLayout() && borderOrPaddingLogicalWidthChanged(oldStyle, newStyle);
+ m_hasBorderOrPaddingLogicalWidthChanged = oldStyle && diff == StyleDifferenceLayout && needsLayout() && borderOrPaddingLogicalWidthChanged(oldStyle, &newStyle);
}
RenderBlock* RenderBlock::continuationBefore(RenderObject* beforeChild)
@@ -357,9 +357,9 @@
// A continuation always consists of two potential candidates: a block or an anonymous
// column span box holding column span children.
- bool childIsNormal = newChild->isInline() || !newChild->style()->columnSpan();
- bool bcpIsNormal = beforeChildParent->isInline() || !beforeChildParent->style()->columnSpan();
- bool flowIsNormal = flow->isInline() || !flow->style()->columnSpan();
+ bool childIsNormal = newChild->isInline() || !newChild->style().columnSpan();
+ bool bcpIsNormal = beforeChildParent->isInline() || !beforeChildParent->style().columnSpan();
+ bool flowIsNormal = flow->isInline() || !flow->style().columnSpan();
if (flow == beforeChildParent) {
flow->addChildIgnoringContinuation(newChild, beforeChild);
@@ -403,7 +403,7 @@
}
// See if the child can be placed in the box.
- bool newChildHasColumnSpan = !newChild->isInline() && newChild->style()->columnSpan();
+ bool newChildHasColumnSpan = !newChild->isInline() && newChild->style().columnSpan();
bool beforeChildParentHoldsColumnSpans = beforeChildParent->isAnonymousColumnSpanBlock();
if (newChildHasColumnSpan == beforeChildParentHoldsColumnSpans) {
@@ -460,7 +460,7 @@
if (!currBlock->createsAnonymousWrapper())
firstChildIgnoringAnonymousWrappers = currBlock;
- if (currBlock->style()->specifiesColumns() && (allowAnonymousColumnBlock || !currBlock->isAnonymousColumnsBlock()))
+ if (currBlock->style().specifiesColumns() && (allowAnonymousColumnBlock || !currBlock->isAnonymousColumnsBlock()))
return firstChildIgnoringAnonymousWrappers;
if (currBlock->isAnonymousColumnSpanBlock())
@@ -476,7 +476,7 @@
cloneBlock = createAnonymousBlock();
cloneBlock->setChildrenInline(childrenInline());
} else {
- auto cloneRenderer = element()->createRenderer(*style());
+ auto cloneRenderer = element()->createRenderer(style());
cloneBlock = toRenderBlock(cloneRenderer);
cloneBlock->initializeStyle();
@@ -682,7 +682,7 @@
// cross the streams and have to cope with both types of continuations mixed together).
// This function currently supports (1) and (2).
RenderBlock* columnsBlockAncestor = 0;
- if (!newChild->isText() && newChild->style()->columnSpan() && !newChild->isBeforeOrAfterContent()
+ if (!newChild->isText() && newChild->style().columnSpan() && !newChild->isBeforeOrAfterContent()
&& !newChild->isFloatingOrOutOfFlowPositioned() && !newChild->isInline() && !isAnonymousColumnSpanBlock()) {
columnsBlockAncestor = containingColumnsBlock(false);
if (columnsBlockAncestor) {
@@ -1097,7 +1097,7 @@
ASSERT(!inlineChildrenBlock->continuation());
// Cache this value as it might get changed in setStyle() call.
bool inlineChildrenBlockHasLayer = inlineChildrenBlock->hasLayer();
- inlineChildrenBlock->setStyle(RenderStyle::createAnonymousStyleWithDisplay(style(), BLOCK));
+ inlineChildrenBlock->setStyle(RenderStyle::createAnonymousStyleWithDisplay(&style(), BLOCK));
removeChildInternal(*inlineChildrenBlock, inlineChildrenBlockHasLayer ? NotifyChildren : DontNotifyChildren);
// Now just put the inlineChildrenBlock inside the blockChildrenBlock.
@@ -1140,8 +1140,8 @@
// are floating, then we need to pull the content up also.
RenderBlock* anonBlock = toRenderBlock((prev && prev->isAnonymousBlock()) ? prev : next);
if ((anonBlock->previousSibling() || anonBlock->nextSibling())
- && (!anonBlock->previousSibling() || (anonBlock->previousSibling()->style()->styleType() != NOPSEUDO && anonBlock->previousSibling()->isFloating() && !anonBlock->previousSibling()->previousSibling()))
- && (!anonBlock->nextSibling() || (anonBlock->nextSibling()->style()->styleType() != NOPSEUDO && anonBlock->nextSibling()->isFloating() && !anonBlock->nextSibling()->nextSibling()))) {
+ && (!anonBlock->previousSibling() || (anonBlock->previousSibling()->style().styleType() != NOPSEUDO && anonBlock->previousSibling()->isFloating() && !anonBlock->previousSibling()->previousSibling()))
+ && (!anonBlock->nextSibling() || (anonBlock->nextSibling()->style().styleType() != NOPSEUDO && anonBlock->nextSibling()->isFloating() && !anonBlock->nextSibling()->nextSibling()))) {
collapseAnonymousBoxChild(this, anonBlock);
}
}
@@ -1189,16 +1189,16 @@
// (e) have specified that one of our margins can't collapse using a CSS extension
if (logicalHeight() > 0
|| isTable() || borderAndPaddingLogicalHeight()
- || style()->logicalMinHeight().isPositive()
- || style()->marginBeforeCollapse() == MSEPARATE || style()->marginAfterCollapse() == MSEPARATE)
+ || style().logicalMinHeight().isPositive()
+ || style().marginBeforeCollapse() == MSEPARATE || style().marginAfterCollapse() == MSEPARATE)
return false;
- Length logicalHeightLength = style()->logicalHeight();
+ Length logicalHeightLength = style().logicalHeight();
bool hasAutoHeight = logicalHeightLength.isAuto();
if (logicalHeightLength.isPercent() && !document().inQuirksMode()) {
hasAutoHeight = true;
for (RenderBlock* cb = containingBlock(); !cb->isRenderView(); cb = cb->containingBlock()) {
- if (cb->style()->logicalHeight().isFixed() || cb->isTableCell())
+ if (cb->style().logicalHeight().isFixed() || cb->isTableCell())
hasAutoHeight = false;
}
}
@@ -1263,7 +1263,7 @@
void RenderBlock::updateScrollInfoAfterLayout()
{
if (hasOverflowClip()) {
- if (style()->isFlippedBlocksWritingMode()) {
+ if (style().isFlippedBlocksWritingMode()) {
// FIXME: https://bugs.webkit.org/show_bug.cgi?id=97937
// Workaround for now. We cannot delay the scroll info for overflow
// for items with opposite writing directions, as the contents needs
@@ -1322,12 +1322,12 @@
if (!containerBlock)
return LayoutSize();
- if (containerBlock->style()->writingMode() != currentBlock->style()->writingMode()) {
+ if (containerBlock->style().writingMode() != currentBlock->style().writingMode()) {
// We have to put the block rect in container coordinates
// and we have to take into account both the container and current block flipping modes
// Bug 118073: Flipping inline and block directions at the same time will not work,
// as one of the flipped dimensions will not yet have been set to its final size
- if (containerBlock->style()->isFlippedBlocksWritingMode()) {
+ if (containerBlock->style().isFlippedBlocksWritingMode()) {
if (containerBlock->isHorizontalWritingMode())
blockRect.setY(currentBlock->height() - blockRect.maxY());
else
@@ -1351,14 +1351,14 @@
if (!parent() || !everHadLayout())
return;
- ShapeValue* shapeValue = style()->shapeInside();
+ ShapeValue* shapeValue = style().shapeInside();
if (shapeValue && shapeValue->image() && shapeValue->image()->data() == image) {
ShapeInsideInfo* shapeInsideInfo = ensureShapeInsideInfo();
shapeInsideInfo->dirtyShapeSize();
markShapeInsideDescendantsForLayout();
}
- ShapeValue* shapeOutsideValue = style()->shapeOutside();
+ ShapeValue* shapeOutsideValue = style().shapeOutside();
if (isFloating() && shapeOutsideValue && shapeOutsideValue->image() && shapeOutsideValue->image()->data() == image)
parent()->setNeedsLayoutAndPrefWidthsRecalc();
}
@@ -1624,9 +1624,9 @@
RenderBox* positionedObject = *it;
// Fixed positioned elements don't contribute to layout overflow, since they don't scroll with the content.
- if (positionedObject->style()->position() != FixedPosition) {
+ if (positionedObject->style().position() != FixedPosition) {
LayoutUnit x = positionedObject->x();
- if (style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
+ if (style().shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
x -= verticalScrollbarWidth();
addOverflowFromChild(positionedObject, LayoutSize(x, positionedObject->y()));
}
@@ -1635,7 +1635,7 @@
void RenderBlock::addVisualOverflowFromTheme()
{
- if (!style()->hasAppearance())
+ if (!style().hasAppearance())
return;
IntRect inflatedRect = pixelSnappedBorderBoxRect();
@@ -1686,9 +1686,9 @@
RenderBoxModelObject* newRunIn = 0;
if (!runIn.isRenderBlockFlow())
- newRunIn = new RenderBlockFlow(*runIn.element(), *runIn.style());
+ newRunIn = new RenderBlockFlow(*runIn.element(), runIn.style());
else
- newRunIn = new RenderInline(*runIn.element(), *runIn.style());
+ newRunIn = new RenderInline(*runIn.element(), runIn.style());
runIn.element()->setRenderer(newRunIn);
newRunIn->initializeStyle();
@@ -1805,7 +1805,7 @@
LayoutUnit startOff = startOffsetForLine(blockOffset, false, region, logicalHeightForChild(child));
- if (style()->textAlign() != WEBKIT_CENTER && !child.style()->marginStartUsing(style()).isAuto()) {
+ if (style().textAlign() != WEBKIT_CENTER && !child.style().marginStartUsing(&style()).isAuto()) {
if (childMarginStart < 0)
startOff += childMarginStart;
newPosition = max(newPosition, startOff); // Let the float sit in the child's margin if it can fit.
@@ -1818,7 +1818,7 @@
void RenderBlock::determineLogicalLeftPositionForChild(RenderBox& child, ApplyLayoutDeltaMode applyDelta)
{
LayoutUnit startPosition = borderStart() + paddingStart();
- if (style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
+ if (style().shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
startPosition -= verticalScrollbarWidth();
LayoutUnit totalAvailableLogicalWidth = borderAndPaddingLogicalWidth() + availableLogicalWidth();
@@ -1831,7 +1831,7 @@
if (child.avoidsFloats() && containsFloats() && !flowThreadContainingBlock())
newPosition += computeStartPositionDeltaForChildAvoidingFloats(child, marginStartForChild(child));
- setLogicalLeftForChild(child, style()->isLeftToRightDirection() ? newPosition : totalAvailableLogicalWidth - newPosition - logicalWidthForChild(child), applyDelta);
+ setLogicalLeftForChild(child, style().isLeftToRightDirection() ? newPosition : totalAvailableLogicalWidth - newPosition - logicalWidthForChild(child), applyDelta);
}
void RenderBlock::setLogicalLeftForChild(RenderBox& child, LayoutUnit logicalLeft, ApplyLayoutDeltaMode applyDelta)
@@ -1937,7 +1937,7 @@
if ((!posChildNeedsLayout() && !needsSimplifiedNormalFlowLayout()) || normalChildNeedsLayout() || selfNeedsLayout())
return false;
- LayoutStateMaintainer statePusher(&view(), this, locationOffset(), hasColumns() || hasTransform() || hasReflection() || style()->isFlippedBlocksWritingMode());
+ LayoutStateMaintainer statePusher(&view(), this, locationOffset(), hasColumns() || hasTransform() || hasReflection() || style().isFlippedBlocksWritingMode());
if (needsPositionedMovementLayout() && !tryLayoutDoingPositionedMovementOnly())
return false;
@@ -1982,18 +1982,18 @@
void RenderBlock::markFixedPositionObjectForLayoutIfNeeded(RenderObject& child)
{
- if (child.style()->position() != FixedPosition)
+ if (child.style().position() != FixedPosition)
return;
- bool hasStaticBlockPosition = child.style()->hasStaticBlockPosition(isHorizontalWritingMode());
- bool hasStaticInlinePosition = child.style()->hasStaticInlinePosition(isHorizontalWritingMode());
+ bool hasStaticBlockPosition = child.style().hasStaticBlockPosition(isHorizontalWritingMode());
+ bool hasStaticInlinePosition = child.style().hasStaticInlinePosition(isHorizontalWritingMode());
if (!hasStaticBlockPosition && !hasStaticInlinePosition)
return;
auto o = child.parent();
- while (o && !o->isRenderView() && o->style()->position() != AbsolutePosition)
+ while (o && !o->isRenderView() && o->style().position() != AbsolutePosition)
o = o->parent();
- if (o->style()->position() != AbsolutePosition)
+ if (o->style().position() != AbsolutePosition)
return;
RenderBox& box = toRenderBox(child);
@@ -2038,7 +2038,7 @@
// non-positioned block. Rather than trying to detect all of these movement cases, we just always lay out positioned
// objects that are positioned implicitly like this. Such objects are rare, and so in typical DHTML menu usage (where everything is
// positioned explicitly) this should not incur a performance penalty.
- if (relayoutChildren || (r.style()->hasStaticBlockPosition(isHorizontalWritingMode()) && r.parent() != this))
+ if (relayoutChildren || (r.style().hasStaticBlockPosition(isHorizontalWritingMode()) && r.parent() != this))
r.setChildNeedsLayout(MarkOnlyThis);
// If relayoutChildren is set and the child has percentage padding or an embedded content box, we also need to invalidate the childs pref widths.
@@ -2131,7 +2131,7 @@
// Our scrollbar widgets paint exactly when we tell them to, so that they work properly with
// z-index. We paint after we painted the background/border, so that the scrollbars will
// sit above the background/border.
- if (hasOverflowClip() && style()->visibility() == VISIBLE && (phase == PaintPhaseBlockBackground || phase == PaintPhaseChildBlockBackground) && paintInfo.shouldPaintWithinRoot(*this) && !paintInfo.paintRootBackgroundOnly())
+ if (hasOverflowClip() && style().visibility() == VISIBLE && (phase == PaintPhaseBlockBackground || phase == PaintPhaseChildBlockBackground) && paintInfo.shouldPaintWithinRoot(*this) && !paintInfo.paintRootBackgroundOnly())
layer()->paintOverflowControls(paintInfo.context, roundedIntPoint(adjustedPaintOffset), paintInfo.rect);
}
@@ -2140,10 +2140,10 @@
if (paintInfo.context->paintingDisabled())
return;
- const Color& ruleColor = style()->visitedDependentColor(CSSPropertyWebkitColumnRuleColor);
- bool ruleTransparent = style()->columnRuleIsTransparent();
- EBorderStyle ruleStyle = style()->columnRuleStyle();
- LayoutUnit ruleThickness = style()->columnRuleWidth();
+ const Color& ruleColor = style().visitedDependentColor(CSSPropertyWebkitColumnRuleColor);
+ bool ruleTransparent = style().columnRuleIsTransparent();
+ EBorderStyle ruleStyle = style().columnRuleStyle();
+ LayoutUnit ruleThickness = style().columnRuleWidth();
LayoutUnit colGap = columnGap();
bool renderRule = ruleStyle > BHIDDEN && !ruleTransparent;
if (!renderRule)
@@ -2155,7 +2155,7 @@
bool antialias = shouldAntialiasLines(paintInfo.context);
if (colInfo->progressionAxis() == ColumnInfo::InlineAxis) {
- bool leftToRight = style()->isLeftToRightDirection() ^ colInfo->progressionIsReversed();
+ bool leftToRight = style().isLeftToRightDirection() ^ colInfo->progressionIsReversed();
LayoutUnit currLogicalLeftOffset = leftToRight ? LayoutUnit() : contentLogicalWidth();
LayoutUnit ruleAdd = logicalLeftOffsetForContent();
LayoutUnit ruleLogicalLeft = leftToRight ? LayoutUnit() : contentLogicalWidth();
@@ -2187,7 +2187,7 @@
ruleLogicalLeft = currLogicalLeftOffset;
}
} else {
- bool topToBottom = !style()->isFlippedBlocksWritingMode() ^ colInfo->progressionIsReversed();
+ bool topToBottom = !style().isFlippedBlocksWritingMode() ^ colInfo->progressionIsReversed();
LayoutUnit ruleLeft = isHorizontalWritingMode()
? borderLeft() + paddingLeft()
: colGap / 2 - colGap - ruleThickness / 2 + (!colInfo->progressionIsReversed() ? borderAndPaddingBefore() : borderAndPaddingAfter());
@@ -2231,7 +2231,7 @@
LayoutRect colRect = columnRectAt(colInfo, 0);
result = isHorizontalWritingMode() ? colRect.y() : colRect.x();
result -= borderAndPaddingBefore();
- if (style()->isFlippedBlocksWritingMode())
+ if (style().isFlippedBlocksWritingMode())
result = -result;
}
return result;
@@ -2248,7 +2248,7 @@
else
blockDelta -= (colInfo->columnHeight() + colGap);
}
- if (style()->isFlippedBlocksWritingMode())
+ if (style().isFlippedBlocksWritingMode())
blockDelta = -blockDelta;
return blockDelta;
}
@@ -2339,7 +2339,7 @@
bool RenderBlock::paintChild(RenderBox& child, PaintInfo& paintInfo, const LayoutPoint& paintOffset, PaintInfo& paintInfoForChild, bool usePrintRect)
{
// Check for page-break-before: always, and if it's set, break and bail.
- bool checkBeforeAlways = !childrenInline() && (usePrintRect && child.style()->pageBreakBefore() == PBALWAYS);
+ bool checkBeforeAlways = !childrenInline() && (usePrintRect && child.style().pageBreakBefore() == PBALWAYS);
LayoutUnit absoluteChildY = paintOffset.y() + child.y();
if (checkBeforeAlways
&& absoluteChildY > paintInfo.rect.y()
@@ -2364,7 +2364,7 @@
child.paint(paintInfoForChild, childPoint);
// Check for page-break-after: always, and if it's set, break and bail.
- bool checkAfterAlways = !childrenInline() && (usePrintRect && child.style()->pageBreakAfter() == PBALWAYS);
+ bool checkAfterAlways = !childrenInline() && (usePrintRect && child.style().pageBreakAfter() == PBALWAYS);
if (checkAfterAlways
&& (absoluteChildY + child.height()) > paintInfo.rect.y()
&& (absoluteChildY + child.height()) < paintInfo.rect.maxY()) {
@@ -2403,14 +2403,14 @@
PaintPhase paintPhase = paintInfo.phase;
// 1. paint background, borders etc
- if ((paintPhase == PaintPhaseBlockBackground || paintPhase == PaintPhaseChildBlockBackground) && style()->visibility() == VISIBLE) {
+ if ((paintPhase == PaintPhaseBlockBackground || paintPhase == PaintPhaseChildBlockBackground) && style().visibility() == VISIBLE) {
if (hasBoxDecorations())
paintBoxDecorations(paintInfo, paintOffset);
if (hasColumns() && !paintInfo.paintRootBackgroundOnly())
paintColumnRules(paintInfo, paintOffset);
}
- if (paintPhase == PaintPhaseMask && style()->visibility() == VISIBLE) {
+ if (paintPhase == PaintPhaseMask && style().visibility() == VISIBLE) {
paintMask(paintInfo, paintOffset);
return;
}
@@ -2447,13 +2447,13 @@
}
// 5. paint outline.
- if ((paintPhase == PaintPhaseOutline || paintPhase == PaintPhaseSelfOutline) && hasOutline() && style()->visibility() == VISIBLE)
+ if ((paintPhase == PaintPhaseOutline || paintPhase == PaintPhaseSelfOutline) && hasOutline() && style().visibility() == VISIBLE)
paintOutline(paintInfo, LayoutRect(paintOffset, size()));
// 6. paint continuation outlines.
if ((paintPhase == PaintPhaseOutline || paintPhase == PaintPhaseChildOutlines)) {
RenderInline* inlineCont = inlineElementContinuation();
- if (inlineCont && inlineCont->hasOutline() && inlineCont->style()->visibility() == VISIBLE) {
+ if (inlineCont && inlineCont->hasOutline() && inlineCont->style().visibility() == VISIBLE) {
RenderInline* inlineRenderer = toRenderInline(inlineCont->element()->renderer());
RenderBlock* cb = containingBlock();
@@ -2563,7 +2563,7 @@
bool RenderBlock::shouldPaintSelectionGaps() const
{
- return selectionState() != SelectionNone && style()->visibility() == VISIBLE && isSelectionRoot();
+ return selectionState() != SelectionNone && style().visibility() == VISIBLE && isSelectionRoot();
}
bool RenderBlock::isSelectionRoot() const
@@ -2697,7 +2697,7 @@
if (!isRenderBlockFlow()) // FIXME: Make multi-column selection gap filling work someday.
return result;
- if (hasColumns() || hasTransform() || style()->columnSpan()) {
+ if (hasColumns() || hasTransform() || style().columnSpan()) {
// FIXME: We should learn how to gap fill multiple columns and transforms eventually.
lastLogicalTop = blockDirectionOffset(rootBlock, offsetFromRootBlock) + logicalHeight();
lastLogicalLeft = logicalLeftSelectionOffset(rootBlock, logicalHeight(), cache);
@@ -2811,7 +2811,7 @@
LayoutRect gapRect = rootBlock.logicalRectToPhysicalRect(rootBlockPhysicalPosition, LayoutRect(logicalLeft, logicalTop, logicalWidth, logicalHeight));
if (paintInfo)
- paintInfo->context->fillRect(pixelSnappedIntRect(gapRect), selectionBackgroundColor(), style()->colorSpace());
+ paintInfo->context->fillRect(pixelSnappedIntRect(gapRect), selectionBackgroundColor(), style().colorSpace());
return gapRect;
}
@@ -2828,7 +2828,7 @@
LayoutRect gapRect = rootBlock.logicalRectToPhysicalRect(rootBlockPhysicalPosition, LayoutRect(rootBlockLogicalLeft, rootBlockLogicalTop, rootBlockLogicalWidth, logicalHeight));
if (paintInfo)
- paintInfo->context->fillRect(pixelSnappedIntRect(gapRect), selObj->selectionBackgroundColor(), selObj->style()->colorSpace());
+ paintInfo->context->fillRect(pixelSnappedIntRect(gapRect), selObj->selectionBackgroundColor(), selObj->style().colorSpace());
return gapRect;
}
@@ -2845,13 +2845,13 @@
LayoutRect gapRect = rootBlock.logicalRectToPhysicalRect(rootBlockPhysicalPosition, LayoutRect(rootBlockLogicalLeft, rootBlockLogicalTop, rootBlockLogicalWidth, logicalHeight));
if (paintInfo)
- paintInfo->context->fillRect(pixelSnappedIntRect(gapRect), selObj->selectionBackgroundColor(), selObj->style()->colorSpace());
+ paintInfo->context->fillRect(pixelSnappedIntRect(gapRect), selObj->selectionBackgroundColor(), selObj->style().colorSpace());
return gapRect;
}
void RenderBlock::getSelectionGapInfo(SelectionState state, bool& leftGap, bool& rightGap)
{
- bool ltr = style()->isLeftToRightDirection();
+ bool ltr = style().isLeftToRightDirection();
leftGap = (state == RenderObject::SelectionInside) ||
(state == RenderObject::SelectionEnd && ltr) ||
(state == RenderObject::SelectionStart && !ltr);
@@ -3106,14 +3106,14 @@
LayoutUnit RenderBlock::textIndentOffset() const
{
LayoutUnit cw = 0;
- if (style()->textIndent().isPercent())
+ if (style().textIndent().isPercent())
cw = containingBlock()->availableLogicalWidth();
- return minimumValueForLength(style()->textIndent(), cw);
+ return minimumValueForLength(style().textIndent(), cw);
}
LayoutUnit RenderBlock::logicalLeftOffsetForContent(RenderRegion* region) const
{
- LayoutUnit logicalLeftOffset = style()->isHorizontalWritingMode() ? borderLeft() + paddingLeft() : borderTop() + paddingTop();
+ LayoutUnit logicalLeftOffset = style().isHorizontalWritingMode() ? borderLeft() + paddingLeft() : borderTop() + paddingTop();
if (!region)
return logicalLeftOffset;
LayoutRect boxRect = borderBoxRectInRegion(region);
@@ -3122,7 +3122,7 @@
LayoutUnit RenderBlock::logicalRightOffsetForContent(RenderRegion* region) const
{
- LayoutUnit logicalRightOffset = style()->isHorizontalWritingMode() ? borderLeft() + paddingLeft() : borderTop() + paddingTop();
+ LayoutUnit logicalRightOffset = style().isHorizontalWritingMode() ? borderLeft() + paddingLeft() : borderTop() + paddingTop();
logicalRightOffset += availableLogicalWidth();
if (!region)
return logicalRightOffset;
@@ -3134,10 +3134,10 @@
{
LayoutUnit left = offsetFromFloats;
- if (applyTextIndent && style()->isLeftToRightDirection())
+ if (applyTextIndent && style().isLeftToRightDirection())
left += textIndentOffset();
- if (style()->lineAlign() == LineAlignNone)
+ if (style().lineAlign() == LineAlignNone)
return left;
// Push in our left offset so that it is aligned with the character grid.
@@ -3146,11 +3146,11 @@
return left;
RenderBlock* lineGrid = layoutState->lineGrid();
- if (!lineGrid || lineGrid->style()->writingMode() != style()->writingMode())
+ if (!lineGrid || lineGrid->style().writingMode() != style().writingMode())
return left;
// FIXME: Should letter-spacing apply? This is complicated since it doesn't apply at the edge?
- float maxCharWidth = lineGrid->style()->font().primaryFont()->maxCharWidth();
+ float maxCharWidth = lineGrid->style().font().primaryFont()->maxCharWidth();
if (!maxCharWidth)
return left;
@@ -3174,10 +3174,10 @@
{
LayoutUnit right = offsetFromFloats;
- if (applyTextIndent && !style()->isLeftToRightDirection())
+ if (applyTextIndent && !style().isLeftToRightDirection())
right -= textIndentOffset();
- if (style()->lineAlign() == LineAlignNone)
+ if (style().lineAlign() == LineAlignNone)
return right;
// Push in our right offset so that it is aligned with the character grid.
@@ -3186,11 +3186,11 @@
return right;
RenderBlock* lineGrid = layoutState->lineGrid();
- if (!lineGrid || lineGrid->style()->writingMode() != style()->writingMode())
+ if (!lineGrid || lineGrid->style().writingMode() != style().writingMode())
return right;
// FIXME: Should letter-spacing apply? This is complicated since it doesn't apply at the edge?
- float maxCharWidth = lineGrid->style()->font().primaryFont()->maxCharWidth();
+ float maxCharWidth = lineGrid->style().font().primaryFont()->maxCharWidth();
if (!maxCharWidth)
return right;
@@ -3213,7 +3213,7 @@
bool RenderBlock::avoidsFloats() const
{
// Floats can't intrude into our box if we have a non-auto column count or width.
- return RenderBox::avoidsFloats() || !style()->hasAutoColumnCount() || !style()->hasAutoColumnWidth();
+ return RenderBox::avoidsFloats() || !style().hasAutoColumnCount() || !style().hasAutoColumnWidth();
}
bool RenderBlock::isPointInOverflowControl(HitTestResult& result, const LayoutPoint& locationInContainer, const LayoutPoint& accumulatedOffset)
@@ -3280,10 +3280,10 @@
}
// Check if the point is outside radii.
- if (!isRenderView() && style()->hasBorderRadius()) {
+ if (!isRenderView() && style().hasBorderRadius()) {
LayoutRect borderRect = borderBoxRect();
borderRect.moveBy(adjustedLocation);
- RoundedRect border = style()->getRoundedBorderFor(borderRect, &view());
+ RoundedRect border = style().getRoundedBorderFor(borderRect, &view());
if (!locationInContainer.intersects(border))
return false;
}
@@ -3307,7 +3307,7 @@
ColumnRectIterator(const RenderBlock& block)
: m_block(block)
, m_colInfo(block.columnInfo())
- , m_direction(m_block.style()->isFlippedBlocksWritingMode() ? 1 : -1)
+ , m_direction(m_block.style().isFlippedBlocksWritingMode() ? 1 : -1)
, m_isHorizontal(block.isHorizontalWritingMode())
, m_logicalLeft(block.logicalLeftOffsetForContent())
{
@@ -3462,7 +3462,7 @@
static inline bool isChildHitTestCandidate(RenderBox& box)
{
- return box.height() && box.style()->visibility() == VISIBLE && !box.isFloatingOrOutOfFlowPositioned();
+ return box.height() && box.style().visibility() == VISIBLE && !box.isFloatingOrOutOfFlowPositioned();
}
VisiblePosition RenderBlock::positionForPoint(const LayoutPoint& point)
@@ -3494,7 +3494,7 @@
while (lastCandidateBox && !isChildHitTestCandidate(*lastCandidateBox))
lastCandidateBox = lastCandidateBox->previousSiblingBox();
- bool blocksAreFlipped = style()->isFlippedBlocksWritingMode();
+ bool blocksAreFlipped = style().isFlippedBlocksWritingMode();
if (lastCandidateBox) {
if (pointInLogicalContents.y() > logicalTopForChild(*lastCandidateBox)
|| (!blocksAreFlipped && pointInLogicalContents.y() == logicalTopForChild(*lastCandidateBox)))
@@ -3538,9 +3538,9 @@
int RenderBlock::columnGap() const
{
- if (style()->hasNormalColumnGap())
- return style()->fontDescription().computedPixelSize(); // "1em" is recommended as the normal gap setting. Matches <p> margins.
- return static_cast<int>(style()->columnGap());
+ if (style().hasNormalColumnGap())
+ return style().fontDescription().computedPixelSize(); // "1em" is recommended as the normal gap setting. Matches <p> margins.
+ return static_cast<int>(style().columnGap());
}
void RenderBlock::calcColumnWidth()
@@ -3554,20 +3554,20 @@
LayoutUnit desiredColumnWidth = contentLogicalWidth();
// For now, we don't support multi-column layouts when printing, since we have to do a lot of work for proper pagination.
- if (document().paginated() || (style()->hasAutoColumnCount() && style()->hasAutoColumnWidth()) || !style()->hasInlineColumnAxis()) {
+ if (document().paginated() || (style().hasAutoColumnCount() && style().hasAutoColumnWidth()) || !style().hasInlineColumnAxis()) {
setDesiredColumnCountAndWidth(desiredColumnCount, desiredColumnWidth);
return;
}
LayoutUnit availWidth = desiredColumnWidth;
LayoutUnit colGap = columnGap();
- LayoutUnit colWidth = max<LayoutUnit>(1, LayoutUnit(style()->columnWidth()));
- int colCount = max<int>(1, style()->columnCount());
+ LayoutUnit colWidth = max<LayoutUnit>(1, LayoutUnit(style().columnWidth()));
+ int colCount = max<int>(1, style().columnCount());
- if (style()->hasAutoColumnWidth() && !style()->hasAutoColumnCount()) {
+ if (style().hasAutoColumnWidth() && !style().hasAutoColumnCount()) {
desiredColumnCount = colCount;
desiredColumnWidth = max<LayoutUnit>(0, (availWidth - ((desiredColumnCount - 1) * colGap)) / desiredColumnCount);
- } else if (!style()->hasAutoColumnWidth() && style()->hasAutoColumnCount()) {
+ } else if (!style().hasAutoColumnWidth() && style().hasAutoColumnCount()) {
desiredColumnCount = max<LayoutUnit>(1, (availWidth + colGap) / (colWidth + colGap));
desiredColumnWidth = ((availWidth + colGap) / desiredColumnCount) - colGap;
} else {
@@ -3581,10 +3581,10 @@
{
// If overflow-y is set to paged-x or paged-y on the body or html element, we'll handle the paginating
// in the RenderView instead.
- bool isPaginated = (style()->overflowY() == OPAGEDX || style()->overflowY() == OPAGEDY) && !(isRoot() || isBody());
+ bool isPaginated = (style().overflowY() == OPAGEDX || style().overflowY() == OPAGEDY) && !(isRoot() || isBody());
return firstChild()
- && (desiredColumnCount != 1 || !style()->hasAutoColumnWidth() || !style()->hasInlineColumnAxis() || isPaginated)
+ && (desiredColumnCount != 1 || !style().hasAutoColumnWidth() || !style().hasInlineColumnAxis() || isPaginated)
&& !firstChild()->isAnonymousColumnsBlock()
&& !firstChild()->isAnonymousColumnSpanBlock();
}
@@ -3610,8 +3610,8 @@
}
info->setDesiredColumnCount(count);
info->setDesiredColumnWidth(width);
- info->setProgressionAxis(style()->hasInlineColumnAxis() ? ColumnInfo::InlineAxis : ColumnInfo::BlockAxis);
- info->setProgressionIsReversed(style()->columnProgression() == ReverseColumnProgression);
+ info->setProgressionAxis(style().hasInlineColumnAxis() ? ColumnInfo::InlineAxis : ColumnInfo::BlockAxis);
+ info->setProgressionIsReversed(style().columnProgression() == ReverseColumnProgression);
}
}
@@ -3680,7 +3680,7 @@
LayoutUnit colLogicalLeft = logicalLeftOffsetForContent();
LayoutUnit colGap = columnGap();
if (colInfo->progressionAxis() == ColumnInfo::InlineAxis) {
- if (style()->isLeftToRightDirection() ^ colInfo->progressionIsReversed())
+ if (style().isLeftToRightDirection() ^ colInfo->progressionIsReversed())
colLogicalLeft += index * (colLogicalWidth + colGap);
else
colLogicalLeft += contentLogicalWidth() - colLogicalWidth - index * (colLogicalWidth + colGap);
@@ -3739,9 +3739,9 @@
// We're inside the column. Translate the x and y into our column coordinate space.
if (colInfo->progressionAxis() == ColumnInfo::InlineAxis)
- point.move(columnPoint.x() - colRect.x(), (!style()->isFlippedBlocksWritingMode() ? logicalOffset : -logicalOffset));
+ point.move(columnPoint.x() - colRect.x(), (!style().isFlippedBlocksWritingMode() ? logicalOffset : -logicalOffset));
else
- point.move((!style()->isFlippedBlocksWritingMode() ? logicalOffset : -logicalOffset) - colRect.x() + borderLeft() + paddingLeft(), 0);
+ point.move((!style().isFlippedBlocksWritingMode() ? logicalOffset : -logicalOffset) - colRect.x() + borderLeft() + paddingLeft(), 0);
return;
}
@@ -3771,9 +3771,9 @@
// We're inside the column. Translate the x and y into our column coordinate space.
if (colInfo->progressionAxis() == ColumnInfo::InlineAxis)
- point.move((!style()->isFlippedBlocksWritingMode() ? logicalOffset : -logicalOffset), columnPoint.y() - colRect.y());
+ point.move((!style().isFlippedBlocksWritingMode() ? logicalOffset : -logicalOffset), columnPoint.y() - colRect.y());
else
- point.move(0, (!style()->isFlippedBlocksWritingMode() ? logicalOffset : -logicalOffset) - colRect.y() + borderTop() + paddingTop());
+ point.move(0, (!style().isFlippedBlocksWritingMode() ? logicalOffset : -logicalOffset) - colRect.y() + borderTop() + paddingTop());
return;
}
@@ -3845,7 +3845,7 @@
LayoutPoint RenderBlock::flipForWritingModeIncludingColumns(const LayoutPoint& point) const
{
ASSERT(hasColumns());
- if (!hasColumns() || !style()->isFlippedBlocksWritingMode())
+ if (!hasColumns() || !style().isFlippedBlocksWritingMode())
return point;
ColumnInfo* colInfo = columnInfo();
LayoutUnit columnLogicalHeight = colInfo->columnHeight();
@@ -3858,7 +3858,7 @@
void RenderBlock::adjustStartEdgeForWritingModeIncludingColumns(LayoutRect& rect) const
{
ASSERT(hasColumns());
- if (!hasColumns() || !style()->isFlippedBlocksWritingMode())
+ if (!hasColumns() || !style().isFlippedBlocksWritingMode())
return;
ColumnInfo* colInfo = columnInfo();
@@ -3924,7 +3924,7 @@
adjustIntrinsicLogicalWidthsForColumns(minLogicalWidth, maxLogicalWidth);
- if (!style()->autoWrap() && childrenInline()) {
+ if (!style().autoWrap() && childrenInline()) {
// A horizontal marquee with inline children has no minimum width.
if (layer() && layer()->marquee() && layer()->marquee()->isHorizontal())
minLogicalWidth = 0;
@@ -3950,21 +3950,21 @@
m_minPreferredLogicalWidth = 0;
m_maxPreferredLogicalWidth = 0;
- RenderStyle* styleToUse = style();
- if (!isTableCell() && styleToUse->logicalWidth().isFixed() && styleToUse->logicalWidth().value() >= 0
- && !(isDeprecatedFlexItem() && !styleToUse->logicalWidth().intValue()))
- m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalWidth().value());
+ const RenderStyle& styleToUse = style();
+ if (!isTableCell() && styleToUse.logicalWidth().isFixed() && styleToUse.logicalWidth().value() >= 0
+ && !(isDeprecatedFlexItem() && !styleToUse.logicalWidth().intValue()))
+ m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalWidth().value());
else
computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth, m_maxPreferredLogicalWidth);
- if (styleToUse->logicalMinWidth().isFixed() && styleToUse->logicalMinWidth().value() > 0) {
- m_maxPreferredLogicalWidth = max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMinWidth().value()));
- m_minPreferredLogicalWidth = max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMinWidth().value()));
+ if (styleToUse.logicalMinWidth().isFixed() && styleToUse.logicalMinWidth().value() > 0) {
+ m_maxPreferredLogicalWidth = max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth().value()));
+ m_minPreferredLogicalWidth = max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth().value()));
}
- if (styleToUse->logicalMaxWidth().isFixed()) {
- m_maxPreferredLogicalWidth = min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMaxWidth().value()));
- m_minPreferredLogicalWidth = min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMaxWidth().value()));
+ if (styleToUse.logicalMaxWidth().isFixed()) {
+ m_maxPreferredLogicalWidth = min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMaxWidth().value()));
+ m_minPreferredLogicalWidth = min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMaxWidth().value()));
}
// Table layout uses integers, ceil the preferred widths to ensure that they can contain the contents.
@@ -3985,17 +3985,17 @@
// FIXME: make this method virtual and move the code to RenderMultiColumnBlock once the old
// multicol code is gone.
- if (!style()->hasAutoColumnCount() || !style()->hasAutoColumnWidth()) {
+ if (!style().hasAutoColumnCount() || !style().hasAutoColumnWidth()) {
// The min/max intrinsic widths calculated really tell how much space elements need when
// laid out inside the columns. In order to eventually end up with the desired column width,
// we need to convert them to values pertaining to the multicol container.
- int columnCount = style()->hasAutoColumnCount() ? 1 : style()->columnCount();
+ int columnCount = style().hasAutoColumnCount() ? 1 : style().columnCount();
LayoutUnit columnWidth;
LayoutUnit gapExtra = (columnCount - 1) * columnGap();
- if (style()->hasAutoColumnWidth())
+ if (style().hasAutoColumnWidth())
minLogicalWidth = minLogicalWidth * columnCount + gapExtra;
else {
- columnWidth = style()->columnWidth();
+ columnWidth = style().columnWidth();
minLogicalWidth = min(minLogicalWidth, columnWidth);
}
// FIXME: If column-count is auto here, we should resolve it to calculate the maximum
@@ -4080,13 +4080,13 @@
static LayoutUnit getBorderPaddingMargin(const RenderBoxModelObject* child, bool endOfInline)
{
- RenderStyle* childStyle = child->style();
+ const RenderStyle& childStyle = child->style();
if (endOfInline)
- return getBPMWidth(child->marginEnd(), childStyle->marginEnd()) +
- getBPMWidth(child->paddingEnd(), childStyle->paddingEnd()) +
+ return getBPMWidth(child->marginEnd(), childStyle.marginEnd()) +
+ getBPMWidth(child->paddingEnd(), childStyle.paddingEnd()) +
child->borderEnd();
- return getBPMWidth(child->marginStart(), childStyle->marginStart()) +
- getBPMWidth(child->paddingStart(), childStyle->paddingStart()) +
+ return getBPMWidth(child->marginStart(), childStyle.marginStart()) +
+ getBPMWidth(child->paddingStart(), childStyle.paddingStart()) +
child->borderStart();
}
@@ -4097,8 +4097,8 @@
// Collapse away the trailing space at the end of a block.
RenderText* t = toRenderText(trailingSpaceChild);
const UChar space = ' ';
- const Font& font = t->style()->font(); // FIXME: This ignores first-line.
- float spaceWidth = font.width(RenderBlock::constructTextRun(t, font, &space, 1, *t->style()));
+ const Font& font = t->style().font(); // FIXME: This ignores first-line.
+ float spaceWidth = font.width(RenderBlock::constructTextRun(t, font, &space, 1, t->style()));
inlineMax -= spaceWidth + font.wordSpacing();
if (inlineMin > inlineMax)
inlineMin = inlineMax;
@@ -4135,7 +4135,7 @@
float inlineMax = 0;
float inlineMin = 0;
- RenderStyle* styleToUse = style();
+ const RenderStyle& styleToUse = style();
RenderBlock* containingBlock = this->containingBlock();
LayoutUnit cw = containingBlock ? containingBlock->contentLogicalWidth() : LayoutUnit();
@@ -4147,10 +4147,10 @@
// Firefox and Opera will allow a table cell to grow to fit an image inside it under
// very specific cirucumstances (in order to match common WinIE renderings).
// Not supporting the quirk has caused us to mis-render some real sites. (See Bugzilla 10517.)
- bool allowImagesToBreak = !document().inQuirksMode() || !isTableCell() || !styleToUse->logicalWidth().isIntrinsicOrAuto();
+ bool allowImagesToBreak = !document().inQuirksMode() || !isTableCell() || !styleToUse.logicalWidth().isIntrinsicOrAuto();
bool autoWrap, oldAutoWrap;
- autoWrap = oldAutoWrap = styleToUse->autoWrap();
+ autoWrap = oldAutoWrap = styleToUse.autoWrap();
InlineMinMaxIterator childIterator(this);
@@ -4159,13 +4159,13 @@
// Signals the text indent was more negative than the min preferred width
bool hasRemainingNegativeTextIndent = false;
- LayoutUnit textIndent = minimumValueForLength(styleToUse->textIndent(), cw);
+ LayoutUnit textIndent = minimumValueForLength(styleToUse.textIndent(), cw);
RenderObject* prevFloat = 0;
bool isPrevChildInlineFlow = false;
bool shouldBreakLineAfterText = false;
while (RenderObject* child = childIterator.next()) {
- autoWrap = child->isReplaced() ? child->parent()->style()->autoWrap() :
- child->style()->autoWrap();
+ autoWrap = child->isReplaced() ? child->parent()->style().autoWrap() :
+ child->style().autoWrap();
if (!child->isBR()) {
// Step One: determine whether or not we need to go ahead and
@@ -4203,7 +4203,7 @@
// values (if any of them are larger than our current min/max). We then look at
// the width of the last non-breakable run and use that to start a new line
// (unless we end in whitespace).
- RenderStyle* childStyle = child->style();
+ const RenderStyle& childStyle = child->style();
float childMin = 0;
float childMax = 0;
@@ -4228,8 +4228,8 @@
} else {
// Inline replaced elts add in their margins to their min/max values.
LayoutUnit margins = 0;
- Length startMargin = childStyle->marginStart();
- Length endMargin = childStyle->marginEnd();
+ Length startMargin = childStyle.marginStart();
+ Length endMargin = childStyle.marginEnd();
if (startMargin.isFixed())
margins += adjustFloatForSubPixelLayout(startMargin.value());
if (endMargin.isFixed())
@@ -4249,8 +4249,8 @@
bool clearPreviousFloat;
if (child->isFloating()) {
clearPreviousFloat = (prevFloat
- && ((prevFloat->style()->floating() == LeftFloat && (childStyle->clear() & CLEFT))
- || (prevFloat->style()->floating() == RightFloat && (childStyle->clear() & CRIGHT))));
+ && ((prevFloat->style().floating() == LeftFloat && (childStyle.clear() & CLEFT))
+ || (prevFloat->style().floating() == RightFloat && (childStyle.clear() & CRIGHT))));
prevFloat = child;
} else
clearPreviousFloat = false;
@@ -4310,7 +4310,7 @@
// Case (3). Text.
RenderText* t = toRenderText(child);
- if (t->style()->hasTextCombine() && t->isCombineText())
+ if (t->style().hasTextCombine() && t->isCombineText())
toRenderCombineText(*t).combineText();
// Determine if we have a breakable character. Pass in
@@ -4424,7 +4424,7 @@
oldAutoWrap = autoWrap;
}
- if (styleToUse->collapseWhiteSpace())
+ if (styleToUse.collapseWhiteSpace())
stripTrailingSpace(inlineMax, inlineMin, trailingSpaceChild);
updatePreferredWidth(minLogicalWidth, inlineMin);
@@ -4433,8 +4433,8 @@
void RenderBlock::computeBlockPreferredLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const
{
- RenderStyle* styleToUse = style();
- bool nowrap = styleToUse->whiteSpace() == NOWRAP;
+ const RenderStyle& styleToUse = style();
+ bool nowrap = styleToUse.whiteSpace() == NOWRAP;
RenderObject* child = firstChild();
RenderBlock* containingBlock = this->containingBlock();
@@ -4446,14 +4446,14 @@
continue;
}
- RenderStyle* childStyle = child->style();
+ const RenderStyle& childStyle = child->style();
if (child->isFloating() || (child->isBox() && toRenderBox(child)->avoidsFloats())) {
LayoutUnit floatTotalWidth = floatLeftWidth + floatRightWidth;
- if (childStyle->clear() & CLEFT) {
+ if (childStyle.clear() & CLEFT) {
maxLogicalWidth = max(floatTotalWidth, maxLogicalWidth);
floatLeftWidth = 0;
}
- if (childStyle->clear() & CRIGHT) {
+ if (childStyle.clear() & CRIGHT) {
maxLogicalWidth = max(floatTotalWidth, maxLogicalWidth);
floatRightWidth = 0;
}
@@ -4462,8 +4462,8 @@
// A margin basically has three types: fixed, percentage, and auto (variable).
// Auto and percentage margins simply become 0 when computing min/max width.
// Fixed margins can be added in as is.
- Length startMarginLength = childStyle->marginStartUsing(styleToUse);
- Length endMarginLength = childStyle->marginEndUsing(styleToUse);
+ Length startMarginLength = childStyle.marginStartUsing(&styleToUse);
+ Length endMarginLength = childStyle.marginEndUsing(&styleToUse);
LayoutUnit margin = 0;
LayoutUnit marginStart = 0;
LayoutUnit marginEnd = 0;
@@ -4498,7 +4498,7 @@
// Determine a left and right max value based off whether or not the floats can fit in the
// margins of the object. For negative margins, we will attempt to overlap the float if the negative margin
// is smaller than the float width.
- bool ltr = containingBlock ? containingBlock->style()->isLeftToRightDirection() : styleToUse->isLeftToRightDirection();
+ bool ltr = containingBlock ? containingBlock->style().isLeftToRightDirection() : styleToUse.isLeftToRightDirection();
LayoutUnit marginLogicalLeft = ltr ? marginStart : marginEnd;
LayoutUnit marginLogicalRight = ltr ? marginEnd : marginStart;
LayoutUnit maxLeft = marginLogicalLeft > 0 ? max(floatLeftWidth, marginLogicalLeft) : floatLeftWidth + marginLogicalLeft;
@@ -4512,7 +4512,7 @@
}
if (child->isFloating()) {
- if (childStyle->floating() == LeftFloat)
+ if (childStyle.floating() == LeftFloat)
floatLeftWidth += w;
else
floatRightWidth += w;
@@ -4550,13 +4550,13 @@
return RenderBox::lineHeight(firstLine, direction, linePositionMode);
if (firstLine && document().styleSheetCollection().usesFirstLineRules()) {
- RenderStyle* s = firstLine ? firstLineStyle() : style();
- if (s != style())
- return s->computedLineHeight(&view());
+ RenderStyle& s = firstLine ? firstLineStyle() : style();
+ if (&s != &style())
+ return s.computedLineHeight(&view());
}
if (m_lineHeight == -1)
- m_lineHeight = style()->computedLineHeight(&view());
+ m_lineHeight = style().computedLineHeight(&view());
return m_lineHeight;
}
@@ -4572,7 +4572,7 @@
// FIXME: Might be better to have a custom CSS property instead, so that if the theme
// is turned off, checkboxes/radios will still have decent baselines.
// FIXME: Need to patch form controls to deal with vertical lines.
- if (style()->hasAppearance() && !theme()->isControlContainer(style()->appearance()))
+ if (style().hasAppearance() && !theme()->isControlContainer(style().appearance()))
return theme()->baselinePosition(this);
// CSS2.1 states that the baseline of an inline block is the baseline of the last line box in
@@ -4593,8 +4593,8 @@
return RenderBox::baselinePosition(baselineType, firstLine, direction, linePositionMode);
}
- const RenderStyle* style = firstLine ? firstLineStyle() : this->style();
- const FontMetrics& fontMetrics = style->fontMetrics();
+ const RenderStyle& style = firstLine ? firstLineStyle() : this->style();
+ const FontMetrics& fontMetrics = style.fontMetrics();
return fontMetrics.ascent(baselineType) + (lineHeight(firstLine, direction, linePositionMode) - fontMetrics.height()) / 2;
}
@@ -4603,8 +4603,8 @@
if (!document().inNoQuirksMode() && replacedHeight)
return replacedHeight;
- const RenderStyle* style = isFirstLine ? firstLineStyle() : this->style();
- if (!(style->lineBoxContain() & LineBoxContainBlock))
+ const RenderStyle& style = isFirstLine ? firstLineStyle() : this->style();
+ if (!(style.lineBoxContain() & LineBoxContainBlock))
return 0;
return std::max<LayoutUnit>(replacedHeight, lineHeight(isFirstLine, isHorizontalWritingMode() ? HorizontalLine : VerticalLine, PositionOfInteriorLineBoxes));
@@ -4642,7 +4642,7 @@
}
if (!haveNormalFlowChild && hasLineIfEmpty()) {
- auto& fontMetrics = firstLineStyle()->fontMetrics();
+ auto& fontMetrics = firstLineStyle().fontMetrics();
return fontMetrics.ascent()
+ (lineHeight(true, lineDirection, PositionOfInteriorLineBoxes) - fontMetrics.height()) / 2
+ (lineDirection == HorizontalLine ? borderTop() + paddingTop() : borderRight() + paddingRight());
@@ -4656,7 +4656,7 @@
RenderBlock* firstLineBlock = const_cast<RenderBlock*>(this);
bool hasPseudo = false;
while (true) {
- hasPseudo = firstLineBlock->style()->hasPseudoStyle(FIRST_LINE);
+ hasPseudo = firstLineBlock->style().hasPseudoStyle(FIRST_LINE);
if (hasPseudo)
break;
RenderElement* parentBlock = firstLineBlock->parent();
@@ -4680,7 +4680,7 @@
static RenderStyle* styleForFirstLetter(RenderObject* firstLetterBlock, RenderObject* firstLetterContainer)
{
- RenderStyle* pseudoStyle = firstLetterBlock->getCachedPseudoStyle(FIRST_LETTER, firstLetterContainer->firstLineStyle());
+ RenderStyle* pseudoStyle = firstLetterBlock->getCachedPseudoStyle(FIRST_LETTER, &firstLetterContainer->firstLineStyle());
// Force inline display (except for floating first-letters).
pseudoStyle->setDisplay(pseudoStyle->isFloating() ? BLOCK : INLINE);
// CSS2 says first-letter can't be positioned.
@@ -4711,7 +4711,7 @@
// first-letter, though.
// FIXME: Remove when buttons are implemented with align-items instead
// of flexbox.
- bool canHaveFirstLetterRenderer = firstLetterBlock->style()->hasPseudoStyle(FIRST_LETTER)
+ bool canHaveFirstLetterRenderer = firstLetterBlock->style().hasPseudoStyle(FIRST_LETTER)
&& firstLetterBlock->canHaveGeneratedChildren()
&& (!firstLetterBlock->isFlexibleBox() || firstLetterBlock->isRenderButton());
if (canHaveFirstLetterRenderer)
@@ -4734,7 +4734,7 @@
RenderStyle* pseudoStyle = styleForFirstLetter(firstLetterBlock, firstLetterContainer);
ASSERT(firstLetter->isFloating() || firstLetter->isInline());
- if (Style::determineChange(firstLetter->style(), pseudoStyle, &frame().settings()) == Style::Detach) {
+ if (Style::determineChange(&firstLetter->style(), pseudoStyle, &frame().settings()) == Style::Detach) {
// The first-letter renderer needs to be replaced. Create a new renderer of the right type.
RenderBoxModelObject* newFirstLetter;
if (pseudoStyle->display() == INLINE)
@@ -4843,7 +4843,7 @@
if (!document().styleSheetCollection().usesFirstLetterRules())
return;
// Don't recur
- if (style()->styleType() == FIRST_LETTER)
+ if (style().styleType() == FIRST_LETTER)
return;
RenderElement* firstLetterBlock = findFirstLetterBlock(this);
@@ -4859,14 +4859,14 @@
if (current.isListMarker())
descendant = current.nextSibling();
else if (current.isFloatingOrOutOfFlowPositioned()) {
- if (current.style()->styleType() == FIRST_LETTER) {
+ if (current.style().styleType() == FIRST_LETTER) {
descendant = current.firstChild();
break;
}
descendant = current.nextSibling();
} else if (current.isReplaced() || current.isRenderButton() || current.isMenuList())
break;
- else if (current.style()->hasPseudoStyle(FIRST_LETTER) && current.canHaveGeneratedChildren()) {
+ else if (current.style().hasPseudoStyle(FIRST_LETTER) && current.canHaveGeneratedChildren()) {
// We found a lower-level node with first-letter, which supersedes the higher-level style
firstLetterBlock = ¤t;
descendant = current.firstChild();
@@ -4877,7 +4877,7 @@
if (!descendant)
return;
- if (descendant->parent()->style()->styleType() == FIRST_LETTER) {
+ if (descendant->parent()->style().styleType() == FIRST_LETTER) {
// Destroy the first-letter object if it is no longer the first child.
RenderObject* remainingText = descendant->parent()->nextSibling();
if (remainingText && descendant->node() != remainingText->node()) {
@@ -4986,7 +4986,7 @@
RenderStyle* RenderBlock::outlineStyleForRepaint() const
{
- return isAnonymousBlockContinuation() ? continuation()->style() : style();
+ return isAnonymousBlockContinuation() ? &continuation()->style() : &style();
}
void RenderBlock::childBecameNonInline(RenderObject*)
@@ -5078,7 +5078,7 @@
return createAnonymousColumnsWithParentRenderer(parent);
if (isAnonymousColumnSpanBlock())
return createAnonymousColumnSpanWithParentRenderer(parent);
- return createAnonymousWithParentRendererAndDisplay(parent, style()->display());
+ return createAnonymousWithParentRendererAndDisplay(parent, style().display());
}
@@ -5221,12 +5221,12 @@
// If the child has the same directionality as we do, then we can just return its
// margin quirk.
if (!child.isWritingModeRoot())
- return child.isRenderBlock() ? toRenderBlock(child).hasMarginBeforeQuirk() : child.style()->hasMarginBeforeQuirk();
+ return child.isRenderBlock() ? toRenderBlock(child).hasMarginBeforeQuirk() : child.style().hasMarginBeforeQuirk();
// The child has a different directionality. If the child is parallel, then it's just
// flipped relative to us. We can use the opposite edge.
if (child.isHorizontalWritingMode() == isHorizontalWritingMode())
- return child.isRenderBlock() ? toRenderBlock(child).hasMarginAfterQuirk() : child.style()->hasMarginAfterQuirk();
+ return child.isRenderBlock() ? toRenderBlock(child).hasMarginAfterQuirk() : child.style().hasMarginAfterQuirk();
// The child is perpendicular to us and box sides are never quirky in html.css, and we don't really care about
// whether or not authors specified quirky ems, since they're an implementation detail.
@@ -5238,12 +5238,12 @@
// If the child has the same directionality as we do, then we can just return its
// margin quirk.
if (!child.isWritingModeRoot())
- return child.isRenderBlock() ? toRenderBlock(child).hasMarginAfterQuirk() : child.style()->hasMarginAfterQuirk();
+ return child.isRenderBlock() ? toRenderBlock(child).hasMarginAfterQuirk() : child.style().hasMarginAfterQuirk();
// The child has a different directionality. If the child is parallel, then it's just
// flipped relative to us. We can use the opposite edge.
if (child.isHorizontalWritingMode() == isHorizontalWritingMode())
- return child.isRenderBlock() ? toRenderBlock(child).hasMarginBeforeQuirk() : child.style()->hasMarginBeforeQuirk();
+ return child.isRenderBlock() ? toRenderBlock(child).hasMarginBeforeQuirk() : child.style().hasMarginBeforeQuirk();
// The child is perpendicular to us and box sides are never quirky in html.css, and we don't really care about
// whether or not authors specified quirky ems, since they're an implementation detail.
@@ -5261,11 +5261,11 @@
return "RenderBlock (floating)";
if (isOutOfFlowPositioned())
return "RenderBlock (positioned)";
- if (style() && isAnonymousColumnsBlock())
+ if (isAnonymousColumnsBlock())
return "RenderBlock (anonymous multi-column)";
- if (style() && isAnonymousColumnSpanBlock())
+ if (isAnonymousColumnSpanBlock())
return "RenderBlock (anonymous multi-column span)";
- if (style() && isAnonymousBlock())
+ if (isAnonymousBlock())
return "RenderBlock (anonymous)";
// FIXME: Temporary hack while the new generated content system is being implemented.
if (isPseudoElement())
@@ -5276,7 +5276,7 @@
return "RenderBlock (relative positioned)";
if (isStickyPositioned())
return "RenderBlock (sticky positioned)";
- if (style() && isRunIn())
+ if (isRunIn())
return "RenderBlock (run-in)";
return "RenderBlock";
}
@@ -5369,9 +5369,9 @@
// FIXME: Do we need to convert all our inline displays to block-type in the anonymous logic ?
RenderBlock* newBox;
if (display == FLEX || display == INLINE_FLEX)
- newBox = new RenderFlexibleBox(parent->document(), RenderStyle::createAnonymousStyleWithDisplay(parent->style(), FLEX));
+ newBox = new RenderFlexibleBox(parent->document(), RenderStyle::createAnonymousStyleWithDisplay(&parent->style(), FLEX));
else
- newBox = new RenderBlockFlow(parent->document(), RenderStyle::createAnonymousStyleWithDisplay(parent->style(), BLOCK));
+ newBox = new RenderBlockFlow(parent->document(), RenderStyle::createAnonymousStyleWithDisplay(&parent->style(), BLOCK));
newBox->initializeStyle();
return newBox;
@@ -5379,8 +5379,8 @@
RenderBlock* RenderBlock::createAnonymousColumnsWithParentRenderer(const RenderObject* parent)
{
- auto newStyle = RenderStyle::createAnonymousStyleWithDisplay(parent->style(), BLOCK);
- newStyle.get().inheritColumnPropertiesFrom(parent->style());
+ auto newStyle = RenderStyle::createAnonymousStyleWithDisplay(&parent->style(), BLOCK);
+ newStyle.get().inheritColumnPropertiesFrom(&parent->style());
RenderBlock* newBox = new RenderBlockFlow(parent->document(), std::move(newStyle));
newBox->initializeStyle();
@@ -5389,7 +5389,7 @@
RenderBlock* RenderBlock::createAnonymousColumnSpanWithParentRenderer(const RenderObject* parent)
{
- auto newStyle = RenderStyle::createAnonymousStyleWithDisplay(parent->style(), BLOCK);
+ auto newStyle = RenderStyle::createAnonymousStyleWithDisplay(&parent->style(), BLOCK);
newStyle.get().setColumnSpan(ColumnSpanAll);
RenderBlock* newBox = new RenderBlockFlow(parent->document(), std::move(newStyle));
@@ -5449,7 +5449,7 @@
// Copied and modified from RenderBlock::lineCount.
// Only descend into list items.
int count = 0;
- if (style()->visibility() == VISIBLE) {
+ if (style().visibility() == VISIBLE) {
if (childrenInline()) {
for (RootInlineBox* box = firstRootBox(); box; box = box->nextRootBox())
count++;
diff --git a/Source/WebCore/rendering/RenderBlock.h b/Source/WebCore/rendering/RenderBlock.h
index 4980632..8bf19f0 100644
--- a/Source/WebCore/rendering/RenderBlock.h
+++ b/Source/WebCore/rendering/RenderBlock.h
@@ -172,12 +172,12 @@
}
LayoutUnit startOffsetForLine(LayoutUnit position, bool shouldIndentText, RenderRegion* region, LayoutUnit logicalHeight = 0) const
{
- return style()->isLeftToRightDirection() ? logicalLeftOffsetForLine(position, shouldIndentText, region, logicalHeight)
+ return style().isLeftToRightDirection() ? logicalLeftOffsetForLine(position, shouldIndentText, region, logicalHeight)
: logicalWidth() - logicalRightOffsetForLine(position, shouldIndentText, region, logicalHeight);
}
LayoutUnit endOffsetForLine(LayoutUnit position, bool shouldIndentText, RenderRegion* region, LayoutUnit logicalHeight = 0) const
{
- return !style()->isLeftToRightDirection() ? logicalLeftOffsetForLine(position, shouldIndentText, region, logicalHeight)
+ return !style().isLeftToRightDirection() ? logicalLeftOffsetForLine(position, shouldIndentText, region, logicalHeight)
: logicalWidth() - logicalRightOffsetForLine(position, shouldIndentText, region, logicalHeight);
}
@@ -207,12 +207,12 @@
}
LayoutUnit startOffsetForLine(LayoutUnit position, bool shouldIndentText, LayoutUnit logicalHeight = 0) const
{
- return style()->isLeftToRightDirection() ? logicalLeftOffsetForLine(position, shouldIndentText, logicalHeight)
+ return style().isLeftToRightDirection() ? logicalLeftOffsetForLine(position, shouldIndentText, logicalHeight)
: logicalWidth() - logicalRightOffsetForLine(position, shouldIndentText, logicalHeight);
}
LayoutUnit endOffsetForLine(LayoutUnit position, bool shouldIndentText, LayoutUnit logicalHeight = 0) const
{
- return !style()->isLeftToRightDirection() ? logicalLeftOffsetForLine(position, shouldIndentText, logicalHeight)
+ return !style().isLeftToRightDirection() ? logicalLeftOffsetForLine(position, shouldIndentText, logicalHeight)
: logicalWidth() - logicalRightOffsetForLine(position, shouldIndentText, logicalHeight);
}
@@ -264,7 +264,7 @@
static bool shouldSkipCreatingRunsForObject(RenderObject* obj)
{
- return obj->isFloating() || (obj->isOutOfFlowPositioned() && !obj->style()->isOriginalDisplayInlineType() && !obj->container()->isRenderInline());
+ return obj->isFloating() || (obj->isOutOfFlowPositioned() && !obj->style().isOriginalDisplayInlineType() && !obj->container()->isRenderInline());
}
static TextRun constructTextRun(RenderObject* context, const Font&, const String&, const RenderStyle&,
@@ -314,14 +314,14 @@
LayoutUnit logicalTopForChild(const RenderBox& child) const { return isHorizontalWritingMode() ? child.y() : child.x(); }
void setLogicalLeftForChild(RenderBox& child, LayoutUnit logicalLeft, ApplyLayoutDeltaMode = DoNotApplyLayoutDelta);
void setLogicalTopForChild(RenderBox& child, LayoutUnit logicalTop, ApplyLayoutDeltaMode = DoNotApplyLayoutDelta);
- LayoutUnit marginBeforeForChild(const RenderBoxModelObject& child) const { return child.marginBefore(style()); }
- LayoutUnit marginAfterForChild(const RenderBoxModelObject& child) const { return child.marginAfter(style()); }
- LayoutUnit marginStartForChild(const RenderBoxModelObject& child) const { return child.marginStart(style()); }
- LayoutUnit marginEndForChild(const RenderBoxModelObject& child) const { return child.marginEnd(style()); }
- void setMarginStartForChild(RenderBox& child, LayoutUnit value) const { child.setMarginStart(value, style()); }
- void setMarginEndForChild(RenderBox& child, LayoutUnit value) const { child.setMarginEnd(value, style()); }
- void setMarginBeforeForChild(RenderBox& child, LayoutUnit value) const { child.setMarginBefore(value, style()); }
- void setMarginAfterForChild(RenderBox& child, LayoutUnit value) const { child.setMarginAfter(value, style()); }
+ LayoutUnit marginBeforeForChild(const RenderBoxModelObject& child) const { return child.marginBefore(&style()); }
+ LayoutUnit marginAfterForChild(const RenderBoxModelObject& child) const { return child.marginAfter(&style()); }
+ LayoutUnit marginStartForChild(const RenderBoxModelObject& child) const { return child.marginStart(&style()); }
+ LayoutUnit marginEndForChild(const RenderBoxModelObject& child) const { return child.marginEnd(&style()); }
+ void setMarginStartForChild(RenderBox& child, LayoutUnit value) const { child.setMarginStart(value, &style()); }
+ void setMarginEndForChild(RenderBox& child, LayoutUnit value) const { child.setMarginEnd(value, &style()); }
+ void setMarginBeforeForChild(RenderBox& child, LayoutUnit value) const { child.setMarginBefore(value, &style()); }
+ void setMarginAfterForChild(RenderBox& child, LayoutUnit value) const { child.setMarginAfter(value, &style()); }
LayoutUnit collapsedMarginBeforeForChild(const RenderBox& child) const;
LayoutUnit collapsedMarginAfterForChild(const RenderBox& child) const;
@@ -339,11 +339,11 @@
}
LayoutUnit startOffsetForContent(RenderRegion* region) const
{
- return style()->isLeftToRightDirection() ? logicalLeftOffsetForContent(region) : logicalWidth() - logicalRightOffsetForContent(region);
+ return style().isLeftToRightDirection() ? logicalLeftOffsetForContent(region) : logicalWidth() - logicalRightOffsetForContent(region);
}
LayoutUnit endOffsetForContent(RenderRegion* region) const
{
- return !style()->isLeftToRightDirection() ? logicalLeftOffsetForContent(region) : logicalWidth() - logicalRightOffsetForContent(region);
+ return !style().isLeftToRightDirection() ? logicalLeftOffsetForContent(region) : logicalWidth() - logicalRightOffsetForContent(region);
}
LayoutUnit logicalLeftOffsetForContent(LayoutUnit blockOffset) const
{
@@ -367,8 +367,8 @@
}
LayoutUnit logicalLeftOffsetForContent() const { return isHorizontalWritingMode() ? borderLeft() + paddingLeft() : borderTop() + paddingTop(); }
LayoutUnit logicalRightOffsetForContent() const { return logicalLeftOffsetForContent() + availableLogicalWidth(); }
- LayoutUnit startOffsetForContent() const { return style()->isLeftToRightDirection() ? logicalLeftOffsetForContent() : logicalWidth() - logicalRightOffsetForContent(); }
- LayoutUnit endOffsetForContent() const { return !style()->isLeftToRightDirection() ? logicalLeftOffsetForContent() : logicalWidth() - logicalRightOffsetForContent(); }
+ LayoutUnit startOffsetForContent() const { return style().isLeftToRightDirection() ? logicalLeftOffsetForContent() : logicalWidth() - logicalRightOffsetForContent(); }
+ LayoutUnit endOffsetForContent() const { return !style().isLeftToRightDirection() ? logicalLeftOffsetForContent() : logicalWidth() - logicalRightOffsetForContent(); }
LayoutUnit computeStartPositionDeltaForChildAvoidingFloats(const RenderBox& child, LayoutUnit childMarginStart, RenderRegion* = 0);
diff --git a/Source/WebCore/rendering/RenderBlockFlow.cpp b/Source/WebCore/rendering/RenderBlockFlow.cpp
index ccc0d08..21f9dc0 100644
--- a/Source/WebCore/rendering/RenderBlockFlow.cpp
+++ b/Source/WebCore/rendering/RenderBlockFlow.cpp
@@ -62,21 +62,21 @@
, m_determinedMarginBeforeQuirk(false)
, m_discardMargin(false)
{
- RenderStyle* blockStyle = block.style();
+ const RenderStyle& blockStyle = block.style();
ASSERT(block.isRenderView() || block.parent());
m_canCollapseWithChildren = !block.isRenderView() && !block.isRoot() && !block.isOutOfFlowPositioned()
&& !block.isFloating() && !block.isTableCell() && !block.hasOverflowClip() && !block.isInlineBlockOrInlineTable()
&& !block.isRenderFlowThread() && !block.isWritingModeRoot() && !block.parent()->isFlexibleBox()
- && blockStyle->hasAutoColumnCount() && blockStyle->hasAutoColumnWidth() && !blockStyle->columnSpan();
+ && blockStyle.hasAutoColumnCount() && blockStyle.hasAutoColumnWidth() && !blockStyle.columnSpan();
- m_canCollapseMarginBeforeWithChildren = m_canCollapseWithChildren && !beforeBorderPadding && blockStyle->marginBeforeCollapse() != MSEPARATE;
+ m_canCollapseMarginBeforeWithChildren = m_canCollapseWithChildren && !beforeBorderPadding && blockStyle.marginBeforeCollapse() != MSEPARATE;
// If any height other than auto is specified in CSS, then we don't collapse our bottom
// margins with our children's margins. To do otherwise would be to risk odd visual
// effects when the children overflow out of the parent block and yet still collapse
// with it. We also don't collapse if we have any bottom border/padding.
m_canCollapseMarginAfterWithChildren = m_canCollapseWithChildren && !afterBorderPadding
- && (blockStyle->logicalHeight().isAuto() && !blockStyle->logicalHeight().value()) && blockStyle->marginAfterCollapse() != MSEPARATE;
+ && (blockStyle.logicalHeight().isAuto() && !blockStyle.logicalHeight().value()) && blockStyle.marginAfterCollapse() != MSEPARATE;
m_quirkContainer = block.isTableCell() || block.isBody();
@@ -325,8 +325,8 @@
bool hasSpecifiedPageLogicalHeight = false;
checkForPaginationLogicalHeightChange(pageLogicalHeight, pageLogicalHeightChanged, hasSpecifiedPageLogicalHeight);
- RenderStyle* styleToUse = style();
- LayoutStateMaintainer statePusher(&view(), this, locationOffset(), hasColumns() || hasTransform() || hasReflection() || styleToUse->isFlippedBlocksWritingMode(), pageLogicalHeight, pageLogicalHeightChanged, columnInfo());
+ const RenderStyle& styleToUse = style();
+ LayoutStateMaintainer statePusher(&view(), this, locationOffset(), hasColumns() || hasTransform() || hasReflection() || styleToUse.isFlippedBlocksWritingMode(), pageLogicalHeight, pageLogicalHeightChanged, columnInfo());
prepareShapesAndPaginationBeforeBlockLayout(relayoutChildren);
if (!relayoutChildren)
@@ -346,8 +346,8 @@
if (!isCell) {
initMaxMarginValues();
- setHasMarginBeforeQuirk(styleToUse->hasMarginBeforeQuirk());
- setHasMarginAfterQuirk(styleToUse->hasMarginAfterQuirk());
+ setHasMarginBeforeQuirk(styleToUse.hasMarginBeforeQuirk());
+ setHasMarginAfterQuirk(styleToUse.hasMarginAfterQuirk());
setPaginationStrut(0);
}
@@ -422,7 +422,7 @@
// FIXME: This repaint logic should be moved into a separate helper function!
// Repaint with our new bounds if they are different from our old bounds.
bool didFullRepaint = repainter.repaintAfterLayout();
- if (!didFullRepaint && repaintLogicalTop != repaintLogicalBottom && (styleToUse->visibility() == VISIBLE || enclosingLayer()->hasVisibleContent())) {
+ if (!didFullRepaint && repaintLogicalTop != repaintLogicalBottom && (styleToUse.visibility() == VISIBLE || enclosingLayer()->hasVisibleContent())) {
// FIXME: We could tighten up the left and right invalidation points if we let layoutInlineChildren fill them in based off the particular lines
// it had to lay out. We wouldn't need the hasOverflowClip() hack in that case either.
LayoutUnit repaintLogicalLeft = logicalLeftVisualOverflow();
@@ -691,7 +691,7 @@
void RenderBlockFlow::adjustPositionedBlock(RenderBox& child, const MarginInfo& marginInfo)
{
bool isHorizontal = isHorizontalWritingMode();
- bool hasStaticBlockPosition = child.style()->hasStaticBlockPosition(isHorizontal);
+ bool hasStaticBlockPosition = child.style().hasStaticBlockPosition(isHorizontal);
LayoutUnit logicalTop = logicalHeight();
updateStaticInlinePositionForChild(child, logicalTop);
@@ -735,7 +735,7 @@
void RenderBlockFlow::updateStaticInlinePositionForChild(RenderBox& child, LayoutUnit logicalTop)
{
- if (child.style()->isOriginalDisplayInlineType())
+ if (child.style().isOriginalDisplayInlineType())
setStaticInlinePositionForChild(child, logicalTop, startAlignedOffsetForLine(logicalTop, false));
else
setStaticInlinePositionForChild(child, logicalTop, startOffsetForContent(logicalTop));
@@ -1010,7 +1010,7 @@
marginInfo.setAtBeforeSideOfBlock(false);
// In case the child discarded the before margin of the block we need to reset the mustDiscardMarginBefore flag to the initial value.
- setMustDiscardMarginBefore(style()->marginBeforeCollapse() == MDISCARD);
+ setMustDiscardMarginBefore(style().marginBeforeCollapse() == MDISCARD);
}
LayoutUnit logicalTop = yPos + heightIncrease;
@@ -1027,12 +1027,12 @@
// Give up if in quirks mode and we're a body/table cell and the top margin of the child box is quirky.
// Give up if the child specified -webkit-margin-collapse: separate that prevents collapsing.
// FIXME: Use writing mode independent accessor for marginBeforeCollapse.
- if ((document().inQuirksMode() && hasMarginAfterQuirk(child) && (isTableCell() || isBody())) || child.style()->marginBeforeCollapse() == MSEPARATE)
+ if ((document().inQuirksMode() && hasMarginAfterQuirk(child) && (isTableCell() || isBody())) || child.style().marginBeforeCollapse() == MSEPARATE)
return;
// The margins are discarded by a child that specified -webkit-margin-collapse: discard.
// FIXME: Use writing mode independent accessor for marginBeforeCollapse.
- if (child.style()->marginBeforeCollapse() == MDISCARD) {
+ if (child.style().marginBeforeCollapse() == MDISCARD) {
positiveMarginBefore = 0;
negativeMarginBefore = 0;
discardMarginBefore = true;
@@ -1061,7 +1061,7 @@
}
// Give up if there is clearance on the box, since it probably won't collapse into us.
- if (!grandchildBox || grandchildBox->style()->clear() != CNONE)
+ if (!grandchildBox || grandchildBox->style().clear() != CNONE)
return;
// Make sure to update the block margins now for the grandchild box so that we're looking at current values.
@@ -1069,8 +1069,8 @@
grandchildBox->computeAndSetBlockDirectionMargins(this);
if (grandchildBox->isRenderBlock()) {
RenderBlock* grandchildBlock = toRenderBlock(grandchildBox);
- grandchildBlock->setHasMarginBeforeQuirk(grandchildBox->style()->hasMarginBeforeQuirk());
- grandchildBlock->setHasMarginAfterQuirk(grandchildBox->style()->hasMarginAfterQuirk());
+ grandchildBlock->setHasMarginBeforeQuirk(grandchildBox->style().hasMarginBeforeQuirk());
+ grandchildBlock->setHasMarginAfterQuirk(grandchildBox->style().hasMarginAfterQuirk());
}
}
@@ -1198,7 +1198,7 @@
void RenderBlockFlow::setMustDiscardMarginBefore(bool value)
{
- if (style()->marginBeforeCollapse() == MDISCARD) {
+ if (style().marginBeforeCollapse() == MDISCARD) {
ASSERT(value);
return;
}
@@ -1214,7 +1214,7 @@
void RenderBlockFlow::setMustDiscardMarginAfter(bool value)
{
- if (style()->marginAfterCollapse() == MDISCARD) {
+ if (style().marginAfterCollapse() == MDISCARD) {
ASSERT(value);
return;
}
@@ -1230,21 +1230,21 @@
bool RenderBlockFlow::mustDiscardMarginBefore() const
{
- return style()->marginBeforeCollapse() == MDISCARD || (m_rareData && m_rareData->m_discardMarginBefore);
+ return style().marginBeforeCollapse() == MDISCARD || (m_rareData && m_rareData->m_discardMarginBefore);
}
bool RenderBlockFlow::mustDiscardMarginAfter() const
{
- return style()->marginAfterCollapse() == MDISCARD || (m_rareData && m_rareData->m_discardMarginAfter);
+ return style().marginAfterCollapse() == MDISCARD || (m_rareData && m_rareData->m_discardMarginAfter);
}
bool RenderBlockFlow::mustDiscardMarginBeforeForChild(const RenderBox& child) const
{
ASSERT(!child.selfNeedsLayout());
if (!child.isWritingModeRoot())
- return child.isRenderBlockFlow() ? toRenderBlockFlow(child).mustDiscardMarginBefore() : (child.style()->marginBeforeCollapse() == MDISCARD);
+ return child.isRenderBlockFlow() ? toRenderBlockFlow(child).mustDiscardMarginBefore() : (child.style().marginBeforeCollapse() == MDISCARD);
if (child.isHorizontalWritingMode() == isHorizontalWritingMode())
- return child.isRenderBlockFlow() ? toRenderBlockFlow(child).mustDiscardMarginAfter() : (child.style()->marginAfterCollapse() == MDISCARD);
+ return child.isRenderBlockFlow() ? toRenderBlockFlow(child).mustDiscardMarginAfter() : (child.style().marginAfterCollapse() == MDISCARD);
// FIXME: We return false here because the implementation is not geometrically complete. We have values only for before/after, not start/end.
// In case the boxes are perpendicular we assume the property is not specified.
@@ -1255,9 +1255,9 @@
{
ASSERT(!child.selfNeedsLayout());
if (!child.isWritingModeRoot())
- return child.isRenderBlockFlow() ? toRenderBlockFlow(child).mustDiscardMarginAfter() : (child.style()->marginAfterCollapse() == MDISCARD);
+ return child.isRenderBlockFlow() ? toRenderBlockFlow(child).mustDiscardMarginAfter() : (child.style().marginAfterCollapse() == MDISCARD);
if (child.isHorizontalWritingMode() == isHorizontalWritingMode())
- return child.isRenderBlockFlow() ? toRenderBlockFlow(child).mustDiscardMarginBefore() : (child.style()->marginBeforeCollapse() == MDISCARD);
+ return child.isRenderBlockFlow() ? toRenderBlockFlow(child).mustDiscardMarginBefore() : (child.style().marginBeforeCollapse() == MDISCARD);
// FIXME: See |mustDiscardMarginBeforeForChild| above.
return false;
@@ -1266,11 +1266,11 @@
bool RenderBlockFlow::mustSeparateMarginBeforeForChild(const RenderBox& child) const
{
ASSERT(!child.selfNeedsLayout());
- const RenderStyle* childStyle = child.style();
+ const RenderStyle& childStyle = child.style();
if (!child.isWritingModeRoot())
- return childStyle->marginBeforeCollapse() == MSEPARATE;
+ return childStyle.marginBeforeCollapse() == MSEPARATE;
if (child.isHorizontalWritingMode() == isHorizontalWritingMode())
- return childStyle->marginAfterCollapse() == MSEPARATE;
+ return childStyle.marginAfterCollapse() == MSEPARATE;
// FIXME: See |mustDiscardMarginBeforeForChild| above.
return false;
@@ -1279,11 +1279,11 @@
bool RenderBlockFlow::mustSeparateMarginAfterForChild(const RenderBox& child) const
{
ASSERT(!child.selfNeedsLayout());
- const RenderStyle* childStyle = child.style();
+ const RenderStyle& childStyle = child.style();
if (!child.isWritingModeRoot())
- return childStyle->marginAfterCollapse() == MSEPARATE;
+ return childStyle.marginAfterCollapse() == MSEPARATE;
if (child.isHorizontalWritingMode() == isHorizontalWritingMode())
- return childStyle->marginBeforeCollapse() == MSEPARATE;
+ return childStyle.marginBeforeCollapse() == MSEPARATE;
// FIXME: See |mustDiscardMarginBeforeForChild| above.
return false;
@@ -1309,8 +1309,8 @@
bool checkPageBreaks = !checkColumnBreaks && view().layoutState()->m_pageLogicalHeight; // FIXME: Once columns can print we have to check this.
RenderFlowThread* flowThread = flowThreadContainingBlock();
bool checkRegionBreaks = flowThread && flowThread->isRenderNamedFlowThread();
- bool checkBeforeAlways = (checkColumnBreaks && child.style()->columnBreakBefore() == PBALWAYS) || (checkPageBreaks && child.style()->pageBreakBefore() == PBALWAYS)
- || (checkRegionBreaks && child.style()->regionBreakBefore() == PBALWAYS);
+ bool checkBeforeAlways = (checkColumnBreaks && child.style().columnBreakBefore() == PBALWAYS) || (checkPageBreaks && child.style().pageBreakBefore() == PBALWAYS)
+ || (checkRegionBreaks && child.style().regionBreakBefore() == PBALWAYS);
if (checkBeforeAlways && inNormalFlow(child) && hasNextPage(logicalOffset, IncludePageBoundary)) {
if (checkColumnBreaks)
view().layoutState()->addForcedColumnBreak(&child, logicalOffset);
@@ -1331,8 +1331,8 @@
bool checkPageBreaks = !checkColumnBreaks && view().layoutState()->m_pageLogicalHeight; // FIXME: Once columns can print we have to check this.
RenderFlowThread* flowThread = flowThreadContainingBlock();
bool checkRegionBreaks = flowThread && flowThread->isRenderNamedFlowThread();
- bool checkAfterAlways = (checkColumnBreaks && child.style()->columnBreakAfter() == PBALWAYS) || (checkPageBreaks && child.style()->pageBreakAfter() == PBALWAYS)
- || (checkRegionBreaks && child.style()->regionBreakAfter() == PBALWAYS);
+ bool checkAfterAlways = (checkColumnBreaks && child.style().columnBreakAfter() == PBALWAYS) || (checkPageBreaks && child.style().pageBreakAfter() == PBALWAYS)
+ || (checkRegionBreaks && child.style().regionBreakAfter() == PBALWAYS);
if (checkAfterAlways && inNormalFlow(child) && hasNextPage(logicalOffset, IncludePageBoundary)) {
LayoutUnit marginOffset = marginInfo.canCollapseWithMarginBefore() ? LayoutUnit() : marginInfo.margin();
@@ -1475,7 +1475,7 @@
LayoutUnit logicalOffset = min(lineBox->lineTopWithLeading(), logicalVisualOverflow.y());
LayoutUnit logicalBottom = max(lineBox->lineBottomWithLeading(), logicalVisualOverflow.maxY());
LayoutUnit lineHeight = logicalBottom - logicalOffset;
- updateMinimumPageHeight(logicalOffset, calculateMinimumPageHeight(style(), lineBox, logicalOffset, logicalBottom));
+ updateMinimumPageHeight(logicalOffset, calculateMinimumPageHeight(&style(), lineBox, logicalOffset, logicalBottom));
logicalOffset += delta;
lineBox->setPaginationStrut(0);
lineBox->setIsFirstAfterPageBreak(false);
@@ -1506,7 +1506,7 @@
LayoutUnit totalLogicalHeight = lineHeight + max<LayoutUnit>(0, logicalOffset);
LayoutUnit pageLogicalHeightAtNewOffset = hasUniformPageLogicalHeight ? pageLogicalHeight : pageLogicalHeightForOffset(logicalOffset + remainingLogicalHeight);
setPageBreak(logicalOffset, lineHeight - remainingLogicalHeight);
- if (((lineBox == firstRootBox() && totalLogicalHeight < pageLogicalHeightAtNewOffset) || (!style()->hasAutoOrphans() && style()->orphans() >= lineIndex))
+ if (((lineBox == firstRootBox() && totalLogicalHeight < pageLogicalHeightAtNewOffset) || (!style().hasAutoOrphans() && style().orphans() >= lineIndex))
&& !isOutOfFlowPositioned() && !isTableCell())
setPaginationStrut(remainingLogicalHeight + max<LayoutUnit>(0, logicalOffset));
else {
@@ -1579,7 +1579,7 @@
if (!region)
return false;
if (region->isLastRegion())
- return region->isRenderRegionSet() || region->style()->regionFragment() == BreakRegionFragment
+ return region->isRenderRegionSet() || region->style().regionFragment() == BreakRegionFragment
|| (pageBoundaryRule == IncludePageBoundary && pageOffset == region->logicalTopForFlowThreadContent());
return true;
}
@@ -1590,9 +1590,9 @@
bool checkPageBreaks = !checkColumnBreaks && view().layoutState()->m_pageLogicalHeight;
RenderFlowThread* flowThread = flowThreadContainingBlock();
bool checkRegionBreaks = flowThread && flowThread->isRenderNamedFlowThread();
- bool isUnsplittable = child.isUnsplittableForPagination() || (checkColumnBreaks && child.style()->columnBreakInside() == PBAVOID)
- || (checkPageBreaks && child.style()->pageBreakInside() == PBAVOID)
- || (checkRegionBreaks && child.style()->regionBreakInside() == PBAVOID);
+ bool isUnsplittable = child.isUnsplittableForPagination() || (checkColumnBreaks && child.style().columnBreakInside() == PBAVOID)
+ || (checkPageBreaks && child.style().pageBreakInside() == PBAVOID)
+ || (checkRegionBreaks && child.style().regionBreakInside() == PBAVOID);
if (!isUnsplittable)
return logicalOffset;
LayoutUnit childLogicalHeight = logicalHeightForChild(child) + (includeMargins ? marginBeforeForChild(child) + marginAfterForChild(child) : LayoutUnit());
@@ -1699,7 +1699,7 @@
void RenderBlockFlow::layoutLineGridBox()
{
- if (style()->lineGrid() == RenderStyle::initialLineGrid()) {
+ if (style().lineGrid() == RenderStyle::initialLineGrid()) {
setLineGridBox(0);
return;
}
@@ -1760,7 +1760,7 @@
}
if (auto fragment = renderNamedFlowFragment())
- fragment->setStyle(RenderNamedFlowFragment::createStyle(*style()));
+ fragment->setStyle(RenderNamedFlowFragment::createStyle(style()));
if (diff >= StyleDifferenceRepaint)
invalidateLineLayoutPath();
@@ -1768,7 +1768,7 @@
void RenderBlockFlow::styleWillChange(StyleDifference diff, const RenderStyle& newStyle)
{
- RenderStyle* oldStyle = hasInitializedStyle() ? style() : nullptr;
+ const RenderStyle* oldStyle = hasInitializedStyle() ? &style() : nullptr;
s_canPropagateFloatIntoSibling = oldStyle ? !isFloatingOrOutOfFlowPositioned() && !avoidsFloats() : false;
if (oldStyle && parent() && diff == StyleDifferenceLayout && oldStyle->position() != newStyle.position()) {
@@ -2072,7 +2072,7 @@
bool insideFlowThread = flowThreadContainingBlock();
- if (childBox.style()->floating() == LeftFloat) {
+ if (childBox.style().floating() == LeftFloat) {
LayoutUnit heightRemainingLeft = 1;
LayoutUnit heightRemainingRight = 1;
floatLogicalLeft = logicalLeftOffsetForLineIgnoringShapeOutside(logicalTopOffset, logicalLeftOffset, false, &heightRemainingLeft);
@@ -2156,13 +2156,13 @@
RenderBox& childBox = floatingObject->renderer();
- LayoutUnit childLogicalLeftMargin = style()->isLeftToRightDirection() ? marginStartForChild(childBox) : marginEndForChild(childBox);
+ LayoutUnit childLogicalLeftMargin = style().isLeftToRightDirection() ? marginStartForChild(childBox) : marginEndForChild(childBox);
LayoutRect oldRect = childBox.frameRect();
- if (childBox.style()->clear() & CLEFT)
+ if (childBox.style().clear() & CLEFT)
logicalTop = max(lowestFloatLogicalBottom(FloatingObject::FloatLeft), logicalTop);
- if (childBox.style()->clear() & CRIGHT)
+ if (childBox.style().clear() & CRIGHT)
logicalTop = max(lowestFloatLogicalBottom(FloatingObject::FloatRight), logicalTop);
LayoutPoint floatLogicalLocation = computeLogicalLocationForFloat(floatingObject, logicalTop);
@@ -2468,7 +2468,7 @@
LayoutPoint RenderBlockFlow::flipFloatForWritingModeForChild(const FloatingObject* child, const LayoutPoint& point) const
{
- if (!style()->isFlippedBlocksWritingMode())
+ if (!style().isFlippedBlocksWritingMode())
return point;
// This is similar to RenderBox::flipForWritingModeForChild. We have to subtract out our left/top offsets twice, since
@@ -2486,9 +2486,9 @@
return 0;
// At least one float is present. We need to perform the clearance computation.
- bool clearSet = child.style()->clear() != CNONE;
+ bool clearSet = child.style().clear() != CNONE;
LayoutUnit logicalBottom = 0;
- switch (child.style()->clear()) {
+ switch (child.style().clear()) {
case CNONE:
break;
case CLEFT:
@@ -2591,7 +2591,7 @@
void RenderBlockFlow::adjustForBorderFit(LayoutUnit x, LayoutUnit& left, LayoutUnit& right) const
{
- if (style()->visibility() != VISIBLE)
+ if (style().visibility() != VISIBLE)
return;
// We don't deal with relative positioning. Our assumption is that you shrink to fit the lines without accounting
@@ -2610,7 +2610,7 @@
if (!obj->isFloatingOrOutOfFlowPositioned()) {
if (obj->isRenderBlockFlow() && !obj->hasOverflowClip())
toRenderBlockFlow(obj)->adjustForBorderFit(x + obj->x(), left, right);
- else if (obj->style()->visibility() == VISIBLE) {
+ else if (obj->style().visibility() == VISIBLE) {
// We are a replaced element or some kind of non-block-flow object.
left = min(left, x + obj->x());
right = max(right, x + obj->x() + obj->width());
@@ -2637,7 +2637,7 @@
void RenderBlockFlow::fitBorderToLinesIfNeeded()
{
- if (style()->borderFit() == BorderFitBorder || hasOverrideWidth())
+ if (style().borderFit() == BorderFitBorder || hasOverrideWidth())
return;
// Walk any normal flow lines to snugly fit.
@@ -2694,7 +2694,7 @@
return SimpleLineLayout::computeFlowFirstLineBaseline(*this, *m_simpleLineLayout);
ASSERT(firstLineBox());
- return firstLineBox()->logicalTop() + firstLineStyle()->fontMetrics().ascent(firstRootBox()->baselineType());
+ return firstLineBox()->logicalTop() + firstLineStyle().fontMetrics().ascent(firstRootBox()->baselineType());
}
int RenderBlockFlow::inlineBlockBaseline(LineDirectionMode lineDirection) const
@@ -2708,7 +2708,7 @@
if (!hasLines()) {
if (!hasLineIfEmpty())
return -1;
- const FontMetrics& fontMetrics = firstLineStyle()->fontMetrics();
+ const FontMetrics& fontMetrics = firstLineStyle().fontMetrics();
return fontMetrics.ascent()
+ (lineHeight(true, lineDirection, PositionOfInteriorLineBoxes) - fontMetrics.height()) / 2
+ (lineDirection == HorizontalLine ? borderTop() + paddingTop() : borderRight() + paddingRight());
@@ -2718,8 +2718,8 @@
return SimpleLineLayout::computeFlowLastLineBaseline(*this, *m_simpleLineLayout);
bool isFirstLine = lastLineBox() == firstLineBox();
- RenderStyle* style = isFirstLine ? firstLineStyle() : this->style();
- return lastLineBox()->logicalTop() + style->fontMetrics().ascent(lastRootBox()->baselineType());
+ const RenderStyle& style = isFirstLine ? firstLineStyle() : this->style();
+ return lastLineBox()->logicalTop() + style.fontMetrics().ascent(lastRootBox()->baselineType());
}
GapRects RenderBlockFlow::inlineSelectionGaps(RenderBlock& rootBlock, const LayoutPoint& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock,
@@ -2783,8 +2783,8 @@
if (!document().cssRegionsEnabled() || renderNamedFlowFragment() || isRenderNamedFlowFragment())
return;
- if (style()->isDisplayRegionType() && style()->hasFlowFrom()) {
- RenderNamedFlowFragment* flowFragment = new RenderNamedFlowFragment(document(), RenderNamedFlowFragment::createStyle(*style()));
+ if (style().isDisplayRegionType() && style().hasFlowFrom()) {
+ RenderNamedFlowFragment* flowFragment = new RenderNamedFlowFragment(document(), RenderNamedFlowFragment::createStyle(style()));
flowFragment->initializeStyle();
setRenderNamedFlowFragment(flowFragment);
addChild(renderNamedFlowFragment());
@@ -2837,14 +2837,14 @@
static bool shouldCheckLines(RenderObject& obj)
{
- return !obj.isFloatingOrOutOfFlowPositioned() && !obj.isRunIn() && obj.isRenderBlockFlow() && obj.style()->height().isAuto() && (!obj.isDeprecatedFlexibleBox() || obj.style()->boxOrient() == VERTICAL);
+ return !obj.isFloatingOrOutOfFlowPositioned() && !obj.isRunIn() && obj.isRenderBlockFlow() && obj.style().height().isAuto() && (!obj.isDeprecatedFlexibleBox() || obj.style().boxOrient() == VERTICAL);
}
RootInlineBox* RenderBlockFlow::lineAtIndex(int i) const
{
ASSERT(i >= 0);
- if (style()->visibility() != VISIBLE)
+ if (style().visibility() != VISIBLE)
return nullptr;
if (childrenInline()) {
@@ -2866,7 +2866,7 @@
int RenderBlockFlow::lineCount(const RootInlineBox* stopRootInlineBox, bool* found) const
{
- if (style()->visibility() != VISIBLE)
+ if (style().visibility() != VISIBLE)
return 0;
int count = 0;
@@ -2899,7 +2899,7 @@
static int getHeightForLineCount(const RenderBlockFlow& block, int lineCount, bool includeBottom, int& count)
{
- if (block.style()->visibility() != VISIBLE)
+ if (block.style().visibility() != VISIBLE)
return -1;
if (block.childrenInline()) {
@@ -2932,7 +2932,7 @@
void RenderBlockFlow::clearTruncation()
{
- if (style()->visibility() != VISIBLE)
+ if (style().visibility() != VISIBLE)
return;
if (childrenInline() && hasMarkupTruncation()) {
@@ -2984,8 +2984,8 @@
if (!firstRootBox())
return createVisiblePosition(0, DOWNSTREAM);
- bool linesAreFlipped = style()->isFlippedLinesWritingMode();
- bool blocksAreFlipped = style()->isFlippedBlocksWritingMode();
+ bool linesAreFlipped = style().isFlippedLinesWritingMode();
+ bool blocksAreFlipped = style().isFlippedBlocksWritingMode();
// look for the closest line box in the root box which is at the passed-in y coordinate
InlineBox* closestBox = 0;
diff --git a/Source/WebCore/rendering/RenderBlockLineLayout.cpp b/Source/WebCore/rendering/RenderBlockLineLayout.cpp
index 8076e49..e0f8b79 100644
--- a/Source/WebCore/rendering/RenderBlockLineLayout.cpp
+++ b/Source/WebCore/rendering/RenderBlockLineLayout.cpp
@@ -193,7 +193,7 @@
if (currpoint == lBreak) {
// We hit the line break before the start point. Shave off the start point.
lineMidpointState.numMidpoints--;
- if (endpoint.m_obj->style()->collapseWhiteSpace() && endpoint.m_obj->isText())
+ if (endpoint.m_obj->style().collapseWhiteSpace() && endpoint.m_obj->isText())
endpoint.m_pos--;
}
}
@@ -363,7 +363,7 @@
unsigned lineDepth = 1;
InlineFlowBox* parentBox = 0;
InlineFlowBox* result = 0;
- bool hasDefaultLineBoxContain = style()->lineBoxContain() == RenderStyle::initialLineBoxContain();
+ bool hasDefaultLineBoxContain = style().lineBoxContain() == RenderStyle::initialLineBoxContain();
do {
ASSERT_WITH_SECURITY_IMPLICATION(obj->isRenderInline() || obj == this);
@@ -460,7 +460,7 @@
// Create a box for our object.
bool isOnlyRun = (runCount == 1);
if (runCount == 2 && !r->m_object->isListMarker())
- isOnlyRun = (!style()->isLeftToRightDirection() ? bidiRuns.lastRun() : bidiRuns.firstRun())->m_object->isListMarker();
+ isOnlyRun = (!style().isLeftToRightDirection() ? bidiRuns.lastRun() : bidiRuns.firstRun())->m_object->isListMarker();
if (lineInfo.isEmpty())
continue;
@@ -492,7 +492,7 @@
parentBox->addToLine(box);
}
- bool visuallyOrdered = r->m_object->style()->rtlOrdering() == VisualOrder;
+ bool visuallyOrdered = r->m_object->style().rtlOrdering() == VisualOrder;
box->setBidiLevel(r->level());
if (box->isInlineTextBox()) {
@@ -530,7 +530,7 @@
ETextAlign RenderBlock::textAlignmentForLine(bool endsWithSoftBreak) const
{
- ETextAlign alignment = style()->textAlign();
+ ETextAlign alignment = style().textAlign();
if (!endsWithSoftBreak && alignment == JUSTIFY)
alignment = TASTART;
@@ -600,14 +600,14 @@
break;
}
}
- renderer.getOverhang(lineInfo.isFirstLine(), renderer.style()->isLeftToRightDirection() ? previousObject : nextObject, renderer.style()->isLeftToRightDirection() ? nextObject : previousObject, startOverhang, endOverhang);
+ renderer.getOverhang(lineInfo.isFirstLine(), renderer.style().isLeftToRightDirection() ? previousObject : nextObject, renderer.style().isLeftToRightDirection() ? nextObject : previousObject, startOverhang, endOverhang);
setMarginStartForChild(renderer, -startOverhang);
setMarginEndForChild(renderer, -endOverhang);
}
static inline float measureHyphenWidth(RenderText* renderer, const Font& font, HashSet<const SimpleFontData*>* fallbackFonts = 0)
{
- const RenderStyle& style = *renderer->style();
+ const RenderStyle& style = renderer->style();
return font.width(RenderBlock::constructTextRun(renderer, font, style.hyphenString().string(), style), fallbackFonts);
}
@@ -630,7 +630,7 @@
static inline const RenderStyle& lineStyle(const RenderElement& renderer, const LineInfo& lineInfo)
{
- return lineInfo.isFirstLine() ? *renderer.firstLineStyle() : *renderer.style();
+ return lineInfo.isFirstLine() ? renderer.firstLineStyle() : renderer.style();
}
static inline void setLogicalWidthForTextRun(RootInlineBox* lineBox, BidiRun* run, RenderText* renderer, float xPos, const LineInfo& lineInfo,
@@ -683,7 +683,7 @@
&wordMeasurement.fallbackFonts, &overflow);
UChar c = renderer->characterAt(wordMeasurement.startOffset);
if (i > 0 && wordLength == 1 && (c == ' ' || c == '\t'))
- measuredWidth += renderer->style()->wordSpacing();
+ measuredWidth += renderer->style().wordSpacing();
} else
measuredWidth += wordMeasurement.width;
if (!wordMeasurement.fallbackFonts.isEmpty()) {
@@ -739,7 +739,7 @@
ASSERT(opportunitiesInRun <= expansionOpportunityCount);
// Only justify text if whitespace is collapsed.
- if (r->m_object->style()->collapseWhiteSpace()) {
+ if (r->m_object->style().collapseWhiteSpace()) {
InlineTextBox* textBox = toInlineTextBox(r->m_box);
int expansion = (availableLogicalWidth - totalLogicalWidth) * opportunitiesInRun / expansionOpportunityCount;
textBox->setExpansion(expansion);
@@ -761,15 +761,15 @@
switch (textAlign) {
case LEFT:
case WEBKIT_LEFT:
- updateLogicalWidthForLeftAlignedBlock(style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth);
+ updateLogicalWidthForLeftAlignedBlock(style().isLeftToRightDirection(), trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth);
break;
case RIGHT:
case WEBKIT_RIGHT:
- updateLogicalWidthForRightAlignedBlock(style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth);
+ updateLogicalWidthForRightAlignedBlock(style().isLeftToRightDirection(), trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth);
break;
case CENTER:
case WEBKIT_CENTER:
- updateLogicalWidthForCenterAlignedBlock(style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth);
+ updateLogicalWidthForCenterAlignedBlock(style().isLeftToRightDirection(), trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth);
break;
case JUSTIFY:
adjustInlineDirectionLineBounds(expansionOpportunityCount, logicalLeft, availableLogicalWidth);
@@ -782,16 +782,16 @@
}
// Fall through
case TASTART:
- if (style()->isLeftToRightDirection())
- updateLogicalWidthForLeftAlignedBlock(style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth);
+ if (style().isLeftToRightDirection())
+ updateLogicalWidthForLeftAlignedBlock(style().isLeftToRightDirection(), trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth);
else
- updateLogicalWidthForRightAlignedBlock(style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth);
+ updateLogicalWidthForRightAlignedBlock(style().isLeftToRightDirection(), trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth);
break;
case TAEND:
- if (style()->isLeftToRightDirection())
- updateLogicalWidthForRightAlignedBlock(style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth);
+ if (style().isLeftToRightDirection())
+ updateLogicalWidthForRightAlignedBlock(style().isLeftToRightDirection(), trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth);
else
- updateLogicalWidthForLeftAlignedBlock(style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth);
+ updateLogicalWidthForLeftAlignedBlock(style().isLeftToRightDirection(), trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth);
break;
}
}
@@ -833,7 +833,7 @@
// but does not affect lines after a soft wrap break.
bool isFirstLine = lineInfo.isFirstLine() && !(isAnonymousBlock() && parent()->firstChild() != this);
bool isAfterHardLineBreak = lineBox->prevRootBox() && lineBox->prevRootBox()->endsWithBreak();
- IndentTextOrNot shouldIndentText = requiresIndent(isFirstLine, isAfterHardLineBreak, *style());
+ IndentTextOrNot shouldIndentText = requiresIndent(isFirstLine, isAfterHardLineBreak, style());
float lineLogicalLeft;
float lineLogicalRight;
float availableLogicalWidth;
@@ -989,9 +989,9 @@
if (character == ' ' || character == '\t' || character == softHyphen)
return true;
if (character == '\n')
- return !renderer->style()->preserveNewline();
+ return !renderer->style().preserveNewline();
if (character == noBreakSpace)
- return renderer->style()->nbspMode() == SPACE;
+ return renderer->style().nbspMode() == SPACE;
return false;
}
@@ -1030,8 +1030,8 @@
inline BidiRun* RenderBlockFlow::handleTrailingSpaces(BidiRunList<BidiRun>& bidiRuns, BidiContext* currentContext)
{
if (!bidiRuns.runCount()
- || !bidiRuns.logicallyLastRun()->m_object->style()->breakOnlyAfterWhiteSpace()
- || !bidiRuns.logicallyLastRun()->m_object->style()->autoWrap())
+ || !bidiRuns.logicallyLastRun()->m_object->style().breakOnlyAfterWhiteSpace()
+ || !bidiRuns.logicallyLastRun()->m_object->style().autoWrap())
return 0;
BidiRun* trailingSpaceRun = bidiRuns.logicallyLastRun();
@@ -1049,7 +1049,7 @@
if (firstSpace == trailingSpaceRun->stop())
return 0;
- TextDirection direction = style()->direction();
+ TextDirection direction = style().direction();
bool shouldReorder = trailingSpaceRun != (direction == LTR ? bidiRuns.lastRun() : bidiRuns.firstRun());
if (firstSpace != trailingSpaceRun->start()) {
BidiContext* baseContext = currentContext;
@@ -1119,13 +1119,13 @@
// violation for BidiResolver (which knows nothing about RenderObject).
RenderInline* isolatedInline = toRenderInline(containingIsolate(startObj, currentRoot));
InlineBidiResolver isolatedResolver;
- EUnicodeBidi unicodeBidi = isolatedInline->style()->unicodeBidi();
+ EUnicodeBidi unicodeBidi = isolatedInline->style().unicodeBidi();
TextDirection direction;
if (unicodeBidi == Plaintext)
determineDirectionality(direction, InlineIterator(isolatedInline, isolatedRun->object(), 0));
else {
ASSERT(unicodeBidi == Isolate || unicodeBidi == IsolateOverride);
- direction = isolatedInline->style()->direction();
+ direction = isolatedInline->style().direction();
}
isolatedResolver.setStatus(statusWithDirection(direction, isOverride(unicodeBidi)));
@@ -1244,7 +1244,7 @@
#if PLATFORM(MAC)
// Highlight acts as an overflow inflation.
- if (style()->highlight() != nullAtom)
+ if (style().highlight() != nullAtom)
lineBox->addHighlightOverflow();
#endif
return lineBox;
@@ -1314,7 +1314,7 @@
if (!lastObject->isBR())
lastObject = &lastRootBox()->firstLeafChild()->renderer();
if (lastObject->isBR()) {
- EClear clear = lastObject->style()->clear();
+ EClear clear = lastObject->style().clear();
if (clear != CNONE)
newLine(clear);
}
@@ -1515,7 +1515,7 @@
void RenderBlockFlow::layoutRunsAndFloatsInRange(LineLayoutState& layoutState, InlineBidiResolver& resolver, const InlineIterator& cleanLineStart, const BidiStatus& cleanLineBidiStatus, unsigned consecutiveHyphenatedLines)
{
- RenderStyle* styleToUse = style();
+ const RenderStyle& styleToUse = style();
bool paginated = view().layoutState() && view().layoutState()->isPaginated();
LineMidpointState& lineMidpointState = resolver.midpointState();
InlineIterator end = resolver.position();
@@ -1591,12 +1591,12 @@
if (lastRootBox())
lastRootBox()->setLineBreakInfo(end.m_obj, end.m_pos, resolver.status());
} else {
- VisualDirectionOverride override = (styleToUse->rtlOrdering() == VisualOrder ? (styleToUse->direction() == LTR ? VisualLeftToRightOverride : VisualRightToLeftOverride) : NoVisualOverride);
+ VisualDirectionOverride override = (styleToUse.rtlOrdering() == VisualOrder ? (styleToUse.direction() == LTR ? VisualLeftToRightOverride : VisualRightToLeftOverride) : NoVisualOverride);
- if (isNewUBAParagraph && styleToUse->unicodeBidi() == Plaintext && !resolver.context()->parent()) {
- TextDirection direction = styleToUse->direction();
+ if (isNewUBAParagraph && styleToUse.unicodeBidi() == Plaintext && !resolver.context()->parent()) {
+ TextDirection direction = styleToUse.direction();
determineDirectionality(direction, resolver.position());
- resolver.setStatus(BidiStatus(direction, isOverride(styleToUse->unicodeBidi())));
+ resolver.setStatus(BidiStatus(direction, isOverride(styleToUse.unicodeBidi())));
}
// FIXME: This ownership is reversed. We should own the BidiRunList and pass it to createBidiRunsForLine.
BidiRunList<BidiRun>& bidiRuns = resolver.runs();
@@ -1688,7 +1688,7 @@
// In case we already adjusted the line positions during this layout to avoid widows
// then we need to ignore the possibility of having a new widows situation.
// Otherwise, we risk leaving empty containers which is against the block fragmentation principles.
- if (paginated && !style()->hasAutoWidows() && !didBreakAtLineToAvoidWidow()) {
+ if (paginated && !style().hasAutoWidows() && !didBreakAtLineToAvoidWidow()) {
// Check the line boxes to make sure we didn't create unacceptable widows.
// However, we'll prioritize orphans - so nothing we do here should create
// a new orphan.
@@ -1708,11 +1708,11 @@
if (!lineBox || !lineBox->isFirstAfterPageBreak() || lineBox == firstLineInBlock)
return;
- if (numLinesHanging < style()->widows()) {
+ if (numLinesHanging < style().widows()) {
// We have detected a widow. Now we need to work out how many
// lines there are on the previous page, and how many we need
// to steal.
- int numLinesNeeded = style()->widows() - numLinesHanging;
+ int numLinesNeeded = style().widows() - numLinesHanging;
RootInlineBox* currentFirstLineOfNewPage = lineBox;
// Count the number of lines in the previous page.
@@ -1728,7 +1728,7 @@
// This means that setting widows implies we also care about orphans, but given
// the specification says the initial orphan value is non-zero, this is ok. The
// author is always free to set orphans explicitly as well.
- int orphans = style()->hasAutoOrphans() ? style()->initialOrphans() : style()->orphans();
+ int orphans = style().hasAutoOrphans() ? style().initialOrphans() : style().orphans();
int numLinesAvailable = numLinesInPreviousPage - orphans;
if (numLinesAvailable <= 0)
return;
@@ -1865,8 +1865,8 @@
// FIXME: CSS3 says that descendants that are clipped must also know how to truncate. This is insanely
// difficult to figure out in general (especially in the middle of doing layout), so we only handle the
// simple case of an anonymous block truncating when it's parent is clipped.
- bool hasTextOverflow = (style()->textOverflow() && hasOverflowClip())
- || (isAnonymousBlock() && parent() && parent()->isRenderBlock() && parent()->style()->textOverflow() && parent()->hasOverflowClip());
+ bool hasTextOverflow = (style().textOverflow() && hasOverflowClip())
+ || (isAnonymousBlock() && parent() && parent()->isRenderBlock() && parent()->style().textOverflow() && parent()->hasOverflowClip());
// Walk all the lines and delete our ellipsis line boxes if they exist.
if (hasTextOverflow)
@@ -1927,7 +1927,7 @@
int lastLineAnnotationsAdjustment = 0;
if (lastRootBox()) {
LayoutUnit lowestAllowedPosition = max(lastRootBox()->lineBottom(), logicalHeight() + paddingAfter());
- if (!style()->isFlippedLinesWritingMode())
+ if (!style().isFlippedLinesWritingMode())
lastLineAnnotationsAdjustment = lastRootBox()->computeUnderAnnotationAdjustment(lowestAllowedPosition);
else
lastLineAnnotationsAdjustment = lastRootBox()->computeOverAnnotationAdjustment(lowestAllowedPosition);
@@ -2081,10 +2081,10 @@
resolver.setPosition(iter, numberOfIsolateAncestors(iter));
resolver.setStatus(last->lineBreakBidiStatus());
} else {
- TextDirection direction = style()->direction();
- if (style()->unicodeBidi() == Plaintext)
+ TextDirection direction = style().direction();
+ if (style().unicodeBidi() == Plaintext)
determineDirectionality(direction, InlineIterator(this, bidiFirstSkippingEmptyInlines(*this), 0));
- resolver.setStatus(BidiStatus(direction, isOverride(style()->unicodeBidi())));
+ resolver.setStatus(BidiStatus(direction, isOverride(style().unicodeBidi())));
InlineIterator iter = InlineIterator(this, bidiFirstSkippingEmptyInlines(*this, &resolver), 0);
resolver.setPosition(iter, numberOfIsolateAncestors(iter));
}
@@ -2223,7 +2223,7 @@
static inline bool skipNonBreakingSpace(const InlineIterator& it, const LineInfo& lineInfo)
{
- if (it.m_obj->style()->nbspMode() != SPACE || it.current() != noBreakSpace)
+ if (it.m_obj->style().nbspMode() != SPACE || it.current() != noBreakSpace)
return false;
// FIXME: This is bad. It makes nbsp inconsistent with space and won't work correctly
@@ -2298,7 +2298,7 @@
rendererIsEmptyInline = isEmptyInline(inlineRenderer);
}
- if (!shouldCollapseWhiteSpace(it.m_obj->style(), lineInfo, whitespacePosition))
+ if (!shouldCollapseWhiteSpace(&it.m_obj->style(), lineInfo, whitespacePosition))
return true;
UChar current = it.current();
@@ -2342,19 +2342,19 @@
RenderObject& object = *resolver.position().m_obj;
if (object.isOutOfFlowPositioned()) {
setStaticPositions(m_block, toRenderBox(object));
- if (object.style()->isOriginalDisplayInlineType()) {
+ if (object.style().isOriginalDisplayInlineType()) {
resolver.runs().addRun(createRun(0, 1, &object, resolver));
lineInfo.incrementRunsFromLeadingWhitespace();
}
} else if (object.isFloating()) {
// The top margin edge of a self-collapsing block that clears a float intrudes up into it by the height of the margin,
// so in order to place this first child float at the top content edge of the self-collapsing block add the margin back in before placement.
- LayoutUnit marginOffset = (!object.previousSibling() && m_block.isSelfCollapsingBlock() && m_block.style()->clear() && m_block.getClearDelta(m_block, LayoutUnit())) ? m_block.collapsedMarginBeforeForChild(m_block) : LayoutUnit();
+ LayoutUnit marginOffset = (!object.previousSibling() && m_block.isSelfCollapsingBlock() && m_block.style().clear() && m_block.getClearDelta(m_block, LayoutUnit())) ? m_block.collapsedMarginBeforeForChild(m_block) : LayoutUnit();
LayoutUnit oldLogicalHeight = m_block.logicalHeight();
m_block.setLogicalHeight(oldLogicalHeight + marginOffset);
m_block.positionNewFloatOnLine(m_block.insertFloatingObject(toRenderBox(object)), lastFloatFromPreviousLine, lineInfo, width);
m_block.setLogicalHeight(oldLogicalHeight);
- } else if (object.isText() && object.style()->hasTextCombine() && object.isCombineText() && !toRenderCombineText(object).isCombined()) {
+ } else if (object.isText() && object.style().hasTextCombine() && object.isCombineText() && !toRenderCombineText(object).isCombined()) {
toRenderCombineText(object).combineText();
if (toRenderCombineText(object).isCombined())
continue;
@@ -2375,7 +2375,7 @@
if (next && next->isText() && toRenderText(next)->textLength() > 0) {
RenderText* nextText = toRenderText(next);
UChar nextChar = nextText->characterAt(0);
- if (nextText->style()->isCollapsibleWhiteSpace(nextChar)) {
+ if (nextText->style().isCollapsibleWhiteSpace(nextChar)) {
startIgnoringSpaces(lineMidpointState, InlineIterator(0, o, 0));
return true;
}
@@ -2386,7 +2386,7 @@
static ALWAYS_INLINE float textWidth(RenderText* text, unsigned from, unsigned len, const Font& font, float xPos, bool isFixedPitch, bool collapseWhiteSpace, HashSet<const SimpleFontData*>& fallbackFonts, TextLayout* layout = 0)
{
- const RenderStyle& style = *text->style();
+ const RenderStyle& style = text->style();
GlyphOverflow glyphOverflow;
if (isFixedPitch || (!from && len == text->textLength()) || style.hasTextCombine())
@@ -2400,7 +2400,7 @@
ASSERT(run.charactersLength() >= run.length());
run.setCharacterScanForCodePath(!text->canUseSimpleFontCodePath());
- run.setTabSize(!collapseWhiteSpace, text->style()->tabSize());
+ run.setTabSize(!collapseWhiteSpace, text->style().tabSize());
run.setXPos(xPos);
return font.width(run, &fallbackFonts, &glyphOverflow);
}
@@ -2435,7 +2435,7 @@
if (maxPrefixWidth <= font.pixelSize() * 5 / 4)
return;
- const RenderStyle& style = *text->style();
+ const RenderStyle& style = text->style();
TextRun run = RenderBlock::constructTextRun(text, font, text, lastSpace, pos - lastSpace, style);
run.setCharactersLength(text->textLength() - lastSpace);
ASSERT(run.charactersLength() >= run.length());
@@ -2674,7 +2674,7 @@
, m_lastObject(m_current.m_obj)
, m_nextObject(0)
, m_currentStyle(0)
- , m_blockStyle(*(block.style()))
+ , m_blockStyle(block.style())
, m_lineInfo(inLineInfo)
, m_renderTextInfo(inRenderTextInfo)
, m_lastFloatFromPreviousLine(inLastFloatFromPreviousLine)
@@ -2795,7 +2795,7 @@
{
m_hadUncommittedWidthBeforeCurrent = !!m_width.uncommittedWidth();
- m_currentStyle = m_current.m_obj->style();
+ m_currentStyle = &m_current.m_obj->style();
ASSERT(m_currentStyle);
@@ -2803,8 +2803,8 @@
if (m_nextObject && m_nextObject->parent() && !m_nextObject->parent()->isDescendantOf(m_current.m_obj->parent()))
m_includeEndWidth = true;
- m_currWS = m_current.m_obj->isReplaced() ? m_current.m_obj->parent()->style()->whiteSpace() : m_currentStyle->whiteSpace();
- m_lastWS = m_lastObject->isReplaced() ? m_lastObject->parent()->style()->whiteSpace() : m_lastObject->style()->whiteSpace();
+ m_currWS = m_current.m_obj->isReplaced() ? m_current.m_obj->parent()->style().whiteSpace() : m_currentStyle->whiteSpace();
+ m_lastWS = m_lastObject->isReplaced() ? m_lastObject->parent()->style().whiteSpace() : m_lastObject->style().whiteSpace();
m_autoWrap = RenderStyle::autoWrap(m_currWS);
m_autoWrapWasEverTrueOnLine = m_autoWrapWasEverTrueOnLine || m_autoWrap;
@@ -2868,7 +2868,7 @@
// If our original display wasn't an inline type, then we can
// go ahead and determine our static inline position now.
RenderBox* box = toRenderBox(m_current.m_obj);
- bool isInlineType = box->style()->isOriginalDisplayInlineType();
+ bool isInlineType = box->style().isOriginalDisplayInlineType();
if (!isInlineType)
m_block.setStaticInlinePositionForChild(*box, m_block.logicalHeight(), m_block.startOffsetForContent(m_block.logicalHeight()));
else {
@@ -3011,7 +3011,7 @@
if (m_autoWrap && !RenderStyle::autoWrap(m_lastWS) && m_ignoringSpaces)
commitLineBreakAtCurrentWidth(m_current.m_obj);
- if (renderText->style()->hasTextCombine() && m_current.m_obj->isCombineText() && !toRenderCombineText(*m_current.m_obj).isCombined()) {
+ if (renderText->style().hasTextCombine() && m_current.m_obj->isCombineText() && !toRenderCombineText(*m_current.m_obj).isCombined()) {
RenderCombineText& combineRenderer = toRenderCombineText(*m_current.m_obj);
combineRenderer.combineText();
// The length of the renderer's text may have changed. Increment stale iterator positions
@@ -3363,7 +3363,7 @@
if (m_nextObject && m_nextObject->isLineBreakOpportunity())
return m_autoWrap;
- bool nextIsAutoWrappingText = (m_nextObject && m_nextObject->isText() && (m_autoWrap || m_nextObject->style()->autoWrap()));
+ bool nextIsAutoWrappingText = (m_nextObject && m_nextObject->isText() && (m_autoWrap || m_nextObject->style().autoWrap()));
if (!nextIsAutoWrappingText)
return m_autoWrap;
bool currentIsTextOrEmptyInline = m_current.m_obj->isText() || (m_current.m_obj->isRenderInline() && isEmptyInline(toRenderInline(*m_current.m_obj)));
@@ -3480,7 +3480,7 @@
bool appliedStartWidth = resolver.position().m_pos > 0;
- LineWidth width(m_block, lineInfo.isFirstLine(), requiresIndent(lineInfo.isFirstLine(), lineInfo.previousLineBrokeCleanly(), *m_block.style()));
+ LineWidth width(m_block, lineInfo.isFirstLine(), requiresIndent(lineInfo.isFirstLine(), lineInfo.previousLineBrokeCleanly(), m_block.style()));
skipLeadingWhitespace(resolver, lineInfo, lastFloatFromPreviousLine, width);
@@ -3536,7 +3536,7 @@
}
LayoutUnit endPadding = hasOverflowClip() ? paddingEnd() : LayoutUnit();
// FIXME: Need to find another way to do this, since scrollbars could show when we don't want them to.
- if (hasOverflowClip() && !endPadding && element() && element()->isRootEditableElement() && style()->isLeftToRightDirection())
+ if (hasOverflowClip() && !endPadding && element() && element()->isRootEditableElement() && style().isLeftToRightDirection())
endPadding = 1;
for (RootInlineBox* curr = firstRootBox(); curr; curr = curr->nextRootBox()) {
addLayoutOverflow(curr->paddedLayoutOverflowRect(endPadding));
@@ -3553,8 +3553,8 @@
void RenderBlockFlow::deleteEllipsisLineBoxes()
{
- ETextAlign textAlign = style()->textAlign();
- bool ltr = style()->isLeftToRightDirection();
+ ETextAlign textAlign = style().textAlign();
+ bool ltr = style().isLeftToRightDirection();
bool firstLine = true;
for (RootInlineBox* curr = firstRootBox(); curr; curr = curr->nextRootBox()) {
if (curr->hasEllipsisBox()) {
@@ -3579,18 +3579,18 @@
{
// Determine the width of the ellipsis using the current font.
// FIXME: CSS3 says this is configurable, also need to use 0x002E (FULL STOP) if horizontal ellipsis is "not renderable"
- const Font& font = style()->font();
+ const Font& font = style().font();
DEFINE_STATIC_LOCAL(AtomicString, ellipsisStr, (&horizontalEllipsis, 1));
- const Font& firstLineFont = firstLineStyle()->font();
- int firstLineEllipsisWidth = firstLineFont.width(constructTextRun(this, firstLineFont, &horizontalEllipsis, 1, *firstLineStyle()));
- int ellipsisWidth = (font == firstLineFont) ? firstLineEllipsisWidth : font.width(constructTextRun(this, font, &horizontalEllipsis, 1, *style()));
+ const Font& firstLineFont = firstLineStyle().font();
+ int firstLineEllipsisWidth = firstLineFont.width(constructTextRun(this, firstLineFont, &horizontalEllipsis, 1, firstLineStyle()));
+ int ellipsisWidth = (font == firstLineFont) ? firstLineEllipsisWidth : font.width(constructTextRun(this, font, &horizontalEllipsis, 1, style()));
// For LTR text truncation, we want to get the right edge of our padding box, and then we want to see
// if the right edge of a line box exceeds that. For RTL, we use the left edge of the padding box and
// check the left edge of the line box to see if it is less
// Include the scrollbar for overflow blocks, which means we want to use "contentWidth()"
- bool ltr = style()->isLeftToRightDirection();
- ETextAlign textAlign = style()->textAlign();
+ bool ltr = style().isLeftToRightDirection();
+ ETextAlign textAlign = style().textAlign();
bool firstLine = true;
for (RootInlineBox* curr = firstRootBox(); curr; curr = curr->nextRootBox()) {
// FIXME: Use pixelSnappedLogicalRightOffsetForLine instead of snapping it ourselves once the column workaround in said method has been fixed.
@@ -3676,7 +3676,7 @@
LayoutUnit RenderBlock::startAlignedOffsetForLine(LayoutUnit position, bool firstLine)
{
- ETextAlign textAlign = style()->textAlign();
+ ETextAlign textAlign = style().textAlign();
if (textAlign == TASTART) // FIXME: Handle TAEND here
return startOffsetForLine(position, firstLine);
@@ -3687,7 +3687,7 @@
float availableLogicalWidth = logicalRightOffsetForLine(logicalHeight(), false) - logicalLeft;
updateLogicalWidthForAlignment(textAlign, 0, logicalLeft, totalLogicalWidth, availableLogicalWidth, 0);
- if (!style()->isLeftToRightDirection())
+ if (!style().isLeftToRightDirection())
return logicalWidth() - logicalLeft;
return logicalLeft;
}
diff --git a/Source/WebCore/rendering/RenderBox.cpp b/Source/WebCore/rendering/RenderBox.cpp
index d30f597..deaa62c 100644
--- a/Source/WebCore/rendering/RenderBox.cpp
+++ b/Source/WebCore/rendering/RenderBox.cpp
@@ -191,7 +191,7 @@
const RenderBlock* currentBox = containingBlock();
RenderBoxRegionInfo* currentBoxInfo = currentBox->renderBoxRegionInfo(region);
while (currentBoxInfo && currentBoxInfo->isShifted()) {
- if (currentBox->style()->direction() == LTR)
+ if (currentBox->style().direction() == LTR)
logicalLeft += currentBoxInfo->logicalLeft();
else
logicalLeft -= (currentBox->logicalWidth() - currentBoxInfo->logicalWidth()) - currentBoxInfo->logicalLeft();
@@ -268,7 +268,7 @@
{
s_hadOverflowClip = hasOverflowClip();
- RenderStyle* oldStyle = hasInitializedStyle() ? style() : nullptr;
+ const RenderStyle* oldStyle = hasInitializedStyle() ? &style() : nullptr;
if (oldStyle) {
// The background of the root element or the body element could propagate up to
// the canvas. Issue full repaint, when our style changes substantially.
@@ -306,14 +306,14 @@
RenderBoxModelObject::styleDidChange(diff, oldStyle);
- RenderStyle* newStyle = style();
+ const RenderStyle& newStyle = style();
if (needsLayout() && oldStyle) {
RenderBlock::removePercentHeightDescendantIfNeeded(*this);
// Normally we can do optimized positioning layout for absolute/fixed positioned objects. There is one special case, however, which is
// when the positioned object's margin-before is changed. In this case the parent has to get a layout in order to run margin collapsing
// to determine the new static position.
- if (isOutOfFlowPositioned() && newStyle->hasStaticBlockPosition(isHorizontalWritingMode()) && oldStyle->marginBefore() != newStyle->marginBefore()
+ if (isOutOfFlowPositioned() && newStyle.hasStaticBlockPosition(isHorizontalWritingMode()) && oldStyle->marginBefore() != newStyle.marginBefore()
&& parent() && !parent()->normalChildNeedsLayout())
parent()->setChildNeedsLayout();
}
@@ -324,13 +324,13 @@
// If our zoom factor changes and we have a defined scrollLeft/Top, we need to adjust that value into the
// new zoomed coordinate space.
- if (hasOverflowClip() && oldStyle && newStyle && oldStyle->effectiveZoom() != newStyle->effectiveZoom()) {
+ if (hasOverflowClip() && oldStyle && oldStyle->effectiveZoom() != newStyle.effectiveZoom()) {
if (int left = layer()->scrollXOffset()) {
- left = (left / oldStyle->effectiveZoom()) * newStyle->effectiveZoom();
+ left = (left / oldStyle->effectiveZoom()) * newStyle.effectiveZoom();
layer()->scrollToXOffset(left);
}
if (int top = layer()->scrollYOffset()) {
- top = (top / oldStyle->effectiveZoom()) * newStyle->effectiveZoom();
+ top = (top / oldStyle->effectiveZoom()) * newStyle.effectiveZoom();
layer()->scrollToYOffset(top);
}
}
@@ -349,27 +349,27 @@
// Set the text color if we're the body.
if (isBodyRenderer)
- document().setTextColor(newStyle->visitedDependentColor(CSSPropertyColor));
+ document().setTextColor(newStyle.visitedDependentColor(CSSPropertyColor));
if (isRootRenderer || isBodyRenderer) {
// Propagate the new writing mode and direction up to the RenderView.
- RenderStyle* viewStyle = view().style();
+ RenderStyle& viewStyle = view().style();
bool viewChangedWritingMode = false;
- if (viewStyle->direction() != newStyle->direction() && (isRootRenderer || !document().directionSetOnDocumentElement())) {
- viewStyle->setDirection(newStyle->direction());
+ if (viewStyle.direction() != newStyle.direction() && (isRootRenderer || !document().directionSetOnDocumentElement())) {
+ viewStyle.setDirection(newStyle.direction());
if (isBodyRenderer)
- document().documentElement()->renderer()->style()->setDirection(newStyle->direction());
+ document().documentElement()->renderer()->style().setDirection(newStyle.direction());
setNeedsLayoutAndPrefWidthsRecalc();
}
- if (viewStyle->writingMode() != newStyle->writingMode() && (isRootRenderer || !document().writingModeSetOnDocumentElement())) {
- viewStyle->setWritingMode(newStyle->writingMode());
+ if (viewStyle.writingMode() != newStyle.writingMode() && (isRootRenderer || !document().writingModeSetOnDocumentElement())) {
+ viewStyle.setWritingMode(newStyle.writingMode());
viewChangedWritingMode = true;
- view().setHorizontalWritingMode(newStyle->isHorizontalWritingMode());
+ view().setHorizontalWritingMode(newStyle.isHorizontalWritingMode());
view().markAllDescendantsWithFloatsForLayout();
if (isBodyRenderer) {
- document().documentElement()->renderer()->style()->setWritingMode(newStyle->writingMode());
- document().documentElement()->renderer()->setHorizontalWritingMode(newStyle->isHorizontalWritingMode());
+ document().documentElement()->renderer()->style().setWritingMode(newStyle.writingMode());
+ document().documentElement()->renderer()->setHorizontalWritingMode(newStyle.isHorizontalWritingMode());
}
setNeedsLayoutAndPrefWidthsRecalc();
}
@@ -378,14 +378,14 @@
const Pagination& pagination = view().frameView().pagination();
if (viewChangedWritingMode && pagination.mode != Pagination::Unpaginated) {
- viewStyle->setColumnStylesFromPaginationMode(pagination.mode);
+ viewStyle.setColumnStylesFromPaginationMode(pagination.mode);
if (view().hasColumns())
- view().updateColumnInfoFromStyle(viewStyle);
+ view().updateColumnInfoFromStyle(&viewStyle);
}
}
#if ENABLE(CSS_SHAPES)
- updateShapeOutsideInfoAfterStyleChange(*style(), oldStyle);
+ updateShapeOutsideInfoAfterStyleChange(style(), oldStyle);
#endif
}
@@ -419,7 +419,7 @@
{
RenderBoxModelObject::updateFromStyle();
- RenderStyle* styleToUse = style();
+ const RenderStyle& styleToUse = style();
bool isRootObject = isRoot();
bool isViewObject = isRenderView();
@@ -427,10 +427,10 @@
if (isRootObject || isViewObject)
setHasBoxDecorations(true);
- setFloating(!isOutOfFlowPositioned() && styleToUse->isFloating());
+ setFloating(!isOutOfFlowPositioned() && styleToUse.isFloating());
// We also handle <body> and <html>, whose overflow applies to the viewport.
- if (styleToUse->overflowX() != OVISIBLE && !isRootObject && isRenderBlock()) {
+ if (styleToUse.overflowX() != OVISIBLE && !isRootObject && isRenderBlock()) {
bool boxHasOverflowClip = true;
if (isBody()) {
// Overflow on the body can propagate to the viewport under the following conditions.
@@ -439,7 +439,7 @@
// (3) The root element has visible overflow.
if (document().documentElement()->hasTagName(htmlTag)
&& document().body() == element()
- && document().documentElement()->renderer()->style()->overflowX() == OVISIBLE) {
+ && document().documentElement()->renderer()->style().overflowX() == OVISIBLE) {
boxHasOverflowClip = false;
}
}
@@ -454,8 +454,8 @@
}
}
- setHasTransform(styleToUse->hasTransformRelatedProperty());
- setHasReflection(styleToUse->boxReflect());
+ setHasTransform(styleToUse.hasTransformRelatedProperty());
+ setHasReflection(styleToUse.boxReflect());
}
void RenderBox::layout()
@@ -469,7 +469,7 @@
return;
}
- LayoutStateMaintainer statePusher(&view(), this, locationOffset(), style()->isFlippedBlocksWritingMode());
+ LayoutStateMaintainer statePusher(&view(), this, locationOffset(), style().isFlippedBlocksWritingMode());
while (child) {
if (child->needsLayout())
toRenderElement(child)->layout();
@@ -519,7 +519,7 @@
return layer()->scrollWidth();
// For objects with visible overflow, this matches IE.
// FIXME: Need to work right with writing modes.
- if (style()->isLeftToRightDirection())
+ if (style().isLeftToRightDirection())
return snapSizeToPixel(max(clientWidth(), layoutOverflowRect().maxX() - borderLeft()), x() + clientLeft());
return clientWidth() - min<LayoutUnit>(0, layoutOverflowRect().x() - borderLeft());
}
@@ -574,32 +574,32 @@
LayoutUnit RenderBox::constrainLogicalWidthInRegionByMinMax(LayoutUnit logicalWidth, LayoutUnit availableWidth, RenderBlock* cb, RenderRegion* region) const
{
- RenderStyle* styleToUse = style();
- if (!styleToUse->logicalMaxWidth().isUndefined())
- logicalWidth = min(logicalWidth, computeLogicalWidthInRegionUsing(MaxSize, styleToUse->logicalMaxWidth(), availableWidth, cb, region));
- return max(logicalWidth, computeLogicalWidthInRegionUsing(MinSize, styleToUse->logicalMinWidth(), availableWidth, cb, region));
+ const RenderStyle& styleToUse = style();
+ if (!styleToUse.logicalMaxWidth().isUndefined())
+ logicalWidth = min(logicalWidth, computeLogicalWidthInRegionUsing(MaxSize, styleToUse.logicalMaxWidth(), availableWidth, cb, region));
+ return max(logicalWidth, computeLogicalWidthInRegionUsing(MinSize, styleToUse.logicalMinWidth(), availableWidth, cb, region));
}
LayoutUnit RenderBox::constrainLogicalHeightByMinMax(LayoutUnit logicalHeight) const
{
- RenderStyle* styleToUse = style();
- if (!styleToUse->logicalMaxHeight().isUndefined()) {
- LayoutUnit maxH = computeLogicalHeightUsing(styleToUse->logicalMaxHeight());
+ const RenderStyle& styleToUse = style();
+ if (!styleToUse.logicalMaxHeight().isUndefined()) {
+ LayoutUnit maxH = computeLogicalHeightUsing(styleToUse.logicalMaxHeight());
if (maxH != -1)
logicalHeight = min(logicalHeight, maxH);
}
- return max(logicalHeight, computeLogicalHeightUsing(styleToUse->logicalMinHeight()));
+ return max(logicalHeight, computeLogicalHeightUsing(styleToUse.logicalMinHeight()));
}
LayoutUnit RenderBox::constrainContentBoxLogicalHeightByMinMax(LayoutUnit logicalHeight) const
{
- RenderStyle* styleToUse = style();
- if (!styleToUse->logicalMaxHeight().isUndefined()) {
- LayoutUnit maxH = computeContentLogicalHeight(styleToUse->logicalMaxHeight());
+ const RenderStyle& styleToUse = style();
+ if (!styleToUse.logicalMaxHeight().isUndefined()) {
+ LayoutUnit maxH = computeContentLogicalHeight(styleToUse.logicalMaxHeight());
if (maxH != -1)
logicalHeight = min(logicalHeight, maxH);
}
- return max(logicalHeight, computeContentLogicalHeight(styleToUse->logicalMinHeight()));
+ return max(logicalHeight, computeContentLogicalHeight(styleToUse.logicalMinHeight()));
}
IntRect RenderBox::absoluteContentBox() const
@@ -648,11 +648,11 @@
LayoutRect RenderBox::reflectionBox() const
{
LayoutRect result;
- if (!style()->boxReflect())
+ if (!style().boxReflect())
return result;
LayoutRect box = borderBoxRect();
result = box;
- switch (style()->boxReflect()->direction()) {
+ switch (style().boxReflect()->direction()) {
case ReflectionBelow:
result.move(0, box.height() + reflectionOffset());
break;
@@ -671,21 +671,21 @@
int RenderBox::reflectionOffset() const
{
- if (!style()->boxReflect())
+ if (!style().boxReflect())
return 0;
- if (style()->boxReflect()->direction() == ReflectionLeft || style()->boxReflect()->direction() == ReflectionRight)
- return valueForLength(style()->boxReflect()->offset(), borderBoxRect().width());
- return valueForLength(style()->boxReflect()->offset(), borderBoxRect().height());
+ if (style().boxReflect()->direction() == ReflectionLeft || style().boxReflect()->direction() == ReflectionRight)
+ return valueForLength(style().boxReflect()->offset(), borderBoxRect().width());
+ return valueForLength(style().boxReflect()->offset(), borderBoxRect().height());
}
LayoutRect RenderBox::reflectedRect(const LayoutRect& r) const
{
- if (!style()->boxReflect())
+ if (!style().boxReflect())
return LayoutRect();
LayoutRect box = borderBoxRect();
LayoutRect result = r;
- switch (style()->boxReflect()->direction()) {
+ switch (style().boxReflect()->direction()) {
case ReflectionBelow:
result.setY(box.maxY() + reflectionOffset() + (box.maxY() - r.maxY()));
break;
@@ -704,19 +704,19 @@
bool RenderBox::fixedElementLaysOutRelativeToFrame(const FrameView& frameView) const
{
- return style() && style()->position() == FixedPosition && container()->isRenderView() && frameView.fixedElementsLayoutRelativeToFrame();
+ return style().position() == FixedPosition && container()->isRenderView() && frameView.fixedElementsLayoutRelativeToFrame();
}
bool RenderBox::includeVerticalScrollbarSize() const
{
return hasOverflowClip() && !layer()->hasOverlayScrollbars()
- && (style()->overflowY() == OSCROLL || style()->overflowY() == OAUTO);
+ && (style().overflowY() == OSCROLL || style().overflowY() == OAUTO);
}
bool RenderBox::includeHorizontalScrollbarSize() const
{
return hasOverflowClip() && !layer()->hasOverlayScrollbars()
- && (style()->overflowX() == OSCROLL || style()->overflowX() == OAUTO);
+ && (style().overflowX() == OSCROLL || style().overflowX() == OAUTO);
}
int RenderBox::verticalScrollbarWidth() const
@@ -734,12 +734,12 @@
if (!hasOverflowClip())
return 0;
- if (isHorizontalWritingMode() && style()->overflowY() == OSCROLL) {
+ if (isHorizontalWritingMode() && style().overflowY() == OSCROLL) {
ASSERT(layer()->hasVerticalScrollbar());
return verticalScrollbarWidth();
}
- if (!isHorizontalWritingMode() && style()->overflowX() == OSCROLL) {
+ if (!isHorizontalWritingMode() && style().overflowX() == OSCROLL) {
ASSERT(layer()->hasHorizontalScrollbar());
return horizontalScrollbarHeight();
}
@@ -774,9 +774,9 @@
#if PLATFORM(MAC)
// On Mac only we reset the inline direction position when doing a document scroll (e.g., hitting Home/End).
if (granularity == ScrollByDocument)
- scrolled = l->scroll(logicalToPhysical(ScrollInlineDirectionBackward, isHorizontalWritingMode(), style()->isFlippedBlocksWritingMode()), ScrollByDocument, multiplier);
+ scrolled = l->scroll(logicalToPhysical(ScrollInlineDirectionBackward, isHorizontalWritingMode(), style().isFlippedBlocksWritingMode()), ScrollByDocument, multiplier);
#endif
- if (l->scroll(logicalToPhysical(direction, isHorizontalWritingMode(), style()->isFlippedBlocksWritingMode()), granularity, multiplier))
+ if (l->scroll(logicalToPhysical(direction, isHorizontalWritingMode(), style().isFlippedBlocksWritingMode()), granularity, multiplier))
scrolled = true;
if (scrolled) {
@@ -882,7 +882,7 @@
bool RenderBox::needsPreferredWidthsRecalculation() const
{
- return style()->paddingStart().isPercent() || style()->paddingEnd().isPercent();
+ return style().paddingStart().isPercent() || style().paddingEnd().isPercent();
}
IntSize RenderBox::scrolledContentOffset() const
@@ -1054,7 +1054,7 @@
LayoutUnit RenderBox::adjustBorderBoxLogicalWidthForBoxSizing(LayoutUnit width) const
{
LayoutUnit bordersPlusPadding = borderAndPaddingLogicalWidth();
- if (style()->boxSizing() == CONTENT_BOX)
+ if (style().boxSizing() == CONTENT_BOX)
return width + bordersPlusPadding;
return max(width, bordersPlusPadding);
}
@@ -1062,21 +1062,21 @@
LayoutUnit RenderBox::adjustBorderBoxLogicalHeightForBoxSizing(LayoutUnit height) const
{
LayoutUnit bordersPlusPadding = borderAndPaddingLogicalHeight();
- if (style()->boxSizing() == CONTENT_BOX)
+ if (style().boxSizing() == CONTENT_BOX)
return height + bordersPlusPadding;
return max(height, bordersPlusPadding);
}
LayoutUnit RenderBox::adjustContentBoxLogicalWidthForBoxSizing(LayoutUnit width) const
{
- if (style()->boxSizing() == BORDER_BOX)
+ if (style().boxSizing() == BORDER_BOX)
width -= borderAndPaddingLogicalWidth();
return max<LayoutUnit>(0, width);
}
LayoutUnit RenderBox::adjustContentBoxLogicalHeightForBoxSizing(LayoutUnit height) const
{
- if (style()->boxSizing() == BORDER_BOX)
+ if (style().boxSizing() == BORDER_BOX)
height -= borderAndPaddingLogicalHeight();
return max<LayoutUnit>(0, height);
}
@@ -1116,8 +1116,8 @@
auto rootBackgroundRenderer = rendererForRootBackground();
- const FillLayer* bgLayer = rootBackgroundRenderer->style()->backgroundLayers();
- Color bgColor = rootBackgroundRenderer->style()->visitedDependentColor(CSSPropertyBackgroundColor);
+ const FillLayer* bgLayer = rootBackgroundRenderer->style().backgroundLayers();
+ Color bgColor = rootBackgroundRenderer->style().visitedDependentColor(CSSPropertyBackgroundColor);
paintFillLayers(paintInfo, bgColor, bgLayer, view().backgroundRect(this), BackgroundBleedNone, CompositeSourceOver, rootBackgroundRenderer);
}
@@ -1127,9 +1127,9 @@
if (context->paintingDisabled())
return BackgroundBleedNone;
- const RenderStyle* style = this->style();
+ const RenderStyle& style = this->style();
- if (!style->hasBackground() || !style->hasBorder() || !style->hasBorderRadius() || borderImageIsLoadedAndCanBeRendered())
+ if (!style.hasBackground() || !style.hasBorder() || !style.hasBorderRadius() || borderImageIsLoadedAndCanBeRendered())
return BackgroundBleedNone;
AffineTransform ctm = context->getCTM();
@@ -1151,7 +1151,7 @@
if (borderObscuresBackgroundEdge(contextScaling))
return BackgroundBleedShrinkBackground;
- if (!style->hasAppearance() && borderObscuresBackground() && backgroundHasOpaqueTopLayer())
+ if (!style.hasAppearance() && borderObscuresBackground() && backgroundHasOpaqueTopLayer())
return BackgroundBleedBackgroundOverBorder;
return BackgroundBleedUseTransparencyLayer;
@@ -1170,14 +1170,14 @@
// FIXME: Should eventually give the theme control over whether the box shadow should paint, since controls could have
// custom shadows of their own.
if (!boxShadowShouldBeAppliedToBackground(bleedAvoidance))
- paintBoxShadow(paintInfo, paintRect, style(), Normal);
+ paintBoxShadow(paintInfo, paintRect, &style(), Normal);
GraphicsContextStateSaver stateSaver(*paintInfo.context, false);
if (bleedAvoidance == BackgroundBleedUseTransparencyLayer) {
// To avoid the background color bleeding out behind the border, we'll render background and border
// into a transparency layer, and then clip that in one go (which requires setting up the clip before
// beginning the layer).
- RoundedRect border = style()->getRoundedBorderFor(paintRect, &view());
+ RoundedRect border = style().getRoundedBorderFor(paintRect, &view());
stateSaver.save();
paintInfo.context->clipRoundedRect(border);
paintInfo.context->beginTransparencyLayer(1);
@@ -1186,21 +1186,21 @@
// If we have a native theme appearance, paint that before painting our background.
// The theme will tell us whether or not we should also paint the CSS background.
IntRect snappedPaintRect(pixelSnappedIntRect(paintRect));
- bool themePainted = style()->hasAppearance() && !theme()->paint(this, paintInfo, snappedPaintRect);
+ bool themePainted = style().hasAppearance() && !theme()->paint(this, paintInfo, snappedPaintRect);
if (!themePainted) {
if (bleedAvoidance == BackgroundBleedBackgroundOverBorder)
- paintBorder(paintInfo, paintRect, style(), bleedAvoidance);
+ paintBorder(paintInfo, paintRect, &style(), bleedAvoidance);
paintBackground(paintInfo, paintRect, bleedAvoidance);
- if (style()->hasAppearance())
+ if (style().hasAppearance())
theme()->paintDecorations(this, paintInfo, snappedPaintRect);
}
- paintBoxShadow(paintInfo, paintRect, style(), Inset);
+ paintBoxShadow(paintInfo, paintRect, &style(), Inset);
// The theme will tell us whether or not we should also paint the CSS border.
- if (bleedAvoidance != BackgroundBleedBackgroundOverBorder && (!style()->hasAppearance() || (!themePainted && theme()->paintBorderOnly(this, paintInfo, snappedPaintRect))) && style()->hasBorder())
- paintBorder(paintInfo, paintRect, style(), bleedAvoidance);
+ if (bleedAvoidance != BackgroundBleedBackgroundOverBorder && (!style().hasAppearance() || (!themePainted && theme()->paintBorderOnly(this, paintInfo, snappedPaintRect))) && style().hasBorder())
+ paintBorder(paintInfo, paintRect, &style(), bleedAvoidance);
if (bleedAvoidance == BackgroundBleedUseTransparencyLayer)
paintInfo.context->endTransparencyLayer();
@@ -1216,7 +1216,7 @@
return;
if (backgroundIsKnownToBeObscured() && !boxShadowShouldBeAppliedToBackground(bleedAvoidance))
return;
- paintFillLayers(paintInfo, style()->visitedDependentColor(CSSPropertyBackgroundColor), style()->backgroundLayers(), paintRect, bleedAvoidance);
+ paintFillLayers(paintInfo, style().visitedDependentColor(CSSPropertyBackgroundColor), style().backgroundLayers(), paintRect, bleedAvoidance);
}
bool RenderBox::getBackgroundPaintedExtent(LayoutRect& paintedExtent) const
@@ -1224,19 +1224,19 @@
ASSERT(hasBackground());
LayoutRect backgroundRect = pixelSnappedIntRect(borderBoxRect());
- Color backgroundColor = style()->visitedDependentColor(CSSPropertyBackgroundColor);
+ Color backgroundColor = style().visitedDependentColor(CSSPropertyBackgroundColor);
if (backgroundColor.isValid() && backgroundColor.alpha()) {
paintedExtent = backgroundRect;
return true;
}
- if (!style()->backgroundLayers()->image() || style()->backgroundLayers()->next()) {
+ if (!style().backgroundLayers()->image() || style().backgroundLayers()->next()) {
paintedExtent = backgroundRect;
return true;
}
BackgroundImageGeometry geometry;
- calculateBackgroundImageGeometry(0, style()->backgroundLayers(), backgroundRect, geometry);
+ calculateBackgroundImageGeometry(0, style().backgroundLayers(), backgroundRect, geometry);
paintedExtent = geometry.destRect();
return !geometry.hasNonLocalGeometry();
}
@@ -1246,7 +1246,7 @@
if (isBody() && skipBodyBackground(this))
return false;
- Color backgroundColor = style()->visitedDependentColor(CSSPropertyBackgroundColor);
+ Color backgroundColor = style().visitedDependentColor(CSSPropertyBackgroundColor);
if (!backgroundColor.isValid() || backgroundColor.hasAlpha())
return false;
@@ -1254,18 +1254,18 @@
// We cannot be sure if theme paints the background opaque.
// In this case it is safe to not assume opaqueness.
// FIXME: May be ask theme if it paints opaque.
- if (style()->hasAppearance())
+ if (style().hasAppearance())
return false;
// FIXME: Check the opaqueness of background images.
// FIXME: Use rounded rect if border radius is present.
- if (style()->hasBorderRadius())
+ if (style().hasBorderRadius())
return false;
// FIXME: The background color clip is defined by the last layer.
- if (style()->backgroundLayers()->next())
+ if (style().backgroundLayers()->next())
return false;
LayoutRect backgroundRect;
- switch (style()->backgroundClip()) {
+ switch (style().backgroundClip()) {
case BorderFillBox:
backgroundRect = borderBoxRect();
break;
@@ -1283,13 +1283,13 @@
static bool isCandidateForOpaquenessTest(RenderBox* childBox)
{
- RenderStyle* childStyle = childBox->style();
- if (childStyle->position() != StaticPosition && childBox->containingBlock() != childBox->parent())
+ const RenderStyle& childStyle = childBox->style();
+ if (childStyle.position() != StaticPosition && childBox->containingBlock() != childBox->parent())
return false;
- if (childStyle->visibility() != VISIBLE)
+ if (childStyle.visibility() != VISIBLE)
return false;
#if ENABLE(CSS_SHAPES)
- if (childStyle->shapeOutside())
+ if (childStyle.shapeOutside())
return false;
#endif
if (!childBox->width() || !childBox->height())
@@ -1300,7 +1300,7 @@
return false;
#endif
// FIXME: Deal with z-index.
- if (!childStyle->hasAutoZIndex())
+ if (!childStyle.hasAutoZIndex())
return false;
if (childLayer->hasTransform() || childLayer->isTransparent() || childLayer->hasFilter())
return false;
@@ -1325,7 +1325,7 @@
childLocalRect.moveBy(-childLocation);
if (childLocalRect.y() < 0 || childLocalRect.x() < 0) {
// If there is unobscured area above/left of a static positioned box then the rect is probably not covered.
- if (childBox->style()->position() == StaticPosition)
+ if (childBox->style().position() == StaticPosition)
return false;
continue;
}
@@ -1357,7 +1357,7 @@
bool RenderBox::backgroundHasOpaqueTopLayer() const
{
- const FillLayer* fillLayer = style()->backgroundLayers();
+ const FillLayer* fillLayer = style().backgroundLayers();
if (!fillLayer || fillLayer->clip() != BorderFillBox)
return false;
@@ -1365,12 +1365,12 @@
if (hasOverflowClip() && fillLayer->attachment() == LocalBackgroundAttachment)
return false;
- if (fillLayer->hasOpaqueImage(this) && fillLayer->hasRepeatXY() && fillLayer->image()->canRender(this, style()->effectiveZoom()))
+ if (fillLayer->hasOpaqueImage(this) && fillLayer->hasRepeatXY() && fillLayer->image()->canRender(this, style().effectiveZoom()))
return true;
// If there is only one layer and no image, check whether the background color is opaque
if (!fillLayer->next() && !fillLayer->hasImage()) {
- Color bgColor = style()->visitedDependentColor(CSSPropertyBackgroundColor);
+ Color bgColor = style().visitedDependentColor(CSSPropertyBackgroundColor);
if (bgColor.isValid() && bgColor.alpha() == 255)
return true;
}
@@ -1380,7 +1380,7 @@
void RenderBox::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
- if (!paintInfo.shouldPaintWithinRoot(*this) || style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask || paintInfo.context->paintingDisabled())
+ if (!paintInfo.shouldPaintWithinRoot(*this) || style().visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask || paintInfo.context->paintingDisabled())
return;
LayoutRect paintRect = LayoutRect(paintOffset, size());
@@ -1399,8 +1399,8 @@
if (!compositedMask || flattenCompositingLayers) {
pushTransparencyLayer = true;
- StyleImage* maskBoxImage = style()->maskBoxImage().image();
- const FillLayer* maskLayers = style()->maskLayers();
+ StyleImage* maskBoxImage = style().maskBoxImage().image();
+ const FillLayer* maskLayers = style().maskLayers();
// Don't render a masked element until all the mask images have loaded, to prevent a flash of unmasked content.
if (maskBoxImage)
@@ -1415,8 +1415,8 @@
}
if (allMaskImagesLoaded) {
- paintFillLayers(paintInfo, Color(), style()->maskLayers(), paintRect, BackgroundBleedNone, compositeOp);
- paintNinePieceImage(paintInfo.context, paintRect, style(), style()->maskBoxImage(), compositeOp);
+ paintFillLayers(paintInfo, Color(), style().maskLayers(), paintRect, BackgroundBleedNone, compositeOp);
+ paintNinePieceImage(paintInfo.context, paintRect, &style(), style().maskBoxImage(), compositeOp);
}
if (pushTransparencyLayer)
@@ -1425,18 +1425,18 @@
LayoutRect RenderBox::maskClipRect()
{
- const NinePieceImage& maskBoxImage = style()->maskBoxImage();
+ const NinePieceImage& maskBoxImage = style().maskBoxImage();
if (maskBoxImage.image()) {
LayoutRect borderImageRect = borderBoxRect();
// Apply outsets to the border box.
- borderImageRect.expand(style()->maskBoxImageOutsets());
+ borderImageRect.expand(style().maskBoxImageOutsets());
return borderImageRect;
}
LayoutRect result;
LayoutRect borderBox = borderBoxRect();
- for (const FillLayer* maskLayer = style()->maskLayers(); maskLayer; maskLayer = maskLayer->next()) {
+ for (const FillLayer* maskLayer = style().maskLayers(); maskLayer; maskLayer = maskLayer->next()) {
if (maskLayer->image()) {
BackgroundImageGeometry geometry;
// Masks should never have fixed attachment, so it's OK for paintContainer to be null.
@@ -1467,7 +1467,7 @@
shouldDrawBackgroundInSeparateBuffer = true;
// The clipOccludesNextLayers condition must be evaluated first to avoid short-circuiting.
- if (curLayer->clipOccludesNextLayers(curLayer == fillLayer) && curLayer->hasOpaqueImage(this) && curLayer->image()->canRender(this, style()->effectiveZoom()) && curLayer->hasRepeatXY() && curLayer->blendMode() == BlendModeNormal)
+ if (curLayer->clipOccludesNextLayers(curLayer == fillLayer) && curLayer->hasOpaqueImage(this) && curLayer->image()->canRender(this, style().effectiveZoom()) && curLayer->hasRepeatXY() && curLayer->blendMode() == BlendModeNormal)
break;
curLayer = curLayer->next();
}
@@ -1509,24 +1509,24 @@
if (!parent())
return;
- if ((style()->borderImage().image() && style()->borderImage().image()->data() == image) ||
- (style()->maskBoxImage().image() && style()->maskBoxImage().image()->data() == image)) {
+ if ((style().borderImage().image() && style().borderImage().image()->data() == image) ||
+ (style().maskBoxImage().image() && style().maskBoxImage().image()->data() == image)) {
repaint();
return;
}
- bool didFullRepaint = repaintLayerRectsForImage(image, style()->backgroundLayers(), true);
+ bool didFullRepaint = repaintLayerRectsForImage(image, style().backgroundLayers(), true);
if (!didFullRepaint)
- repaintLayerRectsForImage(image, style()->maskLayers(), false);
+ repaintLayerRectsForImage(image, style().maskLayers(), false);
#if USE(ACCELERATED_COMPOSITING)
if (!isComposited())
return;
- if (layer()->hasCompositedMask() && layersUseImage(image, style()->maskLayers()))
+ if (layer()->hasCompositedMask() && layersUseImage(image, style().maskLayers()))
layer()->contentChanged(MaskImageChanged);
- if (layersUseImage(image, style()->backgroundLayers()))
+ if (layersUseImage(image, style().backgroundLayers()))
layer()->contentChanged(BackgroundImageChanged);
#endif
}
@@ -1537,7 +1537,7 @@
RenderBox* layerRenderer = 0;
for (const FillLayer* curLayer = layers; curLayer; curLayer = curLayer->next()) {
- if (curLayer->image() && image == curLayer->image()->data() && curLayer->image()->canRender(this, style()->effectiveZoom())) {
+ if (curLayer->image() && image == curLayer->image()->data() && curLayer->image()->canRender(this, style().effectiveZoom())) {
// Now that we know this image is being used, compute the renderer and the rect if we haven't already.
if (!layerRenderer) {
bool drawingRootBackground = drawingBackground && (isRoot() || (isBody() && !document().documentElement()->renderer()->hasBackground()));
@@ -1616,8 +1616,8 @@
}
IntRect clipRect = pixelSnappedIntRect(isControlClip ? controlClipRect(accumulatedOffset) : overflowClipRect(accumulatedOffset, paintInfo.renderRegion, IgnoreOverlayScrollbarSize, paintInfo.phase));
paintInfo.context->save();
- if (style()->hasBorderRadius())
- paintInfo.context->clipRoundedRect(style()->getRoundedInnerBorderFor(LayoutRect(accumulatedOffset, size())));
+ if (style().hasBorderRadius())
+ paintInfo.context->clipRoundedRect(style().getRoundedInnerBorderFor(LayoutRect(accumulatedOffset, size())));
paintInfo.context->clip(clipRect);
return true;
}
@@ -1645,7 +1645,7 @@
// Subtract out scrollbars if we have them.
if (layer()) {
- if (style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
+ if (style().shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
clipRect.move(layer()->verticalScrollbarWidth(relevancy), 0);
clipRect.contract(layer()->verticalScrollbarWidth(relevancy), layer()->horizontalScrollbarHeight(relevancy));
}
@@ -1658,8 +1658,8 @@
LayoutRect borderBoxRect = borderBoxRectInRegion(region);
LayoutRect clipRect = LayoutRect(borderBoxRect.location() + location, borderBoxRect.size());
- if (!style()->clipLeft().isAuto()) {
- LayoutUnit c = valueForLength(style()->clipLeft(), borderBoxRect.width());
+ if (!style().clipLeft().isAuto()) {
+ LayoutUnit c = valueForLength(style().clipLeft(), borderBoxRect.width());
clipRect.move(c, 0);
clipRect.contract(c, 0);
}
@@ -1667,17 +1667,17 @@
// We don't use the region-specific border box's width and height since clip offsets are (stupidly) specified
// from the left and top edges. Therefore it's better to avoid constraining to smaller widths and heights.
- if (!style()->clipRight().isAuto())
- clipRect.contract(width() - valueForLength(style()->clipRight(), width()), 0);
+ if (!style().clipRight().isAuto())
+ clipRect.contract(width() - valueForLength(style().clipRight(), width()), 0);
- if (!style()->clipTop().isAuto()) {
- LayoutUnit c = valueForLength(style()->clipTop(), borderBoxRect.height());
+ if (!style().clipTop().isAuto()) {
+ LayoutUnit c = valueForLength(style().clipTop(), borderBoxRect.height());
clipRect.move(0, c);
clipRect.contract(0, c);
}
- if (!style()->clipBottom().isAuto())
- clipRect.contract(0, height() - valueForLength(style()->clipBottom(), height()));
+ if (!style().clipBottom().isAuto())
+ clipRect.contract(0, height() - valueForLength(style().clipBottom(), height()));
return clipRect;
}
@@ -1778,12 +1778,12 @@
if (cb->hasOverrideHeight())
return cb->overrideLogicalContentHeight();
- RenderStyle* containingBlockStyle = cb->style();
- Length logicalHeightLength = containingBlockStyle->logicalHeight();
+ const RenderStyle& containingBlockStyle = cb->style();
+ Length logicalHeightLength = containingBlockStyle.logicalHeight();
// FIXME: For now just support fixed heights. Eventually should support percentage heights as well.
if (!logicalHeightLength.isFixed()) {
- LayoutUnit fillFallbackExtent = containingBlockStyle->isHorizontalWritingMode() ? view().frameView().visibleHeight() : view().frameView().visibleWidth();
+ LayoutUnit fillFallbackExtent = containingBlockStyle.isHorizontalWritingMode() ? view().frameView().visibleHeight() : view().frameView().visibleWidth();
LayoutUnit fillAvailableExtent = containingBlock()->availableLogicalHeight(ExcludeMarginBorderPadding);
return min(fillAvailableExtent, fillFallbackExtent);
}
@@ -1800,7 +1800,7 @@
if (view().layoutStateEnabled() && !repaintContainer) {
LayoutState* layoutState = view().layoutState();
LayoutSize offset = layoutState->m_paintOffset + locationOffset();
- if (style()->hasInFlowPosition() && layer())
+ if (style().hasInFlowPosition() && layer())
offset += layer()->offsetForInFlowPosition();
transformState.move(offset);
return;
@@ -1811,7 +1811,7 @@
if (!o)
return;
- bool isFixedPos = style()->position() == FixedPosition;
+ bool isFixedPos = style().position() == FixedPosition;
bool hasTransform = hasLayer() && layer()->transform();
// If this box has a transform, it acts as a fixed position container for fixed descendants,
// and may itself also be fixed position. So propagate 'fixed' up only if this box is fixed position.
@@ -1825,7 +1825,7 @@
LayoutSize containerOffset = offsetFromContainer(o, roundedLayoutPoint(transformState.mappedPoint()));
- bool preserve3D = mode & UseTransforms && (o->style()->preserves3D() || style()->preserves3D());
+ bool preserve3D = mode & UseTransforms && (o->style().preserves3D() || style().preserves3D());
if (mode & UseTransforms && shouldUseTransformFromContainer(o)) {
TransformationMatrix t;
getTransformFromContainer(o, containerOffset, t);
@@ -1860,7 +1860,7 @@
if (!container)
return 0;
- bool isFixedPos = style()->position() == FixedPosition;
+ bool isFixedPos = style().position() == FixedPosition;
bool hasTransform = hasLayer() && layer()->transform();
LayoutSize adjustmentForSkippedAncestor;
@@ -1873,7 +1873,7 @@
bool offsetDependsOnPoint = false;
LayoutSize containerOffset = offsetFromContainer(container, LayoutPoint(), &offsetDependsOnPoint);
- bool preserve3D = container->style()->preserves3D() || style()->preserves3D();
+ bool preserve3D = container->style().preserves3D() || style().preserves3D();
if (shouldUseTransformFromContainer(container)) {
TransformationMatrix t;
getTransformFromContainer(container, containerOffset, t);
@@ -1890,7 +1890,7 @@
void RenderBox::mapAbsoluteToLocalPoint(MapCoordinatesFlags mode, TransformState& transformState) const
{
- bool isFixedPos = style()->position() == FixedPosition;
+ bool isFixedPos = style().position() == FixedPosition;
bool hasTransform = hasLayer() && layer()->transform();
if (hasTransform && !isFixedPos) {
// If this box has a transform, it acts as a fixed position container for fixed descendants,
@@ -1912,7 +1912,7 @@
offset += offsetForInFlowPosition();
if (!isInline() || isReplaced()) {
- if (!style()->hasOutOfFlowPosition() && o->hasColumns()) {
+ if (!style().hasOutOfFlowPosition() && o->hasColumns()) {
RenderBlock* block = toRenderBlock(o);
LayoutRect columnRect(frameRect());
block->adjustStartEdgeForWritingModeIncludingColumns(columnRect);
@@ -1931,7 +1931,7 @@
if (o->hasOverflowClip())
offset -= toRenderBox(o)->scrolledContentOffset();
- if (style()->position() == AbsolutePosition && o->isInFlowPositioned() && o->isRenderInline())
+ if (style().position() == AbsolutePosition && o->isInFlowPositioned() && o->isRenderInline())
offset += toRenderInline(o)->offsetForInFlowPositionedInline(this);
if (offsetDependsOnPoint)
@@ -1960,14 +1960,14 @@
{
if (isOutOfFlowPositioned()) {
// Cache the x position only if we were an INLINE type originally.
- bool wasInline = style()->isOriginalDisplayInlineType();
+ bool wasInline = style().isOriginalDisplayInlineType();
if (wasInline) {
// The value is cached in the xPos of the box. We only need this value if
// our object was inline originally, since otherwise it would have ended up underneath
// the inlines.
RootInlineBox& rootBox = box->root();
rootBox.blockFlow().setStaticInlinePositionForChild(*this, rootBox.lineTopWithLeading(), roundedLayoutUnit(box->logicalLeft()));
- if (style()->hasStaticInlinePosition(box->isHorizontal()))
+ if (style().hasStaticInlinePosition(box->isHorizontal()))
setChildNeedsLayout(MarkOnlyThis); // Just go ahead and mark the positioned object as needing layout, so it will update its position properly.
} else {
// Our object was a block originally, so we make our normal flow position be
@@ -1975,7 +1975,7 @@
// wrapped in an anonymous block, which is what would have happened had we been
// in flow). This value was cached in the y() of the box.
layer()->setStaticBlockPosition(box->logicalTop());
- if (style()->hasStaticBlockPosition(box->isHorizontal()))
+ if (style().hasStaticBlockPosition(box->isHorizontal()))
setChildNeedsLayout(MarkOnlyThis); // Just go ahead and mark the positioned object as needing layout, so it will update its position properly.
}
@@ -2004,7 +2004,7 @@
LayoutRect RenderBox::clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const
{
- if (style()->visibility() != VISIBLE && !enclosingLayer()->hasVisibleContent())
+ if (style().visibility() != VISIBLE && !enclosingLayer()->hasVisibleContent())
return LayoutRect();
LayoutRect r = visualOverflowRect();
@@ -2013,12 +2013,10 @@
// repaint containers. https://bugs.webkit.org/show_bug.cgi?id=23308
r.move(view().layoutDelta());
- if (style()) {
- // We have to use maximalOutlineSize() because a child might have an outline
- // that projects outside of our overflowRect.
- ASSERT(style()->outlineSize() <= view().maximalOutlineSize());
- r.inflate(view().maximalOutlineSize());
- }
+ // We have to use maximalOutlineSize() because a child might have an outline
+ // that projects outside of our overflowRect.
+ ASSERT(style().outlineSize() <= view().maximalOutlineSize());
+ r.inflate(view().maximalOutlineSize());
computeRectForRepaint(repaintContainer, r);
return r;
@@ -2034,16 +2032,16 @@
// RenderView::computeRectForRepaint then converts the rect to physical coordinates. We also convert to
// physical when we hit a repaintContainer boundary. Therefore the final rect returned is always in the
// physical coordinate space of the repaintContainer.
- RenderStyle* styleToUse = style();
+ const RenderStyle& styleToUse = style();
// LayoutState is only valid for root-relative, non-fixed position repainting
- if (view().layoutStateEnabled() && !repaintContainer && styleToUse->position() != FixedPosition) {
+ if (view().layoutStateEnabled() && !repaintContainer && styleToUse.position() != FixedPosition) {
LayoutState* layoutState = view().layoutState();
if (layer() && layer()->transform())
rect = layer()->transform()->mapRect(pixelSnappedIntRect(rect));
// We can't trust the bits on RenderObject, because this might be called while re-resolving style.
- if (styleToUse->hasInFlowPosition() && layer())
+ if (styleToUse.hasInFlowPosition() && layer())
rect.move(layer()->offsetForInFlowPosition());
rect.moveBy(location());
@@ -2057,7 +2055,7 @@
rect.unite(reflectedRect(rect));
if (repaintContainer == this) {
- if (repaintContainer->style()->isFlippedBlocksWritingMode())
+ if (repaintContainer->style().isFlippedBlocksWritingMode())
flipForWritingMode(rect);
return;
}
@@ -2073,7 +2071,7 @@
LayoutPoint topLeft = rect.location();
topLeft.move(locationOffset());
- EPosition position = styleToUse->position();
+ EPosition position = styleToUse.position();
// We are now in our parent container's coordinate space. Apply our transform to obtain a bounding box
// in the parent's coordinate space that encloses us.
@@ -2087,7 +2085,7 @@
if (position == AbsolutePosition && o->isInFlowPositioned() && o->isRenderInline())
topLeft += toRenderInline(o)->offsetForInFlowPositionedInline(this);
- else if (styleToUse->hasInFlowPosition() && layer()) {
+ else if (styleToUse.hasInFlowPosition() && layer()) {
// Apply the relative position offset when invalidating a rectangle. The layer
// is translated, but the render box isn't, so we need to do this to get the
// right dirty rect. Since this is called from RenderObject::setStyle, the relative position
@@ -2174,19 +2172,19 @@
// width. Use the width from the style context.
// FIXME: Account for block-flow in flexible boxes.
// https://bugs.webkit.org/show_bug.cgi?id=46418
- if (hasOverrideWidth() && (style()->borderFit() == BorderFitLines || parent()->isFlexibleBoxIncludingDeprecated())) {
+ if (hasOverrideWidth() && (style().borderFit() == BorderFitLines || parent()->isFlexibleBoxIncludingDeprecated())) {
computedValues.m_extent = overrideLogicalContentWidth() + borderAndPaddingLogicalWidth();
return;
}
// FIXME: Account for block-flow in flexible boxes.
// https://bugs.webkit.org/show_bug.cgi?id=46418
- bool inVerticalBox = parent()->isDeprecatedFlexibleBox() && (parent()->style()->boxOrient() == VERTICAL);
- bool stretching = (parent()->style()->boxAlign() == BSTRETCH);
+ bool inVerticalBox = parent()->isDeprecatedFlexibleBox() && (parent()->style().boxOrient() == VERTICAL);
+ bool stretching = (parent()->style().boxAlign() == BSTRETCH);
bool treatAsReplaced = shouldComputeSizeAsReplaced() && (!inVerticalBox || !stretching);
- RenderStyle* styleToUse = style();
- Length logicalWidthLength = treatAsReplaced ? Length(computeReplacedLogicalWidth(), Fixed) : styleToUse->logicalWidth();
+ const RenderStyle& styleToUse = style();
+ Length logicalWidthLength = treatAsReplaced ? Length(computeReplacedLogicalWidth(), Fixed) : styleToUse.logicalWidth();
RenderBlock* cb = containingBlock();
LayoutUnit containerLogicalWidth = max<LayoutUnit>(0, containingBlockLogicalWidthForContentInRegion(region));
@@ -2194,8 +2192,8 @@
if (isInline() && !isInlineBlockOrInlineTable()) {
// just calculate margins
- computedValues.m_margins.m_start = minimumValueForLength(styleToUse->marginStart(), containerLogicalWidth);
- computedValues.m_margins.m_end = minimumValueForLength(styleToUse->marginEnd(), containerLogicalWidth);
+ computedValues.m_margins.m_start = minimumValueForLength(styleToUse.marginStart(), containerLogicalWidth);
+ computedValues.m_margins.m_end = minimumValueForLength(styleToUse.marginEnd(), containerLogicalWidth);
if (treatAsReplaced)
computedValues.m_extent = max<LayoutUnit>(floatValueForLength(logicalWidthLength, 0) + borderAndPaddingLogicalWidth(), minPreferredLogicalWidth());
return;
@@ -2208,19 +2206,19 @@
LayoutUnit containerWidthInInlineDirection = containerLogicalWidth;
if (hasPerpendicularContainingBlock)
containerWidthInInlineDirection = perpendicularContainingBlockLogicalHeight();
- LayoutUnit preferredWidth = computeLogicalWidthInRegionUsing(MainOrPreferredSize, styleToUse->logicalWidth(), containerWidthInInlineDirection, cb, region);
+ LayoutUnit preferredWidth = computeLogicalWidthInRegionUsing(MainOrPreferredSize, styleToUse.logicalWidth(), containerWidthInInlineDirection, cb, region);
computedValues.m_extent = constrainLogicalWidthInRegionByMinMax(preferredWidth, containerWidthInInlineDirection, cb, region);
}
// Margin calculations.
if (hasPerpendicularContainingBlock || isFloating() || isInline()) {
- computedValues.m_margins.m_start = minimumValueForLength(styleToUse->marginStart(), containerLogicalWidth);
- computedValues.m_margins.m_end = minimumValueForLength(styleToUse->marginEnd(), containerLogicalWidth);
+ computedValues.m_margins.m_start = minimumValueForLength(styleToUse.marginStart(), containerLogicalWidth);
+ computedValues.m_margins.m_end = minimumValueForLength(styleToUse.marginEnd(), containerLogicalWidth);
} else {
LayoutUnit containerLogicalWidthForAutoMargins = containerLogicalWidth;
if (avoidsFloats() && cb->containsFloats())
containerLogicalWidthForAutoMargins = containingBlockAvailableLineWidthInRegion(region);
- bool hasInvertedDirection = cb->style()->isLeftToRightDirection() != style()->isLeftToRightDirection();
+ bool hasInvertedDirection = cb->style().isLeftToRightDirection() != style().isLeftToRightDirection();
computeInlineDirectionMargins(cb, containerLogicalWidthForAutoMargins, computedValues.m_extent,
hasInvertedDirection ? computedValues.m_margins.m_end : computedValues.m_margins.m_start,
hasInvertedDirection ? computedValues.m_margins.m_start : computedValues.m_margins.m_end);
@@ -2229,7 +2227,7 @@
if (!hasPerpendicularContainingBlock && containerLogicalWidth && containerLogicalWidth != (computedValues.m_extent + computedValues.m_margins.m_start + computedValues.m_margins.m_end)
&& !isFloating() && !isInline() && !cb->isFlexibleBoxIncludingDeprecated() && !cb->isRenderGrid()) {
LayoutUnit newMargin = containerLogicalWidth - computedValues.m_extent - cb->marginStartForChild(*this);
- bool hasInvertedDirection = cb->style()->isLeftToRightDirection() != style()->isLeftToRightDirection();
+ bool hasInvertedDirection = cb->style().isLeftToRightDirection() != style().isLeftToRightDirection();
if (hasInvertedDirection)
computedValues.m_margins.m_start = newMargin;
else
@@ -2246,8 +2244,8 @@
LayoutUnit RenderBox::fillAvailableMeasure(LayoutUnit availableLogicalWidth, LayoutUnit& marginStart, LayoutUnit& marginEnd) const
{
- marginStart = minimumValueForLength(style()->marginStart(), availableLogicalWidth);
- marginEnd = minimumValueForLength(style()->marginEnd(), availableLogicalWidth);
+ marginStart = minimumValueForLength(style().marginStart(), availableLogicalWidth);
+ marginEnd = minimumValueForLength(style().marginEnd(), availableLogicalWidth);
return availableLogicalWidth - marginStart - marginEnd;
}
@@ -2302,17 +2300,17 @@
static bool flexItemHasStretchAlignment(const RenderBox& flexitem)
{
auto parent = flexitem.parent();
- return flexitem.style()->alignSelf() == AlignStretch || (flexitem.style()->alignSelf() == AlignAuto && parent->style()->alignItems() == AlignStretch);
+ return flexitem.style().alignSelf() == AlignStretch || (flexitem.style().alignSelf() == AlignAuto && parent->style().alignItems() == AlignStretch);
}
static bool isStretchingColumnFlexItem(const RenderBox& flexitem)
{
auto parent = flexitem.parent();
- if (parent->isDeprecatedFlexibleBox() && parent->style()->boxOrient() == VERTICAL && parent->style()->boxAlign() == BSTRETCH)
+ if (parent->isDeprecatedFlexibleBox() && parent->style().boxOrient() == VERTICAL && parent->style().boxAlign() == BSTRETCH)
return true;
// We don't stretch multiline flexboxes because they need to apply line spacing (align-content) first.
- if (parent->isFlexibleBox() && parent->style()->flexWrap() == FlexNoWrap && parent->style()->isColumnFlexDirection() && flexItemHasStretchAlignment(flexitem))
+ if (parent->isFlexibleBox() && parent->style().flexWrap() == FlexNoWrap && parent->style().isColumnFlexDirection() && flexItemHasStretchAlignment(flexitem))
return true;
return false;
}
@@ -2326,7 +2324,7 @@
// This code may look a bit strange. Basically width:intrinsic should clamp the size when testing both
// min-width and width. max-width is only clamped if it is also intrinsic.
- Length logicalWidth = (widthType == MaxSize) ? style()->logicalMaxWidth() : style()->logicalWidth();
+ Length logicalWidth = (widthType == MaxSize) ? style().logicalMaxWidth() : style().logicalWidth();
if (logicalWidth.type() == Intrinsic)
return true;
@@ -2335,8 +2333,8 @@
// FIXME: Think about block-flow here. Need to find out how marquee direction relates to
// block-flow (as well as how marquee overflow should relate to block flow).
// https://bugs.webkit.org/show_bug.cgi?id=46472
- if (parent()->style()->overflowX() == OMARQUEE) {
- EMarqueeDirection dir = parent()->style()->marqueeDirection();
+ if (parent()->style().overflowX() == OMARQUEE) {
+ EMarqueeDirection dir = parent()->style().marqueeDirection();
if (dir == MAUTO || dir == MFORWARD || dir == MBACKWARD || dir == MLEFT || dir == MRIGHT)
return true;
}
@@ -2346,7 +2344,7 @@
// stretched size to avoid an extra layout when applying alignment.
if (parent()->isFlexibleBox()) {
// For multiline columns, we need to apply align-content first, so we can't stretch now.
- if (!parent()->style()->isColumnFlexDirection() || parent()->style()->flexWrap() != FlexNoWrap)
+ if (!parent()->style().isColumnFlexDirection() || parent()->style().flexWrap() != FlexNoWrap)
return true;
if (!flexItemHasStretchAlignment(*this))
return true;
@@ -2356,7 +2354,7 @@
// that don't stretch their kids lay out their children at their intrinsic widths.
// FIXME: Think about block-flow here.
// https://bugs.webkit.org/show_bug.cgi?id=46473
- if (parent()->isDeprecatedFlexibleBox() && (parent()->style()->boxOrient() == HORIZONTAL || parent()->style()->boxAlign() != BSTRETCH))
+ if (parent()->isDeprecatedFlexibleBox() && (parent()->style().boxOrient() == HORIZONTAL || parent()->style().boxAlign() != BSTRETCH))
return true;
// Button, input, select, textarea, and legend treat width value of 'auto' as 'intrinsic' unless it's in a
@@ -2374,9 +2372,9 @@
void RenderBox::computeInlineDirectionMargins(RenderBlock* containingBlock, LayoutUnit containerWidth, LayoutUnit childWidth, LayoutUnit& marginStart, LayoutUnit& marginEnd) const
{
- const RenderStyle* containingBlockStyle = containingBlock->style();
- Length marginStartLength = style()->marginStartUsing(containingBlockStyle);
- Length marginEndLength = style()->marginEndUsing(containingBlockStyle);
+ const RenderStyle& containingBlockStyle = containingBlock->style();
+ Length marginStartLength = style().marginStartUsing(&containingBlockStyle);
+ Length marginEndLength = style().marginEndUsing(&containingBlockStyle);
if (isFloating() || isInline()) {
// Inline blocks/tables and floats don't have their margins increased.
@@ -2387,7 +2385,7 @@
// Case One: The object is being centered in the containing block's available logical width.
if ((marginStartLength.isAuto() && marginEndLength.isAuto() && childWidth < containerWidth)
- || (!marginStartLength.isAuto() && !marginEndLength.isAuto() && containingBlock->style()->textAlign() == WEBKIT_CENTER)) {
+ || (!marginStartLength.isAuto() && !marginEndLength.isAuto() && containingBlock->style().textAlign() == WEBKIT_CENTER)) {
// Other browsers center the margin box for align=center elements so we match them here.
LayoutUnit marginStartWidth = minimumValueForLength(marginStartLength, containerWidth);
LayoutUnit marginEndWidth = minimumValueForLength(marginEndLength, containerWidth);
@@ -2405,8 +2403,8 @@
}
// Case Three: The object is being pushed to the end of the containing block's available logical width.
- bool pushToEndFromTextAlign = !marginEndLength.isAuto() && ((!containingBlockStyle->isLeftToRightDirection() && containingBlockStyle->textAlign() == WEBKIT_LEFT)
- || (containingBlockStyle->isLeftToRightDirection() && containingBlockStyle->textAlign() == WEBKIT_RIGHT));
+ bool pushToEndFromTextAlign = !marginEndLength.isAuto() && ((!containingBlockStyle.isLeftToRightDirection() && containingBlockStyle.textAlign() == WEBKIT_LEFT)
+ || (containingBlockStyle.isLeftToRightDirection() && containingBlockStyle.textAlign() == WEBKIT_RIGHT));
if ((marginStartLength.isAuto() && childWidth < containerWidth) || pushToEndFromTextAlign) {
marginEnd = valueForLength(marginEndLength, containerWidth);
marginStart = containerWidth - childWidth - marginEnd;
@@ -2435,7 +2433,7 @@
// FIXME: For now we limit this computation to normal RenderBlocks. Future patches will expand
// support to cover all boxes.
RenderFlowThread* flowThread = flowThreadContainingBlock();
- if (isRenderFlowThread() || !flowThread || !canHaveBoxInfoInRegion() || flowThread->style()->writingMode() != style()->writingMode())
+ if (isRenderFlowThread() || !flowThread || !canHaveBoxInfoInRegion() || flowThread->style().writingMode() != style().writingMode())
return 0;
LogicalExtentComputedValues computedValues;
@@ -2462,21 +2460,21 @@
if (!isOutOfFlowPositioned() && avoidsFloats() && cb->containsFloats()) {
LayoutUnit startPositionDelta = cb->computeStartPositionDeltaForChildAvoidingFloats(*this, marginStartInRegion, region);
- if (cb->style()->isLeftToRightDirection())
+ if (cb->style().isLeftToRightDirection())
logicalLeftDelta += startPositionDelta;
else
logicalRightDelta += startPositionDelta;
}
- if (cb->style()->isLeftToRightDirection())
+ if (cb->style().isLeftToRightDirection())
logicalLeftOffset += logicalLeftDelta;
else
logicalLeftOffset -= (widthDelta + logicalRightDelta);
LayoutUnit logicalRightOffset = logicalWidth() - (logicalLeftOffset + logicalWidthInRegion);
bool isShifted = (containingBlockInfo && containingBlockInfo->isShifted())
- || (style()->isLeftToRightDirection() && logicalLeftOffset)
- || (!style()->isLeftToRightDirection() && logicalRightOffset);
+ || (style().isLeftToRightDirection() && logicalLeftOffset)
+ || (!style().isLeftToRightDirection() && logicalRightOffset);
// FIXME: Although it's unlikely, these boxes can go outside our bounds, and so we will need to incorporate them into overflow.
if (cacheFlag == CacheRenderBoxRegionInfo)
@@ -2484,12 +2482,12 @@
return new RenderBoxRegionInfo(logicalLeftOffset, logicalWidthInRegion, isShifted);
}
-static bool shouldFlipBeforeAfterMargins(const RenderStyle* containingBlockStyle, const RenderStyle* childStyle)
+static bool shouldFlipBeforeAfterMargins(const RenderStyle& containingBlockStyle, const RenderStyle* childStyle)
{
- ASSERT(containingBlockStyle->isHorizontalWritingMode() != childStyle->isHorizontalWritingMode());
+ ASSERT(containingBlockStyle.isHorizontalWritingMode() != childStyle->isHorizontalWritingMode());
WritingMode childWritingMode = childStyle->writingMode();
bool shouldFlip = false;
- switch (containingBlockStyle->writingMode()) {
+ switch (containingBlockStyle.writingMode()) {
case TopToBottomWritingMode:
shouldFlip = (childWritingMode == RightToLeftWritingMode);
break;
@@ -2504,7 +2502,7 @@
break;
}
- if (!containingBlockStyle->isLeftToRightDirection())
+ if (!containingBlockStyle.isLeftToRightDirection())
shouldFlip = !shouldFlip;
return shouldFlip;
@@ -2538,7 +2536,7 @@
bool hasPerpendicularContainingBlock = cb->isHorizontalWritingMode() != isHorizontalWritingMode();
if (!hasPerpendicularContainingBlock) {
- bool shouldFlipBeforeAfter = cb->style()->writingMode() != style()->writingMode();
+ bool shouldFlipBeforeAfter = cb->style().writingMode() != style().writingMode();
computeBlockDirectionMargins(cb,
shouldFlipBeforeAfter ? computedValues.m_margins.m_after : computedValues.m_margins.m_before,
shouldFlipBeforeAfter ? computedValues.m_margins.m_before : computedValues.m_margins.m_after);
@@ -2547,7 +2545,7 @@
// For tables, calculate margins only.
if (isTable()) {
if (hasPerpendicularContainingBlock) {
- bool shouldFlipBeforeAfter = shouldFlipBeforeAfterMargins(cb->style(), style());
+ bool shouldFlipBeforeAfter = shouldFlipBeforeAfterMargins(cb->style(), &style());
computeInlineDirectionMargins(cb, containingBlockLogicalWidthForContent(), computedValues.m_extent,
shouldFlipBeforeAfter ? computedValues.m_margins.m_after : computedValues.m_margins.m_before,
shouldFlipBeforeAfter ? computedValues.m_margins.m_before : computedValues.m_margins.m_after);
@@ -2557,8 +2555,8 @@
// FIXME: Account for block-flow in flexible boxes.
// https://bugs.webkit.org/show_bug.cgi?id=46418
- bool inHorizontalBox = parent()->isDeprecatedFlexibleBox() && parent()->style()->boxOrient() == HORIZONTAL;
- bool stretching = parent()->style()->boxAlign() == BSTRETCH;
+ bool inHorizontalBox = parent()->isDeprecatedFlexibleBox() && parent()->style().boxOrient() == HORIZONTAL;
+ bool stretching = parent()->style().boxAlign() == BSTRETCH;
bool treatAsReplaced = shouldComputeSizeAsReplaced() && (!inHorizontalBox || !stretching);
bool checkMinMaxHeight = false;
@@ -2571,14 +2569,14 @@
else if (treatAsReplaced)
h = Length(computeReplacedLogicalHeight(), Fixed);
else {
- h = style()->logicalHeight();
+ h = style().logicalHeight();
checkMinMaxHeight = true;
}
// Block children of horizontal flexible boxes fill the height of the box.
// FIXME: Account for block-flow in flexible boxes.
// https://bugs.webkit.org/show_bug.cgi?id=46418
- if (h.isAuto() && parent()->isDeprecatedFlexibleBox() && parent()->style()->boxOrient() == HORIZONTAL
+ if (h.isAuto() && parent()->isDeprecatedFlexibleBox() && parent()->style().boxOrient() == HORIZONTAL
&& parent()->isStretchingChildren()) {
h = Length(parentBox()->contentLogicalHeight() - marginBefore() - marginAfter() - borderAndPaddingLogicalHeight(), Fixed);
checkMinMaxHeight = false;
@@ -2586,7 +2584,7 @@
LayoutUnit heightResult;
if (checkMinMaxHeight) {
- heightResult = computeLogicalHeightUsing(style()->logicalHeight());
+ heightResult = computeLogicalHeightUsing(style().logicalHeight());
if (heightResult == -1)
heightResult = computedValues.m_extent;
heightResult = constrainLogicalHeightByMinMax(heightResult);
@@ -2600,7 +2598,7 @@
computedValues.m_extent = heightResult;
if (hasPerpendicularContainingBlock) {
- bool shouldFlipBeforeAfter = shouldFlipBeforeAfterMargins(cb->style(), style());
+ bool shouldFlipBeforeAfter = shouldFlipBeforeAfterMargins(cb->style(), &style());
computeInlineDirectionMargins(cb, containingBlockLogicalWidthForContent(), heightResult,
shouldFlipBeforeAfter ? computedValues.m_margins.m_after : computedValues.m_margins.m_before,
shouldFlipBeforeAfter ? computedValues.m_margins.m_before : computedValues.m_margins.m_after);
@@ -2613,7 +2611,7 @@
// height since we don't set a height in RenderView when we're printing. So without this quirk, the
// height has nothing to be a percentage of, and it ends up being 0. That is bad.
bool paginatedContentNeedsBaseHeight = document().printing() && h.isPercent()
- && (isRoot() || (isBody() && document().documentElement()->renderer()->style()->logicalHeight().isPercent())) && !isInline();
+ && (isRoot() || (isBody() && document().documentElement()->renderer()->style().logicalHeight().isPercent())) && !isInline();
if (stretchesToViewport() || paginatedContentNeedsBaseHeight) {
LayoutUnit margins = collapsedMarginBefore() + collapsedMarginAfter();
LayoutUnit visibleHeight = view().pageOrViewLogicalHeight();
@@ -2659,7 +2657,7 @@
// For standards mode, we treat the percentage as auto if it has an auto-height containing block.
if (!document().inQuirksMode() && !containingBlock->isAnonymousBlock())
return false;
- return !containingBlock->isTableCell() && !containingBlock->isOutOfFlowPositioned() && containingBlock->style()->logicalHeight().isAuto() && isHorizontalWritingMode() == containingBlock->isHorizontalWritingMode();
+ return !containingBlock->isTableCell() && !containingBlock->isOutOfFlowPositioned() && containingBlock->style().logicalHeight().isAuto() && isHorizontalWritingMode() == containingBlock->isHorizontalWritingMode();
}
LayoutUnit RenderBox::computePercentageLogicalHeight(const Length& height) const
@@ -2679,11 +2677,11 @@
cb->addPercentHeightDescendant(const_cast<RenderBox&>(*this));
}
- RenderStyle* cbstyle = cb->style();
+ const RenderStyle& cbstyle = cb->style();
// A positioned element that specified both top/bottom or that specifies height should be treated as though it has a height
// explicitly specified that can be used for any percentage computations.
- bool isOutOfFlowPositionedWithSpecifiedHeight = cb->isOutOfFlowPositioned() && (!cbstyle->logicalHeight().isAuto() || (!cbstyle->logicalTop().isAuto() && !cbstyle->logicalBottom().isAuto()));
+ bool isOutOfFlowPositionedWithSpecifiedHeight = cb->isOutOfFlowPositioned() && (!cbstyle.logicalHeight().isAuto() || (!cbstyle.logicalTop().isAuto() && !cbstyle.logicalBottom().isAuto()));
bool includeBorderPadding = isTable();
@@ -2705,19 +2703,19 @@
// to grow to fill the space. This could end up being wrong in some cases, but it is
// preferable to the alternative (sizing intrinsically and making the row end up too big).
RenderTableCell* cell = toRenderTableCell(cb);
- if (scrollsOverflowY() && (!cell->style()->logicalHeight().isAuto() || !cell->table()->style()->logicalHeight().isAuto()))
+ if (scrollsOverflowY() && (!cell->style().logicalHeight().isAuto() || !cell->table()->style().logicalHeight().isAuto()))
return 0;
return -1;
}
availableHeight = cb->overrideLogicalContentHeight();
includeBorderPadding = true;
}
- } else if (cbstyle->logicalHeight().isFixed()) {
- LayoutUnit contentBoxHeight = cb->adjustContentBoxLogicalHeightForBoxSizing(cbstyle->logicalHeight().value());
+ } else if (cbstyle.logicalHeight().isFixed()) {
+ LayoutUnit contentBoxHeight = cb->adjustContentBoxLogicalHeightForBoxSizing(cbstyle.logicalHeight().value());
availableHeight = max<LayoutUnit>(0, cb->constrainContentBoxLogicalHeightByMinMax(contentBoxHeight - cb->scrollbarLogicalHeight()));
- } else if (cbstyle->logicalHeight().isPercent() && !isOutOfFlowPositionedWithSpecifiedHeight) {
+ } else if (cbstyle.logicalHeight().isPercent() && !isOutOfFlowPositionedWithSpecifiedHeight) {
// We need to recur and compute the percentage height for our containing block.
- LayoutUnit heightWithScrollbar = cb->computePercentageLogicalHeight(cbstyle->logicalHeight());
+ LayoutUnit heightWithScrollbar = cb->computePercentageLogicalHeight(cbstyle.logicalHeight());
if (heightWithScrollbar != -1) {
LayoutUnit contentBoxHeightWithScrollbar = cb->adjustContentBoxLogicalHeightForBoxSizing(heightWithScrollbar);
// We need to adjust for min/max height because this method does not
@@ -2755,13 +2753,13 @@
LayoutUnit RenderBox::computeReplacedLogicalWidth(ShouldComputePreferred shouldComputePreferred) const
{
- return computeReplacedLogicalWidthRespectingMinMaxWidth(computeReplacedLogicalWidthUsing(style()->logicalWidth()), shouldComputePreferred);
+ return computeReplacedLogicalWidthRespectingMinMaxWidth(computeReplacedLogicalWidthUsing(style().logicalWidth()), shouldComputePreferred);
}
LayoutUnit RenderBox::computeReplacedLogicalWidthRespectingMinMaxWidth(LayoutUnit logicalWidth, ShouldComputePreferred shouldComputePreferred) const
{
- LayoutUnit minLogicalWidth = (shouldComputePreferred == ComputePreferred && style()->logicalMinWidth().isPercent()) || style()->logicalMinWidth().isUndefined() ? logicalWidth : computeReplacedLogicalWidthUsing(style()->logicalMinWidth());
- LayoutUnit maxLogicalWidth = (shouldComputePreferred == ComputePreferred && style()->logicalMaxWidth().isPercent()) || style()->logicalMaxWidth().isUndefined() ? logicalWidth : computeReplacedLogicalWidthUsing(style()->logicalMaxWidth());
+ LayoutUnit minLogicalWidth = (shouldComputePreferred == ComputePreferred && style().logicalMinWidth().isPercent()) || style().logicalMinWidth().isUndefined() ? logicalWidth : computeReplacedLogicalWidthUsing(style().logicalMinWidth());
+ LayoutUnit maxLogicalWidth = (shouldComputePreferred == ComputePreferred && style().logicalMaxWidth().isPercent()) || style().logicalMaxWidth().isUndefined() ? logicalWidth : computeReplacedLogicalWidthUsing(style().logicalMaxWidth());
return max(minLogicalWidth, min(logicalWidth, maxLogicalWidth));
}
@@ -2789,7 +2787,7 @@
// containing block's block-flow.
// https://bugs.webkit.org/show_bug.cgi?id=46496
const LayoutUnit cw = isOutOfFlowPositioned() ? containingBlockLogicalWidthForPositioned(toRenderBoxModelObject(container())) : containingBlockLogicalWidthForContent();
- Length containerLogicalWidth = containingBlock()->style()->logicalWidth();
+ Length containerLogicalWidth = containingBlock()->style().logicalWidth();
// FIXME: Handle cases when containing block width is calculated or viewport percent.
// https://bugs.webkit.org/show_bug.cgi?id=91071
if (logicalWidth.isIntrinsic())
@@ -2812,13 +2810,13 @@
LayoutUnit RenderBox::computeReplacedLogicalHeight() const
{
- return computeReplacedLogicalHeightRespectingMinMaxHeight(computeReplacedLogicalHeightUsing(style()->logicalHeight()));
+ return computeReplacedLogicalHeightRespectingMinMaxHeight(computeReplacedLogicalHeightUsing(style().logicalHeight()));
}
LayoutUnit RenderBox::computeReplacedLogicalHeightRespectingMinMaxHeight(LayoutUnit logicalHeight) const
{
- LayoutUnit minLogicalHeight = computeReplacedLogicalHeightUsing(style()->logicalMinHeight());
- LayoutUnit maxLogicalHeight = style()->logicalMaxHeight().isUndefined() ? logicalHeight : computeReplacedLogicalHeightUsing(style()->logicalMaxHeight());
+ LayoutUnit minLogicalHeight = computeReplacedLogicalHeightUsing(style().logicalMinHeight());
+ LayoutUnit maxLogicalHeight = style().logicalMaxHeight().isUndefined() ? logicalHeight : computeReplacedLogicalHeightUsing(style().logicalMaxHeight());
return max(minLogicalHeight, min(logicalHeight, maxLogicalHeight));
}
@@ -2838,7 +2836,7 @@
// FIXME: This calculation is not patched for block-flow yet.
// https://bugs.webkit.org/show_bug.cgi?id=46500
- if (cb->isOutOfFlowPositioned() && cb->style()->height().isAuto() && !(cb->style()->top().isAuto() || cb->style()->bottom().isAuto())) {
+ if (cb->isOutOfFlowPositioned() && cb->style().height().isAuto() && !(cb->style().top().isAuto() || cb->style().bottom().isAuto())) {
ASSERT_WITH_SECURITY_IMPLICATION(cb->isRenderBlock());
RenderBlock* block = toRenderBlock(cb);
LogicalExtentComputedValues computedValues;
@@ -2861,7 +2859,7 @@
// table cells using percentage heights.
// FIXME: This needs to be made block-flow-aware. If the cell and image are perpendicular block-flows, this isn't right.
// https://bugs.webkit.org/show_bug.cgi?id=46997
- while (cb && !cb->isRenderView() && (cb->style()->logicalHeight().isAuto() || cb->style()->logicalHeight().isPercent())) {
+ while (cb && !cb->isRenderView() && (cb->style().logicalHeight().isAuto() || cb->style().logicalHeight().isPercent())) {
if (cb->isTableCell()) {
// Don't let table cells squeeze percent-height replaced elements
// <http://bugs.webkit.org/show_bug.cgi?id=15359>
@@ -2886,7 +2884,7 @@
LayoutUnit RenderBox::availableLogicalHeight(AvailableLogicalHeightType heightType) const
{
- return constrainLogicalHeightByMinMax(availableLogicalHeightUsing(style()->logicalHeight(), heightType));
+ return constrainLogicalHeightByMinMax(availableLogicalHeightUsing(style().logicalHeight(), heightType));
}
LayoutUnit RenderBox::availableLogicalHeightUsing(const Length& h, AvailableLogicalHeightType heightType) const
@@ -2912,7 +2910,7 @@
// FIXME: Check logicalTop/logicalBottom here to correctly handle vertical writing-mode.
// https://bugs.webkit.org/show_bug.cgi?id=46500
- if (isRenderBlock() && isOutOfFlowPositioned() && style()->height().isAuto() && !(style()->top().isAuto() || style()->bottom().isAuto())) {
+ if (isRenderBlock() && isOutOfFlowPositioned() && style().height().isAuto() && !(style().top().isAuto() || style().bottom().isAuto())) {
RenderBlock* block = const_cast<RenderBlock*>(toRenderBlock(this));
LogicalExtentComputedValues computedValues;
block->computeLogicalHeight(block->logicalHeight(), 0, computedValues);
@@ -2942,9 +2940,9 @@
// Margins are calculated with respect to the logical width of
// the containing block (8.3)
LayoutUnit cw = containingBlockLogicalWidthForContent();
- RenderStyle* containingBlockStyle = containingBlock->style();
- marginBefore = minimumValueForLength(style()->marginBeforeUsing(containingBlockStyle), cw);
- marginAfter = minimumValueForLength(style()->marginAfterUsing(containingBlockStyle), cw);
+ const RenderStyle& containingBlockStyle = containingBlock->style();
+ marginBefore = minimumValueForLength(style().marginBeforeUsing(&containingBlockStyle), cw);
+ marginAfter = minimumValueForLength(style().marginAfterUsing(&containingBlockStyle), cw);
}
void RenderBox::computeAndSetBlockDirectionMargins(const RenderBlock* containingBlock)
@@ -2971,7 +2969,7 @@
if (!flowThread)
return toRenderBox(containingBlock)->clientLogicalWidth();
- if (containingBlock->isRenderNamedFlowThread() && style()->position() == FixedPosition)
+ if (containingBlock->isRenderNamedFlowThread() && style().position() == FixedPosition)
return containingBlock->view().clientLogicalWidth();
const RenderBlock* cb = toRenderBlock(containingBlock);
@@ -3004,7 +3002,7 @@
LayoutUnit fromLeft;
LayoutUnit fromRight;
- if (containingBlock->style()->isLeftToRightDirection()) {
+ if (containingBlock->style().isLeftToRightDirection()) {
fromLeft = first->logicalLeft() + first->borderLogicalLeft();
fromRight = last->logicalLeft() + last->logicalWidth() - last->borderLogicalRight();
} else {
@@ -3029,7 +3027,7 @@
LayoutUnit result = cb->clientLogicalHeight();
RenderFlowThread* flowThread = flowThreadContainingBlock();
if (flowThread && containingBlock->isRenderFlowThread() && flowThread->isHorizontalWritingMode() == containingBlock->isHorizontalWritingMode()) {
- if (containingBlock->isRenderNamedFlowThread() && style()->position() == FixedPosition)
+ if (containingBlock->isRenderNamedFlowThread() && style().position() == FixedPosition)
return containingBlock->view().clientLogicalHeight();
return toRenderFlowThread(containingBlock)->contentLogicalHeightOfFirstRegion();
}
@@ -3062,7 +3060,7 @@
return;
// FIXME: The static distance computation has not been patched for mixed writing modes yet.
- if (child->parent()->style()->direction() == LTR) {
+ if (child->parent()->style().direction() == LTR) {
LayoutUnit staticPosition = child->layer()->staticInlinePosition() - containerBlock->borderLogicalLeft();
for (auto curr = child->parent(); curr && curr != containerBlock; curr = curr->container()) {
if (curr->isBox()) {
@@ -3139,15 +3137,15 @@
// Use the container block's direction except when calculating the static distance
// This conforms with the reference results for abspos-replaced-width-margin-000.htm
// of the CSS 2.1 test suite
- TextDirection containerDirection = containerBlock->style()->direction();
+ TextDirection containerDirection = containerBlock->style().direction();
bool isHorizontal = isHorizontalWritingMode();
const LayoutUnit bordersPlusPadding = borderAndPaddingLogicalWidth();
- const Length marginLogicalLeft = isHorizontal ? style()->marginLeft() : style()->marginTop();
- const Length marginLogicalRight = isHorizontal ? style()->marginRight() : style()->marginBottom();
+ const Length marginLogicalLeft = isHorizontal ? style().marginLeft() : style().marginTop();
+ const Length marginLogicalRight = isHorizontal ? style().marginRight() : style().marginBottom();
- Length logicalLeftLength = style()->logicalLeft();
- Length logicalRightLength = style()->logicalRight();
+ Length logicalLeftLength = style().logicalLeft();
+ Length logicalRightLength = style().logicalRight();
/*---------------------------------------------------------------------------*\
* For the purposes of this section and the next, the term "static position"
@@ -3178,16 +3176,16 @@
computeInlineStaticDistance(logicalLeftLength, logicalRightLength, this, containerBlock, containerLogicalWidth, region);
// Calculate constraint equation values for 'width' case.
- computePositionedLogicalWidthUsing(style()->logicalWidth(), containerBlock, containerDirection,
+ computePositionedLogicalWidthUsing(style().logicalWidth(), containerBlock, containerDirection,
containerLogicalWidth, bordersPlusPadding,
logicalLeftLength, logicalRightLength, marginLogicalLeft, marginLogicalRight,
computedValues);
// Calculate constraint equation values for 'max-width' case.
- if (!style()->logicalMaxWidth().isUndefined()) {
+ if (!style().logicalMaxWidth().isUndefined()) {
LogicalExtentComputedValues maxValues;
- computePositionedLogicalWidthUsing(style()->logicalMaxWidth(), containerBlock, containerDirection,
+ computePositionedLogicalWidthUsing(style().logicalMaxWidth(), containerBlock, containerDirection,
containerLogicalWidth, bordersPlusPadding,
logicalLeftLength, logicalRightLength, marginLogicalLeft, marginLogicalRight,
maxValues);
@@ -3201,10 +3199,10 @@
}
// Calculate constraint equation values for 'min-width' case.
- if (!style()->logicalMinWidth().isZero() || style()->logicalMinWidth().isIntrinsic()) {
+ if (!style().logicalMinWidth().isZero() || style().logicalMinWidth().isIntrinsic()) {
LogicalExtentComputedValues minValues;
- computePositionedLogicalWidthUsing(style()->logicalMinWidth(), containerBlock, containerDirection,
+ computePositionedLogicalWidthUsing(style().logicalMinWidth(), containerBlock, containerDirection,
containerLogicalWidth, bordersPlusPadding,
logicalLeftLength, logicalRightLength, marginLogicalLeft, marginLogicalRight,
minValues);
@@ -3242,7 +3240,7 @@
{
// Deal with differing writing modes here. Our offset needs to be in the containing block's coordinate space. If the containing block is flipped
// along this axis, then we need to flip the coordinate. This can only happen if the containing block is both a flipped mode and perpendicular to us.
- if (containerBlock->isHorizontalWritingMode() != child->isHorizontalWritingMode() && containerBlock->style()->isFlippedBlocksWritingMode()) {
+ if (containerBlock->isHorizontalWritingMode() != child->isHorizontalWritingMode() && containerBlock->style().isFlippedBlocksWritingMode()) {
logicalLeftPos = containerLogicalWidth - logicalWidthValue - logicalLeftPos;
logicalLeftPos += (child->isHorizontalWritingMode() ? containerBlock->borderRight() : containerBlock->borderBottom());
} else
@@ -3268,8 +3266,8 @@
bool logicalWidthIsAuto = logicalWidth.isIntrinsicOrAuto();
bool logicalLeftIsAuto = logicalLeft.isAuto();
bool logicalRightIsAuto = logicalRight.isAuto();
- LayoutUnit& marginLogicalLeftValue = style()->isLeftToRightDirection() ? computedValues.m_margins.m_start : computedValues.m_margins.m_end;
- LayoutUnit& marginLogicalRightValue = style()->isLeftToRightDirection() ? computedValues.m_margins.m_end : computedValues.m_margins.m_start;
+ LayoutUnit& marginLogicalLeftValue = style().isLeftToRightDirection() ? computedValues.m_margins.m_start : computedValues.m_margins.m_end;
+ LayoutUnit& marginLogicalRightValue = style().isLeftToRightDirection() ? computedValues.m_margins.m_end : computedValues.m_margins.m_start;
if (!logicalLeftIsAuto && !logicalWidthIsAuto && !logicalRightIsAuto) {
/*-----------------------------------------------------------------------*\
@@ -3417,7 +3415,7 @@
// positioned, inline because right now, it is using the logical left position
// of the first line box when really it should use the last line box. When
// this is fixed elsewhere, this block should be removed.
- if (containerBlock->isRenderInline() && !containerBlock->style()->isLeftToRightDirection()) {
+ if (containerBlock->isRenderInline() && !containerBlock->style().isLeftToRightDirection()) {
const RenderInline* flow = toRenderInline(containerBlock);
InlineFlowBox* firstLine = flow->firstLineBox();
InlineFlowBox* lastLine = flow->lastLineBox();
@@ -3464,12 +3462,12 @@
const LayoutUnit containerLogicalHeight = containingBlockLogicalHeightForPositioned(containerBlock);
- RenderStyle* styleToUse = style();
+ const RenderStyle& styleToUse = style();
const LayoutUnit bordersPlusPadding = borderAndPaddingLogicalHeight();
- const Length marginBefore = styleToUse->marginBefore();
- const Length marginAfter = styleToUse->marginAfter();
- Length logicalTopLength = styleToUse->logicalTop();
- Length logicalBottomLength = styleToUse->logicalBottom();
+ const Length marginBefore = styleToUse.marginBefore();
+ const Length marginAfter = styleToUse.marginAfter();
+ Length logicalTopLength = styleToUse.logicalTop();
+ Length logicalBottomLength = styleToUse.logicalBottom();
/*---------------------------------------------------------------------------*\
* For the purposes of this section and the next, the term "static position"
@@ -3494,7 +3492,7 @@
// Calculate constraint equation values for 'height' case.
LayoutUnit logicalHeight = computedValues.m_extent;
- computePositionedLogicalHeightUsing(styleToUse->logicalHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding, logicalHeight,
+ computePositionedLogicalHeightUsing(styleToUse.logicalHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding, logicalHeight,
logicalTopLength, logicalBottomLength, marginBefore, marginAfter,
computedValues);
@@ -3502,10 +3500,10 @@
// see FIXME 2
// Calculate constraint equation values for 'max-height' case.
- if (!styleToUse->logicalMaxHeight().isUndefined()) {
+ if (!styleToUse.logicalMaxHeight().isUndefined()) {
LogicalExtentComputedValues maxValues;
- computePositionedLogicalHeightUsing(styleToUse->logicalMaxHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding, logicalHeight,
+ computePositionedLogicalHeightUsing(styleToUse.logicalMaxHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding, logicalHeight,
logicalTopLength, logicalBottomLength, marginBefore, marginAfter,
maxValues);
@@ -3518,10 +3516,10 @@
}
// Calculate constraint equation values for 'min-height' case.
- if (!styleToUse->logicalMinHeight().isZero()) {
+ if (!styleToUse.logicalMinHeight().isZero()) {
LogicalExtentComputedValues minValues;
- computePositionedLogicalHeightUsing(styleToUse->logicalMinHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding, logicalHeight,
+ computePositionedLogicalHeightUsing(styleToUse.logicalMinHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding, logicalHeight,
logicalTopLength, logicalBottomLength, marginBefore, marginAfter,
minValues);
@@ -3559,12 +3557,12 @@
{
// Deal with differing writing modes here. Our offset needs to be in the containing block's coordinate space. If the containing block is flipped
// along this axis, then we need to flip the coordinate. This can only happen if the containing block is both a flipped mode and perpendicular to us.
- if ((child->style()->isFlippedBlocksWritingMode() && child->isHorizontalWritingMode() != containerBlock->isHorizontalWritingMode())
- || (child->style()->isFlippedBlocksWritingMode() != containerBlock->style()->isFlippedBlocksWritingMode() && child->isHorizontalWritingMode() == containerBlock->isHorizontalWritingMode()))
+ if ((child->style().isFlippedBlocksWritingMode() && child->isHorizontalWritingMode() != containerBlock->isHorizontalWritingMode())
+ || (child->style().isFlippedBlocksWritingMode() != containerBlock->style().isFlippedBlocksWritingMode() && child->isHorizontalWritingMode() == containerBlock->isHorizontalWritingMode()))
logicalTopPos = containerLogicalHeight - logicalHeightValue - logicalTopPos;
// Our offset is from the logical bottom edge in a flipped environment, e.g., right for vertical-rl and bottom for horizontal-bt.
- if (containerBlock->style()->isFlippedBlocksWritingMode() && child->isHorizontalWritingMode() == containerBlock->isHorizontalWritingMode()) {
+ if (containerBlock->style().isFlippedBlocksWritingMode() && child->isHorizontalWritingMode() == containerBlock->isHorizontalWritingMode()) {
if (child->isHorizontalWritingMode())
logicalTopPos += containerBlock->borderBottom();
else
@@ -3718,16 +3716,16 @@
// To match WinIE, in quirks mode use the parent's 'direction' property
// instead of the the container block's.
- TextDirection containerDirection = containerBlock->style()->direction();
+ TextDirection containerDirection = containerBlock->style().direction();
// Variables to solve.
bool isHorizontal = isHorizontalWritingMode();
- Length logicalLeft = style()->logicalLeft();
- Length logicalRight = style()->logicalRight();
- Length marginLogicalLeft = isHorizontal ? style()->marginLeft() : style()->marginTop();
- Length marginLogicalRight = isHorizontal ? style()->marginRight() : style()->marginBottom();
- LayoutUnit& marginLogicalLeftAlias = style()->isLeftToRightDirection() ? computedValues.m_margins.m_start : computedValues.m_margins.m_end;
- LayoutUnit& marginLogicalRightAlias = style()->isLeftToRightDirection() ? computedValues.m_margins.m_end : computedValues.m_margins.m_start;
+ Length logicalLeft = style().logicalLeft();
+ Length logicalRight = style().logicalRight();
+ Length marginLogicalLeft = isHorizontal ? style().marginLeft() : style().marginTop();
+ Length marginLogicalRight = isHorizontal ? style().marginRight() : style().marginBottom();
+ LayoutUnit& marginLogicalLeftAlias = style().isLeftToRightDirection() ? computedValues.m_margins.m_start : computedValues.m_margins.m_end;
+ LayoutUnit& marginLogicalRightAlias = style().isLeftToRightDirection() ? computedValues.m_margins.m_end : computedValues.m_margins.m_start;
/*-----------------------------------------------------------------------*\
* 1. The used value of 'width' is determined as for inline replaced
@@ -3855,7 +3853,7 @@
// positioned, inline containing block because right now, it is using the logical left position
// of the first line box when really it should use the last line box. When
// this is fixed elsewhere, this block should be removed.
- if (containerBlock->isRenderInline() && !containerBlock->style()->isLeftToRightDirection()) {
+ if (containerBlock->isRenderInline() && !containerBlock->style().isLeftToRightDirection()) {
const RenderInline* flow = toRenderInline(containerBlock);
InlineFlowBox* firstLine = flow->firstLineBox();
InlineFlowBox* lastLine = flow->lastLineBox();
@@ -3885,13 +3883,13 @@
const LayoutUnit containerRelativeLogicalWidth = containingBlockLogicalWidthForPositioned(containerBlock, 0, false);
// Variables to solve.
- Length marginBefore = style()->marginBefore();
- Length marginAfter = style()->marginAfter();
+ Length marginBefore = style().marginBefore();
+ Length marginAfter = style().marginAfter();
LayoutUnit& marginBeforeAlias = computedValues.m_margins.m_before;
LayoutUnit& marginAfterAlias = computedValues.m_margins.m_after;
- Length logicalTop = style()->logicalTop();
- Length logicalBottom = style()->logicalBottom();
+ Length logicalTop = style().logicalTop();
+ Length logicalBottom = style().logicalBottom();
/*-----------------------------------------------------------------------*\
* 1. The used value of 'height' is determined as for inline replaced
@@ -4007,7 +4005,7 @@
// FIXME: Paint the carets inside empty blocks differently than the carets before/after elements.
LayoutRect rect(location(), LayoutSize(caretWidth, height()));
- bool ltr = box ? box->isLeftToRightDirection() : style()->isLeftToRightDirection();
+ bool ltr = box ? box->isLeftToRightDirection() : style().isLeftToRightDirection();
if ((!caretOffset) ^ ltr)
rect.move(LayoutSize(width() - caretWidth, 0));
@@ -4027,7 +4025,7 @@
// <rdar://problem/3777804> Deleting all content in a document can result in giant tall-as-window insertion point
//
// FIXME: ignoring :first-line, missing good reason to take care of
- LayoutUnit fontHeight = style()->fontMetrics().height();
+ LayoutUnit fontHeight = style().fontMetrics().height();
if (fontHeight > rect.height() || (!isReplaced() && !isTable()))
rect.setHeight(fontHeight);
@@ -4081,7 +4079,7 @@
RenderBox* renderer = toRenderBox(renderObject);
if ((!renderer->firstChild() && !renderer->isInline() && !renderer->isRenderBlockFlow() )
- || renderer->style()->visibility() != VISIBLE)
+ || renderer->style().visibility() != VISIBLE)
continue;
LayoutUnit top = renderer->borderTop() + renderer->paddingTop() + (isTableRow() ? LayoutUnit() : renderer->y());
@@ -4141,7 +4139,7 @@
return false;
// Only auto width objects can possibly shrink to avoid floats.
- return style()->width().isAuto();
+ return style().width().isAuto();
}
bool RenderBox::avoidsFloats() const
@@ -4151,7 +4149,7 @@
void RenderBox::addVisualEffectOverflow()
{
- if (!style()->boxShadow() && !style()->hasBorderImageOutsets())
+ if (!style().boxShadow() && !style().hasBorderImageOutsets())
return;
LayoutRect borderBox = borderBoxRect();
@@ -4164,7 +4162,7 @@
LayoutRect RenderBox::applyVisualEffectOverflow(const LayoutRect& borderBox) const
{
- bool isFlipped = style()->isFlippedBlocksWritingMode();
+ bool isFlipped = style().isFlippedBlocksWritingMode();
bool isHorizontal = isHorizontalWritingMode();
LayoutUnit overflowMinX = borderBox.x();
@@ -4173,12 +4171,12 @@
LayoutUnit overflowMaxY = borderBox.maxY();
// Compute box-shadow overflow first.
- if (style()->boxShadow()) {
+ if (style().boxShadow()) {
LayoutUnit shadowLeft;
LayoutUnit shadowRight;
LayoutUnit shadowTop;
LayoutUnit shadowBottom;
- style()->getBoxShadowExtent(shadowTop, shadowRight, shadowBottom, shadowLeft);
+ style().getBoxShadowExtent(shadowTop, shadowRight, shadowBottom, shadowLeft);
// In flipped blocks writing modes such as vertical-rl, the physical right shadow value is actually at the lower x-coordinate.
overflowMinX = borderBox.x() + ((!isFlipped || isHorizontal) ? shadowLeft : -shadowRight);
@@ -4188,8 +4186,8 @@
}
// Now compute border-image-outset overflow.
- if (style()->hasBorderImageOutsets()) {
- LayoutBoxExtent borderOutsets = style()->borderImageOutsets();
+ if (style().hasBorderImageOutsets()) {
+ LayoutBoxExtent borderOutsets = style().borderImageOutsets();
// In flipped blocks writing modes, the physical sides are inverted. For example in vertical-rl, the right
// border is at the lower x coordinate value.
@@ -4216,7 +4214,7 @@
// Only propagate layout overflow from the child if the child isn't clipping its overflow. If it is, then
// its overflow is internal to it, and we don't care about it. layoutOverflowRectForPropagation takes care of this
// and just propagates the border box rect instead.
- LayoutRect childLayoutOverflowRect = child->layoutOverflowRectForPropagation(style());
+ LayoutRect childLayoutOverflowRect = child->layoutOverflowRectForPropagation(&style());
childLayoutOverflowRect.move(delta);
addLayoutOverflow(childLayoutOverflowRect);
@@ -4225,7 +4223,7 @@
// overflow if we are clipping our own overflow.
if (child->hasSelfPaintingLayer() || hasOverflowClip())
return;
- LayoutRect childVisualOverflowRect = child->visualOverflowRectForPropagation(style());
+ LayoutRect childVisualOverflowRect = child->visualOverflowRectForPropagation(&style());
childVisualOverflowRect.move(delta);
addVisualOverflow(childVisualOverflowRect);
}
@@ -4242,9 +4240,9 @@
// Overflow is in the block's coordinate space and thus is flipped for horizontal-bt and vertical-rl
// writing modes. At this stage that is actually a simplification, since we can treat horizontal-tb/bt as the same
// and vertical-lr/rl as the same.
- bool hasTopOverflow = !style()->isLeftToRightDirection() && !isHorizontalWritingMode();
- bool hasLeftOverflow = !style()->isLeftToRightDirection() && isHorizontalWritingMode();
- if (isFlexibleBox() && style()->isReverseFlexDirection()) {
+ bool hasTopOverflow = !style().isLeftToRightDirection() && !isHorizontalWritingMode();
+ bool hasLeftOverflow = !style().isLeftToRightDirection() && isHorizontalWritingMode();
+ if (isFlexibleBox() && style().isReverseFlexDirection()) {
RenderFlexibleBox* flexibleBox = toRenderFlexibleBox(this);
if (flexibleBox->isHorizontalFlow())
hasLeftOverflow = true;
@@ -4252,8 +4250,8 @@
hasTopOverflow = true;
}
- if (hasColumns() && style()->columnProgression() == ReverseColumnProgression) {
- if (isHorizontalWritingMode() ^ !style()->hasInlineColumnAxis())
+ if (hasColumns() && style().columnProgression() == ReverseColumnProgression) {
+ if (isHorizontalWritingMode() ^ !style().hasInlineColumnAxis())
hasLeftOverflow = !hasLeftOverflow;
else
hasTopOverflow = !hasTopOverflow;
@@ -4314,7 +4312,7 @@
// only at explicit containers.
const RenderBlock* cb = containingBlock;
bool inQuirksMode = cb->document().inQuirksMode();
- while (!cb->isRenderView() && !cb->isBody() && !cb->isTableCell() && !cb->isOutOfFlowPositioned() && cb->style()->logicalHeight().isAuto()) {
+ while (!cb->isRenderView() && !cb->isBody() && !cb->isTableCell() && !cb->isOutOfFlowPositioned() && cb->style().logicalHeight().isAuto()) {
if (!inQuirksMode && !cb->isAnonymousBlock())
break;
cb = cb->containingBlock();
@@ -4324,7 +4322,7 @@
// explicitly specified that can be used for any percentage computations.
// FIXME: We can't just check top/bottom here.
// https://bugs.webkit.org/show_bug.cgi?id=46500
- bool isOutOfFlowPositionedWithSpecifiedHeight = cb->isOutOfFlowPositioned() && (!cb->style()->logicalHeight().isAuto() || (!cb->style()->top().isAuto() && !cb->style()->bottom().isAuto()));
+ bool isOutOfFlowPositionedWithSpecifiedHeight = cb->isOutOfFlowPositioned() && (!cb->style().logicalHeight().isAuto() || (!cb->style().top().isAuto() && !cb->style().bottom().isAuto()));
// Table cells violate what the CSS spec says to do with heights. Basically we
// don't care if the cell specified a height or not. We just always make ourselves
@@ -4334,9 +4332,9 @@
// Otherwise we only use our percentage height if our containing block had a specified
// height.
- if (cb->style()->logicalHeight().isFixed())
+ if (cb->style().logicalHeight().isFixed())
return true;
- if (cb->style()->logicalHeight().isPercent() && !isOutOfFlowPositionedWithSpecifiedHeight)
+ if (cb->style().logicalHeight().isPercent() && !isOutOfFlowPositionedWithSpecifiedHeight)
return percentageLogicalHeightIsResolvableFromBlock(cb->containingBlock(), cb->isOutOfFlowPositioned());
if (cb->isRenderView() || inQuirksMode || isOutOfFlowPositionedWithSpecifiedHeight)
return true;
@@ -4361,9 +4359,9 @@
// Note this is just a heuristic, and it's still possible to have overflow under these
// conditions, but it should work out to be good enough for common cases. Paginating overflow
// with scrollbars present is not the end of the world and is what we used to do in the old model anyway.
- return !style()->logicalHeight().isIntrinsicOrAuto()
- || (!style()->logicalMaxHeight().isIntrinsicOrAuto() && !style()->logicalMaxHeight().isUndefined() && (!style()->logicalMaxHeight().isPercent() || percentageLogicalHeightIsResolvable(this)))
- || (!style()->logicalMinHeight().isIntrinsicOrAuto() && style()->logicalMinHeight().isPositive() && (!style()->logicalMinHeight().isPercent() || percentageLogicalHeightIsResolvable(this)));
+ return !style().logicalHeight().isIntrinsicOrAuto()
+ || (!style().logicalMaxHeight().isIntrinsicOrAuto() && !style().logicalMaxHeight().isUndefined() && (!style().logicalMaxHeight().isPercent() || percentageLogicalHeightIsResolvable(this)))
+ || (!style().logicalMinHeight().isIntrinsicOrAuto() && style().logicalMinHeight().isPositive() && (!style().logicalMinHeight().isPercent() || percentageLogicalHeightIsResolvable(this)));
}
bool RenderBox::isUnsplittableForPagination() const
@@ -4415,14 +4413,14 @@
// If the writing modes of the child and parent match, then we don't have to
// do anything fancy. Just return the result.
LayoutRect rect = visualOverflowRect();
- if (parentStyle->writingMode() == style()->writingMode())
+ if (parentStyle->writingMode() == style().writingMode())
return rect;
// We are putting ourselves into our parent's coordinate space. If there is a flipped block mismatch
// in a particular axis, then we have to flip the rect along that axis.
- if (style()->writingMode() == RightToLeftWritingMode || parentStyle->writingMode() == RightToLeftWritingMode)
+ if (style().writingMode() == RightToLeftWritingMode || parentStyle->writingMode() == RightToLeftWritingMode)
rect.setX(width() - rect.maxX());
- else if (style()->writingMode() == BottomToTopWritingMode || parentStyle->writingMode() == BottomToTopWritingMode)
+ else if (style().writingMode() == BottomToTopWritingMode || parentStyle->writingMode() == BottomToTopWritingMode)
rect.setY(height() - rect.maxY());
return rect;
@@ -4462,14 +4460,14 @@
// If the writing modes of the child and parent match, then we don't have to
// do anything fancy. Just return the result.
- if (parentStyle->writingMode() == style()->writingMode())
+ if (parentStyle->writingMode() == style().writingMode())
return rect;
// We are putting ourselves into our parent's coordinate space. If there is a flipped block mismatch
// in a particular axis, then we have to flip the rect along that axis.
- if (style()->writingMode() == RightToLeftWritingMode || parentStyle->writingMode() == RightToLeftWritingMode)
+ if (style().writingMode() == RightToLeftWritingMode || parentStyle->writingMode() == RightToLeftWritingMode)
rect.setX(width() - rect.maxX());
- else if (style()->writingMode() == BottomToTopWritingMode || parentStyle->writingMode() == BottomToTopWritingMode)
+ else if (style().writingMode() == BottomToTopWritingMode || parentStyle->writingMode() == BottomToTopWritingMode)
rect.setY(height() - rect.maxY());
return rect;
@@ -4498,7 +4496,7 @@
LayoutPoint RenderBox::flipForWritingModeForChild(const RenderBox* child, const LayoutPoint& point) const
{
- if (!style()->isFlippedBlocksWritingMode())
+ if (!style().isFlippedBlocksWritingMode())
return point;
// The child is going to add in its x() and y(), so we have to make sure it ends up in
@@ -4510,7 +4508,7 @@
void RenderBox::flipForWritingMode(LayoutRect& rect) const
{
- if (!style()->isFlippedBlocksWritingMode())
+ if (!style().isFlippedBlocksWritingMode())
return;
if (isHorizontalWritingMode())
@@ -4521,42 +4519,42 @@
LayoutUnit RenderBox::flipForWritingMode(LayoutUnit position) const
{
- if (!style()->isFlippedBlocksWritingMode())
+ if (!style().isFlippedBlocksWritingMode())
return position;
return logicalHeight() - position;
}
LayoutPoint RenderBox::flipForWritingMode(const LayoutPoint& position) const
{
- if (!style()->isFlippedBlocksWritingMode())
+ if (!style().isFlippedBlocksWritingMode())
return position;
return isHorizontalWritingMode() ? LayoutPoint(position.x(), height() - position.y()) : LayoutPoint(width() - position.x(), position.y());
}
LayoutPoint RenderBox::flipForWritingModeIncludingColumns(const LayoutPoint& point) const
{
- if (!hasColumns() || !style()->isFlippedBlocksWritingMode())
+ if (!hasColumns() || !style().isFlippedBlocksWritingMode())
return flipForWritingMode(point);
return toRenderBlock(this)->flipForWritingModeIncludingColumns(point);
}
LayoutSize RenderBox::flipForWritingMode(const LayoutSize& offset) const
{
- if (!style()->isFlippedBlocksWritingMode())
+ if (!style().isFlippedBlocksWritingMode())
return offset;
return isHorizontalWritingMode() ? LayoutSize(offset.width(), height() - offset.height()) : LayoutSize(width() - offset.width(), offset.height());
}
FloatPoint RenderBox::flipForWritingMode(const FloatPoint& position) const
{
- if (!style()->isFlippedBlocksWritingMode())
+ if (!style().isFlippedBlocksWritingMode())
return position;
return isHorizontalWritingMode() ? FloatPoint(position.x(), height() - position.y()) : FloatPoint(width() - position.x(), position.y());
}
void RenderBox::flipForWritingMode(FloatRect& rect) const
{
- if (!style()->isFlippedBlocksWritingMode())
+ if (!style().isFlippedBlocksWritingMode())
return;
if (isHorizontalWritingMode())
@@ -4586,23 +4584,23 @@
bool RenderBox::hasRelativeDimensions() const
{
- return style()->height().isPercent() || style()->width().isPercent()
- || style()->maxHeight().isPercent() || style()->maxWidth().isPercent()
- || style()->minHeight().isPercent() || style()->minWidth().isPercent();
+ return style().height().isPercent() || style().width().isPercent()
+ || style().maxHeight().isPercent() || style().maxWidth().isPercent()
+ || style().minHeight().isPercent() || style().minWidth().isPercent();
}
bool RenderBox::hasRelativeLogicalHeight() const
{
- return style()->logicalHeight().isPercent()
- || style()->logicalMinHeight().isPercent()
- || style()->logicalMaxHeight().isPercent();
+ return style().logicalHeight().isPercent()
+ || style().logicalMinHeight().isPercent()
+ || style().logicalMaxHeight().isPercent();
}
bool RenderBox::hasViewportPercentageLogicalHeight() const
{
- return style()->logicalHeight().isViewportPercentage()
- || style()->logicalMinHeight().isViewportPercentage()
- || style()->logicalMaxHeight().isViewportPercentage();
+ return style().logicalHeight().isViewportPercentage()
+ || style().logicalMinHeight().isViewportPercentage()
+ || style().logicalMaxHeight().isViewportPercentage();
}
static void markBoxForRelayoutAfterSplit(RenderBox* box)
diff --git a/Source/WebCore/rendering/RenderBox.h b/Source/WebCore/rendering/RenderBox.h
index ab3c181..f04b70c 100644
--- a/Source/WebCore/rendering/RenderBox.h
+++ b/Source/WebCore/rendering/RenderBox.h
@@ -52,8 +52,8 @@
virtual bool requiresLayer() const OVERRIDE
{
return isRoot() || isPositioned() || createsGroup() || hasClipPath() || hasOverflowClip()
- || hasTransform() || hasHiddenBackface() || hasReflection() || style()->specifiesColumns()
- || !style()->hasAutoZIndex();
+ || hasTransform() || hasHiddenBackface() || hasReflection() || style().specifiesColumns()
+ || !style().hasAutoZIndex();
}
virtual bool backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect) const OVERRIDE FINAL;
@@ -80,58 +80,58 @@
void setWidth(LayoutUnit width) { m_frameRect.setWidth(width); }
void setHeight(LayoutUnit height) { m_frameRect.setHeight(height); }
- LayoutUnit logicalLeft() const { return style()->isHorizontalWritingMode() ? x() : y(); }
+ LayoutUnit logicalLeft() const { return style().isHorizontalWritingMode() ? x() : y(); }
LayoutUnit logicalRight() const { return logicalLeft() + logicalWidth(); }
- LayoutUnit logicalTop() const { return style()->isHorizontalWritingMode() ? y() : x(); }
+ LayoutUnit logicalTop() const { return style().isHorizontalWritingMode() ? y() : x(); }
LayoutUnit logicalBottom() const { return logicalTop() + logicalHeight(); }
- LayoutUnit logicalWidth() const { return style()->isHorizontalWritingMode() ? width() : height(); }
- LayoutUnit logicalHeight() const { return style()->isHorizontalWritingMode() ? height() : width(); }
+ LayoutUnit logicalWidth() const { return style().isHorizontalWritingMode() ? width() : height(); }
+ LayoutUnit logicalHeight() const { return style().isHorizontalWritingMode() ? height() : width(); }
LayoutUnit constrainLogicalWidthInRegionByMinMax(LayoutUnit, LayoutUnit, RenderBlock*, RenderRegion* = 0) const;
LayoutUnit constrainLogicalHeightByMinMax(LayoutUnit) const;
LayoutUnit constrainContentBoxLogicalHeightByMinMax(LayoutUnit) const;
- int pixelSnappedLogicalHeight() const { return style()->isHorizontalWritingMode() ? pixelSnappedHeight() : pixelSnappedWidth(); }
- int pixelSnappedLogicalWidth() const { return style()->isHorizontalWritingMode() ? pixelSnappedWidth() : pixelSnappedHeight(); }
+ int pixelSnappedLogicalHeight() const { return style().isHorizontalWritingMode() ? pixelSnappedHeight() : pixelSnappedWidth(); }
+ int pixelSnappedLogicalWidth() const { return style().isHorizontalWritingMode() ? pixelSnappedWidth() : pixelSnappedHeight(); }
void setLogicalLeft(LayoutUnit left)
{
- if (style()->isHorizontalWritingMode())
+ if (style().isHorizontalWritingMode())
setX(left);
else
setY(left);
}
void setLogicalTop(LayoutUnit top)
{
- if (style()->isHorizontalWritingMode())
+ if (style().isHorizontalWritingMode())
setY(top);
else
setX(top);
}
void setLogicalLocation(const LayoutPoint& location)
{
- if (style()->isHorizontalWritingMode())
+ if (style().isHorizontalWritingMode())
setLocation(location);
else
setLocation(location.transposedPoint());
}
void setLogicalWidth(LayoutUnit size)
{
- if (style()->isHorizontalWritingMode())
+ if (style().isHorizontalWritingMode())
setWidth(size);
else
setHeight(size);
}
void setLogicalHeight(LayoutUnit size)
{
- if (style()->isHorizontalWritingMode())
+ if (style().isHorizontalWritingMode())
setHeight(size);
else
setWidth(size);
}
void setLogicalSize(const LayoutSize& size)
{
- if (style()->isHorizontalWritingMode())
+ if (style().isHorizontalWritingMode())
setSize(size);
else
setSize(size.transposedSize());
@@ -181,12 +181,12 @@
// respectively are flipped when compared to their physical counterparts. For example minX is on the left in vertical-lr,
// but it is on the right in vertical-rl.
LayoutRect layoutOverflowRect() const { return m_overflow ? m_overflow->layoutOverflowRect() : clientBoxRect(); }
- LayoutUnit logicalLeftLayoutOverflow() const { return style()->isHorizontalWritingMode() ? layoutOverflowRect().x() : layoutOverflowRect().y(); }
- LayoutUnit logicalRightLayoutOverflow() const { return style()->isHorizontalWritingMode() ? layoutOverflowRect().maxX() : layoutOverflowRect().maxY(); }
+ LayoutUnit logicalLeftLayoutOverflow() const { return style().isHorizontalWritingMode() ? layoutOverflowRect().x() : layoutOverflowRect().y(); }
+ LayoutUnit logicalRightLayoutOverflow() const { return style().isHorizontalWritingMode() ? layoutOverflowRect().maxX() : layoutOverflowRect().maxY(); }
virtual LayoutRect visualOverflowRect() const { return m_overflow ? m_overflow->visualOverflowRect() : borderBoxRect(); }
- LayoutUnit logicalLeftVisualOverflow() const { return style()->isHorizontalWritingMode() ? visualOverflowRect().x() : visualOverflowRect().y(); }
- LayoutUnit logicalRightVisualOverflow() const { return style()->isHorizontalWritingMode() ? visualOverflowRect().maxX() : visualOverflowRect().maxY(); }
+ LayoutUnit logicalLeftVisualOverflow() const { return style().isHorizontalWritingMode() ? visualOverflowRect().x() : visualOverflowRect().y(); }
+ LayoutUnit logicalRightVisualOverflow() const { return style().isHorizontalWritingMode() ? visualOverflowRect().maxX() : visualOverflowRect().maxY(); }
LayoutRect overflowRectForPaintRejection() const;
@@ -203,8 +203,8 @@
LayoutUnit contentWidth() const { return clientWidth() - paddingLeft() - paddingRight(); }
LayoutUnit contentHeight() const { return clientHeight() - paddingTop() - paddingBottom(); }
- LayoutUnit contentLogicalWidth() const { return style()->isHorizontalWritingMode() ? contentWidth() : contentHeight(); }
- LayoutUnit contentLogicalHeight() const { return style()->isHorizontalWritingMode() ? contentHeight() : contentWidth(); }
+ LayoutUnit contentLogicalWidth() const { return style().isHorizontalWritingMode() ? contentWidth() : contentHeight(); }
+ LayoutUnit contentLogicalHeight() const { return style().isHorizontalWritingMode() ? contentHeight() : contentWidth(); }
// IE extensions. Used to calculate offsetWidth/Height. Overridden by inlines (RenderFlow)
// to return the remaining width on a given line (and the height of a single line).
@@ -220,8 +220,8 @@
LayoutUnit clientTop() const { return borderTop(); }
LayoutUnit clientWidth() const;
LayoutUnit clientHeight() const;
- LayoutUnit clientLogicalWidth() const { return style()->isHorizontalWritingMode() ? clientWidth() : clientHeight(); }
- LayoutUnit clientLogicalHeight() const { return style()->isHorizontalWritingMode() ? clientHeight() : clientWidth(); }
+ LayoutUnit clientLogicalWidth() const { return style().isHorizontalWritingMode() ? clientWidth() : clientHeight(); }
+ LayoutUnit clientLogicalHeight() const { return style().isHorizontalWritingMode() ? clientHeight() : clientWidth(); }
LayoutUnit clientLogicalBottom() const { return borderBefore() + clientLogicalHeight(); }
LayoutRect clientBoxRect() const { return LayoutRect(clientLeft(), clientTop(), clientWidth(), clientHeight()); }
@@ -249,31 +249,31 @@
void setMarginLeft(LayoutUnit margin) { m_marginBox.setLeft(margin); }
void setMarginRight(LayoutUnit margin) { m_marginBox.setRight(margin); }
- LayoutUnit marginLogicalLeft() const { return m_marginBox.logicalLeft(style()->writingMode()); }
- LayoutUnit marginLogicalRight() const { return m_marginBox.logicalRight(style()->writingMode()); }
+ LayoutUnit marginLogicalLeft() const { return m_marginBox.logicalLeft(style().writingMode()); }
+ LayoutUnit marginLogicalRight() const { return m_marginBox.logicalRight(style().writingMode()); }
- virtual LayoutUnit marginBefore(const RenderStyle* overrideStyle = 0) const OVERRIDE FINAL { return m_marginBox.before((overrideStyle ? overrideStyle : style())->writingMode()); }
- virtual LayoutUnit marginAfter(const RenderStyle* overrideStyle = 0) const OVERRIDE FINAL { return m_marginBox.after((overrideStyle ? overrideStyle : style())->writingMode()); }
+ virtual LayoutUnit marginBefore(const RenderStyle* overrideStyle = 0) const OVERRIDE FINAL { return m_marginBox.before((overrideStyle ? overrideStyle : &style())->writingMode()); }
+ virtual LayoutUnit marginAfter(const RenderStyle* overrideStyle = 0) const OVERRIDE FINAL { return m_marginBox.after((overrideStyle ? overrideStyle : &style())->writingMode()); }
virtual LayoutUnit marginStart(const RenderStyle* overrideStyle = 0) const OVERRIDE FINAL
{
- const RenderStyle* styleToUse = overrideStyle ? overrideStyle : style();
+ const RenderStyle* styleToUse = overrideStyle ? overrideStyle : &style();
return m_marginBox.start(styleToUse->writingMode(), styleToUse->direction());
}
virtual LayoutUnit marginEnd(const RenderStyle* overrideStyle = 0) const OVERRIDE FINAL
{
- const RenderStyle* styleToUse = overrideStyle ? overrideStyle : style();
+ const RenderStyle* styleToUse = overrideStyle ? overrideStyle : &style();
return m_marginBox.end(styleToUse->writingMode(), styleToUse->direction());
}
- void setMarginBefore(LayoutUnit value, const RenderStyle* overrideStyle = 0) { m_marginBox.setBefore((overrideStyle ? overrideStyle : style())->writingMode(), value); }
- void setMarginAfter(LayoutUnit value, const RenderStyle* overrideStyle = 0) { m_marginBox.setAfter((overrideStyle ? overrideStyle : style())->writingMode(), value); }
+ void setMarginBefore(LayoutUnit value, const RenderStyle* overrideStyle = 0) { m_marginBox.setBefore((overrideStyle ? overrideStyle : &style())->writingMode(), value); }
+ void setMarginAfter(LayoutUnit value, const RenderStyle* overrideStyle = 0) { m_marginBox.setAfter((overrideStyle ? overrideStyle : &style())->writingMode(), value); }
void setMarginStart(LayoutUnit value, const RenderStyle* overrideStyle = 0)
{
- const RenderStyle* styleToUse = overrideStyle ? overrideStyle : style();
+ const RenderStyle* styleToUse = overrideStyle ? overrideStyle : &style();
m_marginBox.setStart(styleToUse->writingMode(), styleToUse->direction(), value);
}
void setMarginEnd(LayoutUnit value, const RenderStyle* overrideStyle = 0)
{
- const RenderStyle* styleToUse = overrideStyle ? overrideStyle : style();
+ const RenderStyle* styleToUse = overrideStyle ? overrideStyle : &style();
m_marginBox.setEnd(styleToUse->writingMode(), styleToUse->direction(), value);
}
@@ -404,12 +404,12 @@
bool stretchesToViewport() const
{
- return document().inQuirksMode() && style()->logicalHeight().isAuto() && !isFloatingOrOutOfFlowPositioned() && (isRoot() || isBody()) && !document().shouldDisplaySeamlesslyWithParent() && !isInline();
+ return document().inQuirksMode() && style().logicalHeight().isAuto() && !isFloatingOrOutOfFlowPositioned() && (isRoot() || isBody()) && !document().shouldDisplaySeamlesslyWithParent() && !isInline();
}
virtual LayoutSize intrinsicSize() const { return LayoutSize(); }
- LayoutUnit intrinsicLogicalWidth() const { return style()->isHorizontalWritingMode() ? intrinsicSize().width() : intrinsicSize().height(); }
- LayoutUnit intrinsicLogicalHeight() const { return style()->isHorizontalWritingMode() ? intrinsicSize().height() : intrinsicSize().width(); }
+ LayoutUnit intrinsicLogicalWidth() const { return style().isHorizontalWritingMode() ? intrinsicSize().width() : intrinsicSize().height(); }
+ LayoutUnit intrinsicLogicalHeight() const { return style().isHorizontalWritingMode() ? intrinsicSize().height() : intrinsicSize().width(); }
// Whether or not the element shrinks to its intrinsic width (rather than filling the width
// of a containing block). HTML4 buttons, <select>s, <input>s, legends, and floating/compact elements do this.
@@ -439,13 +439,13 @@
// There are a few cases where we need to refer specifically to the available physical width and available physical height.
// Relative positioning is one of those cases, since left/top offsets are physical.
- LayoutUnit availableWidth() const { return style()->isHorizontalWritingMode() ? availableLogicalWidth() : availableLogicalHeight(IncludeMarginBorderPadding); }
- LayoutUnit availableHeight() const { return style()->isHorizontalWritingMode() ? availableLogicalHeight(IncludeMarginBorderPadding) : availableLogicalWidth(); }
+ LayoutUnit availableWidth() const { return style().isHorizontalWritingMode() ? availableLogicalWidth() : availableLogicalHeight(IncludeMarginBorderPadding); }
+ LayoutUnit availableHeight() const { return style().isHorizontalWritingMode() ? availableLogicalHeight(IncludeMarginBorderPadding) : availableLogicalWidth(); }
virtual int verticalScrollbarWidth() const;
int horizontalScrollbarHeight() const;
int instrinsicScrollbarLogicalWidth() const;
- int scrollbarLogicalHeight() const { return style()->isHorizontalWritingMode() ? horizontalScrollbarHeight() : verticalScrollbarWidth(); }
+ int scrollbarLogicalHeight() const { return style().isHorizontalWritingMode() ? horizontalScrollbarHeight() : verticalScrollbarWidth(); }
virtual bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1, Element** stopElement = 0);
virtual bool logicalScroll(ScrollLogicalDirection, ScrollGranularity, float multiplier = 1, Element** stopElement = 0);
bool canBeScrolledAndHasScrollableArea() const;
@@ -457,11 +457,11 @@
virtual void stopAutoscroll() { }
virtual void panScroll(const IntPoint&);
- bool hasAutoVerticalScrollbar() const { return hasOverflowClip() && (style()->overflowY() == OAUTO || style()->overflowY() == OOVERLAY); }
- bool hasAutoHorizontalScrollbar() const { return hasOverflowClip() && (style()->overflowX() == OAUTO || style()->overflowX() == OOVERLAY); }
+ bool hasAutoVerticalScrollbar() const { return hasOverflowClip() && (style().overflowY() == OAUTO || style().overflowY() == OOVERLAY); }
+ bool hasAutoHorizontalScrollbar() const { return hasOverflowClip() && (style().overflowX() == OAUTO || style().overflowX() == OOVERLAY); }
bool scrollsOverflow() const { return scrollsOverflowX() || scrollsOverflowY(); }
- bool scrollsOverflowX() const { return hasOverflowClip() && (style()->overflowX() == OSCROLL || hasAutoHorizontalScrollbar()); }
- bool scrollsOverflowY() const { return hasOverflowClip() && (style()->overflowY() == OSCROLL || hasAutoVerticalScrollbar()); }
+ bool scrollsOverflowX() const { return hasOverflowClip() && (style().overflowX() == OSCROLL || hasAutoHorizontalScrollbar()); }
+ bool scrollsOverflowY() const { return hasOverflowClip() && (style().overflowY() == OSCROLL || hasAutoVerticalScrollbar()); }
bool hasScrollableOverflowX() const { return scrollsOverflowX() && scrollWidth() != clientWidth(); }
bool hasScrollableOverflowY() const { return scrollsOverflowY() && scrollHeight() != clientHeight(); }
@@ -516,7 +516,7 @@
virtual void markForPaginationRelayoutIfNeeded() { }
- bool isWritingModeRoot() const { return !parent() || parent()->style()->writingMode() != style()->writingMode(); }
+ bool isWritingModeRoot() const { return !parent() || parent()->style().writingMode() != style().writingMode(); }
bool isDeprecatedFlexItem() const { return !isInline() && !isFloatingOrOutOfFlowPositioned() && parent() && parent()->isDeprecatedFlexibleBox(); }
bool isFlexItemIncludingDeprecated() const { return !isInline() && !isFloatingOrOutOfFlowPositioned() && parent() && parent()->isFlexibleBoxIncludingDeprecated(); }
@@ -585,7 +585,7 @@
return 0;
}
- bool hasSameDirectionAs(const RenderBox* object) const { return style()->direction() == object->style()->direction(); }
+ bool hasSameDirectionAs(const RenderBox* object) const { return style().direction() == object->style().direction(); }
#if ENABLE(CSS_SHAPES)
ShapeOutsideInfo* shapeOutsideInfo() const
diff --git a/Source/WebCore/rendering/RenderBoxModelObject.cpp b/Source/WebCore/rendering/RenderBoxModelObject.cpp
index 6bd2325..1950313 100644
--- a/Source/WebCore/rendering/RenderBoxModelObject.cpp
+++ b/Source/WebCore/rendering/RenderBoxModelObject.cpp
@@ -195,11 +195,11 @@
// Set the appropriate bits for a box model object. Since all bits are cleared in styleWillChange,
// we only check for bits that could possibly be set to true.
- RenderStyle* styleToUse = style();
- setHasBoxDecorations(hasBackground() || styleToUse->hasBorder() || styleToUse->hasAppearance() || styleToUse->boxShadow());
- setInline(styleToUse->isDisplayInlineType());
- setPositionState(styleToUse->position());
- setHorizontalWritingMode(styleToUse->isHorizontalWritingMode());
+ const RenderStyle& styleToUse = style();
+ setHasBoxDecorations(hasBackground() || styleToUse.hasBorder() || styleToUse.hasAppearance() || styleToUse.boxShadow());
+ setInline(styleToUse.isDisplayInlineType());
+ setPositionState(styleToUse.position());
+ setHorizontalWritingMode(styleToUse.isHorizontalWritingMode());
}
static LayoutSize accumulateInFlowPositionOffsets(const RenderObject* child)
@@ -220,7 +220,7 @@
bool RenderBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight() const
{
- Length logicalHeightLength = style()->logicalHeight();
+ Length logicalHeightLength = style().logicalHeight();
if (logicalHeightLength.isAuto())
return true;
@@ -243,7 +243,7 @@
if (cb->isTableCell())
return false;
- if (!cb->style()->logicalHeight().isAuto() || (!cb->style()->logicalTop().isAuto() && !cb->style()->logicalBottom().isAuto()))
+ if (!cb->style().logicalHeight().isAuto() || (!cb->style().logicalTop().isAuto() && !cb->style().logicalBottom().isAuto()))
return false;
return true;
@@ -259,13 +259,13 @@
// in the case of relative positioning using percentages, we can't do this. The offset should always be resolved using the
// available width of the containing block. Therefore we don't use containingBlockLogicalWidthForContent() here, but instead explicitly
// call availableWidth on our containing block.
- if (!style()->left().isAuto()) {
- if (!style()->right().isAuto() && !containingBlock->style()->isLeftToRightDirection())
- offset.setWidth(-valueForLength(style()->right(), containingBlock->availableWidth()));
+ if (!style().left().isAuto()) {
+ if (!style().right().isAuto() && !containingBlock->style().isLeftToRightDirection())
+ offset.setWidth(-valueForLength(style().right(), containingBlock->availableWidth()));
else
- offset.expand(valueForLength(style()->left(), containingBlock->availableWidth()), 0);
- } else if (!style()->right().isAuto()) {
- offset.expand(-valueForLength(style()->right(), containingBlock->availableWidth()), 0);
+ offset.expand(valueForLength(style().left(), containingBlock->availableWidth()), 0);
+ } else if (!style().right().isAuto()) {
+ offset.expand(-valueForLength(style().right(), containingBlock->availableWidth()), 0);
}
// If the containing block of a relatively positioned element does not
@@ -274,17 +274,17 @@
// where <html> and <body> assume the size of the viewport. In this case,
// calculate the percent offset based on this height.
// See <https://bugs.webkit.org/show_bug.cgi?id=26396>.
- if (!style()->top().isAuto()
+ if (!style().top().isAuto()
&& (!containingBlock->hasAutoHeightOrContainingBlockWithAutoHeight()
- || !style()->top().isPercent()
+ || !style().top().isPercent()
|| containingBlock->stretchesToViewport()))
- offset.expand(0, valueForLength(style()->top(), containingBlock->availableHeight()));
+ offset.expand(0, valueForLength(style().top(), containingBlock->availableHeight()));
- else if (!style()->bottom().isAuto()
+ else if (!style().bottom().isAuto()
&& (!containingBlock->hasAutoHeightOrContainingBlockWithAutoHeight()
- || !style()->bottom().isPercent()
+ || !style().bottom().isPercent()
|| containingBlock->stretchesToViewport()))
- offset.expand(0, -valueForLength(style()->bottom(), containingBlock->availableHeight()));
+ offset.expand(0, -valueForLength(style().bottom(), containingBlock->availableHeight()));
return offset;
}
@@ -359,10 +359,10 @@
// Sticky positioned element ignore any override logical width on the containing block (as they don't call
// containingBlockLogicalWidthForContent). It's unclear whether this is totally fine.
- LayoutBoxExtent minMargin(minimumValueForLength(style()->marginTop(), maxWidth),
- minimumValueForLength(style()->marginRight(), maxWidth),
- minimumValueForLength(style()->marginBottom(), maxWidth),
- minimumValueForLength(style()->marginLeft(), maxWidth));
+ LayoutBoxExtent minMargin(minimumValueForLength(style().marginTop(), maxWidth),
+ minimumValueForLength(style().marginRight(), maxWidth),
+ minimumValueForLength(style().marginBottom(), maxWidth),
+ minimumValueForLength(style().marginLeft(), maxWidth));
// Compute the container-relative area within which the sticky element is allowed to move.
containerContentRect.contract(minMargin);
@@ -398,23 +398,23 @@
stickyBoxRelativeToScrollingAnecstor.setLocation(stickyLocationRelativeToScrollingAncestor);
constraints.setStickyBoxRect(stickyBoxRelativeToScrollingAnecstor);
- if (!style()->left().isAuto()) {
- constraints.setLeftOffset(valueForLength(style()->left(), constrainingRect.width()));
+ if (!style().left().isAuto()) {
+ constraints.setLeftOffset(valueForLength(style().left(), constrainingRect.width()));
constraints.addAnchorEdge(ViewportConstraints::AnchorEdgeLeft);
}
- if (!style()->right().isAuto()) {
- constraints.setRightOffset(valueForLength(style()->right(), constrainingRect.width()));
+ if (!style().right().isAuto()) {
+ constraints.setRightOffset(valueForLength(style().right(), constrainingRect.width()));
constraints.addAnchorEdge(ViewportConstraints::AnchorEdgeRight);
}
- if (!style()->top().isAuto()) {
- constraints.setTopOffset(valueForLength(style()->top(), constrainingRect.height()));
+ if (!style().top().isAuto()) {
+ constraints.setTopOffset(valueForLength(style().top(), constrainingRect.height()));
constraints.addAnchorEdge(ViewportConstraints::AnchorEdgeTop);
}
- if (!style()->bottom().isAuto()) {
- constraints.setBottomOffset(valueForLength(style()->bottom(), constrainingRect.height()));
+ if (!style().bottom().isAuto()) {
+ constraints.setBottomOffset(valueForLength(style().bottom(), constrainingRect.height()));
constraints.addAnchorEdge(ViewportConstraints::AnchorEdgeBottom);
}
}
@@ -492,9 +492,9 @@
RoundedRect RenderBoxModelObject::getBackgroundRoundedRect(const LayoutRect& borderRect, InlineFlowBox* box, LayoutUnit inlineBoxWidth, LayoutUnit inlineBoxHeight,
bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const
{
- RoundedRect border = style()->getRoundedBorderFor(borderRect, &view(), includeLogicalLeftEdge, includeLogicalRightEdge);
+ RoundedRect border = style().getRoundedBorderFor(borderRect, &view(), includeLogicalLeftEdge, includeLogicalRightEdge);
if (box && (box->nextLineBox() || box->prevLineBox())) {
- RoundedRect segmentBorder = style()->getRoundedBorderFor(LayoutRect(0, 0, inlineBoxWidth, inlineBoxHeight), &view(), includeLogicalLeftEdge, includeLogicalRightEdge);
+ RoundedRect segmentBorder = style().getRoundedBorderFor(LayoutRect(0, 0, inlineBoxWidth, inlineBoxHeight), &view(), includeLogicalLeftEdge, includeLogicalRightEdge);
border.setRadii(segmentBorder.radii());
}
@@ -555,7 +555,7 @@
return getBackgroundRoundedRect(shrinkRectByOnePixel(context, borderRect), box, boxSize.width(), boxSize.height(), includeLogicalLeftEdge, includeLogicalRightEdge);
}
if (bleedAvoidance == BackgroundBleedBackgroundOverBorder)
- return style()->getRoundedInnerBorderFor(borderRect, includeLogicalLeftEdge, includeLogicalRightEdge);
+ return style().getRoundedInnerBorderFor(borderRect, includeLogicalLeftEdge, includeLogicalRightEdge);
return getBackgroundRoundedRect(borderRect, box, boxSize.width(), boxSize.height(), includeLogicalLeftEdge, includeLogicalRightEdge);
}
@@ -583,18 +583,18 @@
bool includeLeftEdge = box ? box->includeLogicalLeftEdge() : true;
bool includeRightEdge = box ? box->includeLogicalRightEdge() : true;
- bool hasRoundedBorder = style()->hasBorderRadius() && (includeLeftEdge || includeRightEdge);
+ bool hasRoundedBorder = style().hasBorderRadius() && (includeLeftEdge || includeRightEdge);
bool clippedWithLocalScrolling = hasOverflowClip() && bgLayer->attachment() == LocalBackgroundAttachment;
bool isBorderFill = bgLayer->clip() == BorderFillBox;
bool isRoot = this->isRoot();
Color bgColor = color;
StyleImage* bgImage = bgLayer->image();
- bool shouldPaintBackgroundImage = bgImage && bgImage->canRender(this, style()->effectiveZoom());
+ bool shouldPaintBackgroundImage = bgImage && bgImage->canRender(this, style().effectiveZoom());
bool forceBackgroundToWhite = false;
if (document().printing()) {
- if (style()->printColorAdjust() == PrintColorAdjustEconomy)
+ if (style().printColorAdjust() == PrintColorAdjustEconomy)
forceBackgroundToWhite = true;
if (frame().settings().shouldPrintBackgrounds())
forceBackgroundToWhite = false;
@@ -626,20 +626,20 @@
bool boxShadowShouldBeAppliedToBackground = this->boxShadowShouldBeAppliedToBackground(bleedAvoidance, box);
GraphicsContextStateSaver shadowStateSaver(*context, boxShadowShouldBeAppliedToBackground);
if (boxShadowShouldBeAppliedToBackground)
- applyBoxShadowForBackground(context, style());
+ applyBoxShadowForBackground(context, &style());
if (hasRoundedBorder && bleedAvoidance != BackgroundBleedUseTransparencyLayer) {
RoundedRect border = backgroundRoundedRectAdjustedForBleedAvoidance(context, rect, bleedAvoidance, box, boxSize, includeLeftEdge, includeRightEdge);
if (border.isRenderable())
- context->fillRoundedRect(border, bgColor, style()->colorSpace());
+ context->fillRoundedRect(border, bgColor, style().colorSpace());
else {
context->save();
clipRoundedInnerRect(context, rect, border);
- context->fillRect(border.rect(), bgColor, style()->colorSpace());
+ context->fillRect(border.rect(), bgColor, style().colorSpace());
context->restore();
}
} else
- context->fillRect(pixelSnappedIntRect(rect), bgColor, style()->colorSpace());
+ context->fillRect(pixelSnappedIntRect(rect), bgColor, style().colorSpace());
return;
}
@@ -652,10 +652,10 @@
// Clip to the padding or content boxes as necessary.
if (bgLayer->clip() == ContentFillBox) {
- border = style()->getRoundedInnerBorderFor(border.rect(),
+ border = style().getRoundedInnerBorderFor(border.rect(),
paddingTop() + borderTop(), paddingBottom() + borderBottom(), paddingLeft() + borderLeft(), paddingRight() + borderRight(), includeLeftEdge, includeRightEdge);
} else if (bgLayer->clip() == PaddingFillBox)
- border = style()->getRoundedInnerBorderFor(border.rect(), includeLeftEdge, includeRightEdge);
+ border = style().getRoundedInnerBorderFor(border.rect(), includeLeftEdge, includeRightEdge);
clipRoundedInnerRect(context, rect, border);
}
@@ -778,16 +778,16 @@
GraphicsContextStateSaver shadowStateSaver(*context, boxShadowShouldBeAppliedToBackground);
if (boxShadowShouldBeAppliedToBackground)
- applyBoxShadowForBackground(context, style());
+ applyBoxShadowForBackground(context, &style());
if (baseColor.alpha()) {
if (bgColor.alpha())
baseColor = baseColor.blend(bgColor);
- context->fillRect(backgroundRect, baseColor, style()->colorSpace(), CompositeCopy);
+ context->fillRect(backgroundRect, baseColor, style().colorSpace(), CompositeCopy);
} else if (bgColor.alpha()) {
CompositeOperator operation = shouldClearBackground ? CompositeCopy : context->compositeOperation();
- context->fillRect(backgroundRect, bgColor, style()->colorSpace(), operation);
+ context->fillRect(backgroundRect, bgColor, style().colorSpace(), operation);
} else if (shouldClearBackground)
context->clearRect(backgroundRect);
}
@@ -806,7 +806,7 @@
bool useLowQualityScaling = shouldPaintAtLowQuality(context, image.get(), bgLayer, geometry.tileSize());
if (image.get())
image->setSpaceSize(geometry.spaceSize());
- context->drawTiledImage(image.get(), style()->colorSpace(), geometry.destRect(), geometry.relativePhase(), geometry.tileSize(),
+ context->drawTiledImage(image.get(), style().colorSpace(), geometry.destRect(), geometry.relativePhase(), geometry.tileSize(),
compositeOp, useLowQualityScaling, bgLayer->blendMode());
}
}
@@ -891,7 +891,7 @@
IntSize resolvedSize(intrinsicWidth.isFixed() ? intrinsicWidth.value() : 0, intrinsicHeight.isFixed() ? intrinsicHeight.value() : 0);
IntSize minimumSize(resolvedSize.width() > 0 ? 1 : 0, resolvedSize.height() > 0 ? 1 : 0);
if (shouldScaleOrNot == ScaleByEffectiveZoom)
- resolvedSize.scale(style()->effectiveZoom());
+ resolvedSize.scale(style().effectiveZoom());
resolvedSize.clampToMinimumSize(minimumSize);
if (!resolvedSize.isEmpty())
@@ -1118,7 +1118,7 @@
auto clientForBackgroundImage = backgroundObject ? backgroundObject : this;
IntSize fillTileSize = calculateFillTileSize(fillLayer, positioningAreaSize);
- fillLayer->image()->setContainerSizeForRenderer(clientForBackgroundImage, fillTileSize, style()->effectiveZoom());
+ fillLayer->image()->setContainerSizeForRenderer(clientForBackgroundImage, fillTileSize, style().effectiveZoom());
geometry.setTileSize(fillTileSize);
EFillRepeat backgroundRepeatX = fillLayer->repeatX();
@@ -1205,7 +1205,7 @@
void RenderBoxModelObject::getGeometryForBackgroundImage(const RenderLayerModelObject* paintContainer, IntRect& destRect, IntPoint& phase, IntSize& tileSize) const
{
- const FillLayer* backgroundLayer = style()->backgroundLayers();
+ const FillLayer* backgroundLayer = style().backgroundLayers();
BackgroundImageGeometry geometry;
calculateBackgroundImageGeometry(paintContainer, backgroundLayer, destRect, geometry);
phase = geometry.phase();
@@ -2381,7 +2381,7 @@
bool RenderBoxModelObject::borderObscuresBackgroundEdge(const FloatSize& contextScale) const
{
BorderEdge edges[4];
- getBorderEdgeInfo(edges, style());
+ getBorderEdgeInfo(edges, &style());
for (int i = BSTop; i <= BSLeft; ++i) {
const BorderEdge& currEdge = edges[i];
@@ -2396,15 +2396,15 @@
bool RenderBoxModelObject::borderObscuresBackground() const
{
- if (!style()->hasBorder())
+ if (!style().hasBorder())
return false;
// Bail if we have any border-image for now. We could look at the image alpha to improve this.
- if (style()->borderImage().image())
+ if (style().borderImage().image())
return false;
BorderEdge edges[4];
- getBorderEdgeInfo(edges, style());
+ getBorderEdgeInfo(edges, &style());
for (int i = BSTop; i <= BSLeft; ++i) {
const BorderEdge& currEdge = edges[i];
@@ -2420,11 +2420,11 @@
if (bleedAvoidance != BackgroundBleedNone)
return false;
- if (style()->hasAppearance())
+ if (style().hasAppearance())
return false;
bool hasOneNormalBoxShadow = false;
- for (const ShadowData* currentShadow = style()->boxShadow(); currentShadow; currentShadow = currentShadow->next()) {
+ for (const ShadowData* currentShadow = style().boxShadow(); currentShadow; currentShadow = currentShadow->next()) {
if (currentShadow->style() != Normal)
continue;
@@ -2439,18 +2439,18 @@
if (!hasOneNormalBoxShadow)
return false;
- Color backgroundColor = style()->visitedDependentColor(CSSPropertyBackgroundColor);
+ Color backgroundColor = style().visitedDependentColor(CSSPropertyBackgroundColor);
if (!backgroundColor.isValid() || backgroundColor.hasAlpha())
return false;
- const FillLayer* lastBackgroundLayer = style()->backgroundLayers();
+ const FillLayer* lastBackgroundLayer = style().backgroundLayers();
for (const FillLayer* next = lastBackgroundLayer->next(); next; next = lastBackgroundLayer->next())
lastBackgroundLayer = next;
if (lastBackgroundLayer->clip() != BorderFillBox)
return false;
- if (lastBackgroundLayer->image() && style()->hasBorderRadius())
+ if (lastBackgroundLayer->image() && style().hasBorderRadius())
return false;
if (inlineFlowBox && !inlineFlowBox->boxShadowCanBeAppliedToBackground(*lastBackgroundLayer))
@@ -2677,14 +2677,14 @@
// However, as soon as some content is entered, the line boxes will be
// constructed and this kludge is not called any more. So only the caret size
// of an empty :first-line'd block is wrong. I think we can live with that.
- RenderStyle* currentStyle = firstLineStyle();
- LayoutUnit height = lineHeight(true, currentStyle->isHorizontalWritingMode() ? HorizontalLine : VerticalLine);
+ const RenderStyle& currentStyle = firstLineStyle();
+ LayoutUnit height = lineHeight(true, currentStyle.isHorizontalWritingMode() ? HorizontalLine : VerticalLine);
enum CaretAlignment { alignLeft, alignRight, alignCenter };
CaretAlignment alignment = alignLeft;
- switch (currentStyle->textAlign()) {
+ switch (currentStyle.textAlign()) {
case LEFT:
case WEBKIT_LEFT:
break;
@@ -2698,11 +2698,11 @@
break;
case JUSTIFY:
case TASTART:
- if (!currentStyle->isLeftToRightDirection())
+ if (!currentStyle.isLeftToRightDirection())
alignment = alignRight;
break;
case TAEND:
- if (currentStyle->isLeftToRightDirection())
+ if (currentStyle.isLeftToRightDirection())
alignment = alignRight;
break;
}
@@ -2712,19 +2712,19 @@
switch (alignment) {
case alignLeft:
- if (currentStyle->isLeftToRightDirection())
+ if (currentStyle.isLeftToRightDirection())
x += textIndentOffset;
break;
case alignCenter:
x = (x + maxX) / 2;
- if (currentStyle->isLeftToRightDirection())
+ if (currentStyle.isLeftToRightDirection())
x += textIndentOffset / 2;
else
x -= textIndentOffset / 2;
break;
case alignRight:
x = maxX - caretWidth;
- if (!currentStyle->isLeftToRightDirection())
+ if (!currentStyle.isLeftToRightDirection())
x -= textIndentOffset;
break;
}
@@ -2732,7 +2732,7 @@
LayoutUnit y = paddingTop() + borderTop();
- return currentStyle->isHorizontalWritingMode() ? LayoutRect(x, y, caretWidth, height) : LayoutRect(y, x, height, caretWidth);
+ return currentStyle.isHorizontalWritingMode() ? LayoutRect(x, y, caretWidth, height) : LayoutRect(y, x, height, caretWidth);
}
bool RenderBoxModelObject::shouldAntialiasLines(GraphicsContext* context)
@@ -2764,14 +2764,14 @@
LayoutSize containerOffset = offsetFromContainer(o, LayoutPoint());
- if (!style()->hasOutOfFlowPosition() && o->hasColumns()) {
+ if (!style().hasOutOfFlowPosition() && o->hasColumns()) {
RenderBlock* block = toRenderBlock(o);
LayoutPoint point(roundedLayoutPoint(transformState.mappedPoint()));
point -= containerOffset;
block->adjustForColumnRect(containerOffset, point);
}
- bool preserve3D = mode & UseTransforms && (o->style()->preserves3D() || style()->preserves3D());
+ bool preserve3D = mode & UseTransforms && (o->style().preserves3D() || style().preserves3D());
if (mode & UseTransforms && shouldUseTransformFromContainer(o)) {
TransformationMatrix t;
getTransformFromContainer(o, containerOffset, t);
diff --git a/Source/WebCore/rendering/RenderBoxModelObject.h b/Source/WebCore/rendering/RenderBoxModelObject.h
index 9f87085..9905ed6 100644
--- a/Source/WebCore/rendering/RenderBoxModelObject.h
+++ b/Source/WebCore/rendering/RenderBoxModelObject.h
@@ -64,11 +64,11 @@
virtual ~RenderBoxModelObject();
LayoutSize relativePositionOffset() const;
- LayoutSize relativePositionLogicalOffset() const { return style()->isHorizontalWritingMode() ? relativePositionOffset() : relativePositionOffset().transposedSize(); }
+ LayoutSize relativePositionLogicalOffset() const { return style().isHorizontalWritingMode() ? relativePositionOffset() : relativePositionOffset().transposedSize(); }
void computeStickyPositionConstraints(StickyPositionViewportConstraints&, const FloatRect& viewportRect) const;
LayoutSize stickyPositionOffset() const;
- LayoutSize stickyPositionLogicalOffset() const { return style()->isHorizontalWritingMode() ? stickyPositionOffset() : stickyPositionOffset().transposedSize(); }
+ LayoutSize stickyPositionLogicalOffset() const { return style().isHorizontalWritingMode() ? stickyPositionOffset() : stickyPositionOffset().transposedSize(); }
LayoutSize offsetForInFlowPosition() const;
@@ -86,20 +86,20 @@
virtual void updateFromStyle() OVERRIDE;
- virtual bool requiresLayer() const OVERRIDE { return isRoot() || isPositioned() || createsGroup() || hasClipPath() || hasTransform() || hasHiddenBackface() || hasReflection() || style()->specifiesColumns(); }
+ virtual bool requiresLayer() const OVERRIDE { return isRoot() || isPositioned() || createsGroup() || hasClipPath() || hasTransform() || hasHiddenBackface() || hasReflection() || style().specifiesColumns(); }
// This will work on inlines to return the bounding box of all of the lines' border boxes.
virtual IntRect borderBoundingBox() const = 0;
// These return the CSS computed padding values.
- LayoutUnit computedCSSPaddingTop() const { return computedCSSPadding(style()->paddingTop()); }
- LayoutUnit computedCSSPaddingBottom() const { return computedCSSPadding(style()->paddingBottom()); }
- LayoutUnit computedCSSPaddingLeft() const { return computedCSSPadding(style()->paddingLeft()); }
- LayoutUnit computedCSSPaddingRight() const { return computedCSSPadding(style()->paddingRight()); }
- LayoutUnit computedCSSPaddingBefore() const { return computedCSSPadding(style()->paddingBefore()); }
- LayoutUnit computedCSSPaddingAfter() const { return computedCSSPadding(style()->paddingAfter()); }
- LayoutUnit computedCSSPaddingStart() const { return computedCSSPadding(style()->paddingStart()); }
- LayoutUnit computedCSSPaddingEnd() const { return computedCSSPadding(style()->paddingEnd()); }
+ LayoutUnit computedCSSPaddingTop() const { return computedCSSPadding(style().paddingTop()); }
+ LayoutUnit computedCSSPaddingBottom() const { return computedCSSPadding(style().paddingBottom()); }
+ LayoutUnit computedCSSPaddingLeft() const { return computedCSSPadding(style().paddingLeft()); }
+ LayoutUnit computedCSSPaddingRight() const { return computedCSSPadding(style().paddingRight()); }
+ LayoutUnit computedCSSPaddingBefore() const { return computedCSSPadding(style().paddingBefore()); }
+ LayoutUnit computedCSSPaddingAfter() const { return computedCSSPadding(style().paddingAfter()); }
+ LayoutUnit computedCSSPaddingStart() const { return computedCSSPadding(style().paddingStart()); }
+ LayoutUnit computedCSSPaddingEnd() const { return computedCSSPadding(style().paddingEnd()); }
// These functions are used during layout. Table cells and the MathML
// code override them to include some extra intrinsic padding.
@@ -112,14 +112,14 @@
virtual LayoutUnit paddingStart() const { return computedCSSPaddingStart(); }
virtual LayoutUnit paddingEnd() const { return computedCSSPaddingEnd(); }
- virtual int borderTop() const { return style()->borderTopWidth(); }
- virtual int borderBottom() const { return style()->borderBottomWidth(); }
- virtual int borderLeft() const { return style()->borderLeftWidth(); }
- virtual int borderRight() const { return style()->borderRightWidth(); }
- virtual int borderBefore() const { return style()->borderBeforeWidth(); }
- virtual int borderAfter() const { return style()->borderAfterWidth(); }
- virtual int borderStart() const { return style()->borderStartWidth(); }
- virtual int borderEnd() const { return style()->borderEndWidth(); }
+ virtual int borderTop() const { return style().borderTopWidth(); }
+ virtual int borderBottom() const { return style().borderBottomWidth(); }
+ virtual int borderLeft() const { return style().borderLeftWidth(); }
+ virtual int borderRight() const { return style().borderRightWidth(); }
+ virtual int borderBefore() const { return style().borderBeforeWidth(); }
+ virtual int borderAfter() const { return style().borderAfterWidth(); }
+ virtual int borderStart() const { return style().borderStartWidth(); }
+ virtual int borderEnd() const { return style().borderEndWidth(); }
LayoutUnit borderAndPaddingStart() const { return borderStart() + paddingStart(); }
LayoutUnit borderAndPaddingBefore() const { return borderBefore() + paddingBefore(); }
@@ -129,13 +129,13 @@
LayoutUnit borderAndPaddingWidth() const { return borderLeft() + borderRight() + paddingLeft() + paddingRight(); }
LayoutUnit borderAndPaddingLogicalHeight() const { return borderAndPaddingBefore() + borderAndPaddingAfter(); }
LayoutUnit borderAndPaddingLogicalWidth() const { return borderStart() + borderEnd() + paddingStart() + paddingEnd(); }
- LayoutUnit borderAndPaddingLogicalLeft() const { return style()->isHorizontalWritingMode() ? borderLeft() + paddingLeft() : borderTop() + paddingTop(); }
+ LayoutUnit borderAndPaddingLogicalLeft() const { return style().isHorizontalWritingMode() ? borderLeft() + paddingLeft() : borderTop() + paddingTop(); }
- LayoutUnit borderLogicalLeft() const { return style()->isHorizontalWritingMode() ? borderLeft() : borderTop(); }
- LayoutUnit borderLogicalRight() const { return style()->isHorizontalWritingMode() ? borderRight() : borderBottom(); }
+ LayoutUnit borderLogicalLeft() const { return style().isHorizontalWritingMode() ? borderLeft() : borderTop(); }
+ LayoutUnit borderLogicalRight() const { return style().isHorizontalWritingMode() ? borderRight() : borderBottom(); }
- LayoutUnit paddingLogicalLeft() const { return style()->isHorizontalWritingMode() ? paddingLeft() : paddingTop(); }
- LayoutUnit paddingLogicalRight() const { return style()->isHorizontalWritingMode() ? paddingRight() : paddingBottom(); }
+ LayoutUnit paddingLogicalLeft() const { return style().isHorizontalWritingMode() ? paddingLeft() : paddingTop(); }
+ LayoutUnit paddingLogicalRight() const { return style().isHorizontalWritingMode() ? paddingRight() : paddingBottom(); }
virtual LayoutUnit marginTop() const = 0;
virtual LayoutUnit marginBottom() const = 0;
diff --git a/Source/WebCore/rendering/RenderButton.cpp b/Source/WebCore/rendering/RenderButton.cpp
index 6834ac7..5722f1c 100644
--- a/Source/WebCore/rendering/RenderButton.cpp
+++ b/Source/WebCore/rendering/RenderButton.cpp
@@ -65,8 +65,8 @@
if (!m_inner) {
// Create an anonymous block.
ASSERT(!firstChild());
- m_inner = createAnonymousBlock(style()->display());
- setupInnerStyle(m_inner->style());
+ m_inner = createAnonymousBlock(style().display());
+ setupInnerStyle(&m_inner->style());
RenderFlexibleBox::addChild(m_inner);
}
@@ -94,9 +94,9 @@
// it right below. Here we change it back to 0 to avoid getting a spurious layout hint
// because of the difference. Same goes for the other properties.
// FIXME: Make this hack unnecessary.
- m_inner->style()->setFlexGrow(newStyle.initialFlexGrow());
- m_inner->style()->setMarginTop(newStyle.initialMargin());
- m_inner->style()->setMarginBottom(newStyle.initialMargin());
+ m_inner->style().setFlexGrow(newStyle.initialFlexGrow());
+ m_inner->style().setMarginTop(newStyle.initialMargin());
+ m_inner->style().setMarginBottom(newStyle.initialMargin());
}
RenderBlock::styleWillChange(diff, newStyle);
}
@@ -106,7 +106,7 @@
RenderBlock::styleDidChange(diff, oldStyle);
if (m_inner) // RenderBlock handled updating the anonymous block's style.
- setupInnerStyle(m_inner->style());
+ setupInnerStyle(&m_inner->style());
if (!m_default && theme()->isDefault(this)) {
if (!m_timer)
@@ -131,7 +131,7 @@
// when the content overflows, treat it the same as align-items: flex-start.
innerStyle->setMarginTop(Length());
innerStyle->setMarginBottom(Length());
- innerStyle->setFlexDirection(style()->flexDirection());
+ innerStyle->setFlexDirection(style().flexDirection());
}
void RenderButton::updateFromElement()
diff --git a/Source/WebCore/rendering/RenderCombineText.cpp b/Source/WebCore/rendering/RenderCombineText.cpp
index f82494a..7b577b2 100644
--- a/Source/WebCore/rendering/RenderCombineText.cpp
+++ b/Source/WebCore/rendering/RenderCombineText.cpp
@@ -39,7 +39,7 @@
void RenderCombineText::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
{
// FIXME: This is pretty hackish.
- m_combineFontStyle = RenderStyle::clone(style());
+ m_combineFontStyle = RenderStyle::clone(&style());
RenderText::styleDidChange(diff, oldStyle);
@@ -72,7 +72,7 @@
void RenderCombineText::adjustTextOrigin(FloatPoint& textOrigin, const FloatRect& boxRect) const
{
if (m_isCombined)
- textOrigin.move(boxRect.height() / 2 - ceilf(m_combinedTextWidth) / 2, style()->font().pixelSize());
+ textOrigin.move(boxRect.height() / 2 - ceilf(m_combinedTextWidth) / 2, style().font().pixelSize());
}
void RenderCombineText::getStringToRender(int start, String& string, int& length) const
@@ -97,10 +97,10 @@
m_needsFontUpdate = false;
// CSS3 spec says text-combine works only in vertical writing mode.
- if (style()->isHorizontalWritingMode())
+ if (style().isHorizontalWritingMode())
return;
- TextRun run = RenderBlock::constructTextRun(this, originalFont(), this, *style());
+ TextRun run = RenderBlock::constructTextRun(this, originalFont(), this, style());
FontDescription description = originalFont().fontDescription();
float emWidth = description.computedSize() * textCombineMargin;
bool shouldUpdateFont = false;
@@ -109,7 +109,7 @@
m_combinedTextWidth = originalFont().width(run);
m_isCombined = m_combinedTextWidth <= emWidth;
- FontSelector* fontSelector = style()->font().fontSelector();
+ FontSelector* fontSelector = style().font().fontSelector();
if (m_isCombined)
shouldUpdateFont = m_combineFontStyle->setFontDescription(description); // Need to change font orientation to horizontal.
@@ -118,7 +118,7 @@
static const FontWidthVariant widthVariants[] = { HalfWidth, ThirdWidth, QuarterWidth };
for (size_t i = 0 ; i < WTF_ARRAY_LENGTH(widthVariants) ; ++i) {
description.setWidthVariant(widthVariants[i]);
- Font compressedFont = Font(description, style()->font().letterSpacing(), style()->font().wordSpacing());
+ Font compressedFont = Font(description, style().font().letterSpacing(), style().font().wordSpacing());
compressedFont.update(fontSelector);
float runWidth = compressedFont.width(run);
if (runWidth <= emWidth) {
diff --git a/Source/WebCore/rendering/RenderCombineText.h b/Source/WebCore/rendering/RenderCombineText.h
index 444bd7a..acb621b 100644
--- a/Source/WebCore/rendering/RenderCombineText.h
+++ b/Source/WebCore/rendering/RenderCombineText.h
@@ -39,7 +39,7 @@
void getStringToRender(int, String& string, int& length) const;
bool isCombined() const { return m_isCombined; }
float combinedTextWidth(const Font& font) const { return font.size(); }
- const Font& originalFont() const { return parent()->style()->font(); }
+ const Font& originalFont() const { return parent()->style().font(); }
const Font& textCombineFont() const { return m_combineFontStyle->font(); }
private:
diff --git a/Source/WebCore/rendering/RenderCounter.cpp b/Source/WebCore/rendering/RenderCounter.cpp
index 5b38a33..c04431d3 100644
--- a/Source/WebCore/rendering/RenderCounter.cpp
+++ b/Source/WebCore/rendering/RenderCounter.cpp
@@ -111,10 +111,9 @@
if (!generatingElement)
return false;
- RenderStyle* style = object->style();
- ASSERT(style);
+ const RenderStyle& style = object->style();
- switch (style->styleType()) {
+ switch (style.styleType()) {
case NOPSEUDO:
// Sometimes elements have more then one renderer. Only the first one gets the counter
// LayoutTests/http/tests/css/counter-crash.html
@@ -128,7 +127,7 @@
return false; // Counters are forbidden from all other pseudo elements.
}
- const CounterDirectives directives = style->getCounterDirectives(identifier);
+ const CounterDirectives directives = style.getCounterDirectives(identifier);
if (directives.isDefined()) {
value = directives.combinedValue();
isReset = directives.isReset();
@@ -395,7 +394,7 @@
return String();
if (!beforeAfterContainer->isAnonymous() && !beforeAfterContainer->isPseudoElement())
return String(); // RenderCounters are restricted to before and after pseudo elements
- PseudoId containerStyle = beforeAfterContainer->style()->styleType();
+ PseudoId containerStyle = beforeAfterContainer->style().styleType();
if ((containerStyle == BEFORE) || (containerStyle == AFTER))
break;
beforeAfterContainer = beforeAfterContainer->parent();
@@ -519,8 +518,7 @@
static void updateCounters(RenderObject* renderer)
{
- ASSERT(renderer->style());
- const CounterDirectiveMap* directiveMap = renderer->style()->counterDirectives();
+ const CounterDirectiveMap* directiveMap = renderer->style().counterDirectives();
if (!directiveMap)
return;
CounterDirectiveMap::const_iterator end = directiveMap->end();
diff --git a/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp b/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp
index a25cb01..60881979 100644
--- a/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp
+++ b/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp
@@ -43,16 +43,16 @@
: m_box(parent)
, m_largestOrdinal(1)
{
- if (m_box->style()->boxOrient() == HORIZONTAL && !m_box->style()->isLeftToRightDirection())
- m_forward = m_box->style()->boxDirection() != BNORMAL;
+ if (m_box->style().boxOrient() == HORIZONTAL && !m_box->style().isLeftToRightDirection())
+ m_forward = m_box->style().boxDirection() != BNORMAL;
else
- m_forward = m_box->style()->boxDirection() == BNORMAL;
+ m_forward = m_box->style().boxDirection() == BNORMAL;
if (!m_forward) {
// No choice, since we're going backwards, we have to find out the highest ordinal up front.
RenderBox* child = m_box->firstChildBox();
while (child) {
- if (child->style()->boxOrdinalGroup() > m_largestOrdinal)
- m_largestOrdinal = child->style()->boxOrdinalGroup();
+ if (child->style().boxOrdinalGroup() > m_largestOrdinal)
+ m_largestOrdinal = child->style().boxOrdinalGroup();
child = child->nextSiblingBox();
}
}
@@ -97,9 +97,9 @@
m_currentChild = m_forward ? m_currentChild->nextSiblingBox() : m_currentChild->previousSiblingBox();
if (m_currentChild && notFirstOrdinalValue())
- m_ordinalValues.add(m_currentChild->style()->boxOrdinalGroup());
+ m_ordinalValues.add(m_currentChild->style().boxOrdinalGroup());
} while (!m_currentChild || (!m_currentChild->isAnonymous()
- && m_currentChild->style()->boxOrdinalGroup() != m_currentOrdinal));
+ && m_currentChild->style().boxOrdinalGroup() != m_currentOrdinal));
return m_currentChild;
}
@@ -107,7 +107,7 @@
bool notFirstOrdinalValue()
{
unsigned int firstOrdinalValue = m_forward ? 1 : m_largestOrdinal;
- return m_currentOrdinal == firstOrdinalValue && m_currentChild->style()->boxOrdinalGroup() != firstOrdinalValue;
+ return m_currentOrdinal == firstOrdinalValue && m_currentChild->style().boxOrdinalGroup() != firstOrdinalValue;
}
RenderDeprecatedFlexibleBox* m_box;
@@ -138,8 +138,8 @@
// A margin basically has three types: fixed, percentage, and auto (variable).
// Auto and percentage margins simply become 0 when computing min/max width.
// Fixed margins can be added in as is.
- Length marginLeft = child->style()->marginLeft();
- Length marginRight = child->style()->marginRight();
+ Length marginLeft = child->style().marginLeft();
+ Length marginRight = child->style().marginRight();
LayoutUnit margin = 0;
if (marginLeft.isFixed())
margin += marginLeft.value();
@@ -151,7 +151,7 @@
static bool childDoesNotAffectWidthOrFlexing(RenderObject* child)
{
// Positioned children and collapsed children don't affect the min/max width.
- return child->isOutOfFlowPositioned() || child->style()->visibility() == COLLAPSE;
+ return child->isOutOfFlowPositioned() || child->style().visibility() == COLLAPSE;
}
static LayoutUnit contentWidthForChild(RenderBox* child)
@@ -170,7 +170,7 @@
void RenderDeprecatedFlexibleBox::styleWillChange(StyleDifference diff, const RenderStyle& newStyle)
{
- RenderStyle* oldStyle = hasInitializedStyle() ? style() : nullptr;
+ RenderStyle* oldStyle = hasInitializedStyle() ? &style() : nullptr;
if (oldStyle && !oldStyle->lineClamp().isNone() && newStyle.lineClamp().isNone())
clearLineClamp();
@@ -214,19 +214,19 @@
ASSERT(preferredLogicalWidthsDirty());
m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = 0;
- if (style()->width().isFixed() && style()->width().value() > 0)
- m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(style()->width().value());
+ if (style().width().isFixed() && style().width().value() > 0)
+ m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(style().width().value());
else
computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth, m_maxPreferredLogicalWidth);
- if (style()->minWidth().isFixed() && style()->minWidth().value() > 0) {
- m_maxPreferredLogicalWidth = max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style()->minWidth().value()));
- m_minPreferredLogicalWidth = max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style()->minWidth().value()));
+ if (style().minWidth().isFixed() && style().minWidth().value() > 0) {
+ m_maxPreferredLogicalWidth = max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth().value()));
+ m_minPreferredLogicalWidth = max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth().value()));
}
- if (style()->maxWidth().isFixed()) {
- m_maxPreferredLogicalWidth = min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style()->maxWidth().value()));
- m_minPreferredLogicalWidth = min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style()->maxWidth().value()));
+ if (style().maxWidth().isFixed()) {
+ m_maxPreferredLogicalWidth = min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth().value()));
+ m_minPreferredLogicalWidth = min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth().value()));
}
LayoutUnit borderAndPadding = borderAndPaddingLogicalWidth();
@@ -285,7 +285,7 @@
return;
LayoutRepainter repainter(*this, checkForRepaintDuringLayout());
- LayoutStateMaintainer statePusher(&view(), this, locationOffset(), hasTransform() || hasReflection() || style()->isFlippedBlocksWritingMode());
+ LayoutStateMaintainer statePusher(&view(), this, locationOffset(), hasTransform() || hasReflection() || style().isFlippedBlocksWritingMode());
prepareShapesAndPaginationBeforeBlockLayout(relayoutChildren);
@@ -295,8 +295,8 @@
updateLogicalHeight();
if (previousSize != size()
- || (parent()->isDeprecatedFlexibleBox() && parent()->style()->boxOrient() == HORIZONTAL
- && parent()->style()->boxAlign() == BSTRETCH))
+ || (parent()->isDeprecatedFlexibleBox() && parent()->style().boxOrient() == HORIZONTAL
+ && parent()->style().boxAlign() == BSTRETCH))
relayoutChildren = true;
setHeight(0);
@@ -354,14 +354,14 @@
{
for (RenderBox* child = iterator.first(); child; child = iterator.next()) {
// Check to see if this child flexes.
- if (!childDoesNotAffectWidthOrFlexing(child) && child->style()->boxFlex() > 0.0f) {
+ if (!childDoesNotAffectWidthOrFlexing(child) && child->style().boxFlex() > 0.0f) {
// We always have to lay out flexible objects again, since the flex distribution
// may have changed, and we need to reallocate space.
child->clearOverrideSize();
if (!relayoutChildren)
child->setChildNeedsLayout(MarkOnlyThis);
haveFlex = true;
- unsigned int flexGroup = child->style()->boxFlexGroup();
+ unsigned flexGroup = child->style().boxFlexGroup();
if (lowestFlexGroup == 0)
lowestFlexGroup = flexGroup;
if (flexGroup < lowestFlexGroup)
@@ -440,7 +440,7 @@
layoutChildIfNeededApplyingDelta(child, childLayoutDelta);
// Update our height and overflow height.
- if (style()->boxAlign() == BBASELINE) {
+ if (style().boxAlign() == BBASELINE) {
LayoutUnit ascent = child->firstLineBaseline();
if (ascent == -1)
ascent = child->height() + child->marginBottom();
@@ -462,7 +462,7 @@
ASSERT(childIndex == childLayoutDeltas.size());
if (!iterator.first() && hasLineIfEmpty())
- setHeight(height() + lineHeight(true, style()->isHorizontalWritingMode() ? HorizontalLine : VerticalLine, PositionOfInteriorLineBoxes));
+ setHeight(height() + lineHeight(true, style().isHorizontalWritingMode() ? HorizontalLine : VerticalLine, PositionOfInteriorLineBoxes));
setHeight(height() + toAdd);
@@ -475,7 +475,7 @@
// Now that our height is actually known, we can place our boxes.
childIndex = 0;
- m_stretchingChildren = (style()->boxAlign() == BSTRETCH);
+ m_stretchingChildren = (style().boxAlign() == BSTRETCH);
for (RenderBox* child = iterator.first(); child; child = iterator.next()) {
if (child->isOutOfFlowPositioned()) {
child->containingBlock()->insertPositionedObject(*child);
@@ -483,7 +483,7 @@
childLayer->setStaticInlinePosition(xPos); // FIXME: Not right for regions.
if (childLayer->staticBlockPosition() != yPos) {
childLayer->setStaticBlockPosition(yPos);
- if (child->style()->hasStaticBlockPosition(style()->isHorizontalWritingMode()))
+ if (child->style().hasStaticBlockPosition(style().isHorizontalWritingMode()))
child->setChildNeedsLayout(MarkOnlyThis);
}
continue;
@@ -491,7 +491,7 @@
LayoutSize& childLayoutDelta = childLayoutDeltas[childIndex++];
- if (child->style()->visibility() == COLLAPSE) {
+ if (child->style().visibility() == COLLAPSE) {
// visibility: collapsed children do not participate in our positioning.
// But we need to lay them out.
layoutChildIfNeededApplyingDelta(child, childLayoutDelta);
@@ -514,7 +514,7 @@
// We can place the child now, using our value of box-align.
xPos += child->marginLeft();
LayoutUnit childY = yPos;
- switch (style()->boxAlign()) {
+ switch (style().boxAlign()) {
case BCENTER:
childY += child->marginTop() + max<LayoutUnit>(0, (contentHeight() - (child->height() + child->marginHeight())) / 2);
break;
@@ -568,13 +568,13 @@
float totalFlex = 0.0f;
for (RenderBox* child = iterator.first(); child; child = iterator.next()) {
if (allowedChildFlex(child, expanding, i))
- totalFlex += child->style()->boxFlex();
+ totalFlex += child->style().boxFlex();
}
LayoutUnit spaceAvailableThisPass = groupRemainingSpace;
for (RenderBox* child = iterator.first(); child; child = iterator.next()) {
LayoutUnit allowedFlex = allowedChildFlex(child, expanding, i);
if (allowedFlex) {
- LayoutUnit projectedFlex = (allowedFlex == LayoutUnit::max()) ? allowedFlex : LayoutUnit(allowedFlex * (totalFlex / child->style()->boxFlex()));
+ LayoutUnit projectedFlex = (allowedFlex == LayoutUnit::max()) ? allowedFlex : LayoutUnit(allowedFlex * (totalFlex / child->style().boxFlex()));
spaceAvailableThisPass = expanding ? min(spaceAvailableThisPass, projectedFlex) : max(spaceAvailableThisPass, projectedFlex);
}
}
@@ -588,11 +588,11 @@
// Now distribute the space to objects.
for (RenderBox* child = iterator.first(); child && spaceAvailableThisPass && totalFlex; child = iterator.next()) {
- if (child->style()->visibility() == COLLAPSE)
+ if (child->style().visibility() == COLLAPSE)
continue;
if (allowedChildFlex(child, expanding, i)) {
- LayoutUnit spaceAdd = LayoutUnit(spaceAvailableThisPass * (child->style()->boxFlex() / totalFlex));
+ LayoutUnit spaceAdd = LayoutUnit(spaceAvailableThisPass * (child->style().boxFlex() / totalFlex));
if (spaceAdd) {
child->setOverrideLogicalContentWidth(contentWidthForChild(child) + spaceAdd);
flexingChildren = true;
@@ -603,7 +603,7 @@
remainingSpace -= spaceAdd;
groupRemainingSpace -= spaceAdd;
- totalFlex -= child->style()->boxFlex();
+ totalFlex -= child->style().boxFlex();
}
}
if (groupRemainingSpace == groupRemainingSpaceAtBeginning) {
@@ -630,11 +630,11 @@
RenderBlock::finishDelayUpdateScrollInfo();
- if (remainingSpace > 0 && ((style()->isLeftToRightDirection() && style()->boxPack() != Start)
- || (!style()->isLeftToRightDirection() && style()->boxPack() != End))) {
+ if (remainingSpace > 0 && ((style().isLeftToRightDirection() && style().boxPack() != Start)
+ || (!style().isLeftToRightDirection() && style().boxPack() != End))) {
// Children must be repositioned.
LayoutUnit offset = 0;
- if (style()->boxPack() == Justify) {
+ if (style().boxPack() == Justify) {
// Determine the total number of children.
int totalChildren = 0;
for (RenderBox* child = iterator.first(); child; child = iterator.next()) {
@@ -665,7 +665,7 @@
}
}
} else {
- if (style()->boxPack() == Center)
+ if (style().boxPack() == Center)
offset += remainingSpace / 2;
else // END for LTR, START for RTL
offset += remainingSpace;
@@ -701,7 +701,7 @@
// We confine the line clamp ugliness to vertical flexible boxes (thus keeping it out of
// mainstream block layout); this is not really part of the XUL box model.
- bool haveLineClamp = !style()->lineClamp().isNone();
+ bool haveLineClamp = !style().lineClamp().isNone();
if (haveLineClamp)
applyLineClamp(iterator, relayoutChildren);
@@ -730,7 +730,7 @@
childLayer->setStaticInlinePosition(borderStart() + paddingStart()); // FIXME: Not right for regions.
if (childLayer->staticBlockPosition() != height()) {
childLayer->setStaticBlockPosition(height());
- if (child->style()->hasStaticBlockPosition(style()->isHorizontalWritingMode()))
+ if (child->style().hasStaticBlockPosition(style().isHorizontalWritingMode()))
child->setChildNeedsLayout(MarkOnlyThis);
}
continue;
@@ -738,7 +738,7 @@
LayoutSize& childLayoutDelta = childLayoutDeltas[childIndex++];
- if (child->style()->visibility() == COLLAPSE) {
+ if (child->style().visibility() == COLLAPSE) {
// visibility: collapsed children do not participate in our positioning.
// But we need to lay them down.
layoutChildIfNeededApplyingDelta(child, childLayoutDelta);
@@ -759,19 +759,19 @@
// We can place the child now, using our value of box-align.
LayoutUnit childX = borderLeft() + paddingLeft();
- switch (style()->boxAlign()) {
+ switch (style().boxAlign()) {
case BCENTER:
case BBASELINE: // Baseline just maps to center for vertical boxes
childX += child->marginLeft() + max<LayoutUnit>(0, (contentWidth() - (child->width() + child->marginWidth())) / 2);
break;
case BEND:
- if (!style()->isLeftToRightDirection())
+ if (!style().isLeftToRightDirection())
childX += child->marginLeft();
else
childX += contentWidth() - child->marginRight() - child->width();
break;
default: // BSTART/BSTRETCH
- if (style()->isLeftToRightDirection())
+ if (style().isLeftToRightDirection())
childX += child->marginLeft();
else
childX += contentWidth() - child->marginRight() - child->width();
@@ -787,7 +787,7 @@
yPos = height();
if (!iterator.first() && hasLineIfEmpty())
- setHeight(height() + lineHeight(true, style()->isHorizontalWritingMode() ? HorizontalLine : VerticalLine, PositionOfInteriorLineBoxes));
+ setHeight(height() + lineHeight(true, style().isHorizontalWritingMode() ? HorizontalLine : VerticalLine, PositionOfInteriorLineBoxes));
setHeight(height() + toAdd);
@@ -829,13 +829,13 @@
float totalFlex = 0.0f;
for (RenderBox* child = iterator.first(); child; child = iterator.next()) {
if (allowedChildFlex(child, expanding, i))
- totalFlex += child->style()->boxFlex();
+ totalFlex += child->style().boxFlex();
}
LayoutUnit spaceAvailableThisPass = groupRemainingSpace;
for (RenderBox* child = iterator.first(); child; child = iterator.next()) {
LayoutUnit allowedFlex = allowedChildFlex(child, expanding, i);
if (allowedFlex) {
- LayoutUnit projectedFlex = (allowedFlex == LayoutUnit::max()) ? allowedFlex : static_cast<LayoutUnit>(allowedFlex * (totalFlex / child->style()->boxFlex()));
+ LayoutUnit projectedFlex = (allowedFlex == LayoutUnit::max()) ? allowedFlex : static_cast<LayoutUnit>(allowedFlex * (totalFlex / child->style().boxFlex()));
spaceAvailableThisPass = expanding ? min(spaceAvailableThisPass, projectedFlex) : max(spaceAvailableThisPass, projectedFlex);
}
}
@@ -850,7 +850,7 @@
// Now distribute the space to objects.
for (RenderBox* child = iterator.first(); child && spaceAvailableThisPass && totalFlex; child = iterator.next()) {
if (allowedChildFlex(child, expanding, i)) {
- LayoutUnit spaceAdd = static_cast<LayoutUnit>(spaceAvailableThisPass * (child->style()->boxFlex() / totalFlex));
+ LayoutUnit spaceAdd = static_cast<LayoutUnit>(spaceAvailableThisPass * (child->style().boxFlex() / totalFlex));
if (spaceAdd) {
child->setOverrideLogicalContentHeight(contentHeightForChild(child) + spaceAdd);
flexingChildren = true;
@@ -861,7 +861,7 @@
remainingSpace -= spaceAdd;
groupRemainingSpace -= spaceAdd;
- totalFlex -= child->style()->boxFlex();
+ totalFlex -= child->style().boxFlex();
}
}
if (groupRemainingSpace == groupRemainingSpaceAtBeginning) {
@@ -888,10 +888,10 @@
RenderBlock::finishDelayUpdateScrollInfo();
- if (style()->boxPack() != Start && remainingSpace > 0) {
+ if (style().boxPack() != Start && remainingSpace > 0) {
// Children must be repositioned.
LayoutUnit offset = 0;
- if (style()->boxPack() == Justify) {
+ if (style().boxPack() == Justify) {
// Determine the total number of children.
int totalChildren = 0;
for (RenderBox* child = iterator.first(); child; child = iterator.next()) {
@@ -922,7 +922,7 @@
}
}
} else {
- if (style()->boxPack() == Center)
+ if (style().boxPack() == Center)
offset += remainingSpace / 2;
else // END
offset += remainingSpace;
@@ -948,8 +948,8 @@
continue;
child->clearOverrideSize();
- if (relayoutChildren || (child->isReplaced() && (child->style()->width().isPercent() || child->style()->height().isPercent()))
- || (child->style()->height().isAuto() && child->isRenderBlockFlow())) {
+ if (relayoutChildren || (child->isReplaced() && (child->style().width().isPercent() || child->style().height().isPercent()))
+ || (child->style().height().isAuto() && child->isRenderBlockFlow())) {
child->setChildNeedsLayout(MarkOnlyThis);
// Dirty all the positioned objects.
@@ -959,19 +959,19 @@
}
}
child->layoutIfNeeded();
- if (child->style()->height().isAuto() && child->isRenderBlockFlow())
+ if (child->style().height().isAuto() && child->isRenderBlockFlow())
maxLineCount = max(maxLineCount, toRenderBlockFlow(child)->lineCount());
}
// Get the number of lines and then alter all block flow children with auto height to use the
// specified height. We always try to leave room for at least one line.
- LineClampValue lineClamp = style()->lineClamp();
+ LineClampValue lineClamp = style().lineClamp();
int numVisibleLines = lineClamp.isPercentage() ? max(1, (maxLineCount + 1) * lineClamp.value() / 100) : lineClamp.value();
if (numVisibleLines >= maxLineCount)
return;
for (RenderBox* child = iterator.first(); child; child = iterator.next()) {
- if (childDoesNotAffectWidthOrFlexing(child) || !child->style()->height().isAuto() || !child->isRenderBlockFlow())
+ if (childDoesNotAffectWidthOrFlexing(child) || !child->style().height().isAuto() || !child->isRenderBlockFlow())
continue;
RenderBlockFlow* blockChild = toRenderBlockFlow(child);
@@ -988,7 +988,7 @@
child->layoutIfNeeded();
// FIXME: For now don't support RTL.
- if (style()->direction() != LTR)
+ if (style().direction() != LTR)
continue;
// Get the last line
@@ -1003,17 +1003,17 @@
const UChar ellipsisAndSpace[2] = { horizontalEllipsis, ' ' };
DEFINE_STATIC_LOCAL(AtomicString, ellipsisAndSpaceStr, (ellipsisAndSpace, 2));
DEFINE_STATIC_LOCAL(AtomicString, ellipsisStr, (&horizontalEllipsis, 1));
- const RenderStyle& lineStyle = numVisibleLines == 1 ? *firstLineStyle() : *style();
+ const RenderStyle& lineStyle = numVisibleLines == 1 ? firstLineStyle() : style();
const Font& font = lineStyle.font();
// Get ellipsis width, and if the last child is an anchor, it will go after the ellipsis, so add in a space and the anchor width too
LayoutUnit totalWidth;
InlineBox* anchorBox = lastLine->lastChild();
- if (anchorBox && anchorBox->renderer().style()->isLink())
- totalWidth = anchorBox->logicalWidth() + font.width(constructTextRun(this, font, ellipsisAndSpace, 2, *style()));
+ if (anchorBox && anchorBox->renderer().style().isLink())
+ totalWidth = anchorBox->logicalWidth() + font.width(constructTextRun(this, font, ellipsisAndSpace, 2, style()));
else {
anchorBox = 0;
- totalWidth = font.width(constructTextRun(this, font, &horizontalEllipsis, 1, *style()));
+ totalWidth = font.width(constructTextRun(this, font, &horizontalEllipsis, 1, style()));
}
// See if this width can be accommodated on the last visible line
@@ -1021,10 +1021,10 @@
RenderBlockFlow& srcBlock = lastLine->blockFlow();
// FIXME: Directions of src/destBlock could be different from our direction and from one another.
- if (!srcBlock.style()->isLeftToRightDirection())
+ if (!srcBlock.style().isLeftToRightDirection())
continue;
- bool leftToRight = destBlock.style()->isLeftToRightDirection();
+ bool leftToRight = destBlock.style().isLeftToRightDirection();
if (!leftToRight)
continue;
@@ -1048,8 +1048,8 @@
continue;
child->clearOverrideSize();
- if ((child->isReplaced() && (child->style()->width().isPercent() || child->style()->height().isPercent()))
- || (child->style()->height().isAuto() && child->isRenderBlock())) {
+ if ((child->isReplaced() && (child->style().width().isPercent() || child->style().height().isPercent()))
+ || (child->style().height().isAuto() && child->isRenderBlock())) {
child->setChildNeedsLayout();
if (child->isRenderBlockFlow()) {
@@ -1070,7 +1070,7 @@
LayoutUnit RenderDeprecatedFlexibleBox::allowedChildFlex(RenderBox* child, bool expanding, unsigned int group)
{
- if (childDoesNotAffectWidthOrFlexing(child) || child->style()->boxFlex() == 0.0f || child->style()->boxFlexGroup() != group)
+ if (childDoesNotAffectWidthOrFlexing(child) || child->style().boxFlex() == 0.0f || child->style().boxFlexGroup() != group)
return 0;
if (expanding) {
@@ -1078,11 +1078,11 @@
// FIXME: For now just handle fixed values.
LayoutUnit maxWidth = LayoutUnit::max();
LayoutUnit width = contentWidthForChild(child);
- if (!child->style()->maxWidth().isUndefined() && child->style()->maxWidth().isFixed())
- maxWidth = child->style()->maxWidth().value();
- else if (child->style()->maxWidth().type() == Intrinsic)
+ if (!child->style().maxWidth().isUndefined() && child->style().maxWidth().isFixed())
+ maxWidth = child->style().maxWidth().value();
+ else if (child->style().maxWidth().type() == Intrinsic)
maxWidth = child->maxPreferredLogicalWidth();
- else if (child->style()->maxWidth().type() == MinIntrinsic)
+ else if (child->style().maxWidth().type() == MinIntrinsic)
maxWidth = child->minPreferredLogicalWidth();
if (maxWidth == LayoutUnit::max())
return maxWidth;
@@ -1091,8 +1091,8 @@
// FIXME: For now just handle fixed values.
LayoutUnit maxHeight = LayoutUnit::max();
LayoutUnit height = contentHeightForChild(child);
- if (!child->style()->maxHeight().isUndefined() && child->style()->maxHeight().isFixed())
- maxHeight = child->style()->maxHeight().value();
+ if (!child->style().maxHeight().isUndefined() && child->style().maxHeight().isFixed())
+ maxHeight = child->style().maxHeight().value();
if (maxHeight == LayoutUnit::max())
return maxHeight;
return max<LayoutUnit>(0, maxHeight - height);
@@ -1103,21 +1103,21 @@
if (isHorizontal()) {
LayoutUnit minWidth = child->minPreferredLogicalWidth();
LayoutUnit width = contentWidthForChild(child);
- if (child->style()->minWidth().isFixed())
- minWidth = child->style()->minWidth().value();
- else if (child->style()->minWidth().type() == Intrinsic)
+ if (child->style().minWidth().isFixed())
+ minWidth = child->style().minWidth().value();
+ else if (child->style().minWidth().type() == Intrinsic)
minWidth = child->maxPreferredLogicalWidth();
- else if (child->style()->minWidth().type() == MinIntrinsic)
+ else if (child->style().minWidth().type() == MinIntrinsic)
minWidth = child->minPreferredLogicalWidth();
- else if (child->style()->minWidth().type() == Auto)
+ else if (child->style().minWidth().type() == Auto)
minWidth = 0;
LayoutUnit allowedShrinkage = min<LayoutUnit>(0, minWidth - width);
return allowedShrinkage;
} else {
- Length minHeight = child->style()->minHeight();
+ Length minHeight = child->style().minHeight();
if (minHeight.isFixed() || minHeight.isAuto()) {
- LayoutUnit minHeight = child->style()->minHeight().value();
+ LayoutUnit minHeight = child->style().minHeight().value();
LayoutUnit height = contentHeightForChild(child);
LayoutUnit allowedShrinkage = min<LayoutUnit>(0, minHeight - height);
return allowedShrinkage;
diff --git a/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.h b/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.h
index b87c19f..ac42242 100644
--- a/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.h
+++ b/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.h
@@ -57,9 +57,9 @@
LayoutUnit allowedChildFlex(RenderBox* child, bool expanding, unsigned group);
- bool hasMultipleLines() const { return style()->boxLines() == MULTIPLE; }
- bool isVertical() const { return style()->boxOrient() == VERTICAL; }
- bool isHorizontal() const { return style()->boxOrient() == HORIZONTAL; }
+ bool hasMultipleLines() const { return style().boxLines() == MULTIPLE; }
+ bool isVertical() const { return style().boxOrient() == VERTICAL; }
+ bool isHorizontal() const { return style().boxOrient() == HORIZONTAL; }
void applyLineClamp(FlexBoxIterator&, bool relayoutChildren);
void clearLineClamp();
diff --git a/Source/WebCore/rendering/RenderDetailsMarker.cpp b/Source/WebCore/rendering/RenderDetailsMarker.cpp
index 468ee54..455d797 100644
--- a/Source/WebCore/rendering/RenderDetailsMarker.cpp
+++ b/Source/WebCore/rendering/RenderDetailsMarker.cpp
@@ -72,21 +72,21 @@
RenderDetailsMarker::Orientation RenderDetailsMarker::orientation() const
{
- switch (style()->writingMode()) {
+ switch (style().writingMode()) {
case TopToBottomWritingMode:
- if (style()->isLeftToRightDirection())
+ if (style().isLeftToRightDirection())
return isOpen() ? Down : Right;
return isOpen() ? Down : Left;
case RightToLeftWritingMode:
- if (style()->isLeftToRightDirection())
+ if (style().isLeftToRightDirection())
return isOpen() ? Left : Down;
return isOpen() ? Left : Up;
case LeftToRightWritingMode:
- if (style()->isLeftToRightDirection())
+ if (style().isLeftToRightDirection())
return isOpen() ? Right : Down;
return isOpen() ? Right : Up;
case BottomToTopWritingMode:
- if (style()->isLeftToRightDirection())
+ if (style().isLeftToRightDirection())
return isOpen() ? Up : Right;
return isOpen() ? Up : Left;
}
@@ -115,7 +115,7 @@
void RenderDetailsMarker::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
- if (paintInfo.phase != PaintPhaseForeground || style()->visibility() != VISIBLE) {
+ if (paintInfo.phase != PaintPhaseForeground || style().visibility() != VISIBLE) {
RenderBlockFlow::paint(paintInfo, paintOffset);
return;
}
@@ -128,11 +128,11 @@
if (!paintInfo.rect.intersects(pixelSnappedIntRect(overflowRect)))
return;
- const Color color(style()->visitedDependentColor(CSSPropertyColor));
- paintInfo.context->setStrokeColor(color, style()->colorSpace());
+ const Color color(style().visitedDependentColor(CSSPropertyColor));
+ paintInfo.context->setStrokeColor(color, style().colorSpace());
paintInfo.context->setStrokeStyle(SolidStroke);
paintInfo.context->setStrokeThickness(1.0f);
- paintInfo.context->setFillColor(color, style()->colorSpace());
+ paintInfo.context->setFillColor(color, style().colorSpace());
boxOrigin.move(borderLeft() + paddingLeft(), borderTop() + paddingTop());
paintInfo.context->fillPath(getPath(boxOrigin));
diff --git a/Source/WebCore/rendering/RenderElement.cpp b/Source/WebCore/rendering/RenderElement.cpp
index 6da8210..b55dba9 100644
--- a/Source/WebCore/rendering/RenderElement.cpp
+++ b/Source/WebCore/rendering/RenderElement.cpp
@@ -197,7 +197,7 @@
static PassRefPtr<RenderStyle> firstLineStyleForCachedUncachedType(StyleCacheState type, const RenderElement& renderer, RenderStyle* style)
{
- const RenderElement& rendererForFirstLineStyle = renderer.isBeforeOrAfterContent() ? *renderer.parent() : renderer;
+ RenderElement& rendererForFirstLineStyle = renderer.isBeforeOrAfterContent() ? *renderer.parent() : const_cast<RenderElement&>(renderer);
if (rendererForFirstLineStyle.isRenderBlockFlow() || rendererForFirstLineStyle.isRenderButton()) {
if (RenderBlock* firstLineBlock = rendererForFirstLineStyle.firstLineBlock()) {
@@ -206,14 +206,14 @@
return firstLineBlock->getUncachedPseudoStyle(PseudoStyleRequest(FIRST_LINE), style, firstLineBlock == &renderer ? style : nullptr);
}
} else if (!rendererForFirstLineStyle.isAnonymous() && rendererForFirstLineStyle.isRenderInline()) {
- RenderStyle* parentStyle = rendererForFirstLineStyle.parent()->firstLineStyle();
- if (parentStyle != rendererForFirstLineStyle.parent()->style()) {
+ RenderStyle& parentStyle = rendererForFirstLineStyle.parent()->firstLineStyle();
+ if (&parentStyle != &rendererForFirstLineStyle.parent()->style()) {
if (type == Cached) {
// A first-line style is in effect. Cache a first-line style for ourselves.
- rendererForFirstLineStyle.style()->setHasPseudoStyle(FIRST_LINE_INHERITED);
- return rendererForFirstLineStyle.getCachedPseudoStyle(FIRST_LINE_INHERITED, parentStyle);
+ rendererForFirstLineStyle.style().setHasPseudoStyle(FIRST_LINE_INHERITED);
+ return rendererForFirstLineStyle.getCachedPseudoStyle(FIRST_LINE_INHERITED, &parentStyle);
}
- return rendererForFirstLineStyle.getUncachedPseudoStyle(PseudoStyleRequest(FIRST_LINE_INHERITED), parentStyle, style);
+ return rendererForFirstLineStyle.getUncachedPseudoStyle(PseudoStyleRequest(FIRST_LINE_INHERITED), &parentStyle, style);
}
}
return nullptr;
@@ -231,11 +231,11 @@
{
ASSERT(document().styleSheetCollection().usesFirstLineRules());
- RenderStyle* style = this->style();
- if (RefPtr<RenderStyle> firstLineStyle = firstLineStyleForCachedUncachedType(Cached, *this, style))
+ RenderStyle& style = this->style();
+ if (RefPtr<RenderStyle> firstLineStyle = firstLineStyleForCachedUncachedType(Cached, *this, &style))
return firstLineStyle.get();
- return style;
+ return &style;
}
StyleDifference RenderElement::adjustStyleDifference(StyleDifference diff, unsigned contextSensitiveProperties) const
@@ -281,7 +281,7 @@
// The answer to requiresLayer() for plugins, iframes, and canvas can change without the actual
// style changing, since it depends on whether we decide to composite these elements. When the
// layer status of one of these elements changes, we need to force a layout.
- if (diff == StyleDifferenceEqual && style() && isRenderLayerModelObject()) {
+ if (diff == StyleDifferenceEqual && isRenderLayerModelObject()) {
if (hasLayer() != toRenderLayerModelObject(this)->requiresLayer())
diff = StyleDifferenceLayout;
}
@@ -301,7 +301,7 @@
for (const RenderObject* renderer = firstChild(); renderer; renderer = renderer->nextSibling()) {
if (renderer->isText() && !toRenderText(renderer)->isAllCollapsibleWhitespace())
return true;
- if (renderer->style()->hasOutline() || renderer->style()->hasBorder())
+ if (renderer->style().hasOutline() || renderer->style().hasBorder())
return true;
}
return false;
@@ -358,7 +358,7 @@
}
#endif
- styleWillChange(StyleDifferenceEqual, *style());
+ styleWillChange(StyleDifferenceEqual, style());
m_hasInitializedStyle = true;
@@ -531,7 +531,7 @@
void RenderElement::destroyLeftoverChildren()
{
while (m_firstChild) {
- if (m_firstChild->isListMarker() || (m_firstChild->style()->styleType() == FIRST_LETTER && !m_firstChild->isText()))
+ if (m_firstChild->isListMarker() || (m_firstChild->style().styleType() == FIRST_LETTER && !m_firstChild->isText()))
m_firstChild->removeFromParent(); // List markers are owned by their enclosing list and so don't get destroyed by this container. Similarly, first letters are destroyed by their remaining text fragment.
else if (m_firstChild->isRunIn() && m_firstChild->node()) {
m_firstChild->node()->setRenderer(0);
@@ -783,7 +783,7 @@
if (child->isText())
continue;
RenderElement& elementChild = toRenderElement(*child);
- if (!elementChild.isAnonymous() || elementChild.style()->styleType() != NOPSEUDO)
+ if (!elementChild.isAnonymous() || elementChild.style().styleType() != NOPSEUDO)
continue;
if (propagationType == PropagateToBlockChildrenOnly && !elementChild.isRenderBlock())
@@ -798,18 +798,18 @@
if (elementChild.isRenderFlowThread())
continue;
- auto newStyle = RenderStyle::createAnonymousStyleWithDisplay(style(), elementChild.style()->display());
- if (style()->specifiesColumns()) {
- if (elementChild.style()->specifiesColumns())
- newStyle.get().inheritColumnPropertiesFrom(style());
- if (elementChild.style()->columnSpan())
+ auto newStyle = RenderStyle::createAnonymousStyleWithDisplay(&style(), elementChild.style().display());
+ if (style().specifiesColumns()) {
+ if (elementChild.style().specifiesColumns())
+ newStyle.get().inheritColumnPropertiesFrom(&style());
+ if (elementChild.style().columnSpan())
newStyle.get().setColumnSpan(ColumnSpanAll);
}
// Preserve the position style of anonymous block continuations as they can have relative or sticky position when
// they contain block descendants of relative or sticky positioned inlines.
if (elementChild.isInFlowPositioned() && toRenderBlock(elementChild).isAnonymousBlockContinuation())
- newStyle.get().setPosition(elementChild.style()->position());
+ newStyle.get().setPosition(elementChild.style().position());
elementChild.setStyle(std::move(newStyle));
}
@@ -835,7 +835,7 @@
void RenderElement::styleWillChange(StyleDifference diff, const RenderStyle& newStyle)
{
- RenderStyle* oldStyle = hasInitializedStyle() ? style() : nullptr;
+ RenderStyle* oldStyle = hasInitializedStyle() ? &style() : nullptr;
if (oldStyle) {
// If our z-index changes value or our visibility changes,
// we need to dirty our stacking context's z-order list.
@@ -856,7 +856,7 @@
if (RenderLayer* layer = enclosingLayer()) {
if (newStyle.visibility() == VISIBLE)
layer->setHasVisibleContent();
- else if (layer->hasVisibleContent() && (this == &layer->renderer() || layer->renderer().style()->visibility() != VISIBLE)) {
+ else if (layer->hasVisibleContent() && (this == &layer->renderer() || layer->renderer().style().visibility() != VISIBLE)) {
layer->dirtyVisibleContentStatus();
if (diff > StyleDifferenceRepaintLayer)
repaint();
@@ -972,7 +972,7 @@
// Don't check for repaint here; we need to wait until the layer has been
// updated by subclasses before we know if we have to repaint (in setStyle()).
- if (oldStyle && !areCursorsEqual(oldStyle, style()))
+ if (oldStyle && !areCursorsEqual(oldStyle, &style()))
frame().eventHandler().scheduleCursorUpdate();
}
@@ -990,7 +990,7 @@
// If |this| is visible but this object was not, tell the layer it has some visible content
// that needs to be drawn and layer visibility optimization can't be used
- if (parent()->style()->visibility() != VISIBLE && style()->visibility() == VISIBLE && !hasLayer()) {
+ if (parent()->style().visibility() != VISIBLE && style().visibility() == VISIBLE && !hasLayer()) {
if (!layer)
layer = parent()->enclosingLayer();
if (layer)
@@ -1002,7 +1002,7 @@
{
// If we remove a visible child from an invisible parent, we don't know the layer visibility any more.
RenderLayer* layer = nullptr;
- if (parent()->style()->visibility() != VISIBLE && style()->visibility() == VISIBLE && !hasLayer()) {
+ if (parent()->style().visibility() != VISIBLE && style().visibility() == VISIBLE && !hasLayer()) {
if ((layer = parent()->enclosingLayer()))
layer->dirtyVisibleContentStatus();
}
@@ -1040,7 +1040,7 @@
setNeedsPositionedMovementLayoutBit(true);
markContainingBlocksForLayout();
if (hasLayer()) {
- if (oldStyle && style()->diffRequiresRepaint(oldStyle))
+ if (oldStyle && style().diffRequiresRepaint(oldStyle))
setLayerNeedsFullRepaint();
else
setLayerNeedsFullRepaintForPositionedMovementLayout();
diff --git a/Source/WebCore/rendering/RenderElement.h b/Source/WebCore/rendering/RenderElement.h
index c979114..8fe0092 100644
--- a/Source/WebCore/rendering/RenderElement.h
+++ b/Source/WebCore/rendering/RenderElement.h
@@ -35,8 +35,8 @@
bool hasInitializedStyle() const { return m_hasInitializedStyle; }
- RenderStyle* style() const { return const_cast<RenderStyle*>(&m_style.get()); }
- RenderStyle* firstLineStyle() const;
+ RenderStyle& style() const { return const_cast<RenderStyle&>(m_style.get()); }
+ RenderStyle& firstLineStyle() const;
void initializeStyle();
@@ -178,9 +178,9 @@
static bool s_noLongerAffectsParentBlock;
};
-inline RenderStyle* RenderElement::firstLineStyle() const
+inline RenderStyle& RenderElement::firstLineStyle() const
{
- return document().styleSheetCollection().usesFirstLineRules() ? cachedFirstLineStyle() : style();
+ return document().styleSheetCollection().usesFirstLineRules() ? *cachedFirstLineStyle() : style();
}
inline void RenderElement::setAncestorLineBoxDirty(bool f)
@@ -279,14 +279,14 @@
return isRenderElement() && toRenderElement(this)->isRenderInline();
}
-inline RenderStyle* RenderObject::style() const
+inline RenderStyle& RenderObject::style() const
{
if (isText())
return m_parent->style();
return toRenderElement(this)->style();
}
-inline RenderStyle* RenderObject::firstLineStyle() const
+inline RenderStyle& RenderObject::firstLineStyle() const
{
if (isText())
return m_parent->firstLineStyle();
diff --git a/Source/WebCore/rendering/RenderEmbeddedObject.cpp b/Source/WebCore/rendering/RenderEmbeddedObject.cpp
index 83c3315..3af1c4b 100644
--- a/Source/WebCore/rendering/RenderEmbeddedObject.cpp
+++ b/Source/WebCore/rendering/RenderEmbeddedObject.cpp
@@ -208,9 +208,9 @@
bool useLowQualityScaling = shouldPaintAtLowQuality(context, image, image, alignedRect.size());
ImageOrientationDescription orientationDescription(shouldRespectImageOrientation());
#if ENABLE(CSS_IMAGE_ORIENTATION)
- orientationDescription.setImageOrientationEnum(style()->imageOrientation());
+ orientationDescription.setImageOrientationEnum(style().imageOrientation());
#endif
- context->drawImage(image, style()->colorSpace(), alignedRect, CompositeSourceOver, orientationDescription, useLowQualityScaling);
+ context->drawImage(image, style().colorSpace(), alignedRect, CompositeSourceOver, orientationDescription, useLowQualityScaling);
}
void RenderEmbeddedObject::paintContents(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
@@ -301,7 +301,7 @@
GraphicsContextStateSaver stateSaver(*context);
context->clip(contentRect);
- context->setFillColor(m_unavailablePluginIndicatorIsPressed ? replacementTextRoundedRectPressedColor() : replacementTextRoundedRectColor(), style()->colorSpace());
+ context->setFillColor(m_unavailablePluginIndicatorIsPressed ? replacementTextRoundedRectPressedColor() : replacementTextRoundedRectColor(), style().colorSpace());
context->fillPath(background);
Path strokePath;
@@ -309,21 +309,21 @@
strokeRect.inflate(1);
strokePath.addRoundedRect(strokeRect, FloatSize(replacementTextRoundedRectRadius + 1, replacementTextRoundedRectRadius + 1));
- context->setStrokeColor(unavailablePluginBorderColor(), style()->colorSpace());
+ context->setStrokeColor(unavailablePluginBorderColor(), style().colorSpace());
context->setStrokeThickness(2);
context->strokePath(strokePath);
const FontMetrics& fontMetrics = font.fontMetrics();
float labelX = roundf(replacementTextRect.location().x() + replacementTextRoundedRectLeftTextMargin);
float labelY = roundf(replacementTextRect.location().y() + (replacementTextRect.size().height() - fontMetrics.height()) / 2 + fontMetrics.ascent() + replacementTextRoundedRectTopTextMargin);
- context->setFillColor(replacementTextColor(), style()->colorSpace());
+ context->setFillColor(replacementTextColor(), style().colorSpace());
context->drawBidiText(font, run, FloatPoint(labelX, labelY));
if (shouldUnavailablePluginMessageBeButton(document(), m_pluginUnavailabilityReason)) {
arrowRect.inflate(-replacementArrowCirclePadding);
context->beginTransparencyLayer(1.0);
- context->setFillColor(replacementTextColor(), style()->colorSpace());
+ context->setFillColor(replacementTextColor(), style().colorSpace());
context->fillEllipse(arrowRect);
context->setCompositeOperation(CompositeClear);
@@ -397,7 +397,7 @@
// Check the opacity of each layer containing the element or its ancestors.
float opacity = 1.0;
for (RenderLayer* layer = enclosingLayer(); layer; layer = layer->parent()) {
- opacity *= layer->renderer().style()->opacity();
+ opacity *= layer->renderer().style().opacity();
if (opacity < 0.1)
return true;
}
@@ -514,11 +514,11 @@
// When calling layout() on a child node, a parent must either push a LayoutStateMaintainter, or
// instantiate LayoutStateDisabler. Since using a LayoutStateMaintainer is slightly more efficient,
// and this method will be called many times per second during playback, use a LayoutStateMaintainer:
- LayoutStateMaintainer statePusher(&view(), this, locationOffset(), hasTransform() || hasReflection() || style()->isFlippedBlocksWritingMode());
+ LayoutStateMaintainer statePusher(&view(), this, locationOffset(), hasTransform() || hasReflection() || style().isFlippedBlocksWritingMode());
childBox->setLocation(LayoutPoint(borderLeft(), borderTop()) + LayoutSize(paddingLeft(), paddingTop()));
- childBox->style()->setHeight(Length(newSize.height(), Fixed));
- childBox->style()->setWidth(Length(newSize.width(), Fixed));
+ childBox->style().setHeight(Length(newSize.height(), Fixed));
+ childBox->style().setWidth(Length(newSize.width(), Fixed));
childBox->setNeedsLayout(MarkOnlyThis);
childBox->layout();
clearChildNeedsLayout();
diff --git a/Source/WebCore/rendering/RenderFieldset.cpp b/Source/WebCore/rendering/RenderFieldset.cpp
index 10f2b65..a844e43 100644
--- a/Source/WebCore/rendering/RenderFieldset.cpp
+++ b/Source/WebCore/rendering/RenderFieldset.cpp
@@ -45,8 +45,8 @@
if (RenderBox* legend = findLegend()) {
int legendMinWidth = legend->minPreferredLogicalWidth();
- Length legendMarginLeft = legend->style()->marginLeft();
- Length legendMarginRight = legend->style()->marginLeft();
+ Length legendMarginLeft = legend->style().marginLeft();
+ Length legendMarginRight = legend->style().marginLeft();
if (legendMarginLeft.isFixed())
legendMinWidth += legendMarginLeft.value();
@@ -70,8 +70,8 @@
legend.layoutIfNeeded();
LayoutUnit logicalLeft;
- if (style()->isLeftToRightDirection()) {
- switch (legend.style()->textAlign()) {
+ if (style().isLeftToRightDirection()) {
+ switch (legend.style().textAlign()) {
case CENTER:
logicalLeft = (logicalWidth() - logicalWidthForChild(legend)) / 2;
break;
@@ -83,7 +83,7 @@
break;
}
} else {
- switch (legend.style()->textAlign()) {
+ switch (legend.style().textAlign()) {
case LEFT:
logicalLeft = borderStart() + paddingStart();
break;
@@ -149,7 +149,7 @@
// FIXME: We need to work with "rl" and "bt" block flow directions. In those
// cases the legend is embedded in the right and bottom borders respectively.
// https://bugs.webkit.org/show_bug.cgi?id=47236
- if (style()->isHorizontalWritingMode()) {
+ if (style().isHorizontalWritingMode()) {
LayoutUnit yOff = (legend->y() > 0) ? LayoutUnit() : (legend->height() - borderTop()) / 2;
paintRect.setHeight(paintRect.height() - yOff);
paintRect.setY(paintRect.y() + yOff);
@@ -160,11 +160,11 @@
}
if (!boxShadowShouldBeAppliedToBackground(determineBackgroundBleedAvoidance(paintInfo.context)))
- paintBoxShadow(paintInfo, paintRect, style(), Normal);
- paintFillLayers(paintInfo, style()->visitedDependentColor(CSSPropertyBackgroundColor), style()->backgroundLayers(), paintRect);
- paintBoxShadow(paintInfo, paintRect, style(), Inset);
+ paintBoxShadow(paintInfo, paintRect, &style(), Normal);
+ paintFillLayers(paintInfo, style().visitedDependentColor(CSSPropertyBackgroundColor), style().backgroundLayers(), paintRect);
+ paintBoxShadow(paintInfo, paintRect, &style(), Inset);
- if (!style()->hasBorder())
+ if (!style().hasBorder())
return;
// Create a clipping region around the legend and paint the border as normal
@@ -174,22 +174,22 @@
// FIXME: We need to work with "rl" and "bt" block flow directions. In those
// cases the legend is embedded in the right and bottom borders respectively.
// https://bugs.webkit.org/show_bug.cgi?id=47236
- if (style()->isHorizontalWritingMode()) {
+ if (style().isHorizontalWritingMode()) {
LayoutUnit clipTop = paintRect.y();
- LayoutUnit clipHeight = std::max(static_cast<LayoutUnit>(style()->borderTopWidth()), legend->height() - ((legend->height() - borderTop()) / 2));
+ LayoutUnit clipHeight = std::max(static_cast<LayoutUnit>(style().borderTopWidth()), legend->height() - ((legend->height() - borderTop()) / 2));
graphicsContext->clipOut(pixelSnappedIntRect(paintRect.x() + legend->x(), clipTop, legend->width(), clipHeight));
} else {
LayoutUnit clipLeft = paintRect.x();
- LayoutUnit clipWidth = std::max(static_cast<LayoutUnit>(style()->borderLeftWidth()), legend->width());
+ LayoutUnit clipWidth = std::max(static_cast<LayoutUnit>(style().borderLeftWidth()), legend->width());
graphicsContext->clipOut(pixelSnappedIntRect(clipLeft, paintRect.y() + legend->y(), clipWidth, legend->height()));
}
- paintBorder(paintInfo, paintRect, style());
+ paintBorder(paintInfo, paintRect, &style());
}
void RenderFieldset::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
- if (style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask)
+ if (style().visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask)
return;
LayoutRect paintRect = LayoutRect(paintOffset, size());
@@ -200,7 +200,7 @@
// FIXME: We need to work with "rl" and "bt" block flow directions. In those
// cases the legend is embedded in the right and bottom borders respectively.
// https://bugs.webkit.org/show_bug.cgi?id=47236
- if (style()->isHorizontalWritingMode()) {
+ if (style().isHorizontalWritingMode()) {
LayoutUnit yOff = (legend->y() > 0) ? LayoutUnit() : (legend->height() - borderTop()) / 2;
paintRect.expand(0, -yOff);
paintRect.move(0, yOff);
diff --git a/Source/WebCore/rendering/RenderFileUploadControl.cpp b/Source/WebCore/rendering/RenderFileUploadControl.cpp
index 7c12b5e..63e7de9 100644
--- a/Source/WebCore/rendering/RenderFileUploadControl.cpp
+++ b/Source/WebCore/rendering/RenderFileUploadControl.cpp
@@ -103,7 +103,7 @@
void RenderFileUploadControl::paintObject(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
- if (style()->visibility() != VISIBLE)
+ if (style().visibility() != VISIBLE)
return;
// Push a clip.
@@ -119,8 +119,8 @@
if (paintInfo.phase == PaintPhaseForeground) {
const String& displayedFilename = fileTextValue();
- const Font& font = style()->font();
- TextRun textRun = constructTextRun(this, font, displayedFilename, *style(), TextRun::AllowTrailingExpansion, RespectDirection | RespectDirectionOverride);
+ const Font& font = style().font();
+ TextRun textRun = constructTextRun(this, font, displayedFilename, style(), TextRun::AllowTrailingExpansion, RespectDirection | RespectDirectionOverride);
textRun.disableRoundingHacks();
// Determine where the filename should be placed
@@ -133,7 +133,7 @@
LayoutUnit buttonAndIconWidth = buttonWidth + afterButtonSpacing
+ (inputElement().icon() ? iconWidth + iconFilenameSpacing : 0);
LayoutUnit textX;
- if (style()->isLeftToRightDirection())
+ if (style().isLeftToRightDirection())
textX = contentLeft + buttonAndIconWidth;
else
textX = contentLeft + contentWidth() - buttonAndIconWidth - font.width(textRun);
@@ -146,7 +146,7 @@
else
textY = baselinePosition(AlphabeticBaseline, true, HorizontalLine, PositionOnContainingLine);
- paintInfo.context->setFillColor(style()->visitedDependentColor(CSSPropertyColor), style()->colorSpace());
+ paintInfo.context->setFillColor(style().visitedDependentColor(CSSPropertyColor), style().colorSpace());
// Draw the filename
paintInfo.context->drawBidiText(font, textRun, IntPoint(roundToInt(textX), roundToInt(textY)));
@@ -155,7 +155,7 @@
// Determine where the icon should be placed
LayoutUnit iconY = paintOffset.y() + borderTop() + paddingTop() + (contentHeight() - iconHeight) / 2;
LayoutUnit iconX;
- if (style()->isLeftToRightDirection())
+ if (style().isLeftToRightDirection())
iconX = contentLeft + buttonWidth + afterButtonSpacing;
else
iconX = contentLeft + contentWidth() - buttonWidth - afterButtonSpacing - iconWidth;
@@ -175,19 +175,19 @@
// (using "0" as the nominal character).
const UChar character = '0';
const String characterAsString = String(&character, 1);
- const Font& font = style()->font();
+ const Font& font = style().font();
// FIXME: Remove the need for this const_cast by making constructTextRun take a const RenderObject*.
RenderFileUploadControl* renderer = const_cast<RenderFileUploadControl*>(this);
- float minDefaultLabelWidth = defaultWidthNumChars * font.width(constructTextRun(renderer, font, characterAsString, *style(), TextRun::AllowTrailingExpansion));
+ float minDefaultLabelWidth = defaultWidthNumChars * font.width(constructTextRun(renderer, font, characterAsString, style(), TextRun::AllowTrailingExpansion));
const String label = theme()->fileListDefaultLabel(inputElement().multiple());
- float defaultLabelWidth = font.width(constructTextRun(renderer, font, label, *style(), TextRun::AllowTrailingExpansion));
+ float defaultLabelWidth = font.width(constructTextRun(renderer, font, label, style(), TextRun::AllowTrailingExpansion));
if (HTMLInputElement* button = uploadButton())
if (RenderObject* buttonRenderer = button->renderer())
defaultLabelWidth += buttonRenderer->maxPreferredLogicalWidth() + afterButtonSpacing;
maxLogicalWidth = static_cast<int>(ceilf(max(minDefaultLabelWidth, defaultLabelWidth)));
- if (!style()->width().isPercent())
+ if (!style().width().isPercent())
minLogicalWidth = maxLogicalWidth;
}
@@ -198,19 +198,19 @@
m_minPreferredLogicalWidth = 0;
m_maxPreferredLogicalWidth = 0;
- if (style()->width().isFixed() && style()->width().value() > 0)
- m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(style()->width().value());
+ if (style().width().isFixed() && style().width().value() > 0)
+ m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(style().width().value());
else
computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth, m_maxPreferredLogicalWidth);
- if (style()->minWidth().isFixed() && style()->minWidth().value() > 0) {
- m_maxPreferredLogicalWidth = max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style()->minWidth().value()));
- m_minPreferredLogicalWidth = max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style()->minWidth().value()));
+ if (style().minWidth().isFixed() && style().minWidth().value() > 0) {
+ m_maxPreferredLogicalWidth = max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth().value()));
+ m_minPreferredLogicalWidth = max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth().value()));
}
- if (style()->maxWidth().isFixed()) {
- m_maxPreferredLogicalWidth = min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style()->maxWidth().value()));
- m_minPreferredLogicalWidth = min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style()->maxWidth().value()));
+ if (style().maxWidth().isFixed()) {
+ m_maxPreferredLogicalWidth = min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth().value()));
+ m_minPreferredLogicalWidth = min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth().value()));
}
int toAdd = borderAndPaddingWidth();
@@ -243,7 +243,7 @@
String RenderFileUploadControl::fileTextValue() const
{
ASSERT(inputElement().files());
- return theme()->fileListNameForWidth(inputElement().files(), style()->font(), maxFilenameWidth(), inputElement().multiple());
+ return theme()->fileListNameForWidth(inputElement().files(), style().font(), maxFilenameWidth(), inputElement().multiple());
}
} // namespace WebCore
diff --git a/Source/WebCore/rendering/RenderFlexibleBox.cpp b/Source/WebCore/rendering/RenderFlexibleBox.cpp
index f111795..81a5469 100644
--- a/Source/WebCore/rendering/RenderFlexibleBox.cpp
+++ b/Source/WebCore/rendering/RenderFlexibleBox.cpp
@@ -96,8 +96,8 @@
// A margin has three types: fixed, percentage, and auto (variable).
// Auto and percentage margins become 0 when computing min/max width.
// Fixed margins can be added in as is.
- Length marginLeft = child.style()->marginStartUsing(parentStyle);
- Length marginRight = child.style()->marginEndUsing(parentStyle);
+ Length marginLeft = child.style().marginStartUsing(parentStyle);
+ Length marginRight = child.style().marginEndUsing(parentStyle);
LayoutUnit margin = 0;
if (marginLeft.isFixed())
margin += marginLeft.value();
@@ -115,7 +115,7 @@
if (child->isOutOfFlowPositioned())
continue;
- LayoutUnit margin = marginLogicalWidthForChild(*child, style());
+ LayoutUnit margin = marginLogicalWidthForChild(*child, &style());
bool hasOrthogonalWritingMode = child->isHorizontalWritingMode() != isHorizontalWritingMode();
LayoutUnit minPreferredLogicalWidth = hasOrthogonalWritingMode ? child->logicalHeight() : child->minPreferredLogicalWidth();
LayoutUnit maxPreferredLogicalWidth = hasOrthogonalWritingMode ? child->logicalHeight() : child->maxPreferredLogicalWidth();
@@ -151,23 +151,23 @@
m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = 0;
- RenderStyle* styleToUse = style();
+ const RenderStyle& styleToUse = style();
// FIXME: This should probably be checking for isSpecified since you should be able to use percentage, calc or viewport relative values for width.
- if (styleToUse->logicalWidth().isFixed() && styleToUse->logicalWidth().value() > 0)
- m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalWidth().value());
+ if (styleToUse.logicalWidth().isFixed() && styleToUse.logicalWidth().value() > 0)
+ m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalWidth().value());
else
computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth, m_maxPreferredLogicalWidth);
// FIXME: This should probably be checking for isSpecified since you should be able to use percentage, calc or viewport relative values for min-width.
- if (styleToUse->logicalMinWidth().isFixed() && styleToUse->logicalMinWidth().value() > 0) {
- m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMinWidth().value()));
- m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMinWidth().value()));
+ if (styleToUse.logicalMinWidth().isFixed() && styleToUse.logicalMinWidth().value() > 0) {
+ m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth().value()));
+ m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth().value()));
}
// FIXME: This should probably be checking for isSpecified since you should be able to use percentage, calc or viewport relative values for maxWidth.
- if (styleToUse->logicalMaxWidth().isFixed()) {
- m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMaxWidth().value()));
- m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMaxWidth().value()));
+ if (styleToUse.logicalMaxWidth().isFixed()) {
+ m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMaxWidth().value()));
+ m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMaxWidth().value()));
}
LayoutUnit borderAndPadding = borderAndPaddingLogicalWidth();
@@ -258,8 +258,8 @@
// Flex items that were previously stretching need to be relayed out so we can compute new available cross axis space.
// This is only necessary for stretching since other alignment values don't change the size of the box.
for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBox()) {
- EAlignItems previousAlignment = resolveAlignment(oldStyle, child->style());
- if (previousAlignment == AlignStretch && previousAlignment != resolveAlignment(style(), child->style()))
+ EAlignItems previousAlignment = resolveAlignment(oldStyle, &child->style());
+ if (previousAlignment == AlignStretch && previousAlignment != resolveAlignment(&style(), &child->style()))
child->setChildNeedsLayout(MarkOnlyThis);
}
}
@@ -280,7 +280,7 @@
LayoutUnit previousHeight = logicalHeight();
setLogicalHeight(borderAndPaddingLogicalHeight() + scrollbarLogicalHeight());
- LayoutStateMaintainer statePusher(&view(), this, locationOffset(), hasTransform() || hasReflection() || style()->isFlippedBlocksWritingMode());
+ LayoutStateMaintainer statePusher(&view(), this, locationOffset(), hasTransform() || hasReflection() || style().isFlippedBlocksWritingMode());
prepareShapesAndPaginationBeforeBlockLayout(relayoutChildren);
@@ -371,7 +371,7 @@
lineContexts[0].crossAxisExtent = crossAxisContentExtent();
alignChildren(lineContexts);
- if (style()->flexWrap() == FlexWrapReverse)
+ if (style().flexWrap() == FlexWrapReverse)
flipForWrapReverse(lineContexts, crossAxisStartEdge);
// direction:rtl + flex-direction:column means the cross-axis direction is flipped.
@@ -398,7 +398,7 @@
bool RenderFlexibleBox::isColumnFlow() const
{
- return style()->isColumnFlexDirection();
+ return style().isColumnFlexDirection();
}
bool RenderFlexibleBox::isHorizontalFlow() const
@@ -411,20 +411,20 @@
bool RenderFlexibleBox::isLeftToRightFlow() const
{
if (isColumnFlow())
- return style()->writingMode() == TopToBottomWritingMode || style()->writingMode() == LeftToRightWritingMode;
- return style()->isLeftToRightDirection() ^ (style()->flexDirection() == FlowRowReverse);
+ return style().writingMode() == TopToBottomWritingMode || style().writingMode() == LeftToRightWritingMode;
+ return style().isLeftToRightDirection() ^ (style().flexDirection() == FlowRowReverse);
}
bool RenderFlexibleBox::isMultiline() const
{
- return style()->flexWrap() != FlexNoWrap;
+ return style().flexWrap() != FlexNoWrap;
}
Length RenderFlexibleBox::flexBasisForChild(RenderBox& child) const
{
- Length flexLength = child.style()->flexBasis();
+ Length flexLength = child.style().flexBasis();
if (flexLength.isAuto())
- flexLength = isHorizontalFlow() ? child.style()->width() : child.style()->height();
+ flexLength = isHorizontalFlow() ? child.style().width() : child.style().height();
return flexLength;
}
@@ -493,17 +493,17 @@
WritingMode RenderFlexibleBox::transformedWritingMode() const
{
- WritingMode mode = style()->writingMode();
+ WritingMode mode = style().writingMode();
if (!isColumnFlow())
return mode;
switch (mode) {
case TopToBottomWritingMode:
case BottomToTopWritingMode:
- return style()->isLeftToRightDirection() ? LeftToRightWritingMode : RightToLeftWritingMode;
+ return style().isLeftToRightDirection() ? LeftToRightWritingMode : RightToLeftWritingMode;
case LeftToRightWritingMode:
case RightToLeftWritingMode:
- return style()->isLeftToRightDirection() ? TopToBottomWritingMode : BottomToTopWritingMode;
+ return style().isLeftToRightDirection() ? TopToBottomWritingMode : BottomToTopWritingMode;
}
ASSERT_NOT_REACHED();
return TopToBottomWritingMode;
@@ -748,14 +748,14 @@
if (child->isOutOfFlowPositioned())
continue;
if (isHorizontal) {
- if (child->style()->marginLeft().isAuto())
+ if (child->style().marginLeft().isAuto())
++numberOfAutoMargins;
- if (child->style()->marginRight().isAuto())
+ if (child->style().marginRight().isAuto())
++numberOfAutoMargins;
} else {
- if (child->style()->marginTop().isAuto())
+ if (child->style().marginTop().isAuto())
++numberOfAutoMargins;
- if (child->style()->marginBottom().isAuto())
+ if (child->style().marginBottom().isAuto())
++numberOfAutoMargins;
}
}
@@ -772,14 +772,14 @@
ASSERT(autoMarginOffset >= 0);
if (isHorizontalFlow()) {
- if (child.style()->marginLeft().isAuto())
+ if (child.style().marginLeft().isAuto())
child.setMarginLeft(autoMarginOffset);
- if (child.style()->marginRight().isAuto())
+ if (child.style().marginRight().isAuto())
child.setMarginRight(autoMarginOffset);
} else {
- if (child.style()->marginTop().isAuto())
+ if (child.style().marginTop().isAuto())
child.setMarginTop(autoMarginOffset);
- if (child.style()->marginBottom().isAuto())
+ if (child.style().marginBottom().isAuto())
child.setMarginBottom(autoMarginOffset);
}
}
@@ -787,8 +787,8 @@
bool RenderFlexibleBox::hasAutoMarginsInCrossAxis(RenderBox& child) const
{
if (isHorizontalFlow())
- return child.style()->marginTop().isAuto() || child.style()->marginBottom().isAuto();
- return child.style()->marginLeft().isAuto() || child.style()->marginRight().isAuto();
+ return child.style().marginTop().isAuto() || child.style().marginBottom().isAuto();
+ return child.style().marginLeft().isAuto() || child.style().marginRight().isAuto();
}
LayoutUnit RenderFlexibleBox::availableAlignmentSpaceForChild(LayoutUnit lineCrossAxisExtent, RenderBox& child)
@@ -804,8 +804,8 @@
ASSERT(availableAlignmentSpace >= 0);
bool isHorizontal = isHorizontalFlow();
- Length start = isHorizontal ? child.style()->marginTop() : child.style()->marginLeft();
- Length end = isHorizontal ? child.style()->marginBottom() : child.style()->marginRight();
+ Length start = isHorizontal ? child.style().marginTop() : child.style().marginLeft();
+ Length end = isHorizontal ? child.style().marginBottom() : child.style().marginRight();
if (start.isAuto() && end.isAuto()) {
adjustAlignmentForChild(child, availableAlignmentSpace / 2);
if (isHorizontal) {
@@ -858,7 +858,7 @@
for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBox()) {
// Avoid growing the vector for the common-case default value of 0. This optimizes the most common case which is
// one or a few values with the default order 0
- int order = child->style()->order();
+ int order = child->style().order();
if (orderValues.isEmpty() || orderValues.last() != order)
orderValues.append(order);
@@ -868,25 +868,25 @@
// Before running the flex algorithm, 'auto' has a margin of 0.
// Also, if we're not auto sizing, we don't do a layout that computes the start/end margins.
if (isHorizontalFlow()) {
- child->setMarginLeft(computeChildMarginValue(child->style()->marginLeft()));
- child->setMarginRight(computeChildMarginValue(child->style()->marginRight()));
+ child->setMarginLeft(computeChildMarginValue(child->style().marginLeft()));
+ child->setMarginRight(computeChildMarginValue(child->style().marginRight()));
} else {
- child->setMarginTop(computeChildMarginValue(child->style()->marginTop()));
- child->setMarginBottom(computeChildMarginValue(child->style()->marginBottom()));
+ child->setMarginTop(computeChildMarginValue(child->style().marginTop()));
+ child->setMarginBottom(computeChildMarginValue(child->style().marginBottom()));
}
}
}
LayoutUnit RenderFlexibleBox::adjustChildSizeForMinAndMax(RenderBox& child, LayoutUnit childSize)
{
- Length max = isHorizontalFlow() ? child.style()->maxWidth() : child.style()->maxHeight();
+ Length max = isHorizontalFlow() ? child.style().maxWidth() : child.style().maxHeight();
if (max.isSpecifiedOrIntrinsic()) {
LayoutUnit maxExtent = computeMainAxisExtentForChild(child, MaxSize, max);
if (maxExtent != -1 && childSize > maxExtent)
childSize = maxExtent;
}
- Length min = isHorizontalFlow() ? child.style()->minWidth() : child.style()->minHeight();
+ Length min = isHorizontalFlow() ? child.style().minWidth() : child.style().minHeight();
LayoutUnit minExtent = 0;
if (min.isSpecifiedOrIntrinsic())
minExtent = computeMainAxisExtentForChild(child, MinSize, min);
@@ -923,8 +923,8 @@
orderedChildren.append(child);
lineHasInFlowItem = true;
preferredMainAxisExtent += childMainAxisMarginBoxExtent;
- totalFlexGrow += child->style()->flexGrow();
- totalWeightedFlexShrink += child->style()->flexShrink() * childMainAxisExtent;
+ totalFlexGrow += child->style().flexGrow();
+ totalWeightedFlexShrink += child->style().flexShrink() * childMainAxisExtent;
LayoutUnit childMinMaxAppliedMainAxisExtent = adjustChildSizeForMinAndMax(*child, childMainAxisExtent);
minMaxAppliedMainAxisExtent += childMinMaxAppliedMainAxisExtent - childMainAxisExtent + childMainAxisMarginBoxExtent;
@@ -939,8 +939,8 @@
LayoutUnit childSize = violations[i].childSize;
LayoutUnit preferredChildSize = preferredMainAxisContentExtentForChild(child, hasInfiniteLineLength);
availableFreeSpace -= childSize - preferredChildSize;
- totalFlexGrow -= child.style()->flexGrow();
- totalWeightedFlexShrink -= child.style()->flexShrink() * preferredChildSize;
+ totalFlexGrow -= child.style().flexGrow();
+ totalWeightedFlexShrink -= child.style().flexShrink() * preferredChildSize;
inflexibleItems.set(&child, childSize);
}
}
@@ -967,9 +967,9 @@
LayoutUnit childSize = preferredChildSize;
double extraSpace = 0;
if (availableFreeSpace > 0 && totalFlexGrow > 0 && flexSign == PositiveFlexibility && std::isfinite(totalFlexGrow))
- extraSpace = availableFreeSpace * child.style()->flexGrow() / totalFlexGrow;
+ extraSpace = availableFreeSpace * child.style().flexGrow() / totalFlexGrow;
else if (availableFreeSpace < 0 && totalWeightedFlexShrink > 0 && flexSign == NegativeFlexibility && std::isfinite(totalWeightedFlexShrink))
- extraSpace = availableFreeSpace * child.style()->flexShrink() * preferredChildSize / totalWeightedFlexShrink;
+ extraSpace = availableFreeSpace * child.style().flexShrink() * preferredChildSize / totalWeightedFlexShrink;
if (std::isfinite(extraSpace))
childSize += roundedLayoutUnit(extraSpace);
@@ -1034,26 +1034,26 @@
child.containingBlock()->insertPositionedObject(child);
RenderLayer* childLayer = child.layer();
LayoutUnit inlinePosition = isColumnFlow() ? crossAxisOffset : mainAxisOffset;
- if (layoutMode == FlipForRowReverse && style()->flexDirection() == FlowRowReverse)
+ if (layoutMode == FlipForRowReverse && style().flexDirection() == FlowRowReverse)
inlinePosition = mainAxisExtent() - mainAxisOffset;
childLayer->setStaticInlinePosition(inlinePosition); // FIXME: Not right for regions.
LayoutUnit staticBlockPosition = isColumnFlow() ? mainAxisOffset : crossAxisOffset;
if (childLayer->staticBlockPosition() != staticBlockPosition) {
childLayer->setStaticBlockPosition(staticBlockPosition);
- if (child.style()->hasStaticBlockPosition(style()->isHorizontalWritingMode()))
+ if (child.style().hasStaticBlockPosition(style().isHorizontalWritingMode()))
child.setChildNeedsLayout(MarkOnlyThis);
}
}
EAlignItems RenderFlexibleBox::alignmentForChild(RenderBox& child) const
{
- EAlignItems align = resolveAlignment(style(), child.style());
+ EAlignItems align = resolveAlignment(&style(), &child.style());
if (align == AlignBaseline && hasOrthogonalFlow(child))
align = AlignFlexStart;
- if (style()->flexWrap() == FlexWrapReverse) {
+ if (style().flexWrap() == FlexWrapReverse) {
if (align == AlignFlexStart)
align = AlignFlexEnd;
else if (align == AlignFlexEnd)
@@ -1079,7 +1079,7 @@
if (alignmentForChild(child) != AlignStretch)
return false;
- Length crossAxisLength = isHorizontalFlow() ? child.style()->height() : child.style()->width();
+ Length crossAxisLength = isHorizontalFlow() ? child.style().height() : child.style().width();
return crossAxisLength.isAuto();
}
@@ -1096,8 +1096,8 @@
size_t numberOfChildrenForJustifyContent = numberOfInFlowPositionedChildren(children);
LayoutUnit autoMarginOffset = autoMarginOffsetInMainAxis(children, availableFreeSpace);
LayoutUnit mainAxisOffset = flowAwareBorderStart() + flowAwarePaddingStart();
- mainAxisOffset += initialJustifyContentOffset(availableFreeSpace, style()->justifyContent(), numberOfChildrenForJustifyContent);
- if (style()->flexDirection() == FlowRowReverse)
+ mainAxisOffset += initialJustifyContentOffset(availableFreeSpace, style().justifyContent(), numberOfChildrenForJustifyContent);
+ if (style().flexDirection() == FlowRowReverse)
mainAxisOffset += isHorizontalFlow() ? verticalScrollbarWidth() : horizontalScrollbarHeight();
LayoutUnit totalMainExtent = mainAxisExtent();
@@ -1153,13 +1153,13 @@
++seenInFlowPositionedChildren;
if (seenInFlowPositionedChildren < numberOfChildrenForJustifyContent)
- mainAxisOffset += justifyContentSpaceBetweenChildren(availableFreeSpace, style()->justifyContent(), numberOfChildrenForJustifyContent);
+ mainAxisOffset += justifyContentSpaceBetweenChildren(availableFreeSpace, style().justifyContent(), numberOfChildrenForJustifyContent);
}
if (isColumnFlow())
setLogicalHeight(mainAxisOffset + flowAwareBorderEnd() + flowAwarePaddingEnd() + scrollbarLogicalHeight());
- if (style()->flexDirection() == FlowColumnReverse) {
+ if (style().flexDirection() == FlowColumnReverse) {
// We have to do an extra pass for column-reverse to reposition the flex items since the start depends
// on the height of the flexbox, which we only know after we've positioned all the flex items.
updateLogicalHeight();
@@ -1179,7 +1179,7 @@
// just moving the children to a new position.
size_t numberOfChildrenForJustifyContent = numberOfInFlowPositionedChildren(children);
LayoutUnit mainAxisOffset = logicalHeight() - flowAwareBorderEnd() - flowAwarePaddingEnd();
- mainAxisOffset -= initialJustifyContentOffset(availableFreeSpace, style()->justifyContent(), numberOfChildrenForJustifyContent);
+ mainAxisOffset -= initialJustifyContentOffset(availableFreeSpace, style().justifyContent(), numberOfChildrenForJustifyContent);
mainAxisOffset -= isHorizontalFlow() ? verticalScrollbarWidth() : horizontalScrollbarHeight();
size_t seenInFlowPositionedChildren = 0;
@@ -1197,7 +1197,7 @@
++seenInFlowPositionedChildren;
if (seenInFlowPositionedChildren < numberOfChildrenForJustifyContent)
- mainAxisOffset -= justifyContentSpaceBetweenChildren(availableFreeSpace, style()->justifyContent(), numberOfChildrenForJustifyContent);
+ mainAxisOffset -= justifyContentSpaceBetweenChildren(availableFreeSpace, style().justifyContent(), numberOfChildrenForJustifyContent);
}
}
@@ -1229,7 +1229,7 @@
void RenderFlexibleBox::alignFlexLines(Vector<LineContext>& lineContexts)
{
- if (!isMultiline() || style()->alignContent() == AlignContentFlexStart)
+ if (!isMultiline() || style().alignContent() == AlignContentFlexStart)
return;
LayoutUnit availableCrossAxisSpace = crossAxisContentExtent();
@@ -1237,16 +1237,16 @@
availableCrossAxisSpace -= lineContexts[i].crossAxisExtent;
RenderBox* child = m_orderIterator.first();
- LayoutUnit lineOffset = initialAlignContentOffset(availableCrossAxisSpace, style()->alignContent(), lineContexts.size());
+ LayoutUnit lineOffset = initialAlignContentOffset(availableCrossAxisSpace, style().alignContent(), lineContexts.size());
for (unsigned lineNumber = 0; lineNumber < lineContexts.size(); ++lineNumber) {
lineContexts[lineNumber].crossAxisOffset += lineOffset;
for (size_t childNumber = 0; childNumber < lineContexts[lineNumber].numberOfChildren; ++childNumber, child = m_orderIterator.next())
adjustAlignmentForChild(*child, lineOffset);
- if (style()->alignContent() == AlignContentStretch && availableCrossAxisSpace > 0)
+ if (style().alignContent() == AlignContentStretch && availableCrossAxisSpace > 0)
lineContexts[lineNumber].crossAxisExtent += availableCrossAxisSpace / static_cast<unsigned>(lineContexts.size());
- lineOffset += alignContentSpaceBetweenChildren(availableCrossAxisSpace, style()->alignContent(), lineContexts.size());
+ lineOffset += alignContentSpaceBetweenChildren(availableCrossAxisSpace, style().alignContent(), lineContexts.size());
}
}
@@ -1279,7 +1279,7 @@
for (size_t childNumber = 0; childNumber < lineContexts[lineNumber].numberOfChildren; ++childNumber, child = m_orderIterator.next()) {
ASSERT(child);
if (child->isOutOfFlowPositioned()) {
- if (style()->flexWrap() == FlexWrapReverse)
+ if (style().flexWrap() == FlexWrapReverse)
adjustAlignmentForChild(*child, lineCrossAxisExtent);
continue;
}
@@ -1294,7 +1294,7 @@
case AlignStretch: {
applyStretchAlignmentToChild(*child, lineCrossAxisExtent);
// Since wrap-reverse flips cross start and cross end, strech children should be aligned with the cross end.
- if (style()->flexWrap() == FlexWrapReverse)
+ if (style().flexWrap() == FlexWrapReverse)
adjustAlignmentForChild(*child, availableAlignmentSpaceForChild(lineCrossAxisExtent, *child));
break;
}
@@ -1313,7 +1313,7 @@
LayoutUnit startOffset = maxAscent - ascent;
adjustAlignmentForChild(*child, startOffset);
- if (style()->flexWrap() == FlexWrapReverse)
+ if (style().flexWrap() == FlexWrapReverse)
minMarginAfterBaseline = std::min(minMarginAfterBaseline, availableAlignmentSpaceForChild(lineCrossAxisExtent, *child) - startOffset);
break;
}
@@ -1322,7 +1322,7 @@
minMarginAfterBaselines.append(minMarginAfterBaseline);
}
- if (style()->flexWrap() != FlexWrapReverse)
+ if (style().flexWrap() != FlexWrapReverse)
return;
// wrap-reverse flips the cross axis start and end. For baseline alignment, this means we
@@ -1340,7 +1340,7 @@
void RenderFlexibleBox::applyStretchAlignmentToChild(RenderBox& child, LayoutUnit lineCrossAxisExtent)
{
- if (!isColumnFlow() && child.style()->logicalHeight().isAuto()) {
+ if (!isColumnFlow() && child.style().logicalHeight().isAuto()) {
// FIXME: If the child has orthogonal flow, then it already has an override height set, so use it.
if (!hasOrthogonalFlow(child)) {
LayoutUnit stretchedLogicalHeight = child.logicalHeight() + availableAlignmentSpaceForChild(lineCrossAxisExtent, child);
@@ -1354,7 +1354,7 @@
child.layout();
}
}
- } else if (isColumnFlow() && child.style()->logicalWidth().isAuto()) {
+ } else if (isColumnFlow() && child.style().logicalWidth().isAuto()) {
// FIXME: If the child doesn't have orthogonal flow, then it already has an override width set, so use it.
if (hasOrthogonalFlow(child)) {
LayoutUnit childWidth = std::max<LayoutUnit>(0, lineCrossAxisExtent - crossAxisMarginExtentForChild(child));
@@ -1371,7 +1371,7 @@
void RenderFlexibleBox::flipForRightToLeftColumn()
{
- if (style()->isLeftToRightDirection() || !isColumnFlow())
+ if (style().isLeftToRightDirection() || !isColumnFlow())
return;
LayoutUnit crossExtent = crossAxisExtent();
diff --git a/Source/WebCore/rendering/RenderFlowThread.cpp b/Source/WebCore/rendering/RenderFlowThread.cpp
index 58a316b..e057e64 100644
--- a/Source/WebCore/rendering/RenderFlowThread.cpp
+++ b/Source/WebCore/rendering/RenderFlowThread.cpp
@@ -90,7 +90,7 @@
{
RenderBlockFlow::styleDidChange(diff, oldStyle);
- if (oldStyle && oldStyle->writingMode() != style()->writingMode())
+ if (oldStyle && oldStyle->writingMode() != style().writingMode())
invalidateRegions();
}
@@ -376,7 +376,7 @@
for (RenderRegionList::iterator iter = m_regionList.begin(); iter != m_regionList.end(); ++iter) {
RenderRegion* region = *iter;
LayoutUnit regionLogicalWidth = region->pageLogicalWidth();
- LayoutUnit logicalLeft = style()->direction() == LTR ? LayoutUnit() : logicalWidth - regionLogicalWidth;
+ LayoutUnit logicalLeft = style().direction() == LTR ? LayoutUnit() : logicalWidth - regionLogicalWidth;
region->setRenderBoxRegionInfo(this, logicalLeft, regionLogicalWidth, false);
}
}
@@ -403,7 +403,7 @@
LayoutRect RenderFlowThread::computeRegionClippingRect(const LayoutPoint& offset, const LayoutRect& flowThreadPortionRect, const LayoutRect& flowThreadPortionOverflowRect) const
{
LayoutRect regionClippingRect(offset + (flowThreadPortionOverflowRect.location() - flowThreadPortionRect.location()), flowThreadPortionOverflowRect.size());
- if (style()->isFlippedBlocksWritingMode())
+ if (style().isFlippedBlocksWritingMode())
regionClippingRect.move(flowThreadPortionRect.size() - flowThreadPortionOverflowRect.size());
return regionClippingRect;
}
@@ -423,7 +423,7 @@
// layout code that attempted to pixel snap would be incorrect.
IntPoint adjustedPaintOffset;
LayoutPoint portionLocation;
- if (style()->isFlippedBlocksWritingMode()) {
+ if (style().isFlippedBlocksWritingMode()) {
LayoutRect flippedFlowThreadPortionRect(flowThreadPortionRect);
flipForWritingMode(flippedFlowThreadPortionRect);
portionLocation = flippedFlowThreadPortionRect.location();
@@ -474,7 +474,7 @@
return false;
LayoutSize renderFlowThreadOffset;
- if (style()->isFlippedBlocksWritingMode()) {
+ if (style().isFlippedBlocksWritingMode()) {
LayoutRect flippedFlowThreadPortionRect(flowThreadPortionRect);
flipForWritingMode(flippedFlowThreadPortionRect);
renderFlowThreadOffset = accumulatedOffset - flippedFlowThreadPortionRect.location();
@@ -1046,7 +1046,7 @@
LayoutUnit regionLogicalWidth = region->pageLogicalWidth();
LayoutUnit regionLogicalHeight = std::min<LayoutUnit>(RenderFlowThread::maxLogicalHeight() - logicalHeight, region->logicalHeightOfAllFlowThreadContent());
- LayoutRect regionRect(style()->direction() == LTR ? LayoutUnit() : logicalWidth() - regionLogicalWidth, logicalHeight, regionLogicalWidth, regionLogicalHeight);
+ LayoutRect regionRect(style().direction() == LTR ? LayoutUnit() : logicalWidth() - regionLogicalWidth, logicalHeight, regionLogicalWidth, regionLogicalHeight);
region->setFlowThreadPortionRect(isHorizontalWritingMode() ? regionRect : regionRect.transposedRect());
@@ -1264,10 +1264,10 @@
return 0;
LayoutPoint currentBlockLocation = currentBlock->location();
- if (containerBlock->style()->writingMode() != currentBlock->style()->writingMode()) {
+ if (containerBlock->style().writingMode() != currentBlock->style().writingMode()) {
// We have to put the block rect in container coordinates
// and we have to take into account both the container and current block flipping modes
- if (containerBlock->style()->isFlippedBlocksWritingMode()) {
+ if (containerBlock->style().isFlippedBlocksWritingMode()) {
if (containerBlock->isHorizontalWritingMode())
blockRect.setY(currentBlock->height() - blockRect.maxY());
else
@@ -1312,8 +1312,8 @@
return LayoutRect();
LayoutPoint currentBoxLocation = box->location();
- if (containerBlock->style()->writingMode() != box->style()->writingMode()) {
- if (containerBlock->style()->isFlippedBlocksWritingMode()) {
+ if (containerBlock->style().writingMode() != box->style().writingMode()) {
+ if (containerBlock->style().isFlippedBlocksWritingMode()) {
if (containerBlock->isHorizontalWritingMode())
boxRect.setY(box->height() - boxRect.maxY());
else
@@ -1344,8 +1344,8 @@
LayoutPoint currentBoxLocation = box->location();
localRect.moveBy(-currentBoxLocation);
- if (containerBlock->style()->writingMode() != box->style()->writingMode()) {
- if (containerBlock->style()->isFlippedBlocksWritingMode()) {
+ if (containerBlock->style().writingMode() != box->style().writingMode()) {
+ if (containerBlock->style().isFlippedBlocksWritingMode()) {
if (containerBlock->isHorizontalWritingMode())
localRect.setY(box->height() - localRect.maxY());
else
diff --git a/Source/WebCore/rendering/RenderFrameSet.cpp b/Source/WebCore/rendering/RenderFrameSet.cpp
index 36c9404..d4b761a 100644
--- a/Source/WebCore/rendering/RenderFrameSet.cpp
+++ b/Source/WebCore/rendering/RenderFrameSet.cpp
@@ -90,8 +90,8 @@
// Fill first.
GraphicsContext* context = paintInfo.context;
- ColorSpace colorSpace = style()->colorSpace();
- context->fillRect(borderRect, frameSetElement().hasBorderColor() ? style()->visitedDependentColor(CSSPropertyBorderLeftColor) : borderFillColor(), colorSpace);
+ ColorSpace colorSpace = style().colorSpace();
+ context->fillRect(borderRect, frameSetElement().hasBorderColor() ? style().visitedDependentColor(CSSPropertyBorderLeftColor) : borderFillColor(), colorSpace);
// Now stroke the edges but only if we have enough room to paint both edges with a little
// bit of the fill color showing through.
@@ -110,8 +110,8 @@
// Fill first.
GraphicsContext* context = paintInfo.context;
- ColorSpace colorSpace = style()->colorSpace();
- context->fillRect(borderRect, frameSetElement().hasBorderColor() ? style()->visitedDependentColor(CSSPropertyBorderLeftColor) : borderFillColor(), colorSpace);
+ ColorSpace colorSpace = style().colorSpace();
+ context->fillRect(borderRect, frameSetElement().hasBorderColor() ? style().visitedDependentColor(CSSPropertyBorderLeftColor) : borderFillColor(), colorSpace);
// Now stroke the edges but only if we have enough room to paint both edges with a little
// bit of the fill color showing through.
diff --git a/Source/WebCore/rendering/RenderFullScreen.cpp b/Source/WebCore/rendering/RenderFullScreen.cpp
index e3d3997..99c9414 100644
--- a/Source/WebCore/rendering/RenderFullScreen.cpp
+++ b/Source/WebCore/rendering/RenderFullScreen.cpp
@@ -111,7 +111,7 @@
{
RenderFullScreen* fullscreenRenderer = new RenderFullScreen(document, createFullScreenStyle());
fullscreenRenderer->initializeStyle();
- if (parent && !parent->isChildAllowed(*fullscreenRenderer, *fullscreenRenderer->style())) {
+ if (parent && !parent->isChildAllowed(*fullscreenRenderer, fullscreenRenderer->style())) {
fullscreenRenderer->destroy();
return 0;
}
diff --git a/Source/WebCore/rendering/RenderGeometryMap.cpp b/Source/WebCore/rendering/RenderGeometryMap.cpp
index 6bae42a..c98d6ec 100644
--- a/Source/WebCore/rendering/RenderGeometryMap.cpp
+++ b/Source/WebCore/rendering/RenderGeometryMap.cpp
@@ -162,8 +162,8 @@
static bool canMapBetweenRenderers(const RenderObject& renderer, const RenderObject& ancestor)
{
for (const RenderObject* current = &renderer; ; current = current->parent()) {
- const RenderStyle* style = current->style();
- if (style->position() == FixedPosition || style->isFlippedBlocksWritingMode())
+ const RenderStyle& style = current->style();
+ if (style.position() == FixedPosition || style.isFlippedBlocksWritingMode())
return false;
if (current->hasColumns() || current->hasTransform() || current->isRenderFlowThread())
diff --git a/Source/WebCore/rendering/RenderGrid.cpp b/Source/WebCore/rendering/RenderGrid.cpp
index fb90e0d..b2347cd 100644
--- a/Source/WebCore/rendering/RenderGrid.cpp
+++ b/Source/WebCore/rendering/RenderGrid.cpp
@@ -163,7 +163,7 @@
// FIXME: Much of this method is boiler plate that matches RenderBox::layoutBlock and Render*FlexibleBox::layoutBlock.
// It would be nice to refactor some of the duplicate code.
LayoutRepainter repainter(*this, checkForRepaintDuringLayout());
- LayoutStateMaintainer statePusher(&view(), this, locationOffset(), hasTransform() || hasReflection() || style()->isFlippedBlocksWritingMode());
+ LayoutStateMaintainer statePusher(&view(), this, locationOffset(), hasTransform() || hasReflection() || style().isFlippedBlocksWritingMode());
prepareShapesAndPaginationBeforeBlockLayout(relayoutChildren);
@@ -353,7 +353,7 @@
{
// FIXME: We still need to support calc() here (https://webkit.org/b/103761).
ASSERT(trackLength.isFixed() || trackLength.isPercent() || trackLength.isViewportPercentage());
- return valueForLength(trackLength, direction == ForColumns ? logicalWidth() : computeContentLogicalHeight(style()->logicalHeight()));
+ return valueForLength(trackLength, direction == ForColumns ? logicalWidth() : computeContentLogicalHeight(style().logicalHeight()));
}
double RenderGrid::computeNormalizedFractionBreadth(Vector<GridTrack>& tracks, TrackSizingDirection direction, LayoutUnit availableLogicalSpace) const
@@ -406,21 +406,21 @@
const GridTrackSize& RenderGrid::gridTrackSize(TrackSizingDirection direction, size_t i) const
{
- const Vector<GridTrackSize>& trackStyles = (direction == ForColumns) ? style()->gridColumns() : style()->gridRows();
+ const Vector<GridTrackSize>& trackStyles = (direction == ForColumns) ? style().gridColumns() : style().gridRows();
if (i >= trackStyles.size())
- return (direction == ForColumns) ? style()->gridAutoColumns() : style()->gridAutoRows();
+ return (direction == ForColumns) ? style().gridAutoColumns() : style().gridAutoRows();
return trackStyles[i];
}
size_t RenderGrid::explicitGridColumnCount() const
{
- return style()->gridColumns().size();
+ return style().gridColumns().size();
}
size_t RenderGrid::explicitGridRowCount() const
{
- return style()->gridRows().size();
+ return style().gridRows().size();
}
size_t RenderGrid::explicitGridSizeForSide(GridPositionSide side) const
@@ -612,7 +612,7 @@
Vector<RenderBox*> autoMajorAxisAutoGridItems;
Vector<RenderBox*> specifiedMajorAxisAutoGridItems;
- GridAutoFlow autoFlow = style()->gridAutoFlow();
+ GridAutoFlow autoFlow = style().gridAutoFlow();
for (RenderBox* child = m_orderIterator.first(); child; child = m_orderIterator.next()) {
// FIXME: We never re-resolve positions if the grid is grown during auto-placement which may lead auto / <integer>
// positions to not match the author's intent. The specification is unclear on what should be done in this case.
@@ -629,8 +629,8 @@
insertItemIntoGrid(child, GridCoordinate(*rowPositions, *columnPositions));
}
- ASSERT(gridRowCount() >= style()->gridRows().size());
- ASSERT(gridColumnCount() >= style()->gridColumns().size());
+ ASSERT(gridRowCount() >= style().gridRows().size());
+ ASSERT(gridColumnCount() >= style().gridColumns().size());
if (autoFlow == AutoFlowNone) {
// If we did collect some grid items, they won't be placed thus never laid out.
@@ -653,7 +653,7 @@
for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBox()) {
// Avoid growing the vector for the common-case default value of 0. This optimizes the most common case which is
// one or a few values with the default order 0
- int order = child->style()->order();
+ int order = child->style().order();
if (orderValues.isEmpty() || orderValues.last() != order)
orderValues.append(order);
@@ -731,14 +731,14 @@
RenderGrid::TrackSizingDirection RenderGrid::autoPlacementMajorAxisDirection() const
{
- GridAutoFlow flow = style()->gridAutoFlow();
+ GridAutoFlow flow = style().gridAutoFlow();
ASSERT(flow != AutoFlowNone);
return (flow == AutoFlowColumn) ? ForColumns : ForRows;
}
RenderGrid::TrackSizingDirection RenderGrid::autoPlacementMinorAxisDirection() const
{
- GridAutoFlow flow = style()->gridAutoFlow();
+ GridAutoFlow flow = style().gridAutoFlow();
ASSERT(flow != AutoFlowNone);
return (flow == AutoFlowColumn) ? ForRows : ForColumns;
}
@@ -819,16 +819,16 @@
PassOwnPtr<GridSpan> RenderGrid::resolveGridPositionsFromStyle(const RenderBox* gridItem, TrackSizingDirection direction) const
{
- const GridPosition& initialPosition = (direction == ForColumns) ? gridItem->style()->gridItemColumnStart() : gridItem->style()->gridItemRowStart();
+ const GridPosition& initialPosition = (direction == ForColumns) ? gridItem->style().gridItemColumnStart() : gridItem->style().gridItemRowStart();
const GridPositionSide initialPositionSide = (direction == ForColumns) ? ColumnStartSide : RowStartSide;
- const GridPosition& finalPosition = (direction == ForColumns) ? gridItem->style()->gridItemColumnEnd() : gridItem->style()->gridItemRowEnd();
+ const GridPosition& finalPosition = (direction == ForColumns) ? gridItem->style().gridItemColumnEnd() : gridItem->style().gridItemRowEnd();
const GridPositionSide finalPositionSide = (direction == ForColumns) ? ColumnEndSide : RowEndSide;
// We should NEVER see both spans as they should have been handled during style resolve.
ASSERT(!initialPosition.isSpan() || !finalPosition.isSpan());
if (initialPosition.shouldBeResolvedAgainstOppositePosition() && finalPosition.shouldBeResolvedAgainstOppositePosition()) {
- if (style()->gridAutoFlow() == AutoFlowNone)
+ if (style().gridAutoFlow() == AutoFlowNone)
return adoptPtr(new GridSpan(0, 0));
// We can't get our grid positions without running the auto placement algorithm.
@@ -875,7 +875,7 @@
{
ASSERT(!position.namedGridLine().isNull());
- const NamedGridLinesMap& gridLinesNames = (side == ColumnStartSide || side == ColumnEndSide) ? style()->namedGridColumnLines() : style()->namedGridRowLines();
+ const NamedGridLinesMap& gridLinesNames = (side == ColumnStartSide || side == ColumnEndSide) ? style().namedGridColumnLines() : style().namedGridRowLines();
NamedGridLinesMap::const_iterator it = gridLinesNames.find(position.namedGridLine());
if (it == gridLinesNames.end()) {
if (position.isPositive())
@@ -959,7 +959,7 @@
// Negative positions are not allowed per the specification and should have been handled during parsing.
ASSERT(position.spanPosition() > 0);
- const NamedGridLinesMap& gridLinesNames = (side == ColumnStartSide || side == ColumnEndSide) ? style()->namedGridColumnLines() : style()->namedGridRowLines();
+ const NamedGridLinesMap& gridLinesNames = (side == ColumnStartSide || side == ColumnEndSide) ? style().namedGridColumnLines() : style().namedGridRowLines();
NamedGridLinesMap::const_iterator it = gridLinesNames.find(position.namedGridLine());
// If there is no named grid line of that name, we resolve the position to 'auto' (which is equivalent to 'span 1' in this case).
diff --git a/Source/WebCore/rendering/RenderHTMLCanvas.cpp b/Source/WebCore/rendering/RenderHTMLCanvas.cpp
index 03bf4d5..034f378 100644
--- a/Source/WebCore/rendering/RenderHTMLCanvas.cpp
+++ b/Source/WebCore/rendering/RenderHTMLCanvas.cpp
@@ -84,14 +84,14 @@
page->addRelevantRepaintedObject(this, intersection(paintRect, contentRect));
}
- bool useLowQualityScale = style()->imageRendering() == ImageRenderingCrispEdges || style()->imageRendering() == ImageRenderingOptimizeSpeed;
+ bool useLowQualityScale = style().imageRendering() == ImageRenderingCrispEdges || style().imageRendering() == ImageRenderingOptimizeSpeed;
canvasElement().paint(context, paintRect, useLowQualityScale);
}
void RenderHTMLCanvas::canvasSizeChanged()
{
IntSize canvasSize = canvasElement().size();
- LayoutSize zoomedSize(canvasSize.width() * style()->effectiveZoom(), canvasSize.height() * style()->effectiveZoom());
+ LayoutSize zoomedSize(canvasSize.width() * style().effectiveZoom(), canvasSize.height() * style().effectiveZoom());
if (zoomedSize == intrinsicSize())
return;
diff --git a/Source/WebCore/rendering/RenderIFrame.cpp b/Source/WebCore/rendering/RenderIFrame.cpp
index 5c584a0..db671fc 100644
--- a/Source/WebCore/rendering/RenderIFrame.cpp
+++ b/Source/WebCore/rendering/RenderIFrame.cpp
@@ -91,7 +91,7 @@
bool RenderIFrame::requiresLayer() const
{
- return RenderFrameBase::requiresLayer() || style()->resize() != RESIZE_NONE;
+ return RenderFrameBase::requiresLayer() || style().resize() != RESIZE_NONE;
}
RenderView* RenderIFrame::contentRootRenderer() const
@@ -114,11 +114,11 @@
if (!enabled || !frame->page())
return false;
- if (style()->width().isFixed() && style()->height().isFixed()) {
+ if (style().width().isFixed() && style().height().isFixed()) {
// Do not flatten iframes with scrolling="no".
if (iframeElement().scrollingMode() == ScrollbarAlwaysOff)
return false;
- if (style()->width().value() <= 0 || style()->height().value() <= 0)
+ if (style().width().value() <= 0 || style().height().value() <= 0)
return false;
}
@@ -166,7 +166,7 @@
updateLogicalHeight();
if (flattenFrame())
- layoutWithFlattening(style()->width().isFixed(), style()->height().isFixed());
+ layoutWithFlattening(style().width().isFixed(), style().height().isFixed());
}
clearOverflow();
diff --git a/Source/WebCore/rendering/RenderImage.cpp b/Source/WebCore/rendering/RenderImage.cpp
index 6019ba3..dc086b3 100644
--- a/Source/WebCore/rendering/RenderImage.cpp
+++ b/Source/WebCore/rendering/RenderImage.cpp
@@ -121,7 +121,7 @@
// imageSize() returns 0 for the error image. We need the true size of the
// error image, so we have to get it by grabbing image() directly.
- return IntSize(paddingWidth + imageSize.width() * style()->effectiveZoom(), paddingHeight + imageSize.height() * style()->effectiveZoom());
+ return IntSize(paddingWidth + imageSize.width() * style().effectiveZoom(), paddingHeight + imageSize.height() * style().effectiveZoom());
}
// Sets the image height and width to fit the alt text. Returns true if the
@@ -140,8 +140,8 @@
if (!m_altText.isEmpty()) {
FontCachePurgePreventer fontCachePurgePreventer;
- const Font& font = style()->font();
- IntSize paddedTextSize(paddingWidth + min(ceilf(font.width(RenderBlock::constructTextRun(this, font, m_altText, *style()))), maxAltTextWidth), paddingHeight + min(font.fontMetrics().height(), maxAltTextHeight));
+ const Font& font = style().font();
+ IntSize paddedTextSize(paddingWidth + min(ceilf(font.width(RenderBlock::constructTextRun(this, font, m_altText, style()))), maxAltTextWidth), paddingHeight + min(font.fontMetrics().height(), maxAltTextHeight));
imageSize = imageSize.expandedTo(paddedTextSize);
}
@@ -161,15 +161,15 @@
m_needsToSetSizeForAltText = false;
}
#if ENABLE(CSS_IMAGE_ORIENTATION)
- if (diff == StyleDifferenceLayout && oldStyle->imageOrientation() != style()->imageOrientation())
+ if (diff == StyleDifferenceLayout && oldStyle->imageOrientation() != style().imageOrientation())
return imageDimensionsChanged(true /* imageSizeChanged */);
#endif
#if ENABLE(CSS_IMAGE_RESOLUTION)
if (diff == StyleDifferenceLayout
- && (oldStyle->imageResolution() != style()->imageResolution()
- || oldStyle->imageResolutionSnap() != style()->imageResolutionSnap()
- || oldStyle->imageResolutionSource() != style()->imageResolutionSource()))
+ && (oldStyle->imageResolution() != style().imageResolution()
+ || oldStyle->imageResolutionSnap() != style().imageResolutionSnap()
+ || oldStyle->imageResolutionSource() != style().imageResolutionSource()))
imageDimensionsChanged(true /* imageSizeChanged */);
#endif
}
@@ -237,14 +237,14 @@
void RenderImage::imageDimensionsChanged(bool imageSizeChanged, const IntRect* rect)
{
#if ENABLE(CSS_IMAGE_RESOLUTION)
- double scale = style()->imageResolution();
- if (style()->imageResolutionSnap() == ImageResolutionSnapPixels)
+ double scale = style().imageResolution();
+ if (style().imageResolutionSnap() == ImageResolutionSnapPixels)
scale = roundForImpreciseConversion<int>(scale);
if (scale <= 0)
scale = 1;
- bool intrinsicSizeChanged = updateIntrinsicSizeIfNeeded(m_imageResource->intrinsicSize(style()->effectiveZoom() / scale), imageSizeChanged);
+ bool intrinsicSizeChanged = updateIntrinsicSizeIfNeeded(m_imageResource->intrinsicSize(style().effectiveZoom() / scale), imageSizeChanged);
#else
- bool intrinsicSizeChanged = updateIntrinsicSizeIfNeeded(m_imageResource->intrinsicSize(style()->effectiveZoom()), imageSizeChanged);
+ bool intrinsicSizeChanged = updateIntrinsicSizeIfNeeded(m_imageResource->intrinsicSize(style().effectiveZoom()), imageSizeChanged);
#endif
// In the case of generated image content using :before/:after/content, we might not be
@@ -274,9 +274,9 @@
// if the containing block's size depends on the image's size (i.e., the container uses shrink-to-fit sizing).
// There's no easy way to detect that shrink-to-fit is needed, always force a layout.
bool containingBlockNeedsToRecomputePreferredSize =
- style()->logicalWidth().isPercent()
- || style()->logicalMaxWidth().isPercent()
- || style()->logicalMinWidth().isPercent();
+ style().logicalWidth().isPercent()
+ || style().logicalMaxWidth().isPercent()
+ || style().logicalMinWidth().isPercent();
if (imageSizeChanged || hasOverrideSize || containingBlockNeedsToRecomputePreferredSize) {
shouldRepaint = false;
@@ -362,8 +362,8 @@
// Draw an outline rect where the image should be.
context->setStrokeStyle(SolidStroke);
- context->setStrokeColor(Color::lightGray, style()->colorSpace());
- context->setFillColor(Color::transparent, style()->colorSpace());
+ context->setStrokeColor(Color::lightGray, style().colorSpace());
+ context->setFillColor(Color::transparent, style().colorSpace());
context->drawRect(pixelSnappedIntRect(LayoutRect(paintOffset.x() + leftBorder + leftPad, paintOffset.y() + topBorder + topPad, cWidth, cHeight)));
bool errorPictureDrawn = false;
@@ -393,17 +393,17 @@
ImageOrientationDescription orientationDescription;
#if ENABLE(CSS_IMAGE_ORIENTATION)
- orientationDescription.setImageOrientationEnum(style()->imageOrientation());
+ orientationDescription.setImageOrientationEnum(style().imageOrientation());
orientationDescription.setRespectImageOrientation(shouldRespectImageOrientation());
#endif
- context->drawImage(image.get(), style()->colorSpace(), pixelSnappedIntRect(LayoutRect(paintOffset + imageOffset, imageSize)), CompositeSourceOver, orientationDescription);
+ context->drawImage(image.get(), style().colorSpace(), pixelSnappedIntRect(LayoutRect(paintOffset + imageOffset, imageSize)), CompositeSourceOver, orientationDescription);
errorPictureDrawn = true;
}
if (!m_altText.isEmpty()) {
String text = document().displayStringModifiedByEncoding(m_altText);
- context->setFillColor(style()->visitedDependentColor(CSSPropertyColor), style()->colorSpace());
- const Font& font = style()->font();
+ context->setFillColor(style().visitedDependentColor(CSSPropertyColor), style().colorSpace());
+ const Font& font = style().font();
const FontMetrics& fontMetrics = font.fontMetrics();
LayoutUnit ascent = fontMetrics.ascent();
LayoutPoint altTextOffset = paintOffset;
@@ -411,7 +411,7 @@
// Only draw the alt text if it'll fit within the content box,
// and only if it fits above the error image.
- TextRun textRun = RenderBlock::constructTextRun(this, font, text, *style());
+ TextRun textRun = RenderBlock::constructTextRun(this, font, text, style());
LayoutUnit textWidth = font.width(textRun);
if (errorPictureDrawn) {
if (usableWidth >= textWidth && fontMetrics.height() <= imageOffset.height())
@@ -429,8 +429,8 @@
}
#if PLATFORM(MAC)
- if (style()->highlight() != nullAtom && !paintInfo.context->paintingDisabled())
- paintCustomHighlight(toPoint(paintOffset - location()), style()->highlight(), true);
+ if (style().highlight() != nullAtom && !paintInfo.context->paintingDisabled())
+ paintCustomHighlight(toPoint(paintOffset - location()), style().highlight(), true);
#endif
LayoutRect contentRect = contentBoxRect();
@@ -525,10 +525,10 @@
bool useLowQualityScaling = shouldPaintAtLowQuality(context, image, image, alignedRect.size());
ImageOrientationDescription orientationDescription;
#if ENABLE(CSS_IMAGE_ORIENTATION)
- orientationDescription.setImageOrientationEnum(style()->imageOrientation());
+ orientationDescription.setImageOrientationEnum(style().imageOrientation());
orientationDescription.setRespectImageOrientation(shouldRespectImageOrientation());
#endif
- context->drawImage(m_imageResource->image(alignedRect.width(), alignedRect.height()).get(), style()->colorSpace(), alignedRect, compositeOperator, orientationDescription, useLowQualityScaling);
+ context->drawImage(m_imageResource->image(alignedRect.width(), alignedRect.height()).get(), style().colorSpace(), alignedRect, compositeOperator, orientationDescription, useLowQualityScaling);
}
bool RenderImage::boxShadowShouldBeAppliedToBackground(BackgroundBleedAvoidance bleedAvoidance, InlineFlowBox*) const
@@ -548,15 +548,15 @@
return false;
if (!contentBoxRect().contains(localRect))
return false;
- EFillBox backgroundClip = style()->backgroundClip();
+ EFillBox backgroundClip = style().backgroundClip();
// Background paints under borders.
- if (backgroundClip == BorderFillBox && style()->hasBorder() && !borderObscuresBackground())
+ if (backgroundClip == BorderFillBox && style().hasBorder() && !borderObscuresBackground())
return false;
// Background shows in padding area.
- if ((backgroundClip == BorderFillBox || backgroundClip == PaddingFillBox) && style()->hasPadding())
+ if ((backgroundClip == BorderFillBox || backgroundClip == PaddingFillBox) && style().hasPadding())
return false;
// Object-fit may leave parts of the content box empty.
- ObjectFit objectFit = style()->objectFit();
+ ObjectFit objectFit = style().objectFit();
if (objectFit != ObjectFitFill && objectFit != ObjectFitCover)
return false;
// Check for image with alpha.
@@ -593,7 +593,7 @@
if (tempResult.innerNode() && element()) {
if (HTMLMapElement* map = imageMap()) {
LayoutRect contentBox = contentBoxRect();
- float scaleFactor = 1 / style()->effectiveZoom();
+ float scaleFactor = 1 / style().effectiveZoom();
LayoutPoint mapLocation = locationInContainer.point() - toLayoutSize(accumulatedOffset) - locationOffset() - toLayoutSize(contentBox.location());
mapLocation.scale(scaleFactor, scaleFactor);
diff --git a/Source/WebCore/rendering/RenderImageResource.cpp b/Source/WebCore/rendering/RenderImageResource.cpp
index d11cbc9..f459bea 100644
--- a/Source/WebCore/rendering/RenderImageResource.cpp
+++ b/Source/WebCore/rendering/RenderImageResource.cpp
@@ -103,7 +103,7 @@
{
ASSERT(m_renderer);
if (m_cachedImage)
- m_cachedImage->setContainerSizeForRenderer(m_renderer, imageContainerSize, m_renderer->style()->effectiveZoom());
+ m_cachedImage->setContainerSizeForRenderer(m_renderer, imageContainerSize, m_renderer->style().effectiveZoom());
}
Image* RenderImageResource::nullImage()
diff --git a/Source/WebCore/rendering/RenderImageResourceStyleImage.cpp b/Source/WebCore/rendering/RenderImageResourceStyleImage.cpp
index b050fa8..42b37dd 100644
--- a/Source/WebCore/rendering/RenderImageResourceStyleImage.cpp
+++ b/Source/WebCore/rendering/RenderImageResourceStyleImage.cpp
@@ -71,7 +71,7 @@
void RenderImageResourceStyleImage::setContainerSizeForRenderer(const IntSize& size)
{
ASSERT(m_renderer);
- m_styleImage->setContainerSizeForRenderer(m_renderer, size, m_renderer->style()->effectiveZoom());
+ m_styleImage->setContainerSizeForRenderer(m_renderer, size, m_renderer->style().effectiveZoom());
}
} // namespace WebCore
diff --git a/Source/WebCore/rendering/RenderInline.cpp b/Source/WebCore/rendering/RenderInline.cpp
index 7f9bd4f..5d6ff29 100644
--- a/Source/WebCore/rendering/RenderInline.cpp
+++ b/Source/WebCore/rendering/RenderInline.cpp
@@ -68,7 +68,7 @@
{
#if !ASSERT_DISABLED
// Make sure we do not retain "this" in the continuation outline table map of our containing blocks.
- if (parent() && style()->visibility() == VISIBLE && hasOutline()) {
+ if (parent() && style().visibility() == VISIBLE && hasOutline()) {
bool containingBlockPaintsContinuationOutline = continuation() || isInlineElementContinuation();
if (containingBlockPaintsContinuationOutline) {
if (RenderBlock* cb = containingBlock()) {
@@ -151,14 +151,14 @@
static void updateStyleOfAnonymousBlockContinuations(RenderBlock* block, const RenderStyle* newStyle, const RenderStyle* oldStyle)
{
for (;block && block->isAnonymousBlock(); block = toRenderBlock(block->nextSibling())) {
- if (!block->isAnonymousBlockContinuation() || block->style()->position() == newStyle->position())
+ if (!block->isAnonymousBlockContinuation() || block->style().position() == newStyle->position())
continue;
// If we are no longer in-flow positioned but our descendant block(s) still have an in-flow positioned ancestor then
// their containing anonymous block should keep its in-flow positioning.
RenderInline* cont = block->inlineElementContinuation();
if (oldStyle->hasInFlowPosition() && inFlowPositionedInlineAncestor(cont))
continue;
- auto blockStyle = RenderStyle::createAnonymousStyleWithDisplay(block->style(), BLOCK);
+ auto blockStyle = RenderStyle::createAnonymousStyleWithDisplay(&block->style(), BLOCK);
blockStyle.get().setPosition(newStyle->position());
block->setStyle(std::move(blockStyle));
}
@@ -174,27 +174,27 @@
// e.g., <font>foo <h4>goo</h4> moo</font>. The <font> inlines before
// and after the block share the same style, but the block doesn't
// need to pass its style on to anyone else.
- RenderStyle* newStyle = style();
+ RenderStyle& newStyle = style();
RenderInline* continuation = inlineElementContinuation();
for (RenderInline* currCont = continuation; currCont; currCont = currCont->inlineElementContinuation()) {
RenderBoxModelObject* nextCont = currCont->continuation();
currCont->setContinuation(0);
- currCont->setStyle(*newStyle);
+ currCont->setStyle(newStyle);
currCont->setContinuation(nextCont);
}
// If an inline's in-flow positioning has changed then any descendant blocks will need to change their in-flow positioning accordingly.
// Do this by updating the position of the descendant blocks' containing anonymous blocks - there may be more than one.
- if (continuation && oldStyle && newStyle->position() != oldStyle->position()
- && (newStyle->hasInFlowPosition() || oldStyle->hasInFlowPosition())) {
+ if (continuation && oldStyle && newStyle.position() != oldStyle->position()
+ && (newStyle.hasInFlowPosition() || oldStyle->hasInFlowPosition())) {
// If any descendant blocks exist then they will be in the next anonymous block and its siblings.
RenderObject* block = containingBlock()->nextSibling();
ASSERT(block && block->isAnonymousBlock());
- updateStyleOfAnonymousBlockContinuations(toRenderBlock(block), newStyle, oldStyle);
+ updateStyleOfAnonymousBlockContinuations(toRenderBlock(block), &newStyle, oldStyle);
}
if (!m_alwaysCreateLineBoxes) {
- bool alwaysCreateLineBoxes = hasSelfPaintingLayer() || hasBoxDecorations() || newStyle->hasPadding() || newStyle->hasMargin() || hasOutline();
+ bool alwaysCreateLineBoxes = hasSelfPaintingLayer() || hasBoxDecorations() || newStyle.hasPadding() || newStyle.hasMargin() || hasOutline();
if (oldStyle && alwaysCreateLineBoxes) {
dirtyLineBoxes(false);
setNeedsLayout();
@@ -210,25 +210,25 @@
if (m_alwaysCreateLineBoxes)
return;
- RenderStyle* parentStyle = parent()->style();
+ RenderStyle* parentStyle = &parent()->style();
RenderInline* parentRenderInline = parent()->isRenderInline() ? toRenderInline(parent()) : 0;
bool checkFonts = document().inNoQuirksMode();
RenderFlowThread* flowThread = flowThreadContainingBlock();
bool alwaysCreateLineBoxes = (parentRenderInline && parentRenderInline->alwaysCreateLineBoxes())
|| (parentRenderInline && parentStyle->verticalAlign() != BASELINE)
- || style()->verticalAlign() != BASELINE
- || style()->textEmphasisMark() != TextEmphasisMarkNone
- || (checkFonts && (!parentStyle->font().fontMetrics().hasIdenticalAscentDescentAndLineGap(style()->font().fontMetrics())
- || parentStyle->lineHeight() != style()->lineHeight()))
+ || style().verticalAlign() != BASELINE
+ || style().textEmphasisMark() != TextEmphasisMarkNone
+ || (checkFonts && (!parentStyle->font().fontMetrics().hasIdenticalAscentDescentAndLineGap(style().font().fontMetrics())
+ || parentStyle->lineHeight() != style().lineHeight()))
|| (flowThread && flowThread->hasRegionsWithStyling());
if (!alwaysCreateLineBoxes && checkFonts && document().styleSheetCollection().usesFirstLineRules()) {
// Have to check the first line style as well.
- parentStyle = parent()->firstLineStyle();
- RenderStyle* childStyle = firstLineStyle();
- alwaysCreateLineBoxes = !parentStyle->font().fontMetrics().hasIdenticalAscentDescentAndLineGap(childStyle->font().fontMetrics())
- || childStyle->verticalAlign() != BASELINE
- || parentStyle->lineHeight() != childStyle->lineHeight();
+ parentStyle = &parent()->firstLineStyle();
+ RenderStyle& childStyle = firstLineStyle();
+ alwaysCreateLineBoxes = !parentStyle->font().fontMetrics().hasIdenticalAscentDescentAndLineGap(childStyle.font().fontMetrics())
+ || childStyle.verticalAlign() != BASELINE
+ || parentStyle->lineHeight() != childStyle.lineHeight();
}
if (alwaysCreateLineBoxes) {
@@ -312,12 +312,12 @@
// inline into continuations. This involves creating an anonymous block box to hold
// |newChild|. We then make that block box a continuation of this inline. We take all of
// the children after |beforeChild| and put them in a clone of this object.
- auto newStyle = RenderStyle::createAnonymousStyleWithDisplay(style(), BLOCK);
+ auto newStyle = RenderStyle::createAnonymousStyleWithDisplay(&style(), BLOCK);
// If inside an inline affected by in-flow positioning the block needs to be affected by it too.
// Giving the block a layer like this allows it to collect the x/y offsets from inline parents later.
if (auto positionedAncestor = inFlowPositionedInlineAncestor(this))
- newStyle.get().setPosition(positionedAncestor->style()->position());
+ newStyle.get().setPosition(positionedAncestor->style().position());
RenderBlock* newBox = new RenderBlockFlow(document(), std::move(newStyle));
newBox->initializeStyle();
@@ -335,7 +335,7 @@
RenderInline* RenderInline::clone() const
{
- RenderInline* cloneInline = new RenderInline(*element(), *style());
+ RenderInline* cloneInline = new RenderInline(*element(), style());
cloneInline->initializeStyle();
cloneInline->setFlowThreadState(flowThreadState());
return cloneInline;
@@ -562,7 +562,7 @@
return;
}
- bool isHorizontal = style()->isHorizontalWritingMode();
+ bool isHorizontal = style().isHorizontalWritingMode();
for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling()) {
if (curr->isFloatingOrOutOfFlowPositioned())
@@ -574,7 +574,7 @@
RenderBox* currBox = toRenderBox(curr);
if (currBox->inlineBoxWrapper()) {
const RootInlineBox& rootBox = currBox->inlineBoxWrapper()->root();
- const RenderStyle& containerStyle = rootBox.isFirstLine() ? *container->firstLineStyle() : *container->style();
+ const RenderStyle& containerStyle = rootBox.isFirstLine() ? container->firstLineStyle() : container->style();
int logicalTop = rootBox.logicalTop() + (rootBox.lineStyle().font().fontMetrics().ascent() - containerStyle.font().fontMetrics().ascent());
int logicalHeight = containerStyle.font().fontMetrics().height();
if (isHorizontal)
@@ -590,7 +590,7 @@
else {
for (InlineFlowBox* childLine = currInline->firstLineBox(); childLine; childLine = childLine->nextLineBox()) {
const RootInlineBox& rootBox = childLine->root();
- const RenderStyle& containerStyle = rootBox.isFirstLine() ? *container->firstLineStyle() : *container->style();
+ const RenderStyle& containerStyle = rootBox.isFirstLine() ? container->firstLineStyle() : container->style();
int logicalTop = rootBox.logicalTop() + (rootBox.lineStyle().font().fontMetrics().ascent() - containerStyle.font().fontMetrics().ascent());
int logicalHeight = containerStyle.fontMetrics().height();
if (isHorizontal)
@@ -609,7 +609,7 @@
RenderText* currText = toRenderText(curr);
for (InlineTextBox* childText = currText->firstTextBox(); childText; childText = childText->nextTextBox()) {
const RootInlineBox& rootBox = childText->root();
- const RenderStyle& containerStyle = rootBox.isFirstLine() ? *container->firstLineStyle() : *container->style();
+ const RenderStyle& containerStyle = rootBox.isFirstLine() ? container->firstLineStyle() : container->style();
int logicalTop = rootBox.logicalTop() + (rootBox.lineStyle().font().fontMetrics().ascent() - containerStyle.font().fontMetrics().ascent());
int logicalHeight = containerStyle.font().fontMetrics().height();
if (isHorizontal)
@@ -621,7 +621,7 @@
if (InlineBox* inlineBox = toRenderLineBreak(curr)->inlineBoxWrapper()) {
// FIXME: This could use a helper to share these with text path.
const RootInlineBox& rootBox = inlineBox->root();
- const RenderStyle& containerStyle = rootBox.isFirstLine() ? *container->firstLineStyle() : *container->style();
+ const RenderStyle& containerStyle = rootBox.isFirstLine() ? container->firstLineStyle() : container->style();
int logicalTop = rootBox.logicalTop() + (rootBox.lineStyle().font().fontMetrics().ascent() - containerStyle.font().fontMetrics().ascent());
int logicalHeight = containerStyle.fontMetrics().height();
if (isHorizontal)
@@ -731,42 +731,42 @@
LayoutUnit RenderInline::marginLeft() const
{
- return computeMargin(this, style()->marginLeft());
+ return computeMargin(this, style().marginLeft());
}
LayoutUnit RenderInline::marginRight() const
{
- return computeMargin(this, style()->marginRight());
+ return computeMargin(this, style().marginRight());
}
LayoutUnit RenderInline::marginTop() const
{
- return computeMargin(this, style()->marginTop());
+ return computeMargin(this, style().marginTop());
}
LayoutUnit RenderInline::marginBottom() const
{
- return computeMargin(this, style()->marginBottom());
+ return computeMargin(this, style().marginBottom());
}
LayoutUnit RenderInline::marginStart(const RenderStyle* otherStyle) const
{
- return computeMargin(this, style()->marginStartUsing(otherStyle ? otherStyle : style()));
+ return computeMargin(this, style().marginStartUsing(otherStyle ? otherStyle : &style()));
}
LayoutUnit RenderInline::marginEnd(const RenderStyle* otherStyle) const
{
- return computeMargin(this, style()->marginEndUsing(otherStyle ? otherStyle : style()));
+ return computeMargin(this, style().marginEndUsing(otherStyle ? otherStyle : &style()));
}
LayoutUnit RenderInline::marginBefore(const RenderStyle* otherStyle) const
{
- return computeMargin(this, style()->marginBeforeUsing(otherStyle ? otherStyle : style()));
+ return computeMargin(this, style().marginBeforeUsing(otherStyle ? otherStyle : &style()));
}
LayoutUnit RenderInline::marginAfter(const RenderStyle* otherStyle) const
{
- return computeMargin(this, style()->marginAfterUsing(otherStyle ? otherStyle : style()));
+ return computeMargin(this, style().marginAfterUsing(otherStyle ? otherStyle : &style()));
}
const char* RenderInline::renderName() const
@@ -780,7 +780,7 @@
return "RenderInline (generated)";
if (isAnonymous())
return "RenderInline (generated)";
- if (style() && isRunIn())
+ if (isRunIn())
return "RenderInline (run-in)";
return "RenderInline";
}
@@ -897,7 +897,7 @@
logicalRightSide = curr->logicalRight();
}
- bool isHorizontal = style()->isHorizontalWritingMode();
+ bool isHorizontal = style().isHorizontalWritingMode();
float x = isHorizontal ? logicalLeftSide : firstLineBox()->x();
float y = isHorizontal ? firstLineBox()->y() : logicalLeftSide;
@@ -971,7 +971,7 @@
LinesBoundingBoxGeneratorContext context(floatResult);
generateCulledLineBoxRects(context, this);
LayoutRect result(enclosingLayoutRect(floatResult));
- bool isHorizontal = style()->isHorizontalWritingMode();
+ bool isHorizontal = style().isHorizontalWritingMode();
for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling()) {
if (curr->isFloatingOrOutOfFlowPositioned())
continue;
@@ -980,7 +980,7 @@
if (curr->isBox()) {
RenderBox* currBox = toRenderBox(curr);
if (!currBox->hasSelfPaintingLayer() && currBox->inlineBoxWrapper()) {
- LayoutRect logicalRect = currBox->logicalVisualOverflowRectForPropagation(style());
+ LayoutRect logicalRect = currBox->logicalVisualOverflowRectForPropagation(&style());
if (isHorizontal) {
logicalRect.moveBy(currBox->location());
result.uniteIfNonZero(logicalRect);
@@ -1030,7 +1030,7 @@
LayoutUnit logicalHeight = lastLineBox()->logicalBottomVisualOverflow(lastRootBox.lineBottom()) - logicalTop;
LayoutRect rect(logicalLeftSide, logicalTop, logicalWidth, logicalHeight);
- if (!style()->isHorizontalWritingMode())
+ if (!style().isHorizontalWritingMode())
rect = rect.transposedRect();
return rect;
}
@@ -1038,7 +1038,7 @@
LayoutRect RenderInline::clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const
{
// Only run-ins and first-letter renderers are allowed in here during layout. They mutate the tree triggering repaints.
- ASSERT(!view().layoutStateEnabled() || isRunIn() || style()->styleType() == FIRST_LETTER);
+ ASSERT(!view().layoutStateEnabled() || isRunIn() || style().styleType() == FIRST_LETTER);
if (!firstLineBoxIncludingCulling() && !continuation())
return LayoutRect();
@@ -1055,11 +1055,11 @@
hitRepaintContainer = true;
break;
}
- if (inlineFlow->style()->hasInFlowPosition() && inlineFlow->hasLayer())
+ if (inlineFlow->style().hasInFlowPosition() && inlineFlow->hasLayer())
repaintRect.move(toRenderInline(inlineFlow)->layer()->offsetForInFlowPosition());
}
- LayoutUnit outlineSize = style()->outlineSize();
+ LayoutUnit outlineSize = style().outlineSize();
repaintRect.inflate(outlineSize);
if (hitRepaintContainer || !cb)
@@ -1103,7 +1103,7 @@
// LayoutState is only valid for root-relative repainting
if (view().layoutStateEnabled() && !repaintContainer) {
LayoutState* layoutState = view().layoutState();
- if (style()->hasInFlowPosition() && layer())
+ if (style().hasInFlowPosition() && layer())
rect.move(layer()->offsetForInFlowPosition());
rect.move(layoutState->m_paintOffset);
if (layoutState->m_clipped)
@@ -1121,7 +1121,7 @@
LayoutPoint topLeft = rect.location();
- if (o->isRenderBlockFlow() && !style()->hasOutOfFlowPosition()) {
+ if (o->isRenderBlockFlow() && !style().hasOutOfFlowPosition()) {
RenderBlock* cb = toRenderBlock(o);
if (cb->hasColumns()) {
LayoutRect repaintRect(topLeft, rect.size());
@@ -1131,7 +1131,7 @@
}
}
- if (style()->hasInFlowPosition() && layer()) {
+ if (style().hasInFlowPosition() && layer()) {
// Apply the in-flow position offset when invalidating a rectangle. The layer
// is translated, but the render box isn't, so we need to do this to get the
// right dirty rect. Since this is called from RenderObject::setStyle, the relative or sticky position
@@ -1174,7 +1174,7 @@
if (offsetDependsOnPoint)
*offsetDependsOnPoint = container->hasColumns()
- || (container->isBox() && container->style()->isFlippedBlocksWritingMode())
+ || (container->isBox() && container->style().isFlippedBlocksWritingMode())
|| container->isRenderFlowThread();
return offset;
@@ -1188,7 +1188,7 @@
if (view().layoutStateEnabled() && !repaintContainer) {
LayoutState* layoutState = view().layoutState();
LayoutSize offset = layoutState->m_paintOffset;
- if (style()->hasInFlowPosition() && layer())
+ if (style().hasInFlowPosition() && layer())
offset += layer()->offsetForInFlowPosition();
transformState.move(offset);
return;
@@ -1200,7 +1200,7 @@
return;
if (mode & ApplyContainerFlip && o->isBox()) {
- if (o->style()->isFlippedBlocksWritingMode()) {
+ if (o->style().isFlippedBlocksWritingMode()) {
IntPoint centerPoint = roundedIntPoint(transformState.mappedPoint());
transformState.move(toRenderBox(o)->flipForWritingModeIncludingColumns(centerPoint) - centerPoint);
}
@@ -1209,7 +1209,7 @@
LayoutSize containerOffset = offsetFromContainer(o, roundedLayoutPoint(transformState.mappedPoint()));
- bool preserve3D = mode & UseTransforms && (o->style()->preserves3D() || style()->preserves3D());
+ bool preserve3D = mode & UseTransforms && (o->style().preserves3D() || style().preserves3D());
if (mode & UseTransforms && shouldUseTransformFromContainer(o)) {
TransformationMatrix t;
getTransformFromContainer(o, containerOffset, t);
@@ -1247,7 +1247,7 @@
bool offsetDependsOnPoint = false;
LayoutSize containerOffset = offsetFromContainer(container, LayoutPoint(), &offsetDependsOnPoint);
- bool preserve3D = container->style()->preserves3D() || style()->preserves3D();
+ bool preserve3D = container->style().preserves3D() || style().preserves3D();
if (shouldUseTransformFromContainer(container)) {
TransformationMatrix t;
getTransformFromContainer(container, containerOffset, t);
@@ -1360,17 +1360,17 @@
LayoutUnit RenderInline::lineHeight(bool firstLine, LineDirectionMode /*direction*/, LinePositionMode /*linePositionMode*/) const
{
if (firstLine && document().styleSheetCollection().usesFirstLineRules()) {
- const RenderStyle& firstLineStyle = *this->firstLineStyle();
- if (&firstLineStyle != style())
+ const RenderStyle& firstLineStyle = this->firstLineStyle();
+ if (&firstLineStyle != &style())
return firstLineStyle.computedLineHeight(&view());
}
- return style()->computedLineHeight(&view());
+ return style().computedLineHeight(&view());
}
int RenderInline::baselinePosition(FontBaseline baselineType, bool firstLine, LineDirectionMode direction, LinePositionMode linePositionMode) const
{
- const RenderStyle& style = firstLine ? *firstLineStyle() : *this->style();
+ const RenderStyle& style = firstLine ? firstLineStyle() : this->style();
const FontMetrics& fontMetrics = style.fontMetrics();
return fontMetrics.ascent(baselineType) + (lineHeight(firstLine, direction, linePositionMode) - fontMetrics.height()) / 2;
}
@@ -1398,21 +1398,21 @@
blockPosition = layer()->staticBlockPosition();
}
- if (!child->style()->hasStaticInlinePosition(style()->isHorizontalWritingMode()))
+ if (!child->style().hasStaticInlinePosition(style().isHorizontalWritingMode()))
logicalOffset.setWidth(inlinePosition);
// This is not terribly intuitive, but we have to match other browsers. Despite being a block display type inside
// an inline, we still keep our x locked to the left of the relative positioned inline. Arguably the correct
// behavior would be to go flush left to the block that contains the inline, but that isn't what other browsers
// do.
- else if (!child->style()->isOriginalDisplayInlineType())
+ else if (!child->style().isOriginalDisplayInlineType())
// Avoid adding in the left border/padding of the containing block twice. Subtract it out.
logicalOffset.setWidth(inlinePosition - child->containingBlock()->borderAndPaddingLogicalLeft());
- if (!child->style()->hasStaticBlockPosition(style()->isHorizontalWritingMode()))
+ if (!child->style().hasStaticBlockPosition(style().isHorizontalWritingMode()))
logicalOffset.setHeight(blockPosition);
- return style()->isHorizontalWritingMode() ? logicalOffset : logicalOffset.transposedSize();
+ return style().isHorizontalWritingMode() ? logicalOffset : logicalOffset.transposedSize();
}
void RenderInline::imageChanged(WrappedImagePtr, const IntRect*)
@@ -1454,11 +1454,11 @@
if (!hasOutline())
return;
- RenderStyle* styleToUse = style();
- if (styleToUse->outlineStyleIsAuto() || hasOutlineAnnotation()) {
- if (!theme()->supportsFocusRing(styleToUse)) {
+ RenderStyle& styleToUse = style();
+ if (styleToUse.outlineStyleIsAuto() || hasOutlineAnnotation()) {
+ if (!theme()->supportsFocusRing(&styleToUse)) {
// Only paint the focus ring by hand if the theme isn't able to draw the focus ring.
- paintFocusRing(paintInfo, paintOffset, styleToUse);
+ paintFocusRing(paintInfo, paintOffset, &styleToUse);
}
}
@@ -1466,7 +1466,7 @@
if (graphicsContext->paintingDisabled())
return;
- if (styleToUse->outlineStyleIsAuto() || styleToUse->outlineStyle() == BNONE)
+ if (styleToUse.outlineStyleIsAuto() || styleToUse.outlineStyle() == BNONE)
return;
Vector<LayoutRect> rects;
@@ -1480,7 +1480,7 @@
}
rects.append(LayoutRect());
- Color outlineColor = styleToUse->visitedDependentColor(CSSPropertyOutlineColor);
+ Color outlineColor = styleToUse.visitedDependentColor(CSSPropertyOutlineColor);
bool useTransparencyLayer = outlineColor.hasAlpha();
if (useTransparencyLayer) {
graphicsContext->beginTransparencyLayer(static_cast<float>(outlineColor.alpha()) / 255);
@@ -1498,13 +1498,13 @@
const LayoutRect& lastline, const LayoutRect& thisline, const LayoutRect& nextline,
const Color outlineColor)
{
- RenderStyle* styleToUse = style();
- int outlineWidth = styleToUse->outlineWidth();
- EBorderStyle outlineStyle = styleToUse->outlineStyle();
+ const RenderStyle& styleToUse = style();
+ int outlineWidth = styleToUse.outlineWidth();
+ EBorderStyle outlineStyle = styleToUse.outlineStyle();
bool antialias = shouldAntialiasLines(graphicsContext);
- int offset = style()->outlineOffset();
+ int offset = style().outlineOffset();
LayoutRect box(LayoutPoint(paintOffset.x() + thisline.x() - offset, paintOffset.y() + thisline.y() - offset),
LayoutSize(thisline.width() + offset, thisline.height() + offset));
@@ -1609,11 +1609,11 @@
void RenderInline::addAnnotatedRegions(Vector<AnnotatedRegionValue>& regions)
{
// Convert the style regions to absolute coordinates.
- if (style()->visibility() != VISIBLE)
+ if (style().visibility() != VISIBLE)
return;
#if ENABLE(DASHBOARD_SUPPORT)
- const Vector<StyleDashboardRegion>& styleRegions = style()->dashboardRegions();
+ const Vector<StyleDashboardRegion>& styleRegions = style().dashboardRegions();
unsigned i, count = styleRegions.size();
for (i = 0; i < count; i++) {
StyleDashboardRegion styleRegion = styleRegions[i];
@@ -1648,11 +1648,11 @@
regions.append(region);
}
#else // ENABLE(DRAGGABLE_REGION)
- if (style()->getDraggableRegionMode() == DraggableRegionNone)
+ if (style().getDraggableRegionMode() == DraggableRegionNone)
return;
AnnotatedRegionValue region;
- region.draggable = style()->getDraggableRegionMode() == DraggableRegionDrag;
+ region.draggable = style().getDraggableRegionMode() == DraggableRegionDrag;
region.bounds = linesBoundingBox();
RenderObject* container = containingBlock();
diff --git a/Source/WebCore/rendering/RenderInputSpeech.cpp b/Source/WebCore/rendering/RenderInputSpeech.cpp
index 65ee275..bbab279 100644
--- a/Source/WebCore/rendering/RenderInputSpeech.cpp
+++ b/Source/WebCore/rendering/RenderInputSpeech.cpp
@@ -93,7 +93,7 @@
image = imageStateRecording.get();
else if (speechButton->state() == InputFieldSpeechButtonElement::Recognizing)
image = imageStateWaiting.get();
- paintInfo.context->drawImage(image, object->style()->colorSpace(), pixelSnappedIntRect(buttonRect));
+ paintInfo.context->drawImage(image, object->style().colorSpace(), pixelSnappedIntRect(buttonRect));
return false;
}
diff --git a/Source/WebCore/rendering/RenderLayer.cpp b/Source/WebCore/rendering/RenderLayer.cpp
index d613c27..9a3cdd3 100644
--- a/Source/WebCore/rendering/RenderLayer.cpp
+++ b/Source/WebCore/rendering/RenderLayer.cpp
@@ -217,9 +217,9 @@
ScrollableArea::setConstrainsScrollingToContentEdge(false);
- if (!renderer().firstChild() && renderer().style()) {
+ if (!renderer().firstChild()) {
m_visibleContentStatusDirty = false;
- m_hasVisibleContent = renderer().style()->visibility() == VISIBLE;
+ m_hasVisibleContent = renderer().style().visibility() == VISIBLE;
}
if (Element* element = renderer().element()) {
@@ -773,7 +773,7 @@
if (flags & HasChangedAncestor || flags & HasSeenViewportConstrainedAncestor || flags & IsOverflowScroll)
clearClipRects();
- if (renderer().style()->hasViewportConstrainedPosition())
+ if (renderer().style().hasViewportConstrainedPosition())
flags |= HasSeenViewportConstrainedAncestor;
if (renderer().hasOverflowClip())
@@ -828,7 +828,7 @@
void RenderLayer::updateBlendMode()
{
- BlendMode newBlendMode = renderer().style()->blendMode();
+ BlendMode newBlendMode = renderer().style().blendMode();
if (newBlendMode != m_blendMode) {
m_blendMode = newBlendMode;
if (backing())
@@ -842,7 +842,7 @@
{
// hasTransform() on the renderer is also true when there is transform-style: preserve-3d or perspective set,
// so check style too.
- bool hasTransform = renderer().hasTransform() && renderer().style()->hasTransform();
+ bool hasTransform = renderer().hasTransform() && renderer().style().hasTransform();
bool had3DTransform = has3DTransform();
bool hadTransform = m_transform;
@@ -860,7 +860,7 @@
RenderBox* box = renderBox();
ASSERT(box);
m_transform->makeIdentity();
- box->style()->applyTransform(*m_transform, box->pixelSnappedBorderBoxRect().size(), RenderStyle::IncludeTransformOrigin);
+ box->style().applyTransform(*m_transform, box->pixelSnappedBorderBoxRect().size(), RenderStyle::IncludeTransformOrigin);
makeMatrixRenderable(*m_transform, canRender3DTransforms());
}
@@ -874,7 +874,7 @@
return TransformationMatrix();
#if USE(ACCELERATED_COMPOSITING)
- if (renderer().style()->isRunningAcceleratedAnimation()) {
+ if (renderer().style().isRunningAcceleratedAnimation()) {
TransformationMatrix currTransform;
RefPtr<RenderStyle> style = renderer().animation().getAnimatedStyleForRenderer(&renderer());
style->applyTransform(currTransform, renderBox()->pixelSnappedBorderBoxRect().size(), applyOrigin);
@@ -886,7 +886,7 @@
if (applyOrigin == RenderStyle::ExcludeTransformOrigin) {
RenderBox* box = renderBox();
TransformationMatrix currTransform;
- box->style()->applyTransform(currTransform, box->pixelSnappedBorderBoxRect().size(), RenderStyle::ExcludeTransformOrigin);
+ box->style().applyTransform(currTransform, box->pixelSnappedBorderBoxRect().size(), RenderStyle::ExcludeTransformOrigin);
makeMatrixRenderable(currTransform, canRender3DTransforms());
return currTransform;
}
@@ -1128,14 +1128,14 @@
}
if (m_visibleContentStatusDirty) {
- if (renderer().style()->visibility() == VISIBLE)
+ if (renderer().style().visibility() == VISIBLE)
m_hasVisibleContent = true;
else {
// layer may be hidden but still have some visible content, check for this
m_hasVisibleContent = false;
RenderObject* r = renderer().firstChild();
while (r) {
- if (r->style()->visibility() == VISIBLE && !r->hasLayer()) {
+ if (r->style().visibility() == VISIBLE && !r->hasLayer()) {
m_hasVisibleContent = true;
break;
}
@@ -1300,8 +1300,8 @@
if (!renderer().hasTransform())
return TransformationMatrix();
- RenderStyle* style = renderer().style();
- if (!style->hasPerspective())
+ const RenderStyle& style = renderer().style();
+ if (!style.hasPerspective())
return TransformationMatrix();
// Maybe fetch the perspective from the backing?
@@ -1309,8 +1309,8 @@
const float boxWidth = borderBox.width();
const float boxHeight = borderBox.height();
- float perspectiveOriginX = floatValueForLength(style->perspectiveOriginX(), boxWidth);
- float perspectiveOriginY = floatValueForLength(style->perspectiveOriginY(), boxHeight);
+ float perspectiveOriginX = floatValueForLength(style.perspectiveOriginX(), boxWidth);
+ float perspectiveOriginY = floatValueForLength(style.perspectiveOriginY(), boxHeight);
// A perspective origin of 0,0 makes the vanishing point in the center of the element.
// We want it to be in the top-left, so subtract half the height and width.
@@ -1319,7 +1319,7 @@
TransformationMatrix t;
t.translate(perspectiveOriginX, perspectiveOriginY);
- t.applyPerspective(style->perspective());
+ t.applyPerspective(style.perspective());
t.translate(-perspectiveOriginX, -perspectiveOriginY);
return t;
@@ -1331,10 +1331,10 @@
return FloatPoint();
const LayoutRect borderBox = toRenderBox(renderer()).borderBoxRect();
- RenderStyle* style = renderer().style();
+ const RenderStyle& style = renderer().style();
- return FloatPoint(floatValueForLength(style->perspectiveOriginX(), borderBox.width()),
- floatValueForLength(style->perspectiveOriginY(), borderBox.height()));
+ return FloatPoint(floatValueForLength(style.perspectiveOriginX(), borderBox.width()),
+ floatValueForLength(style.perspectiveOriginY(), borderBox.height()));
}
RenderLayer* RenderLayer::stackingContainer() const
@@ -1495,7 +1495,7 @@
return;
LayoutRect rectForRepaint = rect;
- renderer().style()->filterOutsets().expandRect(rectForRepaint);
+ renderer().style().filterOutsets().expandRect(rectForRepaint);
FilterInfo& filterInfo = FilterInfo::get(*this);
filterInfo.expandDirtySourceRect(rectForRepaint);
@@ -1543,7 +1543,7 @@
bool RenderLayer::hasAncestorWithFilterOutsets() const
{
for (const RenderLayer* curr = this; curr; curr = curr->parent()) {
- if (curr->renderer().style()->hasFilterOutsets())
+ if (curr->renderer().style().hasFilterOutsets())
return true;
}
return false;
@@ -1679,7 +1679,7 @@
LayoutRect clipRect = layer->boundingBox(layer);
expandClipRectForDescendantsAndReflection(clipRect, layer, layer, transparencyBehavior, paintBehavior);
#if ENABLE(CSS_FILTERS)
- layer->renderer().style()->filterOutsets().expandRect(clipRect);
+ layer->renderer().style().filterOutsets().expandRect(clipRect);
#endif
LayoutRect result = transform.mapRect(clipRect);
if (!paginationLayer)
@@ -1700,7 +1700,7 @@
LayoutRect clipRect = layer->boundingBox(rootLayer, RenderLayer::UseFragmentBoxes);
expandClipRectForDescendantsAndReflection(clipRect, layer, rootLayer, transparencyBehavior, paintBehavior);
#if ENABLE(CSS_FILTERS)
- layer->renderer().style()->filterOutsets().expandRect(clipRect);
+ layer->renderer().style().filterOutsets().expandRect(clipRect);
#endif
return clipRect;
}
@@ -1902,7 +1902,7 @@
ASSERT(ancestorLayer != layer);
const RenderLayerModelObject& renderer = layer->renderer();
- EPosition position = renderer.style()->position();
+ EPosition position = renderer.style().position();
// FIXME: Special casing RenderFlowThread so much for fixed positioning here is not great.
RenderFlowThread* fixedFlowThreadContainer = position == FixedPosition ? renderer.flowThreadContainingBlock() : 0;
@@ -2073,7 +2073,7 @@
&& !hasOutOfFlowPositionedDescendant();
#if ENABLE(ACCELERATED_OVERFLOW_SCROLLING)
- m_needsCompositedScrolling = forceUseCompositedScrolling || renderer().style()->useTouchOverflowScrolling();
+ m_needsCompositedScrolling = forceUseCompositedScrolling || renderer().style().useTouchOverflowScrolling();
#else
m_needsCompositedScrolling = forceUseCompositedScrolling;
#endif
@@ -2148,7 +2148,7 @@
bool restrictedByLineClamp = false;
if (renderer().parent())
- restrictedByLineClamp = !renderer().parent()->style()->lineClamp().isNone();
+ restrictedByLineClamp = !renderer().parent()->style().lineClamp().isNone();
if (renderer().hasOverflowClip() && !restrictedByLineClamp) {
IntSize newScrollOffset = scrollOffset() + delta;
@@ -2202,7 +2202,7 @@
if (!box)
return;
- if (box->style()->overflowX() != OMARQUEE) {
+ if (box->style().overflowX() != OMARQUEE) {
// Ensure that the dimensions will be computed if they need to be (for overflow:hidden blocks).
if (m_scrollDimensionsDirty)
computeScrollDimensions();
@@ -2301,7 +2301,7 @@
bool restrictedByLineClamp = false;
if (renderer().parent()) {
parentLayer = renderer().parent()->enclosingLayer();
- restrictedByLineClamp = !renderer().parent()->style()->lineClamp().isNone();
+ restrictedByLineClamp = !renderer().parent()->style().lineClamp().isNone();
}
if (renderer().hasOverflowClip() && !restrictedByLineClamp) {
@@ -2479,7 +2479,7 @@
// We need a special case for <iframe> because they never have
// hasOverflowClip(). However, they do "implicitly" clip their contents, so
// we want to allow resizing them also.
- return (renderer().hasOverflowClip() || renderer().isRenderIFrame()) && renderer().style()->resize() != RESIZE_NONE;
+ return (renderer().hasOverflowClip() || renderer().isRenderIFrame()) && renderer().style().resize() != RESIZE_NONE;
}
void RenderLayer::resize(const PlatformMouseEvent& evt, const LayoutSize& oldOffset)
@@ -2497,7 +2497,7 @@
if (!document.frame()->eventHandler().mousePressed())
return;
- float zoomFactor = renderer->style()->effectiveZoom();
+ float zoomFactor = renderer->style().effectiveZoom();
LayoutSize newOffset = offsetFromResizeCorner(document.view()->windowToContents(evt.position()));
newOffset.setWidth(newOffset.width() / zoomFactor);
@@ -2508,7 +2508,7 @@
element->setMinimumSizeForResizing(minimumSize);
LayoutSize adjustedOldOffset = LayoutSize(oldOffset.width() / zoomFactor, oldOffset.height() / zoomFactor);
- if (renderer->style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft()) {
+ if (renderer->style().shouldPlaceBlockDirectionScrollbarOnLogicalLeft()) {
newOffset.setWidth(-newOffset.width());
adjustedOldOffset.setWidth(-adjustedOldOffset.width());
}
@@ -2517,9 +2517,9 @@
ASSERT_WITH_SECURITY_IMPLICATION(element->isStyledElement());
StyledElement* styledElement = static_cast<StyledElement*>(element);
- bool isBoxSizingBorder = renderer->style()->boxSizing() == BORDER_BOX;
+ bool isBoxSizingBorder = renderer->style().boxSizing() == BORDER_BOX;
- EResize resize = renderer->style()->resize();
+ EResize resize = renderer->style().resize();
if (resize != RESIZE_VERTICAL && difference.width()) {
if (element->isFormControlElement()) {
// Make implicit margins from the theme explicit (see <http://bugs.webkit.org/show_bug.cgi?id=9547>).
@@ -2610,9 +2610,9 @@
static int cornerStart(const RenderLayer* layer, int minX, int maxX, int thickness)
{
- if (layer->renderer().style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
- return minX + layer->renderer().style()->borderLeftWidth();
- return maxX - thickness - layer->renderer().style()->borderRightWidth();
+ if (layer->renderer().style().shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
+ return minX + layer->renderer().style().borderLeftWidth();
+ return maxX - thickness - layer->renderer().style().borderRightWidth();
}
static IntRect cornerRect(const RenderLayer* layer, const IntRect& bounds)
@@ -2635,7 +2635,7 @@
verticalThickness = layer->horizontalScrollbar()->height();
}
return IntRect(cornerStart(layer, bounds.x(), bounds.maxX(), horizontalThickness),
- bounds.maxY() - verticalThickness - layer->renderer().style()->borderBottomWidth(),
+ bounds.maxY() - verticalThickness - layer->renderer().style().borderBottomWidth(),
horizontalThickness, verticalThickness);
}
@@ -2647,7 +2647,7 @@
// (b) Both scrollbars are present.
bool hasHorizontalBar = horizontalScrollbar();
bool hasVerticalBar = verticalScrollbar();
- bool hasResizer = renderer().style()->resize() != RESIZE_NONE;
+ bool hasResizer = renderer().style().resize() != RESIZE_NONE;
if ((hasHorizontalBar && hasVerticalBar) || (hasResizer && (hasHorizontalBar || hasVerticalBar)))
return cornerRect(this, renderBox()->pixelSnappedBorderBoxRect());
return IntRect();
@@ -2656,7 +2656,7 @@
static IntRect resizerCornerRect(const RenderLayer* layer, const IntRect& bounds)
{
ASSERT(layer->renderer().isBox());
- if (layer->renderer().style()->resize() == RESIZE_NONE)
+ if (layer->renderer().style().resize() == RESIZE_NONE)
return IntRect();
return cornerRect(layer, bounds);
}
@@ -2768,7 +2768,7 @@
LayoutUnit RenderLayer::verticalScrollbarStart(int minX, int maxX) const
{
const RenderBox* box = renderBox();
- if (renderer().style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
+ if (renderer().style().shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
return minX + box->borderLeft();
return maxX - box->borderRight() - m_vBar->width();
}
@@ -2777,7 +2777,7 @@
{
const RenderBox* box = renderBox();
int x = minX + box->borderLeft();
- if (renderer().style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
+ if (renderer().style().shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
x += m_vBar ? m_vBar->width() : resizerCornerRect(this, box->pixelSnappedBorderBoxRect()).width();
return x;
}
@@ -2857,7 +2857,7 @@
{
RefPtr<Scrollbar> widget;
RenderElement* actualRenderer = rendererForScrollbar(renderer());
- bool hasCustomScrollbarStyle = actualRenderer->isBox() && actualRenderer->style()->hasPseudoStyle(SCROLLBAR);
+ bool hasCustomScrollbarStyle = actualRenderer->isBox() && actualRenderer->style().hasPseudoStyle(SCROLLBAR);
if (hasCustomScrollbarStyle)
widget = RenderScrollbar::createCustomScrollbar(this, orientation, actualRenderer->element());
else {
@@ -2965,7 +2965,7 @@
// Currently the resize corner is either the bottom right corner or the bottom left corner.
// FIXME: This assumes the location is 0, 0. Is this guaranteed to always be the case?
IntSize elementSize = size();
- if (renderer().style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
+ if (renderer().style().shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
elementSize.setWidth(0);
IntPoint resizerPoint = IntPoint(elementSize);
IntPoint localPoint = roundedIntPoint(absoluteToContents(absolutePoint));
@@ -2974,7 +2974,7 @@
bool RenderLayer::hasOverflowControls() const
{
- return m_hBar || m_vBar || m_scrollCorner || renderer().style()->resize() != RESIZE_NONE;
+ return m_hBar || m_vBar || m_scrollCorner || renderer().style().resize() != RESIZE_NONE;
}
void RenderLayer::positionOverflowControls(const IntSize& offsetFromRoot)
@@ -3105,16 +3105,16 @@
ASSERT(box);
// List box parts handle the scrollbars by themselves so we have nothing to do.
- if (box->style()->appearance() == ListboxPart)
+ if (box->style().appearance() == ListboxPart)
return;
bool hasHorizontalOverflow = this->hasHorizontalOverflow();
bool hasVerticalOverflow = this->hasVerticalOverflow();
// overflow:scroll should just enable/disable.
- if (renderer().style()->overflowX() == OSCROLL)
+ if (renderer().style().overflowX() == OSCROLL)
m_hBar->setEnabled(hasHorizontalOverflow);
- if (renderer().style()->overflowY() == OSCROLL)
+ if (renderer().style().overflowY() == OSCROLL)
m_vBar->setEnabled(hasVerticalOverflow);
// overflow:auto may need to lay out again if scrollbars got added/removed.
@@ -3137,7 +3137,7 @@
renderer().repaint();
- if (renderer().style()->overflowX() == OAUTO || renderer().style()->overflowY() == OAUTO) {
+ if (renderer().style().overflowX() == OAUTO || renderer().style().overflowY() == OAUTO) {
if (!m_inOverflowRelayout) {
// Our proprietary overflow: overlay value doesn't trigger a layout.
m_inOverflowRelayout = true;
@@ -3181,7 +3181,7 @@
computeScrollDimensions();
- if (box->style()->overflowX() != OMARQUEE) {
+ if (box->style().overflowX() != OMARQUEE) {
// Layout may cause us to be at an invalid scroll position. In this case we need
// to pull our scroll offsets back to the max (or push them up to the min).
IntSize clampedScrollOffset = clampScrollOffset(scrollOffset());
@@ -3318,7 +3318,7 @@
// We don't want to paint white if we have overlay scrollbars, since we need
// to see what is behind it.
if (!hasOverlayScrollbars())
- context->fillRect(absRect, Color::white, box->style()->colorSpace());
+ context->fillRect(absRect, Color::white, box->style().colorSpace());
}
void RenderLayer::drawPlatformResizerImage(GraphicsContext* context, IntRect resizerCornerRect)
@@ -3338,21 +3338,21 @@
cornerResizerSize = resizeCornerImage->size();
}
- if (renderer().style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft()) {
+ if (renderer().style().shouldPlaceBlockDirectionScrollbarOnLogicalLeft()) {
context->save();
context->translate(resizerCornerRect.x() + cornerResizerSize.width(), resizerCornerRect.y() + resizerCornerRect.height() - cornerResizerSize.height());
context->scale(FloatSize(-1.0, 1.0));
- context->drawImage(resizeCornerImage.get(), renderer().style()->colorSpace(), IntRect(IntPoint(), cornerResizerSize));
+ context->drawImage(resizeCornerImage.get(), renderer().style().colorSpace(), IntRect(IntPoint(), cornerResizerSize));
context->restore();
return;
}
IntRect imageRect(resizerCornerRect.maxXMaxYCorner() - cornerResizerSize, cornerResizerSize);
- context->drawImage(resizeCornerImage.get(), renderer().style()->colorSpace(), imageRect);
+ context->drawImage(resizeCornerImage.get(), renderer().style().colorSpace(), imageRect);
}
void RenderLayer::paintResizer(GraphicsContext* context, const IntPoint& paintOffset, const IntRect& damageRect)
{
- if (renderer().style()->resize() == RESIZE_NONE)
+ if (renderer().style().resize() == RESIZE_NONE)
return;
RenderBox* box = renderBox();
@@ -3412,7 +3412,7 @@
ASSERT(box);
IntRect resizeControlRect;
- if (renderer().style()->resize() != RESIZE_NONE) {
+ if (renderer().style().resize() != RESIZE_NONE) {
resizeControlRect = resizerCornerRect(this, box->pixelSnappedBorderBoxRect());
if (resizeControlRect.contains(localPoint))
return true;
@@ -3505,10 +3505,10 @@
// any layers with overflow. The condition for being able to apply these clips is that the overflow object be in our
// containing block chain so we check that also.
for (RenderLayer* layer = rule == IncludeSelfForBorderRadius ? this : parent(); layer; layer = layer->parent()) {
- if (layer->renderer().hasOverflowClip() && layer->renderer().style()->hasBorderRadius() && inContainingBlockChain(this, layer)) {
+ if (layer->renderer().hasOverflowClip() && layer->renderer().style().hasBorderRadius() && inContainingBlockChain(this, layer)) {
LayoutPoint delta;
layer->convertToLayerCoords(rootLayer, delta);
- context->clipRoundedRect(layer->renderer().style()->getRoundedInnerBorderFor(LayoutRect(delta, layer->size())));
+ context->clipRoundedRect(layer->renderer().style().getRoundedInnerBorderFor(LayoutRect(delta, layer->size())));
}
if (layer == rootLayer)
@@ -3591,7 +3591,7 @@
} else if (viewportConstrainedNotCompositedReason() == NotCompositedForBoundsOutOfView) {
// Don't paint out-of-view viewport constrained layers (when doing prepainting) because they will never be visible
// unless their position or viewport size is changed.
- ASSERT(renderer().style()->position() == FixedPosition);
+ ASSERT(renderer().style().position() == FixedPosition);
return;
}
#endif
@@ -3702,11 +3702,11 @@
if (!renderer().hasClipPath() || context->paintingDisabled())
return false;
- RenderStyle* style = renderer().style();
+ RenderStyle& style = renderer().style();
- ASSERT(style->clipPath());
- if (style->clipPath()->type() == ClipPathOperation::SHAPE) {
- ShapeClipPathOperation* clipPath = static_cast<ShapeClipPathOperation*>(style->clipPath());
+ ASSERT(style.clipPath());
+ if (style.clipPath()->type() == ClipPathOperation::SHAPE) {
+ ShapeClipPathOperation* clipPath = static_cast<ShapeClipPathOperation*>(style.clipPath());
if (!rootRelativeBoundsComputed) {
rootRelativeBounds = calculateLayerBounds(paintingInfo.rootLayer, &offsetFromRoot, 0);
@@ -3719,8 +3719,8 @@
}
#if ENABLE(SVG)
- if (style->clipPath()->type() == ClipPathOperation::REFERENCE) {
- ReferenceClipPathOperation* referenceClipPathOperation = static_cast<ReferenceClipPathOperation*>(style->clipPath());
+ if (style.clipPath()->type() == ClipPathOperation::REFERENCE) {
+ ReferenceClipPathOperation* referenceClipPathOperation = static_cast<ReferenceClipPathOperation*>(style.clipPath());
Element* element = renderer().document().getElementById(referenceClipPathOperation->fragment());
if (element && element->hasTagName(SVGNames::clipPathTag) && element->renderer()) {
if (!rootRelativeBoundsComputed) {
@@ -4333,7 +4333,7 @@
// as canUseConvertToLayerCoords is true for this layer.
columnBlock.layer()->convertToLayerCoords(paintingInfo.rootLayer, layerOffset);
- bool isHorizontal = columnBlock.style()->isHorizontalWritingMode();
+ bool isHorizontal = columnBlock.style().isHorizontalWritingMode();
ColumnInfo* colInfo = columnBlock.columnInfo();
unsigned colCount = columnBlock.columnCount(colInfo);
@@ -4636,7 +4636,7 @@
}
// Check for hit test on backface if backface-visibility is 'hidden'
- if (localTransformState && renderer().style()->backfaceVisibility() == BackfaceVisibilityHidden) {
+ if (localTransformState && renderer().style().backfaceVisibility() == BackfaceVisibilityHidden) {
TransformationMatrix invertedMatrix = localTransformState->m_accumulatedTransform.inverse();
// If the z-vector of the matrix is negative, the back is facing towards the viewer.
if (invertedMatrix.m33() < 0)
@@ -4968,7 +4968,7 @@
int colCount = columnBlock.columnCount(colInfo);
// We have to go backwards from the last column to the first.
- bool isHorizontal = columnBlock.style()->isHorizontalWritingMode();
+ bool isHorizontal = columnBlock.style().isHorizontalWritingMode();
LayoutUnit logicalLeft = columnBlock.logicalLeftOffsetForContent();
LayoutUnit currLogicalTopOffset = columnBlock.initialBlockOffsetForPainting();
LayoutUnit blockDelta = columnBlock.blockDeltaForPaintingNextColumn();
@@ -5103,13 +5103,13 @@
// A fixed object is essentially the root of its containing block hierarchy, so when
// we encounter such an object, we reset our clip rects to the fixedClipRect.
- if (renderer().style()->position() == FixedPosition) {
+ if (renderer().style().position() == FixedPosition) {
clipRects.setPosClipRect(clipRects.fixedClipRect());
clipRects.setOverflowClipRect(clipRects.fixedClipRect());
clipRects.setFixed(true);
- } else if (renderer().style()->hasInFlowPosition())
+ } else if (renderer().style().hasInFlowPosition())
clipRects.setPosClipRect(clipRects.overflowClipRect());
- else if (renderer().style()->position() == AbsolutePosition)
+ else if (renderer().style().position() == AbsolutePosition)
clipRects.setOverflowClipRect(clipRects.posClipRect());
// Update the clip rects that will be passed to child layers.
@@ -5126,7 +5126,7 @@
if (renderer().hasOverflowClip()) {
ClipRect newOverflowClip = toRenderBox(renderer()).overflowClipRectForChildLayers(offset, clipRectsContext.region, clipRectsContext.overlayScrollbarSizeRelevancy);
- if (renderer().style()->hasBorderRadius())
+ if (renderer().style().hasBorderRadius())
newOverflowClip.setHasRadius(true);
clipRects.setOverflowClipRect(intersection(newOverflowClip, clipRects.overflowClipRect()));
if (renderer().isPositioned())
@@ -5179,7 +5179,7 @@
} else
parentClipRects(clipRectsContext, parentRects);
- ClipRect backgroundClipRect = backgroundClipRectForPosition(parentRects, renderer().style()->position());
+ ClipRect backgroundClipRect = backgroundClipRectForPosition(parentRects, renderer().style().position());
RenderView& view = renderer().view();
// Note: infinite clipRects should not be scrolled here, otherwise they will accidentally no longer be considered infinite.
@@ -5221,7 +5221,7 @@
// This layer establishes a clip of some kind.
if (renderer().hasOverflowClip() && (this != clipRectsContext.rootLayer || clipRectsContext.respectOverflowClip == RespectOverflowClip)) {
foregroundRect.intersect(toRenderBox(renderer()).overflowClipRect(offset, clipRectsContext.region, clipRectsContext.overlayScrollbarSizeRelevancy));
- if (renderer().style()->hasBorderRadius())
+ if (renderer().style().hasBorderRadius())
foregroundRect.setHasRadius(true);
}
@@ -5542,7 +5542,7 @@
// filtered areas with the outsets if we know that the filter is going to render in hardware.
// https://bugs.webkit.org/show_bug.cgi?id=81239
if (flags & IncludeLayerFilterOutsets)
- renderer().style()->filterOutsets().expandRect(unionBounds);
+ renderer().style().filterOutsets().expandRect(unionBounds);
#endif
if ((flags & IncludeSelfTransform) && paintsWithTransform(PaintBehaviorNormal)) {
@@ -5664,11 +5664,11 @@
// We can't use hasVisibleContent(), because that will be true if our renderer is hidden, but some child
// is visible and that child doesn't cover the entire rect.
- if (renderer().style()->visibility() != VISIBLE)
+ if (renderer().style().visibility() != VISIBLE)
return false;
#if ENABLE(CSS_FILTERS)
- if (paintsWithFilters() && renderer().style()->filter().hasFilterThatAffectsOpacity())
+ if (paintsWithFilters() && renderer().style().filter().hasFilterThatAffectsOpacity())
return false;
#endif
@@ -5955,7 +5955,7 @@
|| renderer().isVideo()
|| renderer().isEmbeddedObject()
|| renderer().isRenderIFrame()
- || (renderer().style()->specifiesColumns() && !isRootLayer()))
+ || (renderer().style().specifiesColumns() && !isRootLayer()))
&& !renderer().isPositioned()
&& !renderer().hasTransform()
&& !renderer().hasClipPath()
@@ -5967,7 +5967,7 @@
#endif
&& !isTransparent()
&& !needsCompositedScrolling()
- && !renderer().style()->hasFlowFrom()
+ && !renderer().style().hasFlowFrom()
;
}
@@ -6019,9 +6019,9 @@
return false;
}
-static bool hasBoxDecorations(const RenderStyle* style)
+static bool hasBoxDecorations(const RenderStyle& style)
{
- return style->hasBorder() || style->hasBorderRadius() || style->hasOutline() || style->hasAppearance() || style->boxShadow() || style->hasFilter();
+ return style.hasBorder() || style.hasBorderRadius() || style.hasOutline() || style.hasAppearance() || style.boxShadow() || style.hasFilter();
}
bool RenderLayer::hasBoxDecorationsOrBackground() const
@@ -6071,7 +6071,7 @@
// FIXME: RenderLayer already handles visibility changes through our visiblity dirty bits. This logic could
// likely be folded along with the rest.
- if (oldStyle->zIndex() != renderer().style()->zIndex() || oldStyle->visibility() != renderer().style()->visibility()) {
+ if (oldStyle->zIndex() != renderer().style().zIndex() || oldStyle->visibility() != renderer().style().visibility()) {
dirtyStackingContainerZOrderLists();
if (isStackingContext)
dirtyZOrderLists();
@@ -6096,11 +6096,11 @@
return;
// List box parts handle the scrollbars by themselves so we have nothing to do.
- if (box->style()->appearance() == ListboxPart)
+ if (box->style().appearance() == ListboxPart)
return;
- EOverflow overflowX = box->style()->overflowX();
- EOverflow overflowY = box->style()->overflowY();
+ EOverflow overflowX = box->style().overflowX();
+ EOverflow overflowY = box->style().overflowY();
// To avoid doing a relayout in updateScrollbarsAfterLayout, we try to keep any automatic scrollbar that was already present.
bool needsHorizontalScrollbar = (hasHorizontalScrollbar() && overflowDefinesAutomaticScrollbar(overflowX)) || overflowRequiresScrollbar(overflowX);
@@ -6187,7 +6187,7 @@
dirtyStackingContainerZOrderLists();
}
- if (renderer().style()->overflowX() == OMARQUEE && renderer().style()->marqueeBehavior() != MNONE && renderer().isBox()) {
+ if (renderer().style().overflowX() == OMARQUEE && renderer().style().marqueeBehavior() != MNONE && renderer().isBox()) {
if (!m_marquee)
m_marquee = adoptPtr(new RenderMarquee(this));
FeatureObserver::observe(&renderer().document(), renderer().isHTMLMarquee() ? FeatureObserver::HTMLMarqueeElement : FeatureObserver::CSSOverflowMarquee);
@@ -6235,10 +6235,10 @@
#if USE(ACCELERATED_COMPOSITING)
updateNeedsCompositedScrolling();
- const RenderStyle* newStyle = renderer().style();
+ const RenderStyle& newStyle = renderer().style();
if (compositor().updateLayerCompositingState(*this)
- || needsCompositingLayersRebuiltForClip(oldStyle, newStyle)
- || needsCompositingLayersRebuiltForOverflow(oldStyle, newStyle))
+ || needsCompositingLayersRebuiltForClip(oldStyle, &newStyle)
+ || needsCompositingLayersRebuiltForOverflow(oldStyle, &newStyle))
compositor().setCompositingLayersNeedRebuild();
else if (isComposited())
backing()->updateGraphicsLayerGeometry();
@@ -6246,9 +6246,9 @@
if (oldStyle) {
// Compositing layers keep track of whether they are clipped by any of the ancestors.
// When the current layer's clipping behaviour changes, we need to propagate it to the descendants.
- RenderStyle* style = renderer().style();
+ const RenderStyle& style = renderer().style();
bool wasClipping = oldStyle->hasClip() || oldStyle->overflowX() != OVISIBLE || oldStyle->overflowY() != OVISIBLE;
- bool isClipping = style->hasClip() || style->overflowX() != OVISIBLE || style->overflowY() != OVISIBLE;
+ bool isClipping = style.hasClip() || style.overflowX() != OVISIBLE || style.overflowY() != OVISIBLE;
if (isClipping != wasClipping) {
if (checkIfDescendantClippingContextNeedsUpdate(isClipping))
compositor().setCompositingLayersNeedRebuild();
@@ -6294,7 +6294,7 @@
void RenderLayer::updateScrollCornerStyle()
{
RenderElement* actualRenderer = rendererForScrollbar(renderer());
- RefPtr<RenderStyle> corner = renderer().hasOverflowClip() ? actualRenderer->getUncachedPseudoStyle(PseudoStyleRequest(SCROLLBAR_CORNER), actualRenderer->style()) : PassRefPtr<RenderStyle>(0);
+ RefPtr<RenderStyle> corner = renderer().hasOverflowClip() ? actualRenderer->getUncachedPseudoStyle(PseudoStyleRequest(SCROLLBAR_CORNER), &actualRenderer->style()) : PassRefPtr<RenderStyle>(0);
if (corner) {
if (!m_scrollCorner) {
m_scrollCorner = new RenderScrollbarPart(renderer().document(), corner.releaseNonNull());
@@ -6311,7 +6311,7 @@
void RenderLayer::updateResizerStyle()
{
RenderElement* actualRenderer = rendererForScrollbar(renderer());
- RefPtr<RenderStyle> resizer = renderer().hasOverflowClip() ? actualRenderer->getUncachedPseudoStyle(PseudoStyleRequest(RESIZER), actualRenderer->style()) : PassRefPtr<RenderStyle>(0);
+ RefPtr<RenderStyle> resizer = renderer().hasOverflowClip() ? actualRenderer->getUncachedPseudoStyle(PseudoStyleRequest(RESIZER), &actualRenderer->style()) : PassRefPtr<RenderStyle>(0);
if (resizer) {
if (!m_resizer) {
m_resizer = new RenderScrollbarPart(renderer().document(), resizer.releaseNonNull());
@@ -6351,36 +6351,36 @@
PassRef<RenderStyle> RenderLayer::createReflectionStyle()
{
auto newStyle = RenderStyle::create();
- newStyle.get().inheritFrom(renderer().style());
+ newStyle.get().inheritFrom(&renderer().style());
// Map in our transform.
TransformOperations transform;
- switch (renderer().style()->boxReflect()->direction()) {
+ switch (renderer().style().boxReflect()->direction()) {
case ReflectionBelow:
transform.operations().append(TranslateTransformOperation::create(Length(0, Fixed), Length(100., Percent), TransformOperation::TRANSLATE));
- transform.operations().append(TranslateTransformOperation::create(Length(0, Fixed), renderer().style()->boxReflect()->offset(), TransformOperation::TRANSLATE));
+ transform.operations().append(TranslateTransformOperation::create(Length(0, Fixed), renderer().style().boxReflect()->offset(), TransformOperation::TRANSLATE));
transform.operations().append(ScaleTransformOperation::create(1.0, -1.0, ScaleTransformOperation::SCALE));
break;
case ReflectionAbove:
transform.operations().append(ScaleTransformOperation::create(1.0, -1.0, ScaleTransformOperation::SCALE));
transform.operations().append(TranslateTransformOperation::create(Length(0, Fixed), Length(100., Percent), TransformOperation::TRANSLATE));
- transform.operations().append(TranslateTransformOperation::create(Length(0, Fixed), renderer().style()->boxReflect()->offset(), TransformOperation::TRANSLATE));
+ transform.operations().append(TranslateTransformOperation::create(Length(0, Fixed), renderer().style().boxReflect()->offset(), TransformOperation::TRANSLATE));
break;
case ReflectionRight:
transform.operations().append(TranslateTransformOperation::create(Length(100., Percent), Length(0, Fixed), TransformOperation::TRANSLATE));
- transform.operations().append(TranslateTransformOperation::create(renderer().style()->boxReflect()->offset(), Length(0, Fixed), TransformOperation::TRANSLATE));
+ transform.operations().append(TranslateTransformOperation::create(renderer().style().boxReflect()->offset(), Length(0, Fixed), TransformOperation::TRANSLATE));
transform.operations().append(ScaleTransformOperation::create(-1.0, 1.0, ScaleTransformOperation::SCALE));
break;
case ReflectionLeft:
transform.operations().append(ScaleTransformOperation::create(-1.0, 1.0, ScaleTransformOperation::SCALE));
transform.operations().append(TranslateTransformOperation::create(Length(100., Percent), Length(0, Fixed), TransformOperation::TRANSLATE));
- transform.operations().append(TranslateTransformOperation::create(renderer().style()->boxReflect()->offset(), Length(0, Fixed), TransformOperation::TRANSLATE));
+ transform.operations().append(TranslateTransformOperation::create(renderer().style().boxReflect()->offset(), Length(0, Fixed), TransformOperation::TRANSLATE));
break;
}
newStyle.get().setTransform(transform);
// Map in our mask.
- newStyle.get().setMaskBoxImage(renderer().style()->boxReflect()->mask());
+ newStyle.get().setMaskBoxImage(renderer().style().boxReflect()->mask());
return newStyle;
}
@@ -6455,15 +6455,15 @@
}
#if ENABLE(CSS_SHADERS)
- if (renderer().style()->filter().hasCustomFilter())
- FilterInfo::get(*this).updateCustomFilterClients(renderer().style()->filter());
+ if (renderer().style().filter().hasCustomFilter())
+ FilterInfo::get(*this).updateCustomFilterClients(renderer().style().filter());
else if (FilterInfo* filterInfo = FilterInfo::getIfExists(*this))
filterInfo->removeCustomFilterClients();
#endif
#if ENABLE(SVG)
- if (renderer().style()->filter().hasReferenceFilter())
- FilterInfo::get(*this).updateReferenceFilterClients(renderer().style()->filter());
+ if (renderer().style().filter().hasReferenceFilter())
+ FilterInfo::get(*this).updateReferenceFilterClients(renderer().style().filter());
else if (FilterInfo* filterInfo = FilterInfo::getIfExists(*this))
filterInfo->removeReferenceFilterClients();
#endif
@@ -6483,7 +6483,7 @@
// Early-return only if we *don't* have reference filters.
// For reference filters, we still want the FilterEffect graph built
// for us, even if we're composited.
- if (!renderer().style()->filter().hasReferenceFilter())
+ if (!renderer().style().filter().hasReferenceFilter())
return;
}
@@ -6500,7 +6500,7 @@
// If the filter fails to build, remove it from the layer. It will still attempt to
// go through regular processing (e.g. compositing), but never apply anything.
- if (!filterInfo.renderer()->build(&renderer(), computeFilterOperations(renderer().style()), FilterProperty))
+ if (!filterInfo.renderer()->build(&renderer(), computeFilterOperations(&renderer().style()), FilterProperty))
filterInfo.setRenderer(0);
}
diff --git a/Source/WebCore/rendering/RenderLayer.h b/Source/WebCore/rendering/RenderLayer.h
index 7f4457f..8fc21c2 100644
--- a/Source/WebCore/rendering/RenderLayer.h
+++ b/Source/WebCore/rendering/RenderLayer.h
@@ -487,7 +487,7 @@
void repaintBlockSelectionGaps();
// A stacking context is a layer that has a non-auto z-index.
- bool isStackingContext() const { return isStackingContext(renderer().style()); }
+ bool isStackingContext() const { return isStackingContext(&renderer().style()); }
// A stacking container can have z-order lists. All stacking contexts are
// stacking containers, but the converse is not true. Layers that use
@@ -599,7 +599,7 @@
void convertToLayerCoords(const RenderLayer* ancestorLayer, LayoutPoint&, ColumnOffsetAdjustment adjustForColumns = DontAdjustForColumns) const;
void convertToLayerCoords(const RenderLayer* ancestorLayer, LayoutRect&, ColumnOffsetAdjustment adjustForColumns = DontAdjustForColumns) const;
- int zIndex() const { return renderer().style()->zIndex(); }
+ int zIndex() const { return renderer().style().zIndex(); }
enum PaintLayerFlag {
PaintLayerHaveTransparency = 1,
@@ -695,7 +695,7 @@
#if ENABLE(CSS_FILTERS)
// If true, this layer's children are included in its bounds for overlap testing.
// We can't rely on the children's positions if this layer has a filter that could have moved the children's pixels around.
- bool overlapBoundsIncludeChildren() const { return hasFilter() && renderer().style()->filter().hasFilterThatMovesPixels(); }
+ bool overlapBoundsIncludeChildren() const { return hasFilter() && renderer().style().filter().hasFilterThatMovesPixels(); }
#else
bool overlapBoundsIncludeChildren() const { return false; }
#endif
@@ -732,7 +732,7 @@
// Note that this transform has the perspective-origin baked in.
TransformationMatrix perspectiveTransform() const;
FloatPoint perspectiveOrigin() const;
- bool preserves3D() const { return renderer().style()->transformStyle3D() == TransformStyle3DPreserve3D; }
+ bool preserves3D() const { return renderer().style().transformStyle3D() == TransformStyle3DPreserve3D; }
bool has3DTransform() const { return m_transform && !m_transform->isAffine(); }
#if ENABLE(CSS_FILTERS)
diff --git a/Source/WebCore/rendering/RenderLayerBacking.cpp b/Source/WebCore/rendering/RenderLayerBacking.cpp
index ac9d70c..711c64c 100644
--- a/Source/WebCore/rendering/RenderLayerBacking.cpp
+++ b/Source/WebCore/rendering/RenderLayerBacking.cpp
@@ -318,13 +318,13 @@
}
#endif
- updateOpacity(renderer().style());
- updateTransform(renderer().style());
+ updateOpacity(&renderer().style());
+ updateTransform(&renderer().style());
#if ENABLE(CSS_FILTERS)
- updateFilters(renderer().style());
+ updateFilters(&renderer().style());
#endif
#if ENABLE(CSS_COMPOSITING)
- updateLayerBlendMode(renderer().style());
+ updateLayerBlendMode(&renderer().style());
#endif
}
@@ -384,9 +384,9 @@
static bool hasNonZeroTransformOrigin(const RenderObject& renderer)
{
- RenderStyle* style = renderer.style();
- return (style->transformOriginX().type() == Fixed && style->transformOriginX().value())
- || (style->transformOriginY().type() == Fixed && style->transformOriginY().value());
+ const RenderStyle& style = renderer.style();
+ return (style.transformOriginX().type() == Fixed && style.transformOriginX().value())
+ || (style.transformOriginY().type() == Fixed && style.transformOriginY().value());
}
static bool layerOrAncestorIsTransformedOrUsingCompositedScrolling(RenderLayer& layer)
@@ -429,7 +429,7 @@
RenderLayer* rootLayer = view.layer();
LayoutRect clippingBounds;
- if (renderer().style()->position() == FixedPosition && renderer().container() == &view)
+ if (renderer().style().position() == FixedPosition && renderer().container() == &view)
clippingBounds = view.frameView().viewportConstrainedVisibleContentRect();
else
clippingBounds = view.unscaledDocumentRect();
@@ -600,18 +600,18 @@
// Set transform property, if it is not animating. We have to do this here because the transform
// is affected by the layer dimensions.
if (!renderer().animation().isRunningAcceleratedAnimationOnRenderer(&renderer(), CSSPropertyWebkitTransform))
- updateTransform(renderer().style());
+ updateTransform(&renderer().style());
// Set opacity, if it is not animating.
if (!renderer().animation().isRunningAcceleratedAnimationOnRenderer(&renderer(), CSSPropertyOpacity))
- updateOpacity(renderer().style());
+ updateOpacity(&renderer().style());
#if ENABLE(CSS_FILTERS)
- updateFilters(renderer().style());
+ updateFilters(&renderer().style());
#endif
#if ENABLE(CSS_COMPOSITING)
- updateLayerBlendMode(renderer().style());
+ updateLayerBlendMode(&renderer().style());
#endif
bool isSimpleContainer = isSimpleContainerCompositingLayer();
@@ -623,11 +623,11 @@
// non-compositing visible layers.
m_graphicsLayer->setContentsVisible(m_owningLayer.hasVisibleContent() || hasVisibleNonCompositingDescendantLayers());
- RenderStyle* style = renderer().style();
+ const RenderStyle& style = renderer().style();
// FIXME: reflections should force transform-style to be flat in the style: https://bugs.webkit.org/show_bug.cgi?id=106959
- bool preserves3D = style->transformStyle3D() == TransformStyle3DPreserve3D && !renderer().hasReflection();
+ bool preserves3D = style.transformStyle3D() == TransformStyle3DPreserve3D && !renderer().hasReflection();
m_graphicsLayer->setPreserves3D(preserves3D);
- m_graphicsLayer->setBackfaceVisibility(style->backfaceVisibility() == BackfaceVisibilityVisible);
+ m_graphicsLayer->setBackfaceVisibility(style.backfaceVisibility() == BackfaceVisibilityVisible);
RenderLayer* compAncestor = m_owningLayer.ancestorCompositingLayer();
@@ -739,9 +739,9 @@
else
m_graphicsLayer->setAnchorPoint(anchor);
- RenderStyle* style = renderer().style();
+ const RenderStyle& style = renderer().style();
GraphicsLayer* clipLayer = clippingLayer();
- if (style->hasPerspective()) {
+ if (style.hasPerspective()) {
TransformationMatrix t = owningLayer().perspectiveTransform();
if (clipLayer) {
@@ -1338,9 +1338,9 @@
// FIXME: When we support overflow areas, we will have to refine this for overflow areas that are also
// positon:fixed.
ScrollingNodeType nodeType;
- if (renderer().style()->position() == FixedPosition)
+ if (renderer().style().position() == FixedPosition)
nodeType = FixedNode;
- else if (renderer().style()->position() == StickyPosition)
+ else if (renderer().style().position() == StickyPosition)
nodeType = StickyNode;
else
nodeType = ScrollingNode;
@@ -1431,7 +1431,7 @@
if (backgroundRenderer->isRoot())
backgroundRenderer = backgroundRenderer->rendererForRootBackground();
- return backgroundRenderer->style()->visitedDependentColor(CSSPropertyBackgroundColor);
+ return backgroundRenderer->style().visitedDependentColor(CSSPropertyBackgroundColor);
}
void RenderLayerBacking::updateDirectlyCompositedBackgroundColor(bool isSimpleContainer, bool& didUpdateContentsRect)
@@ -1491,9 +1491,9 @@
if (isDirectlyCompositedImage())
return;
- const RenderStyle* style = renderer().style();
+ const RenderStyle& style = renderer().style();
- if (!isSimpleContainer || !style->hasBackgroundImage()) {
+ if (!isSimpleContainer || !style.hasBackgroundImage()) {
m_graphicsLayer->setContentsToImage(0);
return;
}
@@ -1502,7 +1502,7 @@
IntPoint phase;
IntSize tileSize;
- RefPtr<Image> image = style->backgroundLayers()->image()->cachedImage()->image();
+ RefPtr<Image> image = style.backgroundLayers()->image()->cachedImage()->image();
toRenderBox(renderer()).getGeometryForBackgroundImage(&m_owningLayer.renderer(), destRect, phase, tileSize);
m_graphicsLayer->setContentsTileSize(tileSize);
m_graphicsLayer->setContentsTilePhase(phase);
@@ -1540,7 +1540,7 @@
if (renderer.hasClip())
return false;
- if (hasBoxDecorationsOrBackgroundImage(renderer.style()))
+ if (hasBoxDecorationsOrBackgroundImage(&renderer.style()))
return false;
// FIXME: We can't create a directly composited background if this
@@ -1548,14 +1548,14 @@
// A better solution might be to introduce a flattening layer if
// we do direct box decoration composition.
// https://bugs.webkit.org/show_bug.cgi?id=119461
- if (hasPerspectiveOrPreserves3D(renderer.style()))
+ if (hasPerspectiveOrPreserves3D(&renderer.style()))
return false;
// FIXME: we should be able to allow backgroundComposite; However since this is not a common use case it has been deferred for now.
- if (renderer.style()->backgroundComposite() != CompositeSourceOver)
+ if (renderer.style().backgroundComposite() != CompositeSourceOver)
return false;
- if (renderer.style()->backgroundClip() == TextFillBox)
+ if (renderer.style().backgroundClip() == TextFillBox)
return false;
return true;
@@ -1623,7 +1623,7 @@
if (!rootObject)
return false;
- RenderStyle* style = rootObject->style();
+ RenderStyle* style = &rootObject->style();
// Reject anything that has a border, a border-radius or outline,
// or is not a simple background (no background, or solid color).
@@ -1636,7 +1636,7 @@
if (!bodyObject)
return false;
- style = bodyObject->style();
+ style = &bodyObject->style();
if (hasBoxDecorationsOrBackgroundImage(style))
return false;
@@ -1754,7 +1754,7 @@
return;
}
- if ((changeType == BackgroundImageChanged) && canCreateTiledImage(renderer().style()))
+ if ((changeType == BackgroundImageChanged) && canCreateTiledImage(&renderer().style()))
updateGraphicsLayerGeometry();
if ((changeType == MaskImageChanged) && m_maskLayer) {
@@ -1807,26 +1807,26 @@
FloatPoint3D RenderLayerBacking::computeTransformOrigin(const IntRect& borderBox) const
{
- RenderStyle* style = renderer().style();
+ const RenderStyle& style = renderer().style();
FloatPoint3D origin;
- origin.setX(floatValueForLength(style->transformOriginX(), borderBox.width()));
- origin.setY(floatValueForLength(style->transformOriginY(), borderBox.height()));
- origin.setZ(style->transformOriginZ());
+ origin.setX(floatValueForLength(style.transformOriginX(), borderBox.width()));
+ origin.setY(floatValueForLength(style.transformOriginY(), borderBox.height()));
+ origin.setZ(style.transformOriginZ());
return origin;
}
FloatPoint RenderLayerBacking::computePerspectiveOrigin(const IntRect& borderBox) const
{
- RenderStyle* style = renderer().style();
+ const RenderStyle& style = renderer().style();
float boxWidth = borderBox.width();
float boxHeight = borderBox.height();
FloatPoint origin;
- origin.setX(floatValueForLength(style->perspectiveOriginX(), boxWidth));
- origin.setY(floatValueForLength(style->perspectiveOriginY(), boxHeight));
+ origin.setX(floatValueForLength(style.perspectiveOriginX(), boxWidth));
+ origin.setY(floatValueForLength(style.perspectiveOriginY(), boxHeight));
return origin;
}
@@ -1861,7 +1861,7 @@
static LayoutRect backgroundRectForBox(const RenderBox& box)
{
- switch (box.style()->backgroundClip()) {
+ switch (box.style().backgroundClip()) {
case BorderFillBox:
return box.borderBoxRect();
case PaddingFillBox:
diff --git a/Source/WebCore/rendering/RenderLayerCompositor.cpp b/Source/WebCore/rendering/RenderLayerCompositor.cpp
index 4e642fe..31b8532 100644
--- a/Source/WebCore/rendering/RenderLayerCompositor.cpp
+++ b/Source/WebCore/rendering/RenderLayerCompositor.cpp
@@ -748,7 +748,7 @@
// If a fixed position layer gained/lost a backing or the reason not compositing it changed,
// the scrolling coordinator needs to recalculate whether it can do fast scrolling.
- if (layer.renderer().style()->position() == FixedPosition) {
+ if (layer.renderer().style().position() == FixedPosition) {
if (layer.viewportConstrainedNotCompositedReason() != viewportConstrainedNotCompositedReason) {
layer.setViewportConstrainedNotCompositedReason(viewportConstrainedNotCompositedReason);
layerChanged = true;
@@ -1816,7 +1816,7 @@
|| requiresCompositingForCanvas(*renderer)
|| requiresCompositingForPlugin(*renderer)
|| requiresCompositingForFrame(*renderer)
- || (canRender3DTransforms() && renderer->style()->backfaceVisibility() == BackfaceVisibilityHidden)
+ || (canRender3DTransforms() && renderer->style().backfaceVisibility() == BackfaceVisibilityHidden)
|| clipsCompositingDescendants(*renderer->layer())
|| requiresCompositingForAnimation(*renderer)
|| requiresCompositingForFilters(*renderer)
@@ -1858,7 +1858,7 @@
|| requiresCompositingForCanvas(renderer)
|| requiresCompositingForPlugin(renderer)
|| requiresCompositingForFrame(renderer)
- || (canRender3DTransforms() && renderer.style()->backfaceVisibility() == BackfaceVisibilityHidden)
+ || (canRender3DTransforms() && renderer.style().backfaceVisibility() == BackfaceVisibilityHidden)
|| requiresCompositingForAnimation(renderer)
|| requiresCompositingForFilters(renderer)
|| requiresCompositingForBlending(renderer)
@@ -1909,7 +1909,7 @@
else if (requiresCompositingForFrame(*renderer))
reasons |= CompositingReasonIFrame;
- if ((canRender3DTransforms() && renderer->style()->backfaceVisibility() == BackfaceVisibilityHidden))
+ if ((canRender3DTransforms() && renderer->style().backfaceVisibility() == BackfaceVisibilityHidden))
reasons |= CompositingReasonBackfaceVisibilityHidden;
if (clipsCompositingDescendants(*renderer->layer()))
@@ -1922,7 +1922,7 @@
reasons |= CompositingReasonFilters;
if (requiresCompositingForPosition(*renderer, *renderer->layer()))
- reasons |= renderer->style()->position() == FixedPosition ? CompositingReasonPositionFixed : CompositingReasonPositionSticky;
+ reasons |= renderer->style().position() == FixedPosition ? CompositingReasonPositionFixed : CompositingReasonPositionSticky;
if (requiresCompositingForOverflowScrolling(*renderer->layer()))
reasons |= CompositingReasonOverflowScrollingTouch;
@@ -2101,10 +2101,9 @@
if (!(m_compositingTriggers & ChromeClient::ThreeDTransformTrigger))
return false;
- RenderStyle* style = renderer.style();
// Note that we ask the renderer if it has a transform, because the style may have transforms,
// but the renderer may be an inline that doesn't suppport them.
- return renderer.hasTransform() && style->transform().has3DOperation();
+ return renderer.hasTransform() && renderer.style().transform().has3DOperation();
}
bool RenderLayerCompositor::requiresCompositingForVideo(RenderLayerModelObject& renderer) const
@@ -2229,12 +2228,12 @@
// A layer with preserve-3d or perspective only needs to be composited if there are descendant layers that
// will be affected by the preserve-3d or perspective.
if (has3DTransformedDescendants) {
- if (renderer.style()->transformStyle3D() == TransformStyle3DPreserve3D) {
+ if (renderer.style().transformStyle3D() == TransformStyle3DPreserve3D) {
reason = RenderLayer::IndirectCompositingForPreserve3D;
return true;
}
- if (renderer.style()->hasPerspective()) {
+ if (renderer.style().hasPerspective()) {
reason = RenderLayer::IndirectCompositingForPerspective;
return true;
}
@@ -2272,11 +2271,11 @@
if (layer.renderer().isStickyPositioned())
return !layer.enclosingOverflowClipLayer(ExcludeSelf);
- if (layer.renderer().style()->position() != FixedPosition)
+ if (layer.renderer().style().position() != FixedPosition)
return false;
for (RenderLayer* stackingContainer = layer.stackingContainer(); stackingContainer; stackingContainer = stackingContainer->stackingContainer()) {
- if (stackingContainer->isComposited() && stackingContainer->renderer().style()->position() == FixedPosition)
+ if (stackingContainer->isComposited() && stackingContainer->renderer().style().position() == FixedPosition)
return false;
}
@@ -2291,7 +2290,7 @@
if (!renderer.isPositioned())
return false;
- EPosition position = renderer.style()->position();
+ EPosition position = renderer.style().position();
bool isFixed = renderer.isOutOfFlowPositioned() && position == FixedPosition;
if (isFixed && !layer.isStackingContainer())
return false;
@@ -3043,12 +3042,9 @@
bool RenderLayerCompositor::layerHas3DContent(const RenderLayer& layer) const
{
- const RenderStyle* style = layer.renderer().style();
+ const RenderStyle& style = layer.renderer().style();
- if (style &&
- (style->transformStyle3D() == TransformStyle3DPreserve3D ||
- style->hasPerspective() ||
- style->transform().has3DOperation()))
+ if (style.transformStyle3D() == TransformStyle3DPreserve3D || style.hasPerspective() || style.transform().has3DOperation())
return true;
const_cast<RenderLayer&>(layer).updateLayerListsIfNeeded();
@@ -3131,25 +3127,25 @@
constraints.setLayerPositionAtLastLayout(graphicsLayer->position());
constraints.setViewportRectAtLastLayout(viewportRect);
- RenderStyle* style = layer.renderer().style();
- if (!style->left().isAuto())
+ const RenderStyle& style = layer.renderer().style();
+ if (!style.left().isAuto())
constraints.addAnchorEdge(ViewportConstraints::AnchorEdgeLeft);
- if (!style->right().isAuto())
+ if (!style.right().isAuto())
constraints.addAnchorEdge(ViewportConstraints::AnchorEdgeRight);
- if (!style->top().isAuto())
+ if (!style.top().isAuto())
constraints.addAnchorEdge(ViewportConstraints::AnchorEdgeTop);
- if (!style->bottom().isAuto())
+ if (!style.bottom().isAuto())
constraints.addAnchorEdge(ViewportConstraints::AnchorEdgeBottom);
// If left and right are auto, use left.
- if (style->left().isAuto() && style->right().isAuto())
+ if (style.left().isAuto() && style.right().isAuto())
constraints.addAnchorEdge(ViewportConstraints::AnchorEdgeLeft);
// If top and bottom are auto, use top.
- if (style->top().isAuto() && style->bottom().isAuto())
+ if (style.top().isAuto() && style.bottom().isAuto())
constraints.addAnchorEdge(ViewportConstraints::AnchorEdgeTop);
return constraints;
diff --git a/Source/WebCore/rendering/RenderLayerModelObject.cpp b/Source/WebCore/rendering/RenderLayerModelObject.cpp
index 791d511..5dbcc1e 100644
--- a/Source/WebCore/rendering/RenderLayerModelObject.cpp
+++ b/Source/WebCore/rendering/RenderLayerModelObject.cpp
@@ -77,7 +77,7 @@
void RenderLayerModelObject::willBeDestroyed()
{
if (isPositioned()) {
- if (style()->hasViewportConstrainedPosition())
+ if (style().hasViewportConstrainedPosition())
view().frameView().removeViewportConstrainedObject(this);
}
@@ -95,7 +95,7 @@
// If our z-index changes value or our visibility changes,
// we need to dirty our stacking context's z-order list.
- RenderStyle* oldStyle = hasInitializedStyle() ? style() : nullptr;
+ const RenderStyle* oldStyle = hasInitializedStyle() ? &style() : nullptr;
if (oldStyle) {
if (parent()) {
// Do a repaint with the old style first, e.g., for example if we go from
@@ -168,7 +168,7 @@
setChildNeedsLayout();
}
- bool newStyleIsViewportConstained = style()->hasViewportConstrainedPosition();
+ bool newStyleIsViewportConstained = style().hasViewportConstrainedPosition();
bool oldStyleIsViewportConstrained = oldStyle && oldStyle->hasViewportConstrainedPosition();
if (newStyleIsViewportConstained != oldStyleIsViewportConstrained) {
if (newStyleIsViewportConstained && layer())
diff --git a/Source/WebCore/rendering/RenderLineBoxList.cpp b/Source/WebCore/rendering/RenderLineBoxList.cpp
index 93a13e1..3b617f4 100644
--- a/Source/WebCore/rendering/RenderLineBoxList.cpp
+++ b/Source/WebCore/rendering/RenderLineBoxList.cpp
@@ -160,7 +160,7 @@
LayoutUnit physicalExtent = absoluteValue(physicalEnd - physicalStart);
physicalStart = min(physicalStart, physicalEnd);
- if (renderer->style()->isHorizontalWritingMode()) {
+ if (renderer->style().isHorizontalWritingMode()) {
physicalStart += offset.y();
if (physicalStart >= rect.maxY() || physicalStart + physicalExtent <= rect.y())
return false;
diff --git a/Source/WebCore/rendering/RenderLineBreak.cpp b/Source/WebCore/rendering/RenderLineBreak.cpp
index 370a1eaf..8cf2db8 100644
--- a/Source/WebCore/rendering/RenderLineBreak.cpp
+++ b/Source/WebCore/rendering/RenderLineBreak.cpp
@@ -50,20 +50,20 @@
LayoutUnit RenderLineBreak::lineHeight(bool firstLine, LineDirectionMode /*direction*/, LinePositionMode /*linePositionMode*/) const
{
if (firstLine && document().styleSheetCollection().usesFirstLineRules()) {
- const RenderStyle& firstLineStyle = *this->firstLineStyle();
- if (&firstLineStyle != style())
+ const RenderStyle& firstLineStyle = this->firstLineStyle();
+ if (&firstLineStyle != &style())
return firstLineStyle.computedLineHeight(&view());
}
if (m_cachedLineHeight == invalidLineHeight)
- m_cachedLineHeight = style()->computedLineHeight(&view());
+ m_cachedLineHeight = style().computedLineHeight(&view());
return m_cachedLineHeight;
}
int RenderLineBreak::baselinePosition(FontBaseline baselineType, bool firstLine, LineDirectionMode direction, LinePositionMode linePositionMode) const
{
- const RenderStyle& style = firstLine ? *firstLineStyle() : *this->style();
+ const RenderStyle& style = firstLine ? firstLineStyle() : this->style();
const FontMetrics& fontMetrics = style.fontMetrics();
return fontMetrics.ascent(baselineType) + (lineHeight(firstLine, direction, linePositionMode) - fontMetrics.height()) / 2;
}
@@ -155,7 +155,7 @@
float logicalLeftSide = m_inlineBoxWrapper->logicalLeft();
float logicalRightSide = m_inlineBoxWrapper->logicalRight();
- bool isHorizontal = style()->isHorizontalWritingMode();
+ bool isHorizontal = style().isHorizontalWritingMode();
float x = isHorizontal ? logicalLeftSide : m_inlineBoxWrapper->x();
float y = isHorizontal ? m_inlineBoxWrapper->y() : logicalLeftSide;
diff --git a/Source/WebCore/rendering/RenderListBox.cpp b/Source/WebCore/rendering/RenderListBox.cpp
index c0f0078..279062e 100644
--- a/Source/WebCore/rendering/RenderListBox.cpp
+++ b/Source/WebCore/rendering/RenderListBox.cpp
@@ -116,7 +116,7 @@
for (int i = 0; i < size; ++i) {
HTMLElement* element = listItems[i];
String text;
- Font itemFont = style()->font();
+ Font itemFont = style().font();
if (isHTMLOptionElement(element))
text = toHTMLOptionElement(element)->textIndentedToRespectGroupLabel();
else if (isHTMLOptGroupElement(element)) {
@@ -128,9 +128,9 @@
}
if (!text.isEmpty()) {
- applyTextTransform(style(), text, ' ');
+ applyTextTransform(&style(), text, ' ');
// FIXME: Why is this always LTR? Can't text direction affect the width?
- TextRun textRun = constructTextRun(this, itemFont, text, *style(), TextRun::AllowTrailingExpansion);
+ TextRun textRun = constructTextRun(this, itemFont, text, style(), TextRun::AllowTrailingExpansion);
textRun.disableRoundingHacks();
float textWidth = itemFont.width(textRun);
width = max(width, textWidth);
@@ -200,7 +200,7 @@
maxLogicalWidth = m_optionsWidth + 2 * optionsSpacingHorizontal;
if (m_vBar)
maxLogicalWidth += m_vBar->width();
- if (!style()->width().isPercent())
+ if (!style().width().isPercent())
minLogicalWidth = maxLogicalWidth;
}
@@ -211,19 +211,19 @@
m_minPreferredLogicalWidth = 0;
m_maxPreferredLogicalWidth = 0;
- if (style()->width().isFixed() && style()->width().value() > 0)
- m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(style()->width().value());
+ if (style().width().isFixed() && style().width().value() > 0)
+ m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(style().width().value());
else
computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth, m_maxPreferredLogicalWidth);
- if (style()->minWidth().isFixed() && style()->minWidth().value() > 0) {
- m_maxPreferredLogicalWidth = max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style()->minWidth().value()));
- m_minPreferredLogicalWidth = max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style()->minWidth().value()));
+ if (style().minWidth().isFixed() && style().minWidth().value() > 0) {
+ m_maxPreferredLogicalWidth = max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth().value()));
+ m_minPreferredLogicalWidth = max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth().value()));
}
- if (style()->maxWidth().isFixed()) {
- m_maxPreferredLogicalWidth = min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style()->maxWidth().value()));
- m_minPreferredLogicalWidth = min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style()->maxWidth().value()));
+ if (style().maxWidth().isFixed()) {
+ m_maxPreferredLogicalWidth = min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth().value()));
+ m_minPreferredLogicalWidth = min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth().value()));
}
LayoutUnit toAdd = borderAndPaddingWidth();
@@ -278,7 +278,7 @@
void RenderListBox::paintObject(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
- if (style()->visibility() != VISIBLE)
+ if (style().visibility() != VISIBLE)
return;
int listItemsSize = numItems();
@@ -385,7 +385,7 @@
RenderStyle* itemStyle = listItemElement->renderStyle();
if (!itemStyle)
- itemStyle = style();
+ itemStyle = &style();
if (itemStyle->visibility() == HIDDEN)
return;
@@ -396,9 +396,9 @@
itemText = toHTMLOptionElement(listItemElement)->textIndentedToRespectGroupLabel();
else if (isHTMLOptGroupElement(listItemElement))
itemText = toHTMLOptGroupElement(listItemElement)->groupLabelText();
- applyTextTransform(style(), itemText, ' ');
+ applyTextTransform(&style(), itemText, ' ');
- Color textColor = listItemElement->renderStyle() ? listItemElement->renderStyle()->visitedDependentColor(CSSPropertyColor) : style()->visitedDependentColor(CSSPropertyColor);
+ Color textColor = listItemElement->renderStyle() ? listItemElement->renderStyle()->visitedDependentColor(CSSPropertyColor) : style().visitedDependentColor(CSSPropertyColor);
if (isOptionElement && toHTMLOptionElement(listItemElement)->selected()) {
if (frame().selection().isFocusedAndActive() && document().focusedElement() == &selectElement())
textColor = theme()->activeListBoxSelectionForegroundColor();
@@ -411,7 +411,7 @@
paintInfo.context->setFillColor(textColor, colorSpace);
TextRun textRun(itemText, 0, 0, TextRun::AllowTrailingExpansion, itemStyle->direction(), isOverride(itemStyle->unicodeBidi()), true, TextRun::NoRounding);
- Font itemFont = style()->font();
+ Font itemFont = style().font();
LayoutRect r = itemBoundingBoxRect(paintOffset, listIndex);
r.move(itemOffsetForAlignment(textRun, itemStyle, itemFont, r));
@@ -438,11 +438,11 @@
else
backColor = theme()->inactiveListBoxSelectionBackgroundColor();
} else
- backColor = listItemElement->renderStyle() ? listItemElement->renderStyle()->visitedDependentColor(CSSPropertyBackgroundColor) : style()->visitedDependentColor(CSSPropertyBackgroundColor);
+ backColor = listItemElement->renderStyle() ? listItemElement->renderStyle()->visitedDependentColor(CSSPropertyBackgroundColor) : style().visitedDependentColor(CSSPropertyBackgroundColor);
// Draw the background for this list box item
if (!listItemElement->renderStyle() || listItemElement->renderStyle()->visibility() != HIDDEN) {
- ColorSpace colorSpace = listItemElement->renderStyle() ? listItemElement->renderStyle()->colorSpace() : style()->colorSpace();
+ ColorSpace colorSpace = listItemElement->renderStyle() ? listItemElement->renderStyle()->colorSpace() : style().colorSpace();
LayoutRect itemRect = itemBoundingBoxRect(paintOffset, listIndex);
itemRect.intersect(controlClipRect(paintOffset));
paintInfo.context->fillRect(pixelSnappedIntRect(itemRect), backColor, colorSpace);
@@ -601,7 +601,7 @@
bool RenderListBox::logicalScroll(ScrollLogicalDirection direction, ScrollGranularity granularity, float multiplier, Element**)
{
- return ScrollableArea::scroll(logicalToPhysical(direction, style()->isHorizontalWritingMode(), style()->isFlippedBlocksWritingMode()), granularity, multiplier);
+ return ScrollableArea::scroll(logicalToPhysical(direction, style().isHorizontalWritingMode(), style().isFlippedBlocksWritingMode()), granularity, multiplier);
}
void RenderListBox::valueChanged(unsigned listIndex)
@@ -637,7 +637,7 @@
LayoutUnit RenderListBox::itemHeight() const
{
- return style()->fontMetrics().height() + rowSpacing;
+ return style().fontMetrics().height() + rowSpacing;
}
int RenderListBox::verticalScrollbarWidth() const
@@ -805,7 +805,7 @@
PassRefPtr<Scrollbar> RenderListBox::createScrollbar()
{
RefPtr<Scrollbar> widget;
- bool hasCustomScrollbarStyle = style()->hasPseudoStyle(SCROLLBAR);
+ bool hasCustomScrollbarStyle = style().hasPseudoStyle(SCROLLBAR);
if (hasCustomScrollbarStyle)
widget = RenderScrollbar::createCustomScrollbar(this, VerticalScrollbar, &selectElement());
else {
diff --git a/Source/WebCore/rendering/RenderListItem.cpp b/Source/WebCore/rendering/RenderListItem.cpp
index 19ed66d..8ab5e38 100644
--- a/Source/WebCore/rendering/RenderListItem.cpp
+++ b/Source/WebCore/rendering/RenderListItem.cpp
@@ -55,12 +55,12 @@
{
RenderBlockFlow::styleDidChange(diff, oldStyle);
- if (style()->listStyleType() != NoneListStyle
- || (style()->listStyleImage() && !style()->listStyleImage()->errorOccurred())) {
+ if (style().listStyleType() != NoneListStyle
+ || (style().listStyleImage() && !style().listStyleImage()->errorOccurred())) {
auto newStyle = RenderStyle::create();
// The marker always inherits from the list item, regardless of where it might end
// up (e.g., in some deeply nested line box). See CSS3 spec.
- newStyle.get().inheritFrom(style());
+ newStyle.get().inheritFrom(&style());
if (!m_marker) {
m_marker = new RenderListMarker(*this, std::move(newStyle));
m_marker->initializeStyle();
@@ -350,7 +350,7 @@
LayoutUnit lineBottom = rootBox.lineBottom();
// FIXME: Need to account for relative positioning in the layout overflow.
- if (style()->isLeftToRightDirection()) {
+ if (style().isLeftToRightDirection()) {
LayoutUnit leftLineOffset = logicalLeftOffsetForLine(blockOffset, logicalLeftOffsetForLine(blockOffset, false), false);
markerLogicalLeft = leftLineOffset - lineOffset - paddingStart() - borderStart() + m_marker->marginStart();
m_marker->inlineBoxWrapper()->adjustLineDirectionPosition(markerLogicalLeft - markerOldLogicalLeft);
@@ -399,7 +399,7 @@
if (adjustOverflow) {
LayoutRect markerRect(markerLogicalLeft + lineOffset, blockOffset, m_marker->width(), m_marker->height());
- if (!style()->isHorizontalWritingMode())
+ if (!style().isHorizontalWritingMode())
markerRect = markerRect.transposedRect();
RenderBox* o = m_marker;
bool propagateVisualOverflow = true;
@@ -451,12 +451,12 @@
const String markerSuffix = m_marker->suffix();
StringBuilder result;
- if (!m_marker->style()->isLeftToRightDirection())
+ if (!m_marker->style().isLeftToRightDirection())
result.append(markerSuffix);
result.append(markerText);
- if (m_marker->style()->isLeftToRightDirection())
+ if (m_marker->style().isLeftToRightDirection())
result.append(markerSuffix);
return result.toString();
diff --git a/Source/WebCore/rendering/RenderListMarker.cpp b/Source/WebCore/rendering/RenderListMarker.cpp
index a7fc7d4..c4e3db5 100644
--- a/Source/WebCore/rendering/RenderListMarker.cpp
+++ b/Source/WebCore/rendering/RenderListMarker.cpp
@@ -1136,13 +1136,13 @@
{
RenderBox::styleDidChange(diff, oldStyle);
- if (oldStyle && (style()->listStylePosition() != oldStyle->listStylePosition() || style()->listStyleType() != oldStyle->listStyleType()))
+ if (oldStyle && (style().listStylePosition() != oldStyle->listStylePosition() || style().listStyleType() != oldStyle->listStyleType()))
setNeedsLayoutAndPrefWidthsRecalc();
- if (m_image != style()->listStyleImage()) {
+ if (m_image != style().listStyleImage()) {
if (m_image)
m_image->removeClient(this);
- m_image = style()->listStyleImage();
+ m_image = style().listStyleImage();
if (m_image)
m_image->addClient(this);
}
@@ -1166,8 +1166,8 @@
if (!box)
return LayoutRect(LayoutPoint(), size());
const RootInlineBox& rootBox = m_inlineBoxWrapper->root();
- LayoutUnit newLogicalTop = rootBox.blockFlow().style()->isFlippedBlocksWritingMode() ? m_inlineBoxWrapper->logicalBottom() - rootBox.selectionBottom() : rootBox.selectionTop() - m_inlineBoxWrapper->logicalTop();
- if (rootBox.blockFlow().style()->isHorizontalWritingMode())
+ LayoutUnit newLogicalTop = rootBox.blockFlow().style().isFlippedBlocksWritingMode() ? m_inlineBoxWrapper->logicalBottom() - rootBox.selectionBottom() : rootBox.selectionTop() - m_inlineBoxWrapper->logicalTop();
+ if (rootBox.blockFlow().style().isHorizontalWritingMode())
return LayoutRect(0, newLogicalTop, width(), rootBox.selectionHeight());
return LayoutRect(newLogicalTop, 0, rootBox.selectionHeight(), height());
}
@@ -1177,7 +1177,7 @@
if (paintInfo.phase != PaintPhaseForeground)
return;
- if (style()->visibility() != VISIBLE)
+ if (style().visibility() != VISIBLE)
return;
LayoutPoint boxOrigin(paintOffset + location());
@@ -1197,37 +1197,37 @@
if (isImage()) {
#if PLATFORM(MAC)
- if (style()->highlight() != nullAtom && !paintInfo.context->paintingDisabled())
- paintCustomHighlight(paintOffset, style()->highlight(), true);
+ if (style().highlight() != nullAtom && !paintInfo.context->paintingDisabled())
+ paintCustomHighlight(paintOffset, style().highlight(), true);
#endif
- context->drawImage(m_image->image(this, marker.size()).get(), style()->colorSpace(), marker);
+ context->drawImage(m_image->image(this, marker.size()).get(), style().colorSpace(), marker);
if (selectionState() != SelectionNone) {
LayoutRect selRect = localSelectionRect();
selRect.moveBy(boxOrigin);
- context->fillRect(pixelSnappedIntRect(selRect), selectionBackgroundColor(), style()->colorSpace());
+ context->fillRect(pixelSnappedIntRect(selRect), selectionBackgroundColor(), style().colorSpace());
}
return;
}
#if PLATFORM(MAC)
// FIXME: paint gap between marker and list item proper
- if (style()->highlight() != nullAtom && !paintInfo.context->paintingDisabled())
- paintCustomHighlight(paintOffset, style()->highlight(), true);
+ if (style().highlight() != nullAtom && !paintInfo.context->paintingDisabled())
+ paintCustomHighlight(paintOffset, style().highlight(), true);
#endif
if (selectionState() != SelectionNone) {
LayoutRect selRect = localSelectionRect();
selRect.moveBy(boxOrigin);
- context->fillRect(pixelSnappedIntRect(selRect), selectionBackgroundColor(), style()->colorSpace());
+ context->fillRect(pixelSnappedIntRect(selRect), selectionBackgroundColor(), style().colorSpace());
}
- const Color color(style()->visitedDependentColor(CSSPropertyColor));
- context->setStrokeColor(color, style()->colorSpace());
+ const Color color(style().visitedDependentColor(CSSPropertyColor));
+ context->setStrokeColor(color, style().colorSpace());
context->setStrokeStyle(SolidStroke);
context->setStrokeThickness(1.0f);
- context->setFillColor(color, style()->colorSpace());
+ context->setFillColor(color, style().colorSpace());
- EListStyleType type = style()->listStyleType();
+ EListStyleType type = style().listStyleType();
switch (type) {
case Disc:
context->drawEllipse(marker);
@@ -1323,11 +1323,11 @@
if (m_text.isEmpty())
return;
- const Font& font = style()->font();
- TextRun textRun = RenderBlock::constructTextRun(this, font, m_text, *style());
+ const Font& font = style().font();
+ TextRun textRun = RenderBlock::constructTextRun(this, font, m_text, style());
GraphicsContextStateSaver stateSaver(*context, false);
- if (!style()->isHorizontalWritingMode()) {
+ if (!style().isHorizontalWritingMode()) {
marker.moveBy(roundedIntPoint(-boxOrigin));
marker = marker.transposedRect();
marker.moveBy(IntPoint(roundToInt(box.x()), roundToInt(box.y() - logicalHeight())));
@@ -1337,7 +1337,7 @@
context->translate(-marker.x(), -marker.maxY());
}
- IntPoint textOrigin = IntPoint(marker.x(), marker.y() + style()->fontMetrics().ascent());
+ IntPoint textOrigin = IntPoint(marker.x(), marker.y() + style().fontMetrics().ascent());
if (type == Asterisks || type == Footnotes)
context->drawText(font, textRun, textOrigin);
@@ -1355,14 +1355,14 @@
}
const UChar suffix = listMarkerSuffix(type, m_listItem.value());
- if (style()->isLeftToRightDirection()) {
+ if (style().isLeftToRightDirection()) {
int width = font.width(textRun);
context->drawText(font, textRun, textOrigin);
UChar suffixSpace[2] = { suffix, ' ' };
- context->drawText(font, RenderBlock::constructTextRun(this, font, suffixSpace, 2, *style()), textOrigin + IntSize(width, 0));
+ context->drawText(font, RenderBlock::constructTextRun(this, font, suffixSpace, 2, style()), textOrigin + IntSize(width, 0));
} else {
UChar spaceSuffix[2] = { ' ', suffix };
- TextRun spaceSuffixRun = RenderBlock::constructTextRun(this, font, spaceSuffix, 2, *style());
+ TextRun spaceSuffixRun = RenderBlock::constructTextRun(this, font, spaceSuffix, 2, style());
int width = font.width(spaceSuffixRun);
context->drawText(font, spaceSuffixRun, textOrigin);
context->drawText(font, textRun, textOrigin + IntSize(width, 0));
@@ -1377,18 +1377,18 @@
if (isImage()) {
updateMarginsAndContent();
- setWidth(m_image->imageSize(this, style()->effectiveZoom()).width());
- setHeight(m_image->imageSize(this, style()->effectiveZoom()).height());
+ setWidth(m_image->imageSize(this, style().effectiveZoom()).width());
+ setHeight(m_image->imageSize(this, style().effectiveZoom()).height());
} else {
setLogicalWidth(minPreferredLogicalWidth());
- setLogicalHeight(style()->fontMetrics().height());
+ setLogicalHeight(style().fontMetrics().height());
}
setMarginStart(0);
setMarginEnd(0);
- Length startMargin = style()->marginStart();
- Length endMargin = style()->marginEnd();
+ Length startMargin = style().marginStart();
+ Length endMargin = style().marginEnd();
if (startMargin.isFixed())
setMarginStart(startMargin.value());
if (endMargin.isFixed())
@@ -1403,7 +1403,7 @@
if (o != m_image->data())
return;
- if (width() != m_image->imageSize(this, style()->effectiveZoom()).width() || height() != m_image->imageSize(this, style()->effectiveZoom()).height() || m_image->errorOccurred())
+ if (width() != m_image->imageSize(this, style().effectiveZoom()).width() || height() != m_image->imageSize(this, style().effectiveZoom()).height() || m_image->errorOccurred())
setNeedsLayoutAndPrefWidthsRecalc();
else
repaint();
@@ -1427,12 +1427,12 @@
if (isImage()) {
// FIXME: This is a somewhat arbitrary width. Generated images for markers really won't become particularly useful
// until we support the CSS3 marker pseudoclass to allow control over the width and height of the marker box.
- int bulletWidth = style()->fontMetrics().ascent() / 2;
- m_image->setContainerSizeForRenderer(this, IntSize(bulletWidth, bulletWidth), style()->effectiveZoom());
+ int bulletWidth = style().fontMetrics().ascent() / 2;
+ m_image->setContainerSizeForRenderer(this, IntSize(bulletWidth, bulletWidth), style().effectiveZoom());
return;
}
- EListStyleType type = style()->listStyleType();
+ EListStyleType type = style().listStyleType();
switch (type) {
case NoneListStyle:
break;
@@ -1529,17 +1529,17 @@
updateContent();
if (isImage()) {
- LayoutSize imageSize = m_image->imageSize(this, style()->effectiveZoom());
- m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = style()->isHorizontalWritingMode() ? imageSize.width() : imageSize.height();
+ LayoutSize imageSize = m_image->imageSize(this, style().effectiveZoom());
+ m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = style().isHorizontalWritingMode() ? imageSize.width() : imageSize.height();
setPreferredLogicalWidthsDirty(false);
updateMargins();
return;
}
- const Font& font = style()->font();
+ const Font& font = style().font();
LayoutUnit logicalWidth = 0;
- EListStyleType type = style()->listStyleType();
+ EListStyleType type = style().listStyleType();
switch (type) {
case NoneListStyle:
break;
@@ -1632,7 +1632,7 @@
else {
LayoutUnit itemWidth = font.width(m_text);
UChar suffixSpace[2] = { listMarkerSuffix(type, m_listItem.value()), ' ' };
- LayoutUnit suffixSpaceWidth = font.width(RenderBlock::constructTextRun(this, font, suffixSpace, 2, *style()));
+ LayoutUnit suffixSpaceWidth = font.width(RenderBlock::constructTextRun(this, font, suffixSpace, 2, style()));
logicalWidth = itemWidth + suffixSpaceWidth;
}
break;
@@ -1648,7 +1648,7 @@
void RenderListMarker::updateMargins()
{
- const FontMetrics& fontMetrics = style()->fontMetrics();
+ const FontMetrics& fontMetrics = style().fontMetrics();
LayoutUnit marginStart = 0;
LayoutUnit marginEnd = 0;
@@ -1656,7 +1656,7 @@
if (isInside()) {
if (isImage())
marginEnd = cMarkerPadding;
- else switch (style()->listStyleType()) {
+ else switch (style().listStyleType()) {
case Disc:
case Circle:
case Square:
@@ -1667,12 +1667,12 @@
break;
}
} else {
- if (style()->isLeftToRightDirection()) {
+ if (style().isLeftToRightDirection()) {
if (isImage())
marginStart = -minPreferredLogicalWidth() - cMarkerPadding;
else {
int offset = fontMetrics.ascent() * 2 / 3;
- switch (style()->listStyleType()) {
+ switch (style().listStyleType()) {
case Disc:
case Circle:
case Square:
@@ -1690,7 +1690,7 @@
marginEnd = cMarkerPadding;
else {
int offset = fontMetrics.ascent() * 2 / 3;
- switch (style()->listStyleType()) {
+ switch (style().listStyleType()) {
case Disc:
case Circle:
case Square:
@@ -1707,8 +1707,8 @@
}
- style()->setMarginStart(Length(marginStart, Fixed));
- style()->setMarginEnd(Length(marginEnd, Fixed));
+ style().setMarginStart(Length(marginStart, Fixed));
+ style().setMarginEnd(Length(marginEnd, Fixed));
}
LayoutUnit RenderListMarker::lineHeight(bool firstLine, LineDirectionMode direction, LinePositionMode linePositionMode) const
@@ -1727,7 +1727,7 @@
String RenderListMarker::suffix() const
{
- EListStyleType type = style()->listStyleType();
+ EListStyleType type = style().listStyleType();
const UChar suffix = listMarkerSuffix(type, m_listItem.value());
if (suffix == ' ')
@@ -1735,7 +1735,7 @@
// If the suffix is not ' ', an extra space is needed
UChar data[2];
- if (style()->isLeftToRightDirection()) {
+ if (style().isLeftToRightDirection()) {
data[0] = suffix;
data[1] = ' ';
} else {
@@ -1748,20 +1748,20 @@
bool RenderListMarker::isInside() const
{
- return m_listItem.notInList() || style()->listStylePosition() == INSIDE;
+ return m_listItem.notInList() || style().listStylePosition() == INSIDE;
}
IntRect RenderListMarker::getRelativeMarkerRect()
{
if (isImage())
- return IntRect(0, 0, m_image->imageSize(this, style()->effectiveZoom()).width(), m_image->imageSize(this, style()->effectiveZoom()).height());
+ return IntRect(0, 0, m_image->imageSize(this, style().effectiveZoom()).width(), m_image->imageSize(this, style().effectiveZoom()).height());
IntRect relativeRect;
- EListStyleType type = style()->listStyleType();
+ EListStyleType type = style().listStyleType();
switch (type) {
case Asterisks:
case Footnotes: {
- const Font& font = style()->font();
+ const Font& font = style().font();
relativeRect = IntRect(0, 0, font.width(m_text), font.fontMetrics().height());
break;
}
@@ -1769,7 +1769,7 @@
case Circle:
case Square: {
// FIXME: Are these particular rounding rules necessary?
- const FontMetrics& fontMetrics = style()->fontMetrics();
+ const FontMetrics& fontMetrics = style().fontMetrics();
int ascent = fontMetrics.ascent();
int bulletWidth = (ascent * 2 / 3 + 1) / 2;
relativeRect = IntRect(1, 3 * (ascent - ascent * 2 / 3) / 2, bulletWidth, bulletWidth);
@@ -1854,14 +1854,14 @@
case Urdu:
if (m_text.isEmpty())
return IntRect();
- const Font& font = style()->font();
+ const Font& font = style().font();
int itemWidth = font.width(m_text);
UChar suffixSpace[2] = { listMarkerSuffix(type, m_listItem.value()), ' ' };
- int suffixSpaceWidth = font.width(RenderBlock::constructTextRun(this, font, suffixSpace, 2, *style()));
+ int suffixSpaceWidth = font.width(RenderBlock::constructTextRun(this, font, suffixSpace, 2, style()));
relativeRect = IntRect(0, 0, itemWidth + suffixSpaceWidth, font.fontMetrics().height());
}
- if (!style()->isHorizontalWritingMode()) {
+ if (!style().isHorizontalWritingMode()) {
relativeRect = relativeRect.transposedRect();
relativeRect.setX(width() - relativeRect.x() - relativeRect.width());
}
diff --git a/Source/WebCore/rendering/RenderMarquee.cpp b/Source/WebCore/rendering/RenderMarquee.cpp
index 7dac87c..86fc0f1 100644
--- a/Source/WebCore/rendering/RenderMarquee.cpp
+++ b/Source/WebCore/rendering/RenderMarquee.cpp
@@ -73,7 +73,7 @@
int RenderMarquee::marqueeSpeed() const
{
- int result = m_layer->renderer().style()->marqueeSpeed();
+ int result = m_layer->renderer().style().marqueeSpeed();
Element* element = m_layer->renderer().element();
if (element && element->hasTagName(marqueeTag)) {
HTMLMarqueeElement* marqueeElement = static_cast<HTMLMarqueeElement*>(element);
@@ -86,8 +86,8 @@
{
// FIXME: Support the CSS3 "auto" value for determining the direction of the marquee.
// For now just map MAUTO to MBACKWARD
- EMarqueeDirection result = m_layer->renderer().style()->marqueeDirection();
- TextDirection dir = m_layer->renderer().style()->direction();
+ EMarqueeDirection result = m_layer->renderer().style().marqueeDirection();
+ TextDirection dir = m_layer->renderer().style().direction();
if (result == MAUTO)
result = MBACKWARD;
if (result == MFORWARD)
@@ -97,7 +97,7 @@
// Now we have the real direction. Next we check to see if the increment is negative.
// If so, then we reverse the direction.
- Length increment = m_layer->renderer().style()->marqueeIncrement();
+ Length increment = m_layer->renderer().style().marqueeIncrement();
if (increment.isNegative())
result = static_cast<EMarqueeDirection>(-result);
@@ -113,9 +113,9 @@
{
RenderBox* box = m_layer->renderBox();
ASSERT(box);
- RenderStyle* s = box->style();
+ RenderStyle& boxStyle = box->style();
if (isHorizontal()) {
- bool ltr = s->isLeftToRightDirection();
+ bool ltr = boxStyle.isLeftToRightDirection();
LayoutUnit clientWidth = box->clientWidth();
LayoutUnit contentWidth = ltr ? box->maxPreferredLogicalWidth() : box->minPreferredLogicalWidth();
if (ltr)
@@ -157,7 +157,7 @@
void RenderMarquee::start()
{
- if (m_timer.isActive() || m_layer->renderer().style()->marqueeIncrement().isZero())
+ if (m_timer.isActive() || m_layer->renderer().style().marqueeIncrement().isZero())
return;
// We may end up propagating a scroll event. It is important that we suspend events until
@@ -197,7 +197,7 @@
{
bool activate = (m_totalLoops <= 0 || m_currentLoop < m_totalLoops);
if (activate) {
- EMarqueeBehavior behavior = m_layer->renderer().style()->marqueeBehavior();
+ EMarqueeBehavior behavior = m_layer->renderer().style().marqueeBehavior();
m_start = computePosition(direction(), behavior == MALTERNATE);
m_end = computePosition(reverseDirection(), behavior == MALTERNATE || behavior == MSLIDE);
if (!m_stopped)
@@ -207,18 +207,18 @@
void RenderMarquee::updateMarqueeStyle()
{
- RenderStyle* s = m_layer->renderer().style();
+ RenderStyle& style = m_layer->renderer().style();
- if (m_direction != s->marqueeDirection() || (m_totalLoops != s->marqueeLoopCount() && m_currentLoop >= m_totalLoops))
+ if (m_direction != style.marqueeDirection() || (m_totalLoops != style.marqueeLoopCount() && m_currentLoop >= m_totalLoops))
m_currentLoop = 0; // When direction changes or our loopCount is a smaller number than our current loop, reset our loop.
- m_totalLoops = s->marqueeLoopCount();
- m_direction = s->marqueeDirection();
+ m_totalLoops = style.marqueeLoopCount();
+ m_direction = style.marqueeDirection();
if (m_layer->renderer().isHTMLMarquee()) {
// Hack for WinIE. In WinIE, a value of 0 or lower for the loop count for SLIDE means to only do
// one loop.
- if (m_totalLoops <= 0 && s->marqueeBehavior() == MSLIDE)
+ if (m_totalLoops <= 0 && style.marqueeBehavior() == MSLIDE)
m_totalLoops = 1;
// Hack alert: Set the white-space value to nowrap for horizontal marquees with inline children, thus ensuring
@@ -228,14 +228,14 @@
// marquee element.
// FIXME: Bring these up with the CSS WG.
if (isHorizontal() && m_layer->renderer().childrenInline()) {
- s->setWhiteSpace(NOWRAP);
- s->setTextAlign(TASTART);
+ style.setWhiteSpace(NOWRAP);
+ style.setTextAlign(TASTART);
}
}
// Legacy hack - multiple browsers default vertical marquees to 200px tall.
- if (!isHorizontal() && s->height().isAuto())
- s->setHeight(Length(200, Fixed));
+ if (!isHorizontal() && style.height().isAuto())
+ style.setHeight(Length(200, Fixed));
if (speed() != marqueeSpeed()) {
m_speed = marqueeSpeed();
@@ -265,7 +265,7 @@
return;
}
- RenderStyle* s = m_layer->renderer().style();
+ const RenderStyle& style = m_layer->renderer().style();
int endPoint = m_end;
int range = m_end - m_start;
@@ -274,7 +274,7 @@
newPos = m_end;
else {
bool addIncrement = direction() == MUP || direction() == MLEFT;
- bool isReversed = s->marqueeBehavior() == MALTERNATE && m_currentLoop % 2;
+ bool isReversed = style.marqueeBehavior() == MALTERNATE && m_currentLoop % 2;
if (isReversed) {
// We're going in the reverse direction.
endPoint = m_start;
@@ -283,7 +283,7 @@
}
bool positive = range > 0;
int clientSize = (isHorizontal() ? m_layer->renderBox()->clientWidth() : m_layer->renderBox()->clientHeight());
- int increment = abs(intValueForLength(m_layer->renderer().style()->marqueeIncrement(), clientSize));
+ int increment = abs(intValueForLength(m_layer->renderer().style().marqueeIncrement(), clientSize));
int currentPos = (isHorizontal() ? m_layer->scrollXOffset() : m_layer->scrollYOffset());
newPos = currentPos + (addIncrement ? increment : -increment);
if (positive)
@@ -296,7 +296,7 @@
m_currentLoop++;
if (m_totalLoops > 0 && m_currentLoop >= m_totalLoops)
m_timer.stop();
- else if (s->marqueeBehavior() != MALTERNATE)
+ else if (style.marqueeBehavior() != MALTERNATE)
m_reset = true;
}
diff --git a/Source/WebCore/rendering/RenderMedia.cpp b/Source/WebCore/rendering/RenderMedia.cpp
index 1b9dd17..3384f27 100644
--- a/Source/WebCore/rendering/RenderMedia.cpp
+++ b/Source/WebCore/rendering/RenderMedia.cpp
@@ -78,11 +78,11 @@
// When calling layout() on a child node, a parent must either push a LayoutStateMaintainter, or
// instantiate LayoutStateDisabler. Since using a LayoutStateMaintainer is slightly more efficient,
// and this method will be called many times per second during playback, use a LayoutStateMaintainer:
- LayoutStateMaintainer statePusher(&view(), this, locationOffset(), hasTransform() || hasReflection() || style()->isFlippedBlocksWritingMode());
+ LayoutStateMaintainer statePusher(&view(), this, locationOffset(), hasTransform() || hasReflection() || style().isFlippedBlocksWritingMode());
controlsRenderer->setLocation(LayoutPoint(borderLeft(), borderTop()) + LayoutSize(paddingLeft(), paddingTop()));
- controlsRenderer->style()->setHeight(Length(newSize.height(), Fixed));
- controlsRenderer->style()->setWidth(Length(newSize.width(), Fixed));
+ controlsRenderer->style().setHeight(Length(newSize.height(), Fixed));
+ controlsRenderer->style().setWidth(Length(newSize.width(), Fixed));
controlsRenderer->setNeedsLayout(MarkOnlyThis);
controlsRenderer->layout();
clearChildNeedsLayout();
diff --git a/Source/WebCore/rendering/RenderMediaControlElements.cpp b/Source/WebCore/rendering/RenderMediaControlElements.cpp
index 2e42bc5..916308a 100644
--- a/Source/WebCore/rendering/RenderMediaControlElements.cpp
+++ b/Source/WebCore/rendering/RenderMediaControlElements.cpp
@@ -44,7 +44,7 @@
{
RenderBlockFlow::layout();
- if (style()->display() == NONE || !nextSibling() || !nextSibling()->isBox())
+ if (style().display() == NONE || !nextSibling() || !nextSibling()->isBox())
return;
RenderBox* buttonBox = toRenderBox(nextSibling());
@@ -89,7 +89,7 @@
void RenderTextTrackContainerElement::layout()
{
RenderBlockFlow::layout();
- if (style()->display() == NONE)
+ if (style().display() == NONE)
return;
ASSERT(mediaControlElementType(element()) == MediaTextTrackDisplayContainer);
diff --git a/Source/WebCore/rendering/RenderMediaControls.cpp b/Source/WebCore/rendering/RenderMediaControls.cpp
index 7ea73f3..4a0a1d9 100644
--- a/Source/WebCore/rendering/RenderMediaControls.cpp
+++ b/Source/WebCore/rendering/RenderMediaControls.cpp
@@ -87,7 +87,7 @@
// Utility to scale when the UI part are not scaled by wkDrawMediaUIPart
static FloatRect getUnzoomedRectAndAdjustCurrentContext(RenderObject* o, const PaintInfo& paintInfo, const IntRect &originalRect)
{
- float zoomLevel = o->style()->effectiveZoom();
+ float zoomLevel = o->style().effectiveZoom();
FloatRect unzoomedRect(originalRect);
if (zoomLevel != 1.0f) {
unzoomedRect.setWidth(unzoomedRect.width() / zoomLevel);
@@ -226,7 +226,7 @@
static const int xOffset = -4;
static const int yOffset = 5;
- float zoomLevel = muteButtonBox->style()->effectiveZoom();
+ float zoomLevel = muteButtonBox->style().effectiveZoom();
int y = yOffset * zoomLevel + muteButtonBox->pixelSnappedOffsetHeight() - size.height();
FloatPoint absPoint = muteButtonBox->localToAbsolute(FloatPoint(muteButtonBox->pixelSnappedOffsetLeft(), y), IsFixed | UseTransforms);
if (absPoint.y() < 0)
diff --git a/Source/WebCore/rendering/RenderMenuList.cpp b/Source/WebCore/rendering/RenderMenuList.cpp
index 457115e..5bd6e2b 100644
--- a/Source/WebCore/rendering/RenderMenuList.cpp
+++ b/Source/WebCore/rendering/RenderMenuList.cpp
@@ -94,38 +94,38 @@
void RenderMenuList::adjustInnerStyle()
{
- RenderStyle* innerStyle = m_innerBlock->style();
- innerStyle->setFlexGrow(1);
- innerStyle->setFlexShrink(1);
+ RenderStyle& innerStyle = m_innerBlock->style();
+ innerStyle.setFlexGrow(1);
+ innerStyle.setFlexShrink(1);
// min-width: 0; is needed for correct shrinking.
// FIXME: Remove this line when https://bugs.webkit.org/show_bug.cgi?id=111790 is fixed.
- innerStyle->setMinWidth(Length(0, Fixed));
+ innerStyle.setMinWidth(Length(0, Fixed));
// Use margin:auto instead of align-items:center to get safe centering, i.e.
// when the content overflows, treat it the same as align-items: flex-start.
// But we only do that for the cases where html.css would otherwise use center.
- if (style()->alignItems() == AlignCenter) {
- innerStyle->setMarginTop(Length());
- innerStyle->setMarginBottom(Length());
- innerStyle->setAlignSelf(AlignFlexStart);
+ if (style().alignItems() == AlignCenter) {
+ innerStyle.setMarginTop(Length());
+ innerStyle.setMarginBottom(Length());
+ innerStyle.setAlignSelf(AlignFlexStart);
}
- innerStyle->setPaddingLeft(Length(theme()->popupInternalPaddingLeft(style()), Fixed));
- innerStyle->setPaddingRight(Length(theme()->popupInternalPaddingRight(style()), Fixed));
- innerStyle->setPaddingTop(Length(theme()->popupInternalPaddingTop(style()), Fixed));
- innerStyle->setPaddingBottom(Length(theme()->popupInternalPaddingBottom(style()), Fixed));
+ innerStyle.setPaddingLeft(Length(theme()->popupInternalPaddingLeft(&style()), Fixed));
+ innerStyle.setPaddingRight(Length(theme()->popupInternalPaddingRight(&style()), Fixed));
+ innerStyle.setPaddingTop(Length(theme()->popupInternalPaddingTop(&style()), Fixed));
+ innerStyle.setPaddingBottom(Length(theme()->popupInternalPaddingBottom(&style()), Fixed));
if (document().page()->chrome().selectItemWritingDirectionIsNatural()) {
// Items in the popup will not respect the CSS text-align and direction properties,
// so we must adjust our own style to match.
- innerStyle->setTextAlign(LEFT);
+ innerStyle.setTextAlign(LEFT);
TextDirection direction = (m_buttonText && m_buttonText->text()->defaultWritingDirection() == U_RIGHT_TO_LEFT) ? RTL : LTR;
- innerStyle->setDirection(direction);
+ innerStyle.setDirection(direction);
} else if (m_optionStyle && document().page()->chrome().selectItemAlignmentFollowsMenuWritingDirection()) {
- if ((m_optionStyle->direction() != innerStyle->direction() || m_optionStyle->unicodeBidi() != innerStyle->unicodeBidi()))
+ if ((m_optionStyle->direction() != innerStyle.direction() || m_optionStyle->unicodeBidi() != innerStyle.unicodeBidi()))
m_innerBlock->setNeedsLayoutAndPrefWidthsRecalc();
- innerStyle->setTextAlign(style()->isLeftToRightDirection() ? LEFT : RIGHT);
- innerStyle->setDirection(m_optionStyle->direction());
- innerStyle->setUnicodeBidi(m_optionStyle->unicodeBidi());
+ innerStyle.setTextAlign(style().isLeftToRightDirection() ? LEFT : RIGHT);
+ innerStyle.setDirection(m_optionStyle->direction());
+ innerStyle.setUnicodeBidi(m_optionStyle->unicodeBidi());
}
}
@@ -160,7 +160,7 @@
if (m_innerBlock) // RenderBlock handled updating the anonymous block's style.
adjustInnerStyle();
- bool fontChanged = !oldStyle || oldStyle->font() != style()->font();
+ bool fontChanged = !oldStyle || oldStyle->font() != style().font();
if (fontChanged) {
updateOptionsWidth();
m_needsOptionsWidthUpdate = false;
@@ -180,17 +180,17 @@
continue;
String text = toHTMLOptionElement(element)->textIndentedToRespectGroupLabel();
- applyTextTransform(style(), text, ' ');
+ applyTextTransform(&style(), text, ' ');
if (theme()->popupOptionSupportsTextIndent()) {
// Add in the option's text indent. We can't calculate percentage values for now.
float optionWidth = 0;
if (RenderStyle* optionStyle = element->renderStyle())
optionWidth += minimumValueForLength(optionStyle->textIndent(), 0);
if (!text.isEmpty())
- optionWidth += style()->font().width(text);
+ optionWidth += style().font().width(text);
maxOptionWidth = max(maxOptionWidth, optionWidth);
} else if (!text.isEmpty())
- maxOptionWidth = max(maxOptionWidth, style()->font().width(text));
+ maxOptionWidth = max(maxOptionWidth, style().font().width(text));
}
int width = static_cast<int>(ceilf(maxOptionWidth));
@@ -272,8 +272,8 @@
void RenderMenuList::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const
{
- maxLogicalWidth = max(m_optionsWidth, theme()->minimumMenuListSize(style())) + m_innerBlock->paddingLeft() + m_innerBlock->paddingRight();
- if (!style()->width().isPercent())
+ maxLogicalWidth = max(m_optionsWidth, theme()->minimumMenuListSize(&style())) + m_innerBlock->paddingLeft() + m_innerBlock->paddingRight();
+ if (!style().width().isPercent())
minLogicalWidth = maxLogicalWidth;
}
@@ -282,19 +282,19 @@
m_minPreferredLogicalWidth = 0;
m_maxPreferredLogicalWidth = 0;
- if (style()->width().isFixed() && style()->width().value() > 0)
- m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(style()->width().value());
+ if (style().width().isFixed() && style().width().value() > 0)
+ m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(style().width().value());
else
computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth, m_maxPreferredLogicalWidth);
- if (style()->minWidth().isFixed() && style()->minWidth().value() > 0) {
- m_maxPreferredLogicalWidth = max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style()->minWidth().value()));
- m_minPreferredLogicalWidth = max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style()->minWidth().value()));
+ if (style().minWidth().isFixed() && style().minWidth().value() > 0) {
+ m_maxPreferredLogicalWidth = max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth().value()));
+ m_minPreferredLogicalWidth = max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth().value()));
}
- if (style()->maxWidth().isFixed()) {
- m_maxPreferredLogicalWidth = min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style()->maxWidth().value()));
- m_minPreferredLogicalWidth = min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style()->maxWidth().value()));
+ if (style().maxWidth().isFixed()) {
+ m_maxPreferredLogicalWidth = min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth().value()));
+ m_minPreferredLogicalWidth = min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth().value()));
}
LayoutUnit toAdd = borderAndPaddingWidth();
@@ -393,7 +393,7 @@
else if (isHTMLOptionElement(element))
itemString = toHTMLOptionElement(element)->textIndentedToRespectGroupLabel();
- applyTextTransform(style(), itemString, ' ');
+ applyTextTransform(&style(), itemString, ' ');
return itemString;
}
@@ -473,7 +473,7 @@
{
const Vector<HTMLElement*>& listItems = selectElement().listItems();
if (listIndex >= listItems.size()) {
- itemBackgroundColor = style()->visitedDependentColor(CSSPropertyBackgroundColor);
+ itemBackgroundColor = style().visitedDependentColor(CSSPropertyBackgroundColor);
itemHasCustomBackgroundColor = false;
return;
}
@@ -490,7 +490,7 @@
}
// Otherwise, the item's background is overlayed on top of the menu background.
- backgroundColor = style()->visitedDependentColor(CSSPropertyBackgroundColor).blend(backgroundColor);
+ backgroundColor = style().visitedDependentColor(CSSPropertyBackgroundColor).blend(backgroundColor);
if (!backgroundColor.hasAlpha()) {
itemBackgroundColor = backgroundColor;
return;
@@ -502,9 +502,9 @@
PopupMenuStyle RenderMenuList::menuStyle() const
{
- RenderStyle* s = m_innerBlock ? m_innerBlock->style() : style();
- return PopupMenuStyle(s->visitedDependentColor(CSSPropertyColor), s->visitedDependentColor(CSSPropertyBackgroundColor), s->font(), s->visibility() == VISIBLE,
- s->display() == NONE, s->textIndent(), style()->direction(), isOverride(style()->unicodeBidi()));
+ const RenderStyle& styleToUse = m_innerBlock ? m_innerBlock->style() : style();
+ return PopupMenuStyle(styleToUse.visitedDependentColor(CSSPropertyColor), styleToUse.visitedDependentColor(CSSPropertyBackgroundColor), styleToUse.font(), styleToUse.visibility() == VISIBLE,
+ styleToUse.display() == NONE, styleToUse.textIndent(), style().direction(), isOverride(style().unicodeBidi()));
}
HostWindow* RenderMenuList::hostWindow() const
@@ -515,7 +515,7 @@
PassRefPtr<Scrollbar> RenderMenuList::createScrollbar(ScrollableArea* scrollableArea, ScrollbarOrientation orientation, ScrollbarControlSize controlSize)
{
RefPtr<Scrollbar> widget;
- bool hasCustomScrollbarStyle = style()->hasPseudoStyle(SCROLLBAR);
+ bool hasCustomScrollbarStyle = style().hasPseudoStyle(SCROLLBAR);
if (hasCustomScrollbarStyle)
widget = RenderScrollbar::createCustomScrollbar(scrollableArea, orientation, &selectElement());
else
@@ -541,7 +541,7 @@
const int endOfLinePadding = 2;
LayoutUnit RenderMenuList::clientPaddingRight() const
{
- if (style()->appearance() == MenulistPart || style()->appearance() == MenulistButtonPart) {
+ if (style().appearance() == MenulistPart || style().appearance() == MenulistButtonPart) {
// For these appearance values, the theme applies padding to leave room for the
// drop-down button. But leaving room for the button inside the popup menu itself
// looks strange, so we return a small default padding to avoid having a large empty
diff --git a/Source/WebCore/rendering/RenderMultiColumnBlock.cpp b/Source/WebCore/rendering/RenderMultiColumnBlock.cpp
index 93d2c4b..b60d666 100644
--- a/Source/WebCore/rendering/RenderMultiColumnBlock.cpp
+++ b/Source/WebCore/rendering/RenderMultiColumnBlock.cpp
@@ -49,7 +49,7 @@
{
RenderBlockFlow::styleDidChange(diff, oldStyle);
for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBox())
- child->setStyle(RenderStyle::createAnonymousStyleWithDisplay(style(), BLOCK));
+ child->setStyle(RenderStyle::createAnonymousStyleWithDisplay(&style(), BLOCK));
}
void RenderMultiColumnBlock::computeColumnCountAndWidth()
@@ -59,17 +59,17 @@
m_columnCount = 1;
m_columnWidth = contentLogicalWidth();
- ASSERT(!style()->hasAutoColumnCount() || !style()->hasAutoColumnWidth());
+ ASSERT(!style().hasAutoColumnCount() || !style().hasAutoColumnWidth());
LayoutUnit availWidth = m_columnWidth;
LayoutUnit colGap = columnGap();
- LayoutUnit colWidth = max<LayoutUnit>(1, LayoutUnit(style()->columnWidth()));
- int colCount = max<int>(1, style()->columnCount());
+ LayoutUnit colWidth = max<LayoutUnit>(1, LayoutUnit(style().columnWidth()));
+ int colCount = max<int>(1, style().columnCount());
- if (style()->hasAutoColumnWidth() && !style()->hasAutoColumnCount()) {
+ if (style().hasAutoColumnWidth() && !style().hasAutoColumnCount()) {
m_columnCount = colCount;
m_columnWidth = max<LayoutUnit>(0, (availWidth - ((m_columnCount - 1) * colGap)) / m_columnCount);
- } else if (!style()->hasAutoColumnWidth() && style()->hasAutoColumnCount()) {
+ } else if (!style().hasAutoColumnWidth() && style().hasAutoColumnCount()) {
m_columnCount = max<LayoutUnit>(1, (availWidth + colGap) / (colWidth + colGap));
m_columnWidth = ((availWidth + colGap) / m_columnCount) - colGap;
} else {
@@ -139,7 +139,7 @@
void RenderMultiColumnBlock::addChild(RenderObject* newChild, RenderObject* beforeChild)
{
if (!m_flowThread) {
- m_flowThread = new RenderMultiColumnFlowThread(document(), RenderStyle::createAnonymousStyleWithDisplay(style(), BLOCK));
+ m_flowThread = new RenderMultiColumnFlowThread(document(), RenderStyle::createAnonymousStyleWithDisplay(&style(), BLOCK));
m_flowThread->initializeStyle();
RenderBlockFlow::addChild(m_flowThread);
}
diff --git a/Source/WebCore/rendering/RenderMultiColumnBlock.h b/Source/WebCore/rendering/RenderMultiColumnBlock.h
index a87de03..ae47438 100644
--- a/Source/WebCore/rendering/RenderMultiColumnBlock.h
+++ b/Source/WebCore/rendering/RenderMultiColumnBlock.h
@@ -45,7 +45,7 @@
RenderMultiColumnFlowThread* flowThread() const { return m_flowThread; }
- bool requiresBalancing() const { return !m_columnHeightAvailable || style()->columnFill() == ColumnFillBalance; }
+ bool requiresBalancing() const { return !m_columnHeightAvailable || style().columnFill() == ColumnFillBalance; }
private:
virtual bool isRenderMultiColumnBlock() const { return true; }
diff --git a/Source/WebCore/rendering/RenderMultiColumnFlowThread.cpp b/Source/WebCore/rendering/RenderMultiColumnFlowThread.cpp
index de9c742..d37ea3f 100644
--- a/Source/WebCore/rendering/RenderMultiColumnFlowThread.cpp
+++ b/Source/WebCore/rendering/RenderMultiColumnFlowThread.cpp
@@ -86,7 +86,7 @@
invalidateRegions();
RenderMultiColumnBlock* parentBlock = toRenderMultiColumnBlock(parent());
- firstSet = new RenderMultiColumnSet(*this, RenderStyle::createAnonymousStyleWithDisplay(parentBlock->style(), BLOCK));
+ firstSet = new RenderMultiColumnSet(*this, RenderStyle::createAnonymousStyleWithDisplay(&parentBlock->style(), BLOCK));
firstSet->initializeStyle();
parentBlock->RenderBlock::addChild(firstSet);
diff --git a/Source/WebCore/rendering/RenderMultiColumnSet.cpp b/Source/WebCore/rendering/RenderMultiColumnSet.cpp
index 87a7fc5..dfd9268 100644
--- a/Source/WebCore/rendering/RenderMultiColumnSet.cpp
+++ b/Source/WebCore/rendering/RenderMultiColumnSet.cpp
@@ -151,7 +151,7 @@
void RenderMultiColumnSet::prepareForLayout()
{
RenderMultiColumnBlock* multicolBlock = toRenderMultiColumnBlock(parent());
- RenderStyle* multicolStyle = multicolBlock->style();
+ const RenderStyle& multicolStyle = multicolBlock->style();
// Set box logical top.
ASSERT(!previousSiblingBox() || !previousSiblingBox()->isRenderMultiColumnSet()); // FIXME: multiple set not implemented; need to examine previous set to calculate the correct logical top.
@@ -163,10 +163,10 @@
if (multicolBlock->requiresBalancing()) {
// Set maximum column height. We will not stretch beyond this.
m_maxColumnHeight = LayoutUnit::max();
- if (!multicolStyle->logicalHeight().isAuto())
- m_maxColumnHeight = multicolBlock->computeContentLogicalHeight(multicolStyle->logicalHeight());
- if (!multicolStyle->logicalMaxHeight().isUndefined()) {
- LayoutUnit logicalMaxHeight = multicolBlock->computeContentLogicalHeight(multicolStyle->logicalMaxHeight());
+ if (!multicolStyle.logicalHeight().isAuto())
+ m_maxColumnHeight = multicolBlock->computeContentLogicalHeight(multicolStyle.logicalHeight());
+ if (!multicolStyle.logicalMaxHeight().isUndefined()) {
+ LayoutUnit logicalMaxHeight = multicolBlock->computeContentLogicalHeight(multicolStyle.logicalMaxHeight());
if (m_maxColumnHeight > logicalMaxHeight)
m_maxColumnHeight = logicalMaxHeight;
}
@@ -190,9 +190,9 @@
// FIXME: Eventually we will cache the column gap when the widths of columns start varying, but for now we just
// go to the parent block to get the gap.
RenderMultiColumnBlock* parentBlock = toRenderMultiColumnBlock(parent());
- if (parentBlock->style()->hasNormalColumnGap())
- return parentBlock->style()->fontDescription().computedPixelSize(); // "1em" is recommended as the normal gap setting. Matches <p> margins.
- return parentBlock->style()->columnGap();
+ if (parentBlock->style().hasNormalColumnGap())
+ return parentBlock->style().fontDescription().computedPixelSize(); // "1em" is recommended as the normal gap setting. Matches <p> margins.
+ return parentBlock->style().columnGap();
}
unsigned RenderMultiColumnSet::columnCount() const
@@ -216,7 +216,7 @@
LayoutUnit colLogicalTop = borderAndPaddingBefore();
LayoutUnit colLogicalLeft = borderAndPaddingLogicalLeft();
LayoutUnit colGap = columnGap();
- if (style()->isLeftToRightDirection())
+ if (style().isLeftToRightDirection())
colLogicalLeft += index * (colLogicalWidth + colGap);
else
colLogicalLeft += contentLogicalWidth() - colLogicalWidth - index * (colLogicalWidth + colGap);
@@ -270,8 +270,8 @@
// This problem applies to regions and pages as well and is not unique to columns.
bool isFirstColumn = !index;
bool isLastColumn = index == colCount - 1;
- bool isLeftmostColumn = style()->isLeftToRightDirection() ? isFirstColumn : isLastColumn;
- bool isRightmostColumn = style()->isLeftToRightDirection() ? isLastColumn : isFirstColumn;
+ bool isLeftmostColumn = style().isLeftToRightDirection() ? isFirstColumn : isLastColumn;
+ bool isRightmostColumn = style().isLeftToRightDirection() ? isLastColumn : isFirstColumn;
// Calculate the overflow rectangle, based on the flow thread's, clipped at column logical
// top/bottom unless it's the first/last column.
@@ -295,7 +295,7 @@
void RenderMultiColumnSet::paintObject(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
- if (style()->visibility() != VISIBLE)
+ if (style().visibility() != VISIBLE)
return;
RenderBlock::paintObject(paintInfo, paintOffset);
@@ -316,11 +316,11 @@
if (paintInfo.context->paintingDisabled())
return;
- RenderStyle* blockStyle = toRenderMultiColumnBlock(parent())->style();
- const Color& ruleColor = blockStyle->visitedDependentColor(CSSPropertyWebkitColumnRuleColor);
- bool ruleTransparent = blockStyle->columnRuleIsTransparent();
- EBorderStyle ruleStyle = blockStyle->columnRuleStyle();
- LayoutUnit ruleThickness = blockStyle->columnRuleWidth();
+ const RenderStyle& blockStyle = toRenderMultiColumnBlock(parent())->style();
+ const Color& ruleColor = blockStyle.visitedDependentColor(CSSPropertyWebkitColumnRuleColor);
+ bool ruleTransparent = blockStyle.columnRuleIsTransparent();
+ EBorderStyle ruleStyle = blockStyle.columnRuleStyle();
+ LayoutUnit ruleThickness = blockStyle.columnRuleWidth();
LayoutUnit colGap = columnGap();
bool renderRule = ruleStyle > BHIDDEN && !ruleTransparent;
if (!renderRule)
@@ -332,7 +332,7 @@
bool antialias = shouldAntialiasLines(paintInfo.context);
- bool leftToRight = style()->isLeftToRightDirection();
+ bool leftToRight = style().isLeftToRightDirection();
LayoutUnit currLogicalLeftOffset = leftToRight ? LayoutUnit() : contentLogicalWidth();
LayoutUnit ruleAdd = borderAndPaddingLogicalLeft();
LayoutUnit ruleLogicalLeft = leftToRight ? LayoutUnit() : contentLogicalWidth();
@@ -473,11 +473,11 @@
// our column index.
LayoutPoint translationOffset;
LayoutUnit inlineOffset = i * (colLogicalWidth + colGap);
- if (!style()->isLeftToRightDirection())
+ if (!style().isLeftToRightDirection())
inlineOffset = -inlineOffset;
translationOffset.setX(inlineOffset);
LayoutUnit blockOffset = isHorizontalWritingMode() ? -flowThreadPortion.y() : -flowThreadPortion.x();
- if (isFlippedBlocksWritingMode(style()->writingMode()))
+ if (isFlippedBlocksWritingMode(style().writingMode()))
blockOffset = -blockOffset;
translationOffset.setY(blockOffset);
if (!isHorizontalWritingMode())
@@ -520,12 +520,12 @@
LayoutPoint translationOffset;
LayoutUnit inlineOffset = startColumn * (colLogicalWidth + colGap);
- if (!style()->isLeftToRightDirection())
+ if (!style().isLeftToRightDirection())
inlineOffset = -inlineOffset;
translationOffset.setX(inlineOffset);
LayoutUnit blockOffset = isHorizontalWritingMode() ? -flowThreadPortion.y() : -flowThreadPortion.x();
- if (isFlippedBlocksWritingMode(style()->writingMode()))
+ if (isFlippedBlocksWritingMode(style().writingMode()))
blockOffset = -blockOffset;
translationOffset.setY(blockOffset);
diff --git a/Source/WebCore/rendering/RenderNamedFlowFragment.cpp b/Source/WebCore/rendering/RenderNamedFlowFragment.cpp
index 7ee2749..842c78e 100644
--- a/Source/WebCore/rendering/RenderNamedFlowFragment.cpp
+++ b/Source/WebCore/rendering/RenderNamedFlowFragment.cpp
@@ -79,10 +79,10 @@
{
ASSERT(parent());
- RenderStyle* styleToUse = parent()->style();
- bool hasSpecifiedEndpointsForHeight = styleToUse->logicalTop().isSpecified() && styleToUse->logicalBottom().isSpecified();
+ const RenderStyle& styleToUse = parent()->style();
+ bool hasSpecifiedEndpointsForHeight = styleToUse.logicalTop().isSpecified() && styleToUse.logicalBottom().isSpecified();
bool hasAnchoredEndpointsForHeight = parent()->isOutOfFlowPositioned() && hasSpecifiedEndpointsForHeight;
- return styleToUse->logicalHeight().isAuto() && !hasAnchoredEndpointsForHeight;
+ return styleToUse.logicalHeight().isAuto() && !hasAnchoredEndpointsForHeight;
}
LayoutUnit RenderNamedFlowFragment::maxPageLogicalHeight() const
@@ -92,8 +92,8 @@
ASSERT(isAnonymous());
ASSERT(parent());
- RenderStyle* styleToUse = parent()->style();
- return styleToUse->logicalMaxHeight().isUndefined() ? RenderFlowThread::maxLogicalHeight() : toRenderBlock(parent())->computeReplacedLogicalHeightUsing(styleToUse->logicalMaxHeight());
+ const RenderStyle& styleToUse = parent()->style();
+ return styleToUse.logicalMaxHeight().isUndefined() ? RenderFlowThread::maxLogicalHeight() : toRenderBlock(parent())->computeReplacedLogicalHeightUsing(styleToUse.logicalMaxHeight());
}
} // namespace WebCore
diff --git a/Source/WebCore/rendering/RenderNamedFlowThread.cpp b/Source/WebCore/rendering/RenderNamedFlowThread.cpp
index 8c8c578..0cd9285 100644
--- a/Source/WebCore/rendering/RenderNamedFlowThread.cpp
+++ b/Source/WebCore/rendering/RenderNamedFlowThread.cpp
@@ -89,12 +89,12 @@
RenderRegion* firstRegion = m_regionList.first();
if (!firstRegion)
return;
- if (style()->writingMode() == firstRegion->style()->writingMode())
+ if (style().writingMode() == firstRegion->style().writingMode())
return;
// The first region defines the principal writing mode for the entire flow.
- auto newStyle = RenderStyle::clone(style());
- newStyle.get().setWritingMode(firstRegion->style()->writingMode());
+ auto newStyle = RenderStyle::clone(&style());
+ newStyle.get().setWritingMode(firstRegion->style().writingMode());
setStyle(std::move(newStyle));
}
@@ -196,21 +196,21 @@
// If the second region is contained in the first one, the first region is "less" if it's :before.
if (position & Node::DOCUMENT_POSITION_CONTAINED_BY) {
- ASSERT(secondRegion->style()->styleType() == NOPSEUDO);
- return firstRegion->style()->styleType() == BEFORE;
+ ASSERT(secondRegion->style().styleType() == NOPSEUDO);
+ return firstRegion->style().styleType() == BEFORE;
}
// If the second region contains the first region, the first region is "less" if the second is :after.
if (position & Node::DOCUMENT_POSITION_CONTAINS) {
- ASSERT(firstRegion->style()->styleType() == NOPSEUDO);
- return secondRegion->style()->styleType() == AFTER;
+ ASSERT(firstRegion->style().styleType() == NOPSEUDO);
+ return secondRegion->style().styleType() == AFTER;
}
return (position & Node::DOCUMENT_POSITION_FOLLOWING);
}
// FIXME: Currently it's not possible for an element to be both a region and have pseudo-children. The case is covered anyway.
- switch (firstRegion->style()->styleType()) {
+ switch (firstRegion->style().styleType()) {
case BEFORE:
// The second region can be the node or the after pseudo-element (before is smaller than any of those).
return true;
@@ -219,7 +219,7 @@
return false;
case NOPSEUDO:
// The second region can either be the before or the after pseudo-element (the node is only smaller than the after pseudo-element).
- return firstRegion->style()->styleType() == AFTER;
+ return firstRegion->style().styleType() == AFTER;
default:
break;
}
diff --git a/Source/WebCore/rendering/RenderObject.cpp b/Source/WebCore/rendering/RenderObject.cpp
index 4e4da19..422fe6f 100644
--- a/Source/WebCore/rendering/RenderObject.cpp
+++ b/Source/WebCore/rendering/RenderObject.cpp
@@ -528,7 +528,7 @@
bool RenderObject::fixedPositionedWithNamedFlowContainingBlock() const
{
return ((flowThreadState() == RenderObject::InsideOutOfFlowThread)
- && (style()->position() == FixedPosition)
+ && (style().position() == FixedPosition)
&& (containingBlock()->isOutOfFlowRenderFlowThread()));
}
@@ -596,7 +596,7 @@
if (!object->hasOverflowClip())
return false;
- if (object->style()->width().isIntrinsicOrAuto() || object->style()->height().isIntrinsicOrAuto() || object->style()->height().isPercent())
+ if (object->style().width().isIntrinsicOrAuto() || object->style().height().isIntrinsicOrAuto() || object->style().height().isPercent())
return false;
// Table parts can't be relayout roots since the table is responsible for layouting all the parts.
@@ -640,7 +640,7 @@
auto ancestor = container();
bool simplifiedNormalFlowLayout = needsSimplifiedNormalFlowLayout() && !selfNeedsLayout() && !normalChildNeedsLayout();
- bool hasOutOfFlowPosition = !isText() && style()->hasOutOfFlowPosition();
+ bool hasOutOfFlowPosition = !isText() && style().hasOutOfFlowPosition();
while (ancestor) {
#ifndef NDEBUG
@@ -681,7 +681,7 @@
if (scheduleRelayout && objectIsRelayoutBoundary(ancestor))
break;
- hasOutOfFlowPosition = ancestor->style()->hasOutOfFlowPosition();
+ hasOutOfFlowPosition = ancestor->style().hasOutOfFlowPosition();
ancestor = container;
}
@@ -703,7 +703,7 @@
{
bool alreadyDirty = preferredLogicalWidthsDirty();
m_bitfields.setPreferredLogicalWidthsDirty(shouldBeDirty);
- if (shouldBeDirty && !alreadyDirty && markParents == MarkContainingBlockChain && (isText() || !style()->hasOutOfFlowPosition()))
+ if (shouldBeDirty && !alreadyDirty && markParents == MarkContainingBlockChain && (isText() || !style().hasOutOfFlowPosition()))
invalidateContainerPreferredLogicalWidths();
}
@@ -720,7 +720,7 @@
break;
o->m_bitfields.setPreferredLogicalWidthsDirty(true);
- if (o->style()->hasOutOfFlowPosition())
+ if (o->style().hasOutOfFlowPosition())
// A positioned object has no effect on the min/max width of its containing block ever.
// We can optimize this case and not go up any further.
break;
@@ -746,10 +746,10 @@
if (!o && isRenderScrollbarPart())
o = toRenderScrollbarPart(this)->rendererOwningScrollbar();
- RenderStyle* style = this->style();
- if (!isText() && style->position() == FixedPosition)
+ const RenderStyle& style = this->style();
+ if (!isText() && style.position() == FixedPosition)
o = containingBlockForFixedPosition(o);
- else if (!isText() && style->position() == AbsolutePosition)
+ else if (!isText() && style.position() == AbsolutePosition)
o = containingBlockForAbsolutePosition(o);
else
o = containingBlockForObjectInFlow(o);
@@ -768,7 +768,7 @@
// Make sure we have a valid image.
StyleImage* image = layer->image();
- if (!image || !image->canRender(renderer, renderer->style()->effectiveZoom()))
+ if (!image || !image->canRender(renderer, renderer->style().effectiveZoom()))
return false;
if (!layer->xPosition().isZero() || !layer->yPosition().isZero())
@@ -794,26 +794,26 @@
bool RenderObject::borderImageIsLoadedAndCanBeRendered() const
{
- ASSERT(style()->hasBorder());
+ ASSERT(style().hasBorder());
- StyleImage* borderImage = style()->borderImage().image();
- return borderImage && borderImage->canRender(toRenderElement(this), style()->effectiveZoom()) && borderImage->isLoaded();
+ StyleImage* borderImage = style().borderImage().image();
+ return borderImage && borderImage->canRender(toRenderElement(this), style().effectiveZoom()) && borderImage->isLoaded();
}
bool RenderObject::mustRepaintBackgroundOrBorder() const
{
- if (hasMask() && mustRepaintFillLayers(this, style()->maskLayers()))
+ if (hasMask() && mustRepaintFillLayers(this, style().maskLayers()))
return true;
// If we don't have a background/border/mask, then nothing to do.
if (!hasBoxDecorations())
return false;
- if (mustRepaintFillLayers(this, style()->backgroundLayers()))
+ if (mustRepaintFillLayers(this, style().backgroundLayers()))
return true;
// Our fill layers are ok. Let's check border.
- if (style()->hasBorder() && borderImageIsLoadedAndCanBeRendered())
+ if (style().hasBorder() && borderImageIsLoadedAndCanBeRendered())
return true;
return false;
@@ -840,7 +840,7 @@
if (borderStyle == DOUBLE && thickness < 3)
borderStyle = SOLID;
- RenderStyle* style = this->style();
+ const RenderStyle& style = this->style();
switch (borderStyle) {
case BNONE:
case BHIDDEN:
@@ -851,7 +851,7 @@
bool wasAntialiased = graphicsContext->shouldAntialias();
StrokeStyle oldStrokeStyle = graphicsContext->strokeStyle();
graphicsContext->setShouldAntialias(antialias);
- graphicsContext->setStrokeColor(color, style->colorSpace());
+ graphicsContext->setStrokeColor(color, style.colorSpace());
graphicsContext->setStrokeThickness(thickness);
graphicsContext->setStrokeStyle(borderStyle == DASHED ? DashedStroke : DottedStroke);
@@ -877,7 +877,7 @@
if (adjacentWidth1 == 0 && adjacentWidth2 == 0) {
StrokeStyle oldStrokeStyle = graphicsContext->strokeStyle();
graphicsContext->setStrokeStyle(NoStroke);
- graphicsContext->setFillColor(color, style->colorSpace());
+ graphicsContext->setFillColor(color, style.colorSpace());
bool wasAntialiased = graphicsContext->shouldAntialias();
graphicsContext->setShouldAntialias(antialias);
@@ -999,7 +999,7 @@
case SOLID: {
StrokeStyle oldStrokeStyle = graphicsContext->strokeStyle();
graphicsContext->setStrokeStyle(NoStroke);
- graphicsContext->setFillColor(color, style->colorSpace());
+ graphicsContext->setFillColor(color, style.colorSpace());
ASSERT(x2 >= x1);
ASSERT(y2 >= y1);
if (!adjacentWidth1 && !adjacentWidth2) {
@@ -1075,19 +1075,19 @@
if (!hasOutline())
return;
- RenderStyle* styleToUse = style();
- LayoutUnit outlineWidth = styleToUse->outlineWidth();
+ RenderStyle& styleToUse = style();
+ LayoutUnit outlineWidth = styleToUse.outlineWidth();
- int outlineOffset = styleToUse->outlineOffset();
+ int outlineOffset = styleToUse.outlineOffset();
- if (styleToUse->outlineStyleIsAuto() || hasOutlineAnnotation()) {
- if (!theme()->supportsFocusRing(styleToUse)) {
+ if (styleToUse.outlineStyleIsAuto() || hasOutlineAnnotation()) {
+ if (!theme()->supportsFocusRing(&styleToUse)) {
// Only paint the focus ring by hand if the theme isn't able to draw the focus ring.
- paintFocusRing(paintInfo, paintRect.location(), styleToUse);
+ paintFocusRing(paintInfo, paintRect.location(), &styleToUse);
}
}
- if (styleToUse->outlineStyleIsAuto() || styleToUse->outlineStyle() == BNONE)
+ if (styleToUse.outlineStyleIsAuto() || styleToUse.outlineStyle() == BNONE)
return;
IntRect inner = pixelSnappedIntRect(paintRect);
@@ -1100,8 +1100,8 @@
if (outer.isEmpty())
return;
- EBorderStyle outlineStyle = styleToUse->outlineStyle();
- Color outlineColor = styleToUse->visitedDependentColor(CSSPropertyOutlineColor);
+ EBorderStyle outlineStyle = styleToUse.outlineStyle();
+ Color outlineColor = styleToUse.visitedDependentColor(CSSPropertyOutlineColor);
GraphicsContext* graphicsContext = paintInfo.context;
bool useTransparencyLayer = outlineColor.hasAlpha();
@@ -1111,7 +1111,7 @@
path.addRect(outer);
path.addRect(inner);
graphicsContext->setFillRule(RULE_EVENODD);
- graphicsContext->setFillColor(outlineColor, styleToUse->colorSpace());
+ graphicsContext->setFillColor(outlineColor, styleToUse.colorSpace());
graphicsContext->fillPath(path);
return;
}
@@ -1360,7 +1360,7 @@
bool fullRepaint = selfNeedsLayout();
// Presumably a background or a border exists if border-fit:lines was specified.
- if (!fullRepaint && style()->borderFit() == BorderFitLines)
+ if (!fullRepaint && style().borderFit() == BorderFitLines)
fullRepaint = true;
if (!fullRepaint) {
// This ASSERT fails due to animations. See https://bugs.webkit.org/show_bug.cgi?id=37048
@@ -1414,16 +1414,16 @@
// two rectangles (but typically only one).
RenderStyle* outlineStyle = outlineStyleForRepaint();
LayoutUnit outlineWidth = outlineStyle->outlineSize();
- LayoutBoxExtent insetShadowExtent = style()->getBoxShadowInsetExtent();
+ LayoutBoxExtent insetShadowExtent = style().getBoxShadowInsetExtent();
LayoutUnit width = absoluteValue(newOutlineBox.width() - oldOutlineBox.width());
if (width) {
LayoutUnit shadowLeft;
LayoutUnit shadowRight;
- style()->getBoxShadowHorizontalExtent(shadowLeft, shadowRight);
+ style().getBoxShadowHorizontalExtent(shadowLeft, shadowRight);
int borderRight = isBox() ? toRenderBox(this)->borderRight() : 0;
LayoutUnit boxWidth = isBox() ? toRenderBox(this)->width() : LayoutUnit();
LayoutUnit minInsetRightShadowExtent = min<LayoutUnit>(-insetShadowExtent.right(), min<LayoutUnit>(newBounds.width(), oldBounds.width()));
- LayoutUnit borderWidth = max<LayoutUnit>(borderRight, max<LayoutUnit>(valueForLength(style()->borderTopRightRadius().width(), boxWidth, &view()), valueForLength(style()->borderBottomRightRadius().width(), boxWidth)));
+ LayoutUnit borderWidth = max<LayoutUnit>(borderRight, max<LayoutUnit>(valueForLength(style().borderTopRightRadius().width(), boxWidth, &view()), valueForLength(style().borderBottomRightRadius().width(), boxWidth)));
LayoutUnit decorationsWidth = max<LayoutUnit>(-outlineStyle->outlineOffset(), borderWidth + minInsetRightShadowExtent) + max<LayoutUnit>(outlineWidth, shadowRight);
LayoutRect rightRect(newOutlineBox.x() + min(newOutlineBox.width(), oldOutlineBox.width()) - decorationsWidth,
newOutlineBox.y(),
@@ -1439,11 +1439,11 @@
if (height) {
LayoutUnit shadowTop;
LayoutUnit shadowBottom;
- style()->getBoxShadowVerticalExtent(shadowTop, shadowBottom);
+ style().getBoxShadowVerticalExtent(shadowTop, shadowBottom);
int borderBottom = isBox() ? toRenderBox(this)->borderBottom() : 0;
LayoutUnit boxHeight = isBox() ? toRenderBox(this)->height() : LayoutUnit();
LayoutUnit minInsetBottomShadowExtent = min<LayoutUnit>(-insetShadowExtent.bottom(), min<LayoutUnit>(newBounds.height(), oldBounds.height()));
- LayoutUnit borderHeight = max<LayoutUnit>(borderBottom, max<LayoutUnit>(valueForLength(style()->borderBottomLeftRadius().height(), boxHeight), valueForLength(style()->borderBottomRightRadius().height(), boxHeight, &view())));
+ LayoutUnit borderHeight = max<LayoutUnit>(borderBottom, max<LayoutUnit>(valueForLength(style().borderBottomLeftRadius().height(), boxHeight), valueForLength(style().borderBottomRightRadius().height(), boxHeight, &view())));
LayoutUnit decorationsHeight = max<LayoutUnit>(-outlineStyle->outlineOffset(), borderHeight + minInsetBottomShadowExtent) + max<LayoutUnit>(outlineWidth, shadowBottom);
LayoutRect bottomRect(newOutlineBox.x(),
min(newOutlineBox.maxY(), oldOutlineBox.maxY()) - decorationsHeight,
@@ -1572,9 +1572,9 @@
Color RenderObject::selectionBackgroundColor() const
{
Color color;
- if (style()->userSelect() != SELECT_NONE) {
+ if (style().userSelect() != SELECT_NONE) {
if (frame().selection().shouldShowBlockCursor() && frame().selection().isCaret())
- color = style()->visitedDependentColor(CSSPropertyColor).blendWithWhite();
+ color = style().visitedDependentColor(CSSPropertyColor).blendWithWhite();
else {
RefPtr<RenderStyle> pseudoStyle = getUncachedPseudoStyle(PseudoStyleRequest(SELECTION));
if (pseudoStyle && pseudoStyle->visitedDependentColor(CSSPropertyBackgroundColor).isValid())
@@ -1592,7 +1592,7 @@
Color color;
// If the element is unselectable, or we are only painting the selection,
// don't override the foreground color with the selection foreground color.
- if (style()->userSelect() == SELECT_NONE
+ if (style().userSelect() == SELECT_NONE
|| (view().frameView().paintBehavior() & PaintBehaviorSelectionOnly))
return color;
@@ -1628,7 +1628,7 @@
// We have gone from not affecting the inline status of the parent flow to suddenly
// having an impact. See if there is a mismatch between the parent flow's
// childrenInline() state and our state.
- setInline(style()->isDisplayInlineType());
+ setInline(style().isDisplayInlineType());
if (isInline() != parent()->childrenInline()) {
if (!isInline())
toRenderBoxModelObject(parent())->childBecameNonInline(this);
@@ -1650,7 +1650,7 @@
// FIXME: We should also handle split inlines here - we exclude them at the moment by returning
// if we find a continuation.
RenderObject* curr = parent()->firstChild();
- while (curr && ((curr->isAnonymousBlock() && !toRenderBlock(curr)->isAnonymousBlockContinuation()) || curr->style()->isFloating() || curr->style()->hasOutOfFlowPosition()))
+ while (curr && ((curr->isAnonymousBlock() && !toRenderBlock(curr)->isAnonymousBlockContinuation()) || curr->style().isFloating() || curr->style().hasOutOfFlowPosition()))
curr = curr->nextSibling();
if (curr)
@@ -1704,7 +1704,7 @@
// FIXME: this should call offsetFromContainer to share code, but I'm not sure it's ever called.
LayoutPoint centerPoint = roundedLayoutPoint(transformState.mappedPoint());
if (mode & ApplyContainerFlip && o->isBox()) {
- if (o->style()->isFlippedBlocksWritingMode())
+ if (o->style().isFlippedBlocksWritingMode())
transformState.move(toRenderBox(o)->flipForWritingModeIncludingColumns(roundedLayoutPoint(transformState.mappedPoint())) - centerPoint);
mode &= ~ApplyContainerFlip;
}
@@ -1753,7 +1753,7 @@
#if ENABLE(3D_RENDERING)
// hasTransform() indicates whether the object has transform, transform-style or perspective. We just care about transform,
// so check the layer's transform directly.
- return (hasLayer() && toRenderLayerModelObject(this)->layer()->transform()) || (containerObject && containerObject->style()->hasPerspective());
+ return (hasLayer() && toRenderLayerModelObject(this)->layer()->transform()) || (containerObject && containerObject->style().hasPerspective());
#else
UNUSED_PARAM(containerObject);
return hasTransform();
@@ -1769,13 +1769,13 @@
transform.multiply(layer->currentTransform());
#if ENABLE(3D_RENDERING)
- if (containerObject && containerObject->hasLayer() && containerObject->style()->hasPerspective()) {
+ if (containerObject && containerObject->hasLayer() && containerObject->style().hasPerspective()) {
// Perpsective on the container affects us, so we have to factor it in here.
ASSERT(containerObject->hasLayer());
FloatPoint perspectiveOrigin = toRenderLayerModelObject(containerObject)->layer()->perspectiveOrigin();
TransformationMatrix perspectiveMatrix;
- perspectiveMatrix.applyPerspective(containerObject->style()->perspective());
+ perspectiveMatrix.applyPerspective(containerObject->style().perspective());
transform.translateRight3d(-perspectiveOrigin.x(), -perspectiveOrigin.y(), 0);
transform = perspectiveMatrix * transform;
@@ -1885,7 +1885,7 @@
bool RenderObject::hasEntirelyFixedBackground() const
{
- return style()->hasEntirelyFixedBackground();
+ return style().hasEntirelyFixedBackground();
}
RenderElement* RenderObject::container(const RenderLayerModelObject* repaintContainer, bool* repaintContainerSkipped) const
@@ -1907,7 +1907,7 @@
if (isText())
return o;
- EPosition pos = style()->position();
+ EPosition pos = style().position();
if (pos == FixedPosition) {
// container() can be called on an object that is not in the
// tree yet. We don't call view() since it will assert if it
@@ -1937,7 +1937,7 @@
// Same goes here. We technically just want our containing block, but
// we may not have one if we're part of an uninstalled subtree. We'll
// climb as high as we can though.
- while (o && o->style()->position() == StaticPosition && !o->isRenderView() && !(o->hasTransform() && o->isRenderBlock())) {
+ while (o && o->style().position() == StaticPosition && !o->isRenderView() && !(o->hasTransform() && o->isRenderBlock())) {
#if ENABLE(SVG)
if (o->isSVGForeignObject()) // foreignObject is the containing block for contents inside it
break;
@@ -2116,7 +2116,7 @@
{
bool valueChanged = (dragOn != isDragging());
setIsDragging(dragOn);
- if (valueChanged && node() && (style()->affectedByDrag() || (node()->isElementNode() && toElement(node())->childrenAffectedByDrag())))
+ if (valueChanged && node() && (style().affectedByDrag() || (node()->isElementNode() && toElement(node())->childrenAffectedByDrag())))
node()->setNeedsStyleRecalc();
for (RenderObject* curr = firstChildSlow(); curr; curr = curr->nextSibling())
curr->updateDragState(dragOn);
@@ -2179,27 +2179,27 @@
RenderStyle* RenderObject::getCachedPseudoStyle(PseudoId pseudo, RenderStyle* parentStyle) const
{
- if (pseudo < FIRST_INTERNAL_PSEUDOID && !style()->hasPseudoStyle(pseudo))
+ if (pseudo < FIRST_INTERNAL_PSEUDOID && !style().hasPseudoStyle(pseudo))
return 0;
- RenderStyle* cachedStyle = style()->getCachedPseudoStyle(pseudo);
+ RenderStyle* cachedStyle = style().getCachedPseudoStyle(pseudo);
if (cachedStyle)
return cachedStyle;
RefPtr<RenderStyle> result = getUncachedPseudoStyle(PseudoStyleRequest(pseudo), parentStyle);
if (result)
- return style()->addCachedPseudoStyle(result.release());
+ return style().addCachedPseudoStyle(result.release());
return 0;
}
PassRefPtr<RenderStyle> RenderObject::getUncachedPseudoStyle(const PseudoStyleRequest& pseudoStyleRequest, RenderStyle* parentStyle, RenderStyle* ownStyle) const
{
- if (pseudoStyleRequest.pseudoId < FIRST_INTERNAL_PSEUDOID && !ownStyle && !style()->hasPseudoStyle(pseudoStyleRequest.pseudoId))
+ if (pseudoStyleRequest.pseudoId < FIRST_INTERNAL_PSEUDOID && !ownStyle && !style().hasPseudoStyle(pseudoStyleRequest.pseudoId))
return 0;
if (!parentStyle) {
ASSERT(!ownStyle);
- parentStyle = style();
+ parentStyle = &style();
}
// FIXME: This "find nearest element parent" should be a helper function.
@@ -2247,7 +2247,7 @@
TextDecoration currDecs = TextDecorationNone;
Color resultColor;
do {
- styleToUse = firstlineStyle ? curr->firstLineStyle() : curr->style();
+ styleToUse = firstlineStyle ? &curr->firstLineStyle() : &curr->style();
currDecs = styleToUse->textDecoration();
resultColor = decorationColor(styleToUse);
// Parameter 'decorations' is cast as an int to enable the bitwise operations below.
@@ -2274,7 +2274,7 @@
// If we bailed out, use the element we bailed out at (typically a <font> or <a> element).
if (decorations && curr) {
- styleToUse = firstlineStyle ? curr->firstLineStyle() : curr->style();
+ styleToUse = firstlineStyle ? &curr->firstLineStyle() : &curr->style();
resultColor = decorationColor(styleToUse);
if (decorations & TextDecorationUnderline)
underline = resultColor;
@@ -2289,14 +2289,14 @@
void RenderObject::addAnnotatedRegions(Vector<AnnotatedRegionValue>& regions)
{
// Convert the style regions to absolute coordinates.
- if (style()->visibility() != VISIBLE || !isBox())
+ if (style().visibility() != VISIBLE || !isBox())
return;
RenderBox* box = toRenderBox(this);
FloatPoint absPos = localToAbsolute();
#if ENABLE(DASHBOARD_SUPPORT)
- const Vector<StyleDashboardRegion>& styleRegions = style()->dashboardRegions();
+ const Vector<StyleDashboardRegion>& styleRegions = style().dashboardRegions();
unsigned i, count = styleRegions.size();
for (i = 0; i < count; i++) {
StyleDashboardRegion styleRegion = styleRegions[i];
@@ -2325,10 +2325,10 @@
regions.append(region);
}
#else // ENABLE(DRAGGABLE_REGION)
- if (style()->getDraggableRegionMode() == DraggableRegionNone)
+ if (style().getDraggableRegionMode() == DraggableRegionNone)
return;
AnnotatedRegionValue region;
- region.draggable = style()->getDraggableRegionMode() == DraggableRegionDrag;
+ region.draggable = style().getDraggableRegionMode() == DraggableRegionDrag;
region.bounds = LayoutRect(absPos.x(), absPos.y(), box->width(), box->height());
regions.append(region);
#endif
@@ -2350,7 +2350,7 @@
bool RenderObject::willRenderImage(CachedImage*)
{
// Without visibility we won't render (and therefore don't care about animation).
- if (style()->visibility() != VISIBLE)
+ if (style().visibility() != VISIBLE)
return false;
// We will not render a new image when Active DOM is suspended
@@ -2401,7 +2401,7 @@
void RenderObject::adjustRectForOutlineAndShadow(LayoutRect& rect) const
{
int outlineSize = outlineStyleForRepaint()->outlineSize();
- if (const ShadowData* boxShadow = style()->boxShadow()) {
+ if (const ShadowData* boxShadow = style().boxShadow()) {
boxShadow->adjustRectForShadow(rect, outlineSize);
return;
}
@@ -2425,7 +2425,7 @@
// A is the root element.
// A is the HTML body element.
// The computed value of the position property for element A is fixed.
- if (isRoot() || isBody() || (isOutOfFlowPositioned() && style()->position() == FixedPosition))
+ if (isRoot() || isBody() || (isOutOfFlowPositioned() && style().position() == FixedPosition))
return 0;
// If A is an area HTML element which has a map HTML element somewhere in the ancestor
@@ -2441,14 +2441,14 @@
// * Our own extension: if there is a difference in the effective zoom
bool skipTables = isPositioned();
- float currZoom = style()->effectiveZoom();
+ float currZoom = style().effectiveZoom();
auto curr = parent();
while (curr && (!curr->element() || (!curr->isPositioned() && !curr->isBody())) && !curr->isRenderNamedFlowThread()) {
Element* element = curr->element();
if (!skipTables && element && (isHTMLTableElement(element) || element->hasTagName(tdTag) || element->hasTagName(thTag)))
break;
- float newZoom = curr->style()->effectiveZoom();
+ float newZoom = curr->style().effectiveZoom();
if (currZoom != newZoom)
break;
currZoom = newZoom;
diff --git a/Source/WebCore/rendering/RenderObject.h b/Source/WebCore/rendering/RenderObject.h
index a3b2131..e7c35d8 100644
--- a/Source/WebCore/rendering/RenderObject.h
+++ b/Source/WebCore/rendering/RenderObject.h
@@ -476,7 +476,7 @@
// RenderBlock::createAnonymousBlock(). This includes creating an anonymous
// RenderBlock having a BLOCK or BOX display. Other classes such as RenderTextFragment
// are not RenderBlocks and will return false. See https://bugs.webkit.org/show_bug.cgi?id=56709.
- return isAnonymous() && (style()->display() == BLOCK || style()->display() == BOX) && style()->styleType() == NOPSEUDO && isRenderBlock() && !isListMarker() && !isRenderFlowThread() && !isRenderView()
+ return isAnonymous() && (style().display() == BLOCK || style().display() == BOX) && style().styleType() == NOPSEUDO && isRenderBlock() && !isListMarker() && !isRenderFlowThread() && !isRenderView()
#if ENABLE(FULLSCREEN_API)
&& !isRenderFullScreen()
&& !isRenderFullScreenPlaceholder()
@@ -486,8 +486,8 @@
#endif
;
}
- bool isAnonymousColumnsBlock() const { return style()->specifiesColumns() && isAnonymousBlock(); }
- bool isAnonymousColumnSpanBlock() const { return style()->columnSpan() && isAnonymousBlock(); }
+ bool isAnonymousColumnsBlock() const { return style().specifiesColumns() && isAnonymousBlock(); }
+ bool isAnonymousColumnSpanBlock() const { return style().columnSpan() && isAnonymousBlock(); }
bool isElementContinuation() const { return node() && node()->renderer() != this; }
bool isInlineElementContinuation() const { return isElementContinuation() && isInline(); }
bool isBlockElementContinuation() const { return isElementContinuation() && !isInline(); }
@@ -509,7 +509,7 @@
bool isBox() const { return m_bitfields.isBox(); }
bool isRenderView() const { return m_bitfields.isBox() && m_bitfields.isTextOrRenderView(); }
bool isInline() const { return m_bitfields.isInline(); } // inline object
- bool isRunIn() const { return style()->display() == RUN_IN; } // run-in object
+ bool isRunIn() const { return style().display() == RUN_IN; } // run-in object
bool isDragging() const { return m_bitfields.isDragging(); }
bool isReplaced() const { return m_bitfields.isReplaced(); } // a "replaced" element (see CSS)
bool isHorizontalWritingMode() const { return m_bitfields.horizontalWritingMode(); }
@@ -526,7 +526,7 @@
bool backgroundIsKnownToBeObscured();
bool borderImageIsLoadedAndCanBeRendered() const;
bool mustRepaintBackgroundOrBorder() const;
- bool hasBackground() const { return style()->hasBackground(); }
+ bool hasBackground() const { return style().hasBackground(); }
bool hasEntirelyFixedBackground() const;
bool needsLayout() const
@@ -551,23 +551,23 @@
bool isSelectionBorder() const;
- bool hasClip() const { return isOutOfFlowPositioned() && style()->hasClip(); }
+ bool hasClip() const { return isOutOfFlowPositioned() && style().hasClip(); }
bool hasOverflowClip() const { return m_bitfields.hasOverflowClip(); }
bool hasClipOrOverflowClip() const { return hasClip() || hasOverflowClip(); }
bool hasTransform() const { return m_bitfields.hasTransform(); }
- bool hasMask() const { return style() && style()->hasMask(); }
- bool hasClipPath() const { return style() && style()->clipPath(); }
- bool hasHiddenBackface() const { return style() && style()->backfaceVisibility() == BackfaceVisibilityHidden; }
+ bool hasMask() const { return style().hasMask(); }
+ bool hasClipPath() const { return style().clipPath(); }
+ bool hasHiddenBackface() const { return style().backfaceVisibility() == BackfaceVisibilityHidden; }
#if ENABLE(CSS_FILTERS)
- bool hasFilter() const { return style() && style()->hasFilter(); }
+ bool hasFilter() const { return style().hasFilter(); }
#else
bool hasFilter() const { return false; }
#endif
#if ENABLE(CSS_COMPOSITING)
- bool hasBlendMode() const { return style() && style()->hasBlendMode(); }
+ bool hasBlendMode() const { return style().hasBlendMode(); }
#else
bool hasBlendMode() const { return false; }
#endif
@@ -598,7 +598,7 @@
Frame& frame() const; // Defined in RenderView.h
bool hasOutlineAnnotation() const;
- bool hasOutline() const { return style()->hasOutline() || hasOutlineAnnotation(); }
+ bool hasOutline() const { return style().hasOutline() || hasOutlineAnnotation(); }
// Returns the object containing this one. Can be different from parent for positioned elements.
// If repaintContainer and repaintContainerSkipped are not null, on return *repaintContainerSkipped
@@ -717,12 +717,13 @@
virtual LayoutUnit minPreferredLogicalWidth() const { return 0; }
virtual LayoutUnit maxPreferredLogicalWidth() const { return 0; }
- RenderStyle* style() const;
- RenderStyle* firstLineStyle() const;
+ RenderStyle& style() const;
+ RenderStyle& firstLineStyle() const;
// Anonymous blocks that are part of of a continuation chain will return their inline continuation's outline style instead.
// This is typically only relevant when repainting.
- virtual RenderStyle* outlineStyleForRepaint() const { return style(); }
+ // FIXME: Return a reference.
+ virtual RenderStyle* outlineStyleForRepaint() const { return &const_cast<RenderStyle&>(style()); }
virtual CursorDirective getCursor(const LayoutPoint&, Cursor&) const;
@@ -784,8 +785,8 @@
bool isFloatingOrOutOfFlowPositioned() const { return (isFloating() || isOutOfFlowPositioned()); }
- bool isTransparent() const { return style()->opacity() < 1.0f; }
- float opacity() const { return style()->opacity(); }
+ bool isTransparent() const { return style().opacity() < 1.0f; }
+ float opacity() const { return style().opacity(); }
bool hasReflection() const { return m_bitfields.hasReflection(); }
@@ -869,7 +870,7 @@
AnimationController& animation() const;
- bool visibleToHitTesting() const { return style()->visibility() == VISIBLE && style()->pointerEvents() != PE_NONE; }
+ bool visibleToHitTesting() const { return style().visibility() == VISIBLE && style().pointerEvents() != PE_NONE; }
// Map points and quads through elements, potentially via 3d transforms. You should never need to call these directly; use
// localToAbsolute/absoluteToLocal methods instead.
@@ -1069,7 +1070,7 @@
// Text nodes don't have their own styles, so ignore the style on a text node.
if (isText())
return false;
- if (style()->styleType() != BEFORE)
+ if (style().styleType() != BEFORE)
return false;
return true;
}
@@ -1079,7 +1080,7 @@
// Text nodes don't have their own styles, so ignore the style on a text node.
if (isText())
return false;
- if (style()->styleType() != AFTER)
+ if (style().styleType() != AFTER)
return false;
return true;
}
@@ -1108,7 +1109,7 @@
return false;
#endif
- return style()->preserveNewline();
+ return style().preserveNewline();
}
inline void RenderObject::setSelectionStateIfNeeded(SelectionState state)
@@ -1148,13 +1149,13 @@
inline int adjustForAbsoluteZoom(int value, RenderObject* renderer)
{
- return adjustForAbsoluteZoom(value, renderer->style());
+ return adjustForAbsoluteZoom(value, &renderer->style());
}
#if ENABLE(SUBPIXEL_LAYOUT)
inline LayoutUnit adjustLayoutUnitForAbsoluteZoom(LayoutUnit value, RenderObject* renderer)
{
- return adjustLayoutUnitForAbsoluteZoom(value, renderer->style());
+ return adjustLayoutUnitForAbsoluteZoom(value, &renderer->style());
}
#endif
diff --git a/Source/WebCore/rendering/RenderProgress.cpp b/Source/WebCore/rendering/RenderProgress.cpp
index 2b5fe15..04ade8d 100644
--- a/Source/WebCore/rendering/RenderProgress.cpp
+++ b/Source/WebCore/rendering/RenderProgress.cpp
@@ -101,7 +101,7 @@
m_animationDuration = theme()->animationDurationForProgressBar(this);
m_animationRepeatInterval = theme()->animationRepeatIntervalForProgressBar(this);
- bool animating = style()->hasAppearance() && m_animationDuration > 0;
+ bool animating = style().hasAppearance() && m_animationDuration > 0;
if (animating == m_animating)
return;
diff --git a/Source/WebCore/rendering/RenderQuote.cpp b/Source/WebCore/rendering/RenderQuote.cpp
index b537afe..00b73bf 100644
--- a/Source/WebCore/rendering/RenderQuote.cpp
+++ b/Source/WebCore/rendering/RenderQuote.cpp
@@ -349,9 +349,9 @@
isOpenQuote = true;
// fall through
case CLOSE_QUOTE:
- if (const QuotesData* quotes = style()->quotes())
+ if (const QuotesData* quotes = style().quotes())
return isOpenQuote ? quotes->openQuote(m_depth).impl() : quotes->closeQuote(m_depth).impl();
- if (const QuotesForLanguage* quotes = quotesForLanguage(style()->locale()))
+ if (const QuotesForLanguage* quotes = quotesForLanguage(style().locale()))
return stringForQuoteCharacter(isOpenQuote ? (m_depth ? quotes->open2 : quotes->open1) : (m_depth ? quotes->close2 : quotes->close1));
// FIXME: Should the default be the quotes for "en" rather than straight quotes?
return m_depth ? apostropheString() : quotationMarkString();
diff --git a/Source/WebCore/rendering/RenderRegion.cpp b/Source/WebCore/rendering/RenderRegion.cpp
index 5759953..f26aeef 100644
--- a/Source/WebCore/rendering/RenderRegion.cpp
+++ b/Source/WebCore/rendering/RenderRegion.cpp
@@ -94,7 +94,7 @@
{
ASSERT(m_flowThread);
ASSERT(hasAutoLogicalHeight() && m_flowThread->inMeasureContentLayoutPhase());
- return style()->logicalMaxHeight().isUndefined() ? RenderFlowThread::maxLogicalHeight() : computeReplacedLogicalHeightUsing(style()->logicalMaxHeight());
+ return style().logicalMaxHeight().isUndefined() ? RenderFlowThread::maxLogicalHeight() : computeReplacedLogicalHeightUsing(style().logicalMaxHeight());
}
LayoutUnit RenderRegion::logicalHeightOfAllFlowThreadContent() const
@@ -118,9 +118,9 @@
// FIXME: Would like to just use hasOverflowClip() but we aren't a block yet. When RenderRegion is eliminated and
// folded into RenderBlock, switch to hasOverflowClip().
- bool clipX = style()->overflowX() != OVISIBLE;
- bool clipY = style()->overflowY() != OVISIBLE;
- bool isLastRegionWithRegionFragmentBreak = (isLastPortion && (style()->regionFragment() == BreakRegionFragment));
+ bool clipX = style().overflowX() != OVISIBLE;
+ bool clipY = style().overflowY() != OVISIBLE;
+ bool isLastRegionWithRegionFragmentBreak = (isLastPortion && (style().regionFragment() == BreakRegionFragment));
if ((clipX && clipY) || isLastRegionWithRegionFragmentBreak)
return flowThreadPortionRect;
@@ -192,7 +192,7 @@
void RenderRegion::paintObject(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
- if (style()->visibility() != VISIBLE)
+ if (style().visibility() != VISIBLE)
return;
RenderBlockFlow::paintObject(paintInfo, paintOffset);
@@ -278,9 +278,9 @@
bool RenderRegion::shouldHaveAutoLogicalHeight() const
{
- bool hasSpecifiedEndpointsForHeight = style()->logicalTop().isSpecified() && style()->logicalBottom().isSpecified();
+ bool hasSpecifiedEndpointsForHeight = style().logicalTop().isSpecified() && style().logicalBottom().isSpecified();
bool hasAnchoredEndpointsForHeight = isOutOfFlowPositioned() && hasSpecifiedEndpointsForHeight;
- return style()->logicalHeight().isAuto() && !hasAnchoredEndpointsForHeight;
+ return style().logicalHeight().isAuto() && !hasAnchoredEndpointsForHeight;
}
void RenderRegion::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
@@ -298,7 +298,7 @@
checkRegionStyle();
updateRegionHasAutoLogicalHeightFlag();
- if (oldStyle && oldStyle->writingMode() != style()->writingMode())
+ if (oldStyle && oldStyle->writingMode() != style().writingMode())
m_flowThread->regionChangedWritingMode(this);
}
@@ -388,7 +388,7 @@
void RenderRegion::installFlowThread()
{
- m_flowThread = &view().flowThreadController().ensureRenderFlowThreadWithName(style()->regionThread());
+ m_flowThread = &view().flowThreadController().ensureRenderFlowThreadWithName(style().regionThread());
// By now the flow thread should already be added to the rendering tree,
// so we go up the rendering parents and check that this region is not part of the same
@@ -497,7 +497,7 @@
// Start from content nodes and recursively compute the style in region for the render objects below.
// If the style in region was already computed, used that style instead of computing a new one.
- const RenderNamedFlowThread& namedFlow = view().flowThreadController().ensureRenderFlowThreadWithName(style()->regionThread());
+ const RenderNamedFlowThread& namedFlow = view().flowThreadController().ensureRenderFlowThreadWithName(style().regionThread());
const NamedFlowContentElements& contentElements = namedFlow.contentElements();
for (auto iter = contentElements.begin(), end = contentElements.end(); iter != end; ++iter) {
@@ -537,7 +537,7 @@
RenderObjectRegionStyleMap temp;
for (RenderObjectRegionStyleMap::iterator iter = m_renderObjectRegionStyle.begin(), end = m_renderObjectRegionStyle.end(); iter != end; ++iter) {
RenderObject* object = const_cast<RenderObject*>(iter->key);
- RefPtr<RenderStyle> objectRegionStyle = object->style();
+ RefPtr<RenderStyle> objectRegionStyle = &object->style();
RefPtr<RenderStyle> objectOriginalStyle = iter->value.style;
if (object->isRenderElement())
toRenderElement(object)->setStyleInternal(*objectOriginalStyle);
@@ -601,9 +601,9 @@
objectRegionStyleCached = true;
} else {
if (child->isAnonymous() || child->isInFlowRenderFlowThread())
- childStyleInRegion = RenderStyle::createAnonymousStyleWithDisplay(object->style(), child->style()->display());
+ childStyleInRegion = RenderStyle::createAnonymousStyleWithDisplay(&object->style(), child->style().display());
else if (child->isText())
- childStyleInRegion = RenderStyle::clone(object->style());
+ childStyleInRegion = RenderStyle::clone(&object->style());
else
childStyleInRegion = computeStyleInRegion(child);
}
@@ -619,16 +619,16 @@
{
ASSERT(object->flowThreadContainingBlock());
- RefPtr<RenderStyle> objectOriginalStyle = object->style();
+ RefPtr<RenderStyle> objectOriginalStyle = &object->style();
if (object->isRenderElement())
toRenderElement(object)->setStyleInternal(*styleInRegion);
if (object->isBoxModelObject() && !object->hasBoxDecorations()) {
bool hasBoxDecorations = object->isTableCell()
- || object->style()->hasBackground()
- || object->style()->hasBorder()
- || object->style()->hasAppearance()
- || object->style()->boxShadow();
+ || object->style().hasBackground()
+ || object->style().hasBorder()
+ || object->style().hasAppearance()
+ || object->style().boxShadow();
object->setHasBoxDecorations(hasBoxDecorations);
}
@@ -672,20 +672,20 @@
// It should also support other values, like percentage, calc or viewport relative.
m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = 0;
- RenderStyle* styleToUse = style();
- if (styleToUse->logicalWidth().isFixed() && styleToUse->logicalWidth().value() > 0)
- m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalWidth().value());
+ const RenderStyle& styleToUse = style();
+ if (styleToUse.logicalWidth().isFixed() && styleToUse.logicalWidth().value() > 0)
+ m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalWidth().value());
else
computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth, m_maxPreferredLogicalWidth);
- if (styleToUse->logicalMinWidth().isFixed() && styleToUse->logicalMinWidth().value() > 0) {
- m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMinWidth().value()));
- m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMinWidth().value()));
+ if (styleToUse.logicalMinWidth().isFixed() && styleToUse.logicalMinWidth().value() > 0) {
+ m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth().value()));
+ m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth().value()));
}
- if (styleToUse->logicalMaxWidth().isFixed()) {
- m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMaxWidth().value()));
- m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMaxWidth().value()));
+ if (styleToUse.logicalMaxWidth().isFixed()) {
+ m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMaxWidth().value()));
+ m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMaxWidth().value()));
}
LayoutUnit borderAndPadding = borderAndPaddingLogicalWidth();
@@ -696,7 +696,7 @@
void RenderRegion::getRanges(Vector<RefPtr<Range>>& rangeObjects) const
{
- const RenderNamedFlowThread& namedFlow = view().flowThreadController().ensureRenderFlowThreadWithName(style()->regionThread());
+ const RenderNamedFlowThread& namedFlow = view().flowThreadController().ensureRenderFlowThreadWithName(style().regionThread());
namedFlow.getRanges(rangeObjects, this);
}
@@ -773,9 +773,9 @@
if (this != endRegion)
mappedRect.setHeight(std::max<LayoutUnit>(0, std::min<LayoutUnit>(logicalBottomForFlowThreadContent() - mappedRect.y(), mappedRect.height())));
- bool clipX = style()->overflowX() != OVISIBLE;
- bool clipY = style()->overflowY() != OVISIBLE;
- bool isLastRegionWithRegionFragmentBreak = (isLastRegion() && (style()->regionFragment() == BreakRegionFragment));
+ bool clipX = style().overflowX() != OVISIBLE;
+ bool clipY = style().overflowY() != OVISIBLE;
+ bool isLastRegionWithRegionFragmentBreak = (isLastRegion() && (style().regionFragment() == BreakRegionFragment));
if ((clipX && clipY) || isLastRegionWithRegionFragmentBreak)
mappedRect.intersect(flowThreadPortionRect());
diff --git a/Source/WebCore/rendering/RenderReplaced.cpp b/Source/WebCore/rendering/RenderReplaced.cpp
index db8dffb..f631ae8 100644
--- a/Source/WebCore/rendering/RenderReplaced.cpp
+++ b/Source/WebCore/rendering/RenderReplaced.cpp
@@ -81,7 +81,7 @@
bool hadStyle = (oldStyle != 0);
float oldZoom = hadStyle ? oldStyle->effectiveZoom() : RenderStyle::initialZoom();
- if (style() && style()->effectiveZoom() != oldZoom)
+ if (style().effectiveZoom() != oldZoom)
intrinsicSizeChanged();
}
@@ -108,8 +108,8 @@
void RenderReplaced::intrinsicSizeChanged()
{
- int scaledWidth = static_cast<int>(cDefaultWidth * style()->effectiveZoom());
- int scaledHeight = static_cast<int>(cDefaultHeight * style()->effectiveZoom());
+ int scaledWidth = static_cast<int>(cDefaultWidth * style().effectiveZoom());
+ int scaledHeight = static_cast<int>(cDefaultHeight * style().effectiveZoom());
m_intrinsicSize = IntSize(scaledWidth, scaledHeight);
setNeedsLayoutAndPrefWidthsRecalc();
}
@@ -130,7 +130,7 @@
}
LayoutRect paintRect = LayoutRect(adjustedPaintOffset, size());
- if ((paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSelfOutline) && style()->outlineWidth())
+ if ((paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSelfOutline) && style().outlineWidth())
paintOutline(paintInfo, paintRect);
if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhaseSelection && !canHaveChildren())
@@ -147,7 +147,7 @@
}
bool completelyClippedOut = false;
- if (style()->hasBorderRadius()) {
+ if (style().hasBorderRadius()) {
LayoutRect borderRect = LayoutRect(adjustedPaintOffset, size());
if (borderRect.isEmpty())
@@ -155,7 +155,7 @@
else {
// Push a clip if we have a border radius, since we want to round the foreground content that gets painted.
paintInfo.context->save();
- RoundedRect roundedInnerRect = style()->getRoundedInnerBorderFor(paintRect,
+ RoundedRect roundedInnerRect = style().getRoundedInnerBorderFor(paintRect,
paddingTop() + borderTop(), paddingBottom() + borderBottom(), paddingLeft() + borderLeft(), paddingRight() + borderRight(), true, true);
clipRoundedInnerRect(paintInfo.context, paintRect, roundedInnerRect);
}
@@ -164,7 +164,7 @@
if (!completelyClippedOut) {
paintReplaced(paintInfo, adjustedPaintOffset);
- if (style()->hasBorderRadius())
+ if (style().hasBorderRadius())
paintInfo.context->restore();
}
@@ -173,7 +173,7 @@
if (drawSelectionTint) {
LayoutRect selectionPaintingRect = localSelectionRect();
selectionPaintingRect.moveBy(adjustedPaintOffset);
- paintInfo.context->fillRect(pixelSnappedIntRect(selectionPaintingRect), selectionBackgroundColor(), style()->colorSpace());
+ paintInfo.context->fillRect(pixelSnappedIntRect(selectionPaintingRect), selectionBackgroundColor(), style().colorSpace());
}
}
@@ -187,7 +187,7 @@
return false;
// if we're invisible or haven't received a layout yet, then just bail.
- if (style()->visibility() != VISIBLE)
+ if (style().visibility() != VISIBLE)
return false;
LayoutPoint adjustedPaintOffset = paintOffset + location();
@@ -224,7 +224,7 @@
return 0;
for (; !containingBlock->isRenderView() && !containingBlock->isBody(); containingBlock = containingBlock->containingBlock()) {
- if (containingBlock->style()->logicalWidth().isSpecified())
+ if (containingBlock->style().logicalWidth().isSpecified())
return containingBlock;
}
@@ -233,10 +233,10 @@
bool RenderReplaced::hasReplacedLogicalWidth() const
{
- if (style()->logicalWidth().isSpecified())
+ if (style().logicalWidth().isSpecified())
return true;
- if (style()->logicalWidth().isAuto())
+ if (style().logicalWidth().isAuto())
return false;
return firstContainingBlockWithLogicalWidth(this);
@@ -244,10 +244,10 @@
bool RenderReplaced::hasReplacedLogicalHeight() const
{
- if (style()->logicalHeight().isAuto())
+ if (style().logicalHeight().isAuto())
return false;
- if (style()->logicalHeight().isSpecified()) {
+ if (style().logicalHeight().isSpecified()) {
if (hasAutoHeightOrContainingBlockWithAutoHeight())
return false;
return true;
@@ -266,7 +266,7 @@
// Handle zoom & vertical writing modes here, as the embedded document doesn't know about them.
if (!isPercentageIntrinsicSize)
- intrinsicSize.scale(style()->effectiveZoom());
+ intrinsicSize.scale(style().effectiveZoom());
if (hasAspectRatio() && isPercentageIntrinsicSize)
intrinsicRatio = 1;
@@ -298,7 +298,7 @@
// FIXME: In the long term, it might be better to just return this code more to the way it used to be before this
// function was added, since all it has done is make the code more unclear.
constrainedSize = intrinsicSize;
- if (intrinsicRatio && !isPercentageIntrinsicSize && !intrinsicSize.isEmpty() && style()->logicalWidth().isAuto() && style()->logicalHeight().isAuto()) {
+ if (intrinsicRatio && !isPercentageIntrinsicSize && !intrinsicSize.isEmpty() && style().logicalWidth().isAuto() && style().logicalHeight().isAuto()) {
// We can't multiply or divide by 'intrinsicRatio' here, it breaks tests, like fast/images/zoomed-img-size.html, which
// can only be fixed once subpixel precision is available for things like intrinsicWidth/Height - which include zoom!
constrainedSize.setWidth(RenderBox::computeReplacedLogicalHeight() * intrinsicSize.width() / intrinsicSize.height());
@@ -309,7 +309,7 @@
LayoutRect RenderReplaced::replacedContentRect(const LayoutSize& intrinsicSize) const
{
LayoutRect contentRect = contentBoxRect();
- ObjectFit objectFit = style()->objectFit();
+ ObjectFit objectFit = style().objectFit();
if (objectFit == ObjectFitFill)
return contentRect;
@@ -357,8 +357,8 @@
LayoutUnit RenderReplaced::computeReplacedLogicalWidth(ShouldComputePreferred shouldComputePreferred) const
{
- if (style()->logicalWidth().isSpecified() || style()->logicalWidth().isIntrinsic())
- return computeReplacedLogicalWidthRespectingMinMaxWidth(computeReplacedLogicalWidthUsing(style()->logicalWidth()), shouldComputePreferred);
+ if (style().logicalWidth().isSpecified() || style().logicalWidth().isIntrinsic())
+ return computeReplacedLogicalWidthRespectingMinMaxWidth(computeReplacedLogicalWidthUsing(style().logicalWidth()), shouldComputePreferred);
RenderBox* contentRenderer = embeddedContentBox();
@@ -368,8 +368,8 @@
FloatSize constrainedSize;
computeAspectRatioInformationForRenderBox(contentRenderer, constrainedSize, intrinsicRatio, isPercentageIntrinsicSize);
- if (style()->logicalWidth().isAuto()) {
- bool heightIsAuto = style()->logicalHeight().isAuto();
+ if (style().logicalWidth().isAuto()) {
+ bool heightIsAuto = style().logicalHeight().isAuto();
bool hasIntrinsicWidth = !isPercentageIntrinsicSize && constrainedSize.width() > 0;
// If 'height' and 'width' both have computed values of 'auto' and the element also has an intrinsic width, then that intrinsic width is the used value of 'width'.
@@ -394,13 +394,13 @@
// 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' = width of containing block
LayoutUnit logicalWidth;
if (RenderBlock* blockWithWidth = firstContainingBlockWithLogicalWidth(this))
- logicalWidth = blockWithWidth->computeReplacedLogicalWidthRespectingMinMaxWidth(blockWithWidth->computeReplacedLogicalWidthUsing(blockWithWidth->style()->logicalWidth()), shouldComputePreferred);
+ logicalWidth = blockWithWidth->computeReplacedLogicalWidthRespectingMinMaxWidth(blockWithWidth->computeReplacedLogicalWidthUsing(blockWithWidth->style().logicalWidth()), shouldComputePreferred);
else
logicalWidth = containingBlock()->availableLogicalWidth();
// This solves above equation for 'width' (== logicalWidth).
- LayoutUnit marginStart = minimumValueForLength(style()->marginStart(), logicalWidth);
- LayoutUnit marginEnd = minimumValueForLength(style()->marginEnd(), logicalWidth);
+ LayoutUnit marginStart = minimumValueForLength(style().marginStart(), logicalWidth);
+ LayoutUnit marginEnd = minimumValueForLength(style().marginEnd(), logicalWidth);
logicalWidth = max<LayoutUnit>(0, logicalWidth - (marginStart + marginEnd + (width() - clientWidth())));
if (isPercentageIntrinsicSize)
logicalWidth = logicalWidth * constrainedSize.width() / 100;
@@ -426,7 +426,7 @@
{
// 10.5 Content height: the 'height' property: http://www.w3.org/TR/CSS21/visudet.html#propdef-height
if (hasReplacedLogicalHeight())
- return computeReplacedLogicalHeightRespectingMinMaxHeight(computeReplacedLogicalHeightUsing(style()->logicalHeight()));
+ return computeReplacedLogicalHeightRespectingMinMaxHeight(computeReplacedLogicalHeightUsing(style().logicalHeight()));
RenderBox* contentRenderer = embeddedContentBox();
@@ -436,7 +436,7 @@
FloatSize constrainedSize;
computeAspectRatioInformationForRenderBox(contentRenderer, constrainedSize, intrinsicRatio, isPercentageIntrinsicSize);
- bool widthIsAuto = style()->logicalWidth().isAuto();
+ bool widthIsAuto = style().logicalWidth().isAuto();
bool hasIntrinsicHeight = !isPercentageIntrinsicSize && constrainedSize.height() > 0;
// If 'height' and 'width' both have computed values of 'auto' and the element also has an intrinsic height, then that intrinsic height is the used value of 'height'.
@@ -468,23 +468,23 @@
// We cannot resolve any percent logical width here as the available logical
// width may not be set on our containing block.
- if (style()->logicalWidth().isPercent())
+ if (style().logicalWidth().isPercent())
computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth, m_maxPreferredLogicalWidth);
else
m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = computeReplacedLogicalWidth(ComputePreferred);
- RenderStyle* styleToUse = style();
- if (styleToUse->logicalWidth().isPercent() || styleToUse->logicalMaxWidth().isPercent() || hasRelativeIntrinsicLogicalWidth())
+ const RenderStyle& styleToUse = style();
+ if (styleToUse.logicalWidth().isPercent() || styleToUse.logicalMaxWidth().isPercent() || hasRelativeIntrinsicLogicalWidth())
m_minPreferredLogicalWidth = 0;
- if (styleToUse->logicalMinWidth().isFixed() && styleToUse->logicalMinWidth().value() > 0) {
- m_maxPreferredLogicalWidth = max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMinWidth().value()));
- m_minPreferredLogicalWidth = max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMinWidth().value()));
+ if (styleToUse.logicalMinWidth().isFixed() && styleToUse.logicalMinWidth().value() > 0) {
+ m_maxPreferredLogicalWidth = max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth().value()));
+ m_minPreferredLogicalWidth = max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth().value()));
}
- if (styleToUse->logicalMaxWidth().isFixed()) {
- m_maxPreferredLogicalWidth = min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMaxWidth().value()));
- m_minPreferredLogicalWidth = min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMaxWidth().value()));
+ if (styleToUse.logicalMaxWidth().isFixed()) {
+ m_maxPreferredLogicalWidth = min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMaxWidth().value()));
+ m_minPreferredLogicalWidth = min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMaxWidth().value()));
}
LayoutUnit borderAndPadding = borderAndPaddingLogicalWidth();
@@ -547,8 +547,8 @@
return LayoutRect(LayoutPoint(), size());
const RootInlineBox& rootBox = m_inlineBoxWrapper->root();
- LayoutUnit newLogicalTop = rootBox.blockFlow().style()->isFlippedBlocksWritingMode() ? m_inlineBoxWrapper->logicalBottom() - rootBox.selectionBottom() : rootBox.selectionTop() - m_inlineBoxWrapper->logicalTop();
- if (rootBox.blockFlow().style()->isHorizontalWritingMode())
+ LayoutUnit newLogicalTop = rootBox.blockFlow().style().isFlippedBlocksWritingMode() ? m_inlineBoxWrapper->logicalBottom() - rootBox.selectionBottom() : rootBox.selectionTop() - m_inlineBoxWrapper->logicalTop();
+ if (rootBox.blockFlow().style().isHorizontalWritingMode())
return LayoutRect(0, newLogicalTop, width(), rootBox.selectionHeight());
return LayoutRect(newLogicalTop, 0, rootBox.selectionHeight(), height());
}
@@ -587,7 +587,7 @@
LayoutRect RenderReplaced::clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const
{
- if (style()->visibility() != VISIBLE && !enclosingLayer()->hasVisibleContent())
+ if (style().visibility() != VISIBLE && !enclosingLayer()->hasVisibleContent())
return LayoutRect();
// The selectionRect can project outside of the overflowRect, so take their union
@@ -598,8 +598,7 @@
// repaint containers. https://bugs.webkit.org/show_bug.cgi?id=23308
r.move(view().layoutDelta());
- if (style())
- r.inflate(style()->outlineSize());
+ r.inflate(style().outlineSize());
computeRectForRepaint(repaintContainer, r);
return r;
diff --git a/Source/WebCore/rendering/RenderRuby.cpp b/Source/WebCore/rendering/RenderRuby.cpp
index 8c06afc..9facf6f 100644
--- a/Source/WebCore/rendering/RenderRuby.cpp
+++ b/Source/WebCore/rendering/RenderRuby.cpp
@@ -47,7 +47,7 @@
|| !object->parent()->isRuby()
|| object->isRubyRun()
|| (object->isInline() && (object->isBeforeContent() || object->isAfterContent()))
- || (object->isAnonymous() && object->isRenderBlock() && object->style()->display() == INLINE_BLOCK));
+ || (object->isAnonymous() && object->isRenderBlock() && object->style().display() == INLINE_BLOCK));
return object
&& object->parent()->isRuby()
@@ -60,7 +60,7 @@
return isAnonymousRubyInlineBlock(object)
&& !object->previousSibling()
&& object->firstChildSlow()
- && object->firstChildSlow()->style()->styleType() == BEFORE;
+ && object->firstChildSlow()->style().styleType() == BEFORE;
}
static inline bool isRubyAfterBlock(const RenderObject* object)
@@ -68,7 +68,7 @@
return isAnonymousRubyInlineBlock(object)
&& !object->nextSibling()
&& object->firstChildSlow()
- && object->firstChildSlow()->style()->styleType() == AFTER;
+ && object->firstChildSlow()->style().styleType() == AFTER;
}
static inline RenderBlock* rubyBeforeBlock(const RenderElement* ruby)
@@ -85,7 +85,7 @@
static RenderBlock* createAnonymousRubyInlineBlock(RenderObject& ruby)
{
- RenderBlock* newBlock = new RenderBlockFlow(ruby.document(), RenderStyle::createAnonymousStyleWithDisplay(ruby.style(), INLINE_BLOCK));
+ RenderBlock* newBlock = new RenderBlockFlow(ruby.document(), RenderStyle::createAnonymousStyleWithDisplay(&ruby.style(), INLINE_BLOCK));
newBlock->initializeStyle();
return newBlock;
}
diff --git a/Source/WebCore/rendering/RenderRubyRun.cpp b/Source/WebCore/rendering/RenderRubyRun.cpp
index 4dbfd5e..5c15114 100644
--- a/Source/WebCore/rendering/RenderRubyRun.cpp
+++ b/Source/WebCore/rendering/RenderRubyRun.cpp
@@ -200,7 +200,7 @@
RenderRubyBase* RenderRubyRun::createRubyBase() const
{
- auto newStyle = RenderStyle::createAnonymousStyleWithDisplay(style(), BLOCK);
+ auto newStyle = RenderStyle::createAnonymousStyleWithDisplay(&style(), BLOCK);
newStyle.get().setTextAlign(CENTER); // FIXME: use WEBKIT_CENTER?
auto renderer = new RenderRubyBase(document(), std::move(newStyle));
renderer->initializeStyle();
@@ -210,7 +210,7 @@
RenderRubyRun* RenderRubyRun::staticCreateRubyRun(const RenderObject* parentRuby)
{
ASSERT(parentRuby && parentRuby->isRuby());
- auto renderer = new RenderRubyRun(parentRuby->document(), RenderStyle::createAnonymousStyleWithDisplay(parentRuby->style(), INLINE_BLOCK));
+ auto renderer = new RenderRubyRun(parentRuby->document(), RenderStyle::createAnonymousStyleWithDisplay(&parentRuby->style(), INLINE_BLOCK));
renderer->initializeStyle();
return renderer;
}
@@ -248,7 +248,7 @@
lastLineRubyTextBottom = rootBox->logicalBottomLayoutOverflow();
}
- if (style()->isFlippedLinesWritingMode() == (style()->rubyPosition() == RubyPositionAfter)) {
+ if (style().isFlippedLinesWritingMode() == (style().rubyPosition() == RubyPositionAfter)) {
LayoutUnit firstLineTop = 0;
if (RenderRubyBase* rb = rubyBase()) {
RootInlineBox* rootBox = rb->firstRootBox();
@@ -278,8 +278,8 @@
{
if (!renderer || !renderer->isText())
return false;
- const RenderStyle& rubyBaseStyle = firstLine ? *rubyBase.firstLineStyle() : *rubyBase.style();
- const RenderStyle& style = firstLine ? *renderer->firstLineStyle() : *renderer->style();
+ const RenderStyle& rubyBaseStyle = firstLine ? rubyBase.firstLineStyle() : rubyBase.style();
+ const RenderStyle& style = firstLine ? renderer->firstLineStyle() : renderer->style();
return style.fontSize() <= rubyBaseStyle.fontSize();
}
@@ -307,8 +307,8 @@
logicalRightOverhang = min<int>(logicalRightOverhang, logicalWidth - rootInlineBox->logicalRight());
}
- startOverhang = style()->isLeftToRightDirection() ? logicalLeftOverhang : logicalRightOverhang;
- endOverhang = style()->isLeftToRightDirection() ? logicalRightOverhang : logicalLeftOverhang;
+ startOverhang = style().isLeftToRightDirection() ? logicalLeftOverhang : logicalRightOverhang;
+ endOverhang = style().isLeftToRightDirection() ? logicalRightOverhang : logicalLeftOverhang;
if (!shouldOverhang(firstLine, startRenderer, *rubyBase))
startOverhang = 0;
@@ -318,7 +318,7 @@
// We overhang a ruby only if the neighboring render object is a text.
// We can overhang the ruby by no more than half the width of the neighboring text
// and no more than half the font size.
- const RenderStyle& rubyTextStyle = firstLine ? *rubyText->firstLineStyle() : *rubyText->style();
+ const RenderStyle& rubyTextStyle = firstLine ? rubyText->firstLineStyle() : rubyText->style();
int halfWidthOfFontSize = rubyTextStyle.fontSize() / 2;
if (startOverhang)
startOverhang = min<int>(startOverhang, min<int>(toRenderText(startRenderer)->minLogicalWidth(), halfWidthOfFontSize));
diff --git a/Source/WebCore/rendering/RenderRubyText.cpp b/Source/WebCore/rendering/RenderRubyText.cpp
index 6a8f362..1257a1d 100644
--- a/Source/WebCore/rendering/RenderRubyText.cpp
+++ b/Source/WebCore/rendering/RenderRubyText.cpp
@@ -53,7 +53,7 @@
ETextAlign RenderRubyText::textAlignmentForLine(bool endsWithSoftBreak) const
{
- ETextAlign textAlign = style()->textAlign();
+ ETextAlign textAlign = style().textAlign();
// FIXME: This check is bogus since user can set the initial value.
if (textAlign != RenderStyle::initialTextAlign())
return RenderBlockFlow::textAlignmentForLine(endsWithSoftBreak);
@@ -64,7 +64,7 @@
void RenderRubyText::adjustInlineDirectionLineBounds(int expansionOpportunityCount, float& logicalLeft, float& logicalWidth) const
{
- ETextAlign textAlign = style()->textAlign();
+ ETextAlign textAlign = style().textAlign();
// FIXME: This check is bogus since user can set the initial value.
if (textAlign != RenderStyle::initialTextAlign())
return RenderBlockFlow::adjustInlineDirectionLineBounds(expansionOpportunityCount, logicalLeft, logicalWidth);
@@ -77,7 +77,7 @@
// ruby character on each side.
float inset = (logicalWidth - maxPreferredLogicalWidth) / (expansionOpportunityCount + 1);
if (expansionOpportunityCount)
- inset = min<float>(2 * style()->fontSize(), inset);
+ inset = min<float>(2 * style().fontSize(), inset);
logicalLeft += inset / 2;
logicalWidth -= inset;
diff --git a/Source/WebCore/rendering/RenderScrollbar.cpp b/Source/WebCore/rendering/RenderScrollbar.cpp
index ef8d569..beb2363 100644
--- a/Source/WebCore/rendering/RenderScrollbar.cpp
+++ b/Source/WebCore/rendering/RenderScrollbar.cpp
@@ -152,7 +152,7 @@
if (!owningRenderer())
return 0;
- RefPtr<RenderStyle> result = owningRenderer()->getUncachedPseudoStyle(PseudoStyleRequest(pseudoId, this, partType), owningRenderer()->style());
+ RefPtr<RenderStyle> result = owningRenderer()->getUncachedPseudoStyle(PseudoStyleRequest(pseudoId, this, partType), &owningRenderer()->style());
// Scrollbars for root frames should always have background color
// unless explicitly specified as transparent. So we force it.
// This is because WebKit assumes scrollbar to be always painted and missing background
@@ -364,7 +364,7 @@
if (!partRenderer)
return 1;
- return partRenderer->style()->opacity();
+ return partRenderer->style().opacity();
}
}
diff --git a/Source/WebCore/rendering/RenderScrollbarPart.cpp b/Source/WebCore/rendering/RenderScrollbarPart.cpp
index 39a2ef7..09ecdbf 100644
--- a/Source/WebCore/rendering/RenderScrollbarPart.cpp
+++ b/Source/WebCore/rendering/RenderScrollbarPart.cpp
@@ -95,15 +95,15 @@
RenderView* renderView = &view();
// FIXME: We are querying layout information but nothing guarantees that it's up-to-date, especially since we are called at style change.
// FIXME: Querying the style's border information doesn't work on table cells with collapsing borders.
- int visibleSize = m_scrollbar->owningRenderer()->width() - m_scrollbar->owningRenderer()->style()->borderLeftWidth() - m_scrollbar->owningRenderer()->style()->borderRightWidth();
- int w = calcScrollbarThicknessUsing(MainOrPreferredSize, style()->width(), visibleSize, renderView);
- int minWidth = calcScrollbarThicknessUsing(MinSize, style()->minWidth(), visibleSize, renderView);
- int maxWidth = style()->maxWidth().isUndefined() ? w : calcScrollbarThicknessUsing(MaxSize, style()->maxWidth(), visibleSize, renderView);
+ int visibleSize = m_scrollbar->owningRenderer()->width() - m_scrollbar->owningRenderer()->style().borderLeftWidth() - m_scrollbar->owningRenderer()->style().borderRightWidth();
+ int w = calcScrollbarThicknessUsing(MainOrPreferredSize, style().width(), visibleSize, renderView);
+ int minWidth = calcScrollbarThicknessUsing(MinSize, style().minWidth(), visibleSize, renderView);
+ int maxWidth = style().maxWidth().isUndefined() ? w : calcScrollbarThicknessUsing(MaxSize, style().maxWidth(), visibleSize, renderView);
setWidth(max(minWidth, min(maxWidth, w)));
// Buttons and track pieces can all have margins along the axis of the scrollbar.
- m_marginBox.setLeft(minimumValueForLength(style()->marginLeft(), visibleSize, renderView));
- m_marginBox.setRight(minimumValueForLength(style()->marginRight(), visibleSize, renderView));
+ m_marginBox.setLeft(minimumValueForLength(style().marginLeft(), visibleSize, renderView));
+ m_marginBox.setRight(minimumValueForLength(style().marginRight(), visibleSize, renderView));
}
void RenderScrollbarPart::computeScrollbarHeight()
@@ -113,15 +113,15 @@
RenderView* renderView = &view();
// FIXME: We are querying layout information but nothing guarantees that it's up-to-date, especially since we are called at style change.
// FIXME: Querying the style's border information doesn't work on table cells with collapsing borders.
- int visibleSize = m_scrollbar->owningRenderer()->height() - m_scrollbar->owningRenderer()->style()->borderTopWidth() - m_scrollbar->owningRenderer()->style()->borderBottomWidth();
- int h = calcScrollbarThicknessUsing(MainOrPreferredSize, style()->height(), visibleSize, renderView);
- int minHeight = calcScrollbarThicknessUsing(MinSize, style()->minHeight(), visibleSize, renderView);
- int maxHeight = style()->maxHeight().isUndefined() ? h : calcScrollbarThicknessUsing(MaxSize, style()->maxHeight(), visibleSize, renderView);
+ int visibleSize = m_scrollbar->owningRenderer()->height() - m_scrollbar->owningRenderer()->style().borderTopWidth() - m_scrollbar->owningRenderer()->style().borderBottomWidth();
+ int h = calcScrollbarThicknessUsing(MainOrPreferredSize, style().height(), visibleSize, renderView);
+ int minHeight = calcScrollbarThicknessUsing(MinSize, style().minHeight(), visibleSize, renderView);
+ int maxHeight = style().maxHeight().isUndefined() ? h : calcScrollbarThicknessUsing(MaxSize, style().maxHeight(), visibleSize, renderView);
setHeight(max(minHeight, min(maxHeight, h)));
// Buttons and track pieces can all have margins along the axis of the scrollbar.
- m_marginBox.setTop(minimumValueForLength(style()->marginTop(), visibleSize, renderView));
- m_marginBox.setBottom(minimumValueForLength(style()->marginBottom(), visibleSize, renderView));
+ m_marginBox.setTop(minimumValueForLength(style().marginTop(), visibleSize, renderView));
+ m_marginBox.setBottom(minimumValueForLength(style().marginBottom(), visibleSize, renderView));
}
void RenderScrollbarPart::computePreferredLogicalWidths()
@@ -166,16 +166,16 @@
setWidth(rect.width());
setHeight(rect.height());
- if (graphicsContext->paintingDisabled() || !style()->opacity())
+ if (graphicsContext->paintingDisabled() || !style().opacity())
return;
// We don't use RenderLayers for scrollbar parts, so we need to handle opacity here.
// Opacity for ScrollbarBGPart is handled by RenderScrollbarTheme::willPaintScrollbar().
- bool needsTransparencyLayer = m_part != ScrollbarBGPart && style()->opacity() < 1;
+ bool needsTransparencyLayer = m_part != ScrollbarBGPart && style().opacity() < 1;
if (needsTransparencyLayer) {
graphicsContext->save();
graphicsContext->clip(rect);
- graphicsContext->beginTransparencyLayer(style()->opacity());
+ graphicsContext->beginTransparencyLayer(style().opacity());
}
// Now do the paint.
diff --git a/Source/WebCore/rendering/RenderSearchField.cpp b/Source/WebCore/rendering/RenderSearchField.cpp
index 49a3952..716161f 100644
--- a/Source/WebCore/rendering/RenderSearchField.cpp
+++ b/Source/WebCore/rendering/RenderSearchField.cpp
@@ -176,19 +176,19 @@
if (!cancelButtonRenderer)
return;
- const RenderStyle* curStyle = cancelButtonRenderer->style();
+ const RenderStyle& curStyle = cancelButtonRenderer->style();
EVisibility buttonVisibility = visibilityForCancelButton();
- if (curStyle->visibility() == buttonVisibility)
+ if (curStyle.visibility() == buttonVisibility)
return;
- auto cancelButtonStyle = RenderStyle::clone(curStyle);
+ auto cancelButtonStyle = RenderStyle::clone(&curStyle);
cancelButtonStyle.get().setVisibility(buttonVisibility);
cancelButtonRenderer->setStyle(std::move(cancelButtonStyle));
}
EVisibility RenderSearchField::visibilityForCancelButton() const
{
- return (style()->visibility() == HIDDEN || inputElement().value().isEmpty()) ? HIDDEN : VISIBLE;
+ return (style().visibility() == HIDDEN || inputElement().value().isEmpty()) ? HIDDEN : VISIBLE;
}
const AtomicString& RenderSearchField::autosaveName() const
@@ -258,8 +258,8 @@
PopupMenuStyle RenderSearchField::menuStyle() const
{
- return PopupMenuStyle(style()->visitedDependentColor(CSSPropertyColor), style()->visitedDependentColor(CSSPropertyBackgroundColor), style()->font(), style()->visibility() == VISIBLE,
- style()->display() == NONE, style()->textIndent(), style()->direction(), isOverride(style()->unicodeBidi()), PopupMenuStyle::CustomBackgroundColor);
+ return PopupMenuStyle(style().visitedDependentColor(CSSPropertyColor), style().visitedDependentColor(CSSPropertyBackgroundColor), style().font(), style().visibility() == VISIBLE,
+ style().display() == NONE, style().textIndent(), style().direction(), isOverride(style().unicodeBidi()), PopupMenuStyle::CustomBackgroundColor);
}
int RenderSearchField::clientInsetLeft() const
@@ -348,7 +348,7 @@
PassRefPtr<Scrollbar> RenderSearchField::createScrollbar(ScrollableArea* scrollableArea, ScrollbarOrientation orientation, ScrollbarControlSize controlSize)
{
RefPtr<Scrollbar> widget;
- bool hasCustomScrollbarStyle = style()->hasPseudoStyle(SCROLLBAR);
+ bool hasCustomScrollbarStyle = style().hasPseudoStyle(SCROLLBAR);
if (hasCustomScrollbarStyle)
widget = RenderScrollbar::createCustomScrollbar(scrollableArea, orientation, &inputElement());
else
diff --git a/Source/WebCore/rendering/RenderSlider.cpp b/Source/WebCore/rendering/RenderSlider.cpp
index 5ffec64..c644f31 100644
--- a/Source/WebCore/rendering/RenderSlider.cpp
+++ b/Source/WebCore/rendering/RenderSlider.cpp
@@ -76,8 +76,8 @@
void RenderSlider::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const
{
- maxLogicalWidth = defaultTrackLength * style()->effectiveZoom();
- if (!style()->width().isPercent())
+ maxLogicalWidth = defaultTrackLength * style().effectiveZoom();
+ if (!style().width().isPercent())
minLogicalWidth = maxLogicalWidth;
}
@@ -86,19 +86,19 @@
m_minPreferredLogicalWidth = 0;
m_maxPreferredLogicalWidth = 0;
- if (style()->width().isFixed() && style()->width().value() > 0)
- m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(style()->width().value());
+ if (style().width().isFixed() && style().width().value() > 0)
+ m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(style().width().value());
else
computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth, m_maxPreferredLogicalWidth);
- if (style()->minWidth().isFixed() && style()->minWidth().value() > 0) {
- m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style()->minWidth().value()));
- m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style()->minWidth().value()));
+ if (style().minWidth().isFixed() && style().minWidth().value() > 0) {
+ m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth().value()));
+ m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().minWidth().value()));
}
- if (style()->maxWidth().isFixed()) {
- m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style()->maxWidth().value()));
- m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style()->maxWidth().value()));
+ if (style().maxWidth().isFixed()) {
+ m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth().value()));
+ m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().maxWidth().value()));
}
LayoutUnit toAdd = borderAndPaddingWidth();
@@ -115,7 +115,7 @@
// FIXME: Find a way to cascade appearance. http://webkit.org/b/62535
RenderBox* thumbBox = element().sliderThumbElement()->renderBox();
if (thumbBox && thumbBox->isSliderThumb())
- static_cast<RenderSliderThumb*>(thumbBox)->updateAppearance(style());
+ static_cast<RenderSliderThumb*>(thumbBox)->updateAppearance(&style());
RenderFlexibleBox::layout();
}
diff --git a/Source/WebCore/rendering/RenderSnapshottedPlugIn.cpp b/Source/WebCore/rendering/RenderSnapshottedPlugIn.cpp
index 1e51ff6..59e6015 100644
--- a/Source/WebCore/rendering/RenderSnapshottedPlugIn.cpp
+++ b/Source/WebCore/rendering/RenderSnapshottedPlugIn.cpp
@@ -124,8 +124,8 @@
GraphicsContext* context = paintInfo.context;
#if PLATFORM(MAC)
- if (style()->highlight() != nullAtom && !context->paintingDisabled())
- paintCustomHighlight(toPoint(paintOffset - location()), style()->highlight(), true);
+ if (style().highlight() != nullAtom && !context->paintingDisabled())
+ paintCustomHighlight(toPoint(paintOffset - location()), style().highlight(), true);
#endif
LayoutSize contentSize(cWidth, cHeight);
@@ -141,9 +141,9 @@
ImageOrientationDescription orientationDescription(shouldRespectImageOrientation());
#if ENABLE(CSS_IMAGE_ORIENTATION)
- orientationDescription.setImageOrientationEnum(style()->imageOrientation());
+ orientationDescription.setImageOrientationEnum(style().imageOrientation());
#endif
- context->drawImage(image, style()->colorSpace(), alignedRect, CompositeSourceOver, orientationDescription, useLowQualityScaling);
+ context->drawImage(image, style().colorSpace(), alignedRect, CompositeSourceOver, orientationDescription, useLowQualityScaling);
}
CursorDirective RenderSnapshottedPlugIn::getCursor(const LayoutPoint& point, Cursor& overrideCursor) const
diff --git a/Source/WebCore/rendering/RenderTable.cpp b/Source/WebCore/rendering/RenderTable.cpp
index a82c238..4e1c72f 100644
--- a/Source/WebCore/rendering/RenderTable.cpp
+++ b/Source/WebCore/rendering/RenderTable.cpp
@@ -102,21 +102,21 @@
ETableLayout oldTableLayout = oldStyle ? oldStyle->tableLayout() : TAUTO;
// In the collapsed border model, there is no cell spacing.
- m_hSpacing = collapseBorders() ? 0 : style()->horizontalBorderSpacing();
- m_vSpacing = collapseBorders() ? 0 : style()->verticalBorderSpacing();
+ m_hSpacing = collapseBorders() ? 0 : style().horizontalBorderSpacing();
+ m_vSpacing = collapseBorders() ? 0 : style().verticalBorderSpacing();
m_columnPos[0] = m_hSpacing;
- if (!m_tableLayout || style()->tableLayout() != oldTableLayout) {
+ if (!m_tableLayout || style().tableLayout() != oldTableLayout) {
// According to the CSS2 spec, you only use fixed table layout if an
// explicit width is specified on the table. Auto width implies auto table layout.
- if (style()->tableLayout() == TFIXED && !style()->logicalWidth().isAuto())
+ if (style().tableLayout() == TFIXED && !style().logicalWidth().isAuto())
m_tableLayout = adoptPtr(new FixedTableLayout(this));
else
m_tableLayout = adoptPtr(new AutoTableLayout(this));
}
// If border was changed, invalidate collapsed borders cache.
- if (!needsLayout() && oldStyle && oldStyle->border() != style()->border())
+ if (!needsLayout() && oldStyle && oldStyle->border() != style().border())
invalidateCollapsedBorders();
}
@@ -141,7 +141,7 @@
m_hasColElements = true;
wrapInAnonymousSection = false;
} else if (child->isTableSection()) {
- switch (child->style()->display()) {
+ switch (child->style().display()) {
case TABLE_HEADER_GROUP:
resetSectionPointerIfNotBefore(m_head, beforeChild);
if (!m_head) {
@@ -200,7 +200,7 @@
}
RenderObject* lastBox = beforeChild;
- while (lastBox && lastBox->parent()->isAnonymous() && !lastBox->isTableSection() && lastBox->style()->display() != TABLE_CAPTION && lastBox->style()->display() != TABLE_COLUMN_GROUP)
+ while (lastBox && lastBox->parent()->isAnonymous() && !lastBox->isTableSection() && lastBox->style().display() != TABLE_CAPTION && lastBox->style().display() != TABLE_COLUMN_GROUP)
lastBox = lastBox->parent();
if (lastBox && lastBox->isAnonymous() && !isAfterContent(lastBox)) {
RenderTableSection* section = toRenderTableSection(lastBox);
@@ -210,7 +210,7 @@
return;
}
- if (beforeChild && !beforeChild->isTableSection() && beforeChild->style()->display() != TABLE_CAPTION && beforeChild->style()->display() != TABLE_COLUMN_GROUP)
+ if (beforeChild && !beforeChild->isTableSection() && beforeChild->style().display() != TABLE_CAPTION && beforeChild->style().display() != TABLE_COLUMN_GROUP)
beforeChild = 0;
RenderTableSection* section = RenderTableSection::createAnonymousWithParentRenderer(this);
@@ -270,16 +270,16 @@
RenderBlock* cb = containingBlock();
LayoutUnit availableLogicalWidth = containingBlockLogicalWidthForContent();
- bool hasPerpendicularContainingBlock = cb->style()->isHorizontalWritingMode() != style()->isHorizontalWritingMode();
+ bool hasPerpendicularContainingBlock = cb->style().isHorizontalWritingMode() != style().isHorizontalWritingMode();
LayoutUnit containerWidthInInlineDirection = hasPerpendicularContainingBlock ? perpendicularContainingBlockLogicalHeight() : availableLogicalWidth;
- Length styleLogicalWidth = style()->logicalWidth();
+ Length styleLogicalWidth = style().logicalWidth();
if ((styleLogicalWidth.isSpecified() && styleLogicalWidth.isPositive()) || styleLogicalWidth.isIntrinsic())
setLogicalWidth(convertStyleLogicalWidthToComputedWidth(styleLogicalWidth, containerWidthInInlineDirection));
else {
// Subtract out any fixed margins from our available width for auto width tables.
- LayoutUnit marginStart = minimumValueForLength(style()->marginStart(), availableLogicalWidth);
- LayoutUnit marginEnd = minimumValueForLength(style()->marginEnd(), availableLogicalWidth);
+ LayoutUnit marginStart = minimumValueForLength(style().marginStart(), availableLogicalWidth);
+ LayoutUnit marginEnd = minimumValueForLength(style().marginEnd(), availableLogicalWidth);
LayoutUnit marginTotal = marginStart + marginEnd;
// Subtract out our margins to get the available content width.
@@ -298,14 +298,14 @@
// Ensure we aren't bigger than our max-width style.
- Length styleMaxLogicalWidth = style()->logicalMaxWidth();
+ Length styleMaxLogicalWidth = style().logicalMaxWidth();
if ((styleMaxLogicalWidth.isSpecified() && !styleMaxLogicalWidth.isNegative()) || styleMaxLogicalWidth.isIntrinsic()) {
LayoutUnit computedMaxLogicalWidth = convertStyleLogicalWidthToComputedWidth(styleMaxLogicalWidth, availableLogicalWidth);
setLogicalWidth(min<int>(logicalWidth(), computedMaxLogicalWidth));
}
// Ensure we aren't smaller than our min-width style.
- Length styleMinLogicalWidth = style()->logicalMinWidth();
+ Length styleMinLogicalWidth = style().logicalMinWidth();
if ((styleMinLogicalWidth.isSpecified() && !styleMinLogicalWidth.isNegative()) || styleMinLogicalWidth.isIntrinsic()) {
LayoutUnit computedMinLogicalWidth = convertStyleLogicalWidthToComputedWidth(styleMinLogicalWidth, availableLogicalWidth);
setLogicalWidth(max<int>(logicalWidth(), computedMinLogicalWidth));
@@ -319,15 +319,15 @@
if (avoidsFloats() && cb->containsFloats())
containerLogicalWidthForAutoMargins = containingBlockAvailableLineWidthInRegion(0); // FIXME: Work with regions someday.
ComputedMarginValues marginValues;
- bool hasInvertedDirection = cb->style()->isLeftToRightDirection() == style()->isLeftToRightDirection();
+ bool hasInvertedDirection = cb->style().isLeftToRightDirection() == style().isLeftToRightDirection();
computeInlineDirectionMargins(cb, containerLogicalWidthForAutoMargins, logicalWidth(),
hasInvertedDirection ? marginValues.m_start : marginValues.m_end,
hasInvertedDirection ? marginValues.m_end : marginValues.m_start);
setMarginStart(marginValues.m_start);
setMarginEnd(marginValues.m_end);
} else {
- setMarginStart(minimumValueForLength(style()->marginStart(), availableLogicalWidth));
- setMarginEnd(minimumValueForLength(style()->marginEnd(), availableLogicalWidth));
+ setMarginStart(minimumValueForLength(style().marginStart(), availableLogicalWidth));
+ setMarginEnd(minimumValueForLength(style().marginEnd(), availableLogicalWidth));
}
}
@@ -340,7 +340,7 @@
// HTML tables' width styles already include borders and paddings, but CSS tables' width styles do not.
LayoutUnit borders = 0;
bool isCSSTable = !element() || !isHTMLTableElement(element());
- if (isCSSTable && styleLogicalWidth.isSpecified() && styleLogicalWidth.isPositive() && style()->boxSizing() == CONTENT_BOX)
+ if (isCSSTable && styleLogicalWidth.isSpecified() && styleLogicalWidth.isPositive() && style().boxSizing() == CONTENT_BOX)
borders = borderStart() + borderEnd() + (collapseBorders() ? LayoutUnit() : paddingStart() + paddingEnd());
return minimumValueForLength(styleLogicalWidth, availableWidth) + borders;
@@ -353,7 +353,7 @@
// HTML tables size as though CSS height includes border/padding, CSS tables do not.
LayoutUnit borders = LayoutUnit();
// FIXME: We cannot apply box-sizing: content-box on <table> which other browsers allow.
- if ((element() && isHTMLTableElement(element())) || style()->boxSizing() == BORDER_BOX) {
+ if ((element() && isHTMLTableElement(element())) || style().boxSizing() == BORDER_BOX) {
LayoutUnit borderAndPaddingBefore = borderBefore() + (collapseBorders() ? LayoutUnit() : paddingBefore());
LayoutUnit borderAndPaddingAfter = borderAfter() + (collapseBorders() ? LayoutUnit() : paddingAfter());
borders = borderAndPaddingBefore + borderAndPaddingAfter;
@@ -424,7 +424,7 @@
recalcBordersInRowDirection();
LayoutRepainter repainter(*this, checkForRepaintDuringLayout());
- LayoutStateMaintainer statePusher(&view(), this, locationOffset(), hasTransform() || hasReflection() || style()->isFlippedBlocksWritingMode());
+ LayoutStateMaintainer statePusher(&view(), this, locationOffset(), hasTransform() || hasReflection() || style().isFlippedBlocksWritingMode());
setLogicalHeight(0);
@@ -474,7 +474,7 @@
// FIXME: Collapse caption margin.
if (!m_captions.isEmpty()) {
for (unsigned i = 0; i < m_captions.size(); i++) {
- if (m_captions[i]->style()->captionSide() == CAPBOTTOM)
+ if (m_captions[i]->style().captionSide() == CAPBOTTOM)
continue;
layoutCaption(m_captions[i]);
}
@@ -494,17 +494,17 @@
LayoutUnit computedLogicalHeight = 0;
- Length logicalHeightLength = style()->logicalHeight();
+ Length logicalHeightLength = style().logicalHeight();
if (logicalHeightLength.isSpecified() && logicalHeightLength.isPositive())
computedLogicalHeight = convertStyleLogicalHeightToComputedHeight(logicalHeightLength);
- Length logicalMaxHeightLength = style()->logicalMaxHeight();
+ Length logicalMaxHeightLength = style().logicalMaxHeight();
if (logicalMaxHeightLength.isSpecified() && !logicalMaxHeightLength.isNegative()) {
LayoutUnit computedMaxLogicalHeight = convertStyleLogicalHeightToComputedHeight(logicalMaxHeightLength);
computedLogicalHeight = min(computedLogicalHeight, computedMaxLogicalHeight);
}
- Length logicalMinHeightLength = style()->logicalMinHeight();
+ Length logicalMinHeightLength = style().logicalMinHeight();
if (logicalMinHeightLength.isSpecified() && !logicalMinHeightLength.isNegative()) {
LayoutUnit computedMinLogicalHeight = convertStyleLogicalHeightToComputedHeight(logicalMinHeightLength);
computedLogicalHeight = max(computedLogicalHeight, computedMinLogicalHeight);
@@ -521,16 +521,16 @@
setLogicalHeight(logicalHeight() + computedLogicalHeight);
}
- LayoutUnit sectionLogicalLeft = style()->isLeftToRightDirection() ? borderStart() : borderEnd();
+ LayoutUnit sectionLogicalLeft = style().isLeftToRightDirection() ? borderStart() : borderEnd();
if (!collapsing)
- sectionLogicalLeft += style()->isLeftToRightDirection() ? paddingStart() : paddingEnd();
+ sectionLogicalLeft += style().isLeftToRightDirection() ? paddingStart() : paddingEnd();
// position the table sections
RenderTableSection* section = topSection();
while (section) {
if (!sectionMoved && section->logicalTop() != logicalHeight()) {
sectionMoved = true;
- movedSectionLogicalTop = min(logicalHeight(), section->logicalTop()) + (style()->isHorizontalWritingMode() ? section->visualOverflowRect().y() : section->visualOverflowRect().x());
+ movedSectionLogicalTop = min(logicalHeight(), section->logicalTop()) + (style().isHorizontalWritingMode() ? section->visualOverflowRect().y() : section->visualOverflowRect().x());
}
section->setLogicalLocation(LayoutPoint(sectionLogicalLeft, logicalHeight()));
@@ -541,7 +541,7 @@
setLogicalHeight(logicalHeight() + borderAndPaddingAfter);
for (unsigned i = 0; i < m_captions.size(); i++) {
- if (m_captions[i]->style()->captionSide() != CAPBOTTOM)
+ if (m_captions[i]->style().captionSide() != CAPBOTTOM)
continue;
layoutCaption(m_captions[i]);
}
@@ -568,7 +568,7 @@
bool didFullRepaint = repainter.repaintAfterLayout();
// Repaint with our new bounds if they are different from our old bounds.
if (!didFullRepaint && sectionMoved) {
- if (style()->isHorizontalWritingMode())
+ if (style().isHorizontalWritingMode())
repaintRectangle(LayoutRect(visualOverflowRect().x(), movedSectionLogicalTop, visualOverflowRect().width(), visualOverflowRect().maxY() - movedSectionLogicalTop));
else
repaintRectangle(LayoutRect(movedSectionLogicalTop, visualOverflowRect().y(), visualOverflowRect().maxX() - movedSectionLogicalTop, visualOverflowRect().height()));
@@ -649,7 +649,7 @@
void RenderTable::paintObject(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
PaintPhase paintPhase = paintInfo.phase;
- if ((paintPhase == PaintPhaseBlockBackground || paintPhase == PaintPhaseChildBlockBackground) && hasBoxDecorations() && style()->visibility() == VISIBLE)
+ if ((paintPhase == PaintPhaseBlockBackground || paintPhase == PaintPhaseChildBlockBackground) && hasBoxDecorations() && style().visibility() == VISIBLE)
paintBoxDecorations(paintInfo, paintOffset);
if (paintPhase == PaintPhaseMask) {
@@ -679,7 +679,7 @@
}
}
- if (collapseBorders() && paintPhase == PaintPhaseChildBlockBackground && style()->visibility() == VISIBLE) {
+ if (collapseBorders() && paintPhase == PaintPhaseChildBlockBackground && style().visibility() == VISIBLE) {
recalcCollapsedBorders();
// Using our cached sorted styles, we then do individual passes,
// painting each style of border from lowest precedence to highest precedence.
@@ -696,7 +696,7 @@
}
// Paint outline.
- if ((paintPhase == PaintPhaseOutline || paintPhase == PaintPhaseSelfOutline) && hasOutline() && style()->visibility() == VISIBLE)
+ if ((paintPhase == PaintPhaseOutline || paintPhase == PaintPhaseSelfOutline) && hasOutline() && style().visibility() == VISIBLE)
paintOutline(paintInfo, LayoutRect(paintOffset, size()));
}
@@ -704,8 +704,8 @@
{
for (unsigned i = 0; i < m_captions.size(); i++) {
LayoutUnit captionLogicalHeight = m_captions[i]->logicalHeight() + m_captions[i]->marginBefore() + m_captions[i]->marginAfter();
- bool captionIsBefore = (m_captions[i]->style()->captionSide() != CAPBOTTOM) ^ style()->isFlippedBlocksWritingMode();
- if (style()->isHorizontalWritingMode()) {
+ bool captionIsBefore = (m_captions[i]->style().captionSide() != CAPBOTTOM) ^ style().isFlippedBlocksWritingMode();
+ if (style().isHorizontalWritingMode()) {
rect.setHeight(rect.height() - captionLogicalHeight);
if (captionIsBefore)
rect.move(0, captionLogicalHeight);
@@ -727,17 +727,17 @@
BackgroundBleedAvoidance bleedAvoidance = determineBackgroundBleedAvoidance(paintInfo.context);
if (!boxShadowShouldBeAppliedToBackground(bleedAvoidance))
- paintBoxShadow(paintInfo, rect, style(), Normal);
+ paintBoxShadow(paintInfo, rect, &style(), Normal);
paintBackground(paintInfo, rect, bleedAvoidance);
- paintBoxShadow(paintInfo, rect, style(), Inset);
+ paintBoxShadow(paintInfo, rect, &style(), Inset);
- if (style()->hasBorder() && !collapseBorders())
- paintBorder(paintInfo, rect, style());
+ if (style().hasBorder() && !collapseBorders())
+ paintBorder(paintInfo, rect, &style());
}
void RenderTable::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
- if (style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask)
+ if (style().visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask)
return;
LayoutRect rect(paintOffset, size());
@@ -774,17 +774,17 @@
for (unsigned i = 0; i < m_captions.size(); i++)
m_minPreferredLogicalWidth = max(m_minPreferredLogicalWidth, m_captions[i]->minPreferredLogicalWidth());
- RenderStyle* styleToUse = style();
+ RenderStyle& styleToUse = style();
// FIXME: This should probably be checking for isSpecified since you should be able to use percentage, calc or viewport relative values for min-width.
- if (styleToUse->logicalMinWidth().isFixed() && styleToUse->logicalMinWidth().value() > 0) {
- m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMinWidth().value()));
- m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMinWidth().value()));
+ if (styleToUse.logicalMinWidth().isFixed() && styleToUse.logicalMinWidth().value() > 0) {
+ m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth().value()));
+ m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth().value()));
}
// FIXME: This should probably be checking for isSpecified since you should be able to use percentage, calc or viewport relative values for maxWidth.
- if (styleToUse->logicalMaxWidth().isFixed()) {
- m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMaxWidth().value()));
- m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMaxWidth().value()));
+ if (styleToUse.logicalMaxWidth().isFixed()) {
+ m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMaxWidth().value()));
+ m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMaxWidth().value()));
}
// FIXME: We should be adding borderAndPaddingLogicalWidth here, but m_tableLayout->computePreferredLogicalWidths already does,
@@ -911,7 +911,7 @@
RenderObject* nextSibling;
for (RenderObject* child = firstChild(); child; child = nextSibling) {
nextSibling = child->nextSibling();
- switch (child->style()->display()) {
+ switch (child->style().display()) {
case TABLE_COLUMN:
case TABLE_COLUMN_GROUP:
m_hasColElements = true;
@@ -979,7 +979,7 @@
unsigned borderWidth = 0;
- const BorderValue& tableStartBorder = style()->borderStart();
+ const BorderValue& tableStartBorder = style().borderStart();
if (tableStartBorder.style() == BHIDDEN)
return 0;
if (tableStartBorder.style() > BHIDDEN)
@@ -987,7 +987,7 @@
if (RenderTableCol* column = colElement(0)) {
// FIXME: We don't account for direction on columns and column groups.
- const BorderValue& columnAdjoiningBorder = column->style()->borderStart();
+ const BorderValue& columnAdjoiningBorder = column->style().borderStart();
if (columnAdjoiningBorder.style() == BHIDDEN)
return 0;
if (columnAdjoiningBorder.style() > BHIDDEN)
@@ -1019,7 +1019,7 @@
borderWidth = max(borderWidth, firstRowAdjoiningBorder.width());
}
}
- return (borderWidth + (style()->isLeftToRightDirection() ? 0 : 1)) / 2;
+ return (borderWidth + (style().isLeftToRightDirection() ? 0 : 1)) / 2;
}
int RenderTable::calcBorderEnd() const
@@ -1033,7 +1033,7 @@
unsigned borderWidth = 0;
- const BorderValue& tableEndBorder = style()->borderEnd();
+ const BorderValue& tableEndBorder = style().borderEnd();
if (tableEndBorder.style() == BHIDDEN)
return 0;
if (tableEndBorder.style() > BHIDDEN)
@@ -1042,7 +1042,7 @@
unsigned endColumn = numEffCols() - 1;
if (RenderTableCol* column = colElement(endColumn)) {
// FIXME: We don't account for direction on columns and column groups.
- const BorderValue& columnAdjoiningBorder = column->style()->borderEnd();
+ const BorderValue& columnAdjoiningBorder = column->style().borderEnd();
if (columnAdjoiningBorder.style() == BHIDDEN)
return 0;
if (columnAdjoiningBorder.style() > BHIDDEN)
@@ -1074,7 +1074,7 @@
borderWidth = max(borderWidth, firstRowAdjoiningBorder.width());
}
}
- return (borderWidth + (style()->isLeftToRightDirection() ? 1 : 0)) / 2;
+ return (borderWidth + (style().isLeftToRightDirection() ? 1 : 0)) / 2;
}
void RenderTable::recalcBordersInRowDirection()
@@ -1112,7 +1112,7 @@
if (borderWidth < 0)
return 0; // Overridden by hidden
}
- const BorderValue& tb = style()->borderBefore();
+ const BorderValue& tb = style().borderBefore();
if (tb.style() == BHIDDEN)
return 0;
if (tb.style() > BHIDDEN)
@@ -1131,7 +1131,7 @@
if (borderWidth < 0)
return 0; // Overridden by hidden
}
- const BorderValue& tb = style()->borderAfter();
+ const BorderValue& tb = style().borderAfter();
if (tb.style() == BHIDDEN)
return 0;
if (tb.style() > BHIDDEN)
@@ -1146,11 +1146,11 @@
int borderWidth = 0;
- const BorderValue& tb = style()->borderStart();
+ const BorderValue& tb = style().borderStart();
if (tb.style() == BHIDDEN)
return 0;
if (tb.style() > BHIDDEN)
- borderWidth = (tb.width() + (style()->isLeftToRightDirection() ? 0 : 1)) / 2;
+ borderWidth = (tb.width() + (style().isLeftToRightDirection() ? 0 : 1)) / 2;
bool allHidden = true;
for (RenderTableSection* section = topSection(); section; section = sectionBelow(section)) {
@@ -1173,11 +1173,11 @@
int borderWidth = 0;
- const BorderValue& tb = style()->borderEnd();
+ const BorderValue& tb = style().borderEnd();
if (tb.style() == BHIDDEN)
return 0;
if (tb.style() > BHIDDEN)
- borderWidth = (tb.width() + (style()->isLeftToRightDirection() ? 1 : 0)) / 2;
+ borderWidth = (tb.width() + (style().isLeftToRightDirection() ? 1 : 0)) / 2;
bool allHidden = true;
for (RenderTableSection* section = topSection(); section; section = sectionBelow(section)) {
@@ -1389,7 +1389,7 @@
// supported. When we actually support left/right and stop mapping them to top/bottom,
// we might have to hack this code first (depending on what order we do these bug fixes in).
if (!m_captions.isEmpty()) {
- if (style()->isHorizontalWritingMode()) {
+ if (style().isHorizontalWritingMode()) {
rect.setHeight(height());
rect.setY(location.y());
} else {
@@ -1431,7 +1431,7 @@
RenderTable* RenderTable::createAnonymousWithParentRenderer(const RenderObject* parent)
{
- auto table = new RenderTable(parent->document(), RenderStyle::createAnonymousStyleWithDisplay(parent->style(), TABLE));
+ auto table = new RenderTable(parent->document(), RenderStyle::createAnonymousStyleWithDisplay(&parent->style(), TABLE));
table->initializeStyle();
return table;
}
@@ -1440,18 +1440,18 @@
{
ASSERT(cell->isFirstOrLastCellInRow());
if (hasSameDirectionAs(cell->row()))
- return style()->borderStart();
+ return style().borderStart();
- return style()->borderEnd();
+ return style().borderEnd();
}
const BorderValue& RenderTable::tableEndBorderAdjoiningCell(const RenderTableCell* cell) const
{
ASSERT(cell->isFirstOrLastCellInRow());
if (hasSameDirectionAs(cell->row()))
- return style()->borderEnd();
+ return style().borderEnd();
- return style()->borderStart();
+ return style().borderStart();
}
}
diff --git a/Source/WebCore/rendering/RenderTable.h b/Source/WebCore/rendering/RenderTable.h
index 975499b..babec29 100644
--- a/Source/WebCore/rendering/RenderTable.h
+++ b/Source/WebCore/rendering/RenderTable.h
@@ -51,7 +51,7 @@
int hBorderSpacing() const { return m_hSpacing; }
int vBorderSpacing() const { return m_vSpacing; }
- bool collapseBorders() const { return style()->borderCollapse(); }
+ bool collapseBorders() const { return style().borderCollapse(); }
virtual int borderStart() const OVERRIDE { return m_borderStart; }
virtual int borderEnd() const OVERRIDE { return m_borderEnd; }
@@ -60,33 +60,33 @@
virtual int borderLeft() const OVERRIDE
{
- if (style()->isHorizontalWritingMode())
- return style()->isLeftToRightDirection() ? borderStart() : borderEnd();
- return style()->isFlippedBlocksWritingMode() ? borderAfter() : borderBefore();
+ if (style().isHorizontalWritingMode())
+ return style().isLeftToRightDirection() ? borderStart() : borderEnd();
+ return style().isFlippedBlocksWritingMode() ? borderAfter() : borderBefore();
}
virtual int borderRight() const OVERRIDE
{
- if (style()->isHorizontalWritingMode())
- return style()->isLeftToRightDirection() ? borderEnd() : borderStart();
- return style()->isFlippedBlocksWritingMode() ? borderBefore() : borderAfter();
+ if (style().isHorizontalWritingMode())
+ return style().isLeftToRightDirection() ? borderEnd() : borderStart();
+ return style().isFlippedBlocksWritingMode() ? borderBefore() : borderAfter();
}
virtual int borderTop() const OVERRIDE
{
- if (style()->isHorizontalWritingMode())
- return style()->isFlippedBlocksWritingMode() ? borderAfter() : borderBefore();
- return style()->isLeftToRightDirection() ? borderStart() : borderEnd();
+ if (style().isHorizontalWritingMode())
+ return style().isFlippedBlocksWritingMode() ? borderAfter() : borderBefore();
+ return style().isLeftToRightDirection() ? borderStart() : borderEnd();
}
virtual int borderBottom() const OVERRIDE
{
- if (style()->isHorizontalWritingMode())
- return style()->isFlippedBlocksWritingMode() ? borderBefore() : borderAfter();
- return style()->isLeftToRightDirection() ? borderEnd() : borderStart();
+ if (style().isHorizontalWritingMode())
+ return style().isFlippedBlocksWritingMode() ? borderBefore() : borderAfter();
+ return style().isLeftToRightDirection() ? borderEnd() : borderStart();
}
- Color bgColor() const { return style()->visitedDependentColor(CSSPropertyBackgroundColor); }
+ Color bgColor() const { return style().visitedDependentColor(CSSPropertyBackgroundColor); }
int outerBorderBefore() const;
int outerBorderAfter() const;
@@ -95,30 +95,30 @@
int outerBorderLeft() const
{
- if (style()->isHorizontalWritingMode())
- return style()->isLeftToRightDirection() ? outerBorderStart() : outerBorderEnd();
- return style()->isFlippedBlocksWritingMode() ? outerBorderAfter() : outerBorderBefore();
+ if (style().isHorizontalWritingMode())
+ return style().isLeftToRightDirection() ? outerBorderStart() : outerBorderEnd();
+ return style().isFlippedBlocksWritingMode() ? outerBorderAfter() : outerBorderBefore();
}
int outerBorderRight() const
{
- if (style()->isHorizontalWritingMode())
- return style()->isLeftToRightDirection() ? outerBorderEnd() : outerBorderStart();
- return style()->isFlippedBlocksWritingMode() ? outerBorderBefore() : outerBorderAfter();
+ if (style().isHorizontalWritingMode())
+ return style().isLeftToRightDirection() ? outerBorderEnd() : outerBorderStart();
+ return style().isFlippedBlocksWritingMode() ? outerBorderBefore() : outerBorderAfter();
}
int outerBorderTop() const
{
- if (style()->isHorizontalWritingMode())
- return style()->isFlippedBlocksWritingMode() ? outerBorderAfter() : outerBorderBefore();
- return style()->isLeftToRightDirection() ? outerBorderStart() : outerBorderEnd();
+ if (style().isHorizontalWritingMode())
+ return style().isFlippedBlocksWritingMode() ? outerBorderAfter() : outerBorderBefore();
+ return style().isLeftToRightDirection() ? outerBorderStart() : outerBorderEnd();
}
int outerBorderBottom() const
{
- if (style()->isHorizontalWritingMode())
- return style()->isFlippedBlocksWritingMode() ? outerBorderBefore() : outerBorderAfter();
- return style()->isLeftToRightDirection() ? outerBorderEnd() : outerBorderStart();
+ if (style().isHorizontalWritingMode())
+ return style().isFlippedBlocksWritingMode() ? outerBorderBefore() : outerBorderAfter();
+ return style().isLeftToRightDirection() ? outerBorderEnd() : outerBorderStart();
}
int calcBorderStart() const;
diff --git a/Source/WebCore/rendering/RenderTableCell.cpp b/Source/WebCore/rendering/RenderTableCell.cpp
index 4fb2eab..3a90453 100644
--- a/Source/WebCore/rendering/RenderTableCell.cpp
+++ b/Source/WebCore/rendering/RenderTableCell.cpp
@@ -145,7 +145,7 @@
unsigned colSpanCount = colSpan();
int colWidthSum = 0;
for (unsigned i = 1; i <= colSpanCount; i++) {
- Length colWidth = tableCol->style()->logicalWidth();
+ Length colWidth = tableCol->style().logicalWidth();
// Percentage value should be returned only for colSpan == 1.
// Otherwise we return original width for the cell.
@@ -177,7 +177,7 @@
table()->recalcSectionsIfNeeded();
RenderBlockFlow::computePreferredLogicalWidths();
- if (element() && style()->autoWrap()) {
+ if (element() && style().autoWrap()) {
// See if nowrap was set.
Length w = styleOrColLogicalWidth();
String nowrap = element()->getAttribute(nowrapAttr);
@@ -198,7 +198,7 @@
int logicalHeightWithoutIntrinsicPadding = pixelSnappedLogicalHeight() - oldIntrinsicPaddingBefore - oldIntrinsicPaddingAfter;
int intrinsicPaddingBefore = 0;
- switch (style()->verticalAlign()) {
+ switch (style().verticalAlign()) {
case SUB:
case SUPER:
case TEXT_TOP:
@@ -278,7 +278,7 @@
int result = computedCSSPaddingTop();
if (!isHorizontalWritingMode())
return result;
- return result + (style()->writingMode() == TopToBottomWritingMode ? intrinsicPaddingBefore() : intrinsicPaddingAfter());
+ return result + (style().writingMode() == TopToBottomWritingMode ? intrinsicPaddingBefore() : intrinsicPaddingAfter());
}
LayoutUnit RenderTableCell::paddingBottom() const
@@ -286,7 +286,7 @@
int result = computedCSSPaddingBottom();
if (!isHorizontalWritingMode())
return result;
- return result + (style()->writingMode() == TopToBottomWritingMode ? intrinsicPaddingAfter() : intrinsicPaddingBefore());
+ return result + (style().writingMode() == TopToBottomWritingMode ? intrinsicPaddingAfter() : intrinsicPaddingBefore());
}
LayoutUnit RenderTableCell::paddingLeft() const
@@ -294,7 +294,7 @@
int result = computedCSSPaddingLeft();
if (isHorizontalWritingMode())
return result;
- return result + (style()->writingMode() == LeftToRightWritingMode ? intrinsicPaddingBefore() : intrinsicPaddingAfter());
+ return result + (style().writingMode() == LeftToRightWritingMode ? intrinsicPaddingBefore() : intrinsicPaddingAfter());
}
LayoutUnit RenderTableCell::paddingRight() const
@@ -302,7 +302,7 @@
int result = computedCSSPaddingRight();
if (isHorizontalWritingMode())
return result;
- return result + (style()->writingMode() == LeftToRightWritingMode ? intrinsicPaddingAfter() : intrinsicPaddingBefore());
+ return result + (style().writingMode() == LeftToRightWritingMode ? intrinsicPaddingAfter() : intrinsicPaddingBefore());
}
LayoutUnit RenderTableCell::paddingBefore() const
@@ -341,8 +341,8 @@
if (!table()->collapseBorders() || table()->needsSectionRecalc())
return RenderBlockFlow::clippedOverflowRectForRepaint(repaintContainer);
- bool rtl = !styleForCellFlow()->isLeftToRightDirection();
- int outlineSize = style()->outlineSize();
+ bool rtl = !styleForCellFlow().isLeftToRightDirection();
+ int outlineSize = style().outlineSize();
int left = max(borderHalfLeft(true), outlineSize);
int right = max(borderHalfRight(true), outlineSize);
int top = max(borderHalfTop(true), outlineSize);
@@ -405,24 +405,24 @@
void RenderTableCell::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
{
- ASSERT(style()->display() == TABLE_CELL);
+ ASSERT(style().display() == TABLE_CELL);
ASSERT(!row() || row()->rowIndexWasSet());
RenderBlockFlow::styleDidChange(diff, oldStyle);
setHasBoxDecorations(true);
- if (parent() && section() && oldStyle && style()->height() != oldStyle->height())
+ if (parent() && section() && oldStyle && style().height() != oldStyle->height())
section()->rowLogicalHeightChanged(rowIndex());
// Our intrinsic padding pushes us down to align with the baseline of other cells on the row. If our vertical-align
// has changed then so will the padding needed to align with other cells - clear it so we can recalculate it from scratch.
- if (oldStyle && style()->verticalAlign() != oldStyle->verticalAlign())
+ if (oldStyle && style().verticalAlign() != oldStyle->verticalAlign())
clearIntrinsicPadding();
// If border was changed, notify table.
if (parent()) {
RenderTable* table = this->table();
- if (table && !table->selfNeedsLayout() && !table->normalChildNeedsLayout()&& oldStyle && oldStyle->border() != style()->border())
+ if (table && !table->selfNeedsLayout() && !table->normalChildNeedsLayout()&& oldStyle && oldStyle->border() != style().border())
table->invalidateCollapsedBorders();
}
}
@@ -525,14 +525,14 @@
// For the start border, we need to check, in order of precedence:
// (1) Our start border.
- int startColorProperty = includeColor ? CSSProperty::resolveDirectionAwareProperty(CSSPropertyWebkitBorderStartColor, styleForCellFlow()->direction(), styleForCellFlow()->writingMode()) : 0;
- int endColorProperty = includeColor ? CSSProperty::resolveDirectionAwareProperty(CSSPropertyWebkitBorderEndColor, styleForCellFlow()->direction(), styleForCellFlow()->writingMode()) : 0;
- CollapsedBorderValue result(style()->borderStart(), includeColor ? style()->visitedDependentColor(startColorProperty) : Color(), BCELL);
+ int startColorProperty = includeColor ? CSSProperty::resolveDirectionAwareProperty(CSSPropertyWebkitBorderStartColor, styleForCellFlow().direction(), styleForCellFlow().writingMode()) : 0;
+ int endColorProperty = includeColor ? CSSProperty::resolveDirectionAwareProperty(CSSPropertyWebkitBorderEndColor, styleForCellFlow().direction(), styleForCellFlow().writingMode()) : 0;
+ CollapsedBorderValue result(style().borderStart(), includeColor ? style().visitedDependentColor(startColorProperty) : Color(), BCELL);
// (2) The end border of the preceding cell.
RenderTableCell* cellBefore = table->cellBefore(this);
if (cellBefore) {
- CollapsedBorderValue cellBeforeAdjoiningBorder = CollapsedBorderValue(cellBefore->borderAdjoiningCellAfter(this), includeColor ? cellBefore->style()->visitedDependentColor(endColorProperty) : Color(), BCELL);
+ CollapsedBorderValue cellBeforeAdjoiningBorder = CollapsedBorderValue(cellBefore->borderAdjoiningCellAfter(this), includeColor ? cellBefore->style().visitedDependentColor(endColorProperty) : Color(), BCELL);
// |result| should be the 2nd argument as |cellBefore| should win in case of equality per CSS 2.1 (Border conflict resolution, point 4).
result = chooseBorder(cellBeforeAdjoiningBorder, result);
if (!result.exists())
@@ -542,12 +542,12 @@
bool startBorderAdjoinsTable = hasStartBorderAdjoiningTable();
if (startBorderAdjoinsTable) {
// (3) Our row's start border.
- result = chooseBorder(result, CollapsedBorderValue(row()->borderAdjoiningStartCell(this), includeColor ? parent()->style()->visitedDependentColor(startColorProperty) : Color(), BROW));
+ result = chooseBorder(result, CollapsedBorderValue(row()->borderAdjoiningStartCell(this), includeColor ? parent()->style().visitedDependentColor(startColorProperty) : Color(), BROW));
if (!result.exists())
return result;
// (4) Our row group's start border.
- result = chooseBorder(result, CollapsedBorderValue(section()->borderAdjoiningStartCell(this), includeColor ? section()->style()->visitedDependentColor(startColorProperty) : Color(), BROWGROUP));
+ result = chooseBorder(result, CollapsedBorderValue(section()->borderAdjoiningStartCell(this), includeColor ? section()->style().visitedDependentColor(startColorProperty) : Color(), BROWGROUP));
if (!result.exists())
return result;
}
@@ -558,19 +558,19 @@
if (RenderTableCol* colElt = table->colElement(col(), &startColEdge, &endColEdge)) {
if (colElt->isTableColumnGroup() && startColEdge) {
// The |colElt| is a column group and is also the first colgroup (in case of spanned colgroups).
- result = chooseBorder(result, CollapsedBorderValue(colElt->borderAdjoiningCellStartBorder(this), includeColor ? colElt->style()->visitedDependentColor(startColorProperty) : Color(), BCOLGROUP));
+ result = chooseBorder(result, CollapsedBorderValue(colElt->borderAdjoiningCellStartBorder(this), includeColor ? colElt->style().visitedDependentColor(startColorProperty) : Color(), BCOLGROUP));
if (!result.exists())
return result;
} else if (!colElt->isTableColumnGroup()) {
// We first consider the |colElt| and irrespective of whether it is a spanned col or not, we apply
// its start border. This is as per HTML5 which states that: "For the purposes of the CSS table model,
// the col element is expected to be treated as if it was present as many times as its span attribute specifies".
- result = chooseBorder(result, CollapsedBorderValue(colElt->borderAdjoiningCellStartBorder(this), includeColor ? colElt->style()->visitedDependentColor(startColorProperty) : Color(), BCOL));
+ result = chooseBorder(result, CollapsedBorderValue(colElt->borderAdjoiningCellStartBorder(this), includeColor ? colElt->style().visitedDependentColor(startColorProperty) : Color(), BCOL));
if (!result.exists())
return result;
// Next, apply the start border of the enclosing colgroup but only if it is adjacent to the cell's edge.
if (RenderTableCol* enclosingColumnGroup = colElt->enclosingColumnGroupIfAdjacentBefore()) {
- result = chooseBorder(result, CollapsedBorderValue(enclosingColumnGroup->borderAdjoiningCellStartBorder(this), includeColor ? enclosingColumnGroup->style()->visitedDependentColor(startColorProperty) : Color(), BCOLGROUP));
+ result = chooseBorder(result, CollapsedBorderValue(enclosingColumnGroup->borderAdjoiningCellStartBorder(this), includeColor ? enclosingColumnGroup->style().visitedDependentColor(startColorProperty) : Color(), BCOLGROUP));
if (!result.exists())
return result;
}
@@ -582,18 +582,18 @@
if (RenderTableCol* colElt = table->colElement(col() - 1, &startColEdge, &endColEdge)) {
if (colElt->isTableColumnGroup() && endColEdge) {
// The element is a colgroup and is also the last colgroup (in case of spanned colgroups).
- result = chooseBorder(CollapsedBorderValue(colElt->borderAdjoiningCellAfter(this), includeColor ? colElt->style()->visitedDependentColor(endColorProperty) : Color(), BCOLGROUP), result);
+ result = chooseBorder(CollapsedBorderValue(colElt->borderAdjoiningCellAfter(this), includeColor ? colElt->style().visitedDependentColor(endColorProperty) : Color(), BCOLGROUP), result);
if (!result.exists())
return result;
} else if (colElt->isTableColumn()) {
// Resolve the collapsing border against the col's border ignoring any 'span' as per HTML5.
- result = chooseBorder(CollapsedBorderValue(colElt->borderAdjoiningCellAfter(this), includeColor ? colElt->style()->visitedDependentColor(endColorProperty) : Color(), BCOL), result);
+ result = chooseBorder(CollapsedBorderValue(colElt->borderAdjoiningCellAfter(this), includeColor ? colElt->style().visitedDependentColor(endColorProperty) : Color(), BCOL), result);
if (!result.exists())
return result;
// Next, if the previous col has a parent colgroup then its end border should be applied
// but only if it is adjacent to the cell's edge.
if (RenderTableCol* enclosingColumnGroup = colElt->enclosingColumnGroupIfAdjacentAfter()) {
- result = chooseBorder(CollapsedBorderValue(enclosingColumnGroup->borderAdjoiningCellEndBorder(this), includeColor ? enclosingColumnGroup->style()->visitedDependentColor(endColorProperty) : Color(), BCOLGROUP), result);
+ result = chooseBorder(CollapsedBorderValue(enclosingColumnGroup->borderAdjoiningCellEndBorder(this), includeColor ? enclosingColumnGroup->style().visitedDependentColor(endColorProperty) : Color(), BCOLGROUP), result);
if (!result.exists())
return result;
}
@@ -603,7 +603,7 @@
if (startBorderAdjoinsTable) {
// (7) The table's start border.
- result = chooseBorder(result, CollapsedBorderValue(table->tableStartBorderAdjoiningCell(this), includeColor ? table->style()->visitedDependentColor(startColorProperty) : Color(), BTABLE));
+ result = chooseBorder(result, CollapsedBorderValue(table->tableStartBorderAdjoiningCell(this), includeColor ? table->style().visitedDependentColor(startColorProperty) : Color(), BTABLE));
if (!result.exists())
return result;
}
@@ -628,14 +628,14 @@
// For end border, we need to check, in order of precedence:
// (1) Our end border.
- int startColorProperty = includeColor ? CSSProperty::resolveDirectionAwareProperty(CSSPropertyWebkitBorderStartColor, styleForCellFlow()->direction(), styleForCellFlow()->writingMode()) : 0;
- int endColorProperty = includeColor ? CSSProperty::resolveDirectionAwareProperty(CSSPropertyWebkitBorderEndColor, styleForCellFlow()->direction(), styleForCellFlow()->writingMode()) : 0;
- CollapsedBorderValue result = CollapsedBorderValue(style()->borderEnd(), includeColor ? style()->visitedDependentColor(endColorProperty) : Color(), BCELL);
+ int startColorProperty = includeColor ? CSSProperty::resolveDirectionAwareProperty(CSSPropertyWebkitBorderStartColor, styleForCellFlow().direction(), styleForCellFlow().writingMode()) : 0;
+ int endColorProperty = includeColor ? CSSProperty::resolveDirectionAwareProperty(CSSPropertyWebkitBorderEndColor, styleForCellFlow().direction(), styleForCellFlow().writingMode()) : 0;
+ CollapsedBorderValue result = CollapsedBorderValue(style().borderEnd(), includeColor ? style().visitedDependentColor(endColorProperty) : Color(), BCELL);
// (2) The start border of the following cell.
if (!isEndColumn) {
if (RenderTableCell* cellAfter = table->cellAfter(this)) {
- CollapsedBorderValue cellAfterAdjoiningBorder = CollapsedBorderValue(cellAfter->borderAdjoiningCellBefore(this), includeColor ? cellAfter->style()->visitedDependentColor(startColorProperty) : Color(), BCELL);
+ CollapsedBorderValue cellAfterAdjoiningBorder = CollapsedBorderValue(cellAfter->borderAdjoiningCellBefore(this), includeColor ? cellAfter->style().visitedDependentColor(startColorProperty) : Color(), BCELL);
result = chooseBorder(result, cellAfterAdjoiningBorder);
if (!result.exists())
return result;
@@ -645,12 +645,12 @@
bool endBorderAdjoinsTable = hasEndBorderAdjoiningTable();
if (endBorderAdjoinsTable) {
// (3) Our row's end border.
- result = chooseBorder(result, CollapsedBorderValue(row()->borderAdjoiningEndCell(this), includeColor ? parent()->style()->visitedDependentColor(endColorProperty) : Color(), BROW));
+ result = chooseBorder(result, CollapsedBorderValue(row()->borderAdjoiningEndCell(this), includeColor ? parent()->style().visitedDependentColor(endColorProperty) : Color(), BROW));
if (!result.exists())
return result;
// (4) Our row group's end border.
- result = chooseBorder(result, CollapsedBorderValue(section()->borderAdjoiningEndCell(this), includeColor ? section()->style()->visitedDependentColor(endColorProperty) : Color(), BROWGROUP));
+ result = chooseBorder(result, CollapsedBorderValue(section()->borderAdjoiningEndCell(this), includeColor ? section()->style().visitedDependentColor(endColorProperty) : Color(), BROWGROUP));
if (!result.exists())
return result;
}
@@ -661,19 +661,19 @@
if (RenderTableCol* colElt = table->colElement(col() + colSpan() - 1, &startColEdge, &endColEdge)) {
if (colElt->isTableColumnGroup() && endColEdge) {
// The element is a colgroup and is also the last colgroup (in case of spanned colgroups).
- result = chooseBorder(result, CollapsedBorderValue(colElt->borderAdjoiningCellEndBorder(this), includeColor ? colElt->style()->visitedDependentColor(endColorProperty) : Color(), BCOLGROUP));
+ result = chooseBorder(result, CollapsedBorderValue(colElt->borderAdjoiningCellEndBorder(this), includeColor ? colElt->style().visitedDependentColor(endColorProperty) : Color(), BCOLGROUP));
if (!result.exists())
return result;
} else if (!colElt->isTableColumnGroup()) {
// First apply the end border of the column irrespective of whether it is spanned or not. This is as per
// HTML5 which states that: "For the purposes of the CSS table model, the col element is expected to be
// treated as if it was present as many times as its span attribute specifies".
- result = chooseBorder(result, CollapsedBorderValue(colElt->borderAdjoiningCellEndBorder(this), includeColor ? colElt->style()->visitedDependentColor(endColorProperty) : Color(), BCOL));
+ result = chooseBorder(result, CollapsedBorderValue(colElt->borderAdjoiningCellEndBorder(this), includeColor ? colElt->style().visitedDependentColor(endColorProperty) : Color(), BCOL));
if (!result.exists())
return result;
// Next, if it has a parent colgroup then we apply its end border but only if it is adjacent to the cell.
if (RenderTableCol* enclosingColumnGroup = colElt->enclosingColumnGroupIfAdjacentAfter()) {
- result = chooseBorder(result, CollapsedBorderValue(enclosingColumnGroup->borderAdjoiningCellEndBorder(this), includeColor ? enclosingColumnGroup->style()->visitedDependentColor(endColorProperty) : Color(), BCOLGROUP));
+ result = chooseBorder(result, CollapsedBorderValue(enclosingColumnGroup->borderAdjoiningCellEndBorder(this), includeColor ? enclosingColumnGroup->style().visitedDependentColor(endColorProperty) : Color(), BCOLGROUP));
if (!result.exists())
return result;
}
@@ -685,17 +685,17 @@
if (RenderTableCol* colElt = table->colElement(col() + colSpan(), &startColEdge, &endColEdge)) {
if (colElt->isTableColumnGroup() && startColEdge) {
// This case is a colgroup without any col, we only compute it if it is adjacent to the cell's edge.
- result = chooseBorder(result, CollapsedBorderValue(colElt->borderAdjoiningCellBefore(this), includeColor ? colElt->style()->visitedDependentColor(startColorProperty) : Color(), BCOLGROUP));
+ result = chooseBorder(result, CollapsedBorderValue(colElt->borderAdjoiningCellBefore(this), includeColor ? colElt->style().visitedDependentColor(startColorProperty) : Color(), BCOLGROUP));
if (!result.exists())
return result;
} else if (colElt->isTableColumn()) {
// Resolve the collapsing border against the col's border ignoring any 'span' as per HTML5.
- result = chooseBorder(result, CollapsedBorderValue(colElt->borderAdjoiningCellBefore(this), includeColor ? colElt->style()->visitedDependentColor(startColorProperty) : Color(), BCOL));
+ result = chooseBorder(result, CollapsedBorderValue(colElt->borderAdjoiningCellBefore(this), includeColor ? colElt->style().visitedDependentColor(startColorProperty) : Color(), BCOL));
if (!result.exists())
return result;
// If we have a parent colgroup, resolve the border only if it is adjacent to the cell.
if (RenderTableCol* enclosingColumnGroup = colElt->enclosingColumnGroupIfAdjacentBefore()) {
- result = chooseBorder(result, CollapsedBorderValue(enclosingColumnGroup->borderAdjoiningCellStartBorder(this), includeColor ? enclosingColumnGroup->style()->visitedDependentColor(startColorProperty) : Color(), BCOLGROUP));
+ result = chooseBorder(result, CollapsedBorderValue(enclosingColumnGroup->borderAdjoiningCellStartBorder(this), includeColor ? enclosingColumnGroup->style().visitedDependentColor(startColorProperty) : Color(), BCOLGROUP));
if (!result.exists())
return result;
}
@@ -705,7 +705,7 @@
if (endBorderAdjoinsTable) {
// (7) The table's end border.
- result = chooseBorder(result, CollapsedBorderValue(table->tableEndBorderAdjoiningCell(this), includeColor ? table->style()->visitedDependentColor(endColorProperty) : Color(), BTABLE));
+ result = chooseBorder(result, CollapsedBorderValue(table->tableEndBorderAdjoiningCell(this), includeColor ? table->style().visitedDependentColor(endColorProperty) : Color(), BTABLE));
if (!result.exists())
return result;
}
@@ -727,20 +727,20 @@
// For before border, we need to check, in order of precedence:
// (1) Our before border.
- int beforeColorProperty = includeColor ? CSSProperty::resolveDirectionAwareProperty(CSSPropertyWebkitBorderBeforeColor, styleForCellFlow()->direction(), styleForCellFlow()->writingMode()) : 0;
- int afterColorProperty = includeColor ? CSSProperty::resolveDirectionAwareProperty(CSSPropertyWebkitBorderAfterColor, styleForCellFlow()->direction(), styleForCellFlow()->writingMode()) : 0;
- CollapsedBorderValue result = CollapsedBorderValue(style()->borderBefore(), includeColor ? style()->visitedDependentColor(beforeColorProperty) : Color(), BCELL);
+ int beforeColorProperty = includeColor ? CSSProperty::resolveDirectionAwareProperty(CSSPropertyWebkitBorderBeforeColor, styleForCellFlow().direction(), styleForCellFlow().writingMode()) : 0;
+ int afterColorProperty = includeColor ? CSSProperty::resolveDirectionAwareProperty(CSSPropertyWebkitBorderAfterColor, styleForCellFlow().direction(), styleForCellFlow().writingMode()) : 0;
+ CollapsedBorderValue result = CollapsedBorderValue(style().borderBefore(), includeColor ? style().visitedDependentColor(beforeColorProperty) : Color(), BCELL);
RenderTableCell* prevCell = table->cellAbove(this);
if (prevCell) {
// (2) A before cell's after border.
- result = chooseBorder(CollapsedBorderValue(prevCell->style()->borderAfter(), includeColor ? prevCell->style()->visitedDependentColor(afterColorProperty) : Color(), BCELL), result);
+ result = chooseBorder(CollapsedBorderValue(prevCell->style().borderAfter(), includeColor ? prevCell->style().visitedDependentColor(afterColorProperty) : Color(), BCELL), result);
if (!result.exists())
return result;
}
// (3) Our row's before border.
- result = chooseBorder(result, CollapsedBorderValue(parent()->style()->borderBefore(), includeColor ? parent()->style()->visitedDependentColor(beforeColorProperty) : Color(), BROW));
+ result = chooseBorder(result, CollapsedBorderValue(parent()->style().borderBefore(), includeColor ? parent()->style().visitedDependentColor(beforeColorProperty) : Color(), BROW));
if (!result.exists())
return result;
@@ -753,7 +753,7 @@
prevRow = prevCell->section()->lastRow();
if (prevRow) {
- result = chooseBorder(CollapsedBorderValue(prevRow->style()->borderAfter(), includeColor ? prevRow->style()->visitedDependentColor(afterColorProperty) : Color(), BROW), result);
+ result = chooseBorder(CollapsedBorderValue(prevRow->style().borderAfter(), includeColor ? prevRow->style().visitedDependentColor(afterColorProperty) : Color(), BROW), result);
if (!result.exists())
return result;
}
@@ -763,14 +763,14 @@
RenderTableSection* currSection = section();
if (!rowIndex()) {
// (5) Our row group's before border.
- result = chooseBorder(result, CollapsedBorderValue(currSection->style()->borderBefore(), includeColor ? currSection->style()->visitedDependentColor(beforeColorProperty) : Color(), BROWGROUP));
+ result = chooseBorder(result, CollapsedBorderValue(currSection->style().borderBefore(), includeColor ? currSection->style().visitedDependentColor(beforeColorProperty) : Color(), BROWGROUP));
if (!result.exists())
return result;
// (6) Previous row group's after border.
currSection = table->sectionAbove(currSection, SkipEmptySections);
if (currSection) {
- result = chooseBorder(CollapsedBorderValue(currSection->style()->borderAfter(), includeColor ? currSection->style()->visitedDependentColor(afterColorProperty) : Color(), BROWGROUP), result);
+ result = chooseBorder(CollapsedBorderValue(currSection->style().borderAfter(), includeColor ? currSection->style().visitedDependentColor(afterColorProperty) : Color(), BROWGROUP), result);
if (!result.exists())
return result;
}
@@ -780,18 +780,18 @@
// (8) Our column and column group's before borders.
RenderTableCol* colElt = table->colElement(col());
if (colElt) {
- result = chooseBorder(result, CollapsedBorderValue(colElt->style()->borderBefore(), includeColor ? colElt->style()->visitedDependentColor(beforeColorProperty) : Color(), BCOL));
+ result = chooseBorder(result, CollapsedBorderValue(colElt->style().borderBefore(), includeColor ? colElt->style().visitedDependentColor(beforeColorProperty) : Color(), BCOL));
if (!result.exists())
return result;
if (RenderTableCol* enclosingColumnGroup = colElt->enclosingColumnGroup()) {
- result = chooseBorder(result, CollapsedBorderValue(enclosingColumnGroup->style()->borderBefore(), includeColor ? enclosingColumnGroup->style()->visitedDependentColor(beforeColorProperty) : Color(), BCOLGROUP));
+ result = chooseBorder(result, CollapsedBorderValue(enclosingColumnGroup->style().borderBefore(), includeColor ? enclosingColumnGroup->style().visitedDependentColor(beforeColorProperty) : Color(), BCOLGROUP));
if (!result.exists())
return result;
}
}
// (9) The table's before border.
- result = chooseBorder(result, CollapsedBorderValue(table->style()->borderBefore(), includeColor ? table->style()->visitedDependentColor(beforeColorProperty) : Color(), BTABLE));
+ result = chooseBorder(result, CollapsedBorderValue(table->style().borderBefore(), includeColor ? table->style().visitedDependentColor(beforeColorProperty) : Color(), BTABLE));
if (!result.exists())
return result;
}
@@ -813,26 +813,26 @@
// For after border, we need to check, in order of precedence:
// (1) Our after border.
- int beforeColorProperty = includeColor ? CSSProperty::resolveDirectionAwareProperty(CSSPropertyWebkitBorderBeforeColor, styleForCellFlow()->direction(), styleForCellFlow()->writingMode()) : 0;
- int afterColorProperty = includeColor ? CSSProperty::resolveDirectionAwareProperty(CSSPropertyWebkitBorderAfterColor, styleForCellFlow()->direction(), styleForCellFlow()->writingMode()) : 0;
- CollapsedBorderValue result = CollapsedBorderValue(style()->borderAfter(), includeColor ? style()->visitedDependentColor(afterColorProperty) : Color(), BCELL);
+ int beforeColorProperty = includeColor ? CSSProperty::resolveDirectionAwareProperty(CSSPropertyWebkitBorderBeforeColor, styleForCellFlow().direction(), styleForCellFlow().writingMode()) : 0;
+ int afterColorProperty = includeColor ? CSSProperty::resolveDirectionAwareProperty(CSSPropertyWebkitBorderAfterColor, styleForCellFlow().direction(), styleForCellFlow().writingMode()) : 0;
+ CollapsedBorderValue result = CollapsedBorderValue(style().borderAfter(), includeColor ? style().visitedDependentColor(afterColorProperty) : Color(), BCELL);
RenderTableCell* nextCell = table->cellBelow(this);
if (nextCell) {
// (2) An after cell's before border.
- result = chooseBorder(result, CollapsedBorderValue(nextCell->style()->borderBefore(), includeColor ? nextCell->style()->visitedDependentColor(beforeColorProperty) : Color(), BCELL));
+ result = chooseBorder(result, CollapsedBorderValue(nextCell->style().borderBefore(), includeColor ? nextCell->style().visitedDependentColor(beforeColorProperty) : Color(), BCELL));
if (!result.exists())
return result;
}
// (3) Our row's after border. (FIXME: Deal with rowspan!)
- result = chooseBorder(result, CollapsedBorderValue(parent()->style()->borderAfter(), includeColor ? parent()->style()->visitedDependentColor(afterColorProperty) : Color(), BROW));
+ result = chooseBorder(result, CollapsedBorderValue(parent()->style().borderAfter(), includeColor ? parent()->style().visitedDependentColor(afterColorProperty) : Color(), BROW));
if (!result.exists())
return result;
// (4) The next row's before border.
if (nextCell) {
- result = chooseBorder(result, CollapsedBorderValue(nextCell->parent()->style()->borderBefore(), includeColor ? nextCell->parent()->style()->visitedDependentColor(beforeColorProperty) : Color(), BROW));
+ result = chooseBorder(result, CollapsedBorderValue(nextCell->parent()->style().borderBefore(), includeColor ? nextCell->parent()->style().visitedDependentColor(beforeColorProperty) : Color(), BROW));
if (!result.exists())
return result;
}
@@ -841,14 +841,14 @@
RenderTableSection* currSection = section();
if (rowIndex() + rowSpan() >= currSection->numRows()) {
// (5) Our row group's after border.
- result = chooseBorder(result, CollapsedBorderValue(currSection->style()->borderAfter(), includeColor ? currSection->style()->visitedDependentColor(afterColorProperty) : Color(), BROWGROUP));
+ result = chooseBorder(result, CollapsedBorderValue(currSection->style().borderAfter(), includeColor ? currSection->style().visitedDependentColor(afterColorProperty) : Color(), BROWGROUP));
if (!result.exists())
return result;
// (6) Following row group's before border.
currSection = table->sectionBelow(currSection, SkipEmptySections);
if (currSection) {
- result = chooseBorder(result, CollapsedBorderValue(currSection->style()->borderBefore(), includeColor ? currSection->style()->visitedDependentColor(beforeColorProperty) : Color(), BROWGROUP));
+ result = chooseBorder(result, CollapsedBorderValue(currSection->style().borderBefore(), includeColor ? currSection->style().visitedDependentColor(beforeColorProperty) : Color(), BROWGROUP));
if (!result.exists())
return result;
}
@@ -858,17 +858,17 @@
// (8) Our column and column group's after borders.
RenderTableCol* colElt = table->colElement(col());
if (colElt) {
- result = chooseBorder(result, CollapsedBorderValue(colElt->style()->borderAfter(), includeColor ? colElt->style()->visitedDependentColor(afterColorProperty) : Color(), BCOL));
+ result = chooseBorder(result, CollapsedBorderValue(colElt->style().borderAfter(), includeColor ? colElt->style().visitedDependentColor(afterColorProperty) : Color(), BCOL));
if (!result.exists()) return result;
if (RenderTableCol* enclosingColumnGroup = colElt->enclosingColumnGroup()) {
- result = chooseBorder(result, CollapsedBorderValue(enclosingColumnGroup->style()->borderAfter(), includeColor ? enclosingColumnGroup->style()->visitedDependentColor(afterColorProperty) : Color(), BCOLGROUP));
+ result = chooseBorder(result, CollapsedBorderValue(enclosingColumnGroup->style().borderAfter(), includeColor ? enclosingColumnGroup->style().visitedDependentColor(afterColorProperty) : Color(), BCOLGROUP));
if (!result.exists())
return result;
}
}
// (9) The table's after border.
- result = chooseBorder(result, CollapsedBorderValue(table->style()->borderAfter(), includeColor ? table->style()->visitedDependentColor(afterColorProperty) : Color(), BTABLE));
+ result = chooseBorder(result, CollapsedBorderValue(table->style().borderAfter(), includeColor ? table->style().visitedDependentColor(afterColorProperty) : Color(), BTABLE));
if (!result.exists())
return result;
}
@@ -976,41 +976,41 @@
int RenderTableCell::borderHalfLeft(bool outer) const
{
- const RenderStyle* styleForCellFlow = this->styleForCellFlow();
- if (styleForCellFlow->isHorizontalWritingMode())
- return styleForCellFlow->isLeftToRightDirection() ? borderHalfStart(outer) : borderHalfEnd(outer);
- return styleForCellFlow->isFlippedBlocksWritingMode() ? borderHalfAfter(outer) : borderHalfBefore(outer);
+ const RenderStyle& styleForCellFlow = this->styleForCellFlow();
+ if (styleForCellFlow.isHorizontalWritingMode())
+ return styleForCellFlow.isLeftToRightDirection() ? borderHalfStart(outer) : borderHalfEnd(outer);
+ return styleForCellFlow.isFlippedBlocksWritingMode() ? borderHalfAfter(outer) : borderHalfBefore(outer);
}
int RenderTableCell::borderHalfRight(bool outer) const
{
- const RenderStyle* styleForCellFlow = this->styleForCellFlow();
- if (styleForCellFlow->isHorizontalWritingMode())
- return styleForCellFlow->isLeftToRightDirection() ? borderHalfEnd(outer) : borderHalfStart(outer);
- return styleForCellFlow->isFlippedBlocksWritingMode() ? borderHalfBefore(outer) : borderHalfAfter(outer);
+ const RenderStyle& styleForCellFlow = this->styleForCellFlow();
+ if (styleForCellFlow.isHorizontalWritingMode())
+ return styleForCellFlow.isLeftToRightDirection() ? borderHalfEnd(outer) : borderHalfStart(outer);
+ return styleForCellFlow.isFlippedBlocksWritingMode() ? borderHalfBefore(outer) : borderHalfAfter(outer);
}
int RenderTableCell::borderHalfTop(bool outer) const
{
- const RenderStyle* styleForCellFlow = this->styleForCellFlow();
- if (styleForCellFlow->isHorizontalWritingMode())
- return styleForCellFlow->isFlippedBlocksWritingMode() ? borderHalfAfter(outer) : borderHalfBefore(outer);
- return styleForCellFlow->isLeftToRightDirection() ? borderHalfStart(outer) : borderHalfEnd(outer);
+ const RenderStyle& styleForCellFlow = this->styleForCellFlow();
+ if (styleForCellFlow.isHorizontalWritingMode())
+ return styleForCellFlow.isFlippedBlocksWritingMode() ? borderHalfAfter(outer) : borderHalfBefore(outer);
+ return styleForCellFlow.isLeftToRightDirection() ? borderHalfStart(outer) : borderHalfEnd(outer);
}
int RenderTableCell::borderHalfBottom(bool outer) const
{
- const RenderStyle* styleForCellFlow = this->styleForCellFlow();
- if (styleForCellFlow->isHorizontalWritingMode())
- return styleForCellFlow->isFlippedBlocksWritingMode() ? borderHalfBefore(outer) : borderHalfAfter(outer);
- return styleForCellFlow->isLeftToRightDirection() ? borderHalfEnd(outer) : borderHalfStart(outer);
+ const RenderStyle& styleForCellFlow = this->styleForCellFlow();
+ if (styleForCellFlow.isHorizontalWritingMode())
+ return styleForCellFlow.isFlippedBlocksWritingMode() ? borderHalfBefore(outer) : borderHalfAfter(outer);
+ return styleForCellFlow.isLeftToRightDirection() ? borderHalfEnd(outer) : borderHalfStart(outer);
}
int RenderTableCell::borderHalfStart(bool outer) const
{
CollapsedBorderValue border = collapsedStartBorder(DoNotIncludeBorderColor);
if (border.exists())
- return (border.width() + ((styleForCellFlow()->isLeftToRightDirection() ^ outer) ? 1 : 0)) / 2; // Give the extra pixel to top and left.
+ return (border.width() + ((styleForCellFlow().isLeftToRightDirection() ^ outer) ? 1 : 0)) / 2; // Give the extra pixel to top and left.
return 0;
}
@@ -1018,7 +1018,7 @@
{
CollapsedBorderValue border = collapsedEndBorder(DoNotIncludeBorderColor);
if (border.exists())
- return (border.width() + ((styleForCellFlow()->isLeftToRightDirection() ^ outer) ? 0 : 1)) / 2;
+ return (border.width() + ((styleForCellFlow().isLeftToRightDirection() ^ outer) ? 0 : 1)) / 2;
return 0;
}
@@ -1026,7 +1026,7 @@
{
CollapsedBorderValue border = collapsedBeforeBorder(DoNotIncludeBorderColor);
if (border.exists())
- return (border.width() + ((styleForCellFlow()->isFlippedBlocksWritingMode() ^ outer) ? 0 : 1)) / 2; // Give the extra pixel to top and left.
+ return (border.width() + ((styleForCellFlow().isFlippedBlocksWritingMode() ^ outer) ? 0 : 1)) / 2; // Give the extra pixel to top and left.
return 0;
}
@@ -1034,7 +1034,7 @@
{
CollapsedBorderValue border = collapsedAfterBorder(DoNotIncludeBorderColor);
if (border.exists())
- return (border.width() + ((styleForCellFlow()->isFlippedBlocksWritingMode() ^ outer) ? 1 : 0)) / 2;
+ return (border.width() + ((styleForCellFlow().isFlippedBlocksWritingMode() ^ outer) ? 1 : 0)) / 2;
return 0;
}
@@ -1140,9 +1140,9 @@
bool RenderTableCell::alignLeftRightBorderPaintRect(int& leftXOffset, int& rightXOffset)
{
- const RenderStyle* styleForTopCell = styleForCellFlow();
- int left = cachedCollapsedLeftBorder(styleForTopCell).width();
- int right = cachedCollapsedRightBorder(styleForTopCell).width();
+ const RenderStyle& styleForTopCell = styleForCellFlow();
+ int left = cachedCollapsedLeftBorder(&styleForTopCell).width();
+ int right = cachedCollapsedRightBorder(&styleForTopCell).width();
leftXOffset = max<int>(leftXOffset, left);
rightXOffset = max<int>(rightXOffset, right);
if (colSpan() > 1)
@@ -1152,9 +1152,9 @@
bool RenderTableCell::alignTopBottomBorderPaintRect(int& topYOffset, int& bottomYOffset)
{
- const RenderStyle* styleForBottomCell = styleForCellFlow();
- int top = cachedCollapsedTopBorder(styleForBottomCell).width();
- int bottom = cachedCollapsedBottomBorder(styleForBottomCell).width();
+ const RenderStyle& styleForBottomCell = styleForCellFlow();
+ int top = cachedCollapsedTopBorder(&styleForBottomCell).width();
+ int bottom = cachedCollapsedBottomBorder(&styleForBottomCell).width();
topYOffset = max<int>(topYOffset, top);
bottomYOffset = max<int>(bottomYOffset, bottom);
if (rowSpan() > 1)
@@ -1167,7 +1167,7 @@
{
ASSERT(paintInfo.phase == PaintPhaseCollapsedTableBorders);
- if (!paintInfo.shouldPaintWithinRoot(*this) || style()->visibility() != VISIBLE)
+ if (!paintInfo.shouldPaintWithinRoot(*this) || style().visibility() != VISIBLE)
return;
LayoutRect localRepaintRect = paintInfo.rect;
@@ -1184,11 +1184,11 @@
if (!table()->currentBorderValue() || graphicsContext->paintingDisabled())
return;
- const RenderStyle* styleForCellFlow = this->styleForCellFlow();
- CollapsedBorderValue leftVal = cachedCollapsedLeftBorder(styleForCellFlow);
- CollapsedBorderValue rightVal = cachedCollapsedRightBorder(styleForCellFlow);
- CollapsedBorderValue topVal = cachedCollapsedTopBorder(styleForCellFlow);
- CollapsedBorderValue bottomVal = cachedCollapsedBottomBorder(styleForCellFlow);
+ const RenderStyle& styleForCellFlow = this->styleForCellFlow();
+ CollapsedBorderValue leftVal = cachedCollapsedLeftBorder(&styleForCellFlow);
+ CollapsedBorderValue rightVal = cachedCollapsedRightBorder(&styleForCellFlow);
+ CollapsedBorderValue topVal = cachedCollapsedTopBorder(&styleForCellFlow);
+ CollapsedBorderValue bottomVal = cachedCollapsedBottomBorder(&styleForCellFlow);
// Adjust our x/y/width/height so that we paint the collapsed borders at the correct location.
int topWidth = topVal.width();
@@ -1207,23 +1207,23 @@
// We use the direction/writing-mode given by the section here because we want to know if we're
// at the section's edge.
- bool shouldDrawTopBorder = !cellAtTop(section()->style());
- bool shouldDrawLeftBorder = !cellAtLeft(section()->style());
+ bool shouldDrawTopBorder = !cellAtTop(§ion()->style());
+ bool shouldDrawLeftBorder = !cellAtLeft(§ion()->style());
bool shouldDrawRightBorder = true;
- if (RenderTableCell* top = cellAtTop(styleForCellFlow)) {
+ if (RenderTableCell* top = cellAtTop(&styleForCellFlow)) {
shouldDrawTopBorder = shouldDrawTopBorder && top->alignLeftRightBorderPaintRect(leftXOffsetTop, rightXOffsetTop);
if (this->colSpan() > 1)
shouldDrawTopBorder = false;
}
- if (RenderTableCell* bottom = cellAtBottom(styleForCellFlow))
+ if (RenderTableCell* bottom = cellAtBottom(&styleForCellFlow))
bottom->alignLeftRightBorderPaintRect(leftXOffsetBottom, rightXOffsetBottom);
- if (RenderTableCell* left = cellAtLeft(styleForCellFlow))
+ if (RenderTableCell* left = cellAtLeft(&styleForCellFlow))
shouldDrawLeftBorder = shouldDrawLeftBorder && left->alignTopBottomBorderPaintRect(topYOffsetLeft, bottomYOffsetLeft);
- if (RenderTableCell* right = cellAtRight(styleForCellFlow))
+ if (RenderTableCell* right = cellAtRight(&styleForCellFlow))
shouldDrawRightBorder = right->alignTopBottomBorderPaintRect(topYOffsetRight, bottomYOffsetRight);
IntRect cellRect = pixelSnappedIntRect(paintRect.x(), paintRect.y(), paintRect.width(), paintRect.height());
@@ -1283,19 +1283,19 @@
if (!backgroundObject)
return;
- if (style()->visibility() != VISIBLE)
+ if (style().visibility() != VISIBLE)
return;
RenderTable* tableElt = table();
- if (!tableElt->collapseBorders() && style()->emptyCells() == HIDE && !firstChild())
+ if (!tableElt->collapseBorders() && style().emptyCells() == HIDE && !firstChild())
return;
LayoutPoint adjustedPaintOffset = paintOffset;
if (backgroundObject != this)
adjustedPaintOffset.moveBy(location());
- Color c = backgroundObject->style()->visitedDependentColor(CSSPropertyBackgroundColor);
- const FillLayer* bgLayer = backgroundObject->style()->backgroundLayers();
+ Color c = backgroundObject->style().visitedDependentColor(CSSPropertyBackgroundColor);
+ const FillLayer* bgLayer = backgroundObject->style().backgroundLayers();
if (bgLayer->hasImage() || c.isValid()) {
// We have to clip here because the background would paint
@@ -1317,30 +1317,30 @@
return;
RenderTable* tableElt = table();
- if (!tableElt->collapseBorders() && style()->emptyCells() == HIDE && !firstChild())
+ if (!tableElt->collapseBorders() && style().emptyCells() == HIDE && !firstChild())
return;
LayoutRect paintRect = LayoutRect(paintOffset, pixelSnappedSize());
- paintBoxShadow(paintInfo, paintRect, style(), Normal);
+ paintBoxShadow(paintInfo, paintRect, &style(), Normal);
// Paint our cell background.
paintBackgroundsBehindCell(paintInfo, paintOffset, this);
- paintBoxShadow(paintInfo, paintRect, style(), Inset);
+ paintBoxShadow(paintInfo, paintRect, &style(), Inset);
- if (!style()->hasBorder() || tableElt->collapseBorders())
+ if (!style().hasBorder() || tableElt->collapseBorders())
return;
- paintBorder(paintInfo, paintRect, style());
+ paintBorder(paintInfo, paintRect, &style());
}
void RenderTableCell::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
- if (style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask)
+ if (style().visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask)
return;
RenderTable* tableElt = table();
- if (!tableElt->collapseBorders() && style()->emptyCells() == HIDE && !firstChild())
+ if (!tableElt->collapseBorders() && style().emptyCells() == HIDE && !firstChild())
return;
paintMaskImages(paintInfo, LayoutRect(paintOffset, pixelSnappedSize()));
@@ -1363,7 +1363,7 @@
return;
// Shrink our intrinsic padding as much as possible to accommodate the scrollbar.
- if (style()->verticalAlign() == MIDDLE) {
+ if (style().verticalAlign() == MIDDLE) {
LayoutUnit totalHeight = logicalHeight();
LayoutUnit heightWithoutIntrinsicPadding = totalHeight - intrinsicPaddingBefore() - intrinsicPaddingAfter();
totalHeight -= scrollbarHeight;
@@ -1377,7 +1377,7 @@
RenderTableCell* RenderTableCell::createAnonymousWithParentRenderer(const RenderObject* parent)
{
- auto cell = new RenderTableCell(parent->document(), RenderStyle::createAnonymousStyleWithDisplay(parent->style(), TABLE_CELL));
+ auto cell = new RenderTableCell(parent->document(), RenderStyle::createAnonymousStyleWithDisplay(&parent->style(), TABLE_CELL));
cell->initializeStyle();
return cell;
}
diff --git a/Source/WebCore/rendering/RenderTableCell.h b/Source/WebCore/rendering/RenderTableCell.h
index c54be51..85684cf 100644
--- a/Source/WebCore/rendering/RenderTableCell.h
+++ b/Source/WebCore/rendering/RenderTableCell.h
@@ -87,7 +87,7 @@
Length styleOrColLogicalWidth() const
{
- Length styleWidth = style()->logicalWidth();
+ Length styleWidth = style().logicalWidth();
if (!styleWidth.isAuto())
return styleWidth;
if (RenderTableCol* firstColumn = table()->colElement(col()))
@@ -99,10 +99,10 @@
{
// FIXME: This function does too much work, and is very hot during table layout!
int adjustedLogicalHeight = pixelSnappedLogicalHeight() - (intrinsicPaddingBefore() + intrinsicPaddingAfter());
- int styleLogicalHeight = valueForLength(style()->logicalHeight(), 0);
+ int styleLogicalHeight = valueForLength(style().logicalHeight(), 0);
// In strict mode, box-sizing: content-box do the right thing and actually add in the border and padding.
// Call computedCSSPadding* directly to avoid including implicitPadding.
- if (!document().inQuirksMode() && style()->boxSizing() != BORDER_BOX)
+ if (!document().inQuirksMode() && style().boxSizing() != BORDER_BOX)
styleLogicalHeight += (computedCSSPaddingBefore() + computedCSSPaddingAfter()).floor() + borderBefore() + borderAfter();
return std::max(styleLogicalHeight, adjustedLogicalHeight);
}
@@ -134,7 +134,7 @@
LayoutUnit cellBaselinePosition() const;
bool isBaselineAligned() const
{
- EVerticalAlign va = style()->verticalAlign();
+ EVerticalAlign va = style().verticalAlign();
return va == BASELINE || va == TEXT_BOTTOM || va == TEXT_TOP || va == SUPER || va == SUB || va == LENGTH;
}
@@ -173,7 +173,7 @@
// This means we can safely use the same style in all cases to simplify our code.
// FIXME: Eventually this function should replaced by style() once we support direction
// on all table parts and writing-mode on cells.
- const RenderStyle* styleForCellFlow() const
+ const RenderStyle& styleForCellFlow() const
{
return row()->style();
}
@@ -182,32 +182,32 @@
{
ASSERT(isFirstOrLastCellInRow());
if (section()->hasSameDirectionAs(table()))
- return style()->borderStart();
+ return style().borderStart();
- return style()->borderEnd();
+ return style().borderEnd();
}
const BorderValue& borderAdjoiningTableEnd() const
{
ASSERT(isFirstOrLastCellInRow());
if (section()->hasSameDirectionAs(table()))
- return style()->borderEnd();
+ return style().borderEnd();
- return style()->borderStart();
+ return style().borderStart();
}
const BorderValue& borderAdjoiningCellBefore(const RenderTableCell* cell)
{
ASSERT_UNUSED(cell, table()->cellAfter(cell) == this);
// FIXME: https://webkit.org/b/79272 - Add support for mixed directionality at the cell level.
- return style()->borderStart();
+ return style().borderStart();
}
const BorderValue& borderAdjoiningCellAfter(const RenderTableCell* cell)
{
ASSERT_UNUSED(cell, table()->cellBefore(cell) == this);
// FIXME: https://webkit.org/b/79272 - Add support for mixed directionality at the cell level.
- return style()->borderEnd();
+ return style().borderEnd();
}
using RenderBlockFlow::nodeAtPoint;
diff --git a/Source/WebCore/rendering/RenderTableCol.cpp b/Source/WebCore/rendering/RenderTableCol.cpp
index 23f1897..4a7868e 100644
--- a/Source/WebCore/rendering/RenderTableCol.cpp
+++ b/Source/WebCore/rendering/RenderTableCol.cpp
@@ -51,7 +51,7 @@
// If border was changed, notify table.
if (parent()) {
RenderTable* table = this->table();
- if (table && !table->selfNeedsLayout() && !table->normalChildNeedsLayout() && oldStyle && oldStyle->border() != style()->border())
+ if (table && !table->selfNeedsLayout() && !table->normalChildNeedsLayout() && oldStyle && oldStyle->border() != style().border())
table->invalidateCollapsedBorders();
}
}
@@ -63,7 +63,7 @@
HTMLTableColElement& tc = static_cast<HTMLTableColElement&>(element());
m_span = tc.span();
} else
- m_span = !(hasInitializedStyle() && style()->display() == TABLE_COLUMN_GROUP);
+ m_span = !(hasInitializedStyle() && style().display() == TABLE_COLUMN_GROUP);
if (m_span != oldSpan && hasInitializedStyle() && parent())
setNeedsLayoutAndPrefWidthsRecalc();
}
@@ -165,24 +165,24 @@
const BorderValue& RenderTableCol::borderAdjoiningCellStartBorder(const RenderTableCell*) const
{
- return style()->borderStart();
+ return style().borderStart();
}
const BorderValue& RenderTableCol::borderAdjoiningCellEndBorder(const RenderTableCell*) const
{
- return style()->borderEnd();
+ return style().borderEnd();
}
const BorderValue& RenderTableCol::borderAdjoiningCellBefore(const RenderTableCell* cell) const
{
ASSERT_UNUSED(cell, table()->colElement(cell->col() + cell->colSpan()) == this);
- return style()->borderStart();
+ return style().borderStart();
}
const BorderValue& RenderTableCol::borderAdjoiningCellAfter(const RenderTableCell* cell) const
{
ASSERT_UNUSED(cell, table()->colElement(cell->col() - 1) == this);
- return style()->borderEnd();
+ return style().borderEnd();
}
}
diff --git a/Source/WebCore/rendering/RenderTableCol.h b/Source/WebCore/rendering/RenderTableCol.h
index 800d172..ab13fb9 100644
--- a/Source/WebCore/rendering/RenderTableCol.h
+++ b/Source/WebCore/rendering/RenderTableCol.h
@@ -44,8 +44,8 @@
void setSpan(unsigned span) { m_span = span; }
bool isTableColumnGroupWithColumnChildren() { return firstChild(); }
- bool isTableColumn() const { return style()->display() == TABLE_COLUMN; }
- bool isTableColumnGroup() const { return style()->display() == TABLE_COLUMN_GROUP; }
+ bool isTableColumn() const { return style().display() == TABLE_COLUMN; }
+ bool isTableColumnGroup() const { return style().display() == TABLE_COLUMN_GROUP; }
RenderTableCol* enclosingColumnGroup() const;
RenderTableCol* enclosingColumnGroupIfAdjacentBefore() const
diff --git a/Source/WebCore/rendering/RenderTableRow.cpp b/Source/WebCore/rendering/RenderTableRow.cpp
index 3b31056..b69ea1f 100644
--- a/Source/WebCore/rendering/RenderTableRow.cpp
+++ b/Source/WebCore/rendering/RenderTableRow.cpp
@@ -69,21 +69,21 @@
void RenderTableRow::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
{
- ASSERT(style()->display() == TABLE_ROW);
+ ASSERT(style().display() == TABLE_ROW);
RenderBox::styleDidChange(diff, oldStyle);
propagateStyleToAnonymousChildren(PropagateToAllChildren);
- if (section() && oldStyle && style()->logicalHeight() != oldStyle->logicalHeight())
+ if (section() && oldStyle && style().logicalHeight() != oldStyle->logicalHeight())
section()->rowLogicalHeightChanged(rowIndex());
// If border was changed, notify table.
if (parent()) {
RenderTable* table = this->table();
- if (table && !table->selfNeedsLayout() && !table->normalChildNeedsLayout() && oldStyle && oldStyle->border() != style()->border())
+ if (table && !table->selfNeedsLayout() && !table->normalChildNeedsLayout() && oldStyle && oldStyle->border() != style().border())
table->invalidateCollapsedBorders();
- if (table && oldStyle && diff == StyleDifferenceLayout && needsLayout() && table->collapseBorders() && borderWidthChanged(oldStyle, style())) {
+ if (table && oldStyle && diff == StyleDifferenceLayout && needsLayout() && table->collapseBorders() && borderWidthChanged(oldStyle, &style())) {
// If the border width changes on a row, we need to make sure the cells in the row know to lay out again.
// This only happens when borders are collapsed, since they end up affecting the border sides of the cell
// itself.
@@ -97,14 +97,14 @@
{
ASSERT_UNUSED(cell, cell->isFirstOrLastCellInRow());
// FIXME: https://webkit.org/b/79272 - Add support for mixed directionality at the cell level.
- return style()->borderStart();
+ return style().borderStart();
}
const BorderValue& RenderTableRow::borderAdjoiningEndCell(const RenderTableCell* cell) const
{
ASSERT_UNUSED(cell, cell->isFirstOrLastCellInRow());
// FIXME: https://webkit.org/b/79272 - Add support for mixed directionality at the cell level.
- return style()->borderEnd();
+ return style().borderEnd();
}
void RenderTableRow::addChild(RenderObject* child, RenderObject* beforeChild)
@@ -163,7 +163,7 @@
ASSERT(needsLayout());
// Table rows do not add translation.
- LayoutStateMaintainer statePusher(&view(), this, LayoutSize(), hasTransform() || hasReflection() || style()->isFlippedBlocksWritingMode());
+ LayoutStateMaintainer statePusher(&view(), this, LayoutSize(), hasTransform() || hasReflection() || style().isFlippedBlocksWritingMode());
bool paginated = view().layoutState()->isPaginated();
@@ -235,7 +235,7 @@
{
LayoutPoint adjustedPaintOffset = paintOffset + location();
PaintPhase paintPhase = paintInfo.phase;
- if ((paintPhase == PaintPhaseOutline || paintPhase == PaintPhaseSelfOutline) && style()->visibility() == VISIBLE)
+ if ((paintPhase == PaintPhaseOutline || paintPhase == PaintPhaseSelfOutline) && style().visibility() == VISIBLE)
paintOutline(paintInfo, LayoutRect(adjustedPaintOffset, size()));
}
@@ -261,7 +261,7 @@
RenderTableRow* RenderTableRow::createAnonymousWithParentRenderer(const RenderObject* parent)
{
- auto newRow = new RenderTableRow(parent->document(), RenderStyle::createAnonymousStyleWithDisplay(parent->style(), TABLE_ROW));
+ auto newRow = new RenderTableRow(parent->document(), RenderStyle::createAnonymousStyleWithDisplay(&parent->style(), TABLE_ROW));
newRow->initializeStyle();
return newRow;
}
diff --git a/Source/WebCore/rendering/RenderTableRow.h b/Source/WebCore/rendering/RenderTableRow.h
index e3190ad..357db80 100644
--- a/Source/WebCore/rendering/RenderTableRow.h
+++ b/Source/WebCore/rendering/RenderTableRow.h
@@ -72,17 +72,17 @@
const BorderValue& borderAdjoiningTableStart() const
{
if (section()->hasSameDirectionAs(table()))
- return style()->borderStart();
+ return style().borderStart();
- return style()->borderEnd();
+ return style().borderEnd();
}
const BorderValue& borderAdjoiningTableEnd() const
{
if (section()->hasSameDirectionAs(table()))
- return style()->borderEnd();
+ return style().borderEnd();
- return style()->borderStart();
+ return style().borderStart();
}
const BorderValue& borderAdjoiningStartCell(const RenderTableCell*) const;
diff --git a/Source/WebCore/rendering/RenderTableSection.cpp b/Source/WebCore/rendering/RenderTableSection.cpp
index c9de8e0..a1055a6 100644
--- a/Source/WebCore/rendering/RenderTableSection.cpp
+++ b/Source/WebCore/rendering/RenderTableSection.cpp
@@ -51,7 +51,7 @@
static inline void setRowLogicalHeightToRowStyleLogicalHeightIfNotRelative(RenderTableSection::RowStruct& row)
{
ASSERT(row.rowRenderer);
- row.logicalHeight = row.rowRenderer->style()->logicalHeight();
+ row.logicalHeight = row.rowRenderer->style().logicalHeight();
if (row.logicalHeight.isRelative())
row.logicalHeight = Length();
}
@@ -62,7 +62,7 @@
if (cell->rowSpan() != 1)
return;
- Length logicalHeight = cell->style()->logicalHeight();
+ Length logicalHeight = cell->style().logicalHeight();
if (logicalHeight.isPositive() || (logicalHeight.isRelative() && logicalHeight.value() >= 0)) {
Length cRowLogicalHeight = row.logicalHeight;
switch (logicalHeight.type()) {
@@ -122,7 +122,7 @@
// If border was changed, notify table.
RenderTable* table = this->table();
- if (table && !table->selfNeedsLayout() && !table->normalChildNeedsLayout() && oldStyle && oldStyle->border() != style()->border())
+ if (table && !table->selfNeedsLayout() && !table->normalChildNeedsLayout() && oldStyle && oldStyle->border() != style().border())
table->invalidateCollapsedBorders();
}
@@ -387,7 +387,7 @@
// can be called in a loop (e.g during parsing). Doing it now ensures we have a stable-enough structure.
m_grid.shrinkToFit();
- LayoutStateMaintainer statePusher(&view(), this, locationOffset(), hasTransform() || hasReflection() || style()->isFlippedBlocksWritingMode());
+ LayoutStateMaintainer statePusher(&view(), this, locationOffset(), hasTransform() || hasReflection() || style().isFlippedBlocksWritingMode());
const Vector<int>& columnPos = table()->columnPositions();
@@ -532,7 +532,7 @@
int vspacing = table()->vBorderSpacing();
unsigned nEffCols = table()->numEffCols();
- LayoutStateMaintainer statePusher(&view(), this, locationOffset(), hasTransform() || style()->isFlippedBlocksWritingMode());
+ LayoutStateMaintainer statePusher(&view(), this, locationOffset(), hasTransform() || style().isFlippedBlocksWritingMode());
for (unsigned r = 0; r < totalRows; r++) {
// Set the row's x/y position and width/height.
@@ -571,11 +571,11 @@
// match the behavior perfectly, but we'll continue to refine it as we discover new
// bugs. :)
bool cellChildrenFlex = false;
- bool flexAllChildren = cell->style()->logicalHeight().isFixed()
- || (!table()->style()->logicalHeight().isAuto() && rHeight != cell->logicalHeight());
+ bool flexAllChildren = cell->style().logicalHeight().isFixed()
+ || (!table()->style().logicalHeight().isAuto() && rHeight != cell->logicalHeight());
for (RenderObject* o = cell->firstChild(); o; o = o->nextSibling()) {
- if (!o->isText() && o->style()->logicalHeight().isPercent() && (flexAllChildren || ((o->isReplaced() || (o->isBox() && toRenderBox(o)->scrollsOverflow())) && !o->isTextControl()))) {
+ if (!o->isText() && o->style().logicalHeight().isPercent() && (flexAllChildren || ((o->isReplaced() || (o->isBox() && toRenderBox(o)->scrollsOverflow())) && !o->isTextControl()))) {
// Tables with no sections do not flex.
if (!o->isTable() || toRenderTable(o)->hasSections()) {
o->setNeedsLayout(MarkOnlyThis);
@@ -725,13 +725,13 @@
unsigned borderWidth = 0;
- const BorderValue& sb = style()->borderBefore();
+ const BorderValue& sb = style().borderBefore();
if (sb.style() == BHIDDEN)
return -1;
if (sb.style() > BHIDDEN)
borderWidth = sb.width();
- const BorderValue& rb = firstRow()->style()->borderBefore();
+ const BorderValue& rb = firstRow()->style().borderBefore();
if (rb.style() == BHIDDEN)
return -1;
if (rb.style() > BHIDDEN && rb.width() > borderWidth)
@@ -742,11 +742,11 @@
const CellStruct& current = cellAt(0, c);
if (current.inColSpan || !current.hasCells())
continue;
- const BorderValue& cb = current.primaryCell()->style()->borderBefore(); // FIXME: Make this work with perpendicular and flipped cells.
+ const BorderValue& cb = current.primaryCell()->style().borderBefore(); // FIXME: Make this work with perpendicular and flipped cells.
// FIXME: Don't repeat for the same col group
RenderTableCol* colGroup = table()->colElement(c);
if (colGroup) {
- const BorderValue& gb = colGroup->style()->borderBefore();
+ const BorderValue& gb = colGroup->style().borderBefore();
if (gb.style() == BHIDDEN || cb.style() == BHIDDEN)
continue;
allHidden = false;
@@ -776,13 +776,13 @@
unsigned borderWidth = 0;
- const BorderValue& sb = style()->borderAfter();
+ const BorderValue& sb = style().borderAfter();
if (sb.style() == BHIDDEN)
return -1;
if (sb.style() > BHIDDEN)
borderWidth = sb.width();
- const BorderValue& rb = lastRow()->style()->borderAfter();
+ const BorderValue& rb = lastRow()->style().borderAfter();
if (rb.style() == BHIDDEN)
return -1;
if (rb.style() > BHIDDEN && rb.width() > borderWidth)
@@ -793,11 +793,11 @@
const CellStruct& current = cellAt(m_grid.size() - 1, c);
if (current.inColSpan || !current.hasCells())
continue;
- const BorderValue& cb = current.primaryCell()->style()->borderAfter(); // FIXME: Make this work with perpendicular and flipped cells.
+ const BorderValue& cb = current.primaryCell()->style().borderAfter(); // FIXME: Make this work with perpendicular and flipped cells.
// FIXME: Don't repeat for the same col group
RenderTableCol* colGroup = table()->colElement(c);
if (colGroup) {
- const BorderValue& gb = colGroup->style()->borderAfter();
+ const BorderValue& gb = colGroup->style().borderAfter();
if (gb.style() == BHIDDEN || cb.style() == BHIDDEN)
continue;
allHidden = false;
@@ -827,14 +827,14 @@
unsigned borderWidth = 0;
- const BorderValue& sb = style()->borderStart();
+ const BorderValue& sb = style().borderStart();
if (sb.style() == BHIDDEN)
return -1;
if (sb.style() > BHIDDEN)
borderWidth = sb.width();
if (RenderTableCol* colGroup = table()->colElement(0)) {
- const BorderValue& gb = colGroup->style()->borderStart();
+ const BorderValue& gb = colGroup->style().borderStart();
if (gb.style() == BHIDDEN)
return -1;
if (gb.style() > BHIDDEN && gb.width() > borderWidth)
@@ -847,8 +847,8 @@
if (!current.hasCells())
continue;
// FIXME: Don't repeat for the same cell
- const BorderValue& cb = current.primaryCell()->style()->borderStart(); // FIXME: Make this work with perpendicular and flipped cells.
- const BorderValue& rb = current.primaryCell()->parent()->style()->borderStart();
+ const BorderValue& cb = current.primaryCell()->style().borderStart(); // FIXME: Make this work with perpendicular and flipped cells.
+ const BorderValue& rb = current.primaryCell()->parent()->style().borderStart();
if (cb.style() == BHIDDEN || rb.style() == BHIDDEN)
continue;
allHidden = false;
@@ -860,7 +860,7 @@
if (allHidden)
return -1;
- return (borderWidth + (table()->style()->isLeftToRightDirection() ? 0 : 1)) / 2;
+ return (borderWidth + (table()->style().isLeftToRightDirection() ? 0 : 1)) / 2;
}
int RenderTableSection::calcOuterBorderEnd() const
@@ -871,14 +871,14 @@
unsigned borderWidth = 0;
- const BorderValue& sb = style()->borderEnd();
+ const BorderValue& sb = style().borderEnd();
if (sb.style() == BHIDDEN)
return -1;
if (sb.style() > BHIDDEN)
borderWidth = sb.width();
if (RenderTableCol* colGroup = table()->colElement(totalCols - 1)) {
- const BorderValue& gb = colGroup->style()->borderEnd();
+ const BorderValue& gb = colGroup->style().borderEnd();
if (gb.style() == BHIDDEN)
return -1;
if (gb.style() > BHIDDEN && gb.width() > borderWidth)
@@ -891,8 +891,8 @@
if (!current.hasCells())
continue;
// FIXME: Don't repeat for the same cell
- const BorderValue& cb = current.primaryCell()->style()->borderEnd(); // FIXME: Make this work with perpendicular and flipped cells.
- const BorderValue& rb = current.primaryCell()->parent()->style()->borderEnd();
+ const BorderValue& cb = current.primaryCell()->style().borderEnd(); // FIXME: Make this work with perpendicular and flipped cells.
+ const BorderValue& rb = current.primaryCell()->parent()->style().borderEnd();
if (cb.style() == BHIDDEN || rb.style() == BHIDDEN)
continue;
allHidden = false;
@@ -904,7 +904,7 @@
if (allHidden)
return -1;
- return (borderWidth + (table()->style()->isLeftToRightDirection() ? 1 : 0)) / 2;
+ return (borderWidth + (table()->style().isLeftToRightDirection() ? 1 : 0)) / 2;
}
void RenderTableSection::recalcOuterBorder()
@@ -959,7 +959,7 @@
if (pushedClip)
popContentsClip(paintInfo, phase, adjustedPaintOffset);
- if ((phase == PaintPhaseOutline || phase == PaintPhaseSelfOutline) && style()->visibility() == VISIBLE)
+ if ((phase == PaintPhaseOutline || phase == PaintPhaseSelfOutline) && style().visibility() == VISIBLE)
paintOutline(paintInfo, LayoutRect(adjustedPaintOffset, size()));
}
@@ -1016,12 +1016,12 @@
flipForWritingMode(tableAlignedRect);
- if (!style()->isHorizontalWritingMode())
+ if (!style().isHorizontalWritingMode())
tableAlignedRect = tableAlignedRect.transposedRect();
const Vector<int>& columnPos = table()->columnPositions();
// FIXME: The table's direction should determine our row's direction, not the section's (see bug 96691).
- if (!style()->isLeftToRightDirection())
+ if (!style().isLeftToRightDirection())
tableAlignedRect.setX(columnPos[columnPos.size() - 1] - tableAlignedRect.maxX());
return tableAlignedRect;
@@ -1121,49 +1121,49 @@
rect.intersect(paintInfo.rect);
if (rect.isEmpty())
return;
- drawLineForBoxSide(paintInfo.context, rect.x(), rect.y(), rect.x() + rect.width(), rect.y() + rect.height(), side, style()->visitedDependentColor(borderColor), borderStyle, 0, 0, antialias);
+ drawLineForBoxSide(paintInfo.context, rect.x(), rect.y(), rect.x() + rect.width(), rect.y() + rect.height(), side, style().visitedDependentColor(borderColor), borderStyle, 0, 0, antialias);
}
int RenderTableSection::offsetLeftForRowGroupBorder(RenderTableCell* cell, const LayoutRect& rowGroupRect, unsigned row)
{
- if (style()->isHorizontalWritingMode()) {
- if (style()->isLeftToRightDirection())
+ if (style().isHorizontalWritingMode()) {
+ if (style().isLeftToRightDirection())
return cell ? cell->x().toInt() + cell->width().toInt() : 0;
- return -outerBorderLeft(style());
+ return -outerBorderLeft(&style());
}
bool isLastRow = row + 1 == m_grid.size();
- return rowGroupRect.width().toInt() - m_rowPos[row + 1] + (isLastRow ? -outerBorderLeft(style()) : 0);
+ return rowGroupRect.width().toInt() - m_rowPos[row + 1] + (isLastRow ? -outerBorderLeft(&style()) : 0);
}
int RenderTableSection::offsetTopForRowGroupBorder(RenderTableCell* cell, BoxSide borderSide, unsigned row)
{
bool isLastRow = row + 1 == m_grid.size();
- if (style()->isHorizontalWritingMode())
- return m_rowPos[row] + (!row && borderSide == BSRight ? -outerBorderTop(style()) : isLastRow && borderSide == BSLeft ? outerBorderTop(style()) : 0);
- if (style()->isLeftToRightDirection())
- return (cell ? cell->y().toInt() + cell->height().toInt() : 0) + (borderSide == BSLeft ? outerBorderTop(style()) : 0);
- return borderSide == BSRight ? -outerBorderTop(style()) : 0;
+ if (style().isHorizontalWritingMode())
+ return m_rowPos[row] + (!row && borderSide == BSRight ? -outerBorderTop(&style()) : isLastRow && borderSide == BSLeft ? outerBorderTop(&style()) : 0);
+ if (style().isLeftToRightDirection())
+ return (cell ? cell->y().toInt() + cell->height().toInt() : 0) + (borderSide == BSLeft ? outerBorderTop(&style()) : 0);
+ return borderSide == BSRight ? -outerBorderTop(&style()) : 0;
}
int RenderTableSection::verticalRowGroupBorderHeight(RenderTableCell* cell, const LayoutRect& rowGroupRect, unsigned row)
{
bool isLastRow = row + 1 == m_grid.size();
- if (style()->isHorizontalWritingMode())
- return m_rowPos[row + 1] - m_rowPos[row] + (!row ? outerBorderTop(style()) : isLastRow ? outerBorderBottom(style()) : 0);
- if (style()->isLeftToRightDirection())
- return rowGroupRect.height().toInt() - (cell ? cell->y().toInt() + cell->height().toInt() : 0) + outerBorderBottom(style());
+ if (style().isHorizontalWritingMode())
+ return m_rowPos[row + 1] - m_rowPos[row] + (!row ? outerBorderTop(&style()) : isLastRow ? outerBorderBottom(&style()) : 0);
+ if (style().isLeftToRightDirection())
+ return rowGroupRect.height().toInt() - (cell ? cell->y().toInt() + cell->height().toInt() : 0) + outerBorderBottom(&style());
return cell ? rowGroupRect.height().toInt() - (cell->y().toInt() - cell->height().toInt()) : 0;
}
int RenderTableSection::horizontalRowGroupBorderWidth(RenderTableCell* cell, const LayoutRect& rowGroupRect, unsigned row, unsigned column)
{
- if (style()->isHorizontalWritingMode()) {
- if (style()->isLeftToRightDirection())
- return rowGroupRect.width().toInt() - (cell ? cell->x().toInt() + cell->width().toInt() : 0) + (!column ? outerBorderLeft(style()) : column == table()->numEffCols() ? outerBorderRight(style()) : 0);
+ if (style().isHorizontalWritingMode()) {
+ if (style().isLeftToRightDirection())
+ return rowGroupRect.width().toInt() - (cell ? cell->x().toInt() + cell->width().toInt() : 0) + (!column ? outerBorderLeft(&style()) : column == table()->numEffCols() ? outerBorderRight(&style()) : 0);
return cell ? rowGroupRect.width().toInt() - (cell->x().toInt() - cell->width().toInt()) : 0;
}
bool isLastRow = row + 1 == m_grid.size();
- return m_rowPos[row + 1] - m_rowPos[row] + (isLastRow ? outerBorderLeft(style()) : !row ? outerBorderRight(style()) : 0);
+ return m_rowPos[row + 1] - m_rowPos[row] + (isLastRow ? outerBorderLeft(&style()) : !row ? outerBorderRight(&style()) : 0);
}
void RenderTableSection::paintRowGroupBorderIfRequired(const PaintInfo& paintInfo, const LayoutPoint& paintOffset, unsigned row, unsigned column, BoxSide borderSide, RenderTableCell* cell)
@@ -1173,27 +1173,27 @@
if (paintInfo.context->paintingDisabled())
return;
- RenderStyle* style = this->style();
+ const RenderStyle& style = this->style();
bool antialias = shouldAntialiasLines(paintInfo.context);
LayoutRect rowGroupRect = LayoutRect(paintOffset, size());
- rowGroupRect.moveBy(-LayoutPoint(outerBorderLeft(style), (borderSide == BSRight) ? 0 : outerBorderTop(style)));
+ rowGroupRect.moveBy(-LayoutPoint(outerBorderLeft(&style), (borderSide == BSRight) ? 0 : outerBorderTop(&style)));
switch (borderSide) {
case BSTop:
paintRowGroupBorder(paintInfo, antialias, LayoutRect(paintOffset.x() + offsetLeftForRowGroupBorder(cell, rowGroupRect, row), rowGroupRect.y(),
- horizontalRowGroupBorderWidth(cell, rowGroupRect, row, column), style->borderTop().width()), BSTop, CSSPropertyBorderTopColor, style->borderTopStyle(), table()->style()->borderTopStyle());
+ horizontalRowGroupBorderWidth(cell, rowGroupRect, row, column), style.borderTop().width()), BSTop, CSSPropertyBorderTopColor, style.borderTopStyle(), table()->style().borderTopStyle());
break;
case BSBottom:
paintRowGroupBorder(paintInfo, antialias, LayoutRect(paintOffset.x() + offsetLeftForRowGroupBorder(cell, rowGroupRect, row), rowGroupRect.y() + rowGroupRect.height(),
- horizontalRowGroupBorderWidth(cell, rowGroupRect, row, column), style->borderBottom().width()), BSBottom, CSSPropertyBorderBottomColor, style->borderBottomStyle(), table()->style()->borderBottomStyle());
+ horizontalRowGroupBorderWidth(cell, rowGroupRect, row, column), style.borderBottom().width()), BSBottom, CSSPropertyBorderBottomColor, style.borderBottomStyle(), table()->style().borderBottomStyle());
break;
case BSLeft:
- paintRowGroupBorder(paintInfo, antialias, LayoutRect(rowGroupRect.x(), rowGroupRect.y() + offsetTopForRowGroupBorder(cell, borderSide, row), style->borderLeft().width(),
- verticalRowGroupBorderHeight(cell, rowGroupRect, row)), BSLeft, CSSPropertyBorderLeftColor, style->borderLeftStyle(), table()->style()->borderLeftStyle());
+ paintRowGroupBorder(paintInfo, antialias, LayoutRect(rowGroupRect.x(), rowGroupRect.y() + offsetTopForRowGroupBorder(cell, borderSide, row), style.borderLeft().width(),
+ verticalRowGroupBorderHeight(cell, rowGroupRect, row)), BSLeft, CSSPropertyBorderLeftColor, style.borderLeftStyle(), table()->style().borderLeftStyle());
break;
case BSRight:
- paintRowGroupBorder(paintInfo, antialias, LayoutRect(rowGroupRect.x() + rowGroupRect.width(), rowGroupRect.y() + offsetTopForRowGroupBorder(cell, borderSide, row), style->borderRight().width(),
- verticalRowGroupBorderHeight(cell, rowGroupRect, row)), BSRight, CSSPropertyBorderRightColor, style->borderRightStyle(), table()->style()->borderRightStyle());
+ paintRowGroupBorder(paintInfo, antialias, LayoutRect(rowGroupRect.x() + rowGroupRect.width(), rowGroupRect.y() + offsetTopForRowGroupBorder(cell, borderSide, row), style.borderRight().width(),
+ verticalRowGroupBorderHeight(cell, rowGroupRect, row)), BSRight, CSSPropertyBorderRightColor, style.borderRightStyle(), table()->style().borderRightStyle());
break;
default:
break;
@@ -1256,9 +1256,9 @@
RenderTableCell* cell = current.primaryCell();
if (!cell) {
if (!c)
- paintRowGroupBorderIfRequired(paintInfo, paintOffset, row, col, physicalBorderForDirection(style(), CBSStart));
+ paintRowGroupBorderIfRequired(paintInfo, paintOffset, row, col, physicalBorderForDirection(&style(), CBSStart));
else if (c == table()->numEffCols())
- paintRowGroupBorderIfRequired(paintInfo, paintOffset, row, col, physicalBorderForDirection(style(), CBSEnd));
+ paintRowGroupBorderIfRequired(paintInfo, paintOffset, row, col, physicalBorderForDirection(&style(), CBSEnd));
shouldPaintRowGroupBorder = true;
continue;
}
@@ -1269,9 +1269,9 @@
// this will only happen once within a row as the null cells will always be clustered together on one end of the row.
if (shouldPaintRowGroupBorder) {
if (r == m_grid.size())
- paintRowGroupBorderIfRequired(paintInfo, paintOffset, row, col, physicalBorderForDirection(style(), CBSAfter), cell);
+ paintRowGroupBorderIfRequired(paintInfo, paintOffset, row, col, physicalBorderForDirection(&style(), CBSAfter), cell);
else if (!row && !table()->sectionAbove(this))
- paintRowGroupBorderIfRequired(paintInfo, paintOffset, row, col, physicalBorderForDirection(style(), CBSBefore), cell);
+ paintRowGroupBorderIfRequired(paintInfo, paintOffset, row, col, physicalBorderForDirection(&style(), CBSBefore), cell);
shouldPaintRowGroupBorder = false;
}
@@ -1422,13 +1422,13 @@
const BorderValue& RenderTableSection::borderAdjoiningStartCell(const RenderTableCell* cell) const
{
ASSERT(cell->isFirstOrLastCellInRow());
- return hasSameDirectionAs(cell) ? style()->borderStart() : style()->borderEnd();
+ return hasSameDirectionAs(cell) ? style().borderStart() : style().borderEnd();
}
const BorderValue& RenderTableSection::borderAdjoiningEndCell(const RenderTableCell* cell) const
{
ASSERT(cell->isFirstOrLastCellInRow());
- return hasSameDirectionAs(cell) ? style()->borderEnd() : style()->borderStart();
+ return hasSameDirectionAs(cell) ? style().borderEnd() : style().borderStart();
}
const RenderTableCell* RenderTableSection::firstRowCellAdjoiningTableStart() const
@@ -1569,7 +1569,7 @@
RenderTableSection* RenderTableSection::createAnonymousWithParentRenderer(const RenderObject* parent)
{
- auto section = new RenderTableSection(parent->document(), RenderStyle::createAnonymousStyleWithDisplay(parent->style(), TABLE_ROW_GROUP));
+ auto section = new RenderTableSection(parent->document(), RenderStyle::createAnonymousStyleWithDisplay(&parent->style(), TABLE_ROW_GROUP));
section->initializeStyle();
return section;
}
@@ -1582,7 +1582,7 @@
int horizontalBorderSpacing = table()->hBorderSpacing();
// FIXME: The table's direction should determine our row's direction, not the section's (see bug 96691).
- if (!style()->isLeftToRightDirection())
+ if (!style().isLeftToRightDirection())
cellLocation.setX(table()->columnPositions()[table()->numEffCols()] - table()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + horizontalBorderSpacing);
else
cellLocation.setX(table()->columnPositions()[effectiveColumn] + horizontalBorderSpacing);
diff --git a/Source/WebCore/rendering/RenderTableSection.h b/Source/WebCore/rendering/RenderTableSection.h
index 03ecb16..4980b6a 100644
--- a/Source/WebCore/rendering/RenderTableSection.h
+++ b/Source/WebCore/rendering/RenderTableSection.h
@@ -123,17 +123,17 @@
const BorderValue& borderAdjoiningTableStart() const
{
if (hasSameDirectionAs(table()))
- return style()->borderStart();
+ return style().borderStart();
- return style()->borderEnd();
+ return style().borderEnd();
}
const BorderValue& borderAdjoiningTableEnd() const
{
if (hasSameDirectionAs(table()))
- return style()->borderEnd();
+ return style().borderEnd();
- return style()->borderStart();
+ return style().borderStart();
}
const BorderValue& borderAdjoiningStartCell(const RenderTableCell*) const;
diff --git a/Source/WebCore/rendering/RenderText.cpp b/Source/WebCore/rendering/RenderText.cpp
index 53fe15c..0ea7544 100644
--- a/Source/WebCore/rendering/RenderText.cpp
+++ b/Source/WebCore/rendering/RenderText.cpp
@@ -211,7 +211,7 @@
bool RenderText::computeUseBackslashAsYenSymbol() const
{
- const RenderStyle& style = *this->style();
+ const RenderStyle& style = this->style();
const FontDescription& fontDescription = style.font().fontDescription();
if (style.font().useBackslashAsYenSymbol())
return true;
@@ -234,19 +234,19 @@
m_knownToHaveNoOverflowAndNoFallbackFonts = false;
}
- RenderStyle* newStyle = style();
+ const RenderStyle& newStyle = style();
bool needsResetText = false;
if (!oldStyle) {
m_useBackslashAsYenSymbol = computeUseBackslashAsYenSymbol();
needsResetText = m_useBackslashAsYenSymbol;
- } else if (oldStyle->font().useBackslashAsYenSymbol() != newStyle->font().useBackslashAsYenSymbol()) {
+ } else if (oldStyle->font().useBackslashAsYenSymbol() != newStyle.font().useBackslashAsYenSymbol()) {
m_useBackslashAsYenSymbol = computeUseBackslashAsYenSymbol();
needsResetText = true;
}
ETextTransform oldTransform = oldStyle ? oldStyle->textTransform() : TTNONE;
ETextSecurity oldSecurity = oldStyle ? oldStyle->textSecurity() : TSNONE;
- if (needsResetText || oldTransform != newStyle->textTransform() || oldSecurity != newStyle->textSecurity())
+ if (needsResetText || oldTransform != newStyle.textTransform() || oldSecurity != newStyle.textSecurity())
transformText();
}
@@ -406,7 +406,7 @@
float& beginMaxW, float& endMaxW,
float& minW, float& maxW, bool& stripFrontSpaces)
{
- const RenderStyle& style = *this->style();
+ const RenderStyle& style = this->style();
bool collapseWhiteSpace = style.collapseWhiteSpace();
if (!collapseWhiteSpace)
stripFrontSpaces = false;
@@ -521,8 +521,8 @@
static inline float hyphenWidth(RenderText* renderer, const Font& font)
{
- RenderStyle* style = renderer->style();
- return font.width(RenderBlock::constructTextRun(renderer, font, style->hyphenString().string(), *style));
+ const RenderStyle& style = renderer->style();
+ return font.width(RenderBlock::constructTextRun(renderer, font, style.hyphenString().string(), style));
}
static float maxWordFragmentWidth(RenderText* renderer, const RenderStyle& style, const Font& font, const UChar* word, int wordLength, int minimumPrefixLength, int minimumSuffixLength, int& suffixStart, HashSet<const SimpleFontData*>& fallbackFonts, GlyphOverflow& glyphOverflow)
@@ -582,7 +582,7 @@
m_hasBeginWS = false;
m_hasEndWS = false;
- const RenderStyle& style = *this->style();
+ const RenderStyle& style = this->style();
const Font& f = style.font(); // FIXME: This ignores first-line.
float wordSpacing = style.wordSpacing();
int len = textLength();
@@ -811,7 +811,7 @@
bool RenderText::isAllCollapsibleWhitespace() const
{
- const RenderStyle& style = *this->style();
+ const RenderStyle& style = this->style();
unsigned length = textLength();
if (is8Bit()) {
for (unsigned i = 0; i < length; ++i) {
@@ -945,23 +945,21 @@
ASSERT(m_text);
- if (style()) {
- applyTextTransform(style(), m_text, previousCharacter());
+ applyTextTransform(&style(), m_text, previousCharacter());
- // We use the same characters here as for list markers.
- // See the listMarkerText function in RenderListMarker.cpp.
- switch (style()->textSecurity()) {
- case TSNONE:
- break;
- case TSCIRCLE:
- secureText(whiteBullet);
- break;
- case TSDISC:
- secureText(bullet);
- break;
- case TSSQUARE:
- secureText(blackSquare);
- }
+ // We use the same characters here as for list markers.
+ // See the listMarkerText function in RenderListMarker.cpp.
+ switch (style().textSecurity()) {
+ case TSNONE:
+ break;
+ case TSCIRCLE:
+ secureText(whiteBullet);
+ break;
+ case TSDISC:
+ secureText(bullet);
+ break;
+ case TSSQUARE:
+ secureText(blackSquare);
}
ASSERT(!m_text.isNull());
@@ -1012,11 +1010,11 @@
String RenderText::textWithoutConvertingBackslashToYenSymbol() const
{
- if (!m_useBackslashAsYenSymbol || style()->textSecurity() != TSNONE)
+ if (!m_useBackslashAsYenSymbol || style().textSecurity() != TSNONE)
return text();
String text = originalText();
- applyTextTransform(style(), text, previousCharacter());
+ applyTextTransform(&style(), text, previousCharacter());
return text;
}
@@ -1072,7 +1070,7 @@
if (from + len > textLength())
len = textLength() - from;
- const RenderStyle& lineStyle = firstLine ? *firstLineStyle() : *style();
+ const RenderStyle& lineStyle = firstLine ? firstLineStyle() : style();
return width(from, len, lineStyle.font(), xPos, fallbackFonts, glyphOverflow);
}
@@ -1082,7 +1080,7 @@
if (!textLength())
return 0;
- const RenderStyle& style = *this->style();
+ const RenderStyle& style = this->style();
float w;
if (&f == &style.font()) {
if (!style.preserveNewline() && !from && len == textLength() && (!glyphOverflow || !glyphOverflow->computeBounds)) {
diff --git a/Source/WebCore/rendering/RenderText.h b/Source/WebCore/rendering/RenderText.h
index 429a477..2bae5ba 100644
--- a/Source/WebCore/rendering/RenderText.h
+++ b/Source/WebCore/rendering/RenderText.h
@@ -47,8 +47,8 @@
virtual bool isTextFragment() const;
- RenderStyle* style() const;
- RenderStyle* firstLineStyle() const;
+ RenderStyle& style() const;
+ RenderStyle& firstLineStyle() const;
virtual String originalText() const;
@@ -111,8 +111,8 @@
virtual LayoutRect selectionRectForRepaint(const RenderLayerModelObject* repaintContainer, bool clipToVisibleContent = true) OVERRIDE;
virtual LayoutRect localCaretRect(InlineBox*, int caretOffset, LayoutUnit* extraWidthToEndOfLine = 0) OVERRIDE;
- LayoutUnit marginLeft() const { return minimumValueForLength(style()->marginLeft(), 0); }
- LayoutUnit marginRight() const { return minimumValueForLength(style()->marginRight(), 0); }
+ LayoutUnit marginLeft() const { return minimumValueForLength(style().marginLeft(), 0); }
+ LayoutUnit marginRight() const { return minimumValueForLength(style().marginRight(), 0); }
virtual LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const OVERRIDE FINAL;
@@ -132,7 +132,7 @@
bool containsReversedText() const { return m_containsReversedText; }
- bool isSecure() const { return style()->textSecurity() != TSNONE; }
+ bool isSecure() const { return style().textSecurity() != TSNONE; }
void momentarilyRevealLastTypedCharacter(unsigned lastTypedCharacterOffset);
InlineTextBox* findNextInlineTextBox(int offset, int& pos) const { return m_lineBoxes.findNext(offset, pos); }
@@ -218,12 +218,12 @@
RENDER_OBJECT_TYPE_CASTS(RenderText, isText())
-inline RenderStyle* RenderText::style() const
+inline RenderStyle& RenderText::style() const
{
return parent()->style();
}
-inline RenderStyle* RenderText::firstLineStyle() const
+inline RenderStyle& RenderText::firstLineStyle() const
{
return parent()->firstLineStyle();
}
diff --git a/Source/WebCore/rendering/RenderTextControl.cpp b/Source/WebCore/rendering/RenderTextControl.cpp
index 7541c15..b02f17b 100644
--- a/Source/WebCore/rendering/RenderTextControl.cpp
+++ b/Source/WebCore/rendering/RenderTextControl.cpp
@@ -67,9 +67,9 @@
if (innerTextRenderer) {
// We may have set the width and the height in the old style in layout().
// Reset them now to avoid getting a spurious layout hint.
- innerTextRenderer->style()->setHeight(Length());
- innerTextRenderer->style()->setWidth(Length());
- innerTextRenderer->setStyle(createInnerTextStyle(style()));
+ innerTextRenderer->style().setHeight(Length());
+ innerTextRenderer->style().setWidth(Length());
+ innerTextRenderer->setStyle(createInnerTextStyle(&style()));
innerText->setNeedsStyleRecalc();
}
textFormControlElement().updatePlaceholderVisibility(false);
@@ -88,8 +88,8 @@
{
// The inner block, if present, always has its direction set to LTR,
// so we need to inherit the direction and unicode-bidi style from the element.
- textBlockStyle->setDirection(style()->direction());
- textBlockStyle->setUnicodeBidi(style()->unicodeBidi());
+ textBlockStyle->setDirection(style().direction());
+ textBlockStyle->setUnicodeBidi(style().unicodeBidi());
bool disabled = updateUserModifyProperty(textFormControlElement(), textBlockStyle);
if (disabled)
@@ -117,7 +117,7 @@
{
TextControlInnerTextElement* innerText = innerTextElement();
if (innerText && innerText->renderer())
- updateUserModifyProperty(textFormControlElement(), innerText->renderer()->style());
+ updateUserModifyProperty(textFormControlElement(), &innerText->renderer()->style());
}
int RenderTextControl::scrollbarThickness() const
@@ -135,8 +135,8 @@
logicalHeight = computeControlLogicalHeight(innerTextBox->lineHeight(true, HorizontalLine, PositionOfInteriorLineBoxes), nonContentHeight) + borderAndPaddingHeight();
// We are able to have a horizontal scrollbar if the overflow style is scroll, or if its auto and there's no word wrap.
- if ((isHorizontalWritingMode() && (style()->overflowX() == OSCROLL || (style()->overflowX() == OAUTO && innerText->renderer()->style()->overflowWrap() == NormalOverflowWrap)))
- || (!isHorizontalWritingMode() && (style()->overflowY() == OSCROLL || (style()->overflowY() == OAUTO && innerText->renderer()->style()->overflowWrap() == NormalOverflowWrap))))
+ if ((isHorizontalWritingMode() && (style().overflowX() == OSCROLL || (style().overflowX() == OAUTO && innerText->renderer()->style().overflowWrap() == NormalOverflowWrap)))
+ || (!isHorizontalWritingMode() && (style().overflowY() == OSCROLL || (style().overflowY() == OAUTO && innerText->renderer()->style().overflowWrap() == NormalOverflowWrap))))
logicalHeight += scrollbarThickness();
}
@@ -226,12 +226,12 @@
float RenderTextControl::getAvgCharWidth(AtomicString family)
{
if (hasValidAvgCharWidth(family))
- return roundf(style()->font().primaryFont()->avgCharWidth());
+ return roundf(style().font().primaryFont()->avgCharWidth());
const UChar ch = '0';
const String str = String(&ch, 1);
- const Font& font = style()->font();
- TextRun textRun = constructTextRun(this, font, str, *style(), TextRun::AllowTrailingExpansion);
+ const Font& font = style().font();
+ TextRun textRun = constructTextRun(this, font, str, style(), TextRun::AllowTrailingExpansion);
textRun.disableRoundingHacks();
return font.width(textRun);
}
@@ -240,17 +240,17 @@
{
// This matches the unitsPerEm value for MS Shell Dlg and Courier New from the "head" font table.
float unitsPerEm = 2048.0f;
- return roundf(style()->font().size() * x / unitsPerEm);
+ return roundf(style().font().size() * x / unitsPerEm);
}
void RenderTextControl::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const
{
// Use average character width. Matches IE.
- const AtomicString& family = style()->font().firstFamily();
+ const AtomicString& family = style().font().firstFamily();
maxLogicalWidth = preferredContentLogicalWidth(const_cast<RenderTextControl*>(this)->getAvgCharWidth(family));
if (RenderBox* innerTextRenderBox = innerTextElement()->renderBox())
maxLogicalWidth += innerTextRenderBox->paddingStart() + innerTextRenderBox->paddingEnd();
- if (!style()->logicalWidth().isPercent())
+ if (!style().logicalWidth().isPercent())
minLogicalWidth = maxLogicalWidth;
}
@@ -261,19 +261,19 @@
m_minPreferredLogicalWidth = 0;
m_maxPreferredLogicalWidth = 0;
- if (style()->logicalWidth().isFixed() && style()->logicalWidth().value() >= 0)
- m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(style()->logicalWidth().value());
+ if (style().logicalWidth().isFixed() && style().logicalWidth().value() >= 0)
+ m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(style().logicalWidth().value());
else
computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth, m_maxPreferredLogicalWidth);
- if (style()->logicalMinWidth().isFixed() && style()->logicalMinWidth().value() > 0) {
- m_maxPreferredLogicalWidth = max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style()->logicalMinWidth().value()));
- m_minPreferredLogicalWidth = max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style()->logicalMinWidth().value()));
+ if (style().logicalMinWidth().isFixed() && style().logicalMinWidth().value() > 0) {
+ m_maxPreferredLogicalWidth = max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().logicalMinWidth().value()));
+ m_minPreferredLogicalWidth = max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().logicalMinWidth().value()));
}
- if (style()->logicalMaxWidth().isFixed()) {
- m_maxPreferredLogicalWidth = min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style()->logicalMaxWidth().value()));
- m_minPreferredLogicalWidth = min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style()->logicalMaxWidth().value()));
+ if (style().logicalMaxWidth().isFixed()) {
+ m_maxPreferredLogicalWidth = min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().logicalMaxWidth().value()));
+ m_minPreferredLogicalWidth = min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(style().logicalMaxWidth().value()));
}
LayoutUnit toAdd = borderAndPaddingLogicalWidth();
diff --git a/Source/WebCore/rendering/RenderTextControlMultiLine.cpp b/Source/WebCore/rendering/RenderTextControlMultiLine.cpp
index 4b015b20..4f08d1e 100644
--- a/Source/WebCore/rendering/RenderTextControlMultiLine.cpp
+++ b/Source/WebCore/rendering/RenderTextControlMultiLine.cpp
@@ -96,7 +96,7 @@
RenderStyle* RenderTextControlMultiLine::textBaseStyle() const
{
- return style();
+ return &style();
}
RenderObject* RenderTextControlMultiLine::layoutSpecialExcludedChild(bool relayoutChildren)
@@ -107,7 +107,7 @@
if (!placeholderRenderer->isBox())
return placeholderRenderer;
RenderBox* placeholderBox = toRenderBox(placeholderRenderer);
- placeholderBox->style()->setLogicalWidth(Length(contentLogicalWidth() - placeholderBox->borderAndPaddingLogicalWidth(), Fixed));
+ placeholderBox->style().setLogicalWidth(Length(contentLogicalWidth() - placeholderBox->borderAndPaddingLogicalWidth(), Fixed));
placeholderBox->layoutIfNeeded();
placeholderBox->setX(borderLeft() + paddingLeft());
placeholderBox->setY(borderTop() + paddingTop());
diff --git a/Source/WebCore/rendering/RenderTextControlSingleLine.cpp b/Source/WebCore/rendering/RenderTextControlSingleLine.cpp
index 5e5a9ce..83850ee 100644
--- a/Source/WebCore/rendering/RenderTextControlSingleLine.cpp
+++ b/Source/WebCore/rendering/RenderTextControlSingleLine.cpp
@@ -70,7 +70,7 @@
RenderStyle* RenderTextControlSingleLine::textBaseStyle() const
{
HTMLElement* innerBlock = innerBlockElement();
- return innerBlock ? innerBlock->renderer()->style() : style();
+ return innerBlock ? &innerBlock->renderer()->style() : &style();
}
void RenderTextControlSingleLine::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
@@ -125,12 +125,12 @@
RenderBox* innerBlockRenderer = innerBlockElement() ? innerBlockElement()->renderBox() : 0;
// To ensure consistency between layouts, we need to reset any conditionally overriden height.
- if (innerTextRenderer && !innerTextRenderer->style()->logicalHeight().isAuto()) {
- innerTextRenderer->style()->setLogicalHeight(Length(Auto));
+ if (innerTextRenderer && !innerTextRenderer->style().logicalHeight().isAuto()) {
+ innerTextRenderer->style().setLogicalHeight(Length(Auto));
setNeedsLayoutOnAncestors(innerTextRenderer, this);
}
- if (innerBlockRenderer && !innerBlockRenderer->style()->logicalHeight().isAuto()) {
- innerBlockRenderer->style()->setLogicalHeight(Length(Auto));
+ if (innerBlockRenderer && !innerBlockRenderer->style().logicalHeight().isAuto()) {
+ innerBlockRenderer->style().setLogicalHeight(Length(Auto));
setNeedsLayoutOnAncestors(innerBlockRenderer, this);
}
@@ -148,10 +148,10 @@
m_desiredInnerTextLogicalHeight = desiredLogicalHeight;
- innerTextRenderer->style()->setLogicalHeight(Length(desiredLogicalHeight, Fixed));
+ innerTextRenderer->style().setLogicalHeight(Length(desiredLogicalHeight, Fixed));
innerTextRenderer->setNeedsLayout(MarkOnlyThis);
if (innerBlockRenderer) {
- innerBlockRenderer->style()->setLogicalHeight(Length(desiredLogicalHeight, Fixed));
+ innerBlockRenderer->style().setLogicalHeight(Length(desiredLogicalHeight, Fixed));
innerBlockRenderer->setNeedsLayout(MarkOnlyThis);
}
}
@@ -160,13 +160,13 @@
containerRenderer->layoutIfNeeded();
LayoutUnit containerLogicalHeight = containerRenderer->logicalHeight();
if (containerLogicalHeight > logicalHeightLimit) {
- containerRenderer->style()->setLogicalHeight(Length(logicalHeightLimit, Fixed));
+ containerRenderer->style().setLogicalHeight(Length(logicalHeightLimit, Fixed));
setNeedsLayout(MarkOnlyThis);
} else if (containerRenderer->logicalHeight() < contentLogicalHeight()) {
- containerRenderer->style()->setLogicalHeight(Length(contentLogicalHeight(), Fixed));
+ containerRenderer->style().setLogicalHeight(Length(contentLogicalHeight(), Fixed));
setNeedsLayout(MarkOnlyThis);
} else
- containerRenderer->style()->setLogicalHeight(Length(containerLogicalHeight, Fixed));
+ containerRenderer->style().setLogicalHeight(Length(containerLogicalHeight, Fixed));
}
// If we need another layout pass, we have changed one of children's height so we need to relayout them.
@@ -183,7 +183,7 @@
// Ignores the paddings for the inner spin button.
if (RenderBox* innerSpinBox = innerSpinButtonElement() ? innerSpinButtonElement()->renderBox() : 0) {
RenderBox* parentBox = innerSpinBox->parentBox();
- if (containerRenderer && !containerRenderer->style()->isLeftToRightDirection())
+ if (containerRenderer && !containerRenderer->style().isLeftToRightDirection())
innerSpinBox->setLogicalLocation(LayoutPoint(-paddingLogicalLeft(), -paddingBefore()));
else
innerSpinBox->setLogicalLocation(LayoutPoint(parentBox->logicalWidth() - innerSpinBox->logicalWidth() + paddingLogicalRight(), -paddingBefore()));
@@ -195,8 +195,8 @@
LayoutSize innerTextSize;
if (innerTextRenderer)
innerTextSize = innerTextRenderer->size();
- placeholderBox->style()->setWidth(Length(innerTextSize.width() - placeholderBox->borderAndPaddingWidth(), Fixed));
- placeholderBox->style()->setHeight(Length(innerTextSize.height() - placeholderBox->borderAndPaddingHeight(), Fixed));
+ placeholderBox->style().setWidth(Length(innerTextSize.width() - placeholderBox->borderAndPaddingWidth(), Fixed));
+ placeholderBox->style().setHeight(Length(innerTextSize.height() - placeholderBox->borderAndPaddingHeight(), Fixed));
bool neededLayout = placeholderBox->needsLayout();
bool placeholderBoxHadLayout = placeholderBox->everHadLayout();
placeholderBox->layoutIfNeeded();
@@ -253,13 +253,13 @@
// Reset them now to avoid getting a spurious layout hint.
HTMLElement* innerBlock = innerBlockElement();
if (RenderObject* innerBlockRenderer = innerBlock ? innerBlock->renderer() : 0) {
- innerBlockRenderer->style()->setHeight(Length());
- innerBlockRenderer->style()->setWidth(Length());
+ innerBlockRenderer->style().setHeight(Length());
+ innerBlockRenderer->style().setWidth(Length());
}
HTMLElement* container = containerElement();
if (RenderObject* containerRenderer = container ? container->renderer() : 0) {
- containerRenderer->style()->setHeight(Length());
- containerRenderer->style()->setWidth(Length());
+ containerRenderer->style().setHeight(Length());
+ containerRenderer->style().setWidth(Length());
}
RenderTextControlInnerBlock* innerTextRenderer = innerTextElement()->renderer();
if (innerTextRenderer && diff == StyleDifferenceLayout)
@@ -326,7 +326,7 @@
LayoutUnit result = static_cast<LayoutUnit>(ceiledLayoutUnit(charWidth * factor));
float maxCharWidth = 0.f;
- const AtomicString& family = style()->font().firstFamily();
+ const AtomicString& family = style().font().firstFamily();
// Since Lucida Grande is the default font, we want this to match the width
// of MS Shell Dlg, the default font for textareas in Firefox, Safari Win and
// IE for some encodings (in IE, the default font is encoding specific).
@@ -334,7 +334,7 @@
if (family == "Lucida Grande")
maxCharWidth = scaleEmToUnits(4027);
else if (hasValidAvgCharWidth(family))
- maxCharWidth = roundf(style()->font().primaryFont()->maxCharWidth());
+ maxCharWidth = roundf(style().font().primaryFont()->maxCharWidth());
// For text inputs, IE adds some extra width.
if (maxCharWidth > 0.f)
@@ -394,7 +394,7 @@
bool RenderTextControlSingleLine::textShouldBeTruncated() const
{
- return document().focusedElement() != &inputElement() && style()->textOverflow() == TextOverflowEllipsis;
+ return document().focusedElement() != &inputElement() && style().textOverflow() == TextOverflowEllipsis;
}
void RenderTextControlSingleLine::autoscroll(const IntPoint& position)
@@ -461,7 +461,7 @@
bool RenderTextControlSingleLine::logicalScroll(ScrollLogicalDirection direction, ScrollGranularity granularity, float multiplier, Element** stopElement)
{
RenderLayer* layer = innerTextElement()->renderer()->layer();
- if (layer && layer->scroll(logicalToPhysical(direction, style()->isHorizontalWritingMode(), style()->isFlippedBlocksWritingMode()), granularity, multiplier))
+ if (layer && layer->scroll(logicalToPhysical(direction, style().isHorizontalWritingMode(), style().isFlippedBlocksWritingMode()), granularity, multiplier))
return true;
return RenderBlockFlow::logicalScroll(direction, granularity, multiplier, stopElement);
}
diff --git a/Source/WebCore/rendering/RenderTextFragment.cpp b/Source/WebCore/rendering/RenderTextFragment.cpp
index e491e7e..133e9d4 100644
--- a/Source/WebCore/rendering/RenderTextFragment.cpp
+++ b/Source/WebCore/rendering/RenderTextFragment.cpp
@@ -73,7 +73,7 @@
RenderText::styleDidChange(diff, oldStyle);
if (RenderBlock* block = blockForAccompanyingFirstLetter()) {
- block->style()->removeCachedPseudoStyle(FIRST_LETTER);
+ block->style().removeCachedPseudoStyle(FIRST_LETTER);
block->updateFirstLetter();
}
}
@@ -126,7 +126,7 @@
if (!m_firstLetter)
return 0;
for (RenderObject* block = m_firstLetter->parent(); block; block = block->parent()) {
- if (block->style()->hasPseudoStyle(FIRST_LETTER) && block->canHaveChildren() && block->isRenderBlock())
+ if (block->style().hasPseudoStyle(FIRST_LETTER) && block->canHaveChildren() && block->isRenderBlock())
return toRenderBlock(block);
}
return 0;
diff --git a/Source/WebCore/rendering/RenderTextLineBoxes.cpp b/Source/WebCore/rendering/RenderTextLineBoxes.cpp
index a3f32f4..bc16c58 100644
--- a/Source/WebCore/rendering/RenderTextLineBoxes.cpp
+++ b/Source/WebCore/rendering/RenderTextLineBoxes.cpp
@@ -161,7 +161,7 @@
logicalRightSide = current->logicalRight();
}
- bool isHorizontal = renderer.style()->isHorizontalWritingMode();
+ bool isHorizontal = renderer.style().isHorizontalWritingMode();
float x = isHorizontal ? logicalLeftSide : m_first->x();
float y = isHorizontal ? m_first->y() : logicalLeftSide;
@@ -188,7 +188,7 @@
auto logicalHeight = m_last->logicalBottomVisualOverflow() - logicalTop;
LayoutRect rect(logicalLeftSide, logicalTop, logicalWidth, logicalHeight);
- if (!renderer.style()->isHorizontalWritingMode())
+ if (!renderer.style().isHorizontalWritingMode())
rect = rect.transposedRect();
return rect;
}
@@ -325,7 +325,7 @@
const InlineBox* prevBox = box.prevLeafChildIgnoringLineBreak();
if ((prevBox && prevBox->bidiLevel() == box.bidiLevel())
- || box.renderer().containingBlock()->style()->direction() == box.direction()) // FIXME: left on 12CBA
+ || box.renderer().containingBlock()->style().direction() == box.direction()) // FIXME: left on 12CBA
return createVisiblePositionForBox(box, box.caretLeftmostOffset(), shouldAffinityBeDownstream);
if (prevBox && prevBox->bidiLevel() > box.bidiLevel()) {
@@ -355,7 +355,7 @@
const InlineBox* nextBox = box.nextLeafChildIgnoringLineBreak();
if ((nextBox && nextBox->bidiLevel() == box.bidiLevel())
- || box.renderer().containingBlock()->style()->direction() == box.direction())
+ || box.renderer().containingBlock()->style().direction() == box.direction())
return createVisiblePositionForBox(box, box.caretRightmostOffset(), shouldAffinityBeDownstream);
// offset is on the right edge
@@ -391,7 +391,7 @@
LayoutUnit pointLineDirection = m_first->isHorizontal() ? point.x() : point.y();
LayoutUnit pointBlockDirection = m_first->isHorizontal() ? point.y() : point.x();
- bool blocksAreFlipped = renderer.style()->isFlippedBlocksWritingMode();
+ bool blocksAreFlipped = renderer.style().isFlippedBlocksWritingMode();
InlineTextBox* lastBox = nullptr;
for (auto box = m_first; box; box = box->nextTextBox()) {
@@ -545,7 +545,7 @@
// FIXME: ellipsisRectForBox should switch to return FloatRect soon with the subpixellayout branch.
IntRect ellipsisRect = (option == ClipToEllipsis) ? ellipsisRectForBox(*box, 0, renderer.textLength()) : IntRect();
if (!ellipsisRect.isEmpty()) {
- if (renderer.style()->isHorizontalWritingMode())
+ if (renderer.style().isHorizontalWritingMode())
boundaries.setWidth(ellipsisRect.maxX() - boundaries.x());
else
boundaries.setHeight(ellipsisRect.maxY() - boundaries.y());
diff --git a/Source/WebCore/rendering/RenderTextTrackCue.cpp b/Source/WebCore/rendering/RenderTextTrackCue.cpp
index 2c91461..4dac0e7 100644
--- a/Source/WebCore/rendering/RenderTextTrackCue.cpp
+++ b/Source/WebCore/rendering/RenderTextTrackCue.cpp
@@ -48,7 +48,7 @@
StackStats::LayoutCheckPoint layoutCheckPoint;
RenderBlockFlow::layout();
- LayoutStateMaintainer statePusher(&view(), this, locationOffset(), hasTransform() || hasReflection() || style()->isFlippedBlocksWritingMode());
+ LayoutStateMaintainer statePusher(&view(), this, locationOffset(), hasTransform() || hasReflection() || style().isFlippedBlocksWritingMode());
if (m_cue->cueType()== TextTrackCue::WebVTT) {
if (m_cue->snapToLines())
diff --git a/Source/WebCore/rendering/RenderTheme.cpp b/Source/WebCore/rendering/RenderTheme.cpp
index 583df5e..8413ec2 100644
--- a/Source/WebCore/rendering/RenderTheme.cpp
+++ b/Source/WebCore/rendering/RenderTheme.cpp
@@ -270,7 +270,7 @@
if (paintInfo.context->paintingDisabled())
return false;
- ControlPart part = o->style()->appearance();
+ ControlPart part = o->style().appearance();
#if USE(NEW_THEME)
switch (part) {
@@ -281,7 +281,7 @@
case DefaultButtonPart:
case ButtonPart:
case InnerSpinButtonPart:
- m_theme->paint(part, controlStatesForRenderer(o), const_cast<GraphicsContext*>(paintInfo.context), r, o->style()->effectiveZoom(), &o->view().frameView());
+ m_theme->paint(part, controlStatesForRenderer(o), const_cast<GraphicsContext*>(paintInfo.context), r, o->style().effectiveZoom(), &o->view().frameView());
return false;
default:
break;
@@ -398,7 +398,7 @@
return false;
// Call the appropriate paint method based off the appearance value.
- switch (o->style()->appearance()) {
+ switch (o->style().appearance()) {
case TextFieldPart:
return paintTextField(o, paintInfo, r);
case ListboxPart:
@@ -448,7 +448,7 @@
return false;
// Call the appropriate paint method based off the appearance value.
- switch (o->style()->appearance()) {
+ switch (o->style().appearance()) {
case MenulistButtonPart:
return paintMenuListButton(o, paintInfo, r);
case TextFieldPart:
@@ -640,7 +640,7 @@
const RenderBox* box = toRenderBox(o);
#if USE(NEW_THEME)
- return box->height() + box->marginTop() + m_theme->baselinePositionAdjustment(o->style()->appearance()) * o->style()->effectiveZoom();
+ return box->height() + box->marginTop() + m_theme->baselinePositionAdjustment(o->style().appearance()) * o->style().effectiveZoom();
#else
return box->height() + box->marginTop();
#endif
@@ -683,7 +683,7 @@
void RenderTheme::adjustRepaintRect(const RenderObject* o, IntRect& r)
{
#if USE(NEW_THEME)
- m_theme->inflateControlPaintRect(o->style()->appearance(), controlStatesForRenderer(o), r, o->style()->effectiveZoom());
+ m_theme->inflateControlPaintRect(o->style().appearance(), controlStatesForRenderer(o), r, o->style().effectiveZoom());
#else
UNUSED_PARAM(o);
UNUSED_PARAM(r);
@@ -698,7 +698,7 @@
bool RenderTheme::stateChanged(RenderObject* o, ControlState state) const
{
// Default implementation assumes the controls don't respond to changes in :hover state
- if (state == HoverState && !supportsHover(o->style()))
+ if (state == HoverState && !supportsHover(&o->style()))
return false;
// Assume pressed state is only responded to if the control is enabled.
@@ -723,7 +723,7 @@
if (isSpinUpButtonPartPressed(o))
result |= SpinUpState;
}
- if (isFocused(o) && o->style()->outlineStyleIsAuto())
+ if (isFocused(o) && o->style().outlineStyleIsAuto())
result |= FocusState;
if (isEnabled(o))
result |= EnabledState;
@@ -856,7 +856,7 @@
if (!o->frame().settings().applicationChromeMode())
return false;
- return o->style()->appearance() == DefaultButtonPart;
+ return o->style().appearance() == DefaultButtonPart;
}
#if !USE(NEW_THEME)
@@ -977,7 +977,7 @@
double min = input->minimum();
double max = input->maximum();
- ControlPart part = o->style()->appearance();
+ ControlPart part = o->style().appearance();
// We don't support ticks on alternate sliders like MediaVolumeSliders.
if (part != SliderHorizontalPart && part != SliderVerticalPart)
return;
@@ -986,15 +986,15 @@
IntSize thumbSize;
RenderObject* thumbRenderer = input->sliderThumbElement()->renderer();
if (thumbRenderer) {
- RenderStyle* thumbStyle = thumbRenderer->style();
- int thumbWidth = thumbStyle->width().intValue();
- int thumbHeight = thumbStyle->height().intValue();
+ const RenderStyle& thumbStyle = thumbRenderer->style();
+ int thumbWidth = thumbStyle.width().intValue();
+ int thumbHeight = thumbStyle.height().intValue();
thumbSize.setWidth(isHorizontal ? thumbWidth : thumbHeight);
thumbSize.setHeight(isHorizontal ? thumbHeight : thumbWidth);
}
IntSize tickSize = sliderTickSize();
- float zoomFactor = o->style()->effectiveZoom();
+ float zoomFactor = o->style().effectiveZoom();
FloatRect tickRect;
int tickRegionSideMargin = 0;
int tickRegionWidth = 0;
@@ -1024,7 +1024,7 @@
}
RefPtr<HTMLCollection> options = dataList->options();
GraphicsContextStateSaver stateSaver(*paintInfo.context);
- paintInfo.context->setFillColor(o->style()->visitedDependentColor(CSSPropertyColor), ColorSpaceDeviceRGB);
+ paintInfo.context->setFillColor(o->style().visitedDependentColor(CSSPropertyColor), ColorSpaceDeviceRGB);
for (unsigned i = 0; Node* node = options->item(i); i++) {
ASSERT(isHTMLOptionElement(node));
HTMLOptionElement* optionElement = toHTMLOptionElement(node);
@@ -1033,7 +1033,7 @@
continue;
double parsedValue = parseToDoubleForNumberType(input->sanitizeValue(value));
double tickFraction = (parsedValue - min) / (max - min);
- double tickRatio = isHorizontal && o->style()->isLeftToRightDirection() ? tickFraction : 1.0 - tickFraction;
+ double tickRatio = isHorizontal && o->style().isLeftToRightDirection() ? tickFraction : 1.0 - tickFraction;
double tickPosition = round(tickRegionSideMargin + tickRegionWidth * tickRatio);
if (isHorizontal)
tickRect.setX(tickPosition);
diff --git a/Source/WebCore/rendering/RenderThemeMac.mm b/Source/WebCore/rendering/RenderThemeMac.mm
index 3341c7e..980604a 100644
--- a/Source/WebCore/rendering/RenderThemeMac.mm
+++ b/Source/WebCore/rendering/RenderThemeMac.mm
@@ -548,7 +548,7 @@
void RenderThemeMac::adjustRepaintRect(const RenderObject* o, IntRect& r)
{
- ControlPart part = o->style()->appearance();
+ ControlPart part = o->style().appearance();
#if USE(NEW_THEME)
switch (part) {
@@ -565,7 +565,7 @@
}
#endif
- float zoomLevel = o->style()->effectiveZoom();
+ float zoomLevel = o->style().effectiveZoom();
if (part == MenulistPart) {
setPopupButtonCellState(o, r);
@@ -643,7 +643,7 @@
void RenderThemeMac::updateFocusedState(NSCell* cell, const RenderObject* o)
{
bool oldFocused = [cell showsFirstResponder];
- bool focused = isFocused(o) && o->style()->outlineStyleIsAuto();
+ bool focused = isFocused(o) && o->style().outlineStyleIsAuto();
if (focused != oldFocused)
[cell setShowsFirstResponder:focused];
}
@@ -667,7 +667,7 @@
return false;
// Checkboxes only have tint when checked.
- if (o->style()->appearance() == CheckboxPart)
+ if (o->style().appearance() == CheckboxPart)
return isChecked(o);
// For now assume other controls have tint if enabled.
@@ -760,9 +760,9 @@
LocalCurrentGraphicsContext localContext(paintInfo.context);
#if __MAC_OS_X_VERSION_MIN_REQUIRED <= 1070
- bool useNSTextFieldCell = o->style()->hasAppearance()
- && o->style()->visitedDependentColor(CSSPropertyBackgroundColor) == Color::white
- && !o->style()->hasBackgroundImage();
+ bool useNSTextFieldCell = o->style().hasAppearance()
+ && o->style().visitedDependentColor(CSSPropertyBackgroundColor) == Color::white
+ && !o->style().hasBackgroundImage();
// We do not use NSTextFieldCell to draw styled text fields on Lion and SnowLeopard because
// there are a number of bugs on those platforms that require NSTextFieldCell to be in charge
@@ -847,14 +847,14 @@
NSPopUpButtonCell* popupButton = this->popupButton();
- float zoomLevel = o->style()->effectiveZoom();
+ float zoomLevel = o->style().effectiveZoom();
IntSize size = popupButtonSizes()[[popupButton controlSize]];
size.setHeight(size.height() * zoomLevel);
size.setWidth(r.width());
// Now inflate it to account for the shadow.
IntRect inflatedRect = r;
- if (r.width() >= minimumMenuListSize(o->style()))
+ if (r.width() >= minimumMenuListSize(&o->style()))
inflatedRect = inflateRect(inflatedRect, size, popupButtonMargins(), zoomLevel);
GraphicsContextStateSaver stateSaver(*paintInfo.context);
@@ -873,7 +873,7 @@
NSView *view = documentViewFor(o);
[popupButton drawWithFrame:inflatedRect inView:view];
#if !BUTTON_CELL_DRAW_WITH_FRAME_DRAWS_FOCUS_RING
- if (isFocused(o) && o->style()->outlineStyleIsAuto())
+ if (isFocused(o) && o->style().outlineStyleIsAuto())
[popupButton _web_drawFocusRingWithFrame:inflatedRect inView:view];
#endif
[popupButton setControlView:nil];
@@ -885,7 +885,7 @@
IntSize RenderThemeMac::meterSizeForBounds(const RenderMeter* renderMeter, const IntRect& bounds) const
{
- if (NoControlPart == renderMeter->style()->appearance())
+ if (NoControlPart == renderMeter->style().appearance())
return bounds.size();
NSLevelIndicatorCell* cell = levelIndicatorFor(renderMeter);
@@ -943,8 +943,8 @@
NSLevelIndicatorCell* RenderThemeMac::levelIndicatorFor(const RenderMeter* renderMeter) const
{
- RenderStyle* style = renderMeter->style();
- ASSERT(style->appearance() != NoControlPart);
+ const RenderStyle& style = renderMeter->style();
+ ASSERT(style.appearance() != NoControlPart);
if (!m_levelIndicator)
m_levelIndicator = adoptNS([[NSLevelIndicatorCell alloc] initWithLevelIndicatorStyle:NSContinuousCapacityLevelIndicatorStyle]);
@@ -973,8 +973,8 @@
break;
}
- [cell setLevelIndicatorStyle:levelIndicatorStyleFor(style->appearance())];
- [cell setBaseWritingDirection:style->isLeftToRightDirection() ? NSWritingDirectionLeftToRight : NSWritingDirectionRightToLeft];
+ [cell setLevelIndicatorStyle:levelIndicatorStyleFor(style.appearance())];
+ [cell setBaseWritingDirection:style.isLeftToRightDirection() ? NSWritingDirectionLeftToRight : NSWritingDirectionRightToLeft];
[cell setMinValue:element->min()];
[cell setMaxValue:element->max()];
RetainPtr<NSNumber> valueObject = [NSNumber numberWithDouble:value];
@@ -1005,18 +1005,18 @@
IntRect RenderThemeMac::progressBarRectForBounds(const RenderObject* renderObject, const IntRect& bounds) const
{
- if (NoControlPart == renderObject->style()->appearance())
+ if (NoControlPart == renderObject->style().appearance())
return bounds;
- float zoomLevel = renderObject->style()->effectiveZoom();
- int controlSize = controlSizeForFont(renderObject->style());
+ float zoomLevel = renderObject->style().effectiveZoom();
+ int controlSize = controlSizeForFont(&renderObject->style());
IntSize size = progressBarSizes()[controlSize];
size.setHeight(size.height() * zoomLevel);
size.setWidth(bounds.width());
// Now inflate it to account for the shadow.
IntRect inflatedRect = bounds;
- if (bounds.height() <= minimumProgressBarHeight(renderObject->style()))
+ if (bounds.height() <= minimumProgressBarHeight(&renderObject->style()))
inflatedRect = inflateRect(inflatedRect, size, progressBarMargins(controlSize), zoomLevel);
return inflatedRect;
@@ -1047,7 +1047,7 @@
return true;
IntRect inflatedRect = progressBarRectForBounds(renderObject, rect);
- int controlSize = controlSizeForFont(renderObject->style());
+ int controlSize = controlSizeForFont(&renderObject->style());
RenderProgress* renderProgress = toRenderProgress(renderObject);
HIThemeTrackDrawInfo trackInfo;
@@ -1081,7 +1081,7 @@
GraphicsContextStateSaver stateSaver(*paintInfo.context);
- if (!renderProgress->style()->isLeftToRightDirection()) {
+ if (!renderProgress->style().isLeftToRightDirection()) {
paintInfo.context->translate(2 * inflatedRect.x() + inflatedRect.width(), 0);
paintInfo.context->scale(FloatSize(-1, 1));
}
@@ -1153,7 +1153,7 @@
GraphicsContextStateSaver stateSaver(*paintInfo.context);
- RoundedRect border = o->style()->getRoundedBorderFor(r, &o->view());
+ RoundedRect border = o->style().getRoundedBorderFor(r, &o->view());
int radius = border.radii().topLeft().width();
CGColorSpaceRef cspace = deviceRGBColorSpaceRef();
@@ -1212,27 +1212,27 @@
bool RenderThemeMac::paintMenuListButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
{
- IntRect bounds = IntRect(r.x() + o->style()->borderLeftWidth(),
- r.y() + o->style()->borderTopWidth(),
- r.width() - o->style()->borderLeftWidth() - o->style()->borderRightWidth(),
- r.height() - o->style()->borderTopWidth() - o->style()->borderBottomWidth());
+ IntRect bounds = IntRect(r.x() + o->style().borderLeftWidth(),
+ r.y() + o->style().borderTopWidth(),
+ r.width() - o->style().borderLeftWidth() - o->style().borderRightWidth(),
+ r.height() - o->style().borderTopWidth() - o->style().borderBottomWidth());
// Draw the gradients to give the styled popup menu a button appearance
paintMenuListButtonGradients(o, paintInfo, bounds);
// Since we actually know the size of the control here, we restrict the font scale to make sure the arrows will fit vertically in the bounds
- float fontScale = min(o->style()->fontSize() / baseFontSize, bounds.height() / (baseArrowHeight * 2 + baseSpaceBetweenArrows));
+ float fontScale = min(o->style().fontSize() / baseFontSize, bounds.height() / (baseArrowHeight * 2 + baseSpaceBetweenArrows));
float centerY = bounds.y() + bounds.height() / 2.0f;
float arrowHeight = baseArrowHeight * fontScale;
float arrowWidth = baseArrowWidth * fontScale;
- float leftEdge = bounds.maxX() - arrowPaddingRight * o->style()->effectiveZoom() - arrowWidth;
+ float leftEdge = bounds.maxX() - arrowPaddingRight * o->style().effectiveZoom() - arrowWidth;
float spaceBetweenArrows = baseSpaceBetweenArrows * fontScale;
- if (bounds.width() < arrowWidth + arrowPaddingLeft * o->style()->effectiveZoom())
+ if (bounds.width() < arrowWidth + arrowPaddingLeft * o->style().effectiveZoom())
return false;
GraphicsContextStateSaver stateSaver(*paintInfo.context);
- paintInfo.context->setFillColor(o->style()->visitedDependentColor(CSSPropertyColor), o->style()->colorSpace());
+ paintInfo.context->setFillColor(o->style().visitedDependentColor(CSSPropertyColor), o->style().colorSpace());
paintInfo.context->setStrokeStyle(NoStroke);
FloatPoint arrow1[3];
@@ -1256,7 +1256,7 @@
// FIXME: Should the separator thickness and space be scaled up by fontScale?
int separatorSpace = 2; // Deliberately ignores zoom since it looks nicer if it stays thin.
- int leftEdgeOfSeparator = static_cast<int>(leftEdge - arrowPaddingLeft * o->style()->effectiveZoom()); // FIXME: Round?
+ int leftEdgeOfSeparator = static_cast<int>(leftEdge - arrowPaddingLeft * o->style().effectiveZoom()); // FIXME: Round?
// Draw the separator to the left of the arrows
paintInfo.context->setStrokeThickness(1.0f); // Deliberately ignores zoom since it looks nicer if it stays thin.
@@ -1362,7 +1362,7 @@
NSPopUpButtonCell* popupButton = this->popupButton();
// Set the control size based off the rectangle we're painting into.
- setControlSize(popupButton, popupButtonSizes(), r.size(), o->style()->effectiveZoom());
+ setControlSize(popupButton, popupButtonSizes(), r.size(), o->style().effectiveZoom());
// Update the various states we respond to.
updateActiveState(popupButton, o);
@@ -1396,13 +1396,13 @@
bool RenderThemeMac::paintSliderTrack(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
{
IntRect bounds = r;
- float zoomLevel = o->style()->effectiveZoom();
+ float zoomLevel = o->style().effectiveZoom();
float zoomedTrackWidth = trackWidth * zoomLevel;
- if (o->style()->appearance() == SliderHorizontalPart || o->style()->appearance() == MediaSliderPart) {
+ if (o->style().appearance() == SliderHorizontalPart || o->style().appearance() == MediaSliderPart) {
bounds.setHeight(zoomedTrackWidth);
bounds.setY(r.y() + r.height() / 2 - zoomedTrackWidth / 2);
- } else if (o->style()->appearance() == SliderVerticalPart) {
+ } else if (o->style().appearance() == SliderVerticalPart) {
bounds.setWidth(zoomedTrackWidth);
bounds.setX(r.x() + r.width() / 2 - zoomedTrackWidth / 2);
}
@@ -1421,7 +1421,7 @@
struct CGFunctionCallbacks mainCallbacks = { 0, TrackGradientInterpolate, NULL };
RetainPtr<CGFunctionRef> mainFunction = adoptCF(CGFunctionCreate(NULL, 1, NULL, 4, NULL, &mainCallbacks));
RetainPtr<CGShadingRef> mainShading;
- if (o->style()->appearance() == SliderVerticalPart)
+ if (o->style().appearance() == SliderVerticalPart)
mainShading = adoptCF(CGShadingCreateAxial(cspace, CGPointMake(bounds.x(), bounds.maxY()), CGPointMake(bounds.maxX(), bounds.maxY()), mainFunction.get(), false, false));
else
mainShading = adoptCF(CGShadingCreateAxial(cspace, CGPointMake(bounds.x(), bounds.y()), CGPointMake(bounds.x(), bounds.maxY()), mainFunction.get(), false, false));
@@ -1444,7 +1444,7 @@
bool RenderThemeMac::paintSliderThumb(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
{
- NSSliderCell* sliderThumbCell = o->style()->appearance() == SliderThumbVerticalPart
+ NSSliderCell* sliderThumbCell = o->style().appearance() == SliderThumbVerticalPart
? sliderThumbVertical()
: sliderThumbHorizontal();
@@ -1458,14 +1458,14 @@
// Update the pressed state using the NSCell tracking methods, since that's how NSSliderCell keeps track of it.
bool oldPressed;
- if (o->style()->appearance() == SliderThumbVerticalPart)
+ if (o->style().appearance() == SliderThumbVerticalPart)
oldPressed = m_isSliderThumbVerticalPressed;
else
oldPressed = m_isSliderThumbHorizontalPressed;
bool pressed = isPressed(o);
- if (o->style()->appearance() == SliderThumbVerticalPart)
+ if (o->style().appearance() == SliderThumbVerticalPart)
m_isSliderThumbVerticalPressed = pressed;
else
m_isSliderThumbHorizontalPressed = pressed;
@@ -1479,11 +1479,11 @@
FloatRect bounds = r;
// Make the height of the vertical slider slightly larger so NSSliderCell will draw a vertical slider.
- if (o->style()->appearance() == SliderThumbVerticalPart)
- bounds.setHeight(bounds.height() + verticalSliderHeightPadding * o->style()->effectiveZoom());
+ if (o->style().appearance() == SliderThumbVerticalPart)
+ bounds.setHeight(bounds.height() + verticalSliderHeightPadding * o->style().effectiveZoom());
GraphicsContextStateSaver stateSaver(*paintInfo.context);
- float zoomLevel = o->style()->effectiveZoom();
+ float zoomLevel = o->style().effectiveZoom();
FloatRect unzoomedRect = bounds;
if (zoomLevel != 1.0f) {
@@ -1509,7 +1509,7 @@
GraphicsContextStateSaver stateSaver(*paintInfo.context);
- float zoomLevel = o->style()->effectiveZoom();
+ float zoomLevel = o->style().effectiveZoom();
IntRect unzoomedRect = r;
@@ -1536,7 +1536,7 @@
{
NSSearchFieldCell* search = this->search();
- [search setControlSize:controlSizeForFont(o->style())];
+ [search setControlSize:controlSizeForFont(&o->style())];
// Update the various states we respond to.
updateActiveState(search, o);
@@ -1614,7 +1614,7 @@
GraphicsContextStateSaver stateSaver(*paintInfo.context);
- float zoomLevel = o->style()->effectiveZoom();
+ float zoomLevel = o->style().effectiveZoom();
FloatRect localBounds = [search cancelButtonRectForBounds:NSRect(input->renderBox()->pixelSnappedBorderBoxRect())];
@@ -1739,7 +1739,7 @@
[search setSearchMenuTemplate:searchMenuTemplate()];
GraphicsContextStateSaver stateSaver(*paintInfo.context);
- float zoomLevel = o->style()->effectiveZoom();
+ float zoomLevel = o->style().effectiveZoom();
FloatRect localBounds = [search searchButtonRectForBounds:NSRect(input->renderBox()->pixelSnappedBorderBoxRect())];
localBounds = convertToPaintingRect(input->renderer(), o, localBounds, r);
@@ -1832,7 +1832,7 @@
if (alignedPluginRect.width() <= 0 || alignedPluginRect.height() <= 0)
return true;
- context->drawImage(snapshot, plugInRenderer->style()->colorSpace(), alignedPluginRect, CompositeSourceOver);
+ context->drawImage(snapshot, plugInRenderer->style().colorSpace(), alignedPluginRect, CompositeSourceOver);
return false;
}
diff --git a/Source/WebCore/rendering/RenderThemeSafari.cpp b/Source/WebCore/rendering/RenderThemeSafari.cpp
index 2ab016d..912ed26 100644
--- a/Source/WebCore/rendering/RenderThemeSafari.cpp
+++ b/Source/WebCore/rendering/RenderThemeSafari.cpp
@@ -263,9 +263,9 @@
void RenderThemeSafari::adjustRepaintRect(const RenderObject* o, IntRect& r)
{
- NSControlSize controlSize = controlSizeForFont(o->style());
+ NSControlSize controlSize = controlSizeForFont(&o->style());
- switch (o->style()->appearance()) {
+ switch (o->style().appearance()) {
case CheckboxPart: {
// We inflate the rect as needed to account for padding included in the cell to accommodate the checkbox
// shadow" and the check. We don't consider this part of the bounds of the control in WebKit.
@@ -319,7 +319,7 @@
if (!o->isBox())
return 0;
- if (o->style()->appearance() == CheckboxPart || o->style()->appearance() == RadioPart) {
+ if (o->style().appearance() == CheckboxPart || o->style().appearance() == RadioPart) {
const RenderBox* box = toRenderBox(o);
return box->marginTop() + box->height() - 2; // The baseline is 2px up from the bottom of the checkbox/radio in AppKit.
}
@@ -333,7 +333,7 @@
return false;
// Checkboxes only have tint when checked.
- if (o->style()->appearance() == CheckboxPart)
+ if (o->style().appearance() == CheckboxPart)
return isChecked(o);
// For now assume other controls have tint if enabled.
@@ -417,7 +417,7 @@
{
ASSERT(SafariThemeLibrary());
- NSControlSize controlSize = controlSizeForFont(o->style());
+ NSControlSize controlSize = controlSizeForFont(&o->style());
IntRect inflatedRect = inflateRect(r, checkboxSizes()[controlSize], checkboxMargins(controlSize));
paintThemePart(SafariTheme::CheckboxPart, paintInfo.context->platformContext(), inflatedRect, controlSize, determineState(o));
@@ -456,7 +456,7 @@
{
ASSERT(SafariThemeLibrary());
- NSControlSize controlSize = controlSizeForFont(o->style());
+ NSControlSize controlSize = controlSizeForFont(&o->style());
IntRect inflatedRect = inflateRect(r, radioSizes()[controlSize], radioMargins(controlSize));
paintThemePart(RadioButtonPart, paintInfo.context->platformContext(), inflatedRect, controlSize, determineState(o));
@@ -687,7 +687,7 @@
size.setWidth(r.width());
// Now inflate it to account for the shadow.
- if (r.width() >= minimumMenuListSize(o->style()))
+ if (r.width() >= minimumMenuListSize(&o->style()))
inflatedRect = inflateRect(inflatedRect, size, popupButtonMargins(controlSize));
paintThemePart(DropDownButtonPart, info.context->platformContext(), inflatedRect, controlSize, determineState(o));
@@ -755,7 +755,7 @@
paintInfo.context->save();
- RoundedRect bound = o->style()->getRoundedBorderFor(r);
+ RoundedRect bound = o->style().getRoundedBorderFor(r);
int radius = bound.radii().topLeft().width();
CGColorSpaceRef cspace = deviceRGBColorSpaceRef();
@@ -809,15 +809,15 @@
bool RenderThemeSafari::paintMenuListButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
{
- IntRect bounds = IntRect(r.x() + o->style()->borderLeftWidth(),
- r.y() + o->style()->borderTopWidth(),
- r.width() - o->style()->borderLeftWidth() - o->style()->borderRightWidth(),
- r.height() - o->style()->borderTopWidth() - o->style()->borderBottomWidth());
+ IntRect bounds = IntRect(r.x() + o->style().borderLeftWidth(),
+ r.y() + o->style().borderTopWidth(),
+ r.width() - o->style().borderLeftWidth() - o->style().borderRightWidth(),
+ r.height() - o->style().borderTopWidth() - o->style().borderBottomWidth());
// Draw the gradients to give the styled popup menu a button appearance
paintMenuListButtonGradients(o, paintInfo, bounds);
// Since we actually know the size of the control here, we restrict the font scale to make sure the arrow will fit vertically in the bounds
- float fontScale = min(o->style()->fontSize() / baseFontSize, bounds.height() / baseArrowHeight);
+ float fontScale = min(o->style().fontSize() / baseFontSize, bounds.height() / baseArrowHeight);
float centerY = bounds.y() + bounds.height() / 2.0f;
float arrowHeight = baseArrowHeight * fontScale;
float arrowWidth = baseArrowWidth * fontScale;
@@ -828,7 +828,7 @@
paintInfo.context->save();
- paintInfo.context->setFillColor(o->style()->visitedDependentColor(CSSPropertyColor), ColorSpaceDeviceRGB);
+ paintInfo.context->setFillColor(o->style().visitedDependentColor(CSSPropertyColor), ColorSpaceDeviceRGB);
paintInfo.context->setStrokeColor(NoStroke, ColorSpaceDeviceRGB);
FloatPoint arrow[3];
@@ -958,12 +958,12 @@
IntSize radius(trackRadius, trackRadius);
RoundedRect bounds(r, radius, radius, radius, radius);
- if (o->style()->appearance() == SliderHorizontalPart)
+ if (o->style().appearance() == SliderHorizontalPart)
bounds.setRect(IntRect(r.x(),
r.y() + r.height() / 2 - trackWidth / 2,
r.width(),
trackWidth));
- else if (o->style()->appearance() == SliderVerticalPart)
+ else if (o->style().appearance() == SliderVerticalPart)
bounds.setRect(IntRect(r.x() + r.width() / 2 - trackWidth / 2,
r.y(),
trackWidth,
@@ -978,7 +978,7 @@
struct CGFunctionCallbacks mainCallbacks = { 0, TrackGradientInterpolate, NULL };
RetainPtr<CGFunctionRef> mainFunction = adoptCF(CGFunctionCreate(NULL, 1, NULL, 4, NULL, &mainCallbacks));
RetainPtr<CGShadingRef> mainShading;
- if (o->style()->appearance() == SliderVerticalPart)
+ if (o->style().appearance() == SliderVerticalPart)
mainShading = adoptCF(CGShadingCreateAxial(cspace, CGPointMake(bounds.rect().x(), bounds.rect().maxY()), CGPointMake(bounds.rect().maxX(), bounds.rect().maxY()), mainFunction.get(), false, false));
else
mainShading = adoptCF(CGShadingCreateAxial(cspace, CGPointMake(bounds.rect().x(), bounds.rect().y()), CGPointMake(bounds.rect().x(), bounds.rect().maxY()), mainFunction.get(), false, false));
diff --git a/Source/WebCore/rendering/RenderThemeWin.cpp b/Source/WebCore/rendering/RenderThemeWin.cpp
index 8f0ffee..d0ff829 100644
--- a/Source/WebCore/rendering/RenderThemeWin.cpp
+++ b/Source/WebCore/rendering/RenderThemeWin.cpp
@@ -437,7 +437,7 @@
unsigned RenderThemeWin::determineClassicState(RenderObject* o, ControlSubPart subPart)
{
unsigned state = 0;
- switch (o->style()->appearance()) {
+ switch (o->style().appearance()) {
case PushButtonPart:
case ButtonPart:
case DefaultButtonPart:
@@ -449,7 +449,7 @@
break;
case RadioPart:
case CheckboxPart:
- state = (o->style()->appearance() == RadioPart) ? DFCS_BUTTONRADIO : DFCS_BUTTONCHECK;
+ state = (o->style().appearance() == RadioPart) ? DFCS_BUTTONRADIO : DFCS_BUTTONCHECK;
if (isChecked(o))
state |= DFCS_CHECKED;
if (!isEnabled(o))
@@ -484,7 +484,7 @@
unsigned RenderThemeWin::determineState(RenderObject* o)
{
unsigned result = TS_NORMAL;
- ControlPart appearance = o->style()->appearance();
+ ControlPart appearance = o->style().appearance();
if (!isEnabled(o))
result = TS_DISABLED;
else if (isReadOnlyControl(o) && (TextFieldPart == appearance || TextAreaPart == appearance || SearchFieldPart == appearance))
@@ -507,7 +507,7 @@
unsigned result = TUS_NORMAL;
if (!isEnabled(o))
result = TUS_DISABLED;
- else if (supportsFocus(o->style()->appearance()) && isFocused(o))
+ else if (supportsFocus(o->style().appearance()) && isFocused(o))
result = TUS_FOCUSED;
else if (isPressed(o))
result = TUS_PRESSED;
@@ -523,7 +523,7 @@
result = PBS_DISABLED;
else if (isPressed(o))
result = PBS_PRESSED;
- else if (supportsFocus(o->style()->appearance()) && isFocused(o))
+ else if (supportsFocus(o->style().appearance()) && isFocused(o))
result = PBS_DEFAULTED;
else if (isHovered(o))
result = PBS_HOT;
@@ -548,7 +548,7 @@
ThemeData RenderThemeWin::getClassicThemeData(RenderObject* o, ControlSubPart subPart)
{
ThemeData result;
- switch (o->style()->appearance()) {
+ switch (o->style().appearance()) {
case PushButtonPart:
case ButtonPart:
case DefaultButtonPart:
@@ -603,7 +603,7 @@
return getClassicThemeData(o, subPart);
ThemeData result;
- switch (o->style()->appearance()) {
+ switch (o->style().appearance()) {
case PushButtonPart:
case ButtonPart:
case DefaultButtonPart:
@@ -685,8 +685,8 @@
} else if (themeData.m_part == TKP_TRACK || themeData.m_part == TKP_TRACKVERT) {
::DrawEdge(hdc, &widgetRect, EDGE_SUNKEN, BF_RECT | BF_ADJUST);
::FillRect(hdc, &widgetRect, (HBRUSH)GetStockObject(GRAY_BRUSH));
- } else if ((o->style()->appearance() == SliderThumbHorizontalPart ||
- o->style()->appearance() == SliderThumbVerticalPart) &&
+ } else if ((o->style().appearance() == SliderThumbHorizontalPart ||
+ o->style().appearance() == SliderThumbVerticalPart) &&
(themeData.m_part == TKP_THUMBBOTTOM || themeData.m_part == TKP_THUMBTOP ||
themeData.m_part == TKP_THUMBLEFT || themeData.m_part == TKP_THUMBRIGHT)) {
::DrawEdge(hdc, &widgetRect, EDGE_RAISED, BF_RECT | BF_SOFT | BF_MIDDLE | BF_ADJUST);
@@ -710,7 +710,7 @@
}
} else {
// Push buttons, buttons, checkboxes and radios, and the dropdown arrow in menulists.
- if (o->style()->appearance() == DefaultButtonPart) {
+ if (o->style().appearance() == DefaultButtonPart) {
HBRUSH brush = ::GetSysColorBrush(COLOR_3DDKSHADOW);
::FrameRect(hdc, &widgetRect, brush);
::InflateRect(&widgetRect, -1, -1);
@@ -843,7 +843,7 @@
// leaving space for the text field's 1px border
IntRect buttonRect(r);
buttonRect.inflate(-borderThickness);
- if (o->style()->direction() == LTR)
+ if (o->style().direction() == LTR)
buttonRect.setX(buttonRect.maxX() - dropDownButtonWidth);
buttonRect.setWidth(dropDownButtonWidth);
@@ -865,10 +865,10 @@
{
IntRect bounds = r;
- if (o->style()->appearance() == SliderHorizontalPart) {
+ if (o->style().appearance() == SliderHorizontalPart) {
bounds.setHeight(trackWidth);
bounds.setY(r.y() + r.height() / 2 - trackWidth / 2);
- } else if (o->style()->appearance() == SliderVerticalPart) {
+ } else if (o->style().appearance() == SliderVerticalPart) {
bounds.setWidth(trackWidth);
bounds.setX(r.x() + r.width() / 2 - trackWidth / 2);
}
@@ -940,7 +940,7 @@
static Image* cancelImage = Image::loadPlatformResource("searchCancel").leakRef();
static Image* cancelPressedImage = Image::loadPlatformResource("searchCancelPressed").leakRef();
- paintInfo.context->drawImage(isPressed(o) ? cancelPressedImage : cancelImage, o->style()->colorSpace(), bounds);
+ paintInfo.context->drawImage(isPressed(o) ? cancelPressedImage : cancelImage, o->style().colorSpace(), bounds);
return false;
}
@@ -989,7 +989,7 @@
bounds.setY(parentBox.y() + (parentBox.height() - bounds.height() + 1) / 2);
static Image* magnifierImage = Image::loadPlatformResource("searchMagnifier").leakRef();
- paintInfo.context->drawImage(magnifierImage, o->style()->colorSpace(), bounds);
+ paintInfo.context->drawImage(magnifierImage, o->style().colorSpace(), bounds);
return false;
}
@@ -1025,7 +1025,7 @@
bounds.setY(parentBox.y() + (parentBox.height() - bounds.height() + 1) / 2);
static Image* magnifierImage = Image::loadPlatformResource("searchMagnifierResults").leakRef();
- paintInfo.context->drawImage(magnifierImage, o->style()->colorSpace(), bounds);
+ paintInfo.context->drawImage(magnifierImage, o->style().colorSpace(), bounds);
return false;
}
diff --git a/Source/WebCore/rendering/RenderThemeWinCE.cpp b/Source/WebCore/rendering/RenderThemeWinCE.cpp
index c6a94bb..1993691 100644
--- a/Source/WebCore/rendering/RenderThemeWinCE.cpp
+++ b/Source/WebCore/rendering/RenderThemeWinCE.cpp
@@ -163,7 +163,7 @@
ThemeData RenderThemeWinCE::getThemeData(RenderObject* o)
{
ThemeData result;
- switch (o->style()->appearance()) {
+ switch (o->style().appearance()) {
case PushButtonPart:
case ButtonPart:
result.m_part = BP_BUTTON;
diff --git a/Source/WebCore/rendering/RenderTreeAsText.cpp b/Source/WebCore/rendering/RenderTreeAsText.cpp
index ce4d4f7..5a857a7 100644
--- a/Source/WebCore/rendering/RenderTreeAsText.cpp
+++ b/Source/WebCore/rendering/RenderTreeAsText.cpp
@@ -220,8 +220,8 @@
if (behavior & RenderAsTextShowAddresses)
ts << " " << static_cast<const void*>(&o);
- if (o.style() && o.style()->zIndex())
- ts << " zI: " << o.style()->zIndex();
+ if (o.style().zIndex())
+ ts << " zI: " << o.style().zIndex();
if (o.node()) {
String tagName = getTagName(o.node());
@@ -288,28 +288,28 @@
ts << " " << quoteAndEscapeNonPrintables(toRenderFileUploadControl(&o)->fileTextValue());
if (o.parent()) {
- Color color = o.style()->visitedDependentColor(CSSPropertyColor);
- if (o.parent()->style()->visitedDependentColor(CSSPropertyColor) != color)
+ Color color = o.style().visitedDependentColor(CSSPropertyColor);
+ if (o.parent()->style().visitedDependentColor(CSSPropertyColor) != color)
ts << " [color=" << color.nameForRenderTreeAsText() << "]";
// Do not dump invalid or transparent backgrounds, since that is the default.
- Color backgroundColor = o.style()->visitedDependentColor(CSSPropertyBackgroundColor);
- if (o.parent()->style()->visitedDependentColor(CSSPropertyBackgroundColor) != backgroundColor
+ Color backgroundColor = o.style().visitedDependentColor(CSSPropertyBackgroundColor);
+ if (o.parent()->style().visitedDependentColor(CSSPropertyBackgroundColor) != backgroundColor
&& backgroundColor.isValid() && backgroundColor.rgb())
ts << " [bgcolor=" << backgroundColor.nameForRenderTreeAsText() << "]";
- Color textFillColor = o.style()->visitedDependentColor(CSSPropertyWebkitTextFillColor);
- if (o.parent()->style()->visitedDependentColor(CSSPropertyWebkitTextFillColor) != textFillColor
+ Color textFillColor = o.style().visitedDependentColor(CSSPropertyWebkitTextFillColor);
+ if (o.parent()->style().visitedDependentColor(CSSPropertyWebkitTextFillColor) != textFillColor
&& textFillColor.isValid() && textFillColor != color && textFillColor.rgb())
ts << " [textFillColor=" << textFillColor.nameForRenderTreeAsText() << "]";
- Color textStrokeColor = o.style()->visitedDependentColor(CSSPropertyWebkitTextStrokeColor);
- if (o.parent()->style()->visitedDependentColor(CSSPropertyWebkitTextStrokeColor) != textStrokeColor
+ Color textStrokeColor = o.style().visitedDependentColor(CSSPropertyWebkitTextStrokeColor);
+ if (o.parent()->style().visitedDependentColor(CSSPropertyWebkitTextStrokeColor) != textStrokeColor
&& textStrokeColor.isValid() && textStrokeColor != color && textStrokeColor.rgb())
ts << " [textStrokeColor=" << textStrokeColor.nameForRenderTreeAsText() << "]";
- if (o.parent()->style()->textStrokeWidth() != o.style()->textStrokeWidth() && o.style()->textStrokeWidth() > 0)
- ts << " [textStrokeWidth=" << o.style()->textStrokeWidth() << "]";
+ if (o.parent()->style().textStrokeWidth() != o.style().textStrokeWidth() && o.style().textStrokeWidth() > 0)
+ ts << " [textStrokeWidth=" << o.style().textStrokeWidth() << "]";
}
if (!o.isBoxModelObject() || o.isLineBreak())
@@ -319,56 +319,56 @@
if (box.borderTop() || box.borderRight() || box.borderBottom() || box.borderLeft()) {
ts << " [border:";
- BorderValue prevBorder = o.style()->borderTop();
+ BorderValue prevBorder = o.style().borderTop();
if (!box.borderTop())
ts << " none";
else {
ts << " (" << box.borderTop() << "px ";
- printBorderStyle(ts, o.style()->borderTopStyle());
- Color col = o.style()->borderTopColor();
+ printBorderStyle(ts, o.style().borderTopStyle());
+ Color col = o.style().borderTopColor();
if (!col.isValid())
- col = o.style()->color();
+ col = o.style().color();
ts << col.nameForRenderTreeAsText() << ")";
}
- if (o.style()->borderRight() != prevBorder) {
- prevBorder = o.style()->borderRight();
+ if (o.style().borderRight() != prevBorder) {
+ prevBorder = o.style().borderRight();
if (!box.borderRight())
ts << " none";
else {
ts << " (" << box.borderRight() << "px ";
- printBorderStyle(ts, o.style()->borderRightStyle());
- Color col = o.style()->borderRightColor();
+ printBorderStyle(ts, o.style().borderRightStyle());
+ Color col = o.style().borderRightColor();
if (!col.isValid())
- col = o.style()->color();
+ col = o.style().color();
ts << col.nameForRenderTreeAsText() << ")";
}
}
- if (o.style()->borderBottom() != prevBorder) {
- prevBorder = box.style()->borderBottom();
+ if (o.style().borderBottom() != prevBorder) {
+ prevBorder = box.style().borderBottom();
if (!box.borderBottom())
ts << " none";
else {
ts << " (" << box.borderBottom() << "px ";
- printBorderStyle(ts, o.style()->borderBottomStyle());
- Color col = o.style()->borderBottomColor();
+ printBorderStyle(ts, o.style().borderBottomStyle());
+ Color col = o.style().borderBottomColor();
if (!col.isValid())
- col = o.style()->color();
+ col = o.style().color();
ts << col.nameForRenderTreeAsText() << ")";
}
}
- if (o.style()->borderLeft() != prevBorder) {
- prevBorder = o.style()->borderLeft();
+ if (o.style().borderLeft() != prevBorder) {
+ prevBorder = o.style().borderLeft();
if (!box.borderLeft())
ts << " none";
else {
ts << " (" << box.borderLeft() << "px ";
- printBorderStyle(ts, o.style()->borderLeftStyle());
- Color col = o.style()->borderLeftColor();
+ printBorderStyle(ts, o.style().borderLeftStyle());
+ Color col = o.style().borderLeftColor();
if (!col.isValid())
- col = o.style()->color();
+ col = o.style().color();
ts << col.nameForRenderTreeAsText() << ")";
}
}
@@ -377,7 +377,7 @@
}
#if ENABLE(MATHML)
- // We want to show any layout padding, both CSS padding and intrinsic padding, so we can't just check o.style()->hasPadding().
+ // We want to show any layout padding, both CSS padding and intrinsic padding, so we can't just check o.style().hasPadding().
if (o.isRenderMathMLBlock() && (box.paddingTop() || box.paddingRight() || box.paddingBottom() || box.paddingLeft())) {
ts << " [";
LayoutUnit cssTop = box.computedCSSPaddingTop();
@@ -530,7 +530,7 @@
ts << ": "
<< quoteAndEscapeNonPrintables(String(o.text()).substring(run.start(), run.len()));
if (run.hasHyphen())
- ts << " + hyphen string " << quoteAndEscapeNonPrintables(o.style()->hyphenString());
+ ts << " + hyphen string " << quoteAndEscapeNonPrintables(o.style().hyphenString());
ts << "\n";
}
diff --git a/Source/WebCore/rendering/RenderVideo.cpp b/Source/WebCore/rendering/RenderVideo.cpp
index 64814fc..e31c46f 100644
--- a/Source/WebCore/rendering/RenderVideo.cpp
+++ b/Source/WebCore/rendering/RenderVideo.cpp
@@ -81,7 +81,7 @@
void RenderVideo::updateIntrinsicSize()
{
LayoutSize size = calculateIntrinsicSize();
- size.scale(style()->effectiveZoom());
+ size.scale(style().effectiveZoom());
// Never set the element size to zero when in a media document.
if (size.isEmpty() && document().isMediaDocument())
@@ -244,7 +244,7 @@
mediaPlayer->setFrameView(&view().frameView());
mediaPlayer->setSize(IntSize(videoBounds.width(), videoBounds.height()));
mediaPlayer->setVisible(true);
- mediaPlayer->setShouldMaintainAspectRatio(style()->objectFit() != ObjectFitFill);
+ mediaPlayer->setShouldMaintainAspectRatio(style().objectFit() != ObjectFitFill);
}
LayoutUnit RenderVideo::computeReplacedLogicalWidth(ShouldComputePreferred shouldComputePreferred) const
diff --git a/Source/WebCore/rendering/RenderView.cpp b/Source/WebCore/rendering/RenderView.cpp
index 9472945..579f1f2 100644
--- a/Source/WebCore/rendering/RenderView.cpp
+++ b/Source/WebCore/rendering/RenderView.cpp
@@ -196,7 +196,7 @@
// pagination information.
RenderBox* seamlessAncestor = enclosingSeamlessRenderer(document());
LayoutState* seamlessLayoutState = seamlessAncestor ? seamlessAncestor->view().layoutState() : 0;
- bool shouldInheritPagination = seamlessLayoutState && !m_pageLogicalHeight && seamlessAncestor->style()->writingMode() == style()->writingMode();
+ bool shouldInheritPagination = seamlessLayoutState && !m_pageLogicalHeight && seamlessAncestor->style().writingMode() == style().writingMode();
state.m_pageLogicalHeight = shouldInheritPagination ? seamlessLayoutState->m_pageLogicalHeight : m_pageLogicalHeight;
state.m_pageLogicalHeightChanged = shouldInheritPagination ? seamlessLayoutState->m_pageLogicalHeightChanged : m_pageLogicalHeightChanged;
@@ -205,7 +205,7 @@
// Set up the correct pagination offset. We can use a negative offset in order to push the top of the RenderView into its correct place
// on a page. We can take the iframe's offset from the logical top of the first page and make the negative into the pagination offset within the child
// view.
- bool isFlipped = seamlessAncestor->style()->isFlippedBlocksWritingMode();
+ bool isFlipped = seamlessAncestor->style().isFlippedBlocksWritingMode();
LayoutSize layoutOffset = seamlessLayoutState->layoutOffset();
LayoutSize iFrameOffset(layoutOffset.width() + seamlessAncestor->x() + (!isFlipped ? seamlessAncestor->borderLeft() + seamlessAncestor->paddingLeft() :
seamlessAncestor->borderRight() + seamlessAncestor->paddingRight()),
@@ -308,12 +308,12 @@
RenderBox& box = toRenderBox(*child);
if (box.hasRelativeLogicalHeight()
|| box.hasViewportPercentageLogicalHeight()
- || box.style()->logicalHeight().isPercent()
- || box.style()->logicalMinHeight().isPercent()
- || box.style()->logicalMaxHeight().isPercent()
- || box.style()->logicalHeight().isViewportPercentage()
- || box.style()->logicalMinHeight().isViewportPercentage()
- || box.style()->logicalMaxHeight().isViewportPercentage()
+ || box.style().logicalHeight().isPercent()
+ || box.style().logicalMinHeight().isPercent()
+ || box.style().logicalMaxHeight().isPercent()
+ || box.style().logicalHeight().isViewportPercentage()
+ || box.style().logicalMinHeight().isViewportPercentage()
+ || box.style().logicalMaxHeight().isViewportPercentage()
#if ENABLE(SVG)
|| box.isSVGRoot()
#endif
@@ -353,7 +353,7 @@
if (document().printing())
return pageLogicalHeight();
- if (hasColumns() && !style()->hasInlineColumnAxis()) {
+ if (hasColumns() && !style().hasInlineColumnAxis()) {
if (int pageLength = frameView().pagination().pageLength)
return pageLength;
}
@@ -416,7 +416,7 @@
void RenderView::calcColumnWidth()
{
int columnWidth = contentLogicalWidth();
- if (style()->hasInlineColumnAxis()) {
+ if (style().hasInlineColumnAxis()) {
if (int pageLength = frameView().pagination().pageLength)
columnWidth = pageLength;
}
@@ -452,17 +452,17 @@
if (!rootObject)
return false;
- RenderStyle* style = rootObject->style();
- if (style->visibility() != VISIBLE
- || style->opacity() != 1
- || style->hasTransform())
+ const RenderStyle& style = rootObject->style();
+ if (style.visibility() != VISIBLE
+ || style.opacity() != 1
+ || style.hasTransform())
return false;
if (isComposited(rootObject))
return false;
const RenderElement* rootRenderer = rootObject->rendererForRootBackground();
- if (rootRenderer->style()->backgroundClip() == TextFillBox)
+ if (rootRenderer->style().backgroundClip() == TextFillBox)
return false;
return true;
@@ -530,7 +530,7 @@
if (baseColor.alpha()) {
CompositeOperator previousOperator = paintInfo.context->compositeOperation();
paintInfo.context->setCompositeOperation(CompositeCopy);
- paintInfo.context->fillRect(paintInfo.rect, baseColor, style()->colorSpace());
+ paintInfo.context->fillRect(paintInfo.rect, baseColor, style().colorSpace());
paintInfo.context->setCompositeOperation(previousOperator);
} else
paintInfo.context->clearRect(paintInfo.rect);
@@ -620,10 +620,10 @@
if (printing())
return;
- if (style()->isFlippedBlocksWritingMode()) {
+ if (style().isFlippedBlocksWritingMode()) {
// We have to flip by hand since the view's logical height has not been determined. We
// can use the viewport width and height.
- if (style()->isHorizontalWritingMode())
+ if (style().isHorizontalWritingMode())
rect.setY(viewHeight() - rect.maxY());
else
rect.setX(viewWidth() - rect.maxX());
@@ -1000,7 +1000,7 @@
int height = 0;
if (!shouldUsePrintingLayout()) {
height = frameView().layoutHeight();
- height = frameView().useFixedLayout() ? ceilf(style()->effectiveZoom() * float(height)) : height;
+ height = frameView().useFixedLayout() ? ceilf(style().effectiveZoom() * float(height)) : height;
}
return height;
}
@@ -1010,14 +1010,14 @@
int width = 0;
if (!shouldUsePrintingLayout()) {
width = frameView().layoutWidth();
- width = frameView().useFixedLayout() ? ceilf(style()->effectiveZoom() * float(width)) : width;
+ width = frameView().useFixedLayout() ? ceilf(style().effectiveZoom() * float(width)) : width;
}
return width;
}
int RenderView::viewLogicalHeight() const
{
- int height = style()->isHorizontalWritingMode() ? viewHeight() : viewWidth();
+ int height = style().isHorizontalWritingMode() ? viewHeight() : viewWidth();
return height;
}
diff --git a/Source/WebCore/rendering/RenderView.h b/Source/WebCore/rendering/RenderView.h
index 89cae2e..3be4be5 100644
--- a/Source/WebCore/rendering/RenderView.h
+++ b/Source/WebCore/rendering/RenderView.h
@@ -65,7 +65,7 @@
// The same as the FrameView's layoutHeight/layoutWidth but with null check guards.
int viewHeight() const;
int viewWidth() const;
- int viewLogicalWidth() const { return style()->isHorizontalWritingMode() ? viewWidth() : viewHeight(); }
+ int viewLogicalWidth() const { return style().isHorizontalWritingMode() ? viewWidth() : viewHeight(); }
int viewLogicalHeight() const;
float zoomFactor() const;
@@ -249,7 +249,7 @@
{
// We push LayoutState even if layoutState is disabled because it stores layoutDelta too.
if (!doingFullRepaint() || m_layoutState->isPaginated() || renderer->hasColumns() || renderer->flowThreadContainingBlock()
- || m_layoutState->lineGrid() || (renderer->style()->lineGrid() != RenderStyle::initialLineGrid() && renderer->isRenderBlockFlow())
+ || m_layoutState->lineGrid() || (renderer->style().lineGrid() != RenderStyle::initialLineGrid() && renderer->isRenderBlockFlow())
#if ENABLE(CSS_SHAPES)
|| (renderer->isRenderBlock() && toRenderBlock(renderer)->shapeInsideInfo())
|| (m_layoutState->shapeInsideInfo() && renderer->isRenderBlock() && !toRenderBlock(renderer)->allowsShapeInsideInfoSharing())
diff --git a/Source/WebCore/rendering/RenderWidget.cpp b/Source/WebCore/rendering/RenderWidget.cpp
index 6c2d105..2fe3576 100644
--- a/Source/WebCore/rendering/RenderWidget.cpp
+++ b/Source/WebCore/rendering/RenderWidget.cpp
@@ -188,8 +188,7 @@
widgetRendererMap().add(m_widget.get(), this);
view().frameView().didAddWidgetToRenderTree(*m_widget);
// If we've already received a layout, apply the calculated space to the
- // widget immediately, but we have to have really been fully constructed (with a non-null
- // style pointer).
+ // widget immediately, but we have to have really been fully constructed.
if (hasInitializedStyle()) {
if (!needsLayout()) {
WeakPtr<RenderWidget> weakThis = createWeakPtr();
@@ -198,7 +197,7 @@
return;
}
- if (style()->visibility() != VISIBLE)
+ if (style().visibility() != VISIBLE)
m_widget->hide();
else {
m_widget->show();
@@ -224,7 +223,7 @@
{
RenderReplaced::styleDidChange(diff, oldStyle);
if (m_widget) {
- if (style()->visibility() != VISIBLE)
+ if (style().visibility() != VISIBLE)
m_widget->hide();
else
m_widget->show();
@@ -292,11 +291,11 @@
return;
#if PLATFORM(MAC)
- if (style()->highlight() != nullAtom && !paintInfo.context->paintingDisabled())
- paintCustomHighlight(paintOffset, style()->highlight(), true);
+ if (style().highlight() != nullAtom && !paintInfo.context->paintingDisabled())
+ paintCustomHighlight(paintOffset, style().highlight(), true);
#endif
- if (style()->hasBorderRadius()) {
+ if (style().hasBorderRadius()) {
LayoutRect borderRect = LayoutRect(adjustedPaintOffset, size());
if (borderRect.isEmpty())
@@ -304,7 +303,7 @@
// Push a clip if we have a border radius, since we want to round the foreground content that gets painted.
paintInfo.context->save();
- RoundedRect roundedInnerRect = style()->getRoundedInnerBorderFor(borderRect,
+ RoundedRect roundedInnerRect = style().getRoundedInnerBorderFor(borderRect,
paddingTop() + borderTop(), paddingBottom() + borderBottom(), paddingLeft() + borderLeft(), paddingRight() + borderRight(), true, true);
clipRoundedInnerRect(paintInfo.context, borderRect, roundedInnerRect);
}
@@ -312,13 +311,13 @@
if (m_widget)
paintContents(paintInfo, paintOffset);
- if (style()->hasBorderRadius())
+ if (style().hasBorderRadius())
paintInfo.context->restore();
// Paint a partially transparent wash over selected widgets.
if (isSelected() && !document().printing()) {
// FIXME: selectionRect() is in absolute, not painting coordinates.
- paintInfo.context->fillRect(pixelSnappedIntRect(selectionRect()), selectionBackgroundColor(), style()->colorSpace());
+ paintInfo.context->fillRect(pixelSnappedIntRect(selectionRect()), selectionBackgroundColor(), style().colorSpace());
}
if (hasLayer() && layer()->canResize())
diff --git a/Source/WebCore/rendering/RootInlineBox.cpp b/Source/WebCore/rendering/RootInlineBox.cpp
index 32bcf63..9acb486 100644
--- a/Source/WebCore/rendering/RootInlineBox.cpp
+++ b/Source/WebCore/rendering/RootInlineBox.cpp
@@ -166,7 +166,7 @@
void RootInlineBox::paintEllipsisBox(PaintInfo& paintInfo, const LayoutPoint& paintOffset, LayoutUnit lineTop, LayoutUnit lineBottom) const
{
- if (hasEllipsisBox() && paintInfo.shouldPaintWithinRoot(renderer()) && renderer().style()->visibility() == VISIBLE
+ if (hasEllipsisBox() && paintInfo.shouldPaintWithinRoot(renderer()) && renderer().style().visibility() == VISIBLE
&& paintInfo.phase == PaintPhaseForeground)
ellipsisBox()->paint(paintInfo, paintOffset, lineTop, lineBottom);
}
@@ -181,13 +181,13 @@
// Highlight acts as a selection inflation.
FloatRect rootRect(0, selectionTop(), logicalWidth(), selectionHeight());
- IntRect inflatedRect = enclosingIntRect(page->chrome().client().customHighlightRect(renderer().element(), renderer().style()->highlight(), rootRect));
+ IntRect inflatedRect = enclosingIntRect(page->chrome().client().customHighlightRect(renderer().element(), renderer().style().highlight(), rootRect));
setOverflowFromLogicalRects(inflatedRect, inflatedRect, lineTop(), lineBottom());
}
void RootInlineBox::paintCustomHighlight(PaintInfo& paintInfo, const LayoutPoint& paintOffset, const AtomicString& highlightType)
{
- if (!paintInfo.shouldPaintWithinRoot(renderer()) || renderer().style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseForeground)
+ if (!paintInfo.shouldPaintWithinRoot(renderer()) || renderer().style().visibility() != VISIBLE || paintInfo.phase != PaintPhaseForeground)
return;
Page* page = renderer().frame().page();
@@ -345,7 +345,7 @@
{
LayoutUnit result = 0;
- if (!renderer().style()->isFlippedLinesWritingMode()) {
+ if (!renderer().style().isFlippedLinesWritingMode()) {
// Annotations under the previous line may push us down.
if (prevRootBox() && prevRootBox()->hasAnnotationsAfter())
result = prevRootBox()->computeUnderAnnotationAdjustment(lineTop());
@@ -376,14 +376,14 @@
{
// If our block doesn't have snapping turned on, do nothing.
// FIXME: Implement bounds snapping.
- if (blockFlow().style()->lineSnap() == LineSnapNone)
+ if (blockFlow().style().lineSnap() == LineSnapNone)
return 0;
// Get the current line grid and offset.
LayoutState* layoutState = blockFlow().view().layoutState();
RenderBlockFlow* lineGrid = layoutState->lineGrid();
LayoutSize lineGridOffset = layoutState->lineGridOffset();
- if (!lineGrid || lineGrid->style()->writingMode() != blockFlow().style()->writingMode())
+ if (!lineGrid || lineGrid->style().writingMode() != blockFlow().style().writingMode())
return 0;
// Get the hypothetical line box used to establish the grid.
@@ -402,14 +402,14 @@
if (!gridLineHeight)
return 0;
- LayoutUnit lineGridFontAscent = lineGrid->style()->fontMetrics().ascent(baselineType());
+ LayoutUnit lineGridFontAscent = lineGrid->style().fontMetrics().ascent(baselineType());
LayoutUnit lineGridFontHeight = lineGridBox->logicalHeight();
LayoutUnit firstTextTop = lineGridBlockOffset + lineGridBox->logicalTop();
LayoutUnit firstLineTopWithLeading = lineGridBlockOffset + lineGridBox->lineTopWithLeading();
LayoutUnit firstBaselinePosition = firstTextTop + lineGridFontAscent;
LayoutUnit currentTextTop = blockOffset + logicalTop() + delta;
- LayoutUnit currentFontAscent = blockFlow().style()->fontMetrics().ascent(baselineType());
+ LayoutUnit currentFontAscent = blockFlow().style().fontMetrics().ascent(baselineType());
LayoutUnit currentBaselinePosition = currentTextTop + currentFontAscent;
LayoutUnit lineGridPaginationOrigin = isHorizontal() ? layoutState->lineGridPaginationOrigin().height() : layoutState->lineGridPaginationOrigin().width();
@@ -423,7 +423,7 @@
firstTextTop = pageLogicalTop + lineGridBox->logicalTop() - lineGrid->borderAndPaddingBefore() + lineGridPaginationOrigin;
}
- if (blockFlow().style()->lineSnap() == LineSnapContain) {
+ if (blockFlow().style().lineSnap() == LineSnapContain) {
// Compute the desired offset from the text-top of a grid line.
// Look at our height (logicalHeight()).
// Look at the total available height. It's going to be (textBottom - textTop) + (n-1)*(multiple with leading)
@@ -501,8 +501,8 @@
logicalRect.move(renderer().isHorizontalWritingMode() ? offsetFromRootBlock : LayoutSize(offsetFromRootBlock.height(), offsetFromRootBlock.width()));
LayoutRect gapRect = rootBlock.logicalRectToPhysicalRect(rootBlockPhysicalPosition, logicalRect);
if (isPreviousBoxSelected && gapRect.width() > 0 && gapRect.height() > 0) {
- if (paintInfo && box->parent()->renderer().style()->visibility() == VISIBLE)
- paintInfo->context->fillRect(gapRect, box->parent()->renderer().selectionBackgroundColor(), box->parent()->renderer().style()->colorSpace());
+ if (paintInfo && box->parent()->renderer().style().visibility() == VISIBLE)
+ paintInfo->context->fillRect(gapRect, box->parent()->renderer().selectionBackgroundColor(), box->parent()->renderer().style().colorSpace());
// VisibleSelection may be non-contiguous, see comment above.
result.uniteCenter(gapRect);
}
@@ -535,10 +535,10 @@
if (extraWidthToEndOfLine)
*extraWidthToEndOfLine = (logicalWidth() + rootLeft) - (left + caretWidth);
- RenderStyle* blockStyle = blockFlow().style();
+ const RenderStyle& blockStyle = blockFlow().style();
bool rightAligned = false;
- switch (blockStyle->textAlign()) {
+ switch (blockStyle.textAlign()) {
case RIGHT:
case WEBKIT_RIGHT:
rightAligned = true;
@@ -550,10 +550,10 @@
break;
case JUSTIFY:
case TASTART:
- rightAligned = !blockStyle->isLeftToRightDirection();
+ rightAligned = !blockStyle.isLeftToRightDirection();
break;
case TAEND:
- rightAligned = blockStyle->isLeftToRightDirection();
+ rightAligned = blockStyle.isLeftToRightDirection();
break;
}
@@ -567,7 +567,7 @@
left = std::min(left, rightEdge - caretWidthRightOfOffset);
left = std::max(left, rootLeft);
}
- return blockStyle->isHorizontalWritingMode() ? IntRect(left, top, caretWidth, height) : IntRect(top, left, height, caretWidth);
+ return blockStyle.isHorizontalWritingMode() ? IntRect(left, top, caretWidth, height) : IntRect(top, left, height, caretWidth);
}
RenderObject::SelectionState RootInlineBox::selectionState()
@@ -619,9 +619,9 @@
LayoutUnit selectionTop = m_lineTop;
if (m_hasAnnotationsBefore)
- selectionTop -= !renderer().style()->isFlippedLinesWritingMode() ? computeOverAnnotationAdjustment(m_lineTop) : computeUnderAnnotationAdjustment(m_lineTop);
+ selectionTop -= !renderer().style().isFlippedLinesWritingMode() ? computeOverAnnotationAdjustment(m_lineTop) : computeUnderAnnotationAdjustment(m_lineTop);
- if (renderer().style()->isFlippedLinesWritingMode())
+ if (renderer().style().isFlippedLinesWritingMode())
return selectionTop;
LayoutUnit prevBottom = prevRootBox() ? prevRootBox()->selectionBottom() : blockFlow().borderAndPaddingBefore();
@@ -671,9 +671,9 @@
LayoutUnit selectionBottom = m_lineBottom;
if (m_hasAnnotationsAfter)
- selectionBottom += !renderer().style()->isFlippedLinesWritingMode() ? computeUnderAnnotationAdjustment(m_lineBottom) : computeOverAnnotationAdjustment(m_lineBottom);
+ selectionBottom += !renderer().style().isFlippedLinesWritingMode() ? computeUnderAnnotationAdjustment(m_lineBottom) : computeOverAnnotationAdjustment(m_lineBottom);
- if (!renderer().style()->isFlippedLinesWritingMode() || !nextRootBox())
+ if (!renderer().style().isFlippedLinesWritingMode() || !nextRootBox())
return selectionBottom;
LayoutUnit nextTop = nextRootBox()->selectionTop();
@@ -694,7 +694,7 @@
int RootInlineBox::blockDirectionPointInLine() const
{
- return !blockFlow().style()->isFlippedBlocksWritingMode() ? max(lineTop(), selectionTop()) : min(lineBottom(), selectionBottom());
+ return !blockFlow().style().isFlippedBlocksWritingMode() ? max(lineTop(), selectionTop()) : min(lineBottom(), selectionBottom());
}
RenderBlockFlow& RootInlineBox::blockFlow() const
@@ -950,16 +950,16 @@
}
LayoutUnit verticalPosition = 0;
- EVerticalAlign verticalAlign = renderer->style()->verticalAlign();
+ EVerticalAlign verticalAlign = renderer->style().verticalAlign();
if (verticalAlign == TOP || verticalAlign == BOTTOM)
return 0;
RenderElement* parent = renderer->parent();
- if (parent->isRenderInline() && parent->style()->verticalAlign() != TOP && parent->style()->verticalAlign() != BOTTOM)
+ if (parent->isRenderInline() && parent->style().verticalAlign() != TOP && parent->style().verticalAlign() != BOTTOM)
verticalPosition = box->parent()->logicalTop();
if (verticalAlign != BASELINE) {
- const RenderStyle& parentLineStyle = firstLine ? *parent->firstLineStyle() : *parent->style();
+ const RenderStyle& parentLineStyle = firstLine ? parent->firstLineStyle() : parent->style();
const Font& font = parentLineStyle.font();
const FontMetrics& fontMetrics = font.fontMetrics();
int fontSize = font.pixelSize();
@@ -984,11 +984,11 @@
else if (verticalAlign == LENGTH) {
LayoutUnit lineHeight;
//Per http://www.w3.org/TR/CSS21/visudet.html#propdef-vertical-align: 'Percentages: refer to the 'line-height' of the element itself'.
- if (renderer->style()->verticalAlignLength().isPercent())
- lineHeight = renderer->style()->computedLineHeight();
+ if (renderer->style().verticalAlignLength().isPercent())
+ lineHeight = renderer->style().computedLineHeight();
else
lineHeight = renderer->lineHeight(firstLine, lineDirection);
- verticalPosition -= valueForLength(renderer->style()->verticalAlignLength(), lineHeight, &renderer->view());
+ verticalPosition -= valueForLength(renderer->style().verticalAlignLength(), lineHeight, &renderer->view());
}
}
@@ -1004,7 +1004,7 @@
if (box->renderer().isReplaced() || (box->renderer().isTextOrLineBreak() && !box->behavesLikeText()))
return false;
- LineBoxContain lineBoxContain = renderer().style()->lineBoxContain();
+ LineBoxContain lineBoxContain = renderer().style().lineBoxContain();
return (lineBoxContain & LineBoxContainInline) || (box == this && (lineBoxContain & LineBoxContainBlock));
}
@@ -1017,7 +1017,7 @@
return false;
// For now map "glyphs" to "font" in vertical text mode until the bounds returned by glyphs aren't garbage.
- LineBoxContain lineBoxContain = renderer().style()->lineBoxContain();
+ LineBoxContain lineBoxContain = renderer().style().lineBoxContain();
return (lineBoxContain & LineBoxContainFont) || (!isHorizontal() && (lineBoxContain & LineBoxContainGlyphs));
}
@@ -1030,7 +1030,7 @@
return false;
// FIXME: We can't fit to glyphs yet for vertical text, since the bounds returned are garbage.
- LineBoxContain lineBoxContain = renderer().style()->lineBoxContain();
+ LineBoxContain lineBoxContain = renderer().style().lineBoxContain();
return isHorizontal() && (lineBoxContain & LineBoxContainGlyphs);
}
@@ -1039,7 +1039,7 @@
if (box->renderer().isReplaced() || (box->renderer().isTextOrLineBreak() && !box->behavesLikeText()))
return false;
- LineBoxContain lineBoxContain = renderer().style()->lineBoxContain();
+ LineBoxContain lineBoxContain = renderer().style().lineBoxContain();
return lineBoxContain & LineBoxContainInlineBox;
}
@@ -1047,13 +1047,13 @@
bool RootInlineBox::fitsToGlyphs() const
{
// FIXME: We can't fit to glyphs yet for vertical text, since the bounds returned are garbage.
- LineBoxContain lineBoxContain = renderer().style()->lineBoxContain();
+ LineBoxContain lineBoxContain = renderer().style().lineBoxContain();
return isHorizontal() && (lineBoxContain & LineBoxContainGlyphs);
}
bool RootInlineBox::includesRootLineBoxFontOrLeading() const
{
- LineBoxContain lineBoxContain = renderer().style()->lineBoxContain();
+ LineBoxContain lineBoxContain = renderer().style().lineBoxContain();
return (lineBoxContain & LineBoxContainBlock) || (lineBoxContain & LineBoxContainInline) || (lineBoxContain & LineBoxContainFont);
}
diff --git a/Source/WebCore/rendering/SimpleLineLayout.cpp b/Source/WebCore/rendering/SimpleLineLayout.cpp
index efa721d..f0ae2a6 100644
--- a/Source/WebCore/rendering/SimpleLineLayout.cpp
+++ b/Source/WebCore/rendering/SimpleLineLayout.cpp
@@ -87,7 +87,7 @@
if (flow.view().layoutState()->m_columnInfo)
return false;
}
- const RenderStyle& style = *flow.style();
+ const RenderStyle& style = flow.style();
if (style.textAlign() == JUSTIFY)
return false;
// Non-visible overflow should be pretty easy to support.
@@ -126,7 +126,7 @@
if (style.resolvedShapeInside())
return true;
#endif
- if (style.textOverflow() || (flow.isAnonymousBlock() && flow.parent()->style()->textOverflow()))
+ if (style.textOverflow() || (flow.isAnonymousBlock() && flow.parent()->style().textOverflow()))
return false;
if (style.hasPseudoStyle(FIRST_LINE) || style.hasPseudoStyle(FIRST_LETTER))
return false;
@@ -238,7 +238,7 @@
RenderText& textRenderer = toRenderText(*flow.firstChild());
ASSERT(!textRenderer.firstTextBox());
- const RenderStyle& style = *flow.style();
+ const RenderStyle& style = flow.style();
const unsigned textLength = textRenderer.textLength();
ETextAlign textAlign = style.textAlign();
diff --git a/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp b/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp
index 35d0b1b..4af1e70 100644
--- a/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp
+++ b/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp
@@ -52,7 +52,7 @@
RenderText& textRenderer = toRenderText(*flow.firstChild());
ASSERT(!textRenderer.firstTextBox());
- RenderStyle& style = *flow.style();
+ RenderStyle& style = flow.style();
const Font& font = style.font();
GraphicsContext& context = *paintInfo.context;
@@ -77,7 +77,7 @@
if (layout.runs.isEmpty())
return false;
- RenderStyle& style = *flow.style();
+ RenderStyle& style = flow.style();
if (style.visibility() != VISIBLE || style.pointerEvents() == PE_NONE)
return false;
diff --git a/Source/WebCore/rendering/SimpleLineLayoutResolver.h b/Source/WebCore/rendering/SimpleLineLayoutResolver.h
index c63ca16..fe8ec58 100644
--- a/Source/WebCore/rendering/SimpleLineLayoutResolver.h
+++ b/Source/WebCore/rendering/SimpleLineLayoutResolver.h
@@ -159,8 +159,8 @@
, m_string(toRenderText(*flow.firstChild()).text())
, m_lineHeight(lineHeightFromFlow(flow))
, m_baseline(baselineFromFlow(flow))
- , m_ascent(flow.style()->font().fontMetrics().ascent())
- , m_descent(flow.style()->font().fontMetrics().descent())
+ , m_ascent(flow.style().font().fontMetrics().ascent())
+ , m_descent(flow.style().font().fontMetrics().descent())
, m_contentOffset(flow.borderLeft() + flow.paddingLeft(), flow.borderTop() + flow.paddingTop())
{
}
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp b/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp
index 2582751..bfc9c38 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp
+++ b/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp
@@ -62,7 +62,7 @@
RenderMathMLBlock* RenderMathMLBlock::createAnonymousMathMLBlock(EDisplay display)
{
- RenderMathMLBlock* newBlock = new RenderMathMLBlock(document(), RenderStyle::createAnonymousStyleWithDisplay(style(), display));
+ RenderMathMLBlock* newBlock = new RenderMathMLBlock(document(), RenderStyle::createAnonymousStyleWithDisplay(&style(), display));
newBlock->initializeStyle();
return newBlock;
}
@@ -83,7 +83,7 @@
const char* RenderMathMLBlock::renderName() const
{
- EDisplay display = style()->display();
+ EDisplay display = style().display();
if (display == FLEX)
return isAnonymous() ? "RenderMathMLBlock (anonymous, flex)" : "RenderMathMLBlock (flex)";
if (display == INLINE_FLEX)
@@ -306,7 +306,7 @@
// In legal MathML, we'll have a MathML parent. That RenderFlexibleBox parent will use our firstLineBaseline() for baseline alignment, per
// http://dev.w3.org/csswg/css3-flexbox/#flex-baselines. We want to vertically center an <mtable>, such as a matrix. Essentially the whole <mtable> element fits on a
// single line, whose baseline gives this centering. This is different than RenderTable::firstLineBoxBaseline, which returns the baseline of the first row of a <table>.
- return (logicalHeight() + style()->fontMetrics().xHeight()) / 2;
+ return (logicalHeight() + style().fontMetrics().xHeight()) / 2;
}
}
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLFenced.cpp b/Source/WebCore/rendering/mathml/RenderMathMLFenced.cpp
index df6232a..b24edda 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLFenced.cpp
+++ b/Source/WebCore/rendering/mathml/RenderMathMLFenced.cpp
@@ -84,11 +84,11 @@
RenderMathMLOperator* RenderMathMLFenced::createMathMLOperator(UChar uChar, RenderMathMLOperator::OperatorType operatorType)
{
- auto newStyle = RenderStyle::createAnonymousStyleWithDisplay(style(), FLEX);
+ auto newStyle = RenderStyle::createAnonymousStyleWithDisplay(&style(), FLEX);
newStyle.get().setFlexDirection(FlowColumn);
- newStyle.get().setMarginEnd(Length((operatorType == RenderMathMLOperator::Fence ? gFenceMarginEms : gSeparatorMarginEndEms) * style()->fontSize(), Fixed));
+ newStyle.get().setMarginEnd(Length((operatorType == RenderMathMLOperator::Fence ? gFenceMarginEms : gSeparatorMarginEndEms) * style().fontSize(), Fixed));
if (operatorType == RenderMathMLOperator::Fence)
- newStyle.get().setMarginStart(Length(gFenceMarginEms * style()->fontSize(), Fixed));
+ newStyle.get().setMarginStart(Length(gFenceMarginEms * style().fontSize(), Fixed));
RenderMathMLOperator* newOperator = new RenderMathMLOperator(element(), std::move(newStyle), uChar);
newOperator->setOperatorType(operatorType);
newOperator->initializeStyle();
@@ -160,14 +160,14 @@
for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
if (child->node() == &element()) {
- ASSERT(child->style()->refCount() == 1);
- child->style()->inheritFrom(style());
+ ASSERT(child->style().refCount() == 1);
+ child->style().inheritFrom(&style());
bool isFence = child == firstChild() || child == lastChild();
- child->style()->setMarginEnd(Length((isFence ? gFenceMarginEms : gSeparatorMarginEndEms) * style()->fontSize(), Fixed));
+ child->style().setMarginEnd(Length((isFence ? gFenceMarginEms : gSeparatorMarginEndEms) * style().fontSize(), Fixed));
if (isFence) {
RenderMathMLBlock* block = toRenderMathMLBlock(child);
toRenderMathMLOperator(block)->updateFromElement();
- child->style()->setMarginStart(Length(gFenceMarginEms * style()->fontSize(), Fixed));
+ child->style().setMarginStart(Length(gFenceMarginEms * style().fontSize(), Fixed));
}
}
}
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp b/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp
index dacde1f..c2e088c 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp
+++ b/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp
@@ -51,8 +51,8 @@
void RenderMathMLFraction::fixChildStyle(RenderObject* child)
{
- ASSERT(child->isAnonymous() && child->style()->refCount() == 1);
- child->style()->setFlexDirection(FlowColumn);
+ ASSERT(child->isAnonymous() && child->style().refCount() == 1);
+ child->style().setFlexDirection(FlowColumn);
}
// FIXME: It's cleaner to only call updateFromElement when an attribute has changed. Move parts
@@ -80,11 +80,11 @@
// This function parses the thickness attribute using gLineMedium as
// the default value. If the parsing fails, m_lineThickness will not be
// modified i.e. the default value will be used.
- parseMathMLLength(thickness, m_lineThickness, style(), false);
+ parseMathMLLength(thickness, m_lineThickness, &style(), false);
}
// Update the style for the padding of the denominator for the line thickness
- lastChild()->style()->setPaddingTop(Length(static_cast<int>(m_lineThickness), Fixed));
+ lastChild()->style().setPaddingTop(Length(static_cast<int>(m_lineThickness), Fixed));
}
void RenderMathMLFraction::addChild(RenderObject* child, RenderObject* /* beforeChild */)
@@ -133,7 +133,7 @@
// Adjust the fraction line thickness for the zoom
if (lastChild() && lastChild()->isRenderBlock())
- m_lineThickness *= ceilf(gFractionBarWidth * style()->fontSize());
+ m_lineThickness *= ceilf(gFractionBarWidth * style().fontSize());
RenderMathMLBlock::layout();
}
@@ -141,7 +141,7 @@
void RenderMathMLFraction::paint(PaintInfo& info, const LayoutPoint& paintOffset)
{
RenderMathMLBlock::paint(info, paintOffset);
- if (info.context->paintingDisabled() || info.phase != PaintPhaseForeground || style()->visibility() != VISIBLE)
+ if (info.context->paintingDisabled() || info.phase != PaintPhaseForeground || style().visibility() != VISIBLE)
return;
RenderBox* denominatorWrapper = lastChildBox();
@@ -154,7 +154,7 @@
info.context->setStrokeThickness(m_lineThickness);
info.context->setStrokeStyle(SolidStroke);
- info.context->setStrokeColor(style()->visitedDependentColor(CSSPropertyColor), ColorSpaceSRGB);
+ info.context->setStrokeColor(style().visitedDependentColor(CSSPropertyColor), ColorSpaceSRGB);
info.context->drawLine(adjustedPaintOffset, IntPoint(adjustedPaintOffset.x() + denominatorWrapper->pixelSnappedOffsetWidth(), adjustedPaintOffset.y()));
}
@@ -162,7 +162,7 @@
int RenderMathMLFraction::firstLineBaseline() const
{
if (RenderBox* denominatorWrapper = lastChildBox())
- return denominatorWrapper->logicalTop() + static_cast<int>(lroundf((m_lineThickness + style()->fontMetrics().xHeight()) / 2));
+ return denominatorWrapper->logicalTop() + static_cast<int>(lroundf((m_lineThickness + style().fontMetrics().xHeight()) / 2));
return RenderMathMLBlock::firstLineBaseline();
}
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp b/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp
index d894f1f..515a9c5 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp
+++ b/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp
@@ -109,7 +109,7 @@
FloatRect RenderMathMLOperator::glyphBoundsForCharacter(UChar character)
{
- GlyphData data = style()->font().glyphDataForCharacter(character, false);
+ GlyphData data = style().font().glyphDataForCharacter(character, false);
return data.fontData->boundsForGlyph(data.glyph);
}
@@ -121,7 +121,7 @@
float RenderMathMLOperator::advanceForCharacter(UChar character)
{
// Hyphen minus is always replaced by the minus sign in rendered text.
- GlyphData data = style()->font().glyphDataForCharacter(convertHyphenMinusToMinusSign(character), false);
+ GlyphData data = style().font().glyphDataForCharacter(convertHyphenMinusToMinusSign(character), false);
return data.fontData->widthForGlyph(data.glyph);
}
@@ -173,7 +173,7 @@
element().setRenderer(savedRenderer);
auto newStyle = RenderStyle::create();
- newStyle.get().inheritFrom(style());
+ newStyle.get().inheritFrom(&style());
newStyle.get().setDisplay(FLEX);
RenderMathMLBlock* container = new RenderMathMLBlock(element(), std::move(newStyle));
@@ -256,7 +256,7 @@
UChar stretchedCharacter;
bool allowStretching = shouldAllowStretching(stretchedCharacter);
- float stretchedCharacterHeight = style()->fontMetrics().floatHeight();
+ float stretchedCharacterHeight = style().fontMetrics().floatHeight();
m_isStretched = allowStretching && expandedStretchHeight() > stretchedCharacterHeight;
// Sometimes we cannot stretch an operator properly, so in that case, we should just use the original size.
@@ -281,7 +281,7 @@
LayoutRect RenderMathMLOperator::paintCharacter(PaintInfo& info, UChar character, const LayoutPoint& origin, CharacterPaintTrimming trim)
{
- GlyphData data = style()->font().glyphDataForCharacter(character, false);
+ GlyphData data = style().font().glyphDataForCharacter(character, false);
FloatRect glyphBounds = data.fontData->boundsForGlyph(data.glyph);
LayoutRect glyphPaintRect(origin, LayoutSize(glyphBounds.x() + glyphBounds.width(), glyphBounds.height()));
@@ -313,7 +313,7 @@
GraphicsContextStateSaver stateSaver(*info.context);
info.context->clip(clipBounds);
- info.context->drawText(style()->font(), TextRun(&character, 1), origin);
+ info.context->drawText(style().font(), TextRun(&character, 1), origin);
return glyphPaintRect;
}
@@ -364,7 +364,7 @@
}
GraphicsContextStateSaver stateSaver(*info.context);
- info.context->setFillColor(style()->visitedDependentColor(CSSPropertyColor), style()->colorSpace());
+ info.context->setFillColor(style().visitedDependentColor(CSSPropertyColor), style().colorSpace());
ASSERT(m_stretchyCharacter->topGlyph);
ASSERT(m_stretchyCharacter->bottomGlyph);
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp b/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp
index c86d483b..54c7baa 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp
+++ b/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp
@@ -78,14 +78,14 @@
LayoutUnit RenderMathMLRoot::paddingTop() const
{
LayoutUnit result = computedCSSPaddingTop();
- switch (style()->writingMode()) {
+ switch (style().writingMode()) {
case TopToBottomWritingMode:
return result + m_intrinsicPaddingBefore;
case BottomToTopWritingMode:
return result + m_intrinsicPaddingAfter;
case LeftToRightWritingMode:
case RightToLeftWritingMode:
- return result + (style()->isLeftToRightDirection() ? m_intrinsicPaddingStart : m_intrinsicPaddingEnd);
+ return result + (style().isLeftToRightDirection() ? m_intrinsicPaddingStart : m_intrinsicPaddingEnd);
}
ASSERT_NOT_REACHED();
return result;
@@ -94,14 +94,14 @@
LayoutUnit RenderMathMLRoot::paddingBottom() const
{
LayoutUnit result = computedCSSPaddingBottom();
- switch (style()->writingMode()) {
+ switch (style().writingMode()) {
case TopToBottomWritingMode:
return result + m_intrinsicPaddingAfter;
case BottomToTopWritingMode:
return result + m_intrinsicPaddingBefore;
case LeftToRightWritingMode:
case RightToLeftWritingMode:
- return result + (style()->isLeftToRightDirection() ? m_intrinsicPaddingEnd : m_intrinsicPaddingStart);
+ return result + (style().isLeftToRightDirection() ? m_intrinsicPaddingEnd : m_intrinsicPaddingStart);
}
ASSERT_NOT_REACHED();
return result;
@@ -110,14 +110,14 @@
LayoutUnit RenderMathMLRoot::paddingLeft() const
{
LayoutUnit result = computedCSSPaddingLeft();
- switch (style()->writingMode()) {
+ switch (style().writingMode()) {
case LeftToRightWritingMode:
return result + m_intrinsicPaddingBefore;
case RightToLeftWritingMode:
return result + m_intrinsicPaddingAfter;
case TopToBottomWritingMode:
case BottomToTopWritingMode:
- return result + (style()->isLeftToRightDirection() ? m_intrinsicPaddingStart : m_intrinsicPaddingEnd);
+ return result + (style().isLeftToRightDirection() ? m_intrinsicPaddingStart : m_intrinsicPaddingEnd);
}
ASSERT_NOT_REACHED();
return result;
@@ -126,14 +126,14 @@
LayoutUnit RenderMathMLRoot::paddingRight() const
{
LayoutUnit result = computedCSSPaddingRight();
- switch (style()->writingMode()) {
+ switch (style().writingMode()) {
case RightToLeftWritingMode:
return result + m_intrinsicPaddingBefore;
case LeftToRightWritingMode:
return result + m_intrinsicPaddingAfter;
case TopToBottomWritingMode:
case BottomToTopWritingMode:
- return result + (style()->isLeftToRightDirection() ? m_intrinsicPaddingEnd : m_intrinsicPaddingStart);
+ return result + (style().isLeftToRightDirection() ? m_intrinsicPaddingEnd : m_intrinsicPaddingStart);
}
ASSERT_NOT_REACHED();
return result;
@@ -167,7 +167,7 @@
RenderMathMLBlock::addChild(RenderMathMLRow::createAnonymousWithParentRenderer(this));
// An <mroot>'s index has { position: absolute }.
- if (newChild->style()->position() == AbsolutePosition)
+ if (newChild->style().position() == AbsolutePosition)
RenderMathMLBlock::addChild(newChild);
else
toRenderElement(firstChild())->addChild(newChild, beforeChild && beforeChild->parent() == firstChild() ? beforeChild : 0);
@@ -191,21 +191,21 @@
toRenderBox(child)->layoutIfNeeded();
}
- int baseHeight = firstChild() && firstChild()->isBox() ? roundToInt(toRenderBox(firstChild())->logicalHeight()) : style()->fontSize();
- int frontWidth = lroundf(gFrontWidthEms * style()->fontSize());
+ int baseHeight = firstChild() && firstChild()->isBox() ? roundToInt(toRenderBox(firstChild())->logicalHeight()) : style().fontSize();
+ int frontWidth = lroundf(gFrontWidthEms * style().fontSize());
// Base height above which the shape of the root changes
- float thresholdHeight = gThresholdBaseHeightEms * style()->fontSize();
+ float thresholdHeight = gThresholdBaseHeightEms * style().fontSize();
if (baseHeight > thresholdHeight && thresholdHeight) {
float shift = min<float>((baseHeight - thresholdHeight) / thresholdHeight, 1.0f);
m_overbarLeftPointShift = static_cast<int>(shift * gRadicalBottomPointXFront * frontWidth);
- m_intrinsicPaddingAfter = lroundf(gBigRootBottomPaddingEms * style()->fontSize());
+ m_intrinsicPaddingAfter = lroundf(gBigRootBottomPaddingEms * style().fontSize());
} else {
m_overbarLeftPointShift = 0;
m_intrinsicPaddingAfter = 0;
}
- int rootPad = lroundf(gSpaceAboveEms * style()->fontSize());
+ int rootPad = lroundf(gSpaceAboveEms * style().fontSize());
m_intrinsicPaddingBefore = rootPad;
m_indexTop = 0;
if (RenderBox* index = this->index()) {
@@ -237,17 +237,17 @@
{
RenderMathMLBlock::paint(info, paintOffset);
- if (info.context->paintingDisabled() || style()->visibility() != VISIBLE)
+ if (info.context->paintingDisabled() || style().visibility() != VISIBLE)
return;
IntPoint adjustedPaintOffset = roundedIntPoint(paintOffset + location() + contentBoxRect().location());
int startX = adjustedPaintOffset.x();
- int frontWidth = lroundf(gFrontWidthEms * style()->fontSize());
+ int frontWidth = lroundf(gFrontWidthEms * style().fontSize());
int overbarWidth = roundToInt(contentLogicalWidth()) + m_overbarLeftPointShift;
int baseHeight = roundToInt(contentLogicalHeight());
- int rootPad = lroundf(gSpaceAboveEms * style()->fontSize());
+ int rootPad = lroundf(gSpaceAboveEms * style().fontSize());
adjustedPaintOffset.setY(adjustedPaintOffset.y() - rootPad);
float radicalDipLeftPointYPos = (index() ? gRootRadicalDipLeftPointYPos : gSqrtRadicalDipLeftPointYPos) * baseHeight;
@@ -255,15 +255,15 @@
FloatPoint overbarLeftPoint(startX - m_overbarLeftPointShift, adjustedPaintOffset.y());
FloatPoint bottomPoint(startX - gRadicalBottomPointXFront * frontWidth, adjustedPaintOffset.y() + baseHeight + gRadicalBottomPointLower);
FloatPoint dipLeftPoint(startX - gRadicalDipLeftPointXFront * frontWidth, adjustedPaintOffset.y() + radicalDipLeftPointYPos);
- FloatPoint leftEnd(startX - frontWidth, dipLeftPoint.y() + gRadicalLeftEndYShiftEms * style()->fontSize());
+ FloatPoint leftEnd(startX - frontWidth, dipLeftPoint.y() + gRadicalLeftEndYShiftEms * style().fontSize());
GraphicsContextStateSaver stateSaver(*info.context);
- info.context->setStrokeThickness(gRadicalLineThicknessEms * style()->fontSize());
+ info.context->setStrokeThickness(gRadicalLineThicknessEms * style().fontSize());
info.context->setStrokeStyle(SolidStroke);
- info.context->setStrokeColor(style()->visitedDependentColor(CSSPropertyColor), ColorSpaceDeviceRGB);
+ info.context->setStrokeColor(style().visitedDependentColor(CSSPropertyColor), ColorSpaceDeviceRGB);
info.context->setLineJoin(MiterJoin);
- info.context->setMiterLimit(style()->fontSize());
+ info.context->setMiterLimit(style().fontSize());
Path root;
@@ -292,7 +292,7 @@
info.context->clip(mask);
// Draw the thick part of the root.
- info.context->setStrokeThickness(gRadicalThickLineThicknessEms * style()->fontSize());
+ info.context->setStrokeThickness(gRadicalThickLineThicknessEms * style().fontSize());
info.context->setLineCap(SquareCap);
Path line;
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLRow.cpp b/Source/WebCore/rendering/mathml/RenderMathMLRow.cpp
index 5e17b87..175f9e3 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLRow.cpp
+++ b/Source/WebCore/rendering/mathml/RenderMathMLRow.cpp
@@ -49,7 +49,7 @@
// FIXME: Change all these createAnonymous... routines to return a PassOwnPtr<>.
RenderMathMLRow* RenderMathMLRow::createAnonymousWithParentRenderer(const RenderObject* parent)
{
- RenderMathMLRow* newMRow = new RenderMathMLRow(parent->document(), RenderStyle::createAnonymousStyleWithDisplay(parent->style(), FLEX));
+ RenderMathMLRow* newMRow = new RenderMathMLRow(parent->document(), RenderStyle::createAnonymousStyleWithDisplay(&parent->style(), FLEX));
newMRow->initializeStyle();
return newMRow;
}
@@ -67,7 +67,7 @@
stretchLogicalHeight = std::max<int>(stretchLogicalHeight, roundToInt(toRenderBox(child)->logicalHeight()));
}
if (!stretchLogicalHeight)
- stretchLogicalHeight = style()->fontSize();
+ stretchLogicalHeight = style().fontSize();
// Set the sizes of (possibly embellished) stretchy operator children.
for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp b/Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp
index 5e8d967..65b2e27 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp
+++ b/Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp
@@ -85,37 +85,37 @@
void RenderMathMLScripts::fixAnonymousStyleForSubSupPair(RenderObject* subSupPair, bool isPostScript)
{
- ASSERT(subSupPair && subSupPair->style()->refCount() == 1);
- RenderStyle* scriptsStyle = subSupPair->style();
+ ASSERT(subSupPair && subSupPair->style().refCount() == 1);
+ RenderStyle& scriptsStyle = subSupPair->style();
// subSup pairs are drawn in column from bottom (subscript) to top (superscript).
- scriptsStyle->setFlexDirection(FlowColumnReverse);
+ scriptsStyle.setFlexDirection(FlowColumnReverse);
// The MathML specification does not specify horizontal alignment of
// scripts. We align the bottom (respectively top) edge of the subscript
// (respectively superscript) with the bottom (respectively top) edge of
// the flex container. Note that for valid <msub> and <msup> elements, the
// subSupPair should actually have only one script.
- scriptsStyle->setJustifyContent(m_kind == Sub ? JustifyFlexStart : m_kind == Super ? JustifyFlexEnd : JustifySpaceBetween);
+ scriptsStyle.setJustifyContent(m_kind == Sub ? JustifyFlexStart : m_kind == Super ? JustifyFlexEnd : JustifySpaceBetween);
// The MathML specification does not specify vertical alignment of scripts.
// Let's right align prescripts and left align postscripts.
// See http://lists.w3.org/Archives/Public/www-math/2012Aug/0006.html
- scriptsStyle->setAlignItems(isPostScript ? AlignFlexStart : AlignFlexEnd);
+ scriptsStyle.setAlignItems(isPostScript ? AlignFlexStart : AlignFlexEnd);
// We set the order property so that the prescripts are drawn before the base.
- scriptsStyle->setOrder(isPostScript ? 0 : -1);
+ scriptsStyle.setOrder(isPostScript ? 0 : -1);
// We set this wrapper's font-size for its line-height.
- LayoutUnit scriptSize = static_cast<int>(0.75 * style()->fontSize());
- scriptsStyle->setFontSize(scriptSize);
+ LayoutUnit scriptSize = static_cast<int>(0.75 * style().fontSize());
+ scriptsStyle.setFontSize(scriptSize);
}
void RenderMathMLScripts::fixAnonymousStyles()
{
// We set the base wrapper's style so that baseHeight in layout() will be an unstretched height.
- ASSERT(m_baseWrapper && m_baseWrapper->style()->hasOneRef());
- m_baseWrapper->style()->setAlignSelf(AlignFlexStart);
+ ASSERT(m_baseWrapper && m_baseWrapper->style().hasOneRef());
+ m_baseWrapper->style().setAlignSelf(AlignFlexStart);
// This sets the style for postscript pairs.
RenderObject* subSupPair = m_baseWrapper;
@@ -131,13 +131,13 @@
// This resets style for extra subSup pairs.
for (; subSupPair; subSupPair = subSupPair->nextSibling()) {
if (!isPrescript(subSupPair)) {
- ASSERT(subSupPair && subSupPair->style()->refCount() == 1);
- RenderStyle* scriptsStyle = subSupPair->style();
- scriptsStyle->setFlexDirection(FlowRow);
- scriptsStyle->setJustifyContent(JustifyFlexStart);
- scriptsStyle->setAlignItems(AlignCenter);
- scriptsStyle->setOrder(0);
- scriptsStyle->setFontSize(style()->fontSize());
+ ASSERT(subSupPair && subSupPair->style().refCount() == 1);
+ RenderStyle& scriptsStyle = subSupPair->style();
+ scriptsStyle.setFlexDirection(FlowRow);
+ scriptsStyle.setJustifyContent(JustifyFlexStart);
+ scriptsStyle.setAlignItems(AlignCenter);
+ scriptsStyle.setOrder(0);
+ scriptsStyle.setFontSize(style().fontSize());
}
}
}
@@ -282,10 +282,10 @@
LayoutUnit baseBaseline = base->firstLineBaseline();
if (baseBaseline == -1)
baseBaseline = baseHeight;
- LayoutUnit axis = style()->fontMetrics().xHeight() / 2;
- int fontSize = style()->fontSize();
+ LayoutUnit axis = style().fontMetrics().xHeight() / 2;
+ int fontSize = style().fontSize();
- ASSERT(m_baseWrapper->style()->hasOneRef());
+ ASSERT(m_baseWrapper->style().hasOneRef());
bool needsSecondLayout = false;
LayoutUnit topPadding = 0;
@@ -295,9 +295,9 @@
LayoutUnit superscriptShiftValue = 0;
LayoutUnit subscriptShiftValue = 0;
if (m_kind == Sub || m_kind == SubSup || m_kind == Multiscripts)
- parseMathMLLength(scriptElement->fastGetAttribute(MathMLNames::subscriptshiftAttr), subscriptShiftValue, style(), false);
+ parseMathMLLength(scriptElement->fastGetAttribute(MathMLNames::subscriptshiftAttr), subscriptShiftValue, &style(), false);
if (m_kind == Super || m_kind == SubSup || m_kind == Multiscripts)
- parseMathMLLength(scriptElement->fastGetAttribute(MathMLNames::superscriptshiftAttr), superscriptShiftValue, style(), false);
+ parseMathMLLength(scriptElement->fastGetAttribute(MathMLNames::superscriptshiftAttr), superscriptShiftValue, &style(), false);
bool isPostScript = true;
RenderMathMLBlock* subSupPair = toRenderMathMLBlock(m_baseWrapper->nextSibling());
@@ -335,14 +335,14 @@
}
Length newPadding(topPadding, Fixed);
- if (newPadding != m_baseWrapper->style()->paddingTop()) {
- m_baseWrapper->style()->setPaddingTop(newPadding);
+ if (newPadding != m_baseWrapper->style().paddingTop()) {
+ m_baseWrapper->style().setPaddingTop(newPadding);
needsSecondLayout = true;
}
newPadding = Length(bottomPadding, Fixed);
- if (newPadding != m_baseWrapper->style()->paddingBottom()) {
- m_baseWrapper->style()->setPaddingBottom(newPadding);
+ if (newPadding != m_baseWrapper->style().paddingBottom()) {
+ m_baseWrapper->style().setPaddingBottom(newPadding);
needsSecondLayout = true;
}
@@ -367,7 +367,7 @@
RenderMathMLScriptsWrapper* RenderMathMLScriptsWrapper::createAnonymousWrapper(RenderMathMLScripts* renderObject, WrapperType type)
{
- RenderMathMLScriptsWrapper* newBlock = new RenderMathMLScriptsWrapper(renderObject->document(), RenderStyle::createAnonymousStyleWithDisplay(renderObject->style(), FLEX), type);
+ RenderMathMLScriptsWrapper* newBlock = new RenderMathMLScriptsWrapper(renderObject->document(), RenderStyle::createAnonymousStyleWithDisplay(&renderObject->style(), FLEX), type);
newBlock->initializeStyle();
return newBlock;
}
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLSpace.cpp b/Source/WebCore/rendering/mathml/RenderMathMLSpace.cpp
index cb1db98..288e662 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLSpace.cpp
+++ b/Source/WebCore/rendering/mathml/RenderMathMLSpace.cpp
@@ -58,9 +58,9 @@
m_width = 0;
m_height = 0;
m_depth = 0;
- parseMathMLLength(spaceElement.getAttribute(MathMLNames::widthAttr), m_width, style());
- parseMathMLLength(spaceElement.getAttribute(MathMLNames::heightAttr), m_height, style());
- parseMathMLLength(spaceElement.getAttribute(MathMLNames::depthAttr), m_depth, style());
+ parseMathMLLength(spaceElement.getAttribute(MathMLNames::widthAttr), m_width, &style());
+ parseMathMLLength(spaceElement.getAttribute(MathMLNames::heightAttr), m_height, &style());
+ parseMathMLLength(spaceElement.getAttribute(MathMLNames::depthAttr), m_depth, &style());
// FIXME: Negative width values should be accepted.
if (m_width < 0)
diff --git a/Source/WebCore/rendering/shapes/ShapeInfo.cpp b/Source/WebCore/rendering/shapes/ShapeInfo.cpp
index 92b897b..8ca00db 100644
--- a/Source/WebCore/rendering/shapes/ShapeInfo.cpp
+++ b/Source/WebCore/rendering/shapes/ShapeInfo.cpp
@@ -59,10 +59,10 @@
if (Shape* shape = m_shape.get())
return shape;
- WritingMode writingMode = m_renderer->style()->writingMode();
- Length margin = m_renderer->style()->shapeMargin();
- Length padding = m_renderer->style()->shapePadding();
- float shapeImageThreshold = m_renderer->style()->shapeImageThreshold();
+ WritingMode writingMode = m_renderer->style().writingMode();
+ Length margin = m_renderer->style().shapeMargin();
+ Length padding = m_renderer->style().shapePadding();
+ float shapeImageThreshold = m_renderer->style().shapeImageThreshold();
const ShapeValue* shapeValue = this->shapeValue();
ASSERT(shapeValue);
diff --git a/Source/WebCore/rendering/shapes/ShapeInfo.h b/Source/WebCore/rendering/shapes/ShapeInfo.h
index 4a6c1e9..979daf4 100644
--- a/Source/WebCore/rendering/shapes/ShapeInfo.h
+++ b/Source/WebCore/rendering/shapes/ShapeInfo.h
@@ -74,7 +74,7 @@
{
LayoutSize newLogicalSize(logicalWidth, logicalHeight);
- if (m_renderer->style()->boxSizing() == CONTENT_BOX)
+ if (m_renderer->style().boxSizing() == CONTENT_BOX)
newLogicalSize -= LayoutSize(m_renderer->borderAndPaddingLogicalWidth(), m_renderer->borderAndPaddingLogicalHeight());
if (m_shapeLogicalSize == newLogicalSize)
@@ -96,7 +96,7 @@
LayoutUnit logicalLineBottom() const { return m_shapeLineTop + m_lineHeight + logicalTopOffset(); }
LayoutUnit logicalLineBottom(LayoutUnit lineHeight) const { return m_shapeLineTop + lineHeight + logicalTopOffset(); }
- LayoutUnit shapeContainingBlockLogicalHeight() const { return (m_renderer->style()->boxSizing() == CONTENT_BOX) ? (m_shapeLogicalSize.height() + m_renderer->borderAndPaddingLogicalHeight()) : m_shapeLogicalSize.height(); }
+ LayoutUnit shapeContainingBlockLogicalHeight() const { return (m_renderer->style().boxSizing() == CONTENT_BOX) ? (m_shapeLogicalSize.height() + m_renderer->borderAndPaddingLogicalHeight()) : m_shapeLogicalSize.height(); }
virtual bool lineOverlapsShapeBounds() const = 0;
@@ -114,8 +114,8 @@
virtual ShapeValue* shapeValue() const = 0;
virtual void getIntervals(LayoutUnit, LayoutUnit, SegmentList&) const = 0;
- LayoutUnit logicalTopOffset() const { return m_renderer->style()->boxSizing() == CONTENT_BOX ? m_renderer->borderAndPaddingBefore() : LayoutUnit(); };
- LayoutUnit logicalLeftOffset() const { return (m_renderer->style()->boxSizing() == CONTENT_BOX && !m_renderer->isRenderRegion()) ? m_renderer->borderAndPaddingStart() : LayoutUnit(); }
+ LayoutUnit logicalTopOffset() const { return m_renderer->style().boxSizing() == CONTENT_BOX ? m_renderer->borderAndPaddingBefore() : LayoutUnit(); };
+ LayoutUnit logicalLeftOffset() const { return (m_renderer->style().boxSizing() == CONTENT_BOX && !m_renderer->isRenderRegion()) ? m_renderer->borderAndPaddingStart() : LayoutUnit(); }
LayoutUnit m_shapeLineTop;
LayoutUnit m_lineHeight;
diff --git a/Source/WebCore/rendering/shapes/ShapeInsideInfo.cpp b/Source/WebCore/rendering/shapes/ShapeInsideInfo.cpp
index 11e7ff2..1745947 100644
--- a/Source/WebCore/rendering/shapes/ShapeInsideInfo.cpp
+++ b/Source/WebCore/rendering/shapes/ShapeInsideInfo.cpp
@@ -45,7 +45,7 @@
bool ShapeInsideInfo::isEnabledFor(const RenderBlock* renderer)
{
- ShapeValue* shapeValue = renderer->style()->resolvedShapeInside();
+ ShapeValue* shapeValue = renderer->style().resolvedShapeInside();
if (!shapeValue)
return false;
@@ -103,7 +103,7 @@
ShapeValue* ShapeInsideInfo::shapeValue() const
{
- return m_renderer->style()->resolvedShapeInside();
+ return m_renderer->style().resolvedShapeInside();
}
LayoutUnit ShapeInsideInfo::computeFirstFitPositionForFloat(const LayoutSize floatSize) const
diff --git a/Source/WebCore/rendering/shapes/ShapeOutsideInfo.cpp b/Source/WebCore/rendering/shapes/ShapeOutsideInfo.cpp
index 0463e9a..7f0b400 100644
--- a/Source/WebCore/rendering/shapes/ShapeOutsideInfo.cpp
+++ b/Source/WebCore/rendering/shapes/ShapeOutsideInfo.cpp
@@ -40,7 +40,7 @@
namespace WebCore {
bool ShapeOutsideInfo::isEnabledFor(const RenderBox* box)
{
- ShapeValue* shapeValue = box->style()->shapeOutside();
+ ShapeValue* shapeValue = box->style().shapeOutside();
if (!box->isFloating() || !shapeValue)
return false;
@@ -92,7 +92,7 @@
ShapeValue* ShapeOutsideInfo::shapeValue() const
{
- return m_renderer->style()->shapeOutside();
+ return m_renderer->style().shapeOutside();
}
}
diff --git a/Source/WebCore/rendering/svg/RenderSVGBlock.cpp b/Source/WebCore/rendering/svg/RenderSVGBlock.cpp
index f1c150a..856b640 100644
--- a/Source/WebCore/rendering/svg/RenderSVGBlock.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGBlock.cpp
@@ -40,7 +40,7 @@
{
LayoutRect borderRect = borderBoxRect();
- if (const ShadowData* textShadow = style()->textShadow())
+ if (const ShadowData* textShadow = style().textShadow())
textShadow->adjustRectForShadow(borderRect);
return borderRect;
@@ -99,7 +99,7 @@
if (diff == StyleDifferenceLayout)
setNeedsBoundariesUpdate();
RenderBlockFlow::styleDidChange(diff, oldStyle);
- SVGResourcesCache::clientStyleChanged(*this, diff, *style());
+ SVGResourcesCache::clientStyleChanged(*this, diff, style());
}
}
diff --git a/Source/WebCore/rendering/svg/RenderSVGContainer.cpp b/Source/WebCore/rendering/svg/RenderSVGContainer.cpp
index 9ac22b3..23aa59b 100644
--- a/Source/WebCore/rendering/svg/RenderSVGContainer.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGContainer.cpp
@@ -92,7 +92,7 @@
void RenderSVGContainer::addChild(RenderObject* child, RenderObject* beforeChild)
{
RenderSVGModelObject::addChild(child, beforeChild);
- SVGResourcesCache::clientWasAddedToTree(child, child->style());
+ SVGResourcesCache::clientWasAddedToTree(child, &child->style());
}
void RenderSVGContainer::removeChild(RenderObject& child)
@@ -152,7 +152,7 @@
// outline rect into parent coords before drawing.
// FIXME: This means our focus ring won't share our rotation like it should.
// We should instead disable our clip during PaintPhaseOutline
- if ((paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSelfOutline) && style()->outlineWidth() && style()->visibility() == VISIBLE) {
+ if ((paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSelfOutline) && style().outlineWidth() && style().visibility() == VISIBLE) {
IntRect paintRectInParent = enclosingIntRect(localToParentTransform().mapRect(repaintRect));
paintOutline(paintInfo, paintRectInParent);
}
diff --git a/Source/WebCore/rendering/svg/RenderSVGEllipse.cpp b/Source/WebCore/rendering/svg/RenderSVGEllipse.cpp
index 7bdbe92..39813cc 100644
--- a/Source/WebCore/rendering/svg/RenderSVGEllipse.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGEllipse.cpp
@@ -71,7 +71,7 @@
m_fillBoundingBox = FloatRect(m_center.x() - m_radii.width(), m_center.y() - m_radii.height(), 2 * m_radii.width(), 2 * m_radii.height());
m_strokeBoundingBox = m_fillBoundingBox;
- if (style()->svgStyle()->hasStroke())
+ if (style().svgStyle()->hasStroke())
m_strokeBoundingBox.inflate(strokeWidth() / 2);
}
@@ -105,7 +105,7 @@
void RenderSVGEllipse::strokeShape(GraphicsContext* context) const
{
- if (!style()->svgStyle()->hasVisibleStroke())
+ if (!style().svgStyle()->hasVisibleStroke())
return;
if (m_usePathFallback) {
RenderSVGShape::strokeShape(context);
diff --git a/Source/WebCore/rendering/svg/RenderSVGImage.cpp b/Source/WebCore/rendering/svg/RenderSVGImage.cpp
index 9b850a2..f2e8cc7 100644
--- a/Source/WebCore/rendering/svg/RenderSVGImage.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGImage.cpp
@@ -120,7 +120,7 @@
void RenderSVGImage::paint(PaintInfo& paintInfo, const LayoutPoint&)
{
- if (paintInfo.context->paintingDisabled() || style()->visibility() == HIDDEN || !m_imageResource->hasImage())
+ if (paintInfo.context->paintingDisabled() || style().visibility() == HIDDEN || !m_imageResource->hasImage())
return;
FloatRect boundingBox = repaintRectInLocalCoordinates();
@@ -128,7 +128,7 @@
return;
PaintInfo childPaintInfo(paintInfo);
- bool drawsOutline = style()->outlineWidth() && (childPaintInfo.phase == PaintPhaseOutline || childPaintInfo.phase == PaintPhaseSelfOutline);
+ bool drawsOutline = style().outlineWidth() && (childPaintInfo.phase == PaintPhaseOutline || childPaintInfo.phase == PaintPhaseSelfOutline);
if (drawsOutline || childPaintInfo.phase == PaintPhaseForeground) {
GraphicsContextStateSaver stateSaver(*childPaintInfo.context);
childPaintInfo.applyTransform(m_localTransform);
@@ -137,7 +137,7 @@
SVGRenderingContext renderingContext(*this, childPaintInfo);
if (renderingContext.isRenderingPrepared()) {
- if (style()->svgStyle()->bufferedRendering() == BR_STATIC && renderingContext.bufferForeground(m_bufferedForeground))
+ if (style().svgStyle()->bufferedRendering() == BR_STATIC && renderingContext.bufferForeground(m_bufferedForeground))
return;
paintForeground(childPaintInfo);
@@ -171,8 +171,8 @@
if (hitTestAction != HitTestForeground)
return false;
- PointerEventsHitRules hitRules(PointerEventsHitRules::SVG_IMAGE_HITTESTING, request, style()->pointerEvents());
- bool isVisible = (style()->visibility() == VISIBLE);
+ PointerEventsHitRules hitRules(PointerEventsHitRules::SVG_IMAGE_HITTESTING, request, style().pointerEvents());
+ bool isVisible = (style().visibility() == VISIBLE);
if (isVisible || !hitRules.requireVisible) {
FloatPoint localPoint = localToParentTransform().inverse().mapPoint(pointInParent);
diff --git a/Source/WebCore/rendering/svg/RenderSVGInline.cpp b/Source/WebCore/rendering/svg/RenderSVGInline.cpp
index ee2ef2d..714b6f5 100644
--- a/Source/WebCore/rendering/svg/RenderSVGInline.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGInline.cpp
@@ -111,13 +111,13 @@
if (diff == StyleDifferenceLayout)
setNeedsBoundariesUpdate();
RenderInline::styleDidChange(diff, oldStyle);
- SVGResourcesCache::clientStyleChanged(*this, diff, *style());
+ SVGResourcesCache::clientStyleChanged(*this, diff, style());
}
void RenderSVGInline::addChild(RenderObject* child, RenderObject* beforeChild)
{
RenderInline::addChild(child, beforeChild);
- SVGResourcesCache::clientWasAddedToTree(child, child->style());
+ SVGResourcesCache::clientWasAddedToTree(child, &child->style());
if (RenderSVGText* textRenderer = RenderSVGText::locateRenderSVGTextAncestor(this))
textRenderer->subtreeChildWasAdded(child);
diff --git a/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp b/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp
index 1b10b25..1fdee1c 100644
--- a/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp
@@ -86,7 +86,7 @@
RenderText::styleDidChange(diff, oldStyle);
updateScaledFont();
- bool newPreserves = style() ? style()->whiteSpace() == PRE : false;
+ bool newPreserves = style().whiteSpace() == PRE;
bool oldPreserves = oldStyle ? oldStyle->whiteSpace() == PRE : false;
if (oldPreserves && !newPreserves) {
setText(applySVGWhitespaceRules(originalText(), false), true);
@@ -219,7 +219,7 @@
void RenderSVGInlineText::updateScaledFont()
{
- computeNewScaledFontForStyle(this, style(), m_scalingFactor, m_scaledFont);
+ computeNewScaledFontForStyle(this, &style(), m_scalingFactor, m_scaledFont);
}
void RenderSVGInlineText::computeNewScaledFontForStyle(RenderObject* renderer, const RenderStyle* style, float& scalingFactor, Font& scaledFont)
diff --git a/Source/WebCore/rendering/svg/RenderSVGModelObject.cpp b/Source/WebCore/rendering/svg/RenderSVGModelObject.cpp
index 1f87e44..6994969 100644
--- a/Source/WebCore/rendering/svg/RenderSVGModelObject.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGModelObject.cpp
@@ -102,11 +102,11 @@
{
if (diff == StyleDifferenceLayout) {
setNeedsBoundariesUpdate();
- if (style()->hasTransform())
+ if (style().hasTransform())
setNeedsTransformUpdate();
}
RenderElement::styleDidChange(diff, oldStyle);
- SVGResourcesCache::clientStyleChanged(*this, diff, *style());
+ SVGResourcesCache::clientStyleChanged(*this, diff, style());
}
bool RenderSVGModelObject::nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation&, const LayoutPoint&, HitTestAction)
@@ -169,7 +169,7 @@
bool RenderSVGModelObject::checkIntersection(RenderObject* renderer, const FloatRect& rect)
{
- if (!renderer || renderer->style()->pointerEvents() == PE_NONE)
+ if (!renderer || renderer->style().pointerEvents() == PE_NONE)
return false;
if (!isGraphicsElement(renderer))
return false;
@@ -182,7 +182,7 @@
bool RenderSVGModelObject::checkEnclosure(RenderObject* renderer, const FloatRect& rect)
{
- if (!renderer || renderer->style()->pointerEvents() == PE_NONE)
+ if (!renderer || renderer->style().pointerEvents() == PE_NONE)
return false;
if (!isGraphicsElement(renderer))
return false;
diff --git a/Source/WebCore/rendering/svg/RenderSVGPath.cpp b/Source/WebCore/rendering/svg/RenderSVGPath.cpp
index 8e7a0cd..5249ea9 100644
--- a/Source/WebCore/rendering/svg/RenderSVGPath.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGPath.cpp
@@ -57,7 +57,7 @@
{
FloatRect strokeBoundingBox = m_strokeBoundingBox;
- if (style()->svgStyle()->hasStroke()) {
+ if (style().svgStyle()->hasStroke()) {
// FIXME: zero-length subpaths do not respect vector-effect = non-scaling-stroke.
float strokeWidth = this->strokeWidth();
for (size_t i = 0; i < m_zeroLengthLinecapLocations.size(); ++i)
@@ -79,7 +79,7 @@
void RenderSVGPath::strokeShape(GraphicsContext* context) const
{
- if (!style()->svgStyle()->hasVisibleStroke())
+ if (!style().svgStyle()->hasVisibleStroke())
return;
RenderSVGShape::strokeShape(context);
@@ -108,7 +108,7 @@
if (RenderSVGShape::shapeDependentStrokeContains(point))
return true;
- const SVGRenderStyle* svgStyle = style()->svgStyle();
+ const SVGRenderStyle* svgStyle = style().svgStyle();
for (size_t i = 0; i < m_zeroLengthLinecapLocations.size(); ++i) {
ASSERT(svgStyle->hasStroke());
float strokeWidth = this->strokeWidth();
@@ -129,7 +129,7 @@
{
// Spec(11.4): Any zero length subpath shall not be stroked if the "stroke-linecap" property has a value of butt
// but shall be stroked if the "stroke-linecap" property has a value of round or square
- return style()->svgStyle()->hasStroke() && style()->svgStyle()->capStyle() != ButtCap;
+ return style().svgStyle()->hasStroke() && style().svgStyle()->capStyle() != ButtCap;
}
Path* RenderSVGPath::zeroLengthLinecapPath(const FloatPoint& linecapPosition) const
@@ -137,7 +137,7 @@
DEFINE_STATIC_LOCAL(Path, tempPath, ());
tempPath.clear();
- if (style()->svgStyle()->capStyle() == SquareCap)
+ if (style().svgStyle()->capStyle() == SquareCap)
tempPath.addRect(zeroLengthSubpathRect(linecapPosition, this->strokeWidth()));
else
tempPath.addEllipse(zeroLengthSubpathRect(linecapPosition, this->strokeWidth()));
diff --git a/Source/WebCore/rendering/svg/RenderSVGRect.cpp b/Source/WebCore/rendering/svg/RenderSVGRect.cpp
index 142182b..29313b0 100644
--- a/Source/WebCore/rendering/svg/RenderSVGRect.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGRect.cpp
@@ -78,7 +78,7 @@
m_innerStrokeRect = m_fillBoundingBox;
m_outerStrokeRect = m_fillBoundingBox;
- if (style()->svgStyle()->hasStroke()) {
+ if (style().svgStyle()->hasStroke()) {
float strokeWidth = this->strokeWidth();
m_innerStrokeRect.inflate(-strokeWidth / 2);
m_outerStrokeRect.inflate(strokeWidth / 2);
@@ -88,7 +88,7 @@
#if USE(CG)
// CoreGraphics can inflate the stroke by 1px when drawing a rectangle with antialiasing disabled at non-integer coordinates, we need to compensate.
- if (style()->svgStyle()->shapeRendering() == SR_CRISPEDGES)
+ if (style().svgStyle()->shapeRendering() == SR_CRISPEDGES)
m_strokeBoundingBox.inflate(1);
#endif
}
@@ -118,7 +118,7 @@
void RenderSVGRect::strokeShape(GraphicsContext* context) const
{
- if (!style()->svgStyle()->hasVisibleStroke())
+ if (!style().svgStyle()->hasVisibleStroke())
return;
if (m_usePathFallback) {
diff --git a/Source/WebCore/rendering/svg/RenderSVGResource.cpp b/Source/WebCore/rendering/svg/RenderSVGResource.cpp
index 5a50f19..956f92c 100644
--- a/Source/WebCore/rendering/svg/RenderSVGResource.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGResource.cpp
@@ -45,7 +45,7 @@
return true;
if (!object.parent())
return false;
- const SVGRenderStyle* parentSVGStyle = object.parent()->style()->svgStyle();
+ const SVGRenderStyle* parentSVGStyle = object.parent()->style().svgStyle();
color = applyToFill ? parentSVGStyle->fillPaintColor() : parentSVGStyle->strokePaintColor();
return true;
}
diff --git a/Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp b/Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp
index d511dc6..d41486d 100644
--- a/Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp
@@ -90,7 +90,7 @@
bool RenderSVGResourceClipper::pathOnlyClipping(GraphicsContext* context, const AffineTransform& animatedLocalTransform, const FloatRect& objectBoundingBox)
{
// If the current clip-path gets clipped itself, we have to fallback to masking.
- if (!style()->svgStyle()->clipperResource().isEmpty())
+ if (!style().svgStyle()->clipperResource().isEmpty())
return false;
WindRule clipRule = RULE_NONZERO;
Path clipPath = Path();
@@ -110,10 +110,10 @@
if (!childNode->isSVGElement() || !toSVGElement(childNode)->isSVGGraphicsElement())
continue;
SVGGraphicsElement* styled = toSVGGraphicsElement(childNode);
- RenderStyle* style = renderer->style();
- if (!style || style->display() == NONE || style->visibility() != VISIBLE)
+ const RenderStyle& style = renderer->style();
+ if (style.display() == NONE || style.visibility() != VISIBLE)
continue;
- const SVGRenderStyle* svgStyle = style->svgStyle();
+ const SVGRenderStyle* svgStyle = style.svgStyle();
// Current shape in clip-path gets clipped too. Fallback to masking.
if (!svgStyle->clipperResource().isEmpty())
return false;
@@ -230,11 +230,11 @@
view().frameView().setPaintBehavior(oldBehavior);
return false;
}
- RenderStyle* style = renderer->style();
- if (!style || style->display() == NONE || style->visibility() != VISIBLE)
+ const RenderStyle& style = renderer->style();
+ if (style.display() == NONE || style.visibility() != VISIBLE)
continue;
- WindRule newClipRule = style->svgStyle()->clipRule();
+ WindRule newClipRule = style.svgStyle()->clipRule();
bool isUseElement = child.hasTagName(SVGNames::useTag);
if (isUseElement) {
SVGUseElement& useElement = toSVGUseElement(child);
@@ -242,7 +242,7 @@
if (!renderer)
continue;
if (!useElement.hasAttribute(SVGNames::clip_ruleAttr))
- newClipRule = renderer->style()->svgStyle()->clipRule();
+ newClipRule = renderer->style().svgStyle()->clipRule();
}
// Only shapes, paths and texts are allowed for clipping.
@@ -270,8 +270,8 @@
continue;
if (!renderer->isSVGShape() && !renderer->isSVGText() && !childNode->hasTagName(SVGNames::useTag))
continue;
- RenderStyle* style = renderer->style();
- if (!style || style->display() == NONE || style->visibility() != VISIBLE)
+ const RenderStyle& style = renderer->style();
+ if (style.display() == NONE || style.visibility() != VISIBLE)
continue;
m_clipBoundaries.unite(renderer->localToParentTransform().mapRect(renderer->repaintRectInLocalCoordinates()));
}
diff --git a/Source/WebCore/rendering/svg/RenderSVGResourceContainer.cpp b/Source/WebCore/rendering/svg/RenderSVGResourceContainer.cpp
index e95ef3f..a58eb34 100644
--- a/Source/WebCore/rendering/svg/RenderSVGResourceContainer.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGResourceContainer.cpp
@@ -192,7 +192,7 @@
auto renderer = (*it)->renderer();
if (!renderer)
continue;
- SVGResourcesCache::clientStyleChanged(*renderer, StyleDifferenceLayout, *renderer->style());
+ SVGResourcesCache::clientStyleChanged(*renderer, StyleDifferenceLayout, renderer->style());
renderer->setNeedsLayout();
}
}
diff --git a/Source/WebCore/rendering/svg/RenderSVGResourceFilter.cpp b/Source/WebCore/rendering/svg/RenderSVGResourceFilter.cpp
index ba91dba..2c7f08f4 100644
--- a/Source/WebCore/rendering/svg/RenderSVGResourceFilter.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGResourceFilter.cpp
@@ -105,7 +105,7 @@
builder->appendEffectToEffectReferences(effect, element->renderer());
element->setStandardAttributes(effect.get());
effect->setEffectBoundaries(SVGLengthContext::resolveRectangle<SVGFilterPrimitiveStandardAttributes>(&*element, filterElement().primitiveUnits(), targetBoundingBox));
- effect->setOperatingColorSpace(element->renderer()->style()->svgStyle()->colorInterpolationFilters() == CI_LINEARRGB ? ColorSpaceLinearRGB : ColorSpaceDeviceRGB);
+ effect->setOperatingColorSpace(element->renderer()->style().svgStyle()->colorInterpolationFilters() == CI_LINEARRGB ? ColorSpaceLinearRGB : ColorSpaceDeviceRGB);
builder->add(element->result(), effect.release());
}
return builder;
@@ -300,7 +300,7 @@
context->concatCTM(filterData->shearFreeAbsoluteTransform.inverse());
context->scale(FloatSize(1 / filterData->filter->filterResolution().width(), 1 / filterData->filter->filterResolution().height()));
- context->drawImageBuffer(resultImage, renderer.style()->colorSpace(), lastEffect->absolutePaintRect());
+ context->drawImageBuffer(resultImage, renderer.style().colorSpace(), lastEffect->absolutePaintRect());
context->scale(filterData->filter->filterResolution());
context->concatCTM(filterData->shearFreeAbsoluteTransform);
diff --git a/Source/WebCore/rendering/svg/RenderSVGResourceFilterPrimitive.cpp b/Source/WebCore/rendering/svg/RenderSVGResourceFilterPrimitive.cpp
index ad800b1..57090a4 100644
--- a/Source/WebCore/rendering/svg/RenderSVGResourceFilterPrimitive.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGResourceFilterPrimitive.cpp
@@ -60,7 +60,7 @@
if (diff == StyleDifferenceEqual || !oldStyle)
return;
- const SVGRenderStyle* newStyle = this->style()->svgStyle();
+ const SVGRenderStyle* newStyle = style().svgStyle();
if (filterPrimitiveElement().hasTagName(SVGNames::feFloodTag)) {
if (newStyle->floodColor() != oldStyle->svgStyle()->floodColor())
toRenderSVGResourceFilter(filter)->primitiveAttributeChanged(this, SVGNames::flood_colorAttr);
diff --git a/Source/WebCore/rendering/svg/RenderSVGResourceMasker.cpp b/Source/WebCore/rendering/svg/RenderSVGResourceMasker.cpp
index 62774b2..e73c96f 100644
--- a/Source/WebCore/rendering/svg/RenderSVGResourceMasker.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGResourceMasker.cpp
@@ -84,8 +84,7 @@
FloatRect repaintRect = renderer.repaintRectInLocalCoordinates();
if (!maskerData->maskImage && !repaintRect.isEmpty()) {
- ASSERT(style());
- const SVGRenderStyle* svgStyle = style()->svgStyle();
+ const SVGRenderStyle* svgStyle = style().svgStyle();
ASSERT(svgStyle);
ColorSpace colorSpace = svgStyle->colorInterpolation() == CI_LINEARRGB ? ColorSpaceLinearRGB : ColorSpaceDeviceRGB;
if (!SVGRenderingContext::createImageBuffer(repaintRect, absoluteTransform, maskerData->maskImage, colorSpace, Unaccelerated))
@@ -126,8 +125,8 @@
continue;
if (renderer->needsLayout())
return false;
- RenderStyle* style = renderer->style();
- if (!style || style->display() == NONE || style->visibility() != VISIBLE)
+ const RenderStyle& style = renderer->style();
+ if (style.display() == NONE || style.visibility() != VISIBLE)
continue;
SVGRenderingContext::renderSubtreeToImageBuffer(maskerData->maskImage.get(), *renderer, maskContentTransformation);
}
@@ -138,10 +137,9 @@
UNUSED_PARAM(colorSpace);
#endif
- ASSERT(style());
- ASSERT(style()->svgStyle());
+ ASSERT(style().svgStyle());
// Create the luminance mask.
- if (style()->svgStyle()->maskType() == MT_LUMINANCE)
+ if (style().svgStyle()->maskType() == MT_LUMINANCE)
maskerData->maskImage->convertToLuminanceMask();
return true;
@@ -153,8 +151,8 @@
RenderObject* renderer = childNode->renderer();
if (!childNode->isSVGElement() || !renderer)
continue;
- RenderStyle* style = renderer->style();
- if (!style || style->display() == NONE || style->visibility() != VISIBLE)
+ const RenderStyle& style = renderer->style();
+ if (style.display() == NONE || style.visibility() != VISIBLE)
continue;
m_maskContentBoundaries.unite(renderer->localToParentTransform().mapRect(renderer->repaintRectInLocalCoordinates()));
}
diff --git a/Source/WebCore/rendering/svg/RenderSVGRoot.cpp b/Source/WebCore/rendering/svg/RenderSVGRoot.cpp
index 130b5b2..496dbfa 100644
--- a/Source/WebCore/rendering/svg/RenderSVGRoot.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGRoot.cpp
@@ -148,11 +148,11 @@
if (!m_containerSize.isEmpty())
return m_containerSize.width();
- if (style()->logicalWidth().isSpecified() || style()->logicalMaxWidth().isSpecified())
+ if (style().logicalWidth().isSpecified() || style().logicalMaxWidth().isSpecified())
return RenderReplaced::computeReplacedLogicalWidth(shouldComputePreferred);
if (svgSVGElement().widthAttributeEstablishesViewport())
- return resolveLengthAttributeForSVG(svgSVGElement().intrinsicWidth(SVGSVGElement::IgnoreCSSProperties), style()->effectiveZoom(), containingBlock()->availableLogicalWidth(), &view());
+ return resolveLengthAttributeForSVG(svgSVGElement().intrinsicWidth(SVGSVGElement::IgnoreCSSProperties), style().effectiveZoom(), containingBlock()->availableLogicalWidth(), &view());
// SVG embedded through object/embed/iframe.
if (isEmbeddedThroughFrameContainingSVGDocument())
@@ -168,7 +168,7 @@
if (!m_containerSize.isEmpty())
return m_containerSize.height();
- if (style()->logicalHeight().isSpecified() || style()->logicalMaxHeight().isSpecified())
+ if (style().logicalHeight().isSpecified() || style().logicalMaxHeight().isSpecified())
return RenderReplaced::computeReplacedLogicalHeight();
if (svgSVGElement().heightAttributeEstablishesViewport()) {
@@ -183,7 +183,7 @@
} else
RenderBlock::removePercentHeightDescendant(const_cast<RenderSVGRoot&>(*this));
- return resolveLengthAttributeForSVG(height, style()->effectiveZoom(), containingBlock()->availableLogicalHeight(IncludeMarginBorderPadding), &view());
+ return resolveLengthAttributeForSVG(height, style().effectiveZoom(), containingBlock()->availableLogicalHeight(IncludeMarginBorderPadding), &view());
}
// SVG embedded through object/embed/iframe.
@@ -318,13 +318,13 @@
if (diff == StyleDifferenceLayout)
setNeedsBoundariesUpdate();
RenderReplaced::styleDidChange(diff, oldStyle);
- SVGResourcesCache::clientStyleChanged(*this, diff, *style());
+ SVGResourcesCache::clientStyleChanged(*this, diff, style());
}
void RenderSVGRoot::addChild(RenderObject* child, RenderObject* beforeChild)
{
RenderReplaced::addChild(child, beforeChild);
- SVGResourcesCache::clientWasAddedToTree(child, child->style());
+ SVGResourcesCache::clientWasAddedToTree(child, &child->style());
}
void RenderSVGRoot::removeChild(RenderObject& child)
@@ -337,7 +337,7 @@
// relative to our borderBox origin. This method gives us exactly that.
void RenderSVGRoot::buildLocalToBorderBoxTransform()
{
- float scale = style()->effectiveZoom();
+ float scale = style().effectiveZoom();
SVGPoint translate = svgSVGElement().currentTranslate();
LayoutSize borderAndPadding(borderLeft() + paddingLeft(), borderTop() + paddingTop());
m_localToBorderBoxTransform = svgSVGElement().viewBoxToViewTransform(contentWidth() / scale, contentHeight() / scale);
@@ -368,7 +368,7 @@
// and then call RenderBox's method to handle all the normal CSS Box model bits
repaintRect = m_localToBorderBoxTransform.mapRect(repaintRect);
- const SVGRenderStyle* svgStyle = style()->svgStyle();
+ const SVGRenderStyle* svgStyle = style().svgStyle();
if (const ShadowData* shadow = svgStyle->shadow())
shadow->adjustRectForShadow(repaintRect);
diff --git a/Source/WebCore/rendering/svg/RenderSVGShape.cpp b/Source/WebCore/rendering/svg/RenderSVGShape.cpp
index 32e465b..63d47a0 100644
--- a/Source/WebCore/rendering/svg/RenderSVGShape.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGShape.cpp
@@ -101,7 +101,7 @@
bool RenderSVGShape::shapeDependentStrokeContains(const FloatPoint& point)
{
ASSERT(m_path);
- BoundingRectStrokeStyleApplier applier(this, style());
+ BoundingRectStrokeStyleApplier applier(this, &style());
if (hasNonScalingStroke()) {
AffineTransform nonScalingTransform = nonScalingStrokeTransform();
@@ -124,7 +124,7 @@
return false;
Color fallbackColor;
- if (requiresFill && !RenderSVGResource::fillPaintingResource(*this, style(), fallbackColor))
+ if (requiresFill && !RenderSVGResource::fillPaintingResource(*this, &style(), fallbackColor))
return false;
return shapeDependentFillContains(point, fillRule);
@@ -136,7 +136,7 @@
return false;
Color fallbackColor;
- if (requiresStroke && !RenderSVGResource::strokePaintingResource(*this, style(), fallbackColor))
+ if (requiresStroke && !RenderSVGResource::strokePaintingResource(*this, &style(), fallbackColor))
return false;
return shapeDependentStrokeContains(point);
@@ -202,7 +202,7 @@
bool RenderSVGShape::shouldGenerateMarkerPositions() const
{
- if (!style()->svgStyle()->hasMarkers())
+ if (!style().svgStyle()->hasMarkers())
return false;
if (!graphicsElement().supportsMarkers())
@@ -247,11 +247,11 @@
void RenderSVGShape::fillAndStrokeShape(GraphicsContext* context)
{
- RenderStyle* style = this->style();
+ RenderStyle& style = this->style();
- fillShape(style, context);
+ fillShape(&style, context);
- if (!style->svgStyle()->hasVisibleStroke())
+ if (!style.svgStyle()->hasVisibleStroke())
return;
GraphicsContextStateSaver stateSaver(*context, false);
@@ -262,19 +262,19 @@
return;
}
- strokeShape(style, context);
+ strokeShape(&style, context);
}
void RenderSVGShape::paint(PaintInfo& paintInfo, const LayoutPoint&)
{
- if (paintInfo.context->paintingDisabled() || style()->visibility() == HIDDEN || isEmpty())
+ if (paintInfo.context->paintingDisabled() || style().visibility() == HIDDEN || isEmpty())
return;
FloatRect boundingBox = repaintRectInLocalCoordinates();
if (!SVGRenderSupport::paintInfoIntersectsRepaintRect(boundingBox, m_localTransform, paintInfo))
return;
PaintInfo childPaintInfo(paintInfo);
- bool drawsOutline = style()->outlineWidth() && (childPaintInfo.phase == PaintPhaseOutline || childPaintInfo.phase == PaintPhaseSelfOutline);
+ bool drawsOutline = style().outlineWidth() && (childPaintInfo.phase == PaintPhaseOutline || childPaintInfo.phase == PaintPhaseSelfOutline);
if (drawsOutline || childPaintInfo.phase == PaintPhaseForeground) {
GraphicsContextStateSaver stateSaver(*childPaintInfo.context);
childPaintInfo.applyTransform(m_localTransform);
@@ -283,7 +283,7 @@
SVGRenderingContext renderingContext(*this, childPaintInfo);
if (renderingContext.isRenderingPrepared()) {
- const SVGRenderStyle* svgStyle = style()->svgStyle();
+ const SVGRenderStyle* svgStyle = style().svgStyle();
if (svgStyle->shapeRendering() == SR_CRISPEDGES)
childPaintInfo.context->setShouldAntialias(false);
@@ -318,10 +318,10 @@
if (!SVGRenderSupport::pointInClippingArea(this, localPoint))
return false;
- PointerEventsHitRules hitRules(PointerEventsHitRules::SVG_PATH_HITTESTING, request, style()->pointerEvents());
- bool isVisible = (style()->visibility() == VISIBLE);
+ PointerEventsHitRules hitRules(PointerEventsHitRules::SVG_PATH_HITTESTING, request, style().pointerEvents());
+ bool isVisible = (style().visibility() == VISIBLE);
if (isVisible || !hitRules.requireVisible) {
- const SVGRenderStyle* svgStyle = style()->svgStyle();
+ const SVGRenderStyle* svgStyle = style().svgStyle();
WindRule fillRule = svgStyle->fillRule();
if (request.svgClipContent())
fillRule = svgStyle->clipRule();
@@ -380,9 +380,9 @@
ASSERT(m_path);
FloatRect strokeBoundingBox = m_fillBoundingBox;
- const SVGRenderStyle* svgStyle = style()->svgStyle();
+ const SVGRenderStyle* svgStyle = style().svgStyle();
if (svgStyle->hasStroke()) {
- BoundingRectStrokeStyleApplier strokeStyle(this, style());
+ BoundingRectStrokeStyleApplier strokeStyle(this, &style());
if (hasNonScalingStroke()) {
AffineTransform nonScalingTransform = nonScalingStrokeTransform();
if (nonScalingTransform.isInvertible()) {
@@ -413,12 +413,12 @@
float RenderSVGShape::strokeWidth() const
{
SVGLengthContext lengthContext(&graphicsElement());
- return style()->svgStyle()->strokeWidth().value(lengthContext);
+ return style().svgStyle()->strokeWidth().value(lengthContext);
}
bool RenderSVGShape::hasSmoothStroke() const
{
- const SVGRenderStyle* svgStyle = style()->svgStyle();
+ const SVGRenderStyle* svgStyle = style().svgStyle();
return svgStyle->strokeDashArray().isEmpty()
&& svgStyle->strokeMiterLimit() == svgStyle->initialStrokeMiterLimit()
&& svgStyle->joinStyle() == svgStyle->initialJoinStyle()
diff --git a/Source/WebCore/rendering/svg/RenderSVGShape.h b/Source/WebCore/rendering/svg/RenderSVGShape.h
index 47e18ac..b7057bc 100644
--- a/Source/WebCore/rendering/svg/RenderSVGShape.h
+++ b/Source/WebCore/rendering/svg/RenderSVGShape.h
@@ -97,7 +97,7 @@
float strokeWidth() const;
bool hasSmoothStroke() const;
- bool hasNonScalingStroke() const { return style()->svgStyle()->vectorEffect() == VE_NON_SCALING_STROKE; }
+ bool hasNonScalingStroke() const { return style().svgStyle()->vectorEffect() == VE_NON_SCALING_STROKE; }
AffineTransform nonScalingStrokeTransform() const;
Path* nonScalingStrokePath(const Path*, const AffineTransform&) const;
diff --git a/Source/WebCore/rendering/svg/RenderSVGText.cpp b/Source/WebCore/rendering/svg/RenderSVGText.cpp
index a6fe5bf..b2f98d6 100644
--- a/Source/WebCore/rendering/svg/RenderSVGText.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGText.cpp
@@ -450,11 +450,11 @@
bool RenderSVGText::nodeAtFloatPoint(const HitTestRequest& request, HitTestResult& result, const FloatPoint& pointInParent, HitTestAction hitTestAction)
{
- PointerEventsHitRules hitRules(PointerEventsHitRules::SVG_TEXT_HITTESTING, request, style()->pointerEvents());
- bool isVisible = (style()->visibility() == VISIBLE);
+ PointerEventsHitRules hitRules(PointerEventsHitRules::SVG_TEXT_HITTESTING, request, style().pointerEvents());
+ bool isVisible = (style().visibility() == VISIBLE);
if (isVisible || !hitRules.requireVisible) {
- if ((hitRules.canHitStroke && (style()->svgStyle()->hasStroke() || !hitRules.requireStroke))
- || (hitRules.canHitFill && (style()->svgStyle()->hasFill() || !hitRules.requireFill))) {
+ if ((hitRules.canHitStroke && (style().svgStyle()->hasStroke() || !hitRules.requireStroke))
+ || (hitRules.canHitFill && (style().svgStyle()->hasFill() || !hitRules.requireFill))) {
FloatPoint localPoint = localToParentTransform().inverse().mapPoint(pointInParent);
if (!SVGRenderSupport::pointInClippingArea(this, localPoint))
@@ -515,7 +515,7 @@
FloatRect RenderSVGText::strokeBoundingBox() const
{
FloatRect strokeBoundaries = objectBoundingBox();
- const SVGRenderStyle* svgStyle = style()->svgStyle();
+ const SVGRenderStyle* svgStyle = style().svgStyle();
if (!svgStyle->hasStroke())
return strokeBoundaries;
@@ -529,7 +529,7 @@
FloatRect repaintRect = strokeBoundingBox();
SVGRenderSupport::intersectRepaintRectWithResources(*this, repaintRect);
- if (const ShadowData* textShadow = style()->textShadow())
+ if (const ShadowData* textShadow = style().textShadow())
textShadow->adjustRectForShadow(repaintRect);
return repaintRect;
@@ -539,7 +539,7 @@
{
RenderSVGBlock::addChild(child, beforeChild);
- SVGResourcesCache::clientWasAddedToTree(child, child->style());
+ SVGResourcesCache::clientWasAddedToTree(child, &child->style());
subtreeChildWasAdded(child);
}
diff --git a/Source/WebCore/rendering/svg/SVGInlineFlowBox.cpp b/Source/WebCore/rendering/svg/SVGInlineFlowBox.cpp
index f29d0d7..a14d4deb 100644
--- a/Source/WebCore/rendering/svg/SVGInlineFlowBox.cpp
+++ b/Source/WebCore/rendering/svg/SVGInlineFlowBox.cpp
@@ -84,8 +84,7 @@
if (!textNode.inDocument())
return;
- RenderStyle* style = textRenderer->style();
- ASSERT(style);
+ RenderStyle& style = textRenderer->style();
AffineTransform fragmentTransform;
Vector<DocumentMarker*> markers = textRenderer->document().markers().markersFor(&textNode);
@@ -124,7 +123,7 @@
if (!textBox->mapStartEndPositionsIntoFragmentCoordinates(fragment, fragmentStartPosition, fragmentEndPosition))
continue;
- FloatRect fragmentRect = textBox->selectionRectForTextFragment(fragment, fragmentStartPosition, fragmentEndPosition, style);
+ FloatRect fragmentRect = textBox->selectionRectForTextFragment(fragment, fragmentStartPosition, fragmentEndPosition, &style);
fragment.buildFragmentTransform(fragmentTransform);
if (!fragmentTransform.isIdentity())
fragmentRect = fragmentTransform.mapRect(fragmentRect);
diff --git a/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp b/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp
index 47ff600..8475c8f 100644
--- a/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp
+++ b/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp
@@ -84,10 +84,7 @@
float scalingFactor = renderer().scalingFactor();
ASSERT(scalingFactor);
- RenderStyle* style = renderer().style();
- ASSERT(style);
-
- TextRun textRun = constructTextRun(style, fragment);
+ TextRun textRun = constructTextRun(&renderer().style(), fragment);
// Eventually handle lengthAdjust="spacingAndGlyphs".
// FIXME: Handle vertical text.
@@ -140,8 +137,7 @@
if (startPosition >= endPosition)
return LayoutRect();
- RenderStyle* style = renderer().style();
- ASSERT(style);
+ RenderStyle& style = renderer().style();
AffineTransform fragmentTransform;
FloatRect selectionRect;
@@ -157,7 +153,7 @@
if (!mapStartEndPositionsIntoFragmentCoordinates(fragment, fragmentStartPosition, fragmentEndPosition))
continue;
- FloatRect fragmentRect = selectionRectForTextFragment(fragment, fragmentStartPosition, fragmentEndPosition, style);
+ FloatRect fragmentRect = selectionRectForTextFragment(fragment, fragmentStartPosition, fragmentEndPosition, &style);
fragment.buildFragmentTransform(fragmentTransform);
if (!fragmentTransform.isIdentity())
fragmentRect = fragmentTransform.mapRect(fragmentRect);
@@ -181,7 +177,7 @@
ASSERT(paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseSelection);
ASSERT(truncation() == cNoTruncation);
- if (renderer().style()->visibility() != VISIBLE)
+ if (renderer().style().visibility() != VISIBLE)
return;
RenderObject& parentRenderer = parent()->renderer();
@@ -200,14 +196,13 @@
if (!textShouldBePainted(renderer()))
return;
- RenderStyle* style = parentRenderer.style();
- ASSERT(style);
+ RenderStyle& style = parentRenderer.style();
- RenderStyle* selectionStyle = style;
+ RenderStyle* selectionStyle = &style;
if (hasSelection) {
selectionStyle = parentRenderer.getCachedPseudoStyle(SELECTION);
if (!selectionStyle)
- selectionStyle = style;
+ selectionStyle = &style;
}
int startPosition, endPosition;
@@ -231,8 +226,8 @@
if (!fragmentTransform.isIdentity())
paintInfo.context->concatCTM(fragmentTransform);
- paintInfo.context->setFillColor(backgroundColor, style->colorSpace());
- paintInfo.context->fillRect(selectionRectForTextFragment(fragment, fragmentStartPosition, fragmentEndPosition, style), backgroundColor, style->colorSpace());
+ paintInfo.context->setFillColor(backgroundColor, style.colorSpace());
+ paintInfo.context->fillRect(selectionRectForTextFragment(fragment, fragmentStartPosition, fragmentEndPosition, &style), backgroundColor, style.colorSpace());
m_paintingResourceMode = ApplyToDefaultMode;
}
@@ -246,7 +241,7 @@
ASSERT(paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseSelection);
ASSERT(truncation() == cNoTruncation);
- if (renderer().style()->visibility() != VISIBLE)
+ if (renderer().style().visibility() != VISIBLE)
return;
// Note: We're explicitely not supporting composition & custom underlines and custom highlighters - unlike InlineTextBox.
@@ -262,16 +257,15 @@
if (!textShouldBePainted(renderer()))
return;
- RenderStyle* style = parentRenderer.style();
- ASSERT(style);
+ RenderStyle& style = parentRenderer.style();
- const SVGRenderStyle* svgStyle = style->svgStyle();
+ const SVGRenderStyle* svgStyle = style.svgStyle();
ASSERT(svgStyle);
bool hasFill = svgStyle->hasFill();
bool hasVisibleStroke = svgStyle->hasVisibleStroke();
- RenderStyle* selectionStyle = style;
+ RenderStyle* selectionStyle = &style;
if (hasSelection) {
selectionStyle = parentRenderer.getCachedPseudoStyle(SELECTION);
if (selectionStyle) {
@@ -283,7 +277,7 @@
if (!hasVisibleStroke)
hasVisibleStroke = svgSelectionStyle->hasVisibleStroke();
} else
- selectionStyle = style;
+ selectionStyle = &style;
}
if (renderer().view().frameView().paintBehavior() & PaintBehaviorRenderingSVGMask) {
@@ -303,7 +297,7 @@
paintInfo.context->concatCTM(fragmentTransform);
// Spec: All text decorations except line-through should be drawn before the text is filled and stroked; thus, the text is rendered on top of these decorations.
- int decorations = style->textDecorationsInEffect();
+ int decorations = style.textDecorationsInEffect();
if (decorations & TextDecorationUnderline)
paintDecoration(paintInfo.context, TextDecorationUnderline, fragment);
if (decorations & TextDecorationOverline)
@@ -312,13 +306,13 @@
// Fill text
if (hasFill) {
m_paintingResourceMode = ApplyToFillMode | ApplyToTextMode;
- paintText(paintInfo.context, style, selectionStyle, fragment, hasSelection, paintSelectedTextOnly);
+ paintText(paintInfo.context, &style, selectionStyle, fragment, hasSelection, paintSelectedTextOnly);
}
// Stroke text
if (hasVisibleStroke) {
m_paintingResourceMode = ApplyToStrokeMode | ApplyToTextMode;
- paintText(paintInfo.context, style, selectionStyle, fragment, hasSelection, paintSelectedTextOnly);
+ paintText(paintInfo.context, &style, selectionStyle, fragment, hasSelection, paintSelectedTextOnly);
}
// Spec: Line-through should be drawn after the text is filled and stroked; thus, the line-through is rendered on top of the text.
@@ -485,7 +479,7 @@
while (parentBox) {
renderer = &parentBox->renderer();
- if (renderer->style()->textDecoration() != TextDecorationNone)
+ if (renderer->style().textDecoration() != TextDecorationNone)
break;
parentBox = parentBox->parent();
@@ -497,18 +491,17 @@
void SVGInlineTextBox::paintDecoration(GraphicsContext* context, TextDecoration decoration, const SVGTextFragment& fragment)
{
- if (renderer().style()->textDecorationsInEffect() == TextDecorationNone)
+ if (renderer().style().textDecorationsInEffect() == TextDecorationNone)
return;
// Find out which render style defined the text-decoration, as its fill/stroke properties have to be used for drawing instead of ours.
auto& decorationRenderer = findRendererDefininingTextDecoration(parent());
- RenderStyle* decorationStyle = decorationRenderer.style();
- ASSERT(decorationStyle);
+ const RenderStyle& decorationStyle = decorationRenderer.style();
- if (decorationStyle->visibility() == HIDDEN)
+ if (decorationStyle.visibility() == HIDDEN)
return;
- const SVGRenderStyle* svgDecorationStyle = decorationStyle->svgStyle();
+ const SVGRenderStyle* svgDecorationStyle = decorationStyle.svgStyle();
ASSERT(svgDecorationStyle);
bool hasDecorationFill = svgDecorationStyle->hasFill();
@@ -530,12 +523,11 @@
ASSERT(!m_paintingResource);
ASSERT(m_paintingResourceMode != ApplyToDefaultMode);
- RenderStyle* decorationStyle = decorationRenderer.style();
- ASSERT(decorationStyle);
+ RenderStyle& decorationStyle = decorationRenderer.style();
float scalingFactor = 1;
Font scaledFont;
- RenderSVGInlineText::computeNewScaledFontForStyle(&decorationRenderer, decorationStyle, scalingFactor, scaledFont);
+ RenderSVGInlineText::computeNewScaledFontForStyle(&decorationRenderer, &decorationStyle, scalingFactor, scaledFont);
ASSERT(scalingFactor);
// The initial y value refers to overline position.
@@ -560,7 +552,7 @@
Path path;
path.addRect(FloatRect(decorationOrigin, FloatSize(width, thickness)));
- if (acquirePaintingResource(context, scalingFactor, decorationRenderer, decorationStyle))
+ if (acquirePaintingResource(context, scalingFactor, decorationRenderer, &decorationStyle))
releasePaintingResource(context, &path);
}
@@ -678,11 +670,11 @@
// FIXME: integrate with InlineTextBox::nodeAtPoint better.
ASSERT(!isLineBreak());
- PointerEventsHitRules hitRules(PointerEventsHitRules::SVG_TEXT_HITTESTING, request, renderer().style()->pointerEvents());
- bool isVisible = renderer().style()->visibility() == VISIBLE;
+ PointerEventsHitRules hitRules(PointerEventsHitRules::SVG_TEXT_HITTESTING, request, renderer().style().pointerEvents());
+ bool isVisible = renderer().style().visibility() == VISIBLE;
if (isVisible || !hitRules.requireVisible) {
- if ((hitRules.canHitStroke && (renderer().style()->svgStyle()->hasStroke() || !hitRules.requireStroke))
- || (hitRules.canHitFill && (renderer().style()->svgStyle()->hasFill() || !hitRules.requireFill))) {
+ if ((hitRules.canHitStroke && (renderer().style().svgStyle()->hasStroke() || !hitRules.requireStroke))
+ || (hitRules.canHitFill && (renderer().style().svgStyle()->hasFill() || !hitRules.requireFill))) {
FloatPoint boxOrigin(x(), y());
boxOrigin.moveBy(accumulatedOffset);
FloatRect rect(boxOrigin, size());
diff --git a/Source/WebCore/rendering/svg/SVGRenderSupport.cpp b/Source/WebCore/rendering/svg/SVGRenderSupport.cpp
index fa2fa53..0a3cdc0 100644
--- a/Source/WebCore/rendering/svg/SVGRenderSupport.cpp
+++ b/Source/WebCore/rendering/svg/SVGRenderSupport.cpp
@@ -59,13 +59,13 @@
LayoutRect SVGRenderSupport::clippedOverflowRectForRepaint(const RenderObject* object, const RenderLayerModelObject* repaintContainer)
{
// Return early for any cases where we don't actually paint
- if (object->style()->visibility() != VISIBLE && !object->enclosingLayer()->hasVisibleContent())
+ if (object->style().visibility() != VISIBLE && !object->enclosingLayer()->hasVisibleContent())
return LayoutRect();
// Pass our local paint rect to computeRectForRepaint() which will
// map to parent coords and recurse up the parent chain.
FloatRect repaintRect = repaintRectForRendererInLocalCoordinatesExcludingSVGShadow(object);
- const SVGRenderStyle* svgStyle = object->style()->svgStyle();
+ const SVGRenderStyle* svgStyle = object->style().svgStyle();
if (const ShadowData* shadow = svgStyle->shadow())
shadow->adjustRectForShadow(repaintRect);
object->computeFloatRectForRepaint(repaintContainer, repaintRect);
@@ -74,10 +74,10 @@
void SVGRenderSupport::computeFloatRectForRepaint(const RenderObject* object, const RenderLayerModelObject* repaintContainer, FloatRect& repaintRect, bool fixed)
{
- const SVGRenderStyle* svgStyle = object->style()->svgStyle();
+ const SVGRenderStyle* svgStyle = object->style().svgStyle();
if (const ShadowData* shadow = svgStyle->shadow())
shadow->adjustRectForShadow(repaintRect);
- repaintRect.inflate(object->style()->outlineWidth());
+ repaintRect.inflate(object->style().outlineWidth());
// Translate to coords in our parent renderer, and then call computeFloatRectForRepaint() on our parent.
repaintRect = object->localToParentTransform().mapRect(repaintRect);
@@ -299,15 +299,15 @@
bool SVGRenderSupport::isOverflowHidden(const RenderObject* object)
{
// SVG doesn't support independent x/y overflow
- ASSERT(object->style()->overflowX() == object->style()->overflowY());
+ ASSERT(object->style().overflowX() == object->style().overflowY());
// OSCROLL is never set for SVG - see StyleResolver::adjustRenderStyle
- ASSERT(object->style()->overflowX() != OSCROLL);
+ ASSERT(object->style().overflowX() != OSCROLL);
// RenderSVGRoot should never query for overflow state - it should always clip itself to the initial viewport size.
ASSERT(!object->isRoot());
- return object->style()->overflowX() == OHIDDEN;
+ return object->style().overflowX() == OHIDDEN;
}
bool SVGRenderSupport::rendererHasSVGShadow(const RenderObject* object)
@@ -349,13 +349,11 @@
AffineTransform localToRootTransform;
while (currentObject && rendererHasSVGShadow(currentObject)) {
- RenderStyle* style = currentObject->style();
- if (style) {
- const SVGRenderStyle* svgStyle = style->svgStyle();
- if (svgStyle) {
- if (const ShadowData* shadow = svgStyle->shadow())
- shadow->adjustRectForShadow(repaintRect);
- }
+ const RenderStyle& style = currentObject->style();
+ const SVGRenderStyle* svgStyle = style.svgStyle();
+ if (svgStyle) {
+ if (const ShadowData* shadow = svgStyle->shadow())
+ shadow->adjustRectForShadow(repaintRect);
}
repaintRect = currentObject->localToParentTransform().mapRect(repaintRect);
@@ -458,7 +456,7 @@
void SVGRenderSupport::styleChanged(RenderObject* object)
{
RenderObject* parent = object->parent();
- SVGRenderSupport::setRendererHasSVGShadow(object, (parent && SVGRenderSupport::rendererHasSVGShadow(parent)) || (object->style()->svgStyle() && object->style()->svgStyle()->shadow()));
+ SVGRenderSupport::setRendererHasSVGShadow(object, (parent && SVGRenderSupport::rendererHasSVGShadow(parent)) || (object->style().svgStyle() && object->style().svgStyle()->shadow()));
}
}
diff --git a/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp b/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp
index b8955da..3f24ea8 100644
--- a/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp
+++ b/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp
@@ -265,18 +265,18 @@
static void writeStyle(TextStream& ts, const RenderObject& object)
{
- const RenderStyle* style = object.style();
- const SVGRenderStyle* svgStyle = style->svgStyle();
+ const RenderStyle& style = object.style();
+ const SVGRenderStyle* svgStyle = style.svgStyle();
if (!object.localTransform().isIdentity())
writeNameValuePair(ts, "transform", object.localTransform());
- writeIfNotDefault(ts, "image rendering", style->imageRendering(), RenderStyle::initialImageRendering());
- writeIfNotDefault(ts, "opacity", style->opacity(), RenderStyle::initialOpacity());
+ writeIfNotDefault(ts, "image rendering", style.imageRendering(), RenderStyle::initialImageRendering());
+ writeIfNotDefault(ts, "opacity", style.opacity(), RenderStyle::initialOpacity());
if (object.isSVGShape()) {
const RenderSVGShape& shape = static_cast<const RenderSVGShape&>(object);
Color fallbackColor;
- if (RenderSVGResource* strokePaintingResource = RenderSVGResource::strokePaintingResource(const_cast<RenderSVGShape&>(shape), shape.style(), fallbackColor)) {
+ if (RenderSVGResource* strokePaintingResource = RenderSVGResource::strokePaintingResource(const_cast<RenderSVGShape&>(shape), &shape.style(), fallbackColor)) {
TextStreamSeparator s(" ");
ts << " [stroke={" << s;
writeSVGPaintingResource(ts, strokePaintingResource);
@@ -303,7 +303,7 @@
ts << "}]";
}
- if (RenderSVGResource* fillPaintingResource = RenderSVGResource::fillPaintingResource(const_cast<RenderSVGShape&>(shape), shape.style(), fallbackColor)) {
+ if (RenderSVGResource* fillPaintingResource = RenderSVGResource::fillPaintingResource(const_cast<RenderSVGShape&>(shape), &shape.style(), fallbackColor)) {
TextStreamSeparator s(" ");
ts << " [fill={" << s;
writeSVGPaintingResource(ts, fillPaintingResource);
@@ -387,8 +387,8 @@
// FIXME: Remove this hack, once the new text layout engine is completly landed. We want to preserve the old layout test results for now.
ts << " contains 1 chunk(s)";
- if (text.parent() && (text.parent()->style()->visitedDependentColor(CSSPropertyColor) != text.style()->visitedDependentColor(CSSPropertyColor)))
- writeNameValuePair(ts, "color", text.style()->visitedDependentColor(CSSPropertyColor).nameForRenderTreeAsText());
+ if (text.parent() && (text.parent()->style().visitedDependentColor(CSSPropertyColor) != text.style().visitedDependentColor(CSSPropertyColor)))
+ writeNameValuePair(ts, "color", text.style().visitedDependentColor(CSSPropertyColor).nameForRenderTreeAsText());
}
static inline void writeSVGInlineTextBox(TextStream& ts, SVGInlineTextBox* textBox, int indent)
@@ -397,7 +397,7 @@
if (fragments.isEmpty())
return;
- const SVGRenderStyle* svgStyle = textBox->renderer().style()->svgStyle();
+ const SVGRenderStyle* svgStyle = textBox->renderer().style().svgStyle();
String text = textBox->renderer().text();
unsigned fragmentsSize = fragments.size();
@@ -627,17 +627,13 @@
SVGStopElement* stopElement = toSVGStopElement(toSVGElement(stop.element()));
ASSERT(stopElement);
- RenderStyle* style = stop.style();
- if (!style)
- return;
-
ts << " [offset=" << stopElement->offset() << "] [color=" << stopElement->stopColorIncludingOpacity() << "]\n";
}
void writeResources(TextStream& ts, const RenderObject& object, int indent)
{
- const RenderStyle* style = object.style();
- const SVGRenderStyle* svgStyle = style->svgStyle();
+ const RenderStyle& style = object.style();
+ const SVGRenderStyle* svgStyle = style.svgStyle();
// FIXME: We want to use SVGResourcesCache to determine which resources are present, instead of quering the resource <-> id cache.
// For now leave the DRT output as is, but later on we should change this so cycles are properly ignored in the DRT output.
diff --git a/Source/WebCore/rendering/svg/SVGRenderingContext.cpp b/Source/WebCore/rendering/svg/SVGRenderingContext.cpp
index 37da94b..f151604 100644
--- a/Source/WebCore/rendering/svg/SVGRenderingContext.cpp
+++ b/Source/WebCore/rendering/svg/SVGRenderingContext.cpp
@@ -97,15 +97,14 @@
m_renderingFlags |= RestoreGraphicsContext;
}
- RenderStyle* style = m_renderer->style();
- ASSERT(style);
+ RenderStyle& style = m_renderer->style();
- const SVGRenderStyle* svgStyle = style->svgStyle();
+ const SVGRenderStyle* svgStyle = style.svgStyle();
ASSERT(svgStyle);
// Setup transparency layers before setting up SVG resources!
bool isRenderingMask = isRenderingMaskImage(*m_renderer);
- float opacity = isRenderingMask ? 1 : style->opacity();
+ float opacity = isRenderingMask ? 1 : style.opacity();
const ShadowData* shadow = svgStyle->shadow();
if (opacity < 1 || shadow) {
FloatRect repaintRect = m_renderer->repaintRectInLocalCoordinates();
@@ -118,13 +117,13 @@
if (shadow) {
m_paintInfo->context->clip(repaintRect);
- m_paintInfo->context->setShadow(IntSize(roundToInt(shadow->x()), roundToInt(shadow->y())), shadow->radius(), shadow->color(), style->colorSpace());
+ m_paintInfo->context->setShadow(IntSize(roundToInt(shadow->x()), roundToInt(shadow->y())), shadow->radius(), shadow->color(), style.colorSpace());
m_paintInfo->context->beginTransparencyLayer(1);
m_renderingFlags |= EndShadowLayer;
}
}
- ClipPathOperation* clipPathOperation = style->clipPath();
+ ClipPathOperation* clipPathOperation = style.clipPath();
if (clipPathOperation && clipPathOperation->type() == ClipPathOperation::SHAPE) {
ShapeClipPathOperation* clipPath = static_cast<ShapeClipPathOperation*>(clipPathOperation);
m_paintInfo->context->clipPath(clipPath->path(renderer.objectBoundingBox()), clipPath->windRule());
@@ -142,14 +141,14 @@
if (!isRenderingMask) {
if (RenderSVGResourceMasker* masker = resources->masker()) {
- if (!masker->applyResource(*m_renderer, style, m_paintInfo->context, ApplyToDefaultMode))
+ if (!masker->applyResource(*m_renderer, &style, m_paintInfo->context, ApplyToDefaultMode))
return;
}
}
RenderSVGResourceClipper* clipper = resources->clipper();
if (!clipPathOperation && clipper) {
- if (!clipper->applyResource(*m_renderer, style, m_paintInfo->context, ApplyToDefaultMode))
+ if (!clipper->applyResource(*m_renderer, &style, m_paintInfo->context, ApplyToDefaultMode))
return;
}
@@ -162,7 +161,7 @@
// Return with false here may mean that we don't need to draw the content
// (because it was either drawn before or empty) but we still need to apply the filter.
m_renderingFlags |= EndFilterLayer;
- if (!m_filter->applyResource(*m_renderer, style, m_paintInfo->context, ApplyToDefaultMode))
+ if (!m_filter->applyResource(*m_renderer, &style, m_paintInfo->context, ApplyToDefaultMode))
return;
// Since we're caching the resulting bitmap and do not invalidate it on repaint rect
diff --git a/Source/WebCore/rendering/svg/SVGTextChunkBuilder.cpp b/Source/WebCore/rendering/svg/SVGTextChunkBuilder.cpp
index 645f1d3..d651b9f 100644
--- a/Source/WebCore/rendering/svg/SVGTextChunkBuilder.cpp
+++ b/Source/WebCore/rendering/svg/SVGTextChunkBuilder.cpp
@@ -93,17 +93,16 @@
SVGInlineTextBox* textBox = lineLayoutBoxes[boxStart];
ASSERT(textBox);
- const RenderStyle* style = textBox->renderer().style();
- ASSERT(style);
+ const RenderStyle& style = textBox->renderer().style();
- const SVGRenderStyle* svgStyle = style->svgStyle();
+ const SVGRenderStyle* svgStyle = style.svgStyle();
ASSERT(svgStyle);
// Build chunk style flags.
unsigned chunkStyle = SVGTextChunk::DefaultStyle;
// Handle 'direction' property.
- if (!style->isLeftToRightDirection())
+ if (!style.isLeftToRightDirection())
chunkStyle |= SVGTextChunk::RightToLeftText;
// Handle 'writing-mode' property.
diff --git a/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp b/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp
index df0491d..1bc19b1 100644
--- a/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp
+++ b/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp
@@ -85,7 +85,7 @@
static inline void processRenderSVGInlineText(RenderSVGInlineText* text, unsigned& atCharacter, const UChar*& lastCharacter)
{
- if (text->style()->whiteSpace() == PRE) {
+ if (text->style().whiteSpace() == PRE) {
atCharacter += text->textLength();
return;
}
diff --git a/Source/WebCore/rendering/svg/SVGTextLayoutEngine.cpp b/Source/WebCore/rendering/svg/SVGTextLayoutEngine.cpp
index 9467c46..43976bc 100644
--- a/Source/WebCore/rendering/svg/SVGTextLayoutEngine.cpp
+++ b/Source/WebCore/rendering/svg/SVGTextLayoutEngine.cpp
@@ -240,12 +240,11 @@
ASSERT(text.parent()->element());
ASSERT(text.parent()->element()->isSVGElement());
- const RenderStyle* style = text.style();
- ASSERT(style);
+ const RenderStyle& style = text.style();
textBox->clearTextFragments();
- m_isVerticalText = style->svgStyle()->isVerticalWritingMode();
- layoutTextOnLineOrPath(textBox, &text, style);
+ m_isVerticalText = style.svgStyle()->isVerticalWritingMode();
+ layoutTextOnLineOrPath(textBox, &text, &style);
if (m_inPathLayout) {
m_pathLayoutBoxes.append(textBox);
diff --git a/Source/WebCore/rendering/svg/SVGTextLayoutEngineBaseline.cpp b/Source/WebCore/rendering/svg/SVGTextLayoutEngineBaseline.cpp
index a175352..c9185d8 100644
--- a/Source/WebCore/rendering/svg/SVGTextLayoutEngineBaseline.cpp
+++ b/Source/WebCore/rendering/svg/SVGTextLayoutEngineBaseline.cpp
@@ -63,11 +63,9 @@
EAlignmentBaseline SVGTextLayoutEngineBaseline::dominantBaselineToAlignmentBaseline(bool isVerticalText, const RenderObject* textRenderer) const
{
ASSERT(textRenderer);
- ASSERT(textRenderer->style());
ASSERT(textRenderer->parent());
- ASSERT(textRenderer->parent()->style());
- const SVGRenderStyle* style = textRenderer->style()->svgStyle();
+ const SVGRenderStyle* style = textRenderer->style().svgStyle();
ASSERT(style);
EDominantBaseline baseline = style->dominantBaseline();
@@ -111,14 +109,13 @@
float SVGTextLayoutEngineBaseline::calculateAlignmentBaselineShift(bool isVerticalText, const RenderObject* textRenderer) const
{
ASSERT(textRenderer);
- ASSERT(textRenderer->style());
- ASSERT(textRenderer->style()->svgStyle());
+ ASSERT(textRenderer->style().svgStyle());
ASSERT(textRenderer->parent());
const RenderObject* textRendererParent = textRenderer->parent();
ASSERT(textRendererParent);
- EAlignmentBaseline baseline = textRenderer->style()->svgStyle()->alignmentBaseline();
+ EAlignmentBaseline baseline = textRenderer->style().svgStyle()->alignmentBaseline();
if (baseline == AB_AUTO) {
baseline = dominantBaselineToAlignmentBaseline(isVerticalText, textRendererParent);
ASSERT(baseline != AB_AUTO);
diff --git a/Source/WebCore/rendering/svg/SVGTextMetrics.cpp b/Source/WebCore/rendering/svg/SVGTextMetrics.cpp
index a16342c..7c1ee6b 100644
--- a/Source/WebCore/rendering/svg/SVGTextMetrics.cpp
+++ b/Source/WebCore/rendering/svg/SVGTextMetrics.cpp
@@ -65,18 +65,17 @@
TextRun SVGTextMetrics::constructTextRun(RenderSVGInlineText* text, const UChar* characters, unsigned position, unsigned length)
{
- RenderStyle* style = text->style();
- ASSERT(style);
+ const RenderStyle& style = text->style();
TextRun run(characters + position
, length
, 0 /* xPos, only relevant with allowTabs=true */
, 0 /* padding, only relevant for justified text, not relevant for SVG */
, TextRun::AllowTrailingExpansion
- , style->direction()
- , isOverride(style->unicodeBidi()) /* directionalOverride */);
+ , style.direction()
+ , isOverride(style.unicodeBidi()) /* directionalOverride */);
- if (textRunNeedsRenderingContext(style->font()))
+ if (textRunNeedsRenderingContext(style.font()))
run.setRenderingContext(SVGTextRunRenderingContext::create(*text));
run.disableRoundingHacks();
@@ -100,7 +99,7 @@
{
ASSERT(text);
- bool needsContext = textRunNeedsRenderingContext(text->style()->font());
+ bool needsContext = textRunNeedsRenderingContext(text->style().font());
float scalingFactor = text->scalingFactor();
ASSERT(scalingFactor);
diff --git a/Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp b/Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp
index 967fc54..0f800d7 100644
--- a/Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp
+++ b/Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp
@@ -142,7 +142,7 @@
}
initializeMeasurementWithTextRenderer(text);
- bool preserveWhiteSpace = text->style()->whiteSpace() == PRE;
+ bool preserveWhiteSpace = text->style().whiteSpace() == PRE;
int surrogatePairCharacters = 0;
while (advance()) {
diff --git a/Source/WebCore/rendering/svg/SVGTextQuery.cpp b/Source/WebCore/rendering/svg/SVGTextQuery.cpp
index 5e94ef3..88c55fe 100644
--- a/Source/WebCore/rendering/svg/SVGTextQuery.cpp
+++ b/Source/WebCore/rendering/svg/SVGTextQuery.cpp
@@ -116,10 +116,9 @@
for (unsigned textBoxPosition = 0; textBoxPosition < textBoxCount; ++textBoxPosition) {
queryData->textBox = m_textBoxes.at(textBoxPosition);
queryData->textRenderer = &queryData->textBox->renderer();
- ASSERT(queryData->textRenderer->style());
- ASSERT(queryData->textRenderer->style()->svgStyle());
+ ASSERT(queryData->textRenderer->style().svgStyle());
- queryData->isVerticalText = queryData->textRenderer->style()->svgStyle()->isVerticalWritingMode();
+ queryData->isVerticalText = queryData->textRenderer->style().svgStyle()->isVerticalWritingMode();
const Vector<SVGTextFragment>& fragments = queryData->textBox->textFragments();
// Loop over all text fragments in this text box, firing a callback for each.
diff --git a/Source/WebCore/rendering/svg/SVGTextRunRenderingContext.cpp b/Source/WebCore/rendering/svg/SVGTextRunRenderingContext.cpp
index 6675807..fad8083 100644
--- a/Source/WebCore/rendering/svg/SVGTextRunRenderingContext.cpp
+++ b/Source/WebCore/rendering/svg/SVGTextRunRenderingContext.cpp
@@ -120,7 +120,7 @@
}
auto& elementRenderer = renderer().isRenderElement() ? toRenderElement(renderer()) : *renderer().parent();
- RenderStyle& style = *elementRenderer.style();
+ RenderStyle& style = elementRenderer.style();
bool isVerticalText = style.svgStyle()->isVerticalWritingMode();
float scale = scaleEmToUnits(fontData->platformData().size(), fontFaceElement->unitsPerEm());
diff --git a/Source/WebCore/style/StyleResolveForDocument.cpp b/Source/WebCore/style/StyleResolveForDocument.cpp
index b6ecf84..b339e28 100644
--- a/Source/WebCore/style/StyleResolveForDocument.cpp
+++ b/Source/WebCore/style/StyleResolveForDocument.cpp
@@ -84,13 +84,13 @@
// If there is no body, then use the document element.
RenderObject* bodyRenderer = document.body() ? document.body()->renderer() : 0;
if (bodyRenderer && !document.writingModeSetOnDocumentElement())
- documentStyle.get().setWritingMode(bodyRenderer->style()->writingMode());
+ documentStyle.get().setWritingMode(bodyRenderer->style().writingMode());
else
- documentStyle.get().setWritingMode(docElementRenderer->style()->writingMode());
+ documentStyle.get().setWritingMode(docElementRenderer->style().writingMode());
if (bodyRenderer && !document.directionSetOnDocumentElement())
- documentStyle.get().setDirection(bodyRenderer->style()->direction());
+ documentStyle.get().setDirection(bodyRenderer->style().direction());
else
- documentStyle.get().setDirection(docElementRenderer->style()->direction());
+ documentStyle.get().setDirection(docElementRenderer->style().direction());
}
const Pagination& pagination = renderView.frameView().pagination();
diff --git a/Source/WebCore/style/StyleResolveTree.cpp b/Source/WebCore/style/StyleResolveTree.cpp
index 02758fa..e077058 100644
--- a/Source/WebCore/style/StyleResolveTree.cpp
+++ b/Source/WebCore/style/StyleResolveTree.cpp
@@ -125,7 +125,7 @@
{
if (!renderer->node()->isElementNode())
return false;
- if (renderer->style() && !renderer->style()->flowThread().isEmpty())
+ if (!renderer->style().flowThread().isEmpty())
return true;
return false;
}
@@ -240,7 +240,7 @@
RenderElement* newRenderer = element.createRenderer(style.releaseNonNull());
if (!newRenderer)
return;
- if (!parentRenderer->isChildAllowed(*newRenderer, *newRenderer->style())) {
+ if (!parentRenderer->isChildAllowed(*newRenderer, newRenderer->style())) {
newRenderer->destroy();
return;
}
@@ -254,7 +254,7 @@
// FIXME: There's probably a better way to factor this.
// This just does what setAnimatedStyle() does, except with setStyleInternal() instead of setStyle().
- newRenderer->setStyleInternal(newRenderer->animation().updateAnimations(*newRenderer, *newRenderer->style()));
+ newRenderer->setStyleInternal(newRenderer->animation().updateAnimations(*newRenderer, newRenderer->style()));
newRenderer->initializeStyle();
@@ -378,7 +378,8 @@
if (!renderingParentNode->childShouldCreateRenderer(&textNode))
return;
- RenderStyle& style = *parentRenderer->style();
+ // FIXME: constify this RenderStyle&.
+ RenderStyle& style = parentRenderer->style();
if (!textRendererIsNeeded(textNode, *parentRenderer, style))
return;
@@ -427,7 +428,7 @@
return;
}
RenderObject* parentRenderer = NodeRenderingTraversal::parent(&textNode)->renderer();
- if (!textRendererIsNeeded(textNode, *parentRenderer, *textRenderer->style())) {
+ if (!textRendererIsNeeded(textNode, *parentRenderer, textRenderer->style())) {
detachTextRenderer(textNode);
attachTextRenderer(textNode);
reattachTextRenderersForWhitespaceOnlySiblingsAfterAttachIfNeeded(textNode);
@@ -559,9 +560,9 @@
static bool pseudoStyleCacheIsInvalid(RenderElement* renderer, RenderStyle* newStyle)
{
- const RenderStyle* currentStyle = renderer->style();
+ const RenderStyle& currentStyle = renderer->style();
- const PseudoStyleCache* pseudoStyleCache = currentStyle->cachedPseudoStyles();
+ const PseudoStyleCache* pseudoStyleCache = currentStyle.cachedPseudoStyles();
if (!pseudoStyleCache)
return false;
@@ -811,7 +812,7 @@
documentStyle.get().font().update(styleResolver->fontSelector());
}
- Style::Change documentChange = determineChange(&documentStyle.get(), document.renderView()->style(), document.settings());
+ Style::Change documentChange = determineChange(&documentStyle.get(), &document.renderView()->style(), document.settings());
if (documentChange != NoChange)
document.renderView()->setStyle(std::move(documentStyle));
else
diff --git a/Source/WebCore/svg/SVGAnimatedColor.cpp b/Source/WebCore/svg/SVGAnimatedColor.cpp
index 28160a1..f81b873 100644
--- a/Source/WebCore/svg/SVGAnimatedColor.cpp
+++ b/Source/WebCore/svg/SVGAnimatedColor.cpp
@@ -53,7 +53,7 @@
ASSERT(targetElement);
if (RenderElement* targetRenderer = targetElement->renderer())
- color = targetRenderer->style()->visitedDependentColor(CSSPropertyColor);
+ color = targetRenderer->style().visitedDependentColor(CSSPropertyColor);
else
color = Color();
}
diff --git a/Source/WebCore/svg/SVGElement.cpp b/Source/WebCore/svg/SVGElement.cpp
index c601c49..824e8b5 100644
--- a/Source/WebCore/svg/SVGElement.cpp
+++ b/Source/WebCore/svg/SVGElement.cpp
@@ -752,8 +752,8 @@
RenderStyle* style = 0;
if (Element* parent = parentOrShadowHostElement()) {
- if (RenderObject* renderer = parent->renderer())
- style = renderer->style();
+ if (auto renderer = parent->renderer())
+ style = &renderer->style();
}
return document().ensureStyleResolver().styleForElement(correspondingElement(), style, DisallowStyleSharing);
@@ -784,8 +784,8 @@
RenderStyle* parentStyle = 0;
if (Element* parent = parentOrShadowHostElement()) {
- if (RenderObject* renderer = parent->renderer())
- parentStyle = renderer->style();
+ if (auto renderer = parent->renderer())
+ parentStyle = &renderer->style();
}
return m_svgRareData->overrideComputedStyle(this, parentStyle);
diff --git a/Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp b/Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp
index f2cf95a..7aa2e19 100644
--- a/Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp
+++ b/Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp
@@ -131,8 +131,7 @@
if (attrName == SVGNames::lighting_colorAttr) {
RenderObject* renderer = this->renderer();
ASSERT(renderer);
- ASSERT(renderer->style());
- return diffuseLighting->setLightingColor(renderer->style()->svgStyle()->lightingColor());
+ return diffuseLighting->setLightingColor(renderer->style().svgStyle()->lightingColor());
}
if (attrName == SVGNames::surfaceScaleAttr)
return diffuseLighting->setSurfaceScale(surfaceScale());
@@ -218,8 +217,7 @@
if (!renderer)
return 0;
- ASSERT(renderer->style());
- Color color = renderer->style()->svgStyle()->lightingColor();
+ Color color = renderer->style().svgStyle()->lightingColor();
RefPtr<FilterEffect> effect = FEDiffuseLighting::create(filter, color, surfaceScale(), diffuseConstant(),
kernelUnitLengthX(), kernelUnitLengthY(), lightSource.release());
diff --git a/Source/WebCore/svg/SVGFEDropShadowElement.cpp b/Source/WebCore/svg/SVGFEDropShadowElement.cpp
index ce183d5..f6af8ff 100644
--- a/Source/WebCore/svg/SVGFEDropShadowElement.cpp
+++ b/Source/WebCore/svg/SVGFEDropShadowElement.cpp
@@ -158,8 +158,7 @@
if (stdDeviationX() < 0 || stdDeviationY() < 0)
return 0;
- ASSERT(renderer->style());
- const SVGRenderStyle* svgStyle = renderer->style()->svgStyle();
+ const SVGRenderStyle* svgStyle = renderer->style().svgStyle();
Color color = svgStyle->floodColor();
float opacity = svgStyle->floodOpacity();
diff --git a/Source/WebCore/svg/SVGFEFloodElement.cpp b/Source/WebCore/svg/SVGFEFloodElement.cpp
index 30dd94a..6605292 100644
--- a/Source/WebCore/svg/SVGFEFloodElement.cpp
+++ b/Source/WebCore/svg/SVGFEFloodElement.cpp
@@ -46,14 +46,13 @@
{
RenderObject* renderer = this->renderer();
ASSERT(renderer);
- RenderStyle* style = renderer->style();
- ASSERT(style);
+ const RenderStyle& style = renderer->style();
FEFlood* flood = static_cast<FEFlood*>(effect);
if (attrName == SVGNames::flood_colorAttr)
- return flood->setFloodColor(style->svgStyle()->floodColor());
+ return flood->setFloodColor(style.svgStyle()->floodColor());
if (attrName == SVGNames::flood_opacityAttr)
- return flood->setFloodOpacity(style->svgStyle()->floodOpacity());
+ return flood->setFloodOpacity(style.svgStyle()->floodOpacity());
ASSERT_NOT_REACHED();
return false;
@@ -65,8 +64,7 @@
if (!renderer)
return 0;
- ASSERT(renderer->style());
- const SVGRenderStyle* svgStyle = renderer->style()->svgStyle();
+ const SVGRenderStyle* svgStyle = renderer->style().svgStyle();
Color color = svgStyle->floodColor();
float opacity = svgStyle->floodOpacity();
diff --git a/Source/WebCore/svg/SVGFESpecularLightingElement.cpp b/Source/WebCore/svg/SVGFESpecularLightingElement.cpp
index 08d9ca3..da1d1fa 100644
--- a/Source/WebCore/svg/SVGFESpecularLightingElement.cpp
+++ b/Source/WebCore/svg/SVGFESpecularLightingElement.cpp
@@ -140,8 +140,7 @@
if (attrName == SVGNames::lighting_colorAttr) {
RenderObject* renderer = this->renderer();
ASSERT(renderer);
- ASSERT(renderer->style());
- return specularLighting->setLightingColor(renderer->style()->svgStyle()->lightingColor());
+ return specularLighting->setLightingColor(renderer->style().svgStyle()->lightingColor());
}
if (attrName == SVGNames::surfaceScaleAttr)
return specularLighting->setSurfaceScale(surfaceScale());
@@ -229,8 +228,7 @@
if (!renderer)
return 0;
- ASSERT(renderer->style());
- Color color = renderer->style()->svgStyle()->lightingColor();
+ Color color = renderer->style().svgStyle()->lightingColor();
RefPtr<FilterEffect> effect = FESpecularLighting::create(filter, color, surfaceScale(), specularConstant(),
specularExponent(), kernelUnitLengthX(), kernelUnitLengthY(), lightSource.release());
diff --git a/Source/WebCore/svg/SVGFontData.cpp b/Source/WebCore/svg/SVGFontData.cpp
index f931e68..f8bf4dc 100644
--- a/Source/WebCore/svg/SVGFontData.cpp
+++ b/Source/WebCore/svg/SVGFontData.cpp
@@ -169,7 +169,7 @@
RenderElement* parentRenderer = renderObject->isRenderElement() ? toRenderElement(renderObject) : renderObject->parent();
ASSERT(parentRenderer);
- isVerticalText = parentRenderer->style()->svgStyle()->isVerticalWritingMode();
+ isVerticalText = parentRenderer->style().svgStyle()->isVerticalWritingMode();
if (Element* parentRendererElement = parentRenderer->element()) {
language = parentRendererElement->getAttribute(XMLNames::langAttr);
diff --git a/Source/WebCore/svg/SVGGraphicsElement.cpp b/Source/WebCore/svg/SVGGraphicsElement.cpp
index d6e8313..501e3f1 100644
--- a/Source/WebCore/svg/SVGGraphicsElement.cpp
+++ b/Source/WebCore/svg/SVGGraphicsElement.cpp
@@ -65,7 +65,7 @@
AffineTransform SVGGraphicsElement::animatedLocalTransform() const
{
AffineTransform matrix;
- RenderStyle* style = renderer() ? renderer()->style() : 0;
+ RenderStyle* style = renderer() ? &renderer()->style() : nullptr;
// If CSS property was set, use that, otherwise fallback to attribute (if set).
if (style && style->hasTransform()) {
diff --git a/Source/WebCore/svg/SVGLengthContext.cpp b/Source/WebCore/svg/SVGLengthContext.cpp
index ca7bb48..0d084bd 100644
--- a/Source/WebCore/svg/SVGLengthContext.cpp
+++ b/Source/WebCore/svg/SVGLengthContext.cpp
@@ -211,7 +211,7 @@
const ContainerNode* currentContext = context;
while (currentContext) {
if (currentContext->renderer())
- return currentContext->renderer()->style();
+ return ¤tContext->renderer()->style();
currentContext = currentContext->parentNode();
}
diff --git a/Source/WebCore/svg/SVGSVGElement.cpp b/Source/WebCore/svg/SVGSVGElement.cpp
index 5502cb1..64810af 100644
--- a/Source/WebCore/svg/SVGSVGElement.cpp
+++ b/Source/WebCore/svg/SVGSVGElement.cpp
@@ -445,7 +445,7 @@
// We also need to adjust for the zoom level factored into CSS coordinates (bug #96361).
if (renderer->isSVGRoot()) {
location = toRenderSVGRoot(renderer)->localToBorderBoxTransform().mapPoint(location);
- zoomFactor = 1 / renderer->style()->effectiveZoom();
+ zoomFactor = 1 / renderer->style().effectiveZoom();
}
// Translate in our CSS parent coordinate space
@@ -583,7 +583,7 @@
if (renderer()->isSVGRoot()) {
LayoutRect contentBoxRect = toRenderSVGRoot(renderer())->contentBoxRect();
- return FloatSize(contentBoxRect.width() / renderer()->style()->effectiveZoom(), contentBoxRect.height() / renderer()->style()->effectiveZoom());
+ return FloatSize(contentBoxRect.width() / renderer()->style().effectiveZoom(), contentBoxRect.height() / renderer()->style().effectiveZoom());
}
FloatRect viewportRect = toRenderSVGViewportContainer(renderer())->viewport();
@@ -649,7 +649,7 @@
}
ASSERT(renderer());
- return renderer()->style()->width();
+ return renderer()->style().width();
}
Length SVGSVGElement::intrinsicHeight(ConsiderCSSMode mode) const
@@ -663,7 +663,7 @@
}
ASSERT(renderer());
- return renderer()->style()->height();
+ return renderer()->style().height();
}
AffineTransform SVGSVGElement::viewBoxToViewTransform(float viewWidth, float viewHeight) const
diff --git a/Source/WebCore/svg/SVGStopElement.cpp b/Source/WebCore/svg/SVGStopElement.cpp
index 0bfebcb..d7c946f 100644
--- a/Source/WebCore/svg/SVGStopElement.cpp
+++ b/Source/WebCore/svg/SVGStopElement.cpp
@@ -112,7 +112,7 @@
Color SVGStopElement::stopColorIncludingOpacity() const
{
- RenderStyle* style = renderer() ? renderer()->style() : 0;
+ RenderStyle* style = renderer() ? &renderer()->style() : nullptr;
// FIXME: This check for null style exists to address Bug WK 90814, a rare crash condition in
// which the renderer or style is null. This entire class is scheduled for removal (Bug WK 86941)
// and we will tolerate this null check until then.
diff --git a/Source/WebCore/svg/SVGTextElement.cpp b/Source/WebCore/svg/SVGTextElement.cpp
index ab8251a..cd9d0df 100644
--- a/Source/WebCore/svg/SVGTextElement.cpp
+++ b/Source/WebCore/svg/SVGTextElement.cpp
@@ -49,7 +49,7 @@
AffineTransform SVGTextElement::animatedLocalTransform() const
{
AffineTransform matrix;
- RenderStyle* style = renderer() ? renderer()->style() : 0;
+ RenderStyle* style = renderer() ? &renderer()->style() : nullptr;
// if CSS property was set, use that, otherwise fallback to attribute (if set)
if (style && style->hasTransform()) {
diff --git a/Source/WebCore/svg/graphics/SVGImage.cpp b/Source/WebCore/svg/graphics/SVGImage.cpp
index 4c5f5f1..b51403a 100644
--- a/Source/WebCore/svg/graphics/SVGImage.cpp
+++ b/Source/WebCore/svg/graphics/SVGImage.cpp
@@ -119,7 +119,7 @@
return containerSize;
// Assure that a container size is always given for a non-identity zoom level.
- ASSERT(renderer->style()->effectiveZoom() == 1);
+ ASSERT(renderer->style().effectiveZoom() == 1);
FloatSize currentSize;
if (rootElement->intrinsicWidth().isFixed() && rootElement->intrinsicHeight().isFixed())
diff --git a/Source/WebKit/mac/WebView/WebFrame.mm b/Source/WebKit/mac/WebView/WebFrame.mm
index 3ec692f..fbd13df 100644
--- a/Source/WebKit/mac/WebView/WebFrame.mm
+++ b/Source/WebKit/mac/WebView/WebFrame.mm
@@ -869,7 +869,7 @@
RenderObject* bodyRenderer = body->renderer();
if (!bodyRenderer)
return nil;
- Color color = bodyRenderer->style()->visitedDependentColor(CSSPropertyBackgroundColor);
+ Color color = bodyRenderer->style().visitedDependentColor(CSSPropertyBackgroundColor);
if (!color.isValid())
return nil;
return nsColor(color);
@@ -1256,8 +1256,8 @@
return [NSArray array];
const LayoutRect& documentRect = root->documentRect();
- float printWidth = root->style()->isHorizontalWritingMode() ? static_cast<float>(documentRect.width()) / printScaleFactor : pageSize.width;
- float printHeight = root->style()->isHorizontalWritingMode() ? pageSize.height : static_cast<float>(documentRect.height()) / printScaleFactor;
+ float printWidth = root->style().isHorizontalWritingMode() ? static_cast<float>(documentRect.width()) / printScaleFactor : pageSize.width;
+ float printHeight = root->style().isHorizontalWritingMode() ? pageSize.height : static_cast<float>(documentRect.height()) / printScaleFactor;
PrintContext printContext(_private->coreFrame);
printContext.computePageRectsWithPageSize(FloatSize(printWidth, printHeight), true);
diff --git a/Source/WebKit/mac/WebView/WebFrameView.mm b/Source/WebKit/mac/WebView/WebFrameView.mm
index f9fc139..ccb881f 100644
--- a/Source/WebKit/mac/WebView/WebFrameView.mm
+++ b/Source/WebKit/mac/WebView/WebFrameView.mm
@@ -575,7 +575,7 @@
RenderView* renderView = document->renderView();
if (!renderView)
return YES;
- return renderView->style()->isHorizontalWritingMode();
+ return renderView->style().isHorizontalWritingMode();
}
- (BOOL)_isFlippedDocument
@@ -589,7 +589,7 @@
RenderView* renderView = document->renderView();
if (!renderView)
return NO;
- return renderView->style()->isFlippedBlocksWritingMode();
+ return renderView->style().isFlippedBlocksWritingMode();
}
- (BOOL)_scrollToBeginningOfDocument
diff --git a/Source/WebKit/mac/WebView/WebHTMLRepresentation.mm b/Source/WebKit/mac/WebView/WebHTMLRepresentation.mm
index bc38086..d981cf4 100644
--- a/Source/WebKit/mac/WebView/WebHTMLRepresentation.mm
+++ b/Source/WebKit/mac/WebView/WebHTMLRepresentation.mm
@@ -458,7 +458,7 @@
return result;
}
searchedCellAbove = true;
- } else if (n->isTextNode() && n->renderer() && n->renderer()->style()->visibility() == VISIBLE) {
+ } else if (n->isTextNode() && n->renderer() && n->renderer()->style().visibility() == VISIBLE) {
// For each text chunk, run the regexp
String nodeString = n->nodeValue();
// add 100 for slop, to make it more likely that we'll search whole nodes
diff --git a/Source/WebKit/mac/WebView/WebHTMLView.mm b/Source/WebKit/mac/WebView/WebHTMLView.mm
index 40d1ac5..ea090d6 100644
--- a/Source/WebKit/mac/WebView/WebHTMLView.mm
+++ b/Source/WebKit/mac/WebView/WebHTMLView.mm
@@ -2152,7 +2152,7 @@
return NO;
Document* document = frame->document();
- bool isHorizontal = !document || !document->renderView() || document->renderView()->style()->isHorizontalWritingMode();
+ bool isHorizontal = !document || !document->renderView() || document->renderView()->style().isHorizontalWritingMode();
float pageLogicalWidth = isHorizontal ? pageWidth : pageHeight;
float pageLogicalHeight = isHorizontal ? pageHeight : pageWidth;
@@ -2188,7 +2188,7 @@
return NO;
Document* document = frame->document();
- bool isHorizontal = !document || !document->renderView() || document->renderView()->style()->isHorizontalWritingMode();
+ bool isHorizontal = !document || !document->renderView() || document->renderView()->style().isHorizontalWritingMode();
float pageLogicalWidth = isHorizontal ? pageSize.width : pageSize.height;
float pageLogicalHeight = isHorizontal ? pageSize.height : pageSize.width;
@@ -3029,7 +3029,7 @@
if (minPageLogicalWidth > 0.0) {
FloatSize pageSize(minPageLogicalWidth, minPageLogicalHeight);
FloatSize originalPageSize(originalPageWidth, originalPageHeight);
- if (coreFrame->document() && coreFrame->document()->renderView() && !coreFrame->document()->renderView()->style()->isHorizontalWritingMode()) {
+ if (coreFrame->document() && coreFrame->document()->renderView() && !coreFrame->document()->renderView()->style().isHorizontalWritingMode()) {
pageSize = FloatSize(minPageLogicalHeight, minPageLogicalWidth);
originalPageSize = FloatSize(originalPageHeight, originalPageWidth);
}
@@ -3972,7 +3972,7 @@
if (coreFrame) {
Document* document = coreFrame->document();
if (document && document->renderView())
- useViewWidth = document->renderView()->style()->isHorizontalWritingMode();
+ useViewWidth = document->renderView()->style().isHorizontalWritingMode();
}
float viewLogicalWidth = useViewWidth ? NSWidth([self bounds]) : NSHeight([self bounds]);
diff --git a/Source/WebKit/win/DOMCoreClasses.cpp b/Source/WebKit/win/DOMCoreClasses.cpp
index 49dd4d5..ccbd719 100644
--- a/Source/WebKit/win/DOMCoreClasses.cpp
+++ b/Source/WebKit/win/DOMCoreClasses.cpp
@@ -1254,7 +1254,7 @@
if (!renderer)
return E_FAIL;
- FontDescription fontDescription = renderer->style()->font().fontDescription();
+ FontDescription fontDescription = renderer->style().font().fontDescription();
AtomicString family = fontDescription.firstFamily();
webFontDescription->family = family.characters();
webFontDescription->familyLength = family.length();
diff --git a/Source/WebKit2/WebProcess/WebPage/TapHighlightController.cpp b/Source/WebKit2/WebProcess/WebPage/TapHighlightController.cpp
index 82c4d42..df9ab32 100644
--- a/Source/WebKit2/WebProcess/WebPage/TapHighlightController.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/TapHighlightController.cpp
@@ -58,7 +58,7 @@
ASSERT(node);
m_path = GestureTapHighlighter::pathForNodeHighlight(node);
- m_color = node->renderer()->style()->tapHighlightColor();
+ m_color = node->renderer()->style().tapHighlightColor();
if (!m_overlay) {
RefPtr<PageOverlay> overlay = PageOverlay::create(this);
diff --git a/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm b/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm
index ea80917..e37a4bc 100644
--- a/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm
+++ b/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm
@@ -568,7 +568,7 @@
return;
RenderObject* renderer = range->startContainer()->renderer();
- RenderStyle* style = renderer->style();
+ const RenderStyle& style = renderer->style();
Vector<FloatQuad> quads;
range->textQuads(quads);
@@ -578,7 +578,7 @@
IntRect rangeRect = frame->view()->contentsToWindow(quads[0].enclosingBoundingBox());
DictionaryPopupInfo dictionaryPopupInfo;
- dictionaryPopupInfo.origin = FloatPoint(rangeRect.x(), rangeRect.y() + (style->fontMetrics().ascent() * pageScaleFactor()));
+ dictionaryPopupInfo.origin = FloatPoint(rangeRect.x(), rangeRect.y() + (style.fontMetrics().ascent() * pageScaleFactor()));
dictionaryPopupInfo.options = (CFDictionaryRef)options;
NSAttributedString *nsAttributedString = [WebHTMLConverter editingAttributedStringFromRange:range];