Permalink
Browse files

De-inline stuff from RenderStyle.h

https://bugs.webkit.org/show_bug.cgi?id=94019

Patch by Nikhil Bhargava <nbhargava@google.com> on 2012-08-14
Reviewed by Eric Seidel.

De-inline things from RenderStyle.h in preparation of fixing a series of
errant includes.

No new tests. Doesn't change functionality

* WebCore.exp.in:
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::listStyleImage):
(WebCore::RenderStyle::setListStyleImage):
(WebCore):
(WebCore::RenderStyle::color):
(WebCore::RenderStyle::visitedLinkColor):
(WebCore::RenderStyle::setColor):
(WebCore::RenderStyle::setVisitedLinkColor):
(WebCore::RenderStyle::horizontalBorderSpacing):
(WebCore::RenderStyle::verticalBorderSpacing):
(WebCore::RenderStyle::setHorizontalBorderSpacing):
(WebCore::RenderStyle::setVerticalBorderSpacing):
(WebCore::RenderStyle::font):
(WebCore::RenderStyle::fontMetrics):
(WebCore::RenderStyle::fontDescription):
(WebCore::RenderStyle::fontSize):
(WebCore::RenderStyle::wordSpacing):
(WebCore::RenderStyle::letterSpacing):
(WebCore::RenderStyle::setFontDescription):
(WebCore::RenderStyle::lineHeight):
(WebCore::RenderStyle::setLineHeight):
(WebCore::RenderStyle::computedLineHeight):
(WebCore::RenderStyle::setWordSpacing):
(WebCore::RenderStyle::setLetterSpacing):
* rendering/style/RenderStyle.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125612 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information...
1 parent 68634f6 commit 903ca1ad4fd9159fe3464cd56851480df340c57a commit-queue committed Aug 14, 2012
View
39 Source/WebCore/ChangeLog
@@ -1,3 +1,42 @@
+2012-08-14 Nikhil Bhargava <nbhargava@google.com>
+
+ De-inline stuff from RenderStyle.h
+ https://bugs.webkit.org/show_bug.cgi?id=94019
+
+ Reviewed by Eric Seidel.
+
+ De-inline things from RenderStyle.h in preparation of fixing a series of
+ errant includes.
+
+ No new tests. Doesn't change functionality
+
+ * WebCore.exp.in:
+ * rendering/style/RenderStyle.cpp:
+ (WebCore::RenderStyle::listStyleImage):
+ (WebCore::RenderStyle::setListStyleImage):
+ (WebCore):
+ (WebCore::RenderStyle::color):
+ (WebCore::RenderStyle::visitedLinkColor):
+ (WebCore::RenderStyle::setColor):
+ (WebCore::RenderStyle::setVisitedLinkColor):
+ (WebCore::RenderStyle::horizontalBorderSpacing):
+ (WebCore::RenderStyle::verticalBorderSpacing):
+ (WebCore::RenderStyle::setHorizontalBorderSpacing):
+ (WebCore::RenderStyle::setVerticalBorderSpacing):
+ (WebCore::RenderStyle::font):
+ (WebCore::RenderStyle::fontMetrics):
+ (WebCore::RenderStyle::fontDescription):
+ (WebCore::RenderStyle::fontSize):
+ (WebCore::RenderStyle::wordSpacing):
+ (WebCore::RenderStyle::letterSpacing):
+ (WebCore::RenderStyle::setFontDescription):
+ (WebCore::RenderStyle::lineHeight):
+ (WebCore::RenderStyle::setLineHeight):
+ (WebCore::RenderStyle::computedLineHeight):
+ (WebCore::RenderStyle::setWordSpacing):
+ (WebCore::RenderStyle::setLetterSpacing):
+ * rendering/style/RenderStyle.h:
+
2012-08-14 Andrei Onea <onea@adobe.com>
[CSSRegions]Region overset property is incorectly computed when content has negative letter spacing and is flowed near to the edge of a region
View
2 Source/WebCore/WebCore.exp.in
@@ -1099,7 +1099,9 @@ __ZNK7WebCore11HistoryItem8referrerEv
__ZNK7WebCore11HistoryItem9urlStringEv
__ZNK7WebCore11HistoryItem9viewStateEv
__ZNK7WebCore11RenderLayer19absoluteBoundingBoxEv
+__ZNK7WebCore11RenderStyle11fontMetricsEv
__ZNK7WebCore11RenderStyle21visitedDependentColorEi
+__ZNK7WebCore11RenderStyle4fontEv
__ZNK7WebCore11ScriptValue9getStringEPN3JSC9ExecStateERN3WTF6StringE
__ZNK7WebCore12RenderObject14enclosingLayerEv
__ZNK7WebCore12RenderObject15localToAbsoluteERKNS_10FloatPointEbb
View
57 Source/WebCore/rendering/style/RenderStyle.cpp
@@ -942,6 +942,23 @@ static float calcConstraintScaleFor(const IntRect& rect, const RoundedRect::Radi
return factor;
}
+StyleImage* RenderStyle::listStyleImage() const { return inherited->list_style_image.get(); }
+void RenderStyle::setListStyleImage(PassRefPtr<StyleImage> v)
+{
+ if (inherited->list_style_image != v)
+ inherited.access()->list_style_image = v;
+}
+
+Color RenderStyle::color() const { return inherited->color; }
+Color RenderStyle::visitedLinkColor() const { return inherited->visitedLinkColor; }
+void RenderStyle::setColor(const Color& v) { SET_VAR(inherited, color, v) };
+void RenderStyle::setVisitedLinkColor(const Color& v) { SET_VAR(inherited, visitedLinkColor, v) }
+
+short RenderStyle::horizontalBorderSpacing() const { return inherited->horizontal_border_spacing; }
+short RenderStyle::verticalBorderSpacing() const { return inherited->vertical_border_spacing; }
+void RenderStyle::setHorizontalBorderSpacing(short v) { SET_VAR(inherited, horizontal_border_spacing, v) }
+void RenderStyle::setVerticalBorderSpacing(short v) { SET_VAR(inherited, vertical_border_spacing, v) }
+
RoundedRect RenderStyle::getRoundedBorderFor(const LayoutRect& borderRect, RenderView* renderView, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const
{
IntRect snappedBorderRect(pixelSnappedIntRect(borderRect));
@@ -1164,6 +1181,46 @@ const Animation* RenderStyle::transitionForProperty(CSSPropertyID property) cons
return 0;
}
+const Font& RenderStyle::font() const { return inherited->font; }
+const FontMetrics& RenderStyle::fontMetrics() const { return inherited->font.fontMetrics(); }
+const FontDescription& RenderStyle::fontDescription() const { return inherited->font.fontDescription(); }
+int RenderStyle::fontSize() const { return inherited->font.pixelSize(); }
+
+int RenderStyle::wordSpacing() const { return inherited->font.wordSpacing(); }
+int RenderStyle::letterSpacing() const { return inherited->font.letterSpacing(); }
+
+bool RenderStyle::setFontDescription(const FontDescription& v)
+{
+ if (inherited->font.fontDescription() != v) {
+ inherited.access()->font = Font(v, inherited->font.letterSpacing(), inherited->font.wordSpacing());
+ return true;
+ }
+ return false;
+}
+
+Length RenderStyle::lineHeight() const { return inherited->line_height; }
+void RenderStyle::setLineHeight(Length v) { SET_VAR(inherited, line_height, v); }
+
+int RenderStyle::computedLineHeight(RenderView* renderView) const
+{
+ const Length& lh = inherited->line_height;
+
+ // Negative value means the line height is not set. Use the font's built-in spacing.
+ if (lh.isNegative())
+ return fontMetrics().lineSpacing();
+
+ if (lh.isPercent())
+ return minimumValueForLength(lh, fontSize());
+
+ if (lh.isViewportPercentage())
+ return valueForLength(lh, 0, renderView);
+
+ return lh.value();
+}
+
+void RenderStyle::setWordSpacing(int v) { inherited.access()->font.setWordSpacing(v); }
+void RenderStyle::setLetterSpacing(int v) { inherited.access()->font.setLetterSpacing(v); }
+
void RenderStyle::setBlendedFontSize(int size)
{
FontSelector* currentFontSelector = font().fontSelector();
View
66 Source/WebCore/rendering/style/RenderStyle.h
@@ -594,42 +594,27 @@ class RenderStyle: public RefCounted<RenderStyle> {
EClear clear() const { return static_cast<EClear>(noninherited_flags._clear); }
ETableLayout tableLayout() const { return static_cast<ETableLayout>(noninherited_flags._table_layout); }
- const Font& font() const { return inherited->font; }
- const FontMetrics& fontMetrics() const { return inherited->font.fontMetrics(); }
- const FontDescription& fontDescription() const { return inherited->font.fontDescription(); }
- int fontSize() const { return inherited->font.pixelSize(); }
+ const Font& font() const;
+ const FontMetrics& fontMetrics() const;
+ const FontDescription& fontDescription() const;
+ int fontSize() const;
Length textIndent() const { return rareInheritedData->indent; }
ETextAlign textAlign() const { return static_cast<ETextAlign>(inherited_flags._text_align); }
ETextTransform textTransform() const { return static_cast<ETextTransform>(inherited_flags._text_transform); }
ETextDecoration textDecorationsInEffect() const { return static_cast<ETextDecoration>(inherited_flags._text_decorations); }
ETextDecoration textDecoration() const { return static_cast<ETextDecoration>(visual->textDecoration); }
- int wordSpacing() const { return inherited->font.wordSpacing(); }
- int letterSpacing() const { return inherited->font.letterSpacing(); }
+ int wordSpacing() const;
+ int letterSpacing() const;
float zoom() const { return visual->m_zoom; }
float effectiveZoom() const { return rareInheritedData->m_effectiveZoom; }
TextDirection direction() const { return static_cast<TextDirection>(inherited_flags._direction); }
bool isLeftToRightDirection() const { return direction() == LTR; }
- Length lineHeight() const { return inherited->line_height; }
- int computedLineHeight(RenderView* renderView = 0) const
- {
- const Length& lh = inherited->line_height;
-
- // Negative value means the line height is not set. Use the font's built-in spacing.
- if (lh.isNegative())
- return fontMetrics().lineSpacing();
-
- if (lh.isPercent())
- return minimumValueForLength(lh, fontSize());
-
- if (lh.isViewportPercentage())
- return valueForLength(lh, 0, renderView);
-
- return lh.value();
- }
+ Length lineHeight() const;
+ int computedLineHeight(RenderView* = 0) const;
EWhiteSpace whiteSpace() const { return static_cast<EWhiteSpace>(inherited_flags._white_space); }
static bool autoWrap(EWhiteSpace ws)
@@ -717,16 +702,16 @@ class RenderStyle: public RefCounted<RenderStyle> {
StyleImage* maskBoxImageSource() const { return rareNonInheritedData->m_maskBoxImage.image(); }
EBorderCollapse borderCollapse() const { return static_cast<EBorderCollapse>(inherited_flags._border_collapse); }
- short horizontalBorderSpacing() const { return inherited->horizontal_border_spacing; }
- short verticalBorderSpacing() const { return inherited->vertical_border_spacing; }
+ short horizontalBorderSpacing() const;
+ short verticalBorderSpacing() const;
EEmptyCell emptyCells() const { return static_cast<EEmptyCell>(inherited_flags._empty_cells); }
ECaptionSide captionSide() const { return static_cast<ECaptionSide>(inherited_flags._caption_side); }
short counterIncrement() const { return rareNonInheritedData->m_counterIncrement; }
short counterReset() const { return rareNonInheritedData->m_counterReset; }
EListStyleType listStyleType() const { return static_cast<EListStyleType>(inherited_flags._list_style_type); }
- StyleImage* listStyleImage() const { return inherited->list_style_image.get(); }
+ StyleImage* listStyleImage() const;
EListStylePosition listStylePosition() const { return static_cast<EListStylePosition>(inherited_flags._list_style_position); }
Length marginTop() const { return surround->margin.top(); }
@@ -1116,27 +1101,20 @@ class RenderStyle: public RefCounted<RenderStyle> {
void setClear(EClear v) { noninherited_flags._clear = v; }
void setTableLayout(ETableLayout v) { noninherited_flags._table_layout = v; }
- bool setFontDescription(const FontDescription& v)
- {
- if (inherited->font.fontDescription() != v) {
- inherited.access()->font = Font(v, inherited->font.letterSpacing(), inherited->font.wordSpacing());
- return true;
- }
- return false;
- }
+ bool setFontDescription(const FontDescription&);
// Only used for blending font sizes when animating, or MathML anonymous blocks.
void setBlendedFontSize(int);
- void setColor(const Color& v) { SET_VAR(inherited, color, v) }
+ void setColor(const Color&);
void setTextIndent(Length v) { SET_VAR(rareInheritedData, indent, v) }
void setTextAlign(ETextAlign v) { inherited_flags._text_align = v; }
void setTextTransform(ETextTransform v) { inherited_flags._text_transform = v; }
void addToTextDecorationsInEffect(ETextDecoration v) { inherited_flags._text_decorations |= v; }
void setTextDecorationsInEffect(ETextDecoration v) { inherited_flags._text_decorations = v; }
void setTextDecoration(ETextDecoration v) { SET_VAR(visual, textDecoration, v); }
void setDirection(TextDirection v) { inherited_flags._direction = v; }
- void setLineHeight(Length v) { SET_VAR(inherited, line_height, v) }
+ void setLineHeight(Length);
bool setZoom(float);
void setZoomWithoutReturnValue(float f) { setZoom(f); }
bool setEffectiveZoom(float);
@@ -1155,8 +1133,8 @@ class RenderStyle: public RefCounted<RenderStyle> {
void setWhiteSpace(EWhiteSpace v) { inherited_flags._white_space = v; }
- void setWordSpacing(int v) { inherited.access()->font.setWordSpacing(v); }
- void setLetterSpacing(int v) { inherited.access()->font.setLetterSpacing(v); }
+ void setWordSpacing(int);
+ void setLetterSpacing(int);
void clearBackgroundLayers() { m_background.access()->m_background = FillLayer(BackgroundFillLayer); }
void inheritBackgroundLayers(const FillLayer& parent) { m_background.access()->m_background = parent; }
@@ -1189,8 +1167,8 @@ class RenderStyle: public RefCounted<RenderStyle> {
void setMaskSize(LengthSize l) { SET_VAR(rareNonInheritedData, m_mask.m_sizeLength, l) }
void setBorderCollapse(EBorderCollapse collapse) { inherited_flags._border_collapse = collapse; }
- void setHorizontalBorderSpacing(short v) { SET_VAR(inherited, horizontal_border_spacing, v) }
- void setVerticalBorderSpacing(short v) { SET_VAR(inherited, vertical_border_spacing, v) }
+ void setHorizontalBorderSpacing(short);
+ void setVerticalBorderSpacing(short);
void setEmptyCells(EEmptyCell v) { inherited_flags._empty_cells = v; }
void setCaptionSide(ECaptionSide v) { inherited_flags._caption_side = v; }
@@ -1201,7 +1179,7 @@ class RenderStyle: public RefCounted<RenderStyle> {
void setCounterReset(short v) { SET_VAR(rareNonInheritedData, m_counterReset, v) }
void setListStyleType(EListStyleType v) { inherited_flags._list_style_type = v; }
- void setListStyleImage(PassRefPtr<StyleImage> v) { if (inherited->list_style_image != v) inherited.access()->list_style_image = v; }
+ void setListStyleImage(PassRefPtr<StyleImage>);
void setListStylePosition(EListStylePosition v) { inherited_flags._list_style_position = v; }
void resetMargin() { SET_VAR(surround, margin, LengthBox(Fixed)) }
@@ -1713,7 +1691,7 @@ class RenderStyle: public RefCounted<RenderStyle> {
static const FilterOperations& initialFilter() { DEFINE_STATIC_LOCAL(FilterOperations, ops, ()); return ops; }
#endif
private:
- void setVisitedLinkColor(const Color& v) { SET_VAR(inherited, visitedLinkColor, v) }
+ void setVisitedLinkColor(const Color&);
void setVisitedLinkBackgroundColor(const Color& v) { SET_VAR(rareNonInheritedData, m_visitedLinkBackgroundColor, v) }
void setVisitedLinkBorderLeftColor(const Color& v) { SET_VAR(rareNonInheritedData, m_visitedLinkBorderLeftColor, v) }
void setVisitedLinkBorderRightColor(const Color& v) { SET_VAR(rareNonInheritedData, m_visitedLinkBorderRightColor, v) }
@@ -1759,13 +1737,13 @@ class RenderStyle: public RefCounted<RenderStyle> {
Color borderTopColor() const { return surround->border.top().color(); }
Color borderBottomColor() const { return surround->border.bottom().color(); }
Color backgroundColor() const { return m_background->color(); }
- Color color() const { return inherited->color; }
+ Color color() const;
Color columnRuleColor() const { return rareNonInheritedData->m_multiCol->m_rule.color(); }
Color outlineColor() const { return m_background->outline().color(); }
Color textEmphasisColor() const { return rareInheritedData->textEmphasisColor; }
Color textFillColor() const { return rareInheritedData->textFillColor; }
Color textStrokeColor() const { return rareInheritedData->textStrokeColor; }
- Color visitedLinkColor() const { return inherited->visitedLinkColor; }
+ Color visitedLinkColor() const;
Color visitedLinkBackgroundColor() const { return rareNonInheritedData->m_visitedLinkBackgroundColor; }
Color visitedLinkBorderLeftColor() const { return rareNonInheritedData->m_visitedLinkBorderLeftColor; }
Color visitedLinkBorderRightColor() const { return rareNonInheritedData->m_visitedLinkBorderRightColor; }

0 comments on commit 903ca1a

Please sign in to comment.