diff options
Diffstat (limited to 'WebCore/rendering/style')
-rw-r--r-- | WebCore/rendering/style/ContentData.cpp | 58 | ||||
-rw-r--r-- | WebCore/rendering/style/ContentData.h | 50 | ||||
-rw-r--r-- | WebCore/rendering/style/CounterContent.h | 8 | ||||
-rw-r--r-- | WebCore/rendering/style/RenderStyle.cpp | 225 | ||||
-rw-r--r-- | WebCore/rendering/style/RenderStyle.h | 85 | ||||
-rw-r--r-- | WebCore/rendering/style/RenderStyleConstants.h | 53 | ||||
-rw-r--r-- | WebCore/rendering/style/SVGRenderStyle.cpp | 2 | ||||
-rw-r--r-- | WebCore/rendering/style/StyleInheritedData.cpp | 2 | ||||
-rw-r--r-- | WebCore/rendering/style/StyleRareInheritedData.cpp | 2 | ||||
-rw-r--r-- | WebCore/rendering/style/StyleRareNonInheritedData.cpp | 50 | ||||
-rw-r--r-- | WebCore/rendering/style/StyleRareNonInheritedData.h | 13 | ||||
-rw-r--r-- | WebCore/rendering/style/StyleTransformData.cpp | 4 | ||||
-rw-r--r-- | WebCore/rendering/style/StyleTransformData.h | 1 |
13 files changed, 384 insertions, 169 deletions
diff --git a/WebCore/rendering/style/ContentData.cpp b/WebCore/rendering/style/ContentData.cpp index b38cc49..410cad4 100644 --- a/WebCore/rendering/style/ContentData.cpp +++ b/WebCore/rendering/style/ContentData.cpp @@ -30,22 +30,9 @@ namespace WebCore { void ContentData::clear() { - switch (m_type) { - case CONTENT_NONE: - break; - case CONTENT_OBJECT: - m_content.m_image->deref(); - break; - case CONTENT_TEXT: - m_content.m_text->deref(); - break; - case CONTENT_COUNTER: - delete m_content.m_counter; - break; - } + deleteContent(); ContentData* n = m_next; - m_type = CONTENT_NONE; m_next = 0; // Reverse the list so we can delete without recursing. @@ -63,4 +50,47 @@ void ContentData::clear() } } +bool ContentData::dataEquivalent(const ContentData& other) const +{ + if (type() != other.type()) + return false; + + switch (type()) { + case CONTENT_NONE: + return true; + break; + case CONTENT_TEXT: + return equal(text(), other.text()); + break; + case CONTENT_OBJECT: + return StyleImage::imagesEquivalent(image(), other.image()); + break; + case CONTENT_COUNTER: + return *counter() == *other.counter(); + break; + } + + ASSERT_NOT_REACHED(); + return false; +} + +void ContentData::deleteContent() +{ + switch (m_type) { + case CONTENT_NONE: + break; + case CONTENT_OBJECT: + m_content.m_image->deref(); + break; + case CONTENT_TEXT: + m_content.m_text->deref(); + break; + case CONTENT_COUNTER: + delete m_content.m_counter; + break; + } + + m_type = CONTENT_NONE; +} + } // namespace WebCore diff --git a/WebCore/rendering/style/ContentData.h b/WebCore/rendering/style/ContentData.h index d924d1a..24d5f86 100644 --- a/WebCore/rendering/style/ContentData.h +++ b/WebCore/rendering/style/ContentData.h @@ -25,16 +25,18 @@ #ifndef ContentData_h #define ContentData_h +#include "PlatformString.h" #include "RenderStyleConstants.h" +#include "StringImpl.h" +#include "StyleImage.h" #include <wtf/Noncopyable.h> namespace WebCore { class CounterContent; -class StringImpl; -class StyleImage; struct ContentData : Noncopyable { +public: ContentData() : m_type(CONTENT_NONE) , m_next(0) @@ -48,7 +50,49 @@ struct ContentData : Noncopyable { void clear(); - ContentType m_type; + bool isCounter() const { return m_type == CONTENT_COUNTER; } + bool isImage() const { return m_type == CONTENT_OBJECT; } + bool isNone() const { return m_type == CONTENT_NONE; } + bool isText() const { return m_type == CONTENT_TEXT; } + + StyleContentType type() const { return m_type; } + + bool dataEquivalent(const ContentData&) const; + + StyleImage* image() const { return m_content.m_image; } + void setImage(PassRefPtr<StyleImage> image) + { + deleteContent(); + m_type = CONTENT_OBJECT; + m_content.m_image = image.releaseRef(); + } + + StringImpl* text() const { return m_content.m_text; } + void setText(PassRefPtr<StringImpl> text) + { + deleteContent(); + m_type = CONTENT_TEXT; + m_content.m_text = text.releaseRef(); + } + + CounterContent* counter() const { return m_content.m_counter; } + void setCounter(CounterContent* counter) + { + deleteContent(); + m_type = CONTENT_COUNTER; + m_content.m_counter = counter; + } + + ContentData* next() const { return m_next; } + void setNext(ContentData* next) + { + m_next = next; + } + +private: + void deleteContent(); + + StyleContentType m_type; union { StyleImage* m_image; StringImpl* m_text; diff --git a/WebCore/rendering/style/CounterContent.h b/WebCore/rendering/style/CounterContent.h index 06440ad..cf11813 100644 --- a/WebCore/rendering/style/CounterContent.h +++ b/WebCore/rendering/style/CounterContent.h @@ -49,11 +49,11 @@ private: AtomicString m_separator; }; -static inline bool operator!=(const CounterContent& a, const CounterContent& b) +static inline bool operator==(const CounterContent& a, const CounterContent& b) { - return a.identifier() != b.identifier() - || a.listStyle() != b.listStyle() - || a.separator() != b.separator(); + return a.identifier() == b.identifier() + && a.listStyle() == b.listStyle() + && a.separator() == b.separator(); } diff --git a/WebCore/rendering/style/RenderStyle.cpp b/WebCore/rendering/style/RenderStyle.cpp index 09445b9..fe53d30 100644 --- a/WebCore/rendering/style/RenderStyle.cpp +++ b/WebCore/rendering/style/RenderStyle.cpp @@ -185,7 +185,7 @@ bool RenderStyle::isStyleAvailable() const return this != CSSStyleSelector::styleNotYetAvailable(); } -static inline int pseudoBit(RenderStyle::PseudoId pseudo) +static inline int pseudoBit(PseudoId pseudo) { return 1 << (pseudo - 1); } @@ -271,14 +271,16 @@ static bool positionedObjectMoved(const LengthBox& a, const LengthBox& b) optimisations are unimplemented, and currently result in the worst case result causing a relayout of the containing block. */ -RenderStyle::Diff RenderStyle::diff(const RenderStyle* other) const +StyleDifference RenderStyle::diff(const RenderStyle* other, unsigned& changedContextSensitiveProperties) const { + changedContextSensitiveProperties = ContextSensitivePropertyNone; + #if ENABLE(SVG) // This is horribly inefficient. Eventually we'll have to integrate // this more directly by calling: Diff svgDiff = svgStyle->diff(other) // and then checking svgDiff and returning from the appropriate places below. if (m_svgStyle != other->m_svgStyle) - return Layout; + return StyleDifferenceLayout; #endif if (box->width != other->box->width || @@ -287,19 +289,19 @@ RenderStyle::Diff RenderStyle::diff(const RenderStyle* other) const box->height != other->box->height || box->min_height != other->box->min_height || box->max_height != other->box->max_height) - return Layout; + return StyleDifferenceLayout; if (box->vertical_align != other->box->vertical_align || noninherited_flags._vertical_align != other->noninherited_flags._vertical_align) - return Layout; + return StyleDifferenceLayout; if (box->boxSizing != other->box->boxSizing) - return Layout; + return StyleDifferenceLayout; if (surround->margin != other->surround->margin) - return Layout; + return StyleDifferenceLayout; if (surround->padding != other->surround->padding) - return Layout; + return StyleDifferenceLayout; if (rareNonInheritedData.get() != other->rareNonInheritedData.get()) { if (rareNonInheritedData->m_appearance != other->rareNonInheritedData->m_appearance || @@ -307,30 +309,47 @@ RenderStyle::Diff RenderStyle::diff(const RenderStyle* other) const rareNonInheritedData->marginBottomCollapse != other->rareNonInheritedData->marginBottomCollapse || rareNonInheritedData->lineClamp != other->rareNonInheritedData->lineClamp || rareNonInheritedData->textOverflow != other->rareNonInheritedData->textOverflow) - return Layout; + return StyleDifferenceLayout; if (rareNonInheritedData->flexibleBox.get() != other->rareNonInheritedData->flexibleBox.get() && *rareNonInheritedData->flexibleBox.get() != *other->rareNonInheritedData->flexibleBox.get()) - return Layout; + return StyleDifferenceLayout; if (!rareNonInheritedData->shadowDataEquivalent(*other->rareNonInheritedData.get())) - return Layout; + return StyleDifferenceLayout; if (!rareNonInheritedData->reflectionDataEquivalent(*other->rareNonInheritedData.get())) - return Layout; + return StyleDifferenceLayout; if (rareNonInheritedData->m_multiCol.get() != other->rareNonInheritedData->m_multiCol.get() && *rareNonInheritedData->m_multiCol.get() != *other->rareNonInheritedData->m_multiCol.get()) - return Layout; + return StyleDifferenceLayout; if (rareNonInheritedData->m_transform.get() != other->rareNonInheritedData->m_transform.get() && - *rareNonInheritedData->m_transform.get() != *other->rareNonInheritedData->m_transform.get()) - return Layout; + *rareNonInheritedData->m_transform.get() != *other->rareNonInheritedData->m_transform.get()) { +#if USE(ACCELERATED_COMPOSITING) + changedContextSensitiveProperties |= ContextSensitivePropertyTransform; + // Don't return; keep looking for another change +#else + return StyleDifferenceLayout; +#endif + } + +#if !USE(ACCELERATED_COMPOSITING) + if (rareNonInheritedData.get() != other->rareNonInheritedData.get()) { + if (rareNonInheritedData->m_transformStyle3D != other->rareNonInheritedData->m_transformStyle3D || + rareNonInheritedData->m_backfaceVisibility != other->rareNonInheritedData->m_backfaceVisibility || + rareNonInheritedData->m_perspective != other->rareNonInheritedData->m_perspective || + rareNonInheritedData->m_perspectiveOriginX != other->rareNonInheritedData->m_perspectiveOriginX || + rareNonInheritedData->m_perspectiveOriginY != other->rareNonInheritedData->m_perspectiveOriginY) + return StyleDifferenceLayout; + } +#endif #if ENABLE(DASHBOARD_SUPPORT) // If regions change, trigger a relayout to re-calc regions. if (rareNonInheritedData->m_dashboardRegions != other->rareNonInheritedData->m_dashboardRegions) - return Layout; + return StyleDifferenceLayout; #endif } @@ -342,13 +361,13 @@ RenderStyle::Diff RenderStyle::diff(const RenderStyle* other) const rareInheritedData->nbspMode != other->rareInheritedData->nbspMode || rareInheritedData->khtmlLineBreak != other->rareInheritedData->khtmlLineBreak || rareInheritedData->textSecurity != other->rareInheritedData->textSecurity) - return Layout; + return StyleDifferenceLayout; if (!rareInheritedData->shadowDataEquivalent(*other->rareInheritedData.get())) - return Layout; + return StyleDifferenceLayout; if (textStrokeWidth() != other->textStrokeWidth()) - return Layout; + return StyleDifferenceLayout; } if (inherited->indent != other->inherited->indent || @@ -363,7 +382,7 @@ RenderStyle::Diff RenderStyle::diff(const RenderStyle* other) const noninherited_flags._position != other->noninherited_flags._position || noninherited_flags._floating != other->noninherited_flags._floating || noninherited_flags._originalDisplay != other->noninherited_flags._originalDisplay) - return Layout; + return StyleDifferenceLayout; if (((int)noninherited_flags._effectiveDisplay) >= TABLE) { @@ -371,26 +390,26 @@ RenderStyle::Diff RenderStyle::diff(const RenderStyle* other) const inherited_flags._empty_cells != other->inherited_flags._empty_cells || inherited_flags._caption_side != other->inherited_flags._caption_side || noninherited_flags._table_layout != other->noninherited_flags._table_layout) - return Layout; + return StyleDifferenceLayout; // In the collapsing border model, 'hidden' suppresses other borders, while 'none' // does not, so these style differences can be width differences. if (inherited_flags._border_collapse && - (borderTopStyle() == BHIDDEN && other->borderTopStyle() == BNONE || - borderTopStyle() == BNONE && other->borderTopStyle() == BHIDDEN || - borderBottomStyle() == BHIDDEN && other->borderBottomStyle() == BNONE || - borderBottomStyle() == BNONE && other->borderBottomStyle() == BHIDDEN || - borderLeftStyle() == BHIDDEN && other->borderLeftStyle() == BNONE || - borderLeftStyle() == BNONE && other->borderLeftStyle() == BHIDDEN || - borderRightStyle() == BHIDDEN && other->borderRightStyle() == BNONE || - borderRightStyle() == BNONE && other->borderRightStyle() == BHIDDEN)) - return Layout; + ((borderTopStyle() == BHIDDEN && other->borderTopStyle() == BNONE) || + (borderTopStyle() == BNONE && other->borderTopStyle() == BHIDDEN) || + (borderBottomStyle() == BHIDDEN && other->borderBottomStyle() == BNONE) || + (borderBottomStyle() == BNONE && other->borderBottomStyle() == BHIDDEN) || + (borderLeftStyle() == BHIDDEN && other->borderLeftStyle() == BNONE) || + (borderLeftStyle() == BNONE && other->borderLeftStyle() == BHIDDEN) || + (borderRightStyle() == BHIDDEN && other->borderRightStyle() == BNONE) || + (borderRightStyle() == BNONE && other->borderRightStyle() == BHIDDEN))) + return StyleDifferenceLayout; } if (noninherited_flags._effectiveDisplay == LIST_ITEM) { if (inherited_flags._list_style_type != other->inherited_flags._list_style_type || inherited_flags._list_style_position != other->inherited_flags._list_style_position) - return Layout; + return StyleDifferenceLayout; } if (inherited_flags._text_align != other->inherited_flags._text_align || @@ -398,12 +417,12 @@ RenderStyle::Diff RenderStyle::diff(const RenderStyle* other) const inherited_flags._direction != other->inherited_flags._direction || inherited_flags._white_space != other->inherited_flags._white_space || noninherited_flags._clear != other->noninherited_flags._clear) - return Layout; + return StyleDifferenceLayout; // Overflow returns a layout hint. if (noninherited_flags._overflowX != other->noninherited_flags._overflowX || noninherited_flags._overflowY != other->noninherited_flags._overflowY) - return Layout; + return StyleDifferenceLayout; // If our border widths change, then we need to layout. Other changes to borders // only necessitate a repaint. @@ -411,19 +430,19 @@ RenderStyle::Diff RenderStyle::diff(const RenderStyle* other) const borderTopWidth() != other->borderTopWidth() || borderBottomWidth() != other->borderBottomWidth() || borderRightWidth() != other->borderRightWidth()) - return Layout; + return StyleDifferenceLayout; // If the counter directives change, trigger a relayout to re-calculate counter values and rebuild the counter node tree. const CounterDirectiveMap* mapA = rareNonInheritedData->m_counterDirectives.get(); const CounterDirectiveMap* mapB = other->rareNonInheritedData->m_counterDirectives.get(); if (!(mapA == mapB || (mapA && mapB && *mapA == *mapB))) - return Layout; + return StyleDifferenceLayout; if (visual->counterIncrement != other->visual->counterIncrement || visual->counterReset != other->visual->counterReset) - return Layout; + return StyleDifferenceLayout; if (inherited->m_effectiveZoom != other->inherited->m_effectiveZoom) - return Layout; + return StyleDifferenceLayout; // Make sure these left/top/right/bottom checks stay below all layout checks and above // all visible checks. @@ -431,7 +450,7 @@ RenderStyle::Diff RenderStyle::diff(const RenderStyle* other) const if (surround->offset != other->surround->offset) { // Optimize for the case where a positioned layer is moving but not changing size. if (position() == AbsolutePosition && positionedObjectMoved(surround->offset, other->surround->offset)) - return LayoutPositionedMovementOnly; + return StyleDifferenceLayoutPositionedMovementOnly; // FIXME: We will need to do a bit of work in RenderObject/Box::setStyle before we // can stop doing a layout when relative positioned objects move. In particular, we'll need @@ -439,16 +458,24 @@ RenderStyle::Diff RenderStyle::diff(const RenderStyle* other) const //if (other->position() == RelativePosition) // return RepaintLayer; //else - return Layout; + return StyleDifferenceLayout; } else if (box->z_index != other->box->z_index || box->z_auto != other->box->z_auto || visual->clip != other->visual->clip || visual->hasClip != other->visual->hasClip) - return RepaintLayer; + return StyleDifferenceRepaintLayer; + } + + if (rareNonInheritedData->opacity != other->rareNonInheritedData->opacity) { +#if USE(ACCELERATED_COMPOSITING) + changedContextSensitiveProperties |= ContextSensitivePropertyOpacity; + // Don't return; keep looking for another change. +#else + return StyleDifferenceRepaintLayer; +#endif } - if (rareNonInheritedData->opacity != other->rareNonInheritedData->opacity || - rareNonInheritedData->m_mask != other->rareNonInheritedData->m_mask || + if (rareNonInheritedData->m_mask != other->rareNonInheritedData->m_mask || rareNonInheritedData->m_maskBoxImage != other->rareNonInheritedData->m_maskBoxImage) - return RepaintLayer; + return StyleDifferenceRepaintLayer; if (inherited->color != other->inherited->color || inherited_flags._visibility != other->inherited_flags._visibility || @@ -463,19 +490,30 @@ RenderStyle::Diff RenderStyle::diff(const RenderStyle* other) const rareNonInheritedData->m_borderFit != other->rareNonInheritedData->m_borderFit || rareInheritedData->textFillColor != other->rareInheritedData->textFillColor || rareInheritedData->textStrokeColor != other->rareInheritedData->textStrokeColor) - return Repaint; + return StyleDifferenceRepaint; + +#if USE(ACCELERATED_COMPOSITING) + if (rareNonInheritedData.get() != other->rareNonInheritedData.get()) { + if (rareNonInheritedData->m_transformStyle3D != other->rareNonInheritedData->m_transformStyle3D || + rareNonInheritedData->m_backfaceVisibility != other->rareNonInheritedData->m_backfaceVisibility || + rareNonInheritedData->m_perspective != other->rareNonInheritedData->m_perspective || + rareNonInheritedData->m_perspectiveOriginX != other->rareNonInheritedData->m_perspectiveOriginX || + rareNonInheritedData->m_perspectiveOriginY != other->rareNonInheritedData->m_perspectiveOriginY) + return StyleDifferenceRecompositeLayer; + } +#endif // Cursors are not checked, since they will be set appropriately in response to mouse events, // so they don't need to cause any repaint or layout. // Animations don't need to be checked either. We always set the new style on the RenderObject, so we will get a chance to fire off // the resulting transition properly. - return Equal; + return StyleDifferenceEqual; } void RenderStyle::setClip(Length top, Length right, Length bottom, Length left) { - StyleVisualData *data = visual.access(); + StyleVisualData* data = visual.access(); data->clip.m_top = top; data->clip.m_right = right; data->clip.m_bottom = bottom; @@ -503,39 +541,6 @@ void RenderStyle::clearCursorList() inherited.access()->cursorData = 0; } -bool RenderStyle::contentDataEquivalent(const RenderStyle* otherStyle) const -{ - ContentData* c1 = rareNonInheritedData->m_content.get(); - ContentData* c2 = otherStyle->rareNonInheritedData->m_content.get(); - - while (c1 && c2) { - if (c1->m_type != c2->m_type) - return false; - - switch (c1->m_type) { - case CONTENT_NONE: - break; - case CONTENT_TEXT: - if (!equal(c1->m_content.m_text, c2->m_content.m_text)) - return false; - break; - case CONTENT_OBJECT: - if (!StyleImage::imagesEquivalent(c1->m_content.m_image, c2->m_content.m_image)) - return false; - break; - case CONTENT_COUNTER: - if (*c1->m_content.m_counter != *c2->m_content.m_counter) - return false; - break; - } - - c1 = c1->m_next; - c2 = c2->m_next; - } - - return !c1 && !c2; -} - void RenderStyle::clearContent() { if (rareNonInheritedData->m_content) @@ -549,8 +554,8 @@ void RenderStyle::setContent(PassRefPtr<StyleImage> image, bool add) OwnPtr<ContentData>& content = rareNonInheritedData.access()->m_content; ContentData* lastContent = content.get(); - while (lastContent && lastContent->m_next) - lastContent = lastContent->m_next; + while (lastContent && lastContent->next()) + lastContent = lastContent->next(); bool reuseContent = !add; ContentData* newContentData; @@ -561,34 +566,30 @@ void RenderStyle::setContent(PassRefPtr<StyleImage> image, bool add) newContentData = new ContentData; if (lastContent && !reuseContent) - lastContent->m_next = newContentData; + lastContent->setNext(newContentData); else content.set(newContentData); - newContentData->m_content.m_image = image.releaseRef(); - newContentData->m_type = CONTENT_OBJECT; + newContentData->setImage(image); } -void RenderStyle::setContent(StringImpl* s, bool add) +void RenderStyle::setContent(PassRefPtr<StringImpl> s, bool add) { if (!s) return; // The string is null. Nothing to do. Just bail. OwnPtr<ContentData>& content = rareNonInheritedData.access()->m_content; ContentData* lastContent = content.get(); - while (lastContent && lastContent->m_next) - lastContent = lastContent->m_next; + while (lastContent && lastContent->next()) + lastContent = lastContent->next(); bool reuseContent = !add; if (add && lastContent) { - if (lastContent->m_type == CONTENT_TEXT) { + if (lastContent->isText()) { // We can augment the existing string and share this ContentData node. - StringImpl* oldStr = lastContent->m_content.m_text; - String newStr = oldStr; - newStr.append(s); - newStr.impl()->ref(); - oldStr->deref(); - lastContent->m_content.m_text = newStr.impl(); + String newStr = lastContent->text(); + newStr.append(s.get()); + lastContent->setText(newStr.impl()); return; } } @@ -601,13 +602,11 @@ void RenderStyle::setContent(StringImpl* s, bool add) newContentData = new ContentData; if (lastContent && !reuseContent) - lastContent->m_next = newContentData; + lastContent->setNext(newContentData); else content.set(newContentData); - newContentData->m_content.m_text = s; - newContentData->m_content.m_text->ref(); - newContentData->m_type = CONTENT_TEXT; + newContentData->setText(s); } void RenderStyle::setContent(CounterContent* c, bool add) @@ -617,8 +616,8 @@ void RenderStyle::setContent(CounterContent* c, bool add) OwnPtr<ContentData>& content = rareNonInheritedData.access()->m_content; ContentData* lastContent = content.get(); - while (lastContent && lastContent->m_next) - lastContent = lastContent->m_next; + while (lastContent && lastContent->next()) + lastContent = lastContent->next(); bool reuseContent = !add; ContentData* newContentData = 0; @@ -629,15 +628,14 @@ void RenderStyle::setContent(CounterContent* c, bool add) newContentData = new ContentData; if (lastContent && !reuseContent) - lastContent->m_next = newContentData; + lastContent->setNext(newContentData); else content.set(newContentData); - newContentData->m_content.m_counter = c; - newContentData->m_type = CONTENT_COUNTER; + newContentData->setCounter(c); } -void RenderStyle::applyTransform(TransformationMatrix& transform, const IntSize& borderBoxSize, bool includeTransformOrigin) const +void RenderStyle::applyTransform(TransformationMatrix& transform, const IntSize& borderBoxSize, ApplyTransformOrigin applyOrigin) const { // transform-origin brackets the transform with translate operations. // Optimize for the case where the only transform is a translation, since the transform-origin is irrelevant @@ -645,26 +643,31 @@ void RenderStyle::applyTransform(TransformationMatrix& transform, const IntSize& bool applyTransformOrigin = false; unsigned s = rareNonInheritedData->m_transform->m_operations.operations().size(); unsigned i; - if (includeTransformOrigin) { + if (applyOrigin == IncludeTransformOrigin) { for (i = 0; i < s; i++) { TransformOperation::OperationType type = rareNonInheritedData->m_transform->m_operations.operations()[i]->getOperationType(); if (type != TransformOperation::TRANSLATE_X && type != TransformOperation::TRANSLATE_Y && - type != TransformOperation::TRANSLATE) { + type != TransformOperation::TRANSLATE && + type != TransformOperation::TRANSLATE_Z && + type != TransformOperation::TRANSLATE_3D + ) { applyTransformOrigin = true; break; } } } - if (applyTransformOrigin) - transform.translate(transformOriginX().calcFloatValue(borderBoxSize.width()), transformOriginY().calcFloatValue(borderBoxSize.height())); + if (applyTransformOrigin) { + transform.translate3d(transformOriginX().calcFloatValue(borderBoxSize.width()), transformOriginY().calcFloatValue(borderBoxSize.height()), transformOriginZ()); + } for (i = 0; i < s; i++) rareNonInheritedData->m_transform->m_operations.operations()[i]->apply(transform, borderBoxSize); - if (applyTransformOrigin) - transform.translate(-transformOriginX().calcFloatValue(borderBoxSize.width()), -transformOriginY().calcFloatValue(borderBoxSize.height())); + if (applyTransformOrigin) { + transform.translate3d(-transformOriginX().calcFloatValue(borderBoxSize.width()), -transformOriginY().calcFloatValue(borderBoxSize.height()), -transformOriginZ()); + } } #if ENABLE(XBL) @@ -818,7 +821,7 @@ AnimationList* RenderStyle::accessTransitions() return rareNonInheritedData->m_transitions.get(); } -const Animation* RenderStyle::transitionForProperty(int property) +const Animation* RenderStyle::transitionForProperty(int property) const { if (transitions()) { for (size_t i = 0; i < transitions()->size(); ++i) { diff --git a/WebCore/rendering/style/RenderStyle.h b/WebCore/rendering/style/RenderStyle.h index fed3057..32c0cf4 100644 --- a/WebCore/rendering/style/RenderStyle.h +++ b/WebCore/rendering/style/RenderStyle.h @@ -106,17 +106,6 @@ class StyleImage; class RenderStyle: public RefCounted<RenderStyle> { friend class CSSStyleSelector; - -public: - // static pseudo styles. Dynamic ones are produced on the fly. - enum PseudoId { NOPSEUDO, FIRST_LINE, FIRST_LETTER, BEFORE, AFTER, SELECTION, FIRST_LINE_INHERITED, SCROLLBAR, FILE_UPLOAD_BUTTON, INPUT_PLACEHOLDER, - SLIDER_THUMB, SEARCH_CANCEL_BUTTON, SEARCH_DECORATION, SEARCH_RESULTS_DECORATION, SEARCH_RESULTS_BUTTON, MEDIA_CONTROLS_PANEL, - MEDIA_CONTROLS_PLAY_BUTTON, MEDIA_CONTROLS_MUTE_BUTTON, MEDIA_CONTROLS_TIMELINE, MEDIA_CONTROLS_TIMELINE_CONTAINER, - MEDIA_CONTROLS_CURRENT_TIME_DISPLAY, MEDIA_CONTROLS_TIME_REMAINING_DISPLAY, MEDIA_CONTROLS_SEEK_BACK_BUTTON, - MEDIA_CONTROLS_SEEK_FORWARD_BUTTON, MEDIA_CONTROLS_FULLSCREEN_BUTTON, - SCROLLBAR_THUMB, SCROLLBAR_BUTTON, SCROLLBAR_TRACK, SCROLLBAR_TRACK_PIECE, SCROLLBAR_CORNER, RESIZER }; - static const int FIRST_INTERNAL_PSEUDOID = FILE_UPLOAD_BUTTON; - protected: // !START SYNC!: Keep this in sync with the copy constructor in RenderStyle.cpp @@ -335,6 +324,7 @@ public: return true; return background->m_background.hasImage(); } + bool hasBackgroundImage() const { return background->m_background.hasImage(); } bool hasFixedBackgroundImage() const { return background->m_background.hasFixedImage(); } bool hasAppearance() const { return appearance() != NoControlPart; } @@ -356,6 +346,11 @@ public: Length top() const { return surround->offset.top(); } Length bottom() const { return surround->offset.bottom(); } + // Whether or not a positioned element requires normal flow x/y to be computed + // to determine its position. + bool hasStaticX() const { return (left().isAuto() && right().isAuto()) || left().isStatic() || right().isStatic(); } + bool hasStaticY() const { return (top().isAuto() && bottom().isAuto()) || top().isStatic(); } + EPosition position() const { return static_cast<EPosition>(noninherited_flags._position); } EFloat floating() const { return static_cast<EFloat>(noninherited_flags._floating); } @@ -446,6 +441,19 @@ public: TextDirection direction() const { return static_cast<TextDirection>(inherited_flags._direction); } Length lineHeight() const { return inherited->line_height; } + int computedLineHeight() const + { + Length lh = lineHeight(); + + // Negative value means the line height is not set. Use the font's built-in spacing. + if (lh.isNegative()) + return font().lineSpacing(); + + if (lh.isPercent()) + return lh.calcMinValue(fontSize()); + + return lh.value(); + } EWhiteSpace whiteSpace() const { return static_cast<EWhiteSpace>(inherited_flags._white_space); } static bool autoWrap(EWhiteSpace ws) @@ -628,8 +636,16 @@ public: const TransformOperations& transform() const { return rareNonInheritedData->m_transform->m_operations; } Length transformOriginX() const { return rareNonInheritedData->m_transform->m_x; } Length transformOriginY() const { return rareNonInheritedData->m_transform->m_y; } + float transformOriginZ() const { return rareNonInheritedData->m_transform->m_z; } bool hasTransform() const { return !rareNonInheritedData->m_transform->m_operations.operations().isEmpty(); } - void applyTransform(TransformationMatrix&, const IntSize& borderBoxSize, bool includeTransformOrigin = true) const; + + // Return true if any transform related property (currently transform, transformStyle3D or perspective) + // indicates that we are transforming + bool hasTransformRelatedProperty() const { return hasTransform() || preserves3D() || hasPerspective(); } + + enum ApplyTransformOrigin { IncludeTransformOrigin, ExcludeTransformOrigin }; + void applyTransform(TransformationMatrix&, const IntSize& borderBoxSize, ApplyTransformOrigin = IncludeTransformOrigin) const; + bool hasMask() const { return rareNonInheritedData->m_mask.hasImage() || rareNonInheritedData->m_maskBoxImage.hasImage(); } // End CSS3 Getters @@ -645,7 +661,21 @@ public: bool hasTransitions() const { return rareNonInheritedData->m_transitions && rareNonInheritedData->m_transitions->size() > 0; } // return the first found Animation (including 'all' transitions) - const Animation* transitionForProperty(int property); + const Animation* transitionForProperty(int property) const; + + ETransformStyle3D transformStyle3D() const { return rareNonInheritedData->m_transformStyle3D; } + bool preserves3D() const { return rareNonInheritedData->m_transformStyle3D == TransformStyle3DPreserve3D; } + + EBackfaceVisibility backfaceVisibility() const { return rareNonInheritedData->m_backfaceVisibility; } + float perspective() const { return rareNonInheritedData->m_perspective; } + bool hasPerspective() const { return rareNonInheritedData->m_perspective > 0; } + Length perspectiveOriginX() const { return rareNonInheritedData->m_perspectiveOriginX; } + Length perspectiveOriginY() const { return rareNonInheritedData->m_perspectiveOriginY; } + +#if USE(ACCELERATED_COMPOSITING) + // When set, this ensures that styles compare as different. Used during accelerated animations. + bool isRunningAcceleratedAnimation() const { return rareNonInheritedData->m_runningAcceleratedAnimation; } +#endif int lineClamp() const { return rareNonInheritedData->lineClamp; } bool textSizeAdjust() const { return rareInheritedData->textSizeAdjust; } @@ -926,6 +956,7 @@ public: 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); } // End CSS3 Setters // Apple-specific property setters @@ -946,6 +977,16 @@ public: void adjustAnimations(); void adjustTransitions(); + void setTransformStyle3D(ETransformStyle3D b) { SET_VAR(rareNonInheritedData, m_transformStyle3D, b); } + void setBackfaceVisibility(EBackfaceVisibility b) { SET_VAR(rareNonInheritedData, m_backfaceVisibility, b); } + 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); } + +#if USE(ACCELERATED_COMPOSITING) + void setIsRunningAcceleratedAnimation(bool b = true) { SET_VAR(rareNonInheritedData, m_runningAcceleratedAnimation, b); } +#endif + void setLineClamp(int c) { SET_VAR(rareNonInheritedData, lineClamp, c); } void setTextSizeAdjust(bool b) { SET_VAR(rareInheritedData, textSizeAdjust, b); } void setTextSecurity(ETextSecurity aTextSecurity) { SET_VAR(rareInheritedData, textSecurity, aTextSecurity); } @@ -969,9 +1010,9 @@ public: #endif const ContentData* contentData() const { return rareNonInheritedData->m_content.get(); } - bool contentDataEquivalent(const RenderStyle* otherStyle) const; + bool contentDataEquivalent(const RenderStyle* otherStyle) const { return const_cast<RenderStyle*>(this)->rareNonInheritedData->contentDataEquivalent(*const_cast<RenderStyle*>(otherStyle)->rareNonInheritedData); } void clearContent(); - void setContent(StringImpl*, bool add = false); + void setContent(PassRefPtr<StringImpl>, bool add = false); void setContent(PassRefPtr<StyleImage>, bool add = false); void setContent(CounterContent*, bool add = false); @@ -980,13 +1021,7 @@ public: bool inheritedNotEqual(RenderStyle*) const; - // The difference between two styles. The following values are used: - // (1) Equal - The two styles are identical - // (2) Repaint - The object just needs to be repainted. - // (3) RepaintLayer - The layer and its descendant layers needs to be repainted. - // (4) Layout - A layout is required. - enum Diff { Equal, Repaint, RepaintLayer, LayoutPositionedMovementOnly, Layout }; - Diff diff(const RenderStyle*) const; + StyleDifference diff(const RenderStyle*, unsigned& changedContextSensitiveProperties) const; bool isDisplayReplacedType() const { @@ -1119,6 +1154,12 @@ public: static Length initialTransformOriginX() { return Length(50.0, Percent); } static Length initialTransformOriginY() { return Length(50.0, Percent); } static EPointerEvents initialPointerEvents() { return PE_AUTO; } + static float initialTransformOriginZ() { return 0; } + static ETransformStyle3D initialTransformStyle3D() { return TransformStyle3DFlat; } + static EBackfaceVisibility initialBackfaceVisibility() { return BackfaceVisibilityVisible; } + static float initialPerspective() { return 0; } + static Length initialPerspectiveOriginX() { return Length(50.0, Percent); } + static Length initialPerspectiveOriginY() { return Length(50.0, Percent); } // Keep these at the end. static int initialLineClamp() { return -1; } diff --git a/WebCore/rendering/style/RenderStyleConstants.h b/WebCore/rendering/style/RenderStyleConstants.h index 40ad3cc..405cf7c 100644 --- a/WebCore/rendering/style/RenderStyleConstants.h +++ b/WebCore/rendering/style/RenderStyleConstants.h @@ -36,6 +36,44 @@ namespace WebCore { * and produce invalid results. */ +// The difference between two styles. The following values are used: +// (1) StyleDifferenceEqual - The two styles are identical +// (2) StyleDifferenceRecompositeLayer - The layer needs its position and transform updated, but no repaint +// (3) StyleDifferenceRepaint - The object just needs to be repainted. +// (4) StyleDifferenceRepaintLayer - The layer and its descendant layers needs to be repainted. +// (5) StyleDifferenceLayout - A layout is required. +enum StyleDifference { + StyleDifferenceEqual, +#if USE(ACCELERATED_COMPOSITING) + StyleDifferenceRecompositeLayer, +#endif + StyleDifferenceRepaint, + StyleDifferenceRepaintLayer, + StyleDifferenceLayoutPositionedMovementOnly, + StyleDifferenceLayout +}; + +// When some style properties change, different amounts of work have to be done depending on +// context (e.g. whether the property is changing on an element which has a compositing layer). +// A simple StyleDifference does not provide enough information so we return a bit mask of +// StyleDifferenceContextSensitiveProperties from RenderStyle::diff() too. +enum StyleDifferenceContextSensitiveProperty { + ContextSensitivePropertyNone = 0, + ContextSensitivePropertyTransform = (1 << 0), + ContextSensitivePropertyOpacity = (1 << 1) +}; + +// Static pseudo styles. Dynamic ones are produced on the fly. +enum PseudoId { + NOPSEUDO, FIRST_LINE, FIRST_LETTER, BEFORE, AFTER, SELECTION, FIRST_LINE_INHERITED, SCROLLBAR, FILE_UPLOAD_BUTTON, INPUT_PLACEHOLDER, + SLIDER_THUMB, SEARCH_CANCEL_BUTTON, SEARCH_DECORATION, SEARCH_RESULTS_DECORATION, SEARCH_RESULTS_BUTTON, MEDIA_CONTROLS_PANEL, + MEDIA_CONTROLS_PLAY_BUTTON, MEDIA_CONTROLS_MUTE_BUTTON, MEDIA_CONTROLS_TIMELINE, MEDIA_CONTROLS_TIMELINE_CONTAINER, + MEDIA_CONTROLS_CURRENT_TIME_DISPLAY, MEDIA_CONTROLS_TIME_REMAINING_DISPLAY, MEDIA_CONTROLS_SEEK_BACK_BUTTON, + MEDIA_CONTROLS_SEEK_FORWARD_BUTTON, MEDIA_CONTROLS_FULLSCREEN_BUTTON, + SCROLLBAR_THUMB, SCROLLBAR_BUTTON, SCROLLBAR_TRACK, SCROLLBAR_TRACK_PIECE, SCROLLBAR_CORNER, RESIZER, + + FIRST_INTERNAL_PSEUDOID = FILE_UPLOAD_BUTTON +}; // These have been defined in the order of their precedence for border-collapsing. Do // not change this order! @@ -163,7 +201,7 @@ enum EListStyleType { HIRAGANA, KATAKANA, HIRAGANA_IROHA, KATAKANA_IROHA, LNONE }; -enum ContentType { +enum StyleContentType { CONTENT_NONE, CONTENT_OBJECT, CONTENT_TEXT, CONTENT_COUNTER }; @@ -171,11 +209,6 @@ enum EBorderFit { BorderFitBorder, BorderFitLines }; enum ETimingFunctionType { LinearTimingFunction, CubicBezierTimingFunction }; -enum EAnimPlayState { - AnimPlayStatePlaying = 0x0, - AnimPlayStatePaused = 0x1 -}; - enum EWhiteSpace { NORMAL, PRE, PRE_WRAP, PRE_LINE, NOWRAP, KHTML_NOWRAP }; @@ -263,6 +296,14 @@ enum EPointerEvents { PE_VISIBLE_STROKE, PE_VISIBLE_FILL, PE_VISIBLE_PAINTED, PE_ALL }; +enum ETransformStyle3D { + TransformStyle3DFlat, TransformStyle3DPreserve3D +}; + +enum EBackfaceVisibility { + BackfaceVisibilityVisible, BackfaceVisibilityHidden +}; + } // namespace WebCore #endif // RenderStyleConstants_h diff --git a/WebCore/rendering/style/SVGRenderStyle.cpp b/WebCore/rendering/style/SVGRenderStyle.cpp index 1749978..c5f0648 100644 --- a/WebCore/rendering/style/SVGRenderStyle.cpp +++ b/WebCore/rendering/style/SVGRenderStyle.cpp @@ -128,7 +128,7 @@ float SVGRenderStyle::cssPrimitiveToLength(const RenderObject* item, CSSValue* v return defaultValue; if (cssType == CSSPrimitiveValue::CSS_PERCENTAGE) { - SVGStyledElement* element = static_cast<SVGStyledElement*>(item->element()); + SVGStyledElement* element = static_cast<SVGStyledElement*>(item->node()); SVGElement* viewportElement = (element ? element->viewportElement() : 0); if (viewportElement) { float result = primitive->getFloatValue() / 100.0f; diff --git a/WebCore/rendering/style/StyleInheritedData.cpp b/WebCore/rendering/style/StyleInheritedData.cpp index 56d2686..f59c0c2 100644 --- a/WebCore/rendering/style/StyleInheritedData.cpp +++ b/WebCore/rendering/style/StyleInheritedData.cpp @@ -66,7 +66,7 @@ static bool cursorDataEquivalent(const CursorList* c1, const CursorList* c2) { if (c1 == c2) return true; - if (!c1 && c2 || c1 && !c2) + if ((!c1 && c2) || (c1 && !c2)) return false; return (*c1 == *c2); } diff --git a/WebCore/rendering/style/StyleRareInheritedData.cpp b/WebCore/rendering/style/StyleRareInheritedData.cpp index 2294568..f26baa6 100644 --- a/WebCore/rendering/style/StyleRareInheritedData.cpp +++ b/WebCore/rendering/style/StyleRareInheritedData.cpp @@ -94,7 +94,7 @@ bool StyleRareInheritedData::operator==(const StyleRareInheritedData& o) const bool StyleRareInheritedData::shadowDataEquivalent(const StyleRareInheritedData& o) const { - if (!textShadow && o.textShadow || textShadow && !o.textShadow) + if ((!textShadow && o.textShadow) || (textShadow && !o.textShadow)) return false; if (textShadow && o.textShadow && (*textShadow != *o.textShadow)) return false; diff --git a/WebCore/rendering/style/StyleRareNonInheritedData.cpp b/WebCore/rendering/style/StyleRareNonInheritedData.cpp index e8ceeeb..401c04f 100644 --- a/WebCore/rendering/style/StyleRareNonInheritedData.cpp +++ b/WebCore/rendering/style/StyleRareNonInheritedData.cpp @@ -23,7 +23,10 @@ #include "StyleRareNonInheritedData.h" #include "CSSStyleSelector.h" +#include "ContentData.h" +#include "RenderCounter.h" #include "RenderStyle.h" +#include "StyleImage.h" namespace WebCore { @@ -39,10 +42,18 @@ StyleRareNonInheritedData::StyleRareNonInheritedData() , matchNearestMailBlockquoteColor(RenderStyle::initialMatchNearestMailBlockquoteColor()) , m_appearance(RenderStyle::initialAppearance()) , m_borderFit(RenderStyle::initialBorderFit()) +#if USE(ACCELERATED_COMPOSITING) + , m_runningAcceleratedAnimation(false) +#endif , m_boxShadow(0) , m_animations(0) , m_transitions(0) , m_mask(FillLayer(MaskFillLayer)) + , m_transformStyle3D(RenderStyle::initialTransformStyle3D()) + , m_backfaceVisibility(RenderStyle::initialBackfaceVisibility()) + , m_perspective(RenderStyle::initialPerspective()) + , m_perspectiveOriginX(RenderStyle::initialPerspectiveOriginX()) + , m_perspectiveOriginY(RenderStyle::initialPerspectiveOriginY()) #if ENABLE(XBL) , bindingURI(0) #endif @@ -66,12 +77,20 @@ StyleRareNonInheritedData::StyleRareNonInheritedData(const StyleRareNonInherited , matchNearestMailBlockquoteColor(o.matchNearestMailBlockquoteColor) , m_appearance(o.m_appearance) , m_borderFit(o.m_borderFit) +#if USE(ACCELERATED_COMPOSITING) + , m_runningAcceleratedAnimation(o.m_runningAcceleratedAnimation) +#endif , m_boxShadow(o.m_boxShadow ? new ShadowData(*o.m_boxShadow) : 0) , m_boxReflect(o.m_boxReflect) , m_animations(o.m_animations ? new AnimationList(*o.m_animations) : 0) , m_transitions(o.m_transitions ? new AnimationList(*o.m_transitions) : 0) , m_mask(o.m_mask) , m_maskBoxImage(o.m_maskBoxImage) + , m_transformStyle3D(o.m_transformStyle3D) + , m_backfaceVisibility(o.m_backfaceVisibility) + , m_perspective(o.m_perspective) + , m_perspectiveOriginX(o.m_perspectiveOriginX) + , m_perspectiveOriginY(o.m_perspectiveOriginY) #if ENABLE(XBL) , bindingURI(o.bindingURI ? o.bindingURI->copy() : 0) #endif @@ -105,7 +124,7 @@ bool StyleRareNonInheritedData::operator==(const StyleRareNonInheritedData& o) c && marquee == o.marquee && m_multiCol == o.m_multiCol && m_transform == o.m_transform - && m_content == o.m_content + && contentDataEquivalent(o) && m_counterDirectives == o.m_counterDirectives && userDrag == o.userDrag && textOverflow == o.textOverflow @@ -114,6 +133,9 @@ bool StyleRareNonInheritedData::operator==(const StyleRareNonInheritedData& o) c && matchNearestMailBlockquoteColor == o.matchNearestMailBlockquoteColor && m_appearance == o.m_appearance && m_borderFit == o.m_borderFit +#if USE(ACCELERATED_COMPOSITING) + && !m_runningAcceleratedAnimation && !o.m_runningAcceleratedAnimation +#endif && shadowDataEquivalent(o) && reflectionDataEquivalent(o) && animationDataEquivalent(o) @@ -123,12 +145,32 @@ bool StyleRareNonInheritedData::operator==(const StyleRareNonInheritedData& o) c #if ENABLE(XBL) && bindingsEquivalent(o) #endif + && (m_transformStyle3D == o.m_transformStyle3D) + && (m_backfaceVisibility == o.m_backfaceVisibility) + && (m_perspective == o.m_perspective) + && (m_perspectiveOriginX == o.m_perspectiveOriginX) + && (m_perspectiveOriginY == o.m_perspectiveOriginY) ; } +bool StyleRareNonInheritedData::contentDataEquivalent(const StyleRareNonInheritedData& o) const +{ + ContentData* c1 = m_content.get(); + ContentData* c2 = o.m_content.get(); + + while (c1 && c2) { + if (!c1->dataEquivalent(*c2)) + return false; + c1 = c1->next(); + c2 = c2->next(); + } + + return !c1 && !c2; +} + bool StyleRareNonInheritedData::shadowDataEquivalent(const StyleRareNonInheritedData& o) const { - if (!m_boxShadow && o.m_boxShadow || m_boxShadow && !o.m_boxShadow) + if ((!m_boxShadow && o.m_boxShadow) || (m_boxShadow && !o.m_boxShadow)) return false; if (m_boxShadow && o.m_boxShadow && (*m_boxShadow != *o.m_boxShadow)) return false; @@ -148,7 +190,7 @@ bool StyleRareNonInheritedData::reflectionDataEquivalent(const StyleRareNonInher bool StyleRareNonInheritedData::animationDataEquivalent(const StyleRareNonInheritedData& o) const { - if (!m_animations && o.m_animations || m_animations && !o.m_animations) + if ((!m_animations && o.m_animations) || (m_animations && !o.m_animations)) return false; if (m_animations && o.m_animations && (*m_animations != *o.m_animations)) return false; @@ -157,7 +199,7 @@ bool StyleRareNonInheritedData::animationDataEquivalent(const StyleRareNonInheri bool StyleRareNonInheritedData::transitionDataEquivalent(const StyleRareNonInheritedData& o) const { - if (!m_transitions && o.m_transitions || m_transitions && !o.m_transitions) + if ((!m_transitions && o.m_transitions) || (m_transitions && !o.m_transitions)) return false; if (m_transitions && o.m_transitions && (*m_transitions != *o.m_transitions)) return false; diff --git a/WebCore/rendering/style/StyleRareNonInheritedData.h b/WebCore/rendering/style/StyleRareNonInheritedData.h index 6ce6a33..8dd22b3 100644 --- a/WebCore/rendering/style/StyleRareNonInheritedData.h +++ b/WebCore/rendering/style/StyleRareNonInheritedData.h @@ -30,6 +30,7 @@ #include "DataRef.h" #include "FillLayer.h" #include "NinePieceImage.h" +#include "StyleTransformData.h" #include <wtf/OwnPtr.h> #include <wtf/PassRefPtr.h> #include <wtf/Vector.h> @@ -69,7 +70,8 @@ public: bool operator==(const StyleRareNonInheritedData&) const; bool operator!=(const StyleRareNonInheritedData& o) const { return !(*this == o); } - + + bool contentDataEquivalent(const StyleRareNonInheritedData& o) const; bool shadowDataEquivalent(const StyleRareNonInheritedData& o) const; bool reflectionDataEquivalent(const StyleRareNonInheritedData& o) const; bool animationDataEquivalent(const StyleRareNonInheritedData&) const; @@ -96,6 +98,9 @@ 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 +#if USE(ACCELERATED_COMPOSITING) + bool m_runningAcceleratedAnimation : 1; +#endif OwnPtr<ShadowData> m_boxShadow; // For box-shadow decorations. RefPtr<StyleReflection> m_boxReflect; @@ -106,6 +111,12 @@ public: FillLayer m_mask; NinePieceImage m_maskBoxImage; + ETransformStyle3D m_transformStyle3D; + EBackfaceVisibility m_backfaceVisibility; + float m_perspective; + Length m_perspectiveOriginX; + Length m_perspectiveOriginY; + #if ENABLE(XBL) OwnPtr<BindingURI> bindingURI; // The XBL binding URI list. #endif diff --git a/WebCore/rendering/style/StyleTransformData.cpp b/WebCore/rendering/style/StyleTransformData.cpp index de20e77..2baebf9 100644 --- a/WebCore/rendering/style/StyleTransformData.cpp +++ b/WebCore/rendering/style/StyleTransformData.cpp @@ -30,6 +30,7 @@ StyleTransformData::StyleTransformData() : m_operations(RenderStyle::initialTransform()) , m_x(RenderStyle::initialTransformOriginX()) , m_y(RenderStyle::initialTransformOriginY()) + , m_z(RenderStyle::initialTransformOriginZ()) { } @@ -38,12 +39,13 @@ StyleTransformData::StyleTransformData(const StyleTransformData& o) , m_operations(o.m_operations) , m_x(o.m_x) , m_y(o.m_y) + , m_z(o.m_z) { } bool StyleTransformData::operator==(const StyleTransformData& o) const { - return m_x == o.m_x && m_y == o.m_y && m_operations == o.m_operations; + return m_x == o.m_x && m_y == o.m_y && m_z == o.m_z && m_operations == o.m_operations; } } // namespace WebCore diff --git a/WebCore/rendering/style/StyleTransformData.h b/WebCore/rendering/style/StyleTransformData.h index 157e600..6039824 100644 --- a/WebCore/rendering/style/StyleTransformData.h +++ b/WebCore/rendering/style/StyleTransformData.h @@ -46,6 +46,7 @@ public: TransformOperations m_operations; Length m_x; Length m_y; + float m_z; private: StyleTransformData(); |