Diff
Modified: trunk/Source/WebCore/ChangeLog (88524 => 88525)
--- trunk/Source/WebCore/ChangeLog 2011-06-10 06:17:40 UTC (rev 88524)
+++ trunk/Source/WebCore/ChangeLog 2011-06-10 06:19:22 UTC (rev 88525)
@@ -2,6 +2,34 @@
Reviewed by Eric Seidel.
+ Implement CSSPropertyOutlineStyle handler in CSSStyleApplyProperty
+ https://bugs.webkit.org/show_bug.cgi?id=61601
+
+ No new tests. No new functionality added / covered by existing tests.
+
+ * css/CSSPrimitiveValueMappings.h:
+ (WebCore::CSSPrimitiveValue::operator EBorderStyle):
+ Support CSSValueAuto as required by outline-style property.
+ (WebCore::CSSPrimitiveValue::operator OutlineIsAuto):
+ Add cast to new OutlineIsAuto enum.
+ * css/CSSStyleApplyProperty.cpp:
+ (WebCore::CSSStyleApplyProperty::CSSStyleApplyProperty):
+ Initialize handler for CSSPropertyOutlineStyle.
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::applyProperty):
+ Remove old handler for CSSPropertyOutlineStyle.
+ * rendering/style/OutlineValue.h:
+ Use new OutlineIsAuto enum instead of bool.
+ * rendering/style/RenderStyle.h:
+ Split existing two-parameter setter setOutlineStyle into separate setters for style and auto properties.
+ Use new OutlineIsAuto enum type.
+ * rendering/style/RenderStyleConstants.h:
+ Define new enum OutlineIsAuto.
+
+2011-06-09 Luke Macpherson <[email protected]>
+
+ Reviewed by Eric Seidel.
+
Code cleanup - add wrappers for function pointer dereferences to improve readability in ApplyPropertyDefaultBase and derived classes.
https://bugs.webkit.org/show_bug.cgi?id=62418
Modified: trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h (88524 => 88525)
--- trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h 2011-06-10 06:17:40 UTC (rev 88524)
+++ trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h 2011-06-10 06:19:22 UTC (rev 88525)
@@ -87,9 +87,18 @@
template<> inline CSSPrimitiveValue::operator EBorderStyle() const
{
+ if (m_value.ident == CSSValueAuto) // Valid for CSS outline-style
+ return DOTTED;
return (EBorderStyle)(m_value.ident - CSSValueNone);
}
+template<> inline CSSPrimitiveValue::operator OutlineIsAuto() const
+{
+ if (m_value.ident == CSSValueAuto)
+ return AUTO_ON;
+ return AUTO_OFF;
+}
+
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(CompositeOperator e)
: m_type(CSS_IDENT)
, m_hasCachedCSSText(false)
Modified: trunk/Source/WebCore/css/CSSStyleApplyProperty.cpp (88524 => 88525)
--- trunk/Source/WebCore/css/CSSStyleApplyProperty.cpp 2011-06-10 06:17:40 UTC (rev 88524)
+++ trunk/Source/WebCore/css/CSSStyleApplyProperty.cpp 2011-06-10 06:19:22 UTC (rev 88525)
@@ -564,8 +564,10 @@
setPropertyHandler(CSSPropertyWebkitTextOrientation, new ApplyPropertyFont<TextOrientation>(&FontDescription::textOrientation, &FontDescription::setTextOrientation, RenderStyle::initialTextOrientation()));
setPropertyHandler(CSSPropertyFontWeight, new ApplyPropertyFontWeight());
+ setPropertyHandler(CSSPropertyOutlineStyle, new ApplyPropertyExpanding<ExpandValue>(new ApplyPropertyDefault<OutlineIsAuto>(&RenderStyle::outlineStyleIsAuto, &RenderStyle::setOutlineStyleIsAuto, &RenderStyle::initialOutlineStyleIsAuto), new ApplyPropertyDefault<EBorderStyle>(&RenderStyle::outlineStyle, &RenderStyle::setOutlineStyle, &RenderStyle::initialBorderStyle)));
setPropertyHandler(CSSPropertyOutlineColor, new ApplyPropertyColor<InheritFromParent>(&RenderStyle::outlineColor, &RenderStyle::setOutlineColor, &RenderStyle::color));
+
setPropertyHandler(CSSPropertyOverflowX, new ApplyPropertyDefault<EOverflow>(&RenderStyle::overflowX, &RenderStyle::setOverflowX, &RenderStyle::initialOverflowX));
setPropertyHandler(CSSPropertyOverflowY, new ApplyPropertyDefault<EOverflow>(&RenderStyle::overflowY, &RenderStyle::setOverflowY, &RenderStyle::initialOverflowY));
setPropertyHandler(CSSPropertyOverflow, new ApplyPropertyExpanding<ExpandValue>(propertyHandler(CSSPropertyOverflowX), propertyHandler(CSSPropertyOverflowY)));
Modified: trunk/Source/WebCore/css/CSSStyleSelector.cpp (88524 => 88525)
--- trunk/Source/WebCore/css/CSSStyleSelector.cpp 2011-06-10 06:17:40 UTC (rev 88524)
+++ trunk/Source/WebCore/css/CSSStyleSelector.cpp 2011-06-10 06:19:22 UTC (rev 88525)
@@ -3660,15 +3660,6 @@
case CSSPropertyBorderCollapse:
HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(borderCollapse, BorderCollapse)
return;
- case CSSPropertyOutlineStyle:
- HANDLE_INHERIT_AND_INITIAL_WITH_VALUE(outlineStyle, OutlineStyle, BorderStyle)
- if (primitiveValue) {
- if (primitiveValue->getIdent() == CSSValueAuto)
- m_style->setOutlineStyle(DOTTED, true);
- else
- m_style->setOutlineStyle(*primitiveValue);
- }
- return;
case CSSPropertyCaptionSide:
HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(captionSide, CaptionSide)
return;
@@ -5410,6 +5401,7 @@
case CSSPropertyWebkitTextOrientation:
case CSSPropertyWebkitFontSmoothing:
case CSSPropertyFontWeight:
+ case CSSPropertyOutlineStyle:
case CSSPropertyOutlineWidth:
case CSSPropertyWebkitColumnRuleWidth:
case CSSPropertyOutlineColor:
Modified: trunk/Source/WebCore/rendering/style/OutlineValue.h (88524 => 88525)
--- trunk/Source/WebCore/rendering/style/OutlineValue.h 2011-06-10 06:17:40 UTC (rev 88524)
+++ trunk/Source/WebCore/rendering/style/OutlineValue.h 2011-06-10 06:19:22 UTC (rev 88525)
@@ -34,7 +34,7 @@
public:
OutlineValue()
: m_offset(0)
- , m_isAuto(false)
+ , m_isAuto(AUTO_OFF)
{
}
@@ -49,11 +49,11 @@
}
int offset() const { return m_offset; }
- bool isAuto() const { return m_isAuto; }
+ OutlineIsAuto isAuto() const { return m_isAuto; }
private:
int m_offset;
- bool m_isAuto;
+ OutlineIsAuto m_isAuto;
};
} // namespace WebCore
Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (88524 => 88525)
--- trunk/Source/WebCore/rendering/style/RenderStyle.h 2011-06-10 06:17:40 UTC (rev 88524)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h 2011-06-10 06:19:22 UTC (rev 88525)
@@ -453,7 +453,7 @@
}
bool hasOutline() const { return outlineWidth() > 0 && outlineStyle() > BHIDDEN; }
EBorderStyle outlineStyle() const { return m_background->outline().style(); }
- bool outlineStyleIsAuto() const { return m_background->outline().isAuto(); }
+ OutlineIsAuto outlineStyleIsAuto() const { return static_cast<OutlineIsAuto>(m_background->outline().isAuto()); }
EOverflow overflowX() const { return static_cast<EOverflow>(noninherited_flags._overflowX); }
EOverflow overflowY() const { return static_cast<EOverflow>(noninherited_flags._overflowY); }
@@ -884,14 +884,10 @@
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_VAR(surround, border.m_bottom.m_color, v) }
- void setOutlineWidth(unsigned short v) { SET_VAR(m_background, m_outline.m_width, v) }
- void setOutlineStyle(EBorderStyle v, bool isAuto = false)
- {
- SET_VAR(m_background, m_outline.m_style, v)
- SET_VAR(m_background, m_outline.m_isAuto, isAuto)
- }
-
+ 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_VAR(m_background, m_outline.m_color, v) }
void setOverflowX(EOverflow v) { noninherited_flags._overflowX = v; }
@@ -1218,6 +1214,7 @@
// Initial values for all the properties
static EBorderCollapse initialBorderCollapse() { return BSEPARATE; }
static EBorderStyle initialBorderStyle() { return BNONE; }
+ static OutlineIsAuto initialOutlineStyleIsAuto() { return AUTO_OFF; }
static NinePieceImage initialNinePieceImage() { return NinePieceImage(); }
static LengthSize initialBorderRadius() { return LengthSize(Length(0, Fixed), Length(0, Fixed)); }
static ECaptionSide initialCaptionSide() { return CAPTOP; }
Modified: trunk/Source/WebCore/rendering/style/RenderStyleConstants.h (88524 => 88525)
--- trunk/Source/WebCore/rendering/style/RenderStyleConstants.h 2011-06-10 06:17:40 UTC (rev 88524)
+++ trunk/Source/WebCore/rendering/style/RenderStyleConstants.h 2011-06-10 06:19:22 UTC (rev 88525)
@@ -92,6 +92,8 @@
enum EBorderPrecedence { BOFF, BTABLE, BCOLGROUP, BCOL, BROWGROUP, BROW, BCELL };
+enum OutlineIsAuto { AUTO_OFF = 0, AUTO_ON };
+
enum EPosition {
StaticPosition, RelativePosition, AbsolutePosition, FixedPosition
};