diff options
Diffstat (limited to 'WebCore/rendering/style')
27 files changed, 33 insertions, 1317 deletions
diff --git a/WebCore/rendering/style/Animation.cpp b/WebCore/rendering/style/Animation.cpp deleted file mode 100644 index ed3a7e7..0000000 --- a/WebCore/rendering/style/Animation.cpp +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) - * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "config.h" -#include "Animation.h" - -#include "RenderStyle.h" - -namespace WebCore { - -Animation::Animation() - : m_delay(RenderStyle::initialAnimationDelay()) - , m_direction(RenderStyle::initialAnimationDirection()) - , m_duration(RenderStyle::initialAnimationDuration()) - , m_iterationCount(RenderStyle::initialAnimationIterationCount()) - , m_name(RenderStyle::initialAnimationName()) - , m_property(RenderStyle::initialAnimationProperty()) - , m_timingFunction(RenderStyle::initialAnimationTimingFunction()) - , m_playState(RenderStyle::initialAnimationPlayState()) - , m_delaySet(false) - , m_directionSet(false) - , m_durationSet(false) - , m_iterationCountSet(false) - , m_nameSet(false) - , m_playStateSet(false) - , m_propertySet(false) - , m_timingFunctionSet(false) - , m_isNone(false) -{ -} - -Animation::Animation(const Animation& o) - : RefCounted<Animation>() - , m_delay(o.m_delay) - , m_direction(o.m_direction) - , m_duration(o.m_duration) - , m_iterationCount(o.m_iterationCount) - , m_name(o.m_name) - , m_property(o.m_property) - , m_timingFunction(o.m_timingFunction) - , m_playState(o.m_playState) - , m_delaySet(o.m_delaySet) - , m_directionSet(o.m_directionSet) - , m_durationSet(o.m_durationSet) - , m_iterationCountSet(o.m_iterationCountSet) - , m_nameSet(o.m_nameSet) - , m_playStateSet(o.m_playStateSet) - , m_propertySet(o.m_propertySet) - , m_timingFunctionSet(o.m_timingFunctionSet) - , m_isNone(o.m_isNone) -{ -} - -Animation& Animation::operator=(const Animation& o) -{ - m_delay = o.m_delay; - m_direction = o.m_direction; - m_duration = o.m_duration; - m_iterationCount = o.m_iterationCount; - m_name = o.m_name; - m_playState = o.m_playState; - m_property = o.m_property; - m_timingFunction = o.m_timingFunction; - - m_delaySet = o.m_delaySet; - m_directionSet = o.m_directionSet; - m_durationSet = o.m_durationSet; - m_iterationCountSet = o.m_iterationCountSet; - m_nameSet = o.m_nameSet; - m_playStateSet = o.m_playStateSet; - m_propertySet = o.m_propertySet; - m_timingFunctionSet = o.m_timingFunctionSet; - - m_isNone = o.m_isNone; - - return *this; -} - -Animation::~Animation() -{ -} - -bool Animation::animationsMatch(const Animation* o, bool matchPlayStates) const -{ - if (!o) - return false; - - bool result = m_delay == o->m_delay && - m_direction == o->m_direction && - m_duration == o->m_duration && - m_iterationCount == o->m_iterationCount && - m_name == o->m_name && - m_property == o->m_property && - m_timingFunction == o->m_timingFunction && - m_delaySet == o->m_delaySet && - m_directionSet == o->m_directionSet && - m_durationSet == o->m_durationSet && - m_iterationCountSet == o->m_iterationCountSet && - m_nameSet == o->m_nameSet && - m_propertySet == o->m_propertySet && - m_timingFunctionSet == o->m_timingFunctionSet && - m_isNone == o->m_isNone; - - if (!result) - return false; - - return !matchPlayStates || (m_playState == o->m_playState && m_playStateSet == o->m_playStateSet); -} - -} // namespace WebCore diff --git a/WebCore/rendering/style/Animation.h b/WebCore/rendering/style/Animation.h deleted file mode 100644 index 8930e30..0000000 --- a/WebCore/rendering/style/Animation.h +++ /dev/null @@ -1,133 +0,0 @@ -/* - * 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) 2006 Graham Dennis (graham.dennis@gmail.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef Animation_h -#define Animation_h - -#include "PlatformString.h" -#include "TimingFunction.h" -#include <wtf/PassRefPtr.h> -#include <wtf/RefCounted.h> - -namespace WebCore { - -class Animation : public RefCounted<Animation> { -public: - ~Animation(); - - static PassRefPtr<Animation> create() { return adoptRef(new Animation); }; - - bool isDelaySet() const { return m_delaySet; } - bool isDirectionSet() const { return m_directionSet; } - bool isDurationSet() const { return m_durationSet; } - bool isIterationCountSet() const { return m_iterationCountSet; } - bool isNameSet() const { return m_nameSet; } - bool isPlayStateSet() const { return m_playStateSet; } - bool isPropertySet() const { return m_propertySet; } - bool isTimingFunctionSet() const { return m_timingFunctionSet; } - - // Flags this to be the special "none" animation (animation-name: none) - bool isNoneAnimation() const { return m_isNone; } - // We can make placeholder Animation objects to keep the comma-separated lists - // of properties in sync. isValidAnimation means this is not a placeholder. - bool isValidAnimation() const { return !m_isNone && !m_name.isEmpty(); } - - bool isEmpty() const - { - return (!m_directionSet && !m_durationSet && !m_nameSet && !m_playStateSet && - !m_iterationCountSet && !m_delaySet && !m_timingFunctionSet && !m_propertySet); - } - - bool isEmptyOrZeroDuration() const - { - return isEmpty() || (m_duration == 0 && m_delay <= 0); - } - - void clearDelay() { m_delaySet = false; } - void clearDirection() { m_directionSet = false; } - void clearDuration() { m_durationSet = false; } - void clearIterationCount() { m_iterationCountSet = false; } - void clearName() { m_nameSet = false; } - void clearPlayState() { m_playStateSet = AnimPlayStatePlaying; } - void clearProperty() { m_propertySet = false; } - void clearTimingFunction() { m_timingFunctionSet = false; } - - double delay() const { return m_delay; } - bool direction() const { return m_direction; } - double duration() const { return m_duration; } - int iterationCount() const { return m_iterationCount; } - const String& name() const { return m_name; } - unsigned playState() const { return m_playState; } - int property() const { return m_property; } - const TimingFunction& timingFunction() const { return m_timingFunction; } - - void setDelay(double c) { m_delay = c; m_delaySet = true; } - void setDirection(bool d) { m_direction = d; m_directionSet = true; } - void setDuration(double d) { ASSERT(d >= 0); m_duration = d; m_durationSet = true; } - void setIterationCount(int c) { m_iterationCount = c; m_iterationCountSet = true; } - void setName(const String& n) { m_name = n; m_nameSet = true; } - void setPlayState(unsigned d) { m_playState = d; m_playStateSet = true; } - void setProperty(int t) { m_property = t; m_propertySet = true; } - void setTimingFunction(const TimingFunction& f) { m_timingFunction = f; m_timingFunctionSet = true; } - - void setIsNoneAnimation(bool n) { m_isNone = n; } - - Animation& operator=(const Animation& o); - - // return true if all members of this class match (excluding m_next) - bool animationsMatch(const Animation*, bool matchPlayStates = true) const; - - // return true every Animation in the chain (defined by m_next) match - bool operator==(const Animation& o) const { return animationsMatch(&o); } - bool operator!=(const Animation& o) const { return !(*this == o); } - -private: - Animation(); - Animation(const Animation& o); - - double m_delay; - bool m_direction; - double m_duration; - int m_iterationCount; - String m_name; - int m_property; - TimingFunction m_timingFunction; - - unsigned m_playState : 2; - - bool m_delaySet : 1; - bool m_directionSet : 1; - bool m_durationSet : 1; - bool m_iterationCountSet : 1; - bool m_nameSet : 1; - bool m_playStateSet : 1; - bool m_propertySet : 1; - bool m_timingFunctionSet : 1; - - bool m_isNone : 1; -}; - -} // namespace WebCore - -#endif // Animation_h diff --git a/WebCore/rendering/style/AnimationList.cpp b/WebCore/rendering/style/AnimationList.cpp deleted file mode 100644 index 804dede..0000000 --- a/WebCore/rendering/style/AnimationList.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) - * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "config.h" -#include "AnimationList.h" - -namespace WebCore { - -#define FILL_UNSET_PROPERTY(test, propGet, propSet) \ -for (i = 0; i < size() && animation(i)->test(); ++i) { } \ -if (i < size() && i != 0) { \ - for (size_t j = 0; i < size(); ++i, ++j) \ - animation(i)->propSet(animation(j)->propGet()); \ -} - -void AnimationList::fillUnsetProperties() -{ - size_t i; - FILL_UNSET_PROPERTY(isDelaySet, delay, setDelay); - FILL_UNSET_PROPERTY(isDirectionSet, direction, setDirection); - FILL_UNSET_PROPERTY(isDurationSet, duration, setDuration); - FILL_UNSET_PROPERTY(isIterationCountSet, iterationCount, setIterationCount); - FILL_UNSET_PROPERTY(isPlayStateSet, playState, setPlayState); - FILL_UNSET_PROPERTY(isNameSet, name, setName); - FILL_UNSET_PROPERTY(isTimingFunctionSet, timingFunction, setTimingFunction); - FILL_UNSET_PROPERTY(isPropertySet, property, setProperty); -} - -bool AnimationList::operator==(const AnimationList& o) const -{ - if (size() != o.size()) - return false; - for (size_t i = 0; i < size(); ++i) - if (*animation(i) != *o.animation(i)) - return false; - return true; -} - -} // namespace WebCore diff --git a/WebCore/rendering/style/AnimationList.h b/WebCore/rendering/style/AnimationList.h deleted file mode 100644 index 9901424..0000000 --- a/WebCore/rendering/style/AnimationList.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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) 2006 Graham Dennis (graham.dennis@gmail.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef AnimationList_h -#define AnimationList_h - -#include "Animation.h" -#include <wtf/RefPtr.h> -#include <wtf/Vector.h> - -namespace WebCore { - -class AnimationList { -public: - void fillUnsetProperties(); - bool operator==(const AnimationList& o) const; - bool operator!=(const AnimationList& o) const - { - return !(*this == o); - } - - size_t size() const { return m_animations.size(); } - bool isEmpty() const { return m_animations.isEmpty(); } - - void resize(size_t n) { m_animations.resize(n); } - void remove(size_t i) { m_animations.remove(i); } - void append(PassRefPtr<Animation> anim) { m_animations.append(anim); } - - Animation* animation(size_t i) { return m_animations[i].get(); } - const Animation* animation(size_t i) const { return m_animations[i].get(); } - -private: - Vector<RefPtr<Animation> > m_animations; -}; - - -} // namespace WebCore - -#endif // AnimationList_h diff --git a/WebCore/rendering/style/FillLayer.h b/WebCore/rendering/style/FillLayer.h index 8f0ad94..2dc5871 100644 --- a/WebCore/rendering/style/FillLayer.h +++ b/WebCore/rendering/style/FillLayer.h @@ -120,8 +120,8 @@ public: static EFillRepeat initialFillRepeat(EFillLayerType) { return RepeatFill; } static CompositeOperator initialFillComposite(EFillLayerType) { return CompositeSourceOver; } static LengthSize initialFillSize(EFillLayerType) { return LengthSize(); } - static Length initialFillXPosition(EFillLayerType type) { return Length(0.0, Percent); } - static Length initialFillYPosition(EFillLayerType type) { return Length(0.0, Percent); } + static Length initialFillXPosition(EFillLayerType) { return Length(0.0, Percent); } + static Length initialFillYPosition(EFillLayerType) { return Length(0.0, Percent); } static StyleImage* initialFillImage(EFillLayerType) { return 0; } private: diff --git a/WebCore/rendering/style/IdentityTransformOperation.h b/WebCore/rendering/style/IdentityTransformOperation.h deleted file mode 100644 index 54c49a3..0000000 --- a/WebCore/rendering/style/IdentityTransformOperation.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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) 2006 Graham Dennis (graham.dennis@gmail.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef IdentityTransformOperation_h -#define IdentityTransformOperation_h - -#include "TransformOperation.h" - -namespace WebCore { - -class IdentityTransformOperation : public TransformOperation { -public: - static PassRefPtr<IdentityTransformOperation> create() - { - return adoptRef(new IdentityTransformOperation()); - } - - virtual bool isIdentity() const { return true; } - virtual OperationType getOperationType() const { return IDENTITY; } - virtual bool isSameType(const TransformOperation& o) const { return o.getOperationType() == IDENTITY; } - - virtual bool operator==(const TransformOperation& o) const - { - return isSameType(o); - } - - virtual bool apply(AffineTransform& transform, const IntSize& borderBoxSize) const - { - return false; - } - - virtual PassRefPtr<TransformOperation> blend(const TransformOperation* from, double progress, bool blendToIdentity = false) - { - return this; - } - -private: - IdentityTransformOperation() - { - } - -}; - -} // namespace WebCore - -#endif // IdentityTransformOperation_h diff --git a/WebCore/rendering/style/MatrixTransformOperation.cpp b/WebCore/rendering/style/MatrixTransformOperation.cpp deleted file mode 100644 index c41ae3e..0000000 --- a/WebCore/rendering/style/MatrixTransformOperation.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) - * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "config.h" -#include "MatrixTransformOperation.h" - -#include <algorithm> - -namespace WebCore { - -PassRefPtr<TransformOperation> MatrixTransformOperation::blend(const TransformOperation* from, double progress, bool blendToIdentity) -{ - if (from && !from->isSameType(*this)) - return this; - - // convert the TransformOperations into matrices - IntSize size; - AffineTransform fromT; - AffineTransform toT(m_a, m_b, m_c, m_d, m_e, m_f); - if (from) { - const MatrixTransformOperation* m = static_cast<const MatrixTransformOperation*>(from); - fromT.setMatrix(m->m_a, m->m_b, m->m_c, m->m_d, m->m_e, m->m_f); - } - - if (blendToIdentity) - std::swap(fromT, toT); - - toT.blend(fromT, progress); - return MatrixTransformOperation::create(toT.a(), toT.b(), toT.c(), toT.d(), toT.e(), toT.f()); -} - -} // namespace WebCore diff --git a/WebCore/rendering/style/MatrixTransformOperation.h b/WebCore/rendering/style/MatrixTransformOperation.h deleted file mode 100644 index 574f2a8..0000000 --- a/WebCore/rendering/style/MatrixTransformOperation.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * 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) 2006 Graham Dennis (graham.dennis@gmail.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef MatrixTransformOperation_h -#define MatrixTransformOperation_h - -#include "TransformOperation.h" - -namespace WebCore { - -class MatrixTransformOperation : public TransformOperation { -public: - static PassRefPtr<MatrixTransformOperation> create(double a, double b, double c, double d, double e, double f) - { - return adoptRef(new MatrixTransformOperation(a, b, c, d, e, f)); - } - - virtual bool isIdentity() const { return m_a == 1 && m_b == 0 && m_c == 0 && m_d == 1 && m_e == 0 && m_f == 0; } - virtual OperationType getOperationType() const { return MATRIX; } - virtual bool isSameType(const TransformOperation& o) const { return o.getOperationType() == MATRIX; } - - virtual bool operator==(const TransformOperation& o) const - { - if (!isSameType(o)) - return false; - - const MatrixTransformOperation* m = static_cast<const MatrixTransformOperation*>(&o); - return m_a == m->m_a && m_b == m->m_b && m_c == m->m_c && m_d == m->m_d && m_e == m->m_e && m_f == m->m_f; - } - - virtual bool apply(AffineTransform& transform, const IntSize& borderBoxSize) const - { - AffineTransform matrix(m_a, m_b, m_c, m_d, m_e, m_f); - transform = matrix * transform; - return false; - } - - virtual PassRefPtr<TransformOperation> blend(const TransformOperation* from, double progress, bool blendToIdentity = false); - -private: - MatrixTransformOperation(double a, double b, double c, double d, double e, double f) - : m_a(a) - , m_b(b) - , m_c(c) - , m_d(d) - , m_e(e) - , m_f(f) - { - } - - double m_a; - double m_b; - double m_c; - double m_d; - double m_e; - double m_f; -}; - -} // namespace WebCore - -#endif // MatrixTransformOperation_h diff --git a/WebCore/rendering/style/RenderStyle.cpp b/WebCore/rendering/style/RenderStyle.cpp index 5088c33..09445b9 100644 --- a/WebCore/rendering/style/RenderStyle.cpp +++ b/WebCore/rendering/style/RenderStyle.cpp @@ -29,6 +29,7 @@ #include "RenderArena.h" #include "RenderObject.h" #include "StyleImage.h" +#include <wtf/StdLibExtras.h> #include <algorithm> namespace WebCore { @@ -232,7 +233,7 @@ bool RenderStyle::inheritedNotEqual(RenderStyle* other) const rareInheritedData != other->rareInheritedData; } -bool positionedObjectMoved(const LengthBox& a, const LengthBox& b) +static bool positionedObjectMoved(const LengthBox& a, const LengthBox& b) { // If any unit types are different, then we can't guarantee // that this was just a movement. @@ -498,7 +499,8 @@ void RenderStyle::setCursorList(PassRefPtr<CursorList> other) void RenderStyle::clearCursorList() { - inherited.access()->cursorData = CursorList::create(); + if (inherited->cursorData) + inherited.access()->cursorData = 0; } bool RenderStyle::contentDataEquivalent(const RenderStyle* otherStyle) const @@ -635,7 +637,7 @@ void RenderStyle::setContent(CounterContent* c, bool add) newContentData->m_type = CONTENT_COUNTER; } -void RenderStyle::applyTransform(AffineTransform& transform, const IntSize& borderBoxSize, bool includeTransformOrigin) const +void RenderStyle::applyTransform(TransformationMatrix& transform, const IntSize& borderBoxSize, bool includeTransformOrigin) 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 @@ -720,13 +722,13 @@ CounterDirectiveMap& RenderStyle::accessCounterDirectives() #if ENABLE(DASHBOARD_SUPPORT) const Vector<StyleDashboardRegion>& RenderStyle::initialDashboardRegions() { - static Vector<StyleDashboardRegion> emptyList; + DEFINE_STATIC_LOCAL(Vector<StyleDashboardRegion>, emptyList, ()); return emptyList; } const Vector<StyleDashboardRegion>& RenderStyle::noneDashboardRegions() { - static Vector<StyleDashboardRegion> noneList; + DEFINE_STATIC_LOCAL(Vector<StyleDashboardRegion>, noneList, ()); static bool noneListInitialized = false; if (!noneListInitialized) { @@ -750,7 +752,7 @@ void RenderStyle::adjustAnimations() if (!animationList) return; - // get rid of empty transitions and anything beyond them + // Get rid of empty animations and anything beyond them for (size_t i = 0; i < animationList->size(); ++i) { if (animationList->animation(i)->isEmpty()) { animationList->resize(i); @@ -773,7 +775,7 @@ void RenderStyle::adjustTransitions() if (!transitionList) return; - // get rid of empty transitions and anything beyond them + // Get rid of empty transitions and anything beyond them for (size_t i = 0; i < transitionList->size(); ++i) { if (transitionList->animation(i)->isEmpty()) { transitionList->resize(i); diff --git a/WebCore/rendering/style/RenderStyle.h b/WebCore/rendering/style/RenderStyle.h index 084bdc8..fed3057 100644 --- a/WebCore/rendering/style/RenderStyle.h +++ b/WebCore/rendering/style/RenderStyle.h @@ -25,7 +25,7 @@ #ifndef RenderStyle_h #define RenderStyle_h -#include "AffineTransform.h" +#include "TransformationMatrix.h" #include "AnimationList.h" #include "BorderData.h" #include "BorderValue.h" @@ -72,6 +72,7 @@ #include "TransformOperations.h" #include <wtf/OwnPtr.h> #include <wtf/RefCounted.h> +#include <wtf/StdLibExtras.h> #include <wtf/Vector.h> #if ENABLE(DASHBOARD_SUPPORT) @@ -110,8 +111,9 @@ 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_TIME_DISPLAY, - MEDIA_CONTROLS_SEEK_BACK_BUTTON, MEDIA_CONTROLS_SEEK_FORWARD_BUTTON , MEDIA_CONTROLS_FULLSCREEN_BUTTON, + 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; @@ -139,7 +141,8 @@ protected: (_box_direction == other._box_direction) && (_visuallyOrdered == other._visuallyOrdered) && (_htmlHacks == other._htmlHacks) && - (_force_backgrounds_to_white == other._force_backgrounds_to_white); + (_force_backgrounds_to_white == other._force_backgrounds_to_white) && + (_pointerEvents == other._pointerEvents); } bool operator!=(const InheritedFlags& other) const { return !(*this == other); } @@ -162,6 +165,7 @@ protected: bool _visuallyOrdered : 1; bool _htmlHacks :1; bool _force_backgrounds_to_white : 1; + unsigned _pointerEvents : 4; // EPointerEvents } inherited_flags; // don't inherit @@ -268,6 +272,7 @@ protected: inherited_flags._htmlHacks=false; inherited_flags._box_direction = initialBoxDirection(); inherited_flags._force_backgrounds_to_white = false; + inherited_flags._pointerEvents = initialPointerEvents(); noninherited_flags._effectiveDisplay = noninherited_flags._originalDisplay = initialDisplay(); noninherited_flags._overflowX = initialOverflowX(); @@ -624,11 +629,12 @@ public: Length transformOriginX() const { return rareNonInheritedData->m_transform->m_x; } Length transformOriginY() const { return rareNonInheritedData->m_transform->m_y; } bool hasTransform() const { return !rareNonInheritedData->m_transform->m_operations.operations().isEmpty(); } - void applyTransform(AffineTransform&, const IntSize& borderBoxSize, bool includeTransformOrigin = true) const; + void applyTransform(TransformationMatrix&, const IntSize& borderBoxSize, bool includeTransformOrigin = true) const; bool hasMask() const { return rareNonInheritedData->m_mask.hasImage() || rareNonInheritedData->m_maskBoxImage.hasImage(); } // End CSS3 Getters // Apple-specific property getter methods + EPointerEvents pointerEvents() const { return static_cast<EPointerEvents>(inherited_flags._pointerEvents); } const AnimationList* animations() const { return rareNonInheritedData->m_animations.get(); } const AnimationList* transitions() const { return rareNonInheritedData->m_transitions.get(); } @@ -923,6 +929,8 @@ public: // End CSS3 Setters // Apple-specific property setters + void setPointerEvents(EPointerEvents p) { inherited_flags._pointerEvents = p; } + void clearAnimations() { rareNonInheritedData.access()->m_animations.clear(); @@ -1107,19 +1115,12 @@ public: static bool initialVisuallyOrdered() { return false; } static float initialTextStrokeWidth() { return 0; } static unsigned short initialColumnCount() { return 1; } - static const TransformOperations& initialTransform() { static TransformOperations ops; return ops; } + 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 EPointerEvents initialPointerEvents() { return PE_AUTO; } // Keep these at the end. - static float initialAnimationDelay() { return 0; } - static bool initialAnimationDirection() { return false; } - static double initialAnimationDuration() { return 0; } - static int initialAnimationIterationCount() { return 1; } - static String initialAnimationName() { return String(); } - static unsigned initialAnimationPlayState() { return AnimPlayStatePlaying; } - static int initialAnimationProperty() { return cAnimateAll; } - static TimingFunction initialAnimationTimingFunction() { return TimingFunction(); } static int initialLineClamp() { return -1; } static bool initialTextSizeAdjust() { return true; } static ETextSecurity initialTextSecurity() { return TSNONE; } diff --git a/WebCore/rendering/style/RenderStyleConstants.h b/WebCore/rendering/style/RenderStyleConstants.h index 37fbc1e..40ad3cc 100644 --- a/WebCore/rendering/style/RenderStyleConstants.h +++ b/WebCore/rendering/style/RenderStyleConstants.h @@ -258,6 +258,11 @@ enum EDisplay { TABLE_CAPTION, BOX, INLINE_BOX, NONE }; +enum EPointerEvents { + PE_NONE, PE_AUTO, PE_STROKE, PE_FILL, PE_PAINTED, PE_VISIBLE, + PE_VISIBLE_STROKE, PE_VISIBLE_FILL, PE_VISIBLE_PAINTED, PE_ALL +}; + } // namespace WebCore #endif // RenderStyleConstants_h diff --git a/WebCore/rendering/style/RotateTransformOperation.cpp b/WebCore/rendering/style/RotateTransformOperation.cpp deleted file mode 100644 index 4887cee..0000000 --- a/WebCore/rendering/style/RotateTransformOperation.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) - * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "config.h" -#include "RotateTransformOperation.h" - -namespace WebCore { - -PassRefPtr<TransformOperation> RotateTransformOperation::blend(const TransformOperation* from, double progress, bool blendToIdentity) -{ - if (from && !from->isSameType(*this)) - return this; - - if (blendToIdentity) - return RotateTransformOperation::create(m_angle - m_angle * progress, m_type); - - const RotateTransformOperation* fromOp = static_cast<const RotateTransformOperation*>(from); - double fromAngle = fromOp ? fromOp->m_angle : 0; - return RotateTransformOperation::create(fromAngle + (m_angle - fromAngle) * progress, m_type); -} - -} // namespace WebCore diff --git a/WebCore/rendering/style/RotateTransformOperation.h b/WebCore/rendering/style/RotateTransformOperation.h deleted file mode 100644 index 9cfc9c8..0000000 --- a/WebCore/rendering/style/RotateTransformOperation.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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) 2006 Graham Dennis (graham.dennis@gmail.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef RotateTransformOperation_h -#define RotateTransformOperation_h - -#include "TransformOperation.h" - -namespace WebCore { - -class RotateTransformOperation : public TransformOperation { -public: - static PassRefPtr<RotateTransformOperation> create(double angle, OperationType type) - { - return adoptRef(new RotateTransformOperation(angle, type)); - } - - virtual bool isIdentity() const { return m_angle == 0; } - virtual OperationType getOperationType() const { return m_type; } - virtual bool isSameType(const TransformOperation& o) const { return o.getOperationType() == m_type; } - - virtual bool operator==(const TransformOperation& o) const - { - if (!isSameType(o)) - return false; - const RotateTransformOperation* r = static_cast<const RotateTransformOperation*>(&o); - return m_angle == r->m_angle; - } - - virtual bool apply(AffineTransform& transform, const IntSize& borderBoxSize) const - { - transform.rotate(m_angle); - return false; - } - - virtual PassRefPtr<TransformOperation> blend(const TransformOperation* from, double progress, bool blendToIdentity = false); - - double angle() const { return m_angle; } - -private: - RotateTransformOperation(double angle, OperationType type) - : m_angle(angle) - , m_type(type) - { - } - - double m_angle; - OperationType m_type; -}; - -} // namespace WebCore - -#endif // RotateTransformOperation_h diff --git a/WebCore/rendering/style/SVGRenderStyle.h b/WebCore/rendering/style/SVGRenderStyle.h index 5724621..0e9dae4 100644 --- a/WebCore/rendering/style/SVGRenderStyle.h +++ b/WebCore/rendering/style/SVGRenderStyle.h @@ -63,7 +63,6 @@ namespace WebCore { SVG_RS_DEFINE_ATTRIBUTE_INHERITED(WindRule, FillRule, fillRule, RULE_NONZERO) SVG_RS_DEFINE_ATTRIBUTE_INHERITED(EImageRendering, ImageRendering, imageRendering, IR_AUTO) SVG_RS_DEFINE_ATTRIBUTE_INHERITED(LineJoin, JoinStyle, joinStyle, MiterJoin) - SVG_RS_DEFINE_ATTRIBUTE_INHERITED(EPointerEvents, PointerEvents, pointerEvents, PE_VISIBLE_PAINTED) SVG_RS_DEFINE_ATTRIBUTE_INHERITED(EShapeRendering, ShapeRendering, shapeRendering, SR_AUTO) SVG_RS_DEFINE_ATTRIBUTE_INHERITED(ETextAnchor, TextAnchor, textAnchor, TA_START) SVG_RS_DEFINE_ATTRIBUTE_INHERITED(ETextRendering, TextRendering, textRendering, TR_AUTO) @@ -122,7 +121,6 @@ namespace WebCore { (_textAnchor == other._textAnchor) && (_colorInterpolation == other._colorInterpolation) && (_colorInterpolationFilters == other._colorInterpolationFilters) && - (_pointerEvents == other._pointerEvents) && (_writingMode == other._writingMode) && (_glyphOrientationHorizontal == other._glyphOrientationHorizontal) && (_glyphOrientationVertical == other._glyphOrientationVertical); @@ -144,7 +142,6 @@ namespace WebCore { unsigned _textAnchor : 2; // ETextAnchor unsigned _colorInterpolation : 2; // EColorInterpolation unsigned _colorInterpolationFilters : 2; // EColorInterpolation - unsigned _pointerEvents : 4; // EPointerEvents unsigned _writingMode : 3; // EWritingMode unsigned _glyphOrientationHorizontal : 3; // EGlyphOrientation unsigned _glyphOrientationVertical : 3; // EGlyphOrientation @@ -199,7 +196,6 @@ namespace WebCore { svg_inherited_flags._joinStyle = initialJoinStyle(); svg_inherited_flags._colorInterpolation = initialColorInterpolation(); svg_inherited_flags._colorInterpolationFilters = initialColorInterpolationFilters(); - svg_inherited_flags._pointerEvents = initialPointerEvents(); svg_inherited_flags._writingMode = initialWritingMode(); svg_inherited_flags._glyphOrientationHorizontal = initialGlyphOrientationHorizontal(); svg_inherited_flags._glyphOrientationVertical = initialGlyphOrientationVertical(); diff --git a/WebCore/rendering/style/SVGRenderStyleDefs.h b/WebCore/rendering/style/SVGRenderStyleDefs.h index 12a70d3..cb504d2 100644 --- a/WebCore/rendering/style/SVGRenderStyleDefs.h +++ b/WebCore/rendering/style/SVGRenderStyleDefs.h @@ -119,11 +119,6 @@ namespace WebCore { DB_CENTRAL, DB_MIDDLE, DB_TEXT_AFTER_EDGE, DB_TEXT_BEFORE_EDGE }; - enum EPointerEvents { - PE_NONE, PE_STROKE, PE_FILL, PE_PAINTED, PE_VISIBLE, - PE_VISIBLE_STROKE, PE_VISIBLE_FILL, PE_VISIBLE_PAINTED, PE_ALL - }; - class CSSValue; class CSSValueList; class SVGPaint; diff --git a/WebCore/rendering/style/ScaleTransformOperation.cpp b/WebCore/rendering/style/ScaleTransformOperation.cpp deleted file mode 100644 index 49a8fd8..0000000 --- a/WebCore/rendering/style/ScaleTransformOperation.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) - * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "config.h" -#include "ScaleTransformOperation.h" - -namespace WebCore { - -PassRefPtr<TransformOperation> ScaleTransformOperation::blend(const TransformOperation* from, double progress, bool blendToIdentity) -{ - if (from && !from->isSameType(*this)) - return this; - - if (blendToIdentity) - return ScaleTransformOperation::create(m_x + (1. - m_x) * progress, m_y + (1. - m_y) * progress, m_type); - - const ScaleTransformOperation* fromOp = static_cast<const ScaleTransformOperation*>(from); - double fromX = fromOp ? fromOp->m_x : 1.; - double fromY = fromOp ? fromOp->m_y : 1.; - return ScaleTransformOperation::create(fromX + (m_x - fromX) * progress, fromY + (m_y - fromY) * progress, m_type); -} - -} // namespace WebCore diff --git a/WebCore/rendering/style/ScaleTransformOperation.h b/WebCore/rendering/style/ScaleTransformOperation.h deleted file mode 100644 index 787f067..0000000 --- a/WebCore/rendering/style/ScaleTransformOperation.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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) 2006 Graham Dennis (graham.dennis@gmail.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef ScaleTransformOperation_h -#define ScaleTransformOperation_h - -#include "TransformOperation.h" - -namespace WebCore { - -class ScaleTransformOperation : public TransformOperation { -public: - static PassRefPtr<ScaleTransformOperation> create(double sx, double sy, OperationType type) - { - return adoptRef(new ScaleTransformOperation(sx, sy, type)); - } - - virtual bool isIdentity() const { return m_x == 1 && m_y == 1; } - virtual OperationType getOperationType() const { return m_type; } - virtual bool isSameType(const TransformOperation& o) const { return o.getOperationType() == m_type; } - - virtual bool operator==(const TransformOperation& o) const - { - if (!isSameType(o)) - return false; - const ScaleTransformOperation* s = static_cast<const ScaleTransformOperation*>(&o); - return m_x == s->m_x && m_y == s->m_y; - } - - virtual bool apply(AffineTransform& transform, const IntSize& borderBoxSize) const - { - transform.scale(m_x, m_y); - return false; - } - - virtual PassRefPtr<TransformOperation> blend(const TransformOperation* from, double progress, bool blendToIdentity = false); - -private: - ScaleTransformOperation(double sx, double sy, OperationType type) - : m_x(sx) - , m_y(sy) - , m_type(type) - { - } - - double m_x; - double m_y; - OperationType m_type; -}; - -} // namespace WebCore - -#endif // ScaleTransformOperation_h diff --git a/WebCore/rendering/style/SkewTransformOperation.cpp b/WebCore/rendering/style/SkewTransformOperation.cpp deleted file mode 100644 index 2a430e9..0000000 --- a/WebCore/rendering/style/SkewTransformOperation.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) - * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "config.h" -#include "SkewTransformOperation.h" - -namespace WebCore { - -PassRefPtr<TransformOperation> SkewTransformOperation::blend(const TransformOperation* from, double progress, bool blendToIdentity) -{ - if (from && !from->isSameType(*this)) - return this; - - if (blendToIdentity) - return SkewTransformOperation::create(m_angleX - m_angleX * progress, m_angleY - m_angleY * progress, m_type); - - const SkewTransformOperation* fromOp = static_cast<const SkewTransformOperation*>(from); - double fromAngleX = fromOp ? fromOp->m_angleX : 0; - double fromAngleY = fromOp ? fromOp->m_angleY : 0; - return SkewTransformOperation::create(fromAngleX + (m_angleX - fromAngleX) * progress, fromAngleY + (m_angleY - fromAngleY) * progress, m_type); -} - -} // namespace WebCore diff --git a/WebCore/rendering/style/SkewTransformOperation.h b/WebCore/rendering/style/SkewTransformOperation.h deleted file mode 100644 index a7879e8..0000000 --- a/WebCore/rendering/style/SkewTransformOperation.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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) 2006 Graham Dennis (graham.dennis@gmail.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SkewTransformOperation_h -#define SkewTransformOperation_h - -#include "TransformOperation.h" - -namespace WebCore { - -class SkewTransformOperation : public TransformOperation { -public: - static PassRefPtr<SkewTransformOperation> create(double angleX, double angleY, OperationType type) - { - return adoptRef(new SkewTransformOperation(angleX, angleY, type)); - } - - virtual bool isIdentity() const { return m_angleX == 0 && m_angleY == 0; } - virtual OperationType getOperationType() const { return m_type; } - virtual bool isSameType(const TransformOperation& o) const { return o.getOperationType() == m_type; } - - virtual bool operator==(const TransformOperation& o) const - { - if (!isSameType(o)) - return false; - const SkewTransformOperation* s = static_cast<const SkewTransformOperation*>(&o); - return m_angleX == s->m_angleX && m_angleY == s->m_angleY; - } - - virtual bool apply(AffineTransform& transform, const IntSize& borderBoxSize) const - { - transform.skew(m_angleX, m_angleY); - return false; - } - - virtual PassRefPtr<TransformOperation> blend(const TransformOperation* from, double progress, bool blendToIdentity = false); - -private: - SkewTransformOperation(double angleX, double angleY, OperationType type) - : m_angleX(angleX) - , m_angleY(angleY) - , m_type(type) - { - } - - double m_angleX; - double m_angleY; - OperationType m_type; -}; - -} // namespace WebCore - -#endif // SkewTransformOperation_h diff --git a/WebCore/rendering/style/StyleCachedImage.cpp b/WebCore/rendering/style/StyleCachedImage.cpp index 17ebce9..b55c5b9 100644 --- a/WebCore/rendering/style/StyleCachedImage.cpp +++ b/WebCore/rendering/style/StyleCachedImage.cpp @@ -84,7 +84,7 @@ void StyleCachedImage::removeClient(RenderObject* renderer) return m_image->removeClient(renderer); } -Image* StyleCachedImage::image(RenderObject* renderer, const IntSize&) const +Image* StyleCachedImage::image(RenderObject*, const IntSize&) const { return m_image->image(); } diff --git a/WebCore/rendering/style/StyleImage.h b/WebCore/rendering/style/StyleImage.h index 4bdba6e..cb90288 100644 --- a/WebCore/rendering/style/StyleImage.h +++ b/WebCore/rendering/style/StyleImage.h @@ -48,7 +48,7 @@ public: virtual PassRefPtr<CSSValue> cssValue() = 0; - virtual bool canRender(float multiplier) const { return true; } + virtual bool canRender(float /*multiplier*/) const { return true; } virtual bool isLoaded() const { return true; } virtual bool errorOccurred() const { return false; } virtual IntSize imageSize(const RenderObject*, float multiplier) const = 0; diff --git a/WebCore/rendering/style/TimingFunction.h b/WebCore/rendering/style/TimingFunction.h deleted file mode 100644 index f114596..0000000 --- a/WebCore/rendering/style/TimingFunction.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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) 2006 Graham Dennis (graham.dennis@gmail.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef TimingFunction_h -#define TimingFunction_h - -#include "RenderStyleConstants.h" - -namespace WebCore { - -struct TimingFunction { - TimingFunction() - : m_type(CubicBezierTimingFunction) - , m_x1(0.25) - , m_y1(0.1) - , m_x2(0.25) - , m_y2(1.0) - { - } - - TimingFunction(ETimingFunctionType timingFunction, double x1 = 0.0, double y1 = 0.0, double x2 = 1.0, double y2 = 1.0) - : m_type(timingFunction) - , m_x1(x1) - , m_y1(y1) - , m_x2(x2) - , m_y2(y2) - { - } - - bool operator==(const TimingFunction& o) const - { - return m_type == o.m_type && m_x1 == o.m_x1 && m_y1 == o.m_y1 && m_x2 == o.m_x2 && m_y2 == o.m_y2; - } - - double x1() const { return m_x1; } - double y1() const { return m_y1; } - double x2() const { return m_x2; } - double y2() const { return m_y2; } - - ETimingFunctionType type() const { return m_type; } - -private: - ETimingFunctionType m_type; - - double m_x1; - double m_y1; - double m_x2; - double m_y2; -}; - -} // namespace WebCore - -#endif // TimingFunction_h diff --git a/WebCore/rendering/style/TransformOperation.h b/WebCore/rendering/style/TransformOperation.h deleted file mode 100644 index 1baa67d..0000000 --- a/WebCore/rendering/style/TransformOperation.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * 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) 2006 Graham Dennis (graham.dennis@gmail.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef TransformOperation_h -#define TransformOperation_h - -#include "AffineTransform.h" -#include "IntSize.h" -#include <wtf/PassRefPtr.h> -#include <wtf/RefCounted.h> - -namespace WebCore { - -// CSS Transforms (may become part of CSS3) - -class TransformOperation : public RefCounted<TransformOperation> { -public: - enum OperationType { - SCALE_X, SCALE_Y, SCALE, - TRANSLATE_X, TRANSLATE_Y, TRANSLATE, - ROTATE, - SKEW_X, SKEW_Y, SKEW, - MATRIX, IDENTITY, NONE - }; - - virtual ~TransformOperation() { } - - virtual bool operator==(const TransformOperation&) const = 0; - bool operator!=(const TransformOperation& o) const { return !(*this == o); } - - virtual bool isIdentity() const = 0; - - virtual bool apply(AffineTransform&, const IntSize& borderBoxSize) const = 0; - - virtual PassRefPtr<TransformOperation> blend(const TransformOperation* from, double progress, bool blendToIdentity = false) = 0; - - virtual OperationType getOperationType() const = 0; - virtual bool isSameType(const TransformOperation& o) const { return false; } -}; - -} // namespace WebCore - -#endif // TransformOperation_h diff --git a/WebCore/rendering/style/TransformOperations.cpp b/WebCore/rendering/style/TransformOperations.cpp deleted file mode 100644 index 3d71480..0000000 --- a/WebCore/rendering/style/TransformOperations.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) - * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "config.h" -#include "TransformOperations.h" - -#include "IdentityTransformOperation.h" - -namespace WebCore { - -TransformOperations::TransformOperations(bool makeIdentity) -{ - if (makeIdentity) - m_operations.append(IdentityTransformOperation::create()); -} - -bool TransformOperations::operator==(const TransformOperations& o) const -{ - if (m_operations.size() != o.m_operations.size()) - return false; - - unsigned s = m_operations.size(); - for (unsigned i = 0; i < s; i++) { - if (*m_operations[i] != *o.m_operations[i]) - return false; - } - - return true; -} - -} // namespace WebCore diff --git a/WebCore/rendering/style/TransformOperations.h b/WebCore/rendering/style/TransformOperations.h deleted file mode 100644 index d558a4e..0000000 --- a/WebCore/rendering/style/TransformOperations.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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) 2006 Graham Dennis (graham.dennis@gmail.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef TransformOperations_h -#define TransformOperations_h - -#include "TransformOperation.h" -#include <wtf/RefPtr.h> -#include <wtf/Vector.h> - -namespace WebCore { - -class TransformOperations { -public: - TransformOperations(bool makeIdentity = false); - - bool operator==(const TransformOperations& o) const; - bool operator!=(const TransformOperations& o) const - { - return !(*this == o); - } - - void apply(const IntSize& sz, AffineTransform& t) const - { - for (unsigned i = 0; i < m_operations.size(); ++i) - m_operations[i]->apply(t, sz); - } - - Vector<RefPtr<TransformOperation> >& operations() { return m_operations; } - const Vector<RefPtr<TransformOperation> >& operations() const { return m_operations; } - -private: - Vector<RefPtr<TransformOperation> > m_operations; -}; - -} // namespace WebCore - -#endif // TransformOperations_h diff --git a/WebCore/rendering/style/TranslateTransformOperation.cpp b/WebCore/rendering/style/TranslateTransformOperation.cpp deleted file mode 100644 index 47471c4..0000000 --- a/WebCore/rendering/style/TranslateTransformOperation.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) - * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "config.h" -#include "TranslateTransformOperation.h" - -namespace WebCore { - -PassRefPtr<TransformOperation> TranslateTransformOperation::blend(const TransformOperation* from, double progress, bool blendToIdentity) -{ - if (from && !from->isSameType(*this)) - return this; - - if (blendToIdentity) - return TranslateTransformOperation::create(Length(m_x.type()).blend(m_x, progress), Length(m_y.type()).blend(m_y, progress), m_type); - - const TranslateTransformOperation* fromOp = static_cast<const TranslateTransformOperation*>(from); - Length fromX = fromOp ? fromOp->m_x : Length(m_x.type()); - Length fromY = fromOp ? fromOp->m_y : Length(m_y.type()); - return TranslateTransformOperation::create(m_x.blend(fromX, progress), m_y.blend(fromY, progress), m_type); -} - -} // namespace WebCore diff --git a/WebCore/rendering/style/TranslateTransformOperation.h b/WebCore/rendering/style/TranslateTransformOperation.h deleted file mode 100644 index c292ae7..0000000 --- a/WebCore/rendering/style/TranslateTransformOperation.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * 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) 2006 Graham Dennis (graham.dennis@gmail.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef TranslateTransformOperation_h -#define TranslateTransformOperation_h - -#include "Length.h" -#include "TransformOperation.h" - -namespace WebCore { - -class TranslateTransformOperation : public TransformOperation { -public: - static PassRefPtr<TranslateTransformOperation> create(const Length& tx, const Length& ty, OperationType type) - { - return adoptRef(new TranslateTransformOperation(tx, ty, type)); - } - - virtual bool isIdentity() const { return m_x.calcFloatValue(1) == 0 && m_y.calcFloatValue(1) == 0; } - virtual OperationType getOperationType() const { return m_type; } - virtual bool isSameType(const TransformOperation& o) const { return o.getOperationType() == m_type; } - - virtual bool operator==(const TransformOperation& o) const - { - if (!isSameType(o)) - return false; - const TranslateTransformOperation* t = static_cast<const TranslateTransformOperation*>(&o); - return m_x == t->m_x && m_y == t->m_y; - } - - virtual bool apply(AffineTransform& transform, const IntSize& borderBoxSize) const - { - transform.translate(m_x.calcFloatValue(borderBoxSize.width()), m_y.calcFloatValue(borderBoxSize.height())); - return m_x.type() == Percent || m_y.type() == Percent; - } - - virtual PassRefPtr<TransformOperation> blend(const TransformOperation* from, double progress, bool blendToIdentity = false); - -private: - TranslateTransformOperation(const Length& tx, const Length& ty, OperationType type) - : m_x(tx) - , m_y(ty) - , m_type(type) - { - } - - Length m_x; - Length m_y; - OperationType m_type; -}; - -} // namespace WebCore - -#endif // TranslateTransformOperation_h |