Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (97045 => 97046)
--- trunk/Source/_javascript_Core/ChangeLog 2011-10-10 07:50:48 UTC (rev 97045)
+++ trunk/Source/_javascript_Core/ChangeLog 2011-10-10 09:03:28 UTC (rev 97046)
@@ -1,3 +1,14 @@
+2011-10-10 Sheriff Bot <webkit.review....@gmail.com>
+
+ Unreviewed, rolling out r97045.
+ http://trac.webkit.org/changeset/97045
+ https://bugs.webkit.org/show_bug.cgi?id=69746
+
+ makes apple bots very crashy :( (Requested by kling on
+ #webkit).
+
+ * config.h:
+
2011-10-10 Andreas Kling <kl...@webkit.org>
Shrink BorderValue.
Modified: trunk/Source/_javascript_Core/config.h (97045 => 97046)
--- trunk/Source/_javascript_Core/config.h 2011-10-10 07:50:48 UTC (rev 97045)
+++ trunk/Source/_javascript_Core/config.h 2011-10-10 09:03:28 UTC (rev 97046)
@@ -109,7 +109,7 @@
// this breaks compilation of <QFontDatabase>, at least, so turn it off for now
// Also generates errors on wx on Windows and QNX, because these functions
-// are used from wx and QNX headers.
+// are used from wx and QNX headers.
#if !PLATFORM(QT) && !PLATFORM(WX) && !OS(QNX)
#include <wtf/DisallowCType.h>
#endif
Modified: trunk/Source/WebCore/ChangeLog (97045 => 97046)
--- trunk/Source/WebCore/ChangeLog 2011-10-10 07:50:48 UTC (rev 97045)
+++ trunk/Source/WebCore/ChangeLog 2011-10-10 09:03:28 UTC (rev 97046)
@@ -1,3 +1,51 @@
+2011-10-10 Sheriff Bot <webkit.review....@gmail.com>
+
+ Unreviewed, rolling out r97045.
+ http://trac.webkit.org/changeset/97045
+ https://bugs.webkit.org/show_bug.cgi?id=69746
+
+ makes apple bots very crashy :( (Requested by kling on
+ #webkit).
+
+ * css/CSSStyleApplyProperty.cpp:
+ (WebCore::ApplyPropertyColor::applyInheritValue):
+ * page/animation/AnimationBase.cpp:
+ (WebCore::PropertyWrapperMaybeInvalidColor::PropertyWrapperMaybeInvalidColor):
+ (WebCore::PropertyWrapperSVGPaint::PropertyWrapperSVGPaint):
+ (WebCore::AnimationBase::ensurePropertyMap):
+ * platform/graphics/Color.h:
+ (WebCore::Color::Color):
+ * rendering/style/BorderValue.h:
+ (WebCore::BorderValue::BorderValue):
+ (WebCore::BorderValue::isTransparent):
+ (WebCore::BorderValue::operator==):
+ (WebCore::BorderValue::color):
+ * rendering/style/OutlineValue.h:
+ (WebCore::OutlineValue::operator==):
+ * rendering/style/RenderStyle.h:
+ (WebCore::InheritedFlags::setBorderLeftColor):
+ (WebCore::InheritedFlags::setBorderRightColor):
+ (WebCore::InheritedFlags::setBorderTopColor):
+ (WebCore::InheritedFlags::setBorderBottomColor):
+ (WebCore::InheritedFlags::setOutlineColor):
+ (WebCore::InheritedFlags::setColumnRuleColor):
+ (WebCore::InheritedFlags::fillPaintColor):
+ (WebCore::InheritedFlags::strokePaintColor):
+ (WebCore::InheritedFlags::borderLeftColor):
+ (WebCore::InheritedFlags::borderRightColor):
+ (WebCore::InheritedFlags::borderTopColor):
+ (WebCore::InheritedFlags::borderBottomColor):
+ (WebCore::InheritedFlags::backgroundColor):
+ (WebCore::InheritedFlags::color):
+ (WebCore::InheritedFlags::columnRuleColor):
+ (WebCore::InheritedFlags::outlineColor):
+ (WebCore::InheritedFlags::textEmphasisColor):
+ (WebCore::InheritedFlags::textFillColor):
+ (WebCore::InheritedFlags::textStrokeColor):
+ (WebCore::InheritedFlags::stopColor):
+ (WebCore::InheritedFlags::floodColor):
+ (WebCore::InheritedFlags::lightingColor):
+
2011-10-06 Andreas Kling <kl...@webkit.org>
Shrink BorderValue.
Modified: trunk/Source/WebCore/css/CSSStyleApplyProperty.cpp (97045 => 97046)
--- trunk/Source/WebCore/css/CSSStyleApplyProperty.cpp 2011-10-10 07:50:48 UTC (rev 97045)
+++ trunk/Source/WebCore/css/CSSStyleApplyProperty.cpp 2011-10-10 09:03:28 UTC (rev 97046)
@@ -219,9 +219,9 @@
template <ColorInherit inheritColorFromParent>
class ApplyPropertyColor : public ApplyPropertyBase {
public:
- typedef Color (RenderStyle::*GetterFunction)() const;
+ typedef const Color& (RenderStyle::*GetterFunction)() const;
typedef void (RenderStyle::*SetterFunction)(const Color&);
- typedef Color (RenderStyle::*DefaultFunction)() const;
+ typedef const Color& (RenderStyle::*DefaultFunction)() const;
typedef Color (*InitialFunction)();
ApplyPropertyColor(GetterFunction getter, SetterFunction setter, DefaultFunction defaultFunction, InitialFunction initialFunction = 0)
@@ -235,7 +235,7 @@
private:
virtual void applyInheritValue(CSSStyleSelector* selector) const
{
- const Color color = (selector->parentStyle()->*m_getter)();
+ const Color& color = (selector->parentStyle()->*m_getter)();
if (m_default && !color.isValid())
(selector->style()->*m_setter)((selector->parentStyle()->*m_default)());
else
Modified: trunk/Source/WebCore/page/animation/AnimationBase.cpp (97045 => 97046)
--- trunk/Source/WebCore/page/animation/AnimationBase.cpp 2011-10-10 07:50:48 UTC (rev 97045)
+++ trunk/Source/WebCore/page/animation/AnimationBase.cpp 2011-10-10 09:03:28 UTC (rev 97046)
@@ -295,23 +295,6 @@
void (RenderStyle::*m_setter)(T);
};
-class PropertyWrapperColor : public PropertyWrapperGetter<Color> {
-public:
- PropertyWrapperColor(int prop, Color (RenderStyle::*getter)() const, void (RenderStyle::*setter)(const Color&))
- : PropertyWrapperGetter<Color>(prop, getter)
- , m_setter(setter)
- {
- }
-
- virtual void blend(const AnimationBase* anim, RenderStyle* dst, const RenderStyle* a, const RenderStyle* b, double progress) const
- {
- (dst->*m_setter)(blendFunc(anim, (a->*PropertyWrapperGetter<Color>::m_getter)(), (b->*PropertyWrapperGetter<Color>::m_getter)(), progress));
- }
-
-protected:
- void (RenderStyle::*m_setter)(const Color&);
-};
-
#if USE(ACCELERATED_COMPOSITING)
class PropertyWrapperAcceleratedOpacity : public PropertyWrapper<float> {
public:
@@ -487,7 +470,7 @@
class PropertyWrapperMaybeInvalidColor : public PropertyWrapperBase {
public:
- PropertyWrapperMaybeInvalidColor(int prop, Color (RenderStyle::*getter)() const, void (RenderStyle::*setter)(const Color&))
+ PropertyWrapperMaybeInvalidColor(int prop, const Color& (RenderStyle::*getter)() const, void (RenderStyle::*setter)(const Color&))
: PropertyWrapperBase(prop)
, m_getter(getter)
, m_setter(setter)
@@ -526,7 +509,7 @@
}
private:
- Color (RenderStyle::*m_getter)() const;
+ const Color& (RenderStyle::*m_getter)() const;
void (RenderStyle::*m_setter)(const Color&);
};
@@ -690,7 +673,7 @@
#if ENABLE(SVG)
class PropertyWrapperSVGPaint : public PropertyWrapperBase {
public:
- PropertyWrapperSVGPaint(int prop, const SVGPaint::SVGPaintType& (RenderStyle::*paintTypeGetter)() const, Color (RenderStyle::*getter)() const, void (RenderStyle::*setter)(const Color&))
+ PropertyWrapperSVGPaint(int prop, const SVGPaint::SVGPaintType& (RenderStyle::*paintTypeGetter)() const, const Color& (RenderStyle::*getter)() const, void (RenderStyle::*setter)(const Color&))
: PropertyWrapperBase(prop)
, m_paintTypeGetter(paintTypeGetter)
, m_getter(getter)
@@ -744,7 +727,7 @@
private:
const SVGPaint::SVGPaintType& (RenderStyle::*m_paintTypeGetter)() const;
- Color (RenderStyle::*m_getter)() const;
+ const Color& (RenderStyle::*m_getter)() const;
void (RenderStyle::*m_setter)(const Color&);
};
#endif
@@ -787,9 +770,9 @@
gPropertyWrappers->append(new PropertyWrapper<Length>(CSSPropertyPaddingRight, &RenderStyle::paddingRight, &RenderStyle::setPaddingRight));
gPropertyWrappers->append(new PropertyWrapper<Length>(CSSPropertyPaddingTop, &RenderStyle::paddingTop, &RenderStyle::setPaddingTop));
gPropertyWrappers->append(new PropertyWrapper<Length>(CSSPropertyPaddingBottom, &RenderStyle::paddingBottom, &RenderStyle::setPaddingBottom));
- gPropertyWrappers->append(new PropertyWrapperColor(CSSPropertyColor, &RenderStyle::color, &RenderStyle::setColor));
+ gPropertyWrappers->append(new PropertyWrapper<const Color&>(CSSPropertyColor, &RenderStyle::color, &RenderStyle::setColor));
- gPropertyWrappers->append(new PropertyWrapperColor(CSSPropertyBackgroundColor, &RenderStyle::backgroundColor, &RenderStyle::setBackgroundColor));
+ gPropertyWrappers->append(new PropertyWrapper<const Color&>(CSSPropertyBackgroundColor, &RenderStyle::backgroundColor, &RenderStyle::setBackgroundColor));
gPropertyWrappers->append(new FillLayersPropertyWrapper(CSSPropertyBackgroundPositionX, &RenderStyle::backgroundLayers, &RenderStyle::accessBackgroundLayers));
gPropertyWrappers->append(new FillLayersPropertyWrapper(CSSPropertyBackgroundPositionY, &RenderStyle::backgroundLayers, &RenderStyle::accessBackgroundLayers));
Modified: trunk/Source/WebCore/platform/graphics/Color.h (97045 => 97046)
--- trunk/Source/WebCore/platform/graphics/Color.h 2011-10-10 07:50:48 UTC (rev 97045)
+++ trunk/Source/WebCore/platform/graphics/Color.h 2011-10-10 09:03:28 UTC (rev 97046)
@@ -78,7 +78,7 @@
WTF_MAKE_FAST_ALLOCATED;
public:
Color() : m_color(0), m_valid(false) { }
- Color(RGBA32 color, bool valid = true) : m_color(color), m_valid(valid) { ASSERT(m_valid || !m_color); }
+ Color(RGBA32 col) : m_color(col), m_valid(true) { }
Color(int r, int g, int b) : m_color(makeRGB(r, g, b)), m_valid(true) { }
Color(int r, int g, int b, int a) : m_color(makeRGBA(r, g, b, a)), m_valid(true) { }
// Color is currently limited to 32bit RGBA, perhaps some day we'll support better colors
Modified: trunk/Source/WebCore/rendering/style/BorderValue.h (97045 => 97046)
--- trunk/Source/WebCore/rendering/style/BorderValue.h 2011-10-10 07:50:48 UTC (rev 97045)
+++ trunk/Source/WebCore/rendering/style/BorderValue.h 2011-10-10 09:03:28 UTC (rev 97046)
@@ -34,9 +34,7 @@
friend class RenderStyle;
public:
BorderValue()
- : m_rgba(0)
- , m_validColor(false)
- , m_width(3)
+ : m_width(3)
, m_style(BNONE)
, m_isAuto(AUTO_OFF)
{
@@ -49,7 +47,7 @@
bool isTransparent() const
{
- return m_validColor && !alphaChannel(m_rgba);
+ return m_color.isValid() && !m_color.alpha();
}
bool isVisible(bool checkStyle = true) const
@@ -59,7 +57,7 @@
bool operator==(const BorderValue& o) const
{
- return m_width == o.m_width && m_style == o.m_style && color() == o.color();
+ return m_width == o.m_width && m_style == o.m_style && m_color == o.m_color;
}
bool operator!=(const BorderValue& o) const
@@ -67,23 +65,12 @@
return !(*this == o);
}
- void setColor(const Color& color)
- {
- m_rgba = color.rgb();
- m_validColor = color.isValid();
- }
- Color color() const { return Color(m_rgba, m_validColor); }
-
+ const Color& color() const { return m_color; }
unsigned short width() const { return m_width; }
EBorderStyle style() const { return static_cast<EBorderStyle>(m_style); }
-private:
- // Instead of using the Color class here, we "unroll" its members onto BorderValue
- // to maximize struct packing. Use accessors to read/write.
- RGBA32 m_rgba;
- bool m_validColor : 1;
-
protected:
+ Color m_color;
unsigned m_width : 12;
unsigned m_style : 4; // EBorderStyle
Modified: trunk/Source/WebCore/rendering/style/OutlineValue.h (97045 => 97046)
--- trunk/Source/WebCore/rendering/style/OutlineValue.h 2011-10-10 07:50:48 UTC (rev 97045)
+++ trunk/Source/WebCore/rendering/style/OutlineValue.h 2011-10-10 09:03:28 UTC (rev 97046)
@@ -39,7 +39,7 @@
bool operator==(const OutlineValue& o) const
{
- return m_width == o.m_width && m_style == o.m_style && color() == o.color() && m_offset == o.m_offset && m_isAuto == o.m_isAuto;
+ return m_width == o.m_width && m_style == o.m_style && m_color == o.m_color && m_offset == o.m_offset && m_isAuto == o.m_isAuto;
}
bool operator!=(const OutlineValue& o) const
Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (97045 => 97046)
--- trunk/Source/WebCore/rendering/style/RenderStyle.h 2011-10-10 07:50:48 UTC (rev 97045)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h 2011-10-10 09:03:28 UTC (rev 97046)
@@ -95,10 +95,6 @@
if (!compareEqual(group->variable, value)) \
group.access()->variable = value;
-#define SET_BORDERVALUE_COLOR(group, variable, value) \
- if (!compareEqual(group->variable.color(), value)) \
- group.access()->variable.setColor(value);
-
namespace WebCore {
using std::max;
@@ -948,21 +944,21 @@
void setBorderLeftWidth(unsigned short v) { SET_VAR(surround, border.m_left.m_width, v) }
void setBorderLeftStyle(EBorderStyle v) { SET_VAR(surround, border.m_left.m_style, v) }
- void setBorderLeftColor(const Color& v) { SET_BORDERVALUE_COLOR(surround, border.m_left, v); }
+ void setBorderLeftColor(const Color& v) { SET_VAR(surround, border.m_left.m_color, v) }
void setBorderRightWidth(unsigned short v) { SET_VAR(surround, border.m_right.m_width, v) }
void setBorderRightStyle(EBorderStyle v) { SET_VAR(surround, border.m_right.m_style, v) }
- void setBorderRightColor(const Color& v) { SET_BORDERVALUE_COLOR(surround, border.m_right, v); }
+ void setBorderRightColor(const Color& v) { SET_VAR(surround, border.m_right.m_color, v) }
void setBorderTopWidth(unsigned short v) { SET_VAR(surround, border.m_top.m_width, v) }
void setBorderTopStyle(EBorderStyle v) { SET_VAR(surround, border.m_top.m_style, v) }
- void setBorderTopColor(const Color& v) { SET_BORDERVALUE_COLOR(surround, border.m_top, v) }
+ void setBorderTopColor(const Color& v) { SET_VAR(surround, border.m_top.m_color, v) }
void setBorderBottomWidth(unsigned short v) { SET_VAR(surround, border.m_bottom.m_width, v) }
void setBorderBottomStyle(EBorderStyle v) { SET_VAR(surround, border.m_bottom.m_style, v) }
- void setBorderBottomColor(const Color& v) { SET_BORDERVALUE_COLOR(surround, border.m_bottom, v) }
+ void setBorderBottomColor(const Color& v) { SET_VAR(surround, border.m_bottom.m_color, v) }
void setOutlineWidth(unsigned short v) { SET_VAR(m_background, m_outline.m_width, v) }
void setOutlineStyleIsAuto(OutlineIsAuto isAuto) { SET_VAR(m_background, m_outline.m_isAuto, isAuto) }
void setOutlineStyle(EBorderStyle v) { SET_VAR(m_background, m_outline.m_style, v) }
- void setOutlineColor(const Color& v) { SET_BORDERVALUE_COLOR(m_background, m_outline, v) }
+ void setOutlineColor(const Color& v) { SET_VAR(m_background, m_outline.m_color, v) }
void setOverflowX(EOverflow v) { noninherited_flags._overflowX = v; }
void setOverflowY(EOverflow v) { noninherited_flags._overflowY = v; }
@@ -1155,7 +1151,7 @@
void setHasAutoColumnCount() { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_autoCount, true); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_count, 0); }
void setColumnGap(float f) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_normalGap, false); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_gap, f); }
void setHasNormalColumnGap() { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_normalGap, true); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_gap, 0); }
- void setColumnRuleColor(const Color& c) { SET_BORDERVALUE_COLOR(rareNonInheritedData.access()->m_multiCol, m_rule, c); }
+ void setColumnRuleColor(const Color& c) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_rule.m_color, c); }
void setColumnRuleStyle(EBorderStyle b) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_rule.m_style, b); }
void setColumnRuleWidth(unsigned short w) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_rule.m_width, w); }
void resetColumnRule() { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_rule, BorderValue()) }
@@ -1235,13 +1231,13 @@
SVGRenderStyle* accessSVGStyle() { return m_svgStyle.access(); }
const SVGPaint::SVGPaintType& fillPaintType() const { return svgStyle()->fillPaintType(); }
- Color fillPaintColor() const { return svgStyle()->fillPaintColor(); }
+ const Color& fillPaintColor() const { return svgStyle()->fillPaintColor(); }
void setFillPaintColor(const Color& c) { accessSVGStyle()->setFillPaint(SVGPaint::SVG_PAINTTYPE_RGBCOLOR, c, ""); }
float fillOpacity() const { return svgStyle()->fillOpacity(); }
void setFillOpacity(float f) { accessSVGStyle()->setFillOpacity(f); }
const SVGPaint::SVGPaintType& strokePaintType() const { return svgStyle()->strokePaintType(); }
- Color strokePaintColor() const { return svgStyle()->strokePaintColor(); }
+ const Color& strokePaintColor() const { return svgStyle()->strokePaintColor(); }
void setStrokePaintColor(const Color& c) { accessSVGStyle()->setStrokePaint(SVGPaint::SVG_PAINTTYPE_RGBCOLOR, c, ""); }
float strokeOpacity() const { return svgStyle()->strokeOpacity(); }
void setStrokeOpacity(float f) { accessSVGStyle()->setStrokeOpacity(f); }
@@ -1513,24 +1509,24 @@
}
// Color accessors are all private to make sure callers use visitedDependentColor instead to access them.
- Color borderLeftColor() const { return surround->border.left().color(); }
- Color borderRightColor() const { return surround->border.right().color(); }
- 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 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; }
+ const Color& borderLeftColor() const { return surround->border.left().color(); }
+ const Color& borderRightColor() const { return surround->border.right().color(); }
+ const Color& borderTopColor() const { return surround->border.top().color(); }
+ const Color& borderBottomColor() const { return surround->border.bottom().color(); }
+ const Color& backgroundColor() const { return m_background->color(); }
+ const Color& color() const { return inherited->color; }
+ const Color& columnRuleColor() const { return rareNonInheritedData->m_multiCol->m_rule.color(); }
+ const Color& outlineColor() const { return m_background->outline().color(); }
+ const Color& textEmphasisColor() const { return rareInheritedData->textEmphasisColor; }
+ const Color& textFillColor() const { return rareInheritedData->textFillColor; }
+ const Color& textStrokeColor() const { return rareInheritedData->textStrokeColor; }
Color colorIncludingFallback(int colorProperty) const;
#if ENABLE(SVG)
- Color stopColor() const { return svgStyle()->stopColor(); }
- Color floodColor() const { return svgStyle()->floodColor(); }
- Color lightingColor() const { return svgStyle()->lightingColor(); }
+ const Color& stopColor() const { return svgStyle()->stopColor(); }
+ const Color& floodColor() const { return svgStyle()->floodColor(); }
+ const Color& lightingColor() const { return svgStyle()->lightingColor(); }
#endif
void appendContent(PassOwnPtr<ContentData>);