Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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...
commit 903ca1ad4fd9159fe3464cd56851480df340c57a 1 parent 68634f6
commit-queue authored
39 Source/WebCore/ChangeLog
... ... @@ -1,3 +1,42 @@
  1 +2012-08-14 Nikhil Bhargava <nbhargava@google.com>
  2 +
  3 + De-inline stuff from RenderStyle.h
  4 + https://bugs.webkit.org/show_bug.cgi?id=94019
  5 +
  6 + Reviewed by Eric Seidel.
  7 +
  8 + De-inline things from RenderStyle.h in preparation of fixing a series of
  9 + errant includes.
  10 +
  11 + No new tests. Doesn't change functionality
  12 +
  13 + * WebCore.exp.in:
  14 + * rendering/style/RenderStyle.cpp:
  15 + (WebCore::RenderStyle::listStyleImage):
  16 + (WebCore::RenderStyle::setListStyleImage):
  17 + (WebCore):
  18 + (WebCore::RenderStyle::color):
  19 + (WebCore::RenderStyle::visitedLinkColor):
  20 + (WebCore::RenderStyle::setColor):
  21 + (WebCore::RenderStyle::setVisitedLinkColor):
  22 + (WebCore::RenderStyle::horizontalBorderSpacing):
  23 + (WebCore::RenderStyle::verticalBorderSpacing):
  24 + (WebCore::RenderStyle::setHorizontalBorderSpacing):
  25 + (WebCore::RenderStyle::setVerticalBorderSpacing):
  26 + (WebCore::RenderStyle::font):
  27 + (WebCore::RenderStyle::fontMetrics):
  28 + (WebCore::RenderStyle::fontDescription):
  29 + (WebCore::RenderStyle::fontSize):
  30 + (WebCore::RenderStyle::wordSpacing):
  31 + (WebCore::RenderStyle::letterSpacing):
  32 + (WebCore::RenderStyle::setFontDescription):
  33 + (WebCore::RenderStyle::lineHeight):
  34 + (WebCore::RenderStyle::setLineHeight):
  35 + (WebCore::RenderStyle::computedLineHeight):
  36 + (WebCore::RenderStyle::setWordSpacing):
  37 + (WebCore::RenderStyle::setLetterSpacing):
  38 + * rendering/style/RenderStyle.h:
  39 +
1 40 2012-08-14 Andrei Onea <onea@adobe.com>
2 41
3 42 [CSSRegions]Region overset property is incorectly computed when content has negative letter spacing and is flowed near to the edge of a region
2  Source/WebCore/WebCore.exp.in
@@ -1099,7 +1099,9 @@ __ZNK7WebCore11HistoryItem8referrerEv
1099 1099 __ZNK7WebCore11HistoryItem9urlStringEv
1100 1100 __ZNK7WebCore11HistoryItem9viewStateEv
1101 1101 __ZNK7WebCore11RenderLayer19absoluteBoundingBoxEv
  1102 +__ZNK7WebCore11RenderStyle11fontMetricsEv
1102 1103 __ZNK7WebCore11RenderStyle21visitedDependentColorEi
  1104 +__ZNK7WebCore11RenderStyle4fontEv
1103 1105 __ZNK7WebCore11ScriptValue9getStringEPN3JSC9ExecStateERN3WTF6StringE
1104 1106 __ZNK7WebCore12RenderObject14enclosingLayerEv
1105 1107 __ZNK7WebCore12RenderObject15localToAbsoluteERKNS_10FloatPointEbb
57 Source/WebCore/rendering/style/RenderStyle.cpp
@@ -942,6 +942,23 @@ static float calcConstraintScaleFor(const IntRect& rect, const RoundedRect::Radi
942 942 return factor;
943 943 }
944 944
  945 +StyleImage* RenderStyle::listStyleImage() const { return inherited->list_style_image.get(); }
  946 +void RenderStyle::setListStyleImage(PassRefPtr<StyleImage> v)
  947 +{
  948 + if (inherited->list_style_image != v)
  949 + inherited.access()->list_style_image = v;
  950 +}
  951 +
  952 +Color RenderStyle::color() const { return inherited->color; }
  953 +Color RenderStyle::visitedLinkColor() const { return inherited->visitedLinkColor; }
  954 +void RenderStyle::setColor(const Color& v) { SET_VAR(inherited, color, v) };
  955 +void RenderStyle::setVisitedLinkColor(const Color& v) { SET_VAR(inherited, visitedLinkColor, v) }
  956 +
  957 +short RenderStyle::horizontalBorderSpacing() const { return inherited->horizontal_border_spacing; }
  958 +short RenderStyle::verticalBorderSpacing() const { return inherited->vertical_border_spacing; }
  959 +void RenderStyle::setHorizontalBorderSpacing(short v) { SET_VAR(inherited, horizontal_border_spacing, v) }
  960 +void RenderStyle::setVerticalBorderSpacing(short v) { SET_VAR(inherited, vertical_border_spacing, v) }
  961 +
