diff options
Diffstat (limited to 'WebCore/rendering/style')
-rw-r--r-- | WebCore/rendering/style/ContentData.h | 6 | ||||
-rw-r--r-- | WebCore/rendering/style/CounterContent.h | 2 | ||||
-rw-r--r-- | WebCore/rendering/style/FillLayer.h | 2 | ||||
-rw-r--r-- | WebCore/rendering/style/LineClampValue.h | 69 | ||||
-rw-r--r-- | WebCore/rendering/style/RenderStyle.cpp | 4 | ||||
-rw-r--r-- | WebCore/rendering/style/RenderStyle.h | 11 | ||||
-rw-r--r-- | WebCore/rendering/style/RenderStyleConstants.h | 9 | ||||
-rw-r--r-- | WebCore/rendering/style/SVGRenderStyle.cpp | 2 | ||||
-rw-r--r-- | WebCore/rendering/style/SVGRenderStyle.h | 2 | ||||
-rw-r--r-- | WebCore/rendering/style/SVGRenderStyleDefs.cpp | 2 | ||||
-rw-r--r-- | WebCore/rendering/style/SVGRenderStyleDefs.h | 2 | ||||
-rw-r--r-- | WebCore/rendering/style/ShadowData.h | 3 | ||||
-rw-r--r-- | WebCore/rendering/style/StyleBackgroundData.cpp | 2 | ||||
-rw-r--r-- | WebCore/rendering/style/StyleRareInheritedData.cpp | 5 | ||||
-rw-r--r-- | WebCore/rendering/style/StyleRareInheritedData.h | 1 | ||||
-rw-r--r-- | WebCore/rendering/style/StyleRareNonInheritedData.h | 3 |
16 files changed, 101 insertions, 24 deletions
diff --git a/WebCore/rendering/style/ContentData.h b/WebCore/rendering/style/ContentData.h index 24d5f86..2c261f8 100644 --- a/WebCore/rendering/style/ContentData.h +++ b/WebCore/rendering/style/ContentData.h @@ -25,15 +25,15 @@ #ifndef ContentData_h #define ContentData_h -#include "PlatformString.h" #include "RenderStyleConstants.h" -#include "StringImpl.h" -#include "StyleImage.h" #include <wtf/Noncopyable.h> +#include <wtf/PassRefPtr.h> namespace WebCore { class CounterContent; +class StringImpl; +class StyleImage; struct ContentData : Noncopyable { public: diff --git a/WebCore/rendering/style/CounterContent.h b/WebCore/rendering/style/CounterContent.h index cf11813..702d9c2 100644 --- a/WebCore/rendering/style/CounterContent.h +++ b/WebCore/rendering/style/CounterContent.h @@ -30,7 +30,7 @@ namespace WebCore { -class CounterContent { +class CounterContent : public FastAllocBase { public: CounterContent(const AtomicString& identifier, EListStyleType style, const AtomicString& separator) : m_identifier(identifier) diff --git a/WebCore/rendering/style/FillLayer.h b/WebCore/rendering/style/FillLayer.h index fb928b6..9c615b4 100644 --- a/WebCore/rendering/style/FillLayer.h +++ b/WebCore/rendering/style/FillLayer.h @@ -59,7 +59,7 @@ struct FillSize { LengthSize size; }; -struct FillLayer { +struct FillLayer : FastAllocBase { public: FillLayer(EFillLayerType); ~FillLayer(); diff --git a/WebCore/rendering/style/LineClampValue.h b/WebCore/rendering/style/LineClampValue.h new file mode 100644 index 0000000..2119ca2 --- /dev/null +++ b/WebCore/rendering/style/LineClampValue.h @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2009 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef LineClampValue_h +#define LineClampValue_h + +#include "RenderStyleConstants.h" + +namespace WebCore { + +class LineClampValue { +public: + LineClampValue() + : m_type(LineClampLineCount) + , m_value(-1) + { + } + + LineClampValue(int value, ELineClampType type) + : m_type(type) + , m_value(value) + { + } + + int value() const { return m_value; } + + bool isPercentage() const { return m_type == LineClampPercentage; } + + bool isNone() const { return m_value == -1; } + + bool operator==(const LineClampValue& o) const + { + return value() == o.value() && isPercentage() == o.isPercentage(); + } + + bool operator!=(const LineClampValue& o) const + { + return !(*this == o); + } + +private: + ELineClampType m_type; + int m_value; +}; + +} // namespace WebCore + +#endif // LineClampValue_h diff --git a/WebCore/rendering/style/RenderStyle.cpp b/WebCore/rendering/style/RenderStyle.cpp index a861fea..59d40b4 100644 --- a/WebCore/rendering/style/RenderStyle.cpp +++ b/WebCore/rendering/style/RenderStyle.cpp @@ -454,8 +454,8 @@ StyleDifference RenderStyle::diff(const RenderStyle* other, unsigned& changedCon if (inherited->m_effectiveZoom != other->inherited->m_effectiveZoom) return StyleDifferenceLayout; - if (rareNonInheritedData->opacity == 1 && other->rareNonInheritedData->opacity < 1 || - rareNonInheritedData->opacity < 1 && other->rareNonInheritedData->opacity == 1) { + if ((rareNonInheritedData->opacity == 1 && other->rareNonInheritedData->opacity < 1) || + (rareNonInheritedData->opacity < 1 && other->rareNonInheritedData->opacity == 1)) { // FIXME: We should add an optimized form of layout that just recomputes visual overflow. return StyleDifferenceLayout; } diff --git a/WebCore/rendering/style/RenderStyle.h b/WebCore/rendering/style/RenderStyle.h index 674f062..a72b66d 100644 --- a/WebCore/rendering/style/RenderStyle.h +++ b/WebCore/rendering/style/RenderStyle.h @@ -37,6 +37,7 @@ #include "CachedImage.h" #include "CollapsedBorderValue.h" #include "Color.h" +#include "ColorSpace.h" #include "ContentData.h" #include "CounterDirectives.h" #include "CursorList.h" @@ -49,6 +50,7 @@ #include "Length.h" #include "LengthBox.h" #include "LengthSize.h" +#include "LineClampValue.h" #include "NinePieceImage.h" #include "OutlineValue.h" #include "Pair.h" @@ -599,6 +601,7 @@ public: const Color& textStrokeColor() const { return rareInheritedData->textStrokeColor; } float textStrokeWidth() const { return rareInheritedData->textStrokeWidth; } const Color& textFillColor() const { return rareInheritedData->textFillColor; } + ColorSpace colorSpace() const { return static_cast<ColorSpace>(rareInheritedData->colorSpace); } float opacity() const { return rareNonInheritedData->opacity; } ControlPart appearance() const { return static_cast<ControlPart>(rareNonInheritedData->m_appearance); } EBoxAlignment boxAlign() const { return static_cast<EBoxAlignment>(rareNonInheritedData->flexibleBox->align); } @@ -693,7 +696,7 @@ public: bool isRunningAcceleratedAnimation() const { return rareNonInheritedData->m_runningAcceleratedAnimation; } #endif - int lineClamp() const { return rareNonInheritedData->lineClamp; } + const LineClampValue& lineClamp() const { return rareNonInheritedData->lineClamp; } bool textSizeAdjust() const { return rareInheritedData->textSizeAdjust; } ETextSecurity textSecurity() const { return static_cast<ETextSecurity>(rareInheritedData->textSecurity); } @@ -934,6 +937,7 @@ public: void setTextStrokeColor(const Color& c) { SET_VAR(rareInheritedData, textStrokeColor, c) } void setTextStrokeWidth(float w) { SET_VAR(rareInheritedData, textStrokeWidth, w) } void setTextFillColor(const Color& c) { SET_VAR(rareInheritedData, textFillColor, c) } + void setColorSpace(ColorSpace space) { SET_VAR(rareInheritedData, colorSpace, space) } void setOpacity(float f) { SET_VAR(rareNonInheritedData, opacity, f); } void setAppearance(ControlPart a) { SET_VAR(rareNonInheritedData, m_appearance, a); } void setBoxAlign(EBoxAlignment a) { SET_VAR(rareNonInheritedData.access()->flexibleBox, align, a); } @@ -1013,7 +1017,7 @@ public: void setIsRunningAcceleratedAnimation(bool b = true) { SET_VAR(rareNonInheritedData, m_runningAcceleratedAnimation, b); } #endif - void setLineClamp(int c) { SET_VAR(rareNonInheritedData, lineClamp, c); } + void setLineClamp(LineClampValue c) { SET_VAR(rareNonInheritedData, lineClamp, c); } void setTextSizeAdjust(bool b) { SET_VAR(rareInheritedData, textSizeAdjust, b); } void setTextSecurity(ETextSecurity aTextSecurity) { SET_VAR(rareInheritedData, textSecurity, aTextSecurity); } @@ -1186,9 +1190,10 @@ public: static float initialPerspective() { return 0; } static Length initialPerspectiveOriginX() { return Length(50.0, Percent); } static Length initialPerspectiveOriginY() { return Length(50.0, Percent); } + static Color initialBackgroundColor() { return Color::transparent; } // Keep these at the end. - static int initialLineClamp() { return -1; } + static LineClampValue initialLineClamp() { return LineClampValue(); } static bool initialTextSizeAdjust() { return true; } static ETextSecurity initialTextSecurity() { return TSNONE; } #if ENABLE(DASHBOARD_SUPPORT) diff --git a/WebCore/rendering/style/RenderStyleConstants.h b/WebCore/rendering/style/RenderStyleConstants.h index 3010947..92cd3d5 100644 --- a/WebCore/rendering/style/RenderStyleConstants.h +++ b/WebCore/rendering/style/RenderStyleConstants.h @@ -2,7 +2,7 @@ * Copyright (C) 2000 Lars Knoll (knoll@kde.org) * (C) 2000 Antti Koivisto (koivisto@kde.org) * (C) 2000 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. + * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/) * @@ -69,8 +69,9 @@ 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_VOLUME_SLIDER, MEDIA_CONTROLS_VOLUME_SLIDER_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, MEDIA_CONTROLS_REWIND_BUTTON, MEDIA_CONTROLS_RETURN_TO_REALTIME_BUTTON, + MEDIA_CONTROLS_VOLUME_SLIDER, MEDIA_CONTROLS_VOLUME_SLIDER_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, MEDIA_CONTROLS_REWIND_BUTTON, + MEDIA_CONTROLS_RETURN_TO_REALTIME_BUTTON, MEDIA_CONTROLS_TOGGLE_CLOSED_CAPTIONS_BUTTON, MEDIA_CONTROLS_STATUS_DISPLAY, SCROLLBAR_THUMB, SCROLLBAR_BUTTON, SCROLLBAR_TRACK, SCROLLBAR_TRACK_PIECE, SCROLLBAR_CORNER, RESIZER, INPUT_LIST_BUTTON, @@ -321,6 +322,8 @@ enum ETransformStyle3D { enum EBackfaceVisibility { BackfaceVisibilityVisible, BackfaceVisibilityHidden }; + +enum ELineClampType { LineClampLineCount, LineClampPercentage }; } // namespace WebCore diff --git a/WebCore/rendering/style/SVGRenderStyle.cpp b/WebCore/rendering/style/SVGRenderStyle.cpp index e8827c4..728738b 100644 --- a/WebCore/rendering/style/SVGRenderStyle.cpp +++ b/WebCore/rendering/style/SVGRenderStyle.cpp @@ -8,8 +8,6 @@ Copyright (C) 2002-2003 Dirk Mueller (mueller@kde.org) Copyright (C) 2002 Apple Computer, Inc. - This file is part of the KDE project - 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 diff --git a/WebCore/rendering/style/SVGRenderStyle.h b/WebCore/rendering/style/SVGRenderStyle.h index 12477d7..c65be97 100644 --- a/WebCore/rendering/style/SVGRenderStyle.h +++ b/WebCore/rendering/style/SVGRenderStyle.h @@ -3,8 +3,6 @@ 2004, 2005 Rob Buis <buis@kde.org> Copyright (C) 2005, 2006 Apple Computer, Inc. - This file is part of the KDE project - 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 diff --git a/WebCore/rendering/style/SVGRenderStyleDefs.cpp b/WebCore/rendering/style/SVGRenderStyleDefs.cpp index 2ed1d8f..093f1f1 100644 --- a/WebCore/rendering/style/SVGRenderStyleDefs.cpp +++ b/WebCore/rendering/style/SVGRenderStyleDefs.cpp @@ -8,8 +8,6 @@ Copyright (C) 2002-2003 Dirk Mueller (mueller@kde.org) Copyright (C) 2002 Apple Computer, Inc. - This file is part of the KDE project - 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 diff --git a/WebCore/rendering/style/SVGRenderStyleDefs.h b/WebCore/rendering/style/SVGRenderStyleDefs.h index f4cf932..8f01d9f 100644 --- a/WebCore/rendering/style/SVGRenderStyleDefs.h +++ b/WebCore/rendering/style/SVGRenderStyleDefs.h @@ -8,8 +8,6 @@ (C) 2000-2003 Dirk Mueller (mueller@kde.org) (C) 2002-2003 Apple Computer, Inc. - This file is part of the KDE project - 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 diff --git a/WebCore/rendering/style/ShadowData.h b/WebCore/rendering/style/ShadowData.h index f4061f2..089cf77 100644 --- a/WebCore/rendering/style/ShadowData.h +++ b/WebCore/rendering/style/ShadowData.h @@ -26,6 +26,7 @@ #define ShadowData_h #include "Color.h" +#include <wtf/FastAllocBase.h> namespace WebCore { @@ -33,7 +34,7 @@ enum ShadowStyle { Normal, Inset }; // This struct holds information about shadows for the text-shadow and box-shadow properties. -struct ShadowData { +struct ShadowData : FastAllocBase { ShadowData() : x(0) , y(0) diff --git a/WebCore/rendering/style/StyleBackgroundData.cpp b/WebCore/rendering/style/StyleBackgroundData.cpp index 68a9ddd..08f5527 100644 --- a/WebCore/rendering/style/StyleBackgroundData.cpp +++ b/WebCore/rendering/style/StyleBackgroundData.cpp @@ -22,12 +22,14 @@ #include "config.h" #include "StyleBackgroundData.h" +#include "RenderStyle.h" #include "RenderStyleConstants.h" namespace WebCore { StyleBackgroundData::StyleBackgroundData() : m_background(BackgroundFillLayer) + , m_color(RenderStyle::initialBackgroundColor()) { } diff --git a/WebCore/rendering/style/StyleRareInheritedData.cpp b/WebCore/rendering/style/StyleRareInheritedData.cpp index 0f3b7e7..ff626b7 100644 --- a/WebCore/rendering/style/StyleRareInheritedData.cpp +++ b/WebCore/rendering/style/StyleRareInheritedData.cpp @@ -42,6 +42,7 @@ StyleRareInheritedData::StyleRareInheritedData() , textSizeAdjust(RenderStyle::initialTextSizeAdjust()) , resize(RenderStyle::initialResize()) , userSelect(RenderStyle::initialUserSelect()) + , colorSpace(DeviceColorSpace) { } @@ -64,6 +65,7 @@ StyleRareInheritedData::StyleRareInheritedData(const StyleRareInheritedData& o) , textSizeAdjust(o.textSizeAdjust) , resize(o.resize) , userSelect(o.userSelect) + , colorSpace(o.colorSpace) { } @@ -90,7 +92,8 @@ bool StyleRareInheritedData::operator==(const StyleRareInheritedData& o) const && tapHighlightColor == o.tapHighlightColor #endif && resize == o.resize - && userSelect == o.userSelect; + && userSelect == o.userSelect + && colorSpace == o.colorSpace; } bool StyleRareInheritedData::shadowDataEquivalent(const StyleRareInheritedData& o) const diff --git a/WebCore/rendering/style/StyleRareInheritedData.h b/WebCore/rendering/style/StyleRareInheritedData.h index 4abd3cf..1aa7b05 100644 --- a/WebCore/rendering/style/StyleRareInheritedData.h +++ b/WebCore/rendering/style/StyleRareInheritedData.h @@ -68,6 +68,7 @@ public: bool textSizeAdjust : 1; // An Apple extension. unsigned resize : 2; // EResize unsigned userSelect : 1; // EUserSelect + unsigned colorSpace : 1; // ColorSpace private: StyleRareInheritedData(); diff --git a/WebCore/rendering/style/StyleRareNonInheritedData.h b/WebCore/rendering/style/StyleRareNonInheritedData.h index 8dd22b3..452b273 100644 --- a/WebCore/rendering/style/StyleRareNonInheritedData.h +++ b/WebCore/rendering/style/StyleRareNonInheritedData.h @@ -29,6 +29,7 @@ #include "CursorData.h" #include "DataRef.h" #include "FillLayer.h" +#include "LineClampValue.h" #include "NinePieceImage.h" #include "StyleTransformData.h" #include <wtf/OwnPtr.h> @@ -77,7 +78,7 @@ public: bool animationDataEquivalent(const StyleRareNonInheritedData&) const; bool transitionDataEquivalent(const StyleRareNonInheritedData&) const; - int lineClamp; // An Apple extension. + LineClampValue lineClamp; // An Apple extension. #if ENABLE(DASHBOARD_SUPPORT) Vector<StyleDashboardRegion> m_dashboardRegions; #endif |