* Copyright (C) 2000 Lars Knoll (knoll@kde.org)
* (C) 2000 Antti Koivisto (koivisto@kde.org)
* (C) 2000 Dirk Mueller (mueller@kde.org)
- * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
*
* This library is free software; you can redistribute it and/or
#include "AnimationList.h"
#include "BorderData.h"
#include "BorderValue.h"
-#include "CSSHelper.h"
#include "CSSImageGeneratorValue.h"
#include "CSSPrimitiveValue.h"
+#include "CSSPropertyNames.h"
#include "CSSReflectionDirection.h"
#include "CSSValueList.h"
-#include "CachedImage.h"
#include "CollapsedBorderValue.h"
#include "Color.h"
#include "ColorSpace.h"
#include "ThemeTypes.h"
#include "TimingFunction.h"
#include "TransformOperations.h"
+#include <wtf/Forward.h>
#include <wtf/OwnPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/StdLibExtras.h>
#include "SVGRenderStyle.h"
#endif
-#if ENABLE(XBL)
-#include "BindingURI.h"
-#endif
-
#if COMPILER(WINSCW)
#define compareEqual(t, u) ((t) == (u))
#else
class CSSStyleSelector;
class CSSValueList;
-class CachedImage;
class Pair;
-class StringImpl;
class StyleImage;
+typedef Vector<RefPtr<RenderStyle>, 4> PseudoStyleCache;
+
class RenderStyle: public RefCounted<RenderStyle> {
- friend class CSSStyleSelector;
+ friend class AnimationBase; // Used by CSS animations. We can't allow them to animate based off visited colors.
+ friend class ApplyStyleCommand; // Editing has to only reveal unvisited info.
+ friend class CSSStyleSelector; // Sets members directly.
+ friend class CSSComputedStyleDeclaration; // Ignores visited styles, so needs to be able to see unvisited info.
+ friend class PropertyWrapperMaybeInvalidColor; // Used by CSS animations. We can't allow them to animate based off visited colors.
+ friend class RenderSVGResource; // FIXME: Needs to alter the visited state by hand. Should clean the SVG code up and move it into RenderStyle perhaps.
+ friend class RenderTreeAsText; // FIXME: Only needed so the render tree can keep lying and dump the wrong colors. Rebaselining would allow this to be yanked.
protected:
// The following bitfield is 32-bits long, which optimizes padding with the
// int refCount in the base class. Beware when adding more bits.
- unsigned m_pseudoState : 3; // PseudoState
bool m_affectedByAttributeSelectors : 1;
bool m_unique : 1;
bool m_childrenAffectedByBackwardPositionalRules : 1;
bool m_firstChildState : 1;
bool m_lastChildState : 1;
- unsigned m_childIndex : 18; // Plenty of bits to cache an index.
+ unsigned m_childIndex : 21; // Plenty of bits to cache an index.
// non-inherited attributes
- DataRef<StyleBoxData> box;
+ DataRef<StyleBoxData> m_box;
DataRef<StyleVisualData> visual;
- DataRef<StyleBackgroundData> background;
+ DataRef<StyleBackgroundData> m_background;
DataRef<StyleSurroundData> surround;
DataRef<StyleRareNonInheritedData> rareNonInheritedData;
DataRef<StyleInheritedData> inherited;
// list of associated pseudo styles
- RefPtr<RenderStyle> m_cachedPseudoStyle;
+ OwnPtr<PseudoStyleCache> m_cachedPseudoStyles;
#if ENABLE(SVG)
DataRef<SVGRenderStyle> m_svgStyle;
(_white_space == other._white_space) &&
(_box_direction == other._box_direction) &&
(_visuallyOrdered == other._visuallyOrdered) &&
- (_htmlHacks == other._htmlHacks) &&
(_force_backgrounds_to_white == other._force_backgrounds_to_white) &&
- (_pointerEvents == other._pointerEvents);
+ (_pointerEvents == other._pointerEvents) &&
+ (_insideLink == other._insideLink) &&
+ (m_writingMode == other.m_writingMode);
}
bool operator!=(const InheritedFlags& other) const { return !(*this == other); }
// non CSS2 inherited
bool _visuallyOrdered : 1;
- bool _htmlHacks : 1;
bool _force_backgrounds_to_white : 1;
unsigned _pointerEvents : 4; // EPointerEvents
- // 41 bits
+ unsigned _insideLink : 2; // EInsideLink
+ // 43 bits
+
+ // CSS Text Layout Module Level 3: Vertical writing support
+ unsigned m_writingMode : 2; // WritingMode
+ // 45 bits
} inherited_flags;
// don't inherit
&& _affectedByActive == other._affectedByActive
&& _affectedByDrag == other._affectedByDrag
&& _pseudoBits == other._pseudoBits
- && _unicodeBidi == other._unicodeBidi;
+ && _unicodeBidi == other._unicodeBidi
+ && _isLink == other._isLink;
}
bool operator!=(const NonInheritedFlags& other) const { return !(*this == other); }
unsigned _page_break_after : 2; // EPageBreak
unsigned _page_break_inside : 2; // EPageBreak
- unsigned _styleType : 5; // PseudoId
+ unsigned _styleType : 6; // PseudoId
bool _affectedByHover : 1;
bool _affectedByActive : 1;
bool _affectedByDrag : 1;
unsigned _pseudoBits : 7;
unsigned _unicodeBidi : 2; // EUnicodeBidi
+ bool _isLink : 1;
// 50 bits
} noninherited_flags;
inherited_flags._border_collapse = initialBorderCollapse();
inherited_flags._white_space = initialWhiteSpace();
inherited_flags._visuallyOrdered = initialVisuallyOrdered();
- inherited_flags._htmlHacks=false;
inherited_flags._box_direction = initialBoxDirection();
inherited_flags._force_backgrounds_to_white = false;
inherited_flags._pointerEvents = initialPointerEvents();
+ inherited_flags._insideLink = NotInsideLink;
+ inherited_flags.m_writingMode = initialWritingMode();
noninherited_flags._effectiveDisplay = noninherited_flags._originalDisplay = initialDisplay();
noninherited_flags._overflowX = initialOverflowX();
noninherited_flags._affectedByDrag = false;
noninherited_flags._pseudoBits = 0;
noninherited_flags._unicodeBidi = initialUnicodeBidi();
+ noninherited_flags._isLink = false;
}
-protected:
- RenderStyle();
+private:
+ ALWAYS_INLINE RenderStyle();
// used to create the default style.
- RenderStyle(bool);
- RenderStyle(const RenderStyle&);
+ ALWAYS_INLINE RenderStyle(bool);
+ ALWAYS_INLINE RenderStyle(const RenderStyle&);
public:
static PassRefPtr<RenderStyle> create();
RenderStyle* getCachedPseudoStyle(PseudoId) const;
RenderStyle* addCachedPseudoStyle(PassRefPtr<RenderStyle>);
+ void removeCachedPseudoStyle(PseudoId);
- typedef Vector<RenderStyle*, 10> PseudoStyleCache;
- void getPseudoStyleCache(PseudoStyleCache&) const;
+ const PseudoStyleCache* cachedPseudoStyles() const { return m_cachedPseudoStyles.get(); }
bool affectedByHoverRules() const { return noninherited_flags._affectedByHover; }
bool affectedByActiveRules() const { return noninherited_flags._affectedByActive; }
bool hasPadding() const { return surround->padding.nonZero(); }
bool hasOffset() const { return surround->offset.nonZero(); }
+ bool hasBackgroundImage() const { return m_background->background().hasImage(); }
+ bool hasFixedBackgroundImage() const { return m_background->background().hasFixedImage(); }
+ bool hasAppearance() const { return appearance() != NoControlPart; }
+
bool hasBackground() const
{
- if (backgroundColor().isValid() && backgroundColor().alpha() > 0)
+ Color color = visitedDependentColor(CSSPropertyBackgroundColor);
+ if (color.isValid() && color.alpha() > 0)
return true;
- return background->m_background.hasImage();
+ return hasBackgroundImage();
}
- bool hasBackgroundImage() const { return background->m_background.hasImage(); }
- bool hasFixedBackgroundImage() const { return background->m_background.hasFixedImage(); }
- bool hasAppearance() const { return appearance() != NoControlPart; }
bool visuallyOrdered() const { return inherited_flags._visuallyOrdered; }
void setVisuallyOrdered(bool b) { inherited_flags._visuallyOrdered = b; }
bool isStyleAvailable() const;
+ bool hasAnyPublicPseudoStyles() const;
bool hasPseudoStyle(PseudoId pseudo) const;
void setHasPseudoStyle(PseudoId pseudo);
EPosition position() const { return static_cast<EPosition>(noninherited_flags._position); }
EFloat floating() const { return static_cast<EFloat>(noninherited_flags._floating); }
- Length width() const { return box->width; }
- Length height() const { return box->height; }
- Length minWidth() const { return box->min_width; }
- Length maxWidth() const { return box->max_width; }
- Length minHeight() const { return box->min_height; }
- Length maxHeight() const { return box->max_height; }
+ Length width() const { return m_box->width(); }
+ Length height() const { return m_box->height(); }
+ Length minWidth() const { return m_box->minWidth(); }
+ Length maxWidth() const { return m_box->maxWidth(); }
+ Length minHeight() const { return m_box->minHeight(); }
+ Length maxHeight() const { return m_box->maxHeight(); }
+
+ Length logicalWidth() const;
+ Length logicalHeight() const;
+ Length logicalMinWidth() const;
+ Length logicalMaxWidth() const;
+ Length logicalMinHeight() const;
+ Length logicalMaxHeight() const;
const BorderData& border() const { return surround->border; }
- const BorderValue& borderLeft() const { return surround->border.left; }
- const BorderValue& borderRight() const { return surround->border.right; }
- const BorderValue& borderTop() const { return surround->border.top; }
- const BorderValue& borderBottom() const { return surround->border.bottom; }
+ const BorderValue& borderLeft() const { return surround->border.left(); }
+ const BorderValue& borderRight() const { return surround->border.right(); }
+ const BorderValue& borderTop() const { return surround->border.top(); }
+ const BorderValue& borderBottom() const { return surround->border.bottom(); }
- const NinePieceImage& borderImage() const { return surround->border.image; }
+ const NinePieceImage& borderImage() const { return surround->border.image(); }
- const IntSize& borderTopLeftRadius() const { return surround->border.topLeft; }
- const IntSize& borderTopRightRadius() const { return surround->border.topRight; }
- const IntSize& borderBottomLeftRadius() const { return surround->border.bottomLeft; }
- const IntSize& borderBottomRightRadius() const { return surround->border.bottomRight; }
+ const LengthSize& borderTopLeftRadius() const { return surround->border.topLeft(); }
+ const LengthSize& borderTopRightRadius() const { return surround->border.topRight(); }
+ const LengthSize& borderBottomLeftRadius() const { return surround->border.bottomLeft(); }
+ const LengthSize& borderBottomRightRadius() const { return surround->border.bottomRight(); }
bool hasBorderRadius() const { return surround->border.hasBorderRadius(); }
unsigned short borderLeftWidth() const { return surround->border.borderLeftWidth(); }
- EBorderStyle borderLeftStyle() const { return surround->border.left.style(); }
- const Color& borderLeftColor() const { return surround->border.left.color; }
- bool borderLeftIsTransparent() const { return surround->border.left.isTransparent(); }
+ EBorderStyle borderLeftStyle() const { return surround->border.left().style(); }
+ bool borderLeftIsTransparent() const { return surround->border.left().isTransparent(); }
unsigned short borderRightWidth() const { return surround->border.borderRightWidth(); }
- EBorderStyle borderRightStyle() const { return surround->border.right.style(); }
- const Color& borderRightColor() const { return surround->border.right.color; }
- bool borderRightIsTransparent() const { return surround->border.right.isTransparent(); }
+ EBorderStyle borderRightStyle() const { return surround->border.right().style(); }
+ bool borderRightIsTransparent() const { return surround->border.right().isTransparent(); }
unsigned short borderTopWidth() const { return surround->border.borderTopWidth(); }
- EBorderStyle borderTopStyle() const { return surround->border.top.style(); }
- const Color& borderTopColor() const { return surround->border.top.color; }
- bool borderTopIsTransparent() const { return surround->border.top.isTransparent(); }
+ EBorderStyle borderTopStyle() const { return surround->border.top().style(); }
+ bool borderTopIsTransparent() const { return surround->border.top().isTransparent(); }
unsigned short borderBottomWidth() const { return surround->border.borderBottomWidth(); }
- EBorderStyle borderBottomStyle() const { return surround->border.bottom.style(); }
- const Color& borderBottomColor() const { return surround->border.bottom.color; }
- bool borderBottomIsTransparent() const { return surround->border.bottom.isTransparent(); }
+ EBorderStyle borderBottomStyle() const { return surround->border.bottom().style(); }
+ bool borderBottomIsTransparent() const { return surround->border.bottom().isTransparent(); }
+
+ unsigned short borderBeforeWidth() const;
+ unsigned short borderAfterWidth() const;
+ unsigned short borderStartWidth() const;
+ unsigned short borderEndWidth() const;
unsigned short outlineSize() const { return max(0, outlineWidth() + outlineOffset()); }
unsigned short outlineWidth() const
{
- if (background->m_outline.style() == BNONE)
+ if (m_background->outline().style() == BNONE)
return 0;
- return background->m_outline.width;
+ return m_background->outline().width();
}
bool hasOutline() const { return outlineWidth() > 0 && outlineStyle() > BHIDDEN; }
- EBorderStyle outlineStyle() const { return background->m_outline.style(); }
- bool outlineStyleIsAuto() const { return background->m_outline._auto; }
- const Color& outlineColor() const { return background->m_outline.color; }
-
+ EBorderStyle outlineStyle() const { return m_background->outline().style(); }
+ bool outlineStyleIsAuto() const { return m_background->outline().isAuto(); }
+
EOverflow overflowX() const { return static_cast<EOverflow>(noninherited_flags._overflowX); }
EOverflow overflowY() const { return static_cast<EOverflow>(noninherited_flags._overflowY); }
EVisibility visibility() const { return static_cast<EVisibility>(inherited_flags._visibility); }
EVerticalAlign verticalAlign() const { return static_cast<EVerticalAlign>(noninherited_flags._vertical_align); }
- Length verticalAlignLength() const { return box->vertical_align; }
+ Length verticalAlignLength() const { return m_box->verticalAlign(); }
Length clipLeft() const { return visual->clip.left(); }
Length clipRight() const { return visual->clip.right(); }
const FontDescription& fontDescription() const { return inherited->font.fontDescription(); }
int fontSize() const { return inherited->font.pixelSize(); }
- const Color& color() const { return inherited->color; }
- Length textIndent() const { return inherited->indent; }
+ 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); }
int textDecorationsInEffect() const { return inherited_flags._text_decorations; }
int letterSpacing() const { return inherited->font.letterSpacing(); }
float zoom() const { return visual->m_zoom; }
- float effectiveZoom() const { return inherited->m_effectiveZoom; }
+ 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() const
{
return wordBreak() == BreakWordBreak || wordWrap() == BreakWordWrap;
}
- const Color& backgroundColor() const { return background->m_color; }
- StyleImage* backgroundImage() const { return background->m_background.m_image.get(); }
- EFillRepeat backgroundRepeatX() const { return static_cast<EFillRepeat>(background->m_background.m_repeatX); }
- EFillRepeat backgroundRepeatY() const { return static_cast<EFillRepeat>(background->m_background.m_repeatY); }
- CompositeOperator backgroundComposite() const { return static_cast<CompositeOperator>(background->m_background.m_composite); }
- EFillAttachment backgroundAttachment() const { return static_cast<EFillAttachment>(background->m_background.m_attachment); }
- EFillBox backgroundClip() const { return static_cast<EFillBox>(background->m_background.m_clip); }
- EFillBox backgroundOrigin() const { return static_cast<EFillBox>(background->m_background.m_origin); }
- Length backgroundXPosition() const { return background->m_background.m_xPosition; }
- Length backgroundYPosition() const { return background->m_background.m_yPosition; }
- EFillSizeType backgroundSizeType() const { return static_cast<EFillSizeType>(background->m_background.m_sizeType); }
- LengthSize backgroundSizeLength() const { return background->m_background.m_sizeLength; }
- FillLayer* accessBackgroundLayers() { return &(background.access()->m_background); }
- const FillLayer* backgroundLayers() const { return &(background->m_background); }
-
- StyleImage* maskImage() const { return rareNonInheritedData->m_mask.m_image.get(); }
- EFillRepeat maskRepeatX() const { return static_cast<EFillRepeat>(rareNonInheritedData->m_mask.m_repeatX); }
- EFillRepeat maskRepeatY() const { return static_cast<EFillRepeat>(rareNonInheritedData->m_mask.m_repeatY); }
- CompositeOperator maskComposite() const { return static_cast<CompositeOperator>(rareNonInheritedData->m_mask.m_composite); }
- EFillAttachment maskAttachment() const { return static_cast<EFillAttachment>(rareNonInheritedData->m_mask.m_attachment); }
- EFillBox maskClip() const { return static_cast<EFillBox>(rareNonInheritedData->m_mask.m_clip); }
- EFillBox maskOrigin() const { return static_cast<EFillBox>(rareNonInheritedData->m_mask.m_origin); }
- Length maskXPosition() const { return rareNonInheritedData->m_mask.m_xPosition; }
- Length maskYPosition() const { return rareNonInheritedData->m_mask.m_yPosition; }
- LengthSize maskSize() const { return rareNonInheritedData->m_mask.m_sizeLength; }
+ StyleImage* backgroundImage() const { return m_background->background().image(); }
+ EFillRepeat backgroundRepeatX() const { return static_cast<EFillRepeat>(m_background->background().repeatX()); }
+ EFillRepeat backgroundRepeatY() const { return static_cast<EFillRepeat>(m_background->background().repeatY()); }
+ CompositeOperator backgroundComposite() const { return static_cast<CompositeOperator>(m_background->background().composite()); }
+ EFillAttachment backgroundAttachment() const { return static_cast<EFillAttachment>(m_background->background().attachment()); }
+ EFillBox backgroundClip() const { return static_cast<EFillBox>(m_background->background().clip()); }
+ EFillBox backgroundOrigin() const { return static_cast<EFillBox>(m_background->background().origin()); }
+ Length backgroundXPosition() const { return m_background->background().xPosition(); }
+ Length backgroundYPosition() const { return m_background->background().yPosition(); }
+ EFillSizeType backgroundSizeType() const { return m_background->background().sizeType(); }
+ LengthSize backgroundSizeLength() const { return m_background->background().sizeLength(); }
+ FillLayer* accessBackgroundLayers() { return &(m_background.access()->m_background); }
+ const FillLayer* backgroundLayers() const { return &(m_background->background()); }
+
+ StyleImage* maskImage() const { return rareNonInheritedData->m_mask.image(); }
+ EFillRepeat maskRepeatX() const { return static_cast<EFillRepeat>(rareNonInheritedData->m_mask.repeatX()); }
+ EFillRepeat maskRepeatY() const { return static_cast<EFillRepeat>(rareNonInheritedData->m_mask.repeatY()); }
+ CompositeOperator maskComposite() const { return static_cast<CompositeOperator>(rareNonInheritedData->m_mask.composite()); }
+ EFillAttachment maskAttachment() const { return static_cast<EFillAttachment>(rareNonInheritedData->m_mask.attachment()); }
+ EFillBox maskClip() const { return static_cast<EFillBox>(rareNonInheritedData->m_mask.clip()); }
+ EFillBox maskOrigin() const { return static_cast<EFillBox>(rareNonInheritedData->m_mask.origin()); }
+ Length maskXPosition() const { return rareNonInheritedData->m_mask.xPosition(); }
+ Length maskYPosition() const { return rareNonInheritedData->m_mask.yPosition(); }
+ EFillSizeType maskSizeType() const { return rareNonInheritedData->m_mask.sizeType(); }
+ LengthSize maskSizeLength() const { return rareNonInheritedData->m_mask.sizeLength(); }
FillLayer* accessMaskLayers() { return &(rareNonInheritedData.access()->m_mask); }
const FillLayer* maskLayers() const { return &(rareNonInheritedData->m_mask); }
const NinePieceImage& maskBoxImage() const { return rareNonInheritedData->m_maskBoxImage; }
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 visual->counterIncrement; }
- short counterReset() const { return visual->counterReset; }
+ 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(); }
Length marginBottom() const { return surround->margin.bottom(); }
Length marginLeft() const { return surround->margin.left(); }
Length marginRight() const { return surround->margin.right(); }
+ Length marginBefore() const;
+ Length marginAfter() const;
+ Length marginStart() const;
+ Length marginEnd() const;
+ Length marginStartUsing(const RenderStyle* otherStyle) const;
+ Length marginEndUsing(const RenderStyle* otherStyle) const;
+ Length marginBeforeUsing(const RenderStyle* otherStyle) const;
+ Length marginAfterUsing(const RenderStyle* otherStyle) const;
LengthBox paddingBox() const { return surround->padding; }
Length paddingTop() const { return surround->padding.top(); }
Length paddingBottom() const { return surround->padding.bottom(); }
Length paddingLeft() const { return surround->padding.left(); }
Length paddingRight() const { return surround->padding.right(); }
+ Length paddingBefore() const;
+ Length paddingAfter() const;
+ Length paddingStart() const;
+ Length paddingEnd() const;
ECursor cursor() const { return static_cast<ECursor>(inherited_flags._cursor_style); }
- CursorList* cursors() const { return inherited->cursorData.get(); }
+ CursorList* cursors() const { return rareInheritedData->cursorData.get(); }
+
+ EInsideLink insideLink() const { return static_cast<EInsideLink>(inherited_flags._insideLink); }
+ bool isLink() const { return noninherited_flags._isLink; }
- short widows() const { return inherited->widows; }
- short orphans() const { return inherited->orphans; }
+ short widows() const { return rareInheritedData->widows; }
+ short orphans() const { return rareInheritedData->orphans; }
EPageBreak pageBreakInside() const { return static_cast<EPageBreak>(noninherited_flags._page_break_inside); }
EPageBreak pageBreakBefore() const { return static_cast<EPageBreak>(noninherited_flags._page_break_before); }
EPageBreak pageBreakAfter() const { return static_cast<EPageBreak>(noninherited_flags._page_break_after); }
// CSS3 Getter Methods
-#if ENABLE(XBL)
- BindingURI* bindingURIs() const { return rareNonInheritedData->bindingURI; }
-#endif
int outlineOffset() const
{
- if (background->m_outline.style() == BNONE)
+ if (m_background->outline().style() == BNONE)
return 0;
- return background->m_outline._offset;
+ return m_background->outline().offset();
}
- ShadowData* textShadow() const { return rareInheritedData->textShadow; }
- const Color& textStrokeColor() const { return rareInheritedData->textStrokeColor; }
+ const ShadowData* textShadow() const { return rareInheritedData->textShadow; }
+ void getTextShadowExtent(int& top, int& right, int& bottom, int& left) const { getShadowExtent(textShadow(), top, right, bottom, left); }
+ void getTextShadowHorizontalExtent(int& left, int& right) const { getShadowHorizontalExtent(textShadow(), left, right); }
+ void getTextShadowVerticalExtent(int& top, int& bottom) const { getShadowVerticalExtent(textShadow(), top, bottom); }
+ void getTextShadowInlineDirectionExtent(int& logicalLeft, int& logicalRight) { getShadowInlineDirectionExtent(textShadow(), logicalLeft, logicalRight); }
+ void getTextShadowBlockDirectionExtent(int& logicalTop, int& logicalBottom) { getShadowBlockDirectionExtent(textShadow(), logicalTop, logicalBottom); }
+
float textStrokeWidth() const { return rareInheritedData->textStrokeWidth; }
- const Color& textFillColor() const { return rareInheritedData->textFillColor; }
ColorSpace colorSpace() const { return static_cast<ColorSpace>(rareInheritedData->colorSpace); }
float opacity() const { return rareNonInheritedData->opacity; }
ControlPart appearance() const { return static_cast<ControlPart>(rareNonInheritedData->m_appearance); }
EBoxOrient boxOrient() const { return static_cast<EBoxOrient>(rareNonInheritedData->flexibleBox->orient); }
EBoxAlignment boxPack() const { return static_cast<EBoxAlignment>(rareNonInheritedData->flexibleBox->pack); }
- ShadowData* boxShadow() const { return rareNonInheritedData->m_boxShadow.get(); }
- void getBoxShadowExtent(int &top, int &right, int &bottom, int &left) const;
- void getBoxShadowHorizontalExtent(int &left, int &right) const;
- void getBoxShadowVerticalExtent(int &top, int &bottom) const;
+ const ShadowData* boxShadow() const { return rareNonInheritedData->m_boxShadow.get(); }
+ void getBoxShadowExtent(int& top, int& right, int& bottom, int& left) const { getShadowExtent(boxShadow(), top, right, bottom, left); }
+ void getBoxShadowHorizontalExtent(int& left, int& right) const { getShadowHorizontalExtent(boxShadow(), left, right); }
+ void getBoxShadowVerticalExtent(int& top, int& bottom) const { getShadowVerticalExtent(boxShadow(), top, bottom); }
+ void getBoxShadowInlineDirectionExtent(int& logicalLeft, int& logicalRight) { getShadowInlineDirectionExtent(boxShadow(), logicalLeft, logicalRight); }
+ void getBoxShadowBlockDirectionExtent(int& logicalTop, int& logicalBottom) { getShadowBlockDirectionExtent(boxShadow(), logicalTop, logicalBottom); }
StyleReflection* boxReflect() const { return rareNonInheritedData->m_boxReflect.get(); }
- EBoxSizing boxSizing() const { return static_cast<EBoxSizing>(box->boxSizing); }
+ EBoxSizing boxSizing() const { return m_box->boxSizing(); }
Length marqueeIncrement() const { return rareNonInheritedData->marquee->increment; }
int marqueeSpeed() const { return rareNonInheritedData->marquee->speed; }
int marqueeLoopCount() const { return rareNonInheritedData->marquee->loops; }
EUserDrag userDrag() const { return static_cast<EUserDrag>(rareNonInheritedData->userDrag); }
EUserSelect userSelect() const { return static_cast<EUserSelect>(rareInheritedData->userSelect); }
bool textOverflow() const { return rareNonInheritedData->textOverflow; }
- EMarginCollapse marginTopCollapse() const { return static_cast<EMarginCollapse>(rareNonInheritedData->marginTopCollapse); }
- EMarginCollapse marginBottomCollapse() const { return static_cast<EMarginCollapse>(rareNonInheritedData->marginBottomCollapse); }
+ EMarginCollapse marginBeforeCollapse() const { return static_cast<EMarginCollapse>(rareNonInheritedData->marginBeforeCollapse); }
+ EMarginCollapse marginAfterCollapse() const { return static_cast<EMarginCollapse>(rareNonInheritedData->marginAfterCollapse); }
EWordBreak wordBreak() const { return static_cast<EWordBreak>(rareInheritedData->wordBreak); }
EWordWrap wordWrap() const { return static_cast<EWordWrap>(rareInheritedData->wordWrap); }
ENBSPMode nbspMode() const { return static_cast<ENBSPMode>(rareInheritedData->nbspMode); }
EKHTMLLineBreak khtmlLineBreak() const { return static_cast<EKHTMLLineBreak>(rareInheritedData->khtmlLineBreak); }
EMatchNearestMailBlockquoteColor matchNearestMailBlockquoteColor() const { return static_cast<EMatchNearestMailBlockquoteColor>(rareNonInheritedData->matchNearestMailBlockquoteColor); }
const AtomicString& highlight() const { return rareInheritedData->highlight; }
+ Hyphens hyphens() const { return static_cast<Hyphens>(rareInheritedData->hyphens); }
+ const AtomicString& hyphenationString() const { return rareInheritedData->hyphenationString; }
+ const AtomicString& hyphenationLocale() const { return rareInheritedData->hyphenationLocale; }
EBorderFit borderFit() const { return static_cast<EBorderFit>(rareNonInheritedData->m_borderFit); }
EResize resize() const { return static_cast<EResize>(rareInheritedData->resize); }
float columnWidth() const { return rareNonInheritedData->m_multiCol->m_width; }
bool hasAutoColumnWidth() const { return rareNonInheritedData->m_multiCol->m_autoWidth; }
unsigned short columnCount() const { return rareNonInheritedData->m_multiCol->m_count; }
bool hasAutoColumnCount() const { return rareNonInheritedData->m_multiCol->m_autoCount; }
+ bool specifiesColumns() const { return !hasAutoColumnCount() || !hasAutoColumnWidth(); }
float columnGap() const { return rareNonInheritedData->m_multiCol->m_gap; }
bool hasNormalColumnGap() const { return rareNonInheritedData->m_multiCol->m_normalGap; }
- const Color& columnRuleColor() const { return rareNonInheritedData->m_multiCol->m_rule.color; }
EBorderStyle columnRuleStyle() const { return rareNonInheritedData->m_multiCol->m_rule.style(); }
unsigned short columnRuleWidth() const { return rareNonInheritedData->m_multiCol->ruleWidth(); }
bool columnRuleIsTransparent() const { return rareNonInheritedData->m_multiCol->m_rule.isTransparent(); }
+ bool columnSpan() const { return rareNonInheritedData->m_multiCol->m_columnSpan; }
EPageBreak columnBreakBefore() const { return static_cast<EPageBreak>(rareNonInheritedData->m_multiCol->m_breakBefore); }
EPageBreak columnBreakInside() const { return static_cast<EPageBreak>(rareNonInheritedData->m_multiCol->m_breakInside); }
EPageBreak columnBreakAfter() const { return static_cast<EPageBreak>(rareNonInheritedData->m_multiCol->m_breakAfter); }
enum ApplyTransformOrigin { IncludeTransformOrigin, ExcludeTransformOrigin };
void applyTransform(TransformationMatrix&, const IntSize& borderBoxSize, ApplyTransformOrigin = IncludeTransformOrigin) const;
+ void setPageScaleTransform(float);
bool hasMask() const { return rareNonInheritedData->m_mask.hasImage() || rareNonInheritedData->m_maskBoxImage.hasImage(); }
// End CSS3 Getters
bool hasPerspective() const { return rareNonInheritedData->m_perspective > 0; }
Length perspectiveOriginX() const { return rareNonInheritedData->m_perspectiveOriginX; }
Length perspectiveOriginY() const { return rareNonInheritedData->m_perspectiveOriginY; }
+ LengthSize pageSize() const { return rareNonInheritedData->m_pageSize; }
+ PageSizeType pageSizeType() const { return rareNonInheritedData->m_pageSizeType; }
#if USE(ACCELERATED_COMPOSITING)
// When set, this ensures that styles compare as different. Used during accelerated animations.
bool textSizeAdjust() const { return rareInheritedData->textSizeAdjust; }
ETextSecurity textSecurity() const { return static_cast<ETextSecurity>(rareInheritedData->textSecurity); }
+ WritingMode writingMode() const { return static_cast<WritingMode>(inherited_flags.m_writingMode); }
+ bool isHorizontalWritingMode() const { return writingMode() == TopToBottomWritingMode || writingMode() == BottomToTopWritingMode; }
+ bool isFlippedLinesWritingMode() const { return writingMode() == LeftToRightWritingMode || writingMode() == BottomToTopWritingMode; }
+ bool isFlippedBlocksWritingMode() const { return writingMode() == RightToLeftWritingMode || writingMode() == BottomToTopWritingMode; }
+
+ ESpeak speak() { return static_cast<ESpeak>(rareInheritedData->speak); }
+
+#ifdef ANDROID_CSS_RING
+ // called when building nav cache to determine if the ring data is unchanged
+ const void* ringData() const { return reinterpret_cast<const void*>(rareInheritedData.get()); }
+ Color ringFillColor() const { return rareInheritedData->ringFillColor; }
+ Length ringInnerWidth() const { return rareInheritedData->ringInnerWidth; }
+ Length ringOuterWidth() const { return rareInheritedData->ringOuterWidth; }
+ Length ringOutset() const { return rareInheritedData->ringOutset; }
+ Color ringPressedInnerColor() const { return rareInheritedData->ringPressedInnerColor; }
+ Color ringPressedOuterColor() const { return rareInheritedData->ringPressedOuterColor; }
+ Length ringRadius() const { return rareInheritedData->ringRadius; }
+ Color ringSelectedInnerColor() const { return rareInheritedData->ringSelectedInnerColor; }
+ Color ringSelectedOuterColor() const { return rareInheritedData->ringSelectedOuterColor; }
+#endif
#ifdef ANDROID_CSS_TAP_HIGHLIGHT_COLOR
Color tapHighlightColor() const { return rareInheritedData->tapHighlightColor; }
#endif
-
// attribute setter methods
void setDisplay(EDisplay v) { noninherited_flags._effectiveDisplay = v; }
void setTop(Length v) { SET_VAR(surround, offset.m_top, v) }
void setBottom(Length v) { SET_VAR(surround, offset.m_bottom, v) }
- void setWidth(Length v) { SET_VAR(box, width, v) }
- void setHeight(Length v) { SET_VAR(box, height, v) }
+ void setWidth(Length v) { SET_VAR(m_box, m_width, v) }
+ void setHeight(Length v) { SET_VAR(m_box, m_height, v) }
- void setMinWidth(Length v) { SET_VAR(box, min_width, v) }
- void setMaxWidth(Length v) { SET_VAR(box, max_width, v) }
- void setMinHeight(Length v) { SET_VAR(box, min_height, v) }
- void setMaxHeight(Length v) { SET_VAR(box, max_height, v) }
+ void setMinWidth(Length v) { SET_VAR(m_box, m_minWidth, v) }
+ void setMaxWidth(Length v) { SET_VAR(m_box, m_maxWidth, v) }
+ void setMinHeight(Length v) { SET_VAR(m_box, m_minHeight, v) }
+ void setMaxHeight(Length v) { SET_VAR(m_box, m_maxHeight, v) }
#if ENABLE(DASHBOARD_SUPPORT)
Vector<StyleDashboardRegion> dashboardRegions() const { return rareNonInheritedData->m_dashboardRegions; }
#endif
void resetBorder() { resetBorderImage(); resetBorderTop(); resetBorderRight(); resetBorderBottom(); resetBorderLeft(); resetBorderRadius(); }
- void resetBorderTop() { SET_VAR(surround, border.top, BorderValue()) }
- void resetBorderRight() { SET_VAR(surround, border.right, BorderValue()) }
- void resetBorderBottom() { SET_VAR(surround, border.bottom, BorderValue()) }
- void resetBorderLeft() { SET_VAR(surround, border.left, BorderValue()) }
- void resetBorderImage() { SET_VAR(surround, border.image, NinePieceImage()) }
+ void resetBorderTop() { SET_VAR(surround, border.m_top, BorderValue()) }
+ void resetBorderRight() { SET_VAR(surround, border.m_right, BorderValue()) }
+ void resetBorderBottom() { SET_VAR(surround, border.m_bottom, BorderValue()) }
+ void resetBorderLeft() { SET_VAR(surround, border.m_left, BorderValue()) }
+ void resetBorderImage() { SET_VAR(surround, border.m_image, NinePieceImage()) }
void resetBorderRadius() { resetBorderTopLeftRadius(); resetBorderTopRightRadius(); resetBorderBottomLeftRadius(); resetBorderBottomRightRadius(); }
- void resetBorderTopLeftRadius() { SET_VAR(surround, border.topLeft, initialBorderRadius()) }
- void resetBorderTopRightRadius() { SET_VAR(surround, border.topRight, initialBorderRadius()) }
- void resetBorderBottomLeftRadius() { SET_VAR(surround, border.bottomLeft, initialBorderRadius()) }
- void resetBorderBottomRightRadius() { SET_VAR(surround, border.bottomRight, initialBorderRadius()) }
+ void resetBorderTopLeftRadius() { SET_VAR(surround, border.m_topLeft, initialBorderRadius()) }
+ void resetBorderTopRightRadius() { SET_VAR(surround, border.m_topRight, initialBorderRadius()) }
+ void resetBorderBottomLeftRadius() { SET_VAR(surround, border.m_bottomLeft, initialBorderRadius()) }
+ void resetBorderBottomRightRadius() { SET_VAR(surround, border.m_bottomRight, initialBorderRadius()) }
- void resetOutline() { SET_VAR(background, m_outline, OutlineValue()) }
+ void resetOutline() { SET_VAR(m_background, m_outline, OutlineValue()) }
- void setBackgroundColor(const Color& v) { SET_VAR(background, m_color, v) }
+ void setBackgroundColor(const Color& v) { SET_VAR(m_background, m_color, v) }
- void setBackgroundXPosition(Length l) { SET_VAR(background, m_background.m_xPosition, l) }
- void setBackgroundYPosition(Length l) { SET_VAR(background, m_background.m_yPosition, l) }
- void setBackgroundSize(EFillSizeType b) { SET_VAR(background, m_background.m_sizeType, b) }
- void setBackgroundSizeLength(LengthSize l) { SET_VAR(background, m_background.m_sizeLength, l) }
+ void setBackgroundXPosition(Length l) { SET_VAR(m_background, m_background.m_xPosition, l) }
+ void setBackgroundYPosition(Length l) { SET_VAR(m_background, m_background.m_yPosition, l) }
+ void setBackgroundSize(EFillSizeType b) { SET_VAR(m_background, m_background.m_sizeType, b) }
+ void setBackgroundSizeLength(LengthSize l) { SET_VAR(m_background, m_background.m_sizeLength, l) }
- void setBorderImage(const NinePieceImage& b) { SET_VAR(surround, border.image, b) }
+ void setBorderImage(const NinePieceImage& b) { SET_VAR(surround, border.m_image, b) }
- void setBorderTopLeftRadius(const IntSize& s) { SET_VAR(surround, border.topLeft, s) }
- void setBorderTopRightRadius(const IntSize& s) { SET_VAR(surround, border.topRight, s) }
- void setBorderBottomLeftRadius(const IntSize& s) { SET_VAR(surround, border.bottomLeft, s) }
- void setBorderBottomRightRadius(const IntSize& s) { SET_VAR(surround, border.bottomRight, s) }
+ void setBorderTopLeftRadius(const LengthSize& s) { SET_VAR(surround, border.m_topLeft, s) }
+ void setBorderTopRightRadius(const LengthSize& s) { SET_VAR(surround, border.m_topRight, s) }
+ void setBorderBottomLeftRadius(const LengthSize& s) { SET_VAR(surround, border.m_bottomLeft, s) }
+ void setBorderBottomRightRadius(const LengthSize& s) { SET_VAR(surround, border.m_bottomRight, s) }
- void setBorderRadius(const IntSize& s)
+ void setBorderRadius(const LengthSize& s)
{
setBorderTopLeftRadius(s);
setBorderTopRightRadius(s);
setBorderBottomLeftRadius(s);
setBorderBottomRightRadius(s);
}
+ void setBorderRadius(const IntSize& s)
+ {
+ setBorderRadius(LengthSize(Length(s.width(), Fixed), Length(s.height(), Fixed)));
+ }
+
void getBorderRadiiForRect(const IntRect&, IntSize& topLeft, IntSize& topRight, IntSize& bottomLeft, IntSize& bottomRight) const;
-
- void setBorderLeftWidth(unsigned short v) { SET_VAR(surround, border.left.width, v) }
- void setBorderLeftStyle(EBorderStyle v) { SET_VAR(surround, border.left.m_style, v) }
- void setBorderLeftColor(const Color& v) { SET_VAR(surround, border.left.color, v) }
- void setBorderRightWidth(unsigned short v) { SET_VAR(surround, border.right.width, v) }
- void setBorderRightStyle(EBorderStyle v) { SET_VAR(surround, border.right.m_style, v) }
- void setBorderRightColor(const Color& v) { SET_VAR(surround, border.right.color, v) }
- void setBorderTopWidth(unsigned short v) { SET_VAR(surround, border.top.width, v) }
- void setBorderTopStyle(EBorderStyle v) { SET_VAR(surround, border.top.m_style, v) }
- void setBorderTopColor(const Color& v) { SET_VAR(surround, border.top.color, v) }
- void setBorderBottomWidth(unsigned short v) { SET_VAR(surround, border.bottom.width, v) }
- void setBorderBottomStyle(EBorderStyle v) { SET_VAR(surround, border.bottom.m_style, v) }
- void setBorderBottomColor(const Color& v) { SET_VAR(surround, border.bottom.color, v) }
- void setOutlineWidth(unsigned short v) { SET_VAR(background, m_outline.width, v) }
+ void getInnerBorderRadiiForRectWithBorderWidths(const IntRect&, unsigned short topWidth,
+ unsigned short bottomWidth, unsigned short leftWidth, unsigned short rightWidth,
+ IntSize& innerTopLeft, IntSize& innerTopRight, IntSize& innerBottomLeft,
+ IntSize& innerBottomRight) const;
+
+ 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_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_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_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_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(background, m_outline.m_style, v)
- SET_VAR(background, m_outline._auto, isAuto)
+ SET_VAR(m_background, m_outline.m_style, v)
+ SET_VAR(m_background, m_outline.m_isAuto, isAuto)
}
- void setOutlineColor(const Color& v) { SET_VAR(background, m_outline.color, 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; }
void setVisibility(EVisibility v) { inherited_flags._visibility = v; }
void setVerticalAlign(EVerticalAlign v) { noninherited_flags._vertical_align = v; }
- void setVerticalAlignLength(Length l) { SET_VAR(box, vertical_align, l) }
+ void setVerticalAlignLength(Length l) { SET_VAR(m_box, m_verticalAlign, l) }
void setHasClip(bool b = true) { SET_VAR(visual, hasClip, b) }
void setClipLeft(Length v) { SET_VAR(visual, clip.m_left, v) }
void setClipTop(Length v) { SET_VAR(visual, clip.m_top, v) }
void setClipBottom(Length v) { SET_VAR(visual, clip.m_bottom, v) }
void setClip(Length top, Length right, Length bottom, Length left);
+ void setClip(LengthBox box) { SET_VAR(visual, clip, box) }
void setUnicodeBidi(EUnicodeBidi b) { noninherited_flags._unicodeBidi = b; }
void setBlendedFontSize(int);
void setColor(const Color& v) { SET_VAR(inherited, color, v) }
- void setTextIndent(Length v) { SET_VAR(inherited, indent, v) }
+ 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(int v) { inherited_flags._text_decorations |= v; }
void setDirection(TextDirection v) { inherited_flags._direction = v; }
void setLineHeight(Length v) { SET_VAR(inherited, line_height, v) }
void setZoom(float f) { SET_VAR(visual, m_zoom, f); setEffectiveZoom(effectiveZoom() * zoom()); }
- void setEffectiveZoom(float f) { SET_VAR(inherited, m_effectiveZoom, f) }
+ void setEffectiveZoom(float f) { SET_VAR(rareInheritedData, m_effectiveZoom, f) }
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 clearBackgroundLayers() { background.access()->m_background = FillLayer(BackgroundFillLayer); }
- void inheritBackgroundLayers(const FillLayer& parent) { background.access()->m_background = parent; }
+ void clearBackgroundLayers() { m_background.access()->m_background = FillLayer(BackgroundFillLayer); }
+ void inheritBackgroundLayers(const FillLayer& parent) { m_background.access()->m_background = parent; }
void adjustBackgroundLayers()
{
void setEmptyCells(EEmptyCell v) { inherited_flags._empty_cells = v; }
void setCaptionSide(ECaptionSide v) { inherited_flags._caption_side = v; }
- void setCounterIncrement(short v) { SET_VAR(visual, counterIncrement, v) }
- void setCounterReset(short v) { SET_VAR(visual, counterReset, v) }
+ void setCounterIncrement(short v) { SET_VAR(rareNonInheritedData, m_counterIncrement, v) }
+ void setCounterReset(short v) { SET_VAR(rareNonInheritedData, m_counterReset, v) }
void setListStyleType(EListStyleType v) { inherited_flags._list_style_type = v; }
- void setListStyleImage(StyleImage* v) { if (inherited->list_style_image != v) inherited.access()->list_style_image = v; }
+ void setListStyleImage(PassRefPtr<StyleImage> v) { if (inherited->list_style_image != v) inherited.access()->list_style_image = v; }
void setListStylePosition(EListStylePosition v) { inherited_flags._list_style_position = v; }
void resetMargin() { SET_VAR(surround, margin, LengthBox(Fixed)) }
void setPaddingRight(Length v) { SET_VAR(surround, padding.m_right, v) }
void setCursor(ECursor c) { inherited_flags._cursor_style = c; }
- void addCursor(CachedImage*, const IntPoint& = IntPoint());
+ void addCursor(PassRefPtr<StyleImage>, const IntPoint& hotSpot = IntPoint());
void setCursorList(PassRefPtr<CursorList>);
void clearCursorList();
+ void setInsideLink(EInsideLink insideLink) { inherited_flags._insideLink = insideLink; }
+ void setIsLink(bool b) { noninherited_flags._isLink = b; }
+
bool forceBackgroundsToWhite() const { return inherited_flags._force_backgrounds_to_white; }
void setForceBackgroundsToWhite(bool b=true) { inherited_flags._force_backgrounds_to_white = b; }
- bool htmlHacks() const { return inherited_flags._htmlHacks; }
- void setHtmlHacks(bool b=true) { inherited_flags._htmlHacks = b; }
-
- bool hasAutoZIndex() const { return box->z_auto; }
- void setHasAutoZIndex() { SET_VAR(box, z_auto, true); SET_VAR(box, z_index, 0) }
- int zIndex() const { return box->z_index; }
- void setZIndex(int v) { SET_VAR(box, z_auto, false); SET_VAR(box, z_index, v) }
+ bool hasAutoZIndex() const { return m_box->hasAutoZIndex(); }
+ void setHasAutoZIndex() { SET_VAR(m_box, m_hasAutoZIndex, true); SET_VAR(m_box, m_zIndex, 0) }
+ int zIndex() const { return m_box->zIndex(); }
+ void setZIndex(int v) { SET_VAR(m_box, m_hasAutoZIndex, false); SET_VAR(m_box, m_zIndex, v) }
- void setWidows(short w) { SET_VAR(inherited, widows, w); }
- void setOrphans(short o) { SET_VAR(inherited, orphans, o); }
+ void setWidows(short w) { SET_VAR(rareInheritedData, widows, w); }
+ void setOrphans(short o) { SET_VAR(rareInheritedData, orphans, o); }
void setPageBreakInside(EPageBreak b) { noninherited_flags._page_break_inside = b; }
void setPageBreakBefore(EPageBreak b) { noninherited_flags._page_break_before = b; }
void setPageBreakAfter(EPageBreak b) { noninherited_flags._page_break_after = b; }
// CSS3 Setters
-#if ENABLE(XBL)
- void deleteBindingURIs() { SET_VAR(rareNonInheritedData, bindingURI, static_cast<BindingURI*>(0)); }
- void inheritBindingURIs(BindingURI* other) { SET_VAR(rareNonInheritedData, bindingURI, other->copy()); }
- void addBindingURI(StringImpl* uri);
-#endif
-
- void setOutlineOffset(int v) { SET_VAR(background, m_outline._offset, v) }
+ void setOutlineOffset(int v) { SET_VAR(m_background, m_outline.m_offset, v) }
void setTextShadow(ShadowData* val, bool add=false);
void setTextStrokeColor(const Color& c) { SET_VAR(rareInheritedData, textStrokeColor, c) }
void setTextStrokeWidth(float w) { SET_VAR(rareInheritedData, textStrokeWidth, w) }
void setBoxPack(EBoxAlignment p) { SET_VAR(rareNonInheritedData.access()->flexibleBox, pack, p); }
void setBoxShadow(ShadowData* val, bool add=false);
void setBoxReflect(PassRefPtr<StyleReflection> reflect) { if (rareNonInheritedData->m_boxReflect != reflect) rareNonInheritedData.access()->m_boxReflect = reflect; }
- void setBoxSizing(EBoxSizing s) { SET_VAR(box, boxSizing, s); }
+ void setBoxSizing(EBoxSizing s) { SET_VAR(m_box, m_boxSizing, s); }
void setMarqueeIncrement(const Length& f) { SET_VAR(rareNonInheritedData.access()->marquee, increment, f); }
void setMarqueeSpeed(int f) { SET_VAR(rareNonInheritedData.access()->marquee, speed, f); }
void setMarqueeDirection(EMarqueeDirection d) { SET_VAR(rareNonInheritedData.access()->marquee, direction, d); }
void setUserDrag(EUserDrag d) { SET_VAR(rareNonInheritedData, userDrag, d); }
void setUserSelect(EUserSelect s) { SET_VAR(rareInheritedData, userSelect, s); }
void setTextOverflow(bool b) { SET_VAR(rareNonInheritedData, textOverflow, b); }
- void setMarginTopCollapse(EMarginCollapse c) { SET_VAR(rareNonInheritedData, marginTopCollapse, c); }
- void setMarginBottomCollapse(EMarginCollapse c) { SET_VAR(rareNonInheritedData, marginBottomCollapse, c); }
+ void setMarginBeforeCollapse(EMarginCollapse c) { SET_VAR(rareNonInheritedData, marginBeforeCollapse, c); }
+ void setMarginAfterCollapse(EMarginCollapse c) { SET_VAR(rareNonInheritedData, marginAfterCollapse, c); }
void setWordBreak(EWordBreak b) { SET_VAR(rareInheritedData, wordBreak, b); }
void setWordWrap(EWordWrap b) { SET_VAR(rareInheritedData, wordWrap, b); }
void setNBSPMode(ENBSPMode b) { SET_VAR(rareInheritedData, nbspMode, b); }
void setKHTMLLineBreak(EKHTMLLineBreak b) { SET_VAR(rareInheritedData, khtmlLineBreak, b); }
void setMatchNearestMailBlockquoteColor(EMatchNearestMailBlockquoteColor c) { SET_VAR(rareNonInheritedData, matchNearestMailBlockquoteColor, c); }
void setHighlight(const AtomicString& h) { SET_VAR(rareInheritedData, highlight, h); }
+ void setHyphens(Hyphens h) { SET_VAR(rareInheritedData, hyphens, h); }
+ void setHyphenationString(const AtomicString& h) { SET_VAR(rareInheritedData, hyphenationString, h); }
+ void setHyphenationLocale(const AtomicString& h) { SET_VAR(rareInheritedData, hyphenationLocale, h); }
void setBorderFit(EBorderFit b) { SET_VAR(rareNonInheritedData, m_borderFit, b); }
void setResize(EResize r) { SET_VAR(rareInheritedData, resize, r); }
void setColumnWidth(float f) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_autoWidth, false); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_width, f); }
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_VAR(rareNonInheritedData.access()->m_multiCol, m_rule.color, 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.width, w); }
+ 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()) }
+ void setColumnSpan(bool b) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_columnSpan, b); }
void setColumnBreakBefore(EPageBreak p) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_breakBefore, p); }
void setColumnBreakInside(EPageBreak p) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_breakInside, p); }
void setColumnBreakAfter(EPageBreak p) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_breakAfter, p); }
+ void inheritColumnPropertiesFrom(RenderStyle* parent) { rareNonInheritedData.access()->m_multiCol = parent->rareNonInheritedData->m_multiCol; }
void setTransform(const TransformOperations& ops) { SET_VAR(rareNonInheritedData.access()->m_transform, m_operations, ops); }
void setTransformOriginX(Length l) { SET_VAR(rareNonInheritedData.access()->m_transform, m_x, l); }
void setTransformOriginY(Length l) { SET_VAR(rareNonInheritedData.access()->m_transform, m_y, l); }
void setTransformOriginZ(float f) { SET_VAR(rareNonInheritedData.access()->m_transform, m_z, f); }
+ void setSpeak(ESpeak s) { SET_VAR(rareInheritedData, speak, s); }
// End CSS3 Setters
// Apple-specific property setters
rareNonInheritedData.access()->m_transitions.clear();
}
- void inheritAnimations(const AnimationList* parent) { rareNonInheritedData.access()->m_animations.set(parent ? new AnimationList(*parent) : 0); }
- void inheritTransitions(const AnimationList* parent) { rareNonInheritedData.access()->m_transitions.set(parent ? new AnimationList(*parent) : 0); }
+ void inheritAnimations(const AnimationList* parent) { rareNonInheritedData.access()->m_animations = parent ? adoptPtr(new AnimationList(*parent)) : PassOwnPtr<AnimationList>(); }
+ void inheritTransitions(const AnimationList* parent) { rareNonInheritedData.access()->m_transitions = parent ? adoptPtr(new AnimationList(*parent)) : PassOwnPtr<AnimationList>(); }
void adjustAnimations();
void adjustTransitions();
void setPerspective(float p) { SET_VAR(rareNonInheritedData, m_perspective, p); }
void setPerspectiveOriginX(Length l) { SET_VAR(rareNonInheritedData, m_perspectiveOriginX, l); }
void setPerspectiveOriginY(Length l) { SET_VAR(rareNonInheritedData, m_perspectiveOriginY, l); }
+ void setPageSize(LengthSize s) { SET_VAR(rareNonInheritedData, m_pageSize, s); }
+ void setPageSizeType(PageSizeType t) { SET_VAR(rareNonInheritedData, m_pageSizeType, t); }
+ void resetPageSizeType() { SET_VAR(rareNonInheritedData, m_pageSizeType, PAGE_SIZE_AUTO); }
#if USE(ACCELERATED_COMPOSITING)
void setIsRunningAcceleratedAnimation(bool b = true) { SET_VAR(rareNonInheritedData, m_runningAcceleratedAnimation, b); }
void setTextSizeAdjust(bool b) { SET_VAR(rareInheritedData, textSizeAdjust, b); }
void setTextSecurity(ETextSecurity aTextSecurity) { SET_VAR(rareInheritedData, textSecurity, aTextSecurity); }
+#ifdef ANDROID_CSS_RING
+ void setRingFillColor(const Color& v) { SET_VAR(rareInheritedData, ringFillColor, v); }
+ void setRingInnerWidth(Length v) { SET_VAR(rareInheritedData, ringInnerWidth, v); }
+ void setRingOuterWidth(Length v) { SET_VAR(rareInheritedData, ringOuterWidth, v); }
+ void setRingOutset(Length v) { SET_VAR(rareInheritedData, ringOutset, v); }
+ void setRingPressedInnerColor(const Color& v) {
+ SET_VAR(rareInheritedData, ringPressedInnerColor, v); }
+ void setRingPressedOuterColor(const Color& v) {
+ SET_VAR(rareInheritedData, ringPressedOuterColor, v); }
+ void setRingRadius(Length v) { SET_VAR(rareInheritedData, ringRadius, v); }
+ void setRingSelectedInnerColor(const Color& v) {
+ SET_VAR(rareInheritedData, ringSelectedInnerColor, v); }
+ void setRingSelectedOuterColor(const Color& v) {
+ SET_VAR(rareInheritedData, ringSelectedOuterColor, v); }
+#endif
#ifdef ANDROID_CSS_TAP_HIGHLIGHT_COLOR
void setTapHighlightColor(const Color& v) { SET_VAR(rareInheritedData, tapHighlightColor, v); }
#endif
void clearContent();
void setContent(PassRefPtr<StringImpl>, bool add = false);
void setContent(PassRefPtr<StyleImage>, bool add = false);
- void setContent(CounterContent*, bool add = false);
+ void setContent(PassOwnPtr<CounterContent>, bool add = false);
const CounterDirectiveMap* counterDirectives() const;
CounterDirectiveMap& accessCounterDirectives();
+ const AtomicString& hyphenString() const;
+
bool inheritedNotEqual(const RenderStyle*) const;
StyleDifference diff(const RenderStyle*, unsigned& changedContextSensitiveProperties) const;
originalDisplay() == INLINE_BOX || originalDisplay() == INLINE_TABLE;
}
- // To obtain at any time the pseudo state for a given link.
- PseudoState pseudoState() const { return static_cast<PseudoState>(m_pseudoState); }
- void setPseudoState(PseudoState s) { m_pseudoState = s; }
+ void setWritingMode(WritingMode v) { inherited_flags.m_writingMode = v; }
// To tell if this style matched attribute selectors. This makes it impossible to share.
bool affectedByAttributeSelectors() const { return m_affectedByAttributeSelectors; }
unsigned childIndex() const { return m_childIndex; }
void setChildIndex(unsigned index) { m_childIndex = index; }
+ const Color visitedDependentColor(int colorProperty) const;
+
// Initial values for all the properties
static bool initialBorderCollapse() { return false; }
static EBorderStyle initialBorderStyle() { return BNONE; }
static NinePieceImage initialNinePieceImage() { return NinePieceImage(); }
- static IntSize initialBorderRadius() { return IntSize(0, 0); }
+ static LengthSize initialBorderRadius() { return LengthSize(Length(0, Fixed), Length(0, Fixed)); }
static ECaptionSide initialCaptionSide() { return CAPTOP; }
static EClear initialClear() { return CNONE; }
static TextDirection initialDirection() { return LTR; }
+ static WritingMode initialWritingMode() { return TopToBottomWritingMode; }
static EDisplay initialDisplay() { return INLINE; }
static EEmptyCell initialEmptyCells() { return SHOW; }
static EFloat initialFloating() { return FNONE; }
static EUserDrag initialUserDrag() { return DRAG_AUTO; }
static EUserSelect initialUserSelect() { return SELECT_TEXT; }
static bool initialTextOverflow() { return false; }
- static EMarginCollapse initialMarginTopCollapse() { return MCOLLAPSE; }
- static EMarginCollapse initialMarginBottomCollapse() { return MCOLLAPSE; }
+ static EMarginCollapse initialMarginBeforeCollapse() { return MCOLLAPSE; }
+ static EMarginCollapse initialMarginAfterCollapse() { return MCOLLAPSE; }
static EWordBreak initialWordBreak() { return NormalWordBreak; }
static EWordWrap initialWordWrap() { return NormalWordWrap; }
static ENBSPMode initialNBSPMode() { return NBNORMAL; }
static EKHTMLLineBreak initialKHTMLLineBreak() { return LBNORMAL; }
static EMatchNearestMailBlockquoteColor initialMatchNearestMailBlockquoteColor() { return BCNORMAL; }
static const AtomicString& initialHighlight() { return nullAtom; }
+ static ESpeak initialSpeak() { return SpeakNormal; }
+ static Hyphens initialHyphens() { return HyphensManual; }
+ static const AtomicString& initialHyphenationString() { return nullAtom; }
+ static const AtomicString& initialHyphenationLocale() { return nullAtom; }
static EBorderFit initialBorderFit() { return BorderFitBorder; }
static EResize initialResize() { return RESIZE_NONE; }
static ControlPart initialAppearance() { return NoControlPart; }
static bool initialVisuallyOrdered() { return false; }
static float initialTextStrokeWidth() { return 0; }
static unsigned short initialColumnCount() { return 1; }
+ static bool initialColumnSpan() { return false; }
static const TransformOperations& initialTransform() { DEFINE_STATIC_LOCAL(TransformOperations, ops, ()); return ops; }
static Length initialTransformOriginX() { return Length(50.0, Percent); }
static Length initialTransformOriginY() { return Length(50.0, Percent); }
static const Vector<StyleDashboardRegion>& noneDashboardRegions();
#endif
+#ifdef ANDROID_CSS_RING
+ static Color initialRingFillColor() { return Color::ringFill; }
+ static Length initialRingInnerWidth() { return Length(24, Fixed); } // 1.5
+ static Length initialRingOuterWidth() { return Length(52, Fixed); } // 3.25
+ static Length initialRingOutset() { return Length(2, Fixed); }
+ static Color initialRingSelectedInnerColor() { return Color::ringSelectedInner; }
+ static Color initialRingSelectedOuterColor() { return Color::ringSelectedOuter; }
+ static Color initialRingPressedInnerColor() { return Color::ringPressedInner; }
+ static Color initialRingPressedOuterColor() { return Color::ringPressedOuter; }
+ static Length initialRingRadius() { return Length(5, Fixed); }
+#endif
#ifdef ANDROID_CSS_TAP_HIGHLIGHT_COLOR
static Color initialTapHighlightColor() { return Color::tap; }
#endif
+
+private:
+ void getShadowExtent(const ShadowData*, int& top, int& right, int& bottom, int& left) const;
+ void getShadowHorizontalExtent(const ShadowData*, int& left, int& right) const;
+ void getShadowVerticalExtent(const ShadowData*, int& top, int& bottom) const;
+ void getShadowInlineDirectionExtent(const ShadowData* shadow, int& logicalLeft, int& logicalRight) const
+ {
+ return isHorizontalWritingMode() ? getShadowHorizontalExtent(shadow, logicalLeft, logicalRight) : getShadowVerticalExtent(shadow, logicalLeft, logicalRight);
+ }
+ void getShadowBlockDirectionExtent(const ShadowData* shadow, int& logicalTop, int& logicalBottom) const
+ {
+ return isHorizontalWritingMode() ? getShadowVerticalExtent(shadow, logicalTop, logicalBottom) : getShadowHorizontalExtent(shadow, logicalTop, logicalBottom);
+ }
+
+ // Color accessors are all private to make sure callers use visitedDependentColor instead to access them.
+ 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& textFillColor() const { return rareInheritedData->textFillColor; }
+ const Color& textStrokeColor() const { return rareInheritedData->textStrokeColor; }
+
+ const Color colorIncludingFallback(int colorProperty, EBorderStyle borderStyle) const;
+
+ ContentData* prepareToSetContent(StringImpl*, bool add);
};
+inline int adjustForAbsoluteZoom(int value, const RenderStyle* style)
+{
+ double zoomFactor = style->effectiveZoom();
+ if (zoomFactor == 1)
+ return value;
+ // Needed because computeLengthInt truncates (rather than rounds) when scaling up.
+ if (zoomFactor > 1)
+ value++;
+
+ return roundForImpreciseConversion<int, INT_MAX, INT_MIN>(value / zoomFactor);
+}
+
} // namespace WebCore
#endif // RenderStyle_h