diff options
Diffstat (limited to 'WebCore/rendering/style')
-rw-r--r-- | WebCore/rendering/style/FillLayer.cpp | 8 | ||||
-rw-r--r-- | WebCore/rendering/style/FillLayer.h | 4 | ||||
-rw-r--r-- | WebCore/rendering/style/RenderStyle.cpp | 25 | ||||
-rw-r--r-- | WebCore/rendering/style/RenderStyle.h | 27 | ||||
-rw-r--r-- | WebCore/rendering/style/StyleInheritedData.cpp | 27 | ||||
-rw-r--r-- | WebCore/rendering/style/StyleInheritedData.h | 10 | ||||
-rw-r--r-- | WebCore/rendering/style/StyleRareInheritedData.cpp | 23 | ||||
-rw-r--r-- | WebCore/rendering/style/StyleRareInheritedData.h | 11 | ||||
-rw-r--r-- | WebCore/rendering/style/StyleRareNonInheritedData.cpp | 6 | ||||
-rw-r--r-- | WebCore/rendering/style/StyleRareNonInheritedData.h | 6 | ||||
-rw-r--r-- | WebCore/rendering/style/StyleVisualData.cpp | 4 | ||||
-rw-r--r-- | WebCore/rendering/style/StyleVisualData.h | 5 |
12 files changed, 78 insertions, 78 deletions
diff --git a/WebCore/rendering/style/FillLayer.cpp b/WebCore/rendering/style/FillLayer.cpp index 597e919..59f3bb2 100644 --- a/WebCore/rendering/style/FillLayer.cpp +++ b/WebCore/rendering/style/FillLayer.cpp @@ -25,7 +25,8 @@ namespace WebCore { FillLayer::FillLayer(EFillLayerType type) - : m_image(FillLayer::initialFillImage(type)) + : m_next(0) + , m_image(FillLayer::initialFillImage(type)) , m_xPosition(FillLayer::initialFillXPosition(type)) , m_yPosition(FillLayer::initialFillYPosition(type)) , m_attachment(FillLayer::initialFillAttachment(type)) @@ -46,12 +47,12 @@ FillLayer::FillLayer(EFillLayerType type) , m_yPosSet(false) , m_compositeSet(type == MaskFillLayer) , m_type(type) - , m_next(0) { } FillLayer::FillLayer(const FillLayer& o) - : m_image(o.m_image) + : m_next(o.m_next ? new FillLayer(*o.m_next) : 0) + , m_image(o.m_image) , m_xPosition(o.m_xPosition) , m_yPosition(o.m_yPosition) , m_attachment(o.m_attachment) @@ -72,7 +73,6 @@ FillLayer::FillLayer(const FillLayer& o) , m_yPosSet(o.m_yPosSet) , m_compositeSet(o.m_compositeSet) , m_type(o.m_type) - , m_next(o.m_next ? new FillLayer(*o.m_next) : 0) { } diff --git a/WebCore/rendering/style/FillLayer.h b/WebCore/rendering/style/FillLayer.h index eb21ec3..49fb294 100644 --- a/WebCore/rendering/style/FillLayer.h +++ b/WebCore/rendering/style/FillLayer.h @@ -166,6 +166,8 @@ private: FillLayer() { } + FillLayer* m_next; + RefPtr<StyleImage> m_image; Length m_xPosition; @@ -192,8 +194,6 @@ private: bool m_compositeSet : 1; unsigned m_type : 1; // EFillLayerType - - FillLayer* m_next; }; } // namespace WebCore diff --git a/WebCore/rendering/style/RenderStyle.cpp b/WebCore/rendering/style/RenderStyle.cpp index f3b3f0c..7ef580f 100644 --- a/WebCore/rendering/style/RenderStyle.cpp +++ b/WebCore/rendering/style/RenderStyle.cpp @@ -379,6 +379,8 @@ StyleDifference RenderStyle::diff(const RenderStyle* other, unsigned& changedCon if (rareInheritedData.get() != other->rareInheritedData.get()) { if (rareInheritedData->highlight != other->rareInheritedData->highlight || + rareInheritedData->indent != other->rareInheritedData->indent || + rareInheritedData->m_effectiveZoom != other->rareInheritedData->m_effectiveZoom || rareInheritedData->textSizeAdjust != other->rareInheritedData->textSizeAdjust || rareInheritedData->wordBreak != other->rareInheritedData->wordBreak || rareInheritedData->wordWrap != other->rareInheritedData->wordWrap || @@ -394,8 +396,7 @@ StyleDifference RenderStyle::diff(const RenderStyle* other, unsigned& changedCon return StyleDifferenceLayout; } - if (inherited->indent != other->inherited->indent || - inherited->line_height != other->inherited->line_height || + if (inherited->line_height != other->inherited->line_height || inherited->list_style_image != other->inherited->list_style_image || inherited->font != other->inherited->font || inherited->horizontal_border_spacing != other->inherited->horizontal_border_spacing || @@ -461,11 +462,8 @@ StyleDifference RenderStyle::diff(const RenderStyle* other, unsigned& changedCon const CounterDirectiveMap* mapB = other->rareNonInheritedData->m_counterDirectives.get(); if (!(mapA == mapB || (mapA && mapB && *mapA == *mapB))) return StyleDifferenceLayout; - if (visual->counterIncrement != other->visual->counterIncrement || - visual->counterReset != other->visual->counterReset) - return StyleDifferenceLayout; - - if (inherited->m_effectiveZoom != other->inherited->m_effectiveZoom) + if (rareNonInheritedData->m_counterIncrement != other->rareNonInheritedData->m_counterIncrement || + rareNonInheritedData->m_counterReset != other->rareNonInheritedData->m_counterReset) return StyleDifferenceLayout; if ((rareNonInheritedData->opacity == 1 && other->rareNonInheritedData->opacity < 1) || @@ -553,20 +551,20 @@ void RenderStyle::setClip(Length top, Length right, Length bottom, Length left) void RenderStyle::addCursor(CachedImage* image, const IntPoint& hotSpot) { - if (!inherited.access()->cursorData) - inherited.access()->cursorData = CursorList::create(); - inherited.access()->cursorData->append(CursorData(image, hotSpot)); + if (!rareInheritedData.access()->cursorData) + rareInheritedData.access()->cursorData = CursorList::create(); + rareInheritedData.access()->cursorData->append(CursorData(image, hotSpot)); } void RenderStyle::setCursorList(PassRefPtr<CursorList> other) { - inherited.access()->cursorData = other; + rareInheritedData.access()->cursorData = other; } void RenderStyle::clearCursorList() { - if (inherited->cursorData) - inherited.access()->cursorData = 0; + if (rareInheritedData->cursorData) + rareInheritedData.access()->cursorData = 0; } void RenderStyle::clearContent() @@ -1035,7 +1033,6 @@ static Color colorIncludingFallback(const RenderStyle* style, int colorProperty, result = style->textStrokeColor(); break; default: - // FIXME: Add SVG fill and stroke. ASSERT_NOT_REACHED(); break; } diff --git a/WebCore/rendering/style/RenderStyle.h b/WebCore/rendering/style/RenderStyle.h index 815fb30..970b26a 100644 --- a/WebCore/rendering/style/RenderStyle.h +++ b/WebCore/rendering/style/RenderStyle.h @@ -452,7 +452,7 @@ public: 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; } @@ -461,7 +461,7 @@ public: 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); } Length lineHeight() const { return inherited->line_height; } @@ -572,8 +572,8 @@ public: 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(); } @@ -592,13 +592,13 @@ public: 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); } @@ -661,6 +661,7 @@ public: 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(); } @@ -852,7 +853,7 @@ public: 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; } @@ -861,7 +862,7 @@ public: 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; } @@ -901,8 +902,8 @@ public: 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; } @@ -940,8 +941,8 @@ public: 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; } diff --git a/WebCore/rendering/style/StyleInheritedData.cpp b/WebCore/rendering/style/StyleInheritedData.cpp index c73497f..874d053 100644 --- a/WebCore/rendering/style/StyleInheritedData.cpp +++ b/WebCore/rendering/style/StyleInheritedData.cpp @@ -28,15 +28,11 @@ namespace WebCore { StyleInheritedData::StyleInheritedData() - : indent(RenderStyle::initialTextIndent()) - , line_height(RenderStyle::initialLineHeight()) + : line_height(RenderStyle::initialLineHeight()) , list_style_image(RenderStyle::initialListStyleImage()) , color(RenderStyle::initialColor()) - , m_effectiveZoom(RenderStyle::initialZoom()) , horizontal_border_spacing(RenderStyle::initialHorizontalBorderSpacing()) , vertical_border_spacing(RenderStyle::initialVerticalBorderSpacing()) - , widows(RenderStyle::initialWidows()) - , orphans(RenderStyle::initialOrphans()) { } @@ -46,43 +42,24 @@ StyleInheritedData::~StyleInheritedData() StyleInheritedData::StyleInheritedData(const StyleInheritedData& o) : RefCounted<StyleInheritedData>() - , indent(o.indent) , line_height(o.line_height) , list_style_image(o.list_style_image) - , cursorData(o.cursorData) , font(o.font) , color(o.color) - , m_effectiveZoom(o.m_effectiveZoom) , horizontal_border_spacing(o.horizontal_border_spacing) , vertical_border_spacing(o.vertical_border_spacing) - , widows(o.widows) - , orphans(o.orphans) { } -static bool cursorDataEquivalent(const CursorList* c1, const CursorList* c2) -{ - if (c1 == c2) - return true; - if ((!c1 && c2) || (c1 && !c2)) - return false; - return (*c1 == *c2); -} - bool StyleInheritedData::operator==(const StyleInheritedData& o) const { return - indent == o.indent && line_height == o.line_height && StyleImage::imagesEquivalent(list_style_image.get(), o.list_style_image.get()) && - cursorDataEquivalent(cursorData.get(), o.cursorData.get()) && font == o.font && color == o.color && - m_effectiveZoom == o.m_effectiveZoom && horizontal_border_spacing == o.horizontal_border_spacing && - vertical_border_spacing == o.vertical_border_spacing && - widows == o.widows && - orphans == o.orphans; + vertical_border_spacing == o.vertical_border_spacing; } } // namespace WebCore diff --git a/WebCore/rendering/style/StyleInheritedData.h b/WebCore/rendering/style/StyleInheritedData.h index 3b30b8f..ea398db 100644 --- a/WebCore/rendering/style/StyleInheritedData.h +++ b/WebCore/rendering/style/StyleInheritedData.h @@ -35,7 +35,6 @@ namespace WebCore { class StyleImage; -class CursorList; class StyleInheritedData : public RefCounted<StyleInheritedData> { public: @@ -49,26 +48,17 @@ public: return !(*this == o); } - Length indent; // could be packed in a short but doesn't // make a difference currently because of padding Length line_height; RefPtr<StyleImage> list_style_image; - RefPtr<CursorList> cursorData; Font font; Color color; - - float m_effectiveZoom; short horizontal_border_spacing; short vertical_border_spacing; - - // Paged media properties. - short widows; - short orphans; - private: StyleInheritedData(); StyleInheritedData(const StyleInheritedData&); diff --git a/WebCore/rendering/style/StyleRareInheritedData.cpp b/WebCore/rendering/style/StyleRareInheritedData.cpp index ff626b7..04923d5 100644 --- a/WebCore/rendering/style/StyleRareInheritedData.cpp +++ b/WebCore/rendering/style/StyleRareInheritedData.cpp @@ -33,6 +33,10 @@ StyleRareInheritedData::StyleRareInheritedData() , tapHighlightColor(RenderStyle::initialTapHighlightColor()) #endif , textShadow(0) + , indent(RenderStyle::initialTextIndent()) + , m_effectiveZoom(RenderStyle::initialZoom()) + , widows(RenderStyle::initialWidows()) + , orphans(RenderStyle::initialOrphans()) , textSecurity(RenderStyle::initialTextSecurity()) , userModify(READ_ONLY) , wordBreak(RenderStyle::initialWordBreak()) @@ -56,6 +60,11 @@ StyleRareInheritedData::StyleRareInheritedData(const StyleRareInheritedData& o) #endif , textShadow(o.textShadow ? new ShadowData(*o.textShadow) : 0) , highlight(o.highlight) + , cursorData(o.cursorData) + , indent(o.indent) + , m_effectiveZoom(o.m_effectiveZoom) + , widows(o.widows) + , orphans(o.orphans) , textSecurity(o.textSecurity) , userModify(o.userModify) , wordBreak(o.wordBreak) @@ -74,6 +83,15 @@ StyleRareInheritedData::~StyleRareInheritedData() delete textShadow; } +static bool cursorDataEquivalent(const CursorList* c1, const CursorList* c2) +{ + if (c1 == c2) + return true; + if ((!c1 && c2) || (c1 && !c2)) + return false; + return (*c1 == *c2); +} + bool StyleRareInheritedData::operator==(const StyleRareInheritedData& o) const { return textStrokeColor == o.textStrokeColor @@ -81,6 +99,11 @@ bool StyleRareInheritedData::operator==(const StyleRareInheritedData& o) const && textFillColor == o.textFillColor && shadowDataEquivalent(o) && highlight == o.highlight + && cursorDataEquivalent(cursorData.get(), o.cursorData.get()) + && indent == o.indent + && m_effectiveZoom == o.m_effectiveZoom + && widows == o.widows + && orphans == o.orphans && textSecurity == o.textSecurity && userModify == o.userModify && wordBreak == o.wordBreak diff --git a/WebCore/rendering/style/StyleRareInheritedData.h b/WebCore/rendering/style/StyleRareInheritedData.h index 8f128fd..3ad8b0b 100644 --- a/WebCore/rendering/style/StyleRareInheritedData.h +++ b/WebCore/rendering/style/StyleRareInheritedData.h @@ -27,11 +27,13 @@ #include "AtomicString.h" #include "Color.h" +#include "Length.h" #include <wtf/RefCounted.h> #include <wtf/PassRefPtr.h> namespace WebCore { +class CursorList; class ShadowData; // This struct is for rarely used inherited CSS3, CSS2, and WebKit-specific properties. @@ -59,6 +61,15 @@ public: ShadowData* textShadow; // Our text shadow information for shadowed text drawing. AtomicString highlight; // Apple-specific extension for custom highlight rendering. + + RefPtr<CursorList> cursorData; + Length indent; + float m_effectiveZoom; + + // Paged media properties. + short widows; + short orphans; + unsigned textSecurity : 2; // ETextSecurity unsigned userModify : 2; // EUserModify (editing) unsigned wordBreak : 2; // EWordBreak diff --git a/WebCore/rendering/style/StyleRareNonInheritedData.cpp b/WebCore/rendering/style/StyleRareNonInheritedData.cpp index 401c04f..e3367d1 100644 --- a/WebCore/rendering/style/StyleRareNonInheritedData.cpp +++ b/WebCore/rendering/style/StyleRareNonInheritedData.cpp @@ -42,6 +42,8 @@ StyleRareNonInheritedData::StyleRareNonInheritedData() , matchNearestMailBlockquoteColor(RenderStyle::initialMatchNearestMailBlockquoteColor()) , m_appearance(RenderStyle::initialAppearance()) , m_borderFit(RenderStyle::initialBorderFit()) + , m_counterIncrement(0) + , m_counterReset(0) #if USE(ACCELERATED_COMPOSITING) , m_runningAcceleratedAnimation(false) #endif @@ -77,6 +79,8 @@ StyleRareNonInheritedData::StyleRareNonInheritedData(const StyleRareNonInherited , matchNearestMailBlockquoteColor(o.matchNearestMailBlockquoteColor) , m_appearance(o.m_appearance) , m_borderFit(o.m_borderFit) + , m_counterIncrement(o.m_counterIncrement) + , m_counterReset(o.m_counterReset) #if USE(ACCELERATED_COMPOSITING) , m_runningAcceleratedAnimation(o.m_runningAcceleratedAnimation) #endif @@ -133,6 +137,8 @@ bool StyleRareNonInheritedData::operator==(const StyleRareNonInheritedData& o) c && matchNearestMailBlockquoteColor == o.matchNearestMailBlockquoteColor && m_appearance == o.m_appearance && m_borderFit == o.m_borderFit + && m_counterIncrement == o.m_counterIncrement + && m_counterReset == o.m_counterReset #if USE(ACCELERATED_COMPOSITING) && !m_runningAcceleratedAnimation && !o.m_runningAcceleratedAnimation #endif diff --git a/WebCore/rendering/style/StyleRareNonInheritedData.h b/WebCore/rendering/style/StyleRareNonInheritedData.h index 21bbe94..d6fe96e 100644 --- a/WebCore/rendering/style/StyleRareNonInheritedData.h +++ b/WebCore/rendering/style/StyleRareNonInheritedData.h @@ -100,9 +100,13 @@ public: unsigned matchNearestMailBlockquoteColor : 1; // EMatchNearestMailBlockquoteColor, FIXME: This property needs to be eliminated. It should never have been added. unsigned m_appearance : 6; // EAppearance unsigned m_borderFit : 1; // EBorderFit + + short m_counterIncrement; + short m_counterReset; + #if USE(ACCELERATED_COMPOSITING) bool m_runningAcceleratedAnimation : 1; -#endif +#endif OwnPtr<ShadowData> m_boxShadow; // For box-shadow decorations. RefPtr<StyleReflection> m_boxReflect; diff --git a/WebCore/rendering/style/StyleVisualData.cpp b/WebCore/rendering/style/StyleVisualData.cpp index 91690cf..14996c9 100644 --- a/WebCore/rendering/style/StyleVisualData.cpp +++ b/WebCore/rendering/style/StyleVisualData.cpp @@ -29,8 +29,6 @@ namespace WebCore { StyleVisualData::StyleVisualData() : hasClip(false) , textDecoration(RenderStyle::initialTextDecoration()) - , counterIncrement(0) - , counterReset(0) , m_zoom(RenderStyle::initialZoom()) { } @@ -44,8 +42,6 @@ StyleVisualData::StyleVisualData(const StyleVisualData& o) , clip(o.clip) , hasClip(o.hasClip) , textDecoration(o.textDecoration) - , counterIncrement(o.counterIncrement) - , counterReset(o.counterReset) , m_zoom(RenderStyle::initialZoom()) { } diff --git a/WebCore/rendering/style/StyleVisualData.h b/WebCore/rendering/style/StyleVisualData.h index 613ef2f..d1f0f83 100644 --- a/WebCore/rendering/style/StyleVisualData.h +++ b/WebCore/rendering/style/StyleVisualData.h @@ -41,8 +41,6 @@ public: { return ( clip == o.clip && hasClip == o.hasClip && - counterIncrement == o.counterIncrement && - counterReset == o.counterReset && textDecoration == o.textDecoration && m_zoom == o.m_zoom); } @@ -52,9 +50,6 @@ public: bool hasClip : 1; unsigned textDecoration : 4; // Text decorations defined *only* by this element. - short counterIncrement; // ok, so these are not visual mode specific - short counterReset; // can't go to inherited, since these are not inherited - float m_zoom; private: |