summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/rendering/style
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2011-05-24 11:24:40 +0100
committerBen Murdoch <benm@google.com>2011-06-02 09:53:15 +0100
commit81bc750723a18f21cd17d1b173cd2a4dda9cea6e (patch)
tree7a9e5ed86ff429fd347a25153107221543909b19 /Source/WebCore/rendering/style
parent94088a6d336c1dd80a1e734af51e96abcbb689a7 (diff)
downloadexternal_webkit-81bc750723a18f21cd17d1b173cd2a4dda9cea6e.zip
external_webkit-81bc750723a18f21cd17d1b173cd2a4dda9cea6e.tar.gz
external_webkit-81bc750723a18f21cd17d1b173cd2a4dda9cea6e.tar.bz2
Merge WebKit at r80534: Intial merge by Git
Change-Id: Ia7a83357124c9e1cdb1debf55d9661ec0bd09a61
Diffstat (limited to 'Source/WebCore/rendering/style')
-rw-r--r--Source/WebCore/rendering/style/ContentData.cpp4
-rw-r--r--Source/WebCore/rendering/style/ContentData.h14
-rw-r--r--Source/WebCore/rendering/style/QuotesData.cpp60
-rw-r--r--Source/WebCore/rendering/style/QuotesData.h43
-rw-r--r--Source/WebCore/rendering/style/RenderStyle.cpp17
-rw-r--r--Source/WebCore/rendering/style/RenderStyle.h28
-rw-r--r--Source/WebCore/rendering/style/RenderStyleConstants.h6
-rw-r--r--Source/WebCore/rendering/style/SVGRenderStyle.cpp6
-rw-r--r--Source/WebCore/rendering/style/SVGRenderStyle.h50
-rw-r--r--Source/WebCore/rendering/style/SVGRenderStyleDefs.cpp44
-rw-r--r--Source/WebCore/rendering/style/SVGRenderStyleDefs.h14
-rw-r--r--Source/WebCore/rendering/style/StyleAllInOne.cpp1
-rw-r--r--Source/WebCore/rendering/style/StyleRareInheritedData.cpp14
-rw-r--r--Source/WebCore/rendering/style/StyleRareInheritedData.h7
14 files changed, 249 insertions, 59 deletions
diff --git a/Source/WebCore/rendering/style/ContentData.cpp b/Source/WebCore/rendering/style/ContentData.cpp
index d150f77..ab504fd 100644
--- a/Source/WebCore/rendering/style/ContentData.cpp
+++ b/Source/WebCore/rendering/style/ContentData.cpp
@@ -51,6 +51,8 @@ bool ContentData::dataEquivalent(const ContentData& other) const
return StyleImage::imagesEquivalent(image(), other.image());
case CONTENT_COUNTER:
return *counter() == *other.counter();
+ case CONTENT_QUOTE:
+ return quote() == other.quote();
}
ASSERT_NOT_REACHED();
@@ -71,6 +73,8 @@ void ContentData::deleteContent()
case CONTENT_COUNTER:
delete m_content.m_counter;
break;
+ case CONTENT_QUOTE:
+ break;
}
m_type = CONTENT_NONE;
diff --git a/Source/WebCore/rendering/style/ContentData.h b/Source/WebCore/rendering/style/ContentData.h
index 15f6912..cce3754 100644
--- a/Source/WebCore/rendering/style/ContentData.h
+++ b/Source/WebCore/rendering/style/ContentData.h
@@ -51,6 +51,7 @@ public:
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 isQuote() const { return m_type == CONTENT_QUOTE; }
bool isText() const { return m_type == CONTENT_TEXT; }
StyleContentType type() const { return m_type; }
@@ -93,6 +94,18 @@ public:
m_content.m_counter = counter.leakPtr();
}
+ QuoteType quote() const
+ {
+ ASSERT(isQuote());
+ return m_content.m_quote;
+ }
+ void setQuote(QuoteType type)
+ {
+ deleteContent();
+ m_type = CONTENT_QUOTE;
+ m_content.m_quote = type;
+ }
+
ContentData* next() const { return m_next.get(); }
void setNext(PassOwnPtr<ContentData> next) { m_next = next; }
@@ -104,6 +117,7 @@ private:
StyleImage* m_image;
StringImpl* m_text;
CounterContent* m_counter;
+ QuoteType m_quote;
} m_content;
OwnPtr<ContentData> m_next;
};
diff --git a/Source/WebCore/rendering/style/QuotesData.cpp b/Source/WebCore/rendering/style/QuotesData.cpp
new file mode 100644
index 0000000..829fe3f
--- /dev/null
+++ b/Source/WebCore/rendering/style/QuotesData.cpp
@@ -0,0 +1,60 @@
+/**
+ * Copyright (C) 2011 Nokia 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 "QuotesData.h"
+
+namespace WebCore {
+
+QuotesData* QuotesData::create(int stringCount)
+{
+ char* tmp = new char[sizeof(QuotesData)+sizeof(String)*stringCount];
+ if (!tmp)
+ return 0;
+ new (tmp) QuotesData(stringCount);
+ for (int i = 0; i < stringCount; ++i)
+ new (tmp +sizeof(QuotesData) + sizeof(String)*i) String();
+ return reinterpret_cast<QuotesData*>(tmp);
+}
+
+bool QuotesData::operator==(const QuotesData& other) const
+{
+ if (this == &other)
+ return true;
+ if (!&other || !this)
+ return false;
+ if (length != other.length)
+ return false;
+ const String* myData = data();
+ const String* otherData = other.data();
+ for (int i = length-1; i >= 0; --i)
+ if (myData[i] != otherData[i])
+ return false;
+ return true;
+}
+
+QuotesData::~QuotesData()
+{
+ String* p = data();
+ for (int i = 0; i < length; ++i)
+ p[i].~String();
+}
+
+} // namespace WebCore
diff --git a/Source/WebCore/rendering/style/QuotesData.h b/Source/WebCore/rendering/style/QuotesData.h
new file mode 100644
index 0000000..df8a6dd
--- /dev/null
+++ b/Source/WebCore/rendering/style/QuotesData.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2011 Nokia 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.
+ *
+ */
+
+#ifndef QuotesData_h
+#define QuotesData_h
+
+#include <wtf/RefPtr.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+class QuotesData : public RefCounted<QuotesData> {
+public:
+ virtual ~QuotesData();
+ static QuotesData* create(int stringCount);
+ String* data() { return reinterpret_cast<String*>(this+1); }
+ const String* data() const { return reinterpret_cast<const String*>(this+1); }
+ int length;
+ bool operator==(const QuotesData&) const;
+ void operator delete(void* p) { delete[] static_cast<char*>(p); }
+private:
+ QuotesData(int stringCount) : length(stringCount) {}
+};
+
+}
+#endif // QuotesData_h
diff --git a/Source/WebCore/rendering/style/RenderStyle.cpp b/Source/WebCore/rendering/style/RenderStyle.cpp
index b76a350..122b762 100644
--- a/Source/WebCore/rendering/style/RenderStyle.cpp
+++ b/Source/WebCore/rendering/style/RenderStyle.cpp
@@ -27,6 +27,7 @@
#include "CSSPropertyNames.h"
#include "CSSStyleSelector.h"
#include "FontSelector.h"
+#include "QuotesData.h"
#include "RenderArena.h"
#include "RenderObject.h"
#include "ScaleTransformOperation.h"
@@ -404,8 +405,10 @@ StyleDifference RenderStyle::diff(const RenderStyle* other, unsigned& changedCon
rareInheritedData->khtmlLineBreak != other->rareInheritedData->khtmlLineBreak ||
rareInheritedData->textSecurity != other->rareInheritedData->textSecurity ||
rareInheritedData->hyphens != other->rareInheritedData->hyphens ||
+ rareInheritedData->hyphenationLimitBefore != other->rareInheritedData->hyphenationLimitBefore ||
+ rareInheritedData->hyphenationLimitAfter != other->rareInheritedData->hyphenationLimitAfter ||
rareInheritedData->hyphenationString != other->rareInheritedData->hyphenationString ||
- rareInheritedData->hyphenationLocale != other->rareInheritedData->hyphenationLocale ||
+ rareInheritedData->locale != other->rareInheritedData->locale ||
rareInheritedData->textEmphasisMark != other->rareInheritedData->textEmphasisMark ||
rareInheritedData->textEmphasisPosition != other->rareInheritedData->textEmphasisPosition ||
rareInheritedData->textEmphasisCustomMark != other->rareInheritedData->textEmphasisCustomMark)
@@ -605,6 +608,13 @@ void RenderStyle::setCursorList(PassRefPtr<CursorList> other)
rareInheritedData.access()->cursorData = other;
}
+void RenderStyle::setQuotes(PassRefPtr<QuotesData> q)
+{
+ if (*rareInheritedData->quotes.get() == *q.get())
+ return;
+ rareInheritedData.access()->quotes = q;
+}
+
void RenderStyle::clearCursorList()
{
if (rareInheritedData->cursorData)
@@ -672,6 +682,11 @@ void RenderStyle::setContent(PassOwnPtr<CounterContent> counter, bool add)
prepareToSetContent(0, add)->setCounter(counter);
}
+void RenderStyle::setContent(QuoteType quote, bool add)
+{
+ prepareToSetContent(0, add)->setQuote(quote);
+}
+
void RenderStyle::applyTransform(TransformationMatrix& transform, const IntSize& borderBoxSize, ApplyTransformOrigin applyOrigin) const
{
// transform-origin brackets the transform with translate operations.
diff --git a/Source/WebCore/rendering/style/RenderStyle.h b/Source/WebCore/rendering/style/RenderStyle.h
index 7b79db1..79ed6e4 100644
--- a/Source/WebCore/rendering/style/RenderStyle.h
+++ b/Source/WebCore/rendering/style/RenderStyle.h
@@ -372,10 +372,18 @@ public:
Length top() const { return surround->offset.top(); }
Length bottom() const { return surround->offset.bottom(); }
+ // Accessors for positioned object edges that take into account writing mode.
+ Length logicalLeft() const { return isHorizontalWritingMode() ? left() : top(); }
+ Length logicalRight() const { return isHorizontalWritingMode() ? right() : bottom(); }
+ Length logicalTop() const { return isHorizontalWritingMode() ? (isFlippedBlocksWritingMode() ? bottom() : top()) : (isFlippedBlocksWritingMode() ? right() : left()); }
+ Length logicalBottom() const { return isHorizontalWritingMode() ? (isFlippedBlocksWritingMode() ? top() : bottom()) : (isFlippedBlocksWritingMode() ? left() : right()); }
+
// 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(); }
+ bool hasAutoLeftAndRight() const { return left().isAuto() && right().isAuto(); }
+ bool hasAutoTopAndBottom() const { return top().isAuto() && bottom().isAuto(); }
+ bool hasStaticInlinePosition(bool horizontal) const { return horizontal ? hasAutoLeftAndRight() : hasAutoTopAndBottom(); }
+ bool hasStaticBlockPosition(bool horizontal) const { return horizontal ? hasAutoTopAndBottom() : hasAutoLeftAndRight(); }
EPosition position() const { return static_cast<EPosition>(noninherited_flags._position); }
EFloat floating() const { return static_cast<EFloat>(noninherited_flags._floating); }
@@ -686,8 +694,10 @@ public:
EMatchNearestMailBlockquoteColor matchNearestMailBlockquoteColor() const { return static_cast<EMatchNearestMailBlockquoteColor>(rareNonInheritedData->matchNearestMailBlockquoteColor); }
const AtomicString& highlight() const { return rareInheritedData->highlight; }
Hyphens hyphens() const { return static_cast<Hyphens>(rareInheritedData->hyphens); }
+ short hyphenationLimitBefore() const { return rareInheritedData->hyphenationLimitBefore; }
+ short hyphenationLimitAfter() const { return rareInheritedData->hyphenationLimitAfter; }
const AtomicString& hyphenationString() const { return rareInheritedData->hyphenationString; }
- const AtomicString& hyphenationLocale() const { return rareInheritedData->hyphenationLocale; }
+ const AtomicString& locale() const { return rareInheritedData->locale; }
EBorderFit borderFit() const { return static_cast<EBorderFit>(rareNonInheritedData->m_borderFit); }
EResize resize() const { return static_cast<EResize>(rareInheritedData->resize); }
float columnWidth() const { return rareNonInheritedData->m_multiCol->m_width; }
@@ -1055,8 +1065,10 @@ public:
void setMatchNearestMailBlockquoteColor(EMatchNearestMailBlockquoteColor c) { SET_VAR(rareNonInheritedData, matchNearestMailBlockquoteColor, c); }
void setHighlight(const AtomicString& h) { SET_VAR(rareInheritedData, highlight, h); }
void setHyphens(Hyphens h) { SET_VAR(rareInheritedData, hyphens, h); }
+ void setHyphenationLimitBefore(short limit) { SET_VAR(rareInheritedData, hyphenationLimitBefore, limit); }
+ void setHyphenationLimitAfter(short limit) { SET_VAR(rareInheritedData, hyphenationLimitAfter, limit); }
void setHyphenationString(const AtomicString& h) { SET_VAR(rareInheritedData, hyphenationString, h); }
- void setHyphenationLocale(const AtomicString& h) { SET_VAR(rareInheritedData, hyphenationLocale, h); }
+ void setLocale(const AtomicString& locale) { SET_VAR(rareInheritedData, locale, locale); }
void setBorderFit(EBorderFit b) { SET_VAR(rareNonInheritedData, m_borderFit, b); }
void setResize(EResize r) { SET_VAR(rareInheritedData, resize, r); }
void setColumnWidth(float f) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_autoWidth, false); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_width, f); }
@@ -1161,10 +1173,14 @@ public:
void setContent(PassRefPtr<StringImpl>, bool add = false);
void setContent(PassRefPtr<StyleImage>, bool add = false);
void setContent(PassOwnPtr<CounterContent>, bool add = false);
+ void setContent(QuoteType, bool add = false);
const CounterDirectiveMap* counterDirectives() const;
CounterDirectiveMap& accessCounterDirectives();
+ QuotesData* quotes() const { return rareInheritedData->quotes.get(); }
+ void setQuotes(PassRefPtr<QuotesData>);
+
const AtomicString& hyphenString() const;
bool inheritedNotEqual(const RenderStyle*) const;
@@ -1296,8 +1312,10 @@ public:
static const AtomicString& initialHighlight() { return nullAtom; }
static ESpeak initialSpeak() { return SpeakNormal; }
static Hyphens initialHyphens() { return HyphensManual; }
+ static short initialHyphenationLimitBefore() { return -1; }
+ static short initialHyphenationLimitAfter() { return -1; }
static const AtomicString& initialHyphenationString() { return nullAtom; }
- static const AtomicString& initialHyphenationLocale() { return nullAtom; }
+ static const AtomicString& initialLocale() { return nullAtom; }
static EBorderFit initialBorderFit() { return BorderFitBorder; }
static EResize initialResize() { return RESIZE_NONE; }
static ControlPart initialAppearance() { return NoControlPart; }
diff --git a/Source/WebCore/rendering/style/RenderStyleConstants.h b/Source/WebCore/rendering/style/RenderStyleConstants.h
index 44cd3f5..3c62dbe 100644
--- a/Source/WebCore/rendering/style/RenderStyleConstants.h
+++ b/Source/WebCore/rendering/style/RenderStyleConstants.h
@@ -297,7 +297,11 @@ enum EListStyleType {
};
enum StyleContentType {
- CONTENT_NONE, CONTENT_OBJECT, CONTENT_TEXT, CONTENT_COUNTER
+ CONTENT_NONE, CONTENT_OBJECT, CONTENT_TEXT, CONTENT_COUNTER, CONTENT_QUOTE
+};
+
+enum QuoteType {
+ OPEN_QUOTE, CLOSE_QUOTE, NO_OPEN_QUOTE, NO_CLOSE_QUOTE
};
enum EBorderFit { BorderFitBorder, BorderFitLines };
diff --git a/Source/WebCore/rendering/style/SVGRenderStyle.cpp b/Source/WebCore/rendering/style/SVGRenderStyle.cpp
index 28f80f2..1ee1f36 100644
--- a/Source/WebCore/rendering/style/SVGRenderStyle.cpp
+++ b/Source/WebCore/rendering/style/SVGRenderStyle.cpp
@@ -169,7 +169,9 @@ StyleDifference SVGRenderStyle::diff(const SVGRenderStyle* other) const
// Some stroke properties, requires relayouts, as the cached stroke boundaries need to be recalculated.
if (stroke != other->stroke) {
if (stroke->width != other->stroke->width
- || stroke->paint != other->stroke->paint
+ || stroke->paintType != other->stroke->paintType
+ || stroke->paintColor != other->stroke->paintColor
+ || stroke->paintUri != other->stroke->paintUri
|| stroke->miterLimit != other->stroke->miterLimit
|| stroke->dashArray != other->stroke->dashArray
|| stroke->dashOffset != other->stroke->dashOffset)
@@ -191,7 +193,7 @@ StyleDifference SVGRenderStyle::diff(const SVGRenderStyle* other) const
}
// If fill changes, we just need to repaint. Fill boundaries are not influenced by this, only by the Path, that RenderSVGPath contains.
- if (fill != other->fill)
+ if (fill->paintType != other->fill->paintType || fill->paintColor != other->fill->paintColor || fill->paintUri != other->fill->paintUri)
return StyleDifferenceRepaint;
// If gradient stops change, we just need to repaint. Style updates are already handled through RenderSVGGradientSTop.
diff --git a/Source/WebCore/rendering/style/SVGRenderStyle.h b/Source/WebCore/rendering/style/SVGRenderStyle.h
index 7f032e7..88a48df 100644
--- a/Source/WebCore/rendering/style/SVGRenderStyle.h
+++ b/Source/WebCore/rendering/style/SVGRenderStyle.h
@@ -70,15 +70,19 @@ public:
static SVGWritingMode initialWritingMode() { return WM_LRTB; }
static EGlyphOrientation initialGlyphOrientationHorizontal() { return GO_0DEG; }
static EGlyphOrientation initialGlyphOrientationVertical() { return GO_AUTO; }
- static float initialFillOpacity() { return 1.0f; }
- static SVGPaint* initialFillPaint() { return SVGPaint::defaultFill(); }
- static float initialStrokeOpacity() { return 1.0f; }
- static SVGPaint* initialStrokePaint() { return SVGPaint::defaultStroke(); }
+ static float initialFillOpacity() { return 1; }
+ static SVGPaint::SVGPaintType initialFillPaintType() { return SVGPaint::SVG_PAINTTYPE_RGBCOLOR; }
+ static Color initialFillPaintColor() { return Color::black; }
+ static String initialFillPaintUri() { return String(); }
+ static float initialStrokeOpacity() { return 1; }
+ static SVGPaint::SVGPaintType initialStrokePaintType() { return SVGPaint::SVG_PAINTTYPE_NONE; }
+ static Color initialStrokePaintColor() { return Color(); }
+ static String initialStrokePaintUri() { return String(); }
static Vector<SVGLength> initialStrokeDashArray() { return Vector<SVGLength>(); }
- static float initialStrokeMiterLimit() { return 4.0f; }
- static float initialStopOpacity() { return 1.0f; }
+ static float initialStrokeMiterLimit() { return 4; }
+ static float initialStopOpacity() { return 1; }
static Color initialStopColor() { return Color(0, 0, 0); }
- static float initialFloodOpacity() { return 1.0f; }
+ static float initialFloodOpacity() { return 1; }
static Color initialFloodColor() { return Color(0, 0, 0); }
static Color initialLightingColor() { return Color(255, 255, 255); }
static ShadowData* initialShadow() { return 0; }
@@ -150,10 +154,14 @@ public:
fill.access()->opacity = obj;
}
- void setFillPaint(PassRefPtr<SVGPaint> obj)
+ void setFillPaint(SVGPaint::SVGPaintType type, const Color& color, const String& uri)
{
- if (!(fill->paint == obj))
- fill.access()->paint = obj;
+ if (!(fill->paintType == type))
+ fill.access()->paintType = type;
+ if (!(fill->paintColor == color))
+ fill.access()->paintColor = color;
+ if (!(fill->paintUri == uri))
+ fill.access()->paintUri = uri;
}
void setStrokeOpacity(float obj)
@@ -162,10 +170,14 @@ public:
stroke.access()->opacity = obj;
}
- void setStrokePaint(PassRefPtr<SVGPaint> obj)
+ void setStrokePaint(SVGPaint::SVGPaintType type, const Color& color, const String& uri)
{
- if (!(stroke->paint == obj))
- stroke.access()->paint = obj;
+ if (!(stroke->paintType == type))
+ stroke.access()->paintType = type;
+ if (!(stroke->paintColor == color))
+ stroke.access()->paintColor = color;
+ if (!(stroke->paintUri == uri))
+ stroke.access()->paintUri = uri;
}
void setStrokeDashArray(const Vector<SVGLength>& obj)
@@ -293,9 +305,13 @@ public:
EGlyphOrientation glyphOrientationHorizontal() const { return (EGlyphOrientation) svg_inherited_flags._glyphOrientationHorizontal; }
EGlyphOrientation glyphOrientationVertical() const { return (EGlyphOrientation) svg_inherited_flags._glyphOrientationVertical; }
float fillOpacity() const { return fill->opacity; }
- SVGPaint* fillPaint() const { return fill->paint.get(); }
+ const SVGPaint::SVGPaintType& fillPaintType() const { return fill->paintType; }
+ const Color& fillPaintColor() const { return fill->paintColor; }
+ const String& fillPaintUri() const { return fill->paintUri; }
float strokeOpacity() const { return stroke->opacity; }
- SVGPaint* strokePaint() const { return stroke->paint.get(); }
+ const SVGPaint::SVGPaintType& strokePaintType() const { return stroke->paintType; }
+ const Color& strokePaintColor() const { return stroke->paintColor; }
+ const String& strokePaintUri() const { return stroke->paintUri; }
Vector<SVGLength> strokeDashArray() const { return stroke->dashArray; }
float strokeMiterLimit() const { return stroke->miterLimit; }
SVGLength strokeWidth() const { return stroke->width; }
@@ -320,8 +336,8 @@ public:
bool hasMasker() const { return !maskerResource().isEmpty(); }
bool hasFilter() const { return !filterResource().isEmpty(); }
bool hasMarkers() const { return !markerStartResource().isEmpty() || !markerMidResource().isEmpty() || !markerEndResource().isEmpty(); }
- bool hasStroke() const { return strokePaint()->paintType() != SVGPaint::SVG_PAINTTYPE_NONE; }
- bool hasFill() const { return fillPaint()->paintType() != SVGPaint::SVG_PAINTTYPE_NONE; }
+ bool hasStroke() const { return strokePaintType() != SVGPaint::SVG_PAINTTYPE_NONE; }
+ bool hasFill() const { return fillPaintType() != SVGPaint::SVG_PAINTTYPE_NONE; }
bool isVerticalWritingMode() const { return writingMode() == WM_TBRL || writingMode() == WM_TB; }
protected:
diff --git a/Source/WebCore/rendering/style/SVGRenderStyleDefs.cpp b/Source/WebCore/rendering/style/SVGRenderStyleDefs.cpp
index c30ae6d..fb23e14 100644
--- a/Source/WebCore/rendering/style/SVGRenderStyleDefs.cpp
+++ b/Source/WebCore/rendering/style/SVGRenderStyleDefs.cpp
@@ -37,35 +37,27 @@ namespace WebCore {
StyleFillData::StyleFillData()
: opacity(SVGRenderStyle::initialFillOpacity())
- , paint(SVGRenderStyle::initialFillPaint())
+ , paintType(SVGRenderStyle::initialFillPaintType())
+ , paintColor(SVGRenderStyle::initialFillPaintColor())
+ , paintUri(SVGRenderStyle::initialFillPaintUri())
{
}
StyleFillData::StyleFillData(const StyleFillData& other)
: RefCounted<StyleFillData>()
, opacity(other.opacity)
- , paint(other.paint)
+ , paintType(other.paintType)
+ , paintColor(other.paintColor)
+ , paintUri(other.paintUri)
{
}
bool StyleFillData::operator==(const StyleFillData& other) const
{
- if (opacity != other.opacity)
- return false;
-
- if (!paint || !other.paint)
- return paint == other.paint;
-
- if (paint->paintType() != other.paint->paintType())
- return false;
-
- if (paint->paintType() == SVGPaint::SVG_PAINTTYPE_URI)
- return paint->uri() == other.paint->uri();
-
- if (paint->paintType() == SVGPaint::SVG_PAINTTYPE_RGBCOLOR)
- return paint->color() == other.paint->color();
-
- return paint == other.paint;
+ return opacity == other.opacity
+ && paintType == other.paintType
+ && paintColor == other.paintColor
+ && paintUri == other.paintUri;
}
StyleStrokeData::StyleStrokeData()
@@ -74,7 +66,9 @@ StyleStrokeData::StyleStrokeData()
, width(SVGRenderStyle::initialStrokeWidth())
, dashOffset(SVGRenderStyle::initialStrokeDashOffset())
, dashArray(SVGRenderStyle::initialStrokeDashArray())
- , paint(SVGRenderStyle::initialStrokePaint())
+ , paintType(SVGRenderStyle::initialStrokePaintType())
+ , paintColor(SVGRenderStyle::initialStrokePaintColor())
+ , paintUri(SVGRenderStyle::initialStrokePaintUri())
{
}
@@ -85,18 +79,22 @@ StyleStrokeData::StyleStrokeData(const StyleStrokeData& other)
, width(other.width)
, dashOffset(other.dashOffset)
, dashArray(other.dashArray)
- , paint(other.paint)
+ , paintType(other.paintType)
+ , paintColor(other.paintColor)
+ , paintUri(other.paintUri)
{
}
bool StyleStrokeData::operator==(const StyleStrokeData& other) const
{
- return paint == other.paint
- && width == other.width
+ return width == other.width
&& opacity == other.opacity
&& miterLimit == other.miterLimit
&& dashOffset == other.dashOffset
- && dashArray == other.dashArray;
+ && dashArray == other.dashArray
+ && paintType == other.paintType
+ && paintColor == other.paintColor
+ && paintUri == other.paintUri;
}
StyleStopData::StyleStopData()
diff --git a/Source/WebCore/rendering/style/SVGRenderStyleDefs.h b/Source/WebCore/rendering/style/SVGRenderStyleDefs.h
index de058a2..00358a0 100644
--- a/Source/WebCore/rendering/style/SVGRenderStyleDefs.h
+++ b/Source/WebCore/rendering/style/SVGRenderStyleDefs.h
@@ -29,9 +29,8 @@
#define SVGRenderStyleDefs_h
#if ENABLE(SVG)
-#include "Color.h"
-#include "PlatformString.h"
#include "SVGLength.h"
+#include "SVGPaint.h"
#include "ShadowData.h"
#include <wtf/OwnPtr.h>
#include <wtf/PassOwnPtr.h>
@@ -98,7 +97,7 @@ namespace WebCore {
public:
static PassRefPtr<StyleFillData> create() { return adoptRef(new StyleFillData); }
PassRefPtr<StyleFillData> copy() const { return adoptRef(new StyleFillData(*this)); }
-
+
bool operator==(const StyleFillData&) const;
bool operator!=(const StyleFillData& other) const
{
@@ -106,7 +105,9 @@ namespace WebCore {
}
float opacity;
- RefPtr<SVGPaint> paint;
+ SVGPaint::SVGPaintType paintType;
+ Color paintColor;
+ String paintUri;
private:
StyleFillData();
@@ -131,7 +132,9 @@ namespace WebCore {
SVGLength dashOffset;
Vector<SVGLength> dashArray;
- RefPtr<SVGPaint> paint;
+ SVGPaint::SVGPaintType paintType;
+ Color paintColor;
+ String paintUri;
private:
StyleStrokeData();
@@ -262,5 +265,4 @@ namespace WebCore {
} // namespace WebCore
#endif // ENABLE(SVG)
-
#endif // SVGRenderStyleDefs_h
diff --git a/Source/WebCore/rendering/style/StyleAllInOne.cpp b/Source/WebCore/rendering/style/StyleAllInOne.cpp
index 25b539f..967fa00 100644
--- a/Source/WebCore/rendering/style/StyleAllInOne.cpp
+++ b/Source/WebCore/rendering/style/StyleAllInOne.cpp
@@ -30,6 +30,7 @@
#include "FillLayer.cpp"
#include "KeyframeList.cpp"
#include "NinePieceImage.cpp"
+#include "QuotesData.cpp"
#include "RenderStyle.cpp"
#include "SVGRenderStyle.cpp"
#include "SVGRenderStyleDefs.cpp"
diff --git a/Source/WebCore/rendering/style/StyleRareInheritedData.cpp b/Source/WebCore/rendering/style/StyleRareInheritedData.cpp
index 0953dae..2798fd1 100644
--- a/Source/WebCore/rendering/style/StyleRareInheritedData.cpp
+++ b/Source/WebCore/rendering/style/StyleRareInheritedData.cpp
@@ -23,6 +23,7 @@
#include "StyleRareInheritedData.h"
#include "CursorList.h"
+#include "QuotesData.h"
#include "RenderStyle.h"
#include "RenderStyleConstants.h"
#include "ShadowData.h"
@@ -65,6 +66,8 @@ StyleRareInheritedData::StyleRareInheritedData()
, textEmphasisFill(TextEmphasisFillFilled)
, textEmphasisMark(TextEmphasisMarkNone)
, textEmphasisPosition(TextEmphasisPositionOver)
+ , hyphenationLimitBefore(-1)
+ , hyphenationLimitAfter(-1)
{
}
@@ -111,7 +114,9 @@ StyleRareInheritedData::StyleRareInheritedData(const StyleRareInheritedData& o)
, textEmphasisMark(o.textEmphasisMark)
, textEmphasisPosition(o.textEmphasisPosition)
, hyphenationString(o.hyphenationString)
- , hyphenationLocale(o.hyphenationLocale)
+ , hyphenationLimitBefore(o.hyphenationLimitBefore)
+ , hyphenationLimitAfter(o.hyphenationLimitAfter)
+ , locale(o.locale)
, textEmphasisCustomMark(o.textEmphasisCustomMark)
{
}
@@ -169,12 +174,15 @@ bool StyleRareInheritedData::operator==(const StyleRareInheritedData& o) const
&& colorSpace == o.colorSpace
&& speak == o.speak
&& hyphens == o.hyphens
+ && hyphenationLimitBefore == o.hyphenationLimitBefore
+ && hyphenationLimitAfter == o.hyphenationLimitAfter
&& textEmphasisFill == o.textEmphasisFill
&& textEmphasisMark == o.textEmphasisMark
&& textEmphasisPosition == o.textEmphasisPosition
&& hyphenationString == o.hyphenationString
- && hyphenationLocale == o.hyphenationLocale
- && textEmphasisCustomMark == o.textEmphasisCustomMark;
+ && locale == o.locale
+ && textEmphasisCustomMark == o.textEmphasisCustomMark
+ && *quotes == *o.quotes;
}
bool StyleRareInheritedData::shadowDataEquivalent(const StyleRareInheritedData& o) const
diff --git a/Source/WebCore/rendering/style/StyleRareInheritedData.h b/Source/WebCore/rendering/style/StyleRareInheritedData.h
index a370934..d4f233c 100644
--- a/Source/WebCore/rendering/style/StyleRareInheritedData.h
+++ b/Source/WebCore/rendering/style/StyleRareInheritedData.h
@@ -34,6 +34,7 @@
namespace WebCore {
class CursorList;
+class QuotesData;
class ShadowData;
// This struct is for rarely used inherited CSS3, CSS2, and WebKit-specific properties.
@@ -100,9 +101,13 @@ public:
unsigned textEmphasisPosition : 1; // TextEmphasisPosition
AtomicString hyphenationString;
- AtomicString hyphenationLocale;
+ short hyphenationLimitBefore;
+ short hyphenationLimitAfter;
+
+ AtomicString locale;
AtomicString textEmphasisCustomMark;
+ RefPtr<QuotesData> quotes;
private:
StyleRareInheritedData();