945 962 RoundedRect RenderStyle::getRoundedBorderFor(const LayoutRect& borderRect, RenderView* renderView, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const
946 963 {
947 964 IntRect snappedBorderRect(pixelSnappedIntRect(borderRect));
@@ -1164,6 +1181,46 @@ const Animation* RenderStyle::transitionForProperty(CSSPropertyID property) cons
1164 1181 return 0;
1165 1182 }
1166 1183
  1184 +const Font& RenderStyle::font() const { return inherited->font; }
  1185 +const FontMetrics& RenderStyle::fontMetrics() const { return inherited->font.fontMetrics(); }
  1186 +const FontDescription& RenderStyle::fontDescription() const { return inherited->font.fontDescription(); }
  1187 +int RenderStyle::fontSize() const { return inherited->font.pixelSize(); }
  1188 +
  1189 +int RenderStyle::wordSpacing() const { return inherited->font.wordSpacing(); }
  1190 +int RenderStyle::letterSpacing() const { return inherited->font.letterSpacing(); }
  1191 +
  1192 +bool RenderStyle::setFontDescription(const FontDescription& v)
  1193 +{
  1194 + if (inherited->font.fontDescription() != v) {
  1195 + inherited.access()->font = Font(v, inherited->font.letterSpacing(), inherited->font.wordSpacing());
  1196 + return true;
  1197 + }
  1198 + return false;
  1199 +}
  1200 +
  1201 +Length RenderStyle::lineHeight() const { return inherited->line_height; }
  1202 +void RenderStyle::setLineHeight(Length v) { SET_VAR(inherited, line_height, v); }
  1203 +
  1204 +int RenderStyle::computedLineHeight(RenderView* renderView) const
  1205 +{
  1206 + const Length& lh = inherited->line_height;
  1207 +
  1208 + // Negative value means the line height is not set. Use the font's built-in spacing.
  1209 + if (lh.isNegative())
  1210 + return fontMetrics().lineSpacing();
  1211 +
  1212 + if (lh.isPercent())
  1213 + return minimumValueForLength(lh, fontSize());
  1214 +
  1215 + if (lh.isViewportPercentage())
  1216 + return valueForLength(lh, 0, renderView);
  1217 +
  1218 + return lh.value();
  1219 +}
  1220 +
  1221 +void RenderStyle::setWordSpacing(int v) { inherited.access()->font.setWordSpacing(v); }
  1222 +void RenderStyle::setLetterSpacing(int v) { inherited.access()->font.setLetterSpacing(v); }
  1223 +
1167 1224 void RenderStyle::setBlendedFontSize(int size)
1168 1225 {
1169 1226 FontSelector* currentFontSelector = font().fontSelector();
66 Source/WebCore/rendering/style/RenderStyle.h
@@ -594,18 +594,18 @@ class RenderStyle: public RefCounted<RenderStyle> {
594 594 EClear clear() const { return static_cast<EClear>(noninherited_flags._clear); }
595 595 ETableLayout tableLayout() const { return static_cast<ETableLayout>(noninherited_flags._table_layout); }
596 596
597   - const Font& font() const { return inherited->font; }
598   - const FontMetrics& fontMetrics() const { return inherited->font.fontMetrics(); }
599   - const FontDescription& fontDescription() const { return inherited->font.fontDescription(); }
600   - int fontSize() const { return inherited->font.pixelSize(); }
  597 + const Font& font() const;
  598 + const FontMetrics& fontMetrics() const;
  599 + const FontDescription& fontDescription() const;
  600 + int fontSize() const;
601 601
602 602 Length textIndent() const { return rareInheritedData->indent; }
603 603 ETextAlign textAlign() const { return static_cast<ETextAlign>(inherited_flags._text_align); }
604 604 ETextTransform textTransform() const { return static_cast<ETextTransform>(inherited_flags._text_transform); }
605 605 ETextDecoration textDecorationsInEffect() const { return static_cast<ETextDecoration>(inherited_flags._text_decorations); }
606 606 ETextDecoration textDecoration() const { return static_cast<ETextDecoration>(visual->textDecoration); }
607   - int wordSpacing() const { return inherited->font.wordSpacing(); }
608   - int letterSpacing() const { return inherited->font.letterSpacing(); }
  607 + int wordSpacing() const;
  608 + int letterSpacing() const;
609 609
610 610 float zoom() const { return visual->m_zoom; }
611 611 float effectiveZoom() const { return rareInheritedData->m_effectiveZoom; }
@@ -613,23 +613,8 @@ class RenderStyle: public RefCounted<RenderStyle> {
613 613 TextDirection direction() const { return static_cast<TextDirection>(inherited_flags._direction); }
614 614 bool isLeftToRightDirection() const { return direction() == LTR; }
615 615
616   - Length lineHeight() const { return inherited->line_height; }
617   - int computedLineHeight(RenderView* renderView = 0) const
618   - {
619   - const Length& lh = inherited->line_height;
620   -
621   - // Negative value means the line height is not set. Use the font's built-in spacing.
622   - if (lh.isNegative())
623   - return fontMetrics().lineSpacing();
624   -
625   - if (lh.isPercent())
626   - return minimumValueForLength(lh, fontSize());
627   -
628   - if (lh.isViewportPercentage())
629   - return valueForLength(lh, 0, renderView);
630   -
631   - return lh.value();
632   - }
  616 + Length lineHeight() const;
  617 + int computedLineHeight(RenderView* = 0) const;
633 618
634 619 EWhiteSpace whiteSpace() const { return static_cast<EWhiteSpace>(inherited_flags._white_space); }
635 620 static bool autoWrap(EWhiteSpace ws)
@@ -717,8 +702,8 @@ class RenderStyle: public RefCounted<RenderStyle> {
717 702 StyleImage* maskBoxImageSource() const { return rareNonInheritedData->m_maskBoxImage.image(); }
718 703
719 704 EBorderCollapse borderCollapse() const { return static_cast<EBorderCollapse>(inherited_flags._border_collapse); }
720   - short horizontalBorderSpacing() const { return inherited->horizontal_border_spacing; }
721   - short verticalBorderSpacing() const { return inherited->vertical_border_spacing; }
  705 + short horizontalBorderSpacing() const;
  706 + short verticalBorderSpacing() const;
722 707 EEmptyCell emptyCells() const { return static_cast<EEmptyCell>(inherited_flags._empty_cells); }
723 708 ECaptionSide captionSide() const { return static_cast<ECaptionSide>(inherited_flags._caption_side); }
724 709
@@ -726,7 +711,7 @@ class RenderStyle: public RefCounted<RenderStyle> {
726 711 short counterReset() const { return rareNonInheritedData->m_counterReset; }
727 712
728 713 EListStyleType listStyleType() const { return static_cast<EListStyleType>(inherited_flags._list_style_type); }
729   - StyleImage* listStyleImage() const { return inherited->list_style_image.get(); }
  714 + StyleImage* listStyleImage() const;
730 715 EListStylePosition listStylePosition() const { return static_cast<EListStylePosition>(inherited_flags._list_style_position); }
731 716
732 717 Length marginTop() const { return surround->margin.top(); }
@@ -1116,19 +1101,12 @@ class RenderStyle: public RefCounted<RenderStyle> {
1116 1101 void setClear(EClear v) { noninherited_flags._clear = v; }
1117 1102 void setTableLayout(ETableLayout v) { noninherited_flags._table_layout = v; }
1118 1103
1119   - bool setFontDescription(const FontDescription& v)
1120   - {
1121   - if (inherited->font.fontDescription() != v) {
1122   - inherited.access()->font = Font(v, inherited->font.letterSpacing(), inherited->font.wordSpacing());
1123   - return true;
1124   - }
1125   - return false;
1126   - }
  1104 + bool setFontDescription(const FontDescription&);
1127 1105
1128 1106 // Only used for blending font sizes when animating, or MathML anonymous blocks.
1129 1107 void setBlendedFontSize(int);
1130 1108
1131   - void setColor(const Color& v) { SET_VAR(inherited, color, v) }
  1109 + void setColor(const Color&);
1132 1110 void setTextIndent(Length v) { SET_VAR(rareInheritedData, indent, v) }
1133 1111 void setTextAlign(ETextAlign v) { inherited_flags._text_align = v; }
1134 1112 void setTextTransform(ETextTransform v) { inherited_flags._text_transform = v; }
@@ -1136,7 +1114,7 @@ class RenderStyle: public RefCounted<RenderStyle> {
1136 1114 void setTextDecorationsInEffect(ETextDecoration v) { inherited_flags._text_decorations = v; }
1137 1115 void setTextDecoration(ETextDecoration v) { SET_VAR(visual, textDecoration, v); }
1138 1116 void setDirection(TextDirection v) { inherited_flags._direction = v; }
1139   - void setLineHeight(Length v) { SET_VAR(inherited, line_height, v) }
  1117 + void setLineHeight(Length);
1140 1118 bool setZoom(float);
1141 1119 void setZoomWithoutReturnValue(float f) { setZoom(f); }
1142 1120 bool setEffectiveZoom(float);
@@ -1155,8 +1133,8 @@ class RenderStyle: public RefCounted<RenderStyle> {
1155 1133
1156 1134 void setWhiteSpace(EWhiteSpace v) { inherited_flags._white_space = v; }
1157 1135
1158   - void setWordSpacing(int v) { inherited.access()->font.setWordSpacing(v); }
1159   - void setLetterSpacing(int v) { inherited.access()->font.setLetterSpacing(v); }
  1136 + void setWordSpacing(int);
  1137 + void setLetterSpacing(int);
1160 1138
1161 1139 void clearBackgroundLayers() { m_background.access()->m_background = FillLayer(BackgroundFillLayer); }
1162 1140 void inheritBackgroundLayers(const FillLayer& parent) { m_background.access()->m_background = parent; }
@@ -1189,8 +1167,8 @@ class RenderStyle: public RefCounted<RenderStyle> {
1189 1167 void setMaskSize(LengthSize l) { SET_VAR(rareNonInheritedData, m_mask.m_sizeLength, l) }
1190 1168
1191 1169 void setBorderCollapse(EBorderCollapse collapse) { inherited_flags._border_collapse = collapse; }
1192   - void setHorizontalBorderSpacing(short v) { SET_VAR(inherited, horizontal_border_spacing, v) }
1193   - void setVerticalBorderSpacing(short v) { SET_VAR(inherited, vertical_border_spacing, v) }
  1170 + void setHorizontalBorderSpacing(short);
  1171 + void setVerticalBorderSpacing(short);
1194 1172 void setEmptyCells(EEmptyCell v) { inherited_flags._empty_cells = v; }
1195 1173 void setCaptionSide(ECaptionSide v) { inherited_flags._caption_side = v; }
1196 1174
@@ -1201,7 +1179,7 @@ class RenderStyle: public RefCounted<RenderStyle> {
1201 1179 void setCounterReset(short v) { SET_VAR(rareNonInheritedData, m_counterReset, v) }
1202 1180
1203 1181 void setListStyleType(EListStyleType v) { inherited_flags._list_style_type = v; }
1204   - void setListStyleImage(PassRefPtr<StyleImage> v) { if (inherited->list_style_image != v) inherited.access()->list_style_image = v; }
  1182 + void setListStyleImage(PassRefPtr<StyleImage>);
1205 1183 void setListStylePosition(EListStylePosition v) { inherited_flags._list_style_position = v; }
1206 1184
1207 1185 void resetMargin() { SET_VAR(surround, margin, LengthBox(Fixed)) }
@@ -1713,7 +1691,7 @@ class RenderStyle: public RefCounted<RenderStyle> {
1713 1691 static const FilterOperations& initialFilter() { DEFINE_STATIC_LOCAL(FilterOperations, ops, ()); return ops; }
1714 1692 #endif
1715 1693 private:
1716   - void setVisitedLinkColor(const Color& v) { SET_VAR(inherited, visitedLinkColor, v) }
  1694 + void setVisitedLinkColor(const Color&);
1717 1695 void setVisitedLinkBackgroundColor(const Color& v) { SET_VAR(rareNonInheritedData, m_visitedLinkBackgroundColor, v) }
1718 1696 void setVisitedLinkBorderLeftColor(const Color& v) { SET_VAR(rareNonInheritedData, m_visitedLinkBorderLeftColor, v) }
1719 1697 void setVisitedLinkBorderRightColor(const Color& v) { SET_VAR(rareNonInheritedData, m_visitedLinkBorderRightColor, v) }
@@ -1759,13 +1737,13 @@ class RenderStyle: public RefCounted<RenderStyle> {
1759 1737 Color borderTopColor() const { return surround->border.top().color(); }
1760 1738 Color borderBottomColor() const { return surround->border.bottom().color(); }
1761 1739 Color backgroundColor() const { return m_background->color(); }
1762   - Color color() const { return inherited->color; }
  1740 + Color color() const;
1763 1741 Color columnRuleColor() const { return rareNonInheritedData->m_multiCol->m_rule.color(); }
1764 1742 Color outlineColor() const { return m_background->outline().color(); }
1765 1743 Color textEmphasisColor() const { return rareInheritedData->textEmphasisColor; }
1766 1744 Color textFillColor() const { return rareInheritedData->textFillColor; }
1767 1745 Color textStrokeColor() const { return rareInheritedData->textStrokeColor; }
1768   - Color visitedLinkColor() const { return inherited->visitedLinkColor; }
  1746 + Color visitedLinkColor() const;
1769 1747 Color visitedLinkBackgroundColor() const { return rareNonInheritedData->m_visitedLinkBackgroundColor; }
1770 1748 Color visitedLinkBorderLeftColor() const { return rareNonInheritedData->m_visitedLinkBorderLeftColor; }
1771 1749 Color visitedLinkBorderRightColor() const { return rareNonInheritedData->m_visitedLinkBorderRightColor; }

0 comments on commit 903ca1a

Please sign in to comment.
Something went wrong with that request. Please try again.