Commit 9159df97 authored by weinig's avatar weinig

Reviewed by Darin and then by Mitz.

        Patch for http://bugs.webkit.org/show_bug.cgi?id=12228
        Cleanup assorted CSS classes

        * css/CSSBorderImageValue.cpp:
        (WebCore::CSSBorderImageValue::CSSBorderImageValue):
        (WebCore::CSSBorderImageValue::cssText):
        * css/CSSBorderImageValue.h:
        * css/CSSComputedStyleDeclaration.cpp:
        (WebCore::valueForLength):
        (WebCore::valueForBorderStyle):
        (WebCore::valueForTextAlign):
        (WebCore::valueForShadow):
        (WebCore::getPositionOffsetValue):
        (WebCore::CSSComputedStyleDeclaration::cssText):
        (WebCore::primitiveValueFromLength):
        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
        (WebCore::CSSComputedStyleDeclaration::getPropertyPriority):
        (WebCore::CSSComputedStyleDeclaration::removeProperty):
        (WebCore::CSSComputedStyleDeclaration::setProperty):
        (WebCore::CSSComputedStyleDeclaration::length):
        (WebCore::CSSComputedStyleDeclaration::item):
        * css/CSSComputedStyleDeclaration.h:
        * css/CSSCursorImageValue.cpp:
        (WebCore::CSSCursorImageValue::CSSCursorImageValue):
        * css/CSSCursorImageValue.h:
        * css/CSSGrammar.y:
        * css/CSSImageValue.cpp:
        * css/CSSImageValue.h:
        * css/CSSInheritedValue.cpp:
        * css/CSSInheritedValue.h:
        * css/CSSInitialValue.cpp:
        * css/CSSInitialValue.h:
        * css/CSSMutableStyleDeclaration.cpp:
        (WebCore::CSSMutableStyleDeclaration::CSSMutableStyleDeclaration):
        (WebCore::CSSMutableStyleDeclaration::operator=):
        (WebCore::CSSMutableStyleDeclaration::getPropertyValue):
        (WebCore::CSSMutableStyleDeclaration::get4Values):
        (WebCore::CSSMutableStyleDeclaration::getShorthandValue):
        (WebCore::CSSMutableStyleDeclaration::getPropertyCSSValue):
        (WebCore::CSSMutableStyleDeclaration::removeProperty):
        (WebCore::CSSMutableStyleDeclaration::setChanged):
        (WebCore::CSSMutableStyleDeclaration::getPropertyPriority):
        (WebCore::CSSMutableStyleDeclaration::getPropertyShorthand):
        (WebCore::CSSMutableStyleDeclaration::isPropertyImplicit):
        (WebCore::CSSMutableStyleDeclaration::setProperty):
        (WebCore::CSSMutableStyleDeclaration::setImageProperty):
        (WebCore::CSSMutableStyleDeclaration::parseDeclaration):
        (WebCore::CSSMutableStyleDeclaration::addParsedProperties):
        (WebCore::CSSMutableStyleDeclaration::setLengthProperty):
        (WebCore::CSSMutableStyleDeclaration::cssText):
        (WebCore::CSSMutableStyleDeclaration::merge):
        (WebCore::CSSMutableStyleDeclaration::removePropertiesInSet):
        * css/CSSMutableStyleDeclaration.h:
        (WebCore::CSSMutableStyleDeclaration::setProperty):
        (WebCore::CSSMutableStyleDeclaration::removeProperty):
        * css/CSSNamespace.h:
        (WebCore::CSSNamespace::CSSNamespace):
        * css/CSSPrimitiveValue.cpp:
        (WebCore::isCSSTokenizerIdentifier):
        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
        (WebCore::CSSPrimitiveValue::cleanup):
        (WebCore::CSSPrimitiveValue::computeLengthInt):
        (WebCore::CSSPrimitiveValue::computeLengthIntForLength):
        (WebCore::CSSPrimitiveValue::computeLengthShort):
        (WebCore::CSSPrimitiveValue::computeLengthFloat):
        (WebCore::CSSPrimitiveValue::setFloatValue):
        (WebCore::scaleFactorForConversion):
        (WebCore::CSSPrimitiveValue::getFloatValue):
        (WebCore::CSSPrimitiveValue::setStringValue):
        (WebCore::CSSPrimitiveValue::getStringValue):
        (WebCore::CSSPrimitiveValue::parseString):
        (WebCore::CSSPrimitiveValue::getIdent):
        (WebCore::CSSPrimitiveValue::cssText):
        * css/CSSPrimitiveValue.h:
        (WebCore::CSSPrimitiveValue::getCounterValue):
        (WebCore::CSSPrimitiveValue::getRectValue):
        (WebCore::CSSPrimitiveValue::getRGBColorValue):
        (WebCore::CSSPrimitiveValue::getPairValue):
        (WebCore::CSSPrimitiveValue::getDashboardRegionValue):
        * css/CSSProperty.cpp:
        (WebCore::operator==):
        * css/CSSProperty.h:
        (WebCore::CSSProperty::operator=):
        * css/CSSQuirkPrimitiveValue.h:
        (WebCore::CSSQuirkPrimitiveValue::CSSQuirkPrimitiveValue):
        * css/CSSRuleList.cpp:
        (WebCore::CSSRuleList::CSSRuleList):
        (WebCore::CSSRuleList::deleteRule):
        (WebCore::CSSRuleList::insertRule):
        * css/CSSRuleList.h:
        (WebCore::CSSRuleList::item):
        * css/CSSSelector.cpp:
        (WebCore::CSSSelector::print):
        (WebCore::CSSSelector::specificity):
        (WebCore::CSSSelector::extractPseudoType):
        (WebCore::CSSSelector::operator==):
        (WebCore::CSSSelector::selectorText):
        * css/CSSSelector.h:
        (WebCore::CSSSelector::CSSSelector):
        (WebCore::CSSSelector::~CSSSelector):
        (WebCore::CSSSelector::append):
        (WebCore::CSSSelector::next):
        (WebCore::CSSSelector::pseudoType):
        (WebCore::CSSSelector::hasTag):
        (WebCore::CSSSelector::hasAttribute):
        * css/CSSStyleDeclaration.cpp:
        (WebCore::propertyID):
        (WebCore::CSSStyleDeclaration::getPropertyPriority):
        (WebCore::CSSStyleDeclaration::getPropertyShorthand):
        (WebCore::CSSStyleDeclaration::isPropertyImplicit):
        (WebCore::CSSStyleDeclaration::setProperty):
        (WebCore::CSSStyleDeclaration::isPropertyName):
        (WebCore::CSSStyleDeclaration::parentRule):
        (WebCore::CSSStyleDeclaration::diff):
        (WebCore::CSSStyleDeclaration::copyPropertiesInSet):
        * css/CSSStyleDeclaration.h:
        * css/Counter.h:
        (WebCore::Counter::Counter):
        (WebCore::Counter::listStyleNumber):
        * css/csshelper.cpp:
        (WebCore::parseURL):
        * css/csshelper.h:
        * css/cssparser.h:
        (WebCore::domString):
        (WebCore::atomicString):
        (WebCore::CSSParser::operator|):
        * css/cssstyleselector.cpp:
        (WebCore::CSSStyleSelector::matchRulesForList):
        (WebCore::CSSStyleSelector::checkSelector):
        (WebCore::CSSStyleSelector::checkOneSelector):
        (WebCore::CSSRuleSet::addRule):



git-svn-id: svn://svn.chromium.org/blink/trunk@18850 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 7e1b95cd
2007-01-14 Sam Weinig <sam@webkit.org>
Reviewed by Darin and then by Mitz.
Patch for http://bugs.webkit.org/show_bug.cgi?id=12228
Cleanup assorted CSS classes
* css/CSSBorderImageValue.cpp:
(WebCore::CSSBorderImageValue::CSSBorderImageValue):
(WebCore::CSSBorderImageValue::cssText):
* css/CSSBorderImageValue.h:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::valueForLength):
(WebCore::valueForBorderStyle):
(WebCore::valueForTextAlign):
(WebCore::valueForShadow):
(WebCore::getPositionOffsetValue):
(WebCore::CSSComputedStyleDeclaration::cssText):
(WebCore::primitiveValueFromLength):
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
(WebCore::CSSComputedStyleDeclaration::getPropertyPriority):
(WebCore::CSSComputedStyleDeclaration::removeProperty):
(WebCore::CSSComputedStyleDeclaration::setProperty):
(WebCore::CSSComputedStyleDeclaration::length):
(WebCore::CSSComputedStyleDeclaration::item):
* css/CSSComputedStyleDeclaration.h:
* css/CSSCursorImageValue.cpp:
(WebCore::CSSCursorImageValue::CSSCursorImageValue):
* css/CSSCursorImageValue.h:
* css/CSSGrammar.y:
* css/CSSImageValue.cpp:
* css/CSSImageValue.h:
* css/CSSInheritedValue.cpp:
* css/CSSInheritedValue.h:
* css/CSSInitialValue.cpp:
* css/CSSInitialValue.h:
* css/CSSMutableStyleDeclaration.cpp:
(WebCore::CSSMutableStyleDeclaration::CSSMutableStyleDeclaration):
(WebCore::CSSMutableStyleDeclaration::operator=):
(WebCore::CSSMutableStyleDeclaration::getPropertyValue):
(WebCore::CSSMutableStyleDeclaration::get4Values):
(WebCore::CSSMutableStyleDeclaration::getShorthandValue):
(WebCore::CSSMutableStyleDeclaration::getPropertyCSSValue):
(WebCore::CSSMutableStyleDeclaration::removeProperty):
(WebCore::CSSMutableStyleDeclaration::setChanged):
(WebCore::CSSMutableStyleDeclaration::getPropertyPriority):
(WebCore::CSSMutableStyleDeclaration::getPropertyShorthand):
(WebCore::CSSMutableStyleDeclaration::isPropertyImplicit):
(WebCore::CSSMutableStyleDeclaration::setProperty):
(WebCore::CSSMutableStyleDeclaration::setImageProperty):
(WebCore::CSSMutableStyleDeclaration::parseDeclaration):
(WebCore::CSSMutableStyleDeclaration::addParsedProperties):
(WebCore::CSSMutableStyleDeclaration::setLengthProperty):
(WebCore::CSSMutableStyleDeclaration::cssText):
(WebCore::CSSMutableStyleDeclaration::merge):
(WebCore::CSSMutableStyleDeclaration::removePropertiesInSet):
* css/CSSMutableStyleDeclaration.h:
(WebCore::CSSMutableStyleDeclaration::setProperty):
(WebCore::CSSMutableStyleDeclaration::removeProperty):
* css/CSSNamespace.h:
(WebCore::CSSNamespace::CSSNamespace):
* css/CSSPrimitiveValue.cpp:
(WebCore::isCSSTokenizerIdentifier):
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::cleanup):
(WebCore::CSSPrimitiveValue::computeLengthInt):
(WebCore::CSSPrimitiveValue::computeLengthIntForLength):
(WebCore::CSSPrimitiveValue::computeLengthShort):
(WebCore::CSSPrimitiveValue::computeLengthFloat):
(WebCore::CSSPrimitiveValue::setFloatValue):
(WebCore::scaleFactorForConversion):
(WebCore::CSSPrimitiveValue::getFloatValue):
(WebCore::CSSPrimitiveValue::setStringValue):
(WebCore::CSSPrimitiveValue::getStringValue):
(WebCore::CSSPrimitiveValue::parseString):
(WebCore::CSSPrimitiveValue::getIdent):
(WebCore::CSSPrimitiveValue::cssText):
* css/CSSPrimitiveValue.h:
(WebCore::CSSPrimitiveValue::getCounterValue):
(WebCore::CSSPrimitiveValue::getRectValue):
(WebCore::CSSPrimitiveValue::getRGBColorValue):
(WebCore::CSSPrimitiveValue::getPairValue):
(WebCore::CSSPrimitiveValue::getDashboardRegionValue):
* css/CSSProperty.cpp:
(WebCore::operator==):
* css/CSSProperty.h:
(WebCore::CSSProperty::operator=):
* css/CSSQuirkPrimitiveValue.h:
(WebCore::CSSQuirkPrimitiveValue::CSSQuirkPrimitiveValue):
* css/CSSRuleList.cpp:
(WebCore::CSSRuleList::CSSRuleList):
(WebCore::CSSRuleList::deleteRule):
(WebCore::CSSRuleList::insertRule):
* css/CSSRuleList.h:
(WebCore::CSSRuleList::item):
* css/CSSSelector.cpp:
(WebCore::CSSSelector::print):
(WebCore::CSSSelector::specificity):
(WebCore::CSSSelector::extractPseudoType):
(WebCore::CSSSelector::operator==):
(WebCore::CSSSelector::selectorText):
* css/CSSSelector.h:
(WebCore::CSSSelector::CSSSelector):
(WebCore::CSSSelector::~CSSSelector):
(WebCore::CSSSelector::append):
(WebCore::CSSSelector::next):
(WebCore::CSSSelector::pseudoType):
(WebCore::CSSSelector::hasTag):
(WebCore::CSSSelector::hasAttribute):
* css/CSSStyleDeclaration.cpp:
(WebCore::propertyID):
(WebCore::CSSStyleDeclaration::getPropertyPriority):
(WebCore::CSSStyleDeclaration::getPropertyShorthand):
(WebCore::CSSStyleDeclaration::isPropertyImplicit):
(WebCore::CSSStyleDeclaration::setProperty):
(WebCore::CSSStyleDeclaration::isPropertyName):
(WebCore::CSSStyleDeclaration::parentRule):
(WebCore::CSSStyleDeclaration::diff):
(WebCore::CSSStyleDeclaration::copyPropertiesInSet):
* css/CSSStyleDeclaration.h:
* css/Counter.h:
(WebCore::Counter::Counter):
(WebCore::Counter::listStyleNumber):
* css/csshelper.cpp:
(WebCore::parseURL):
* css/csshelper.h:
* css/cssparser.h:
(WebCore::domString):
(WebCore::atomicString):
(WebCore::CSSParser::operator|):
* css/cssstyleselector.cpp:
(WebCore::CSSStyleSelector::matchRulesForList):
(WebCore::CSSStyleSelector::checkSelector):
(WebCore::CSSStyleSelector::checkOneSelector):
(WebCore::CSSRuleSet::addRule):
2007-01-14 Mitz Pettel <mitz@webkit.org> 2007-01-14 Mitz Pettel <mitz@webkit.org>
Reviewed by Adam. Reviewed by Adam.
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330, * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA. * Boston, MA 02111-1307, USA.
*/ */
#include "config.h" #include "config.h"
#include "CSSBorderImageValue.h" #include "CSSBorderImageValue.h"
...@@ -28,8 +29,7 @@ ...@@ -28,8 +29,7 @@
namespace WebCore { namespace WebCore {
CSSBorderImageValue::CSSBorderImageValue(PassRefPtr<CSSImageValue> image, CSSBorderImageValue::CSSBorderImageValue(PassRefPtr<CSSImageValue> image, PassRefPtr<RectImpl> imageRect, int horizontalRule, int verticalRule)
PassRefPtr<RectImpl> imageRect, int horizontalRule, int verticalRule)
: m_image(image) : m_image(image)
, m_imageSliceRect(imageRect) , m_imageSliceRect(imageRect)
, m_horizontalSizeRule(horizontalRule) , m_horizontalSizeRule(horizontalRule)
...@@ -42,7 +42,7 @@ String CSSBorderImageValue::cssText() const ...@@ -42,7 +42,7 @@ String CSSBorderImageValue::cssText() const
// Image first. // Image first.
String text(m_image->cssText()); String text(m_image->cssText());
text += " "; text += " ";
// Now the rect, but it isn't really a rect, so we dump manually // Now the rect, but it isn't really a rect, so we dump manually
text += m_imageSliceRect->top()->cssText(); text += m_imageSliceRect->top()->cssText();
text += " "; text += " ";
...@@ -51,7 +51,7 @@ String CSSBorderImageValue::cssText() const ...@@ -51,7 +51,7 @@ String CSSBorderImageValue::cssText() const
text += m_imageSliceRect->bottom()->cssText(); text += m_imageSliceRect->bottom()->cssText();
text += " "; text += " ";
text += m_imageSliceRect->left()->cssText(); text += m_imageSliceRect->left()->cssText();
// Now the keywords. // Now the keywords.
text += " "; text += " ";
text += CSSPrimitiveValue(m_horizontalSizeRule).cssText(); text += CSSPrimitiveValue(m_horizontalSizeRule).cssText();
...@@ -61,4 +61,4 @@ String CSSBorderImageValue::cssText() const ...@@ -61,4 +61,4 @@ String CSSBorderImageValue::cssText() const
return text; return text;
} }
} } // namespace WebCore
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
* Boston, MA 02111-1307, USA. * Boston, MA 02111-1307, USA.
*/ */
#ifndef CSSBorderImageValue_H #ifndef CSSBorderImageValue_h
#define CSSBorderImageValue_H #define CSSBorderImageValue_h
#include "CSSValue.h" #include "CSSValue.h"
#include <wtf/PassRefPtr.h> #include <wtf/PassRefPtr.h>
...@@ -32,8 +32,7 @@ namespace WebCore { ...@@ -32,8 +32,7 @@ namespace WebCore {
class CSSImageValue; class CSSImageValue;
class RectImpl; class RectImpl;
class CSSBorderImageValue : public CSSValue class CSSBorderImageValue : public CSSValue {
{
public: public:
CSSBorderImageValue(); CSSBorderImageValue();
CSSBorderImageValue(PassRefPtr<CSSImageValue>, PassRefPtr<RectImpl>, int horizontalRule, int verticalRule); CSSBorderImageValue(PassRefPtr<CSSImageValue>, PassRefPtr<RectImpl>, int horizontalRule, int verticalRule);
...@@ -47,12 +46,12 @@ public: ...@@ -47,12 +46,12 @@ public:
// These four values are used to make "cuts" in the image. They can be numbers // These four values are used to make "cuts" in the image. They can be numbers
// or percentages. // or percentages.
RefPtr<RectImpl> m_imageSliceRect; RefPtr<RectImpl> m_imageSliceRect;
// Values for how to handle the scaling/stretching/tiling of the image slices. // Values for how to handle the scaling/stretching/tiling of the image slices.
int m_horizontalSizeRule; // Rule for how to adjust the widths of the top/middle/bottom int m_horizontalSizeRule; // Rule for how to adjust the widths of the top/middle/bottom
int m_verticalSizeRule; // Rule for how to adjust the heights of the left/middle/right int m_verticalSizeRule; // Rule for how to adjust the heights of the left/middle/right
}; };
} // namespace } // namespace WebCore
#endif #endif // CSSBorderImageValue_h
/** /**
* CSSComputedStyleDeclaration.h
* *
* Copyright (C) 2004 Zack Rusin <zack@kde.org> * Copyright (C) 2004 Zack Rusin <zack@kde.org>
* Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.
...@@ -20,8 +19,8 @@ ...@@ -20,8 +19,8 @@
* 02111-1307 USA * 02111-1307 USA
*/ */
#ifndef CSS_COMPUTEDSTYLE_H #ifndef CSSComputedStyleDeclaration_h
#define CSS_COMPUTEDSTYLE_H #define CSSComputedStyleDeclaration_h
#include "CSSStyleDeclaration.h" #include "CSSStyleDeclaration.h"
#include "Node.h" #include "Node.h"
...@@ -62,12 +61,13 @@ public: ...@@ -62,12 +61,13 @@ public:
private: private:
virtual void setCssText(const String&, ExceptionCode&); virtual void setCssText(const String&, ExceptionCode&);
virtual String removeProperty(int propertyID, ExceptionCode&); virtual String removeProperty(int propertyID, ExceptionCode&);
virtual void setProperty(int propertyId, const String& value, bool important, ExceptionCode&); virtual void setProperty(int propertyId, const String& value, bool important, ExceptionCode&);
RefPtr<Node> m_node; RefPtr<Node> m_node;
}; };
} } // namespace WebCore
#endif #endif // CSSComputedStyleDeclaration_h
...@@ -18,18 +18,20 @@ ...@@ -18,18 +18,20 @@
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330, * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA. * Boston, MA 02111-1307, USA.
*/ */
#include "config.h" #include "config.h"
#include "CSSCursorImageValue.h" #include "CSSCursorImageValue.h"
namespace WebCore { namespace WebCore {
CSSCursorImageValue::CSSCursorImageValue(const String& url, const IntPoint& p, StyleBase* style) CSSCursorImageValue::CSSCursorImageValue(const String& url, const IntPoint& hotspot, StyleBase* style)
: CSSImageValue(url, style) : CSSImageValue(url, style)
, m_hotspot(p) , m_hotspot(hotspot)
{ {
} }
CSSCursorImageValue::~CSSCursorImageValue() CSSCursorImageValue::~CSSCursorImageValue()
{ {
} }
}
} // namespace WebCore
...@@ -19,18 +19,17 @@ ...@@ -19,18 +19,17 @@
* Boston, MA 02111-1307, USA. * Boston, MA 02111-1307, USA.
*/ */
#ifndef CSSCursorImageValue_H #ifndef CSSCursorImageValue_h
#define CSSCursorImageValue_H #define CSSCursorImageValue_h
#include "IntPoint.h"
#include "CSSImageValue.h" #include "CSSImageValue.h"
#include "IntPoint.h"
namespace WebCore { namespace WebCore {
class CSSCursorImageValue : public CSSImageValue class CSSCursorImageValue : public CSSImageValue {
{
public: public:
CSSCursorImageValue(const String& url, const IntPoint&, StyleBase*); CSSCursorImageValue(const String& url, const IntPoint& hotspot, StyleBase*);
virtual ~CSSCursorImageValue(); virtual ~CSSCursorImageValue();
IntPoint hotspot() const { return m_hotspot; } IntPoint hotspot() const { return m_hotspot; }
...@@ -38,6 +37,7 @@ public: ...@@ -38,6 +37,7 @@ public:
protected: protected:
IntPoint m_hotspot; IntPoint m_hotspot;
}; };
} // namespace
#endif } // namespace WebCore
#endif // CSSCursorImageValue_h
This diff is collapsed.
...@@ -19,12 +19,13 @@ ...@@ -19,12 +19,13 @@
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330, * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA. * Boston, MA 02111-1307, USA.
*/ */
#include "config.h" #include "config.h"
#include "CSSImageValue.h" #include "CSSImageValue.h"
#include "CSSValueKeywords.h"
#include "Cache.h" #include "Cache.h"
#include "CachedImage.h" #include "CachedImage.h"
#include "CSSValueKeywords.h"
#include "DocLoader.h" #include "DocLoader.h"
namespace WebCore { namespace WebCore {
...@@ -67,4 +68,4 @@ CachedImage* CSSImageValue::image(DocLoader* loader) ...@@ -67,4 +68,4 @@ CachedImage* CSSImageValue::image(DocLoader* loader)
return m_image; return m_image;
} }
} } // namespace WebCore
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
* Boston, MA 02111-1307, USA. * Boston, MA 02111-1307, USA.
*/ */
#ifndef CSSImageValue_H #ifndef CSSImageValue_h
#define CSSImageValue_H #define CSSImageValue_h
#include "CSSPrimitiveValue.h" #include "CSSPrimitiveValue.h"
#include "CachedResourceClient.h" #include "CachedResourceClient.h"
...@@ -30,8 +30,7 @@ namespace WebCore { ...@@ -30,8 +30,7 @@ namespace WebCore {
class DocLoader; class DocLoader;
class CSSImageValue : public CSSPrimitiveValue, public CachedResourceClient class CSSImageValue : public CSSPrimitiveValue, public CachedResourceClient {
{
public: public:
CSSImageValue(); CSSImageValue();
CSSImageValue(const String& url, StyleBase*); CSSImageValue(const String& url, StyleBase*);
...@@ -44,6 +43,6 @@ protected: ...@@ -44,6 +43,6 @@ protected:
bool m_accessedImage; bool m_accessedImage;
}; };
} // namespace } // namespace WebCore
#endif #endif // CSSImageValue_h
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330, * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA. * Boston, MA 02111-1307, USA.
*/ */
#include "config.h" #include "config.h"
#include "CSSInheritedValue.h" #include "CSSInheritedValue.h"
...@@ -36,4 +37,4 @@ String CSSInheritedValue::cssText() const ...@@ -36,4 +37,4 @@ String CSSInheritedValue::cssText() const
return "inherit"; return "inherit";
} }
} } // namespace WebCore
...@@ -20,20 +20,19 @@ ...@@ -20,20 +20,19 @@
* Boston, MA 02111-1307, USA. * Boston, MA 02111-1307, USA.
*/ */
#ifndef CSSInheritedValue_H #ifndef CSSInheritedValue_h
#define CSSInheritedValue_H #define CSSInheritedValue_h
#include "CSSValue.h" #include "CSSValue.h"
namespace WebCore { namespace WebCore {
class CSSInheritedValue : public CSSValue class CSSInheritedValue : public CSSValue {
{
public: public:
virtual unsigned short cssValueType() const; virtual unsigned short cssValueType() const;
virtual String cssText() const; virtual String cssText() const;
}; };
} // namespace } // namespace WebCore
#endif #endif // CSSInheritedValue_h
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330, * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA. * Boston, MA 02111-1307, USA.
*/ */
#include "config.h" #include "config.h"
#include "CSSInitialValue.h" #include "CSSInitialValue.h"
...@@ -36,4 +37,4 @@ String CSSInitialValue::cssText() const ...@@ -36,4 +37,4 @@ String CSSInitialValue::cssText() const
return "initial"; return "initial";
} }
} } // namespace WebCore
...@@ -20,20 +20,19 @@ ...@@ -20,20 +20,19 @@
* Boston, MA 02111-1307, USA. * Boston, MA 02111-1307, USA.
*/ */
#ifndef CSSInitialValue_H #ifndef CSSInitialValue_h
#define CSSInitialValue_H #define CSSInitialValue_h
#include "CSSValue.h" #include "CSSValue.h"
namespace WebCore { namespace WebCore {
class CSSInitialValue : public CSSValue class CSSInitialValue : public CSSValue {
{
public: public:
virtual unsigned short cssValueType() const; virtual unsigned short cssValueType() const;
virtual String cssText() const; virtual String cssText() const;
}; };
} // namespace } // namespace WebCore
#endif #endif // CSSInitialValue_h
...@@ -20,11 +20,11 @@ ...@@ -20,11 +20,11 @@
* Boston, MA 02111-1307, USA. * Boston, MA 02111-1307, USA.
*/ */
#ifndef CSSMutableStyleDeclaration_H #ifndef CSSMutableStyleDeclaration_h
#define CSSMutableStyleDeclaration_H #define CSSMutableStyleDeclaration_h
#include "CSSStyleDeclaration.h" #include "CSSStyleDeclaration.h"
#include "CSSPrimitiveValue.h" // for CSSPrimitiveValue::UnitTypes #include "CSSPrimitiveValue.h"
#include "DeprecatedValueList.h" #include "DeprecatedValueList.h"
#include "PlatformString.h" #include "PlatformString.h"
...@@ -33,15 +33,14 @@ namespace WebCore { ...@@ -33,15 +33,14 @@ namespace WebCore {
class CSSProperty; class CSSProperty;
class Node; class Node;
class CSSMutableStyleDeclaration : public CSSStyleDeclaration class CSSMutableStyleDeclaration : public CSSStyleDeclaration {
{
public: public:
CSSMutableStyleDeclaration(); CSSMutableStyleDeclaration();
CSSMutableStyleDeclaration(CSSRule* parentRule); CSSMutableStyleDeclaration(CSSRule* parentRule);
CSSMutableStyleDeclaration(CSSRule* parentRule, const DeprecatedValueList<CSSProperty>&); CSSMutableStyleDeclaration(CSSRule* parentRule, const DeprecatedValueList<CSSProperty>&);
CSSMutableStyleDeclaration(CSSRule* parentRule, const CSSProperty * const *, int numProperties); CSSMutableStyleDeclaration(CSSRule* parentRule, const CSSProperty* const *, int numProperties);
CSSMutableStyleDeclaration &operator=(const CSSMutableStyleDeclaration &); CSSMutableStyleDeclaration& operator=(const CSSMutableStyleDeclaration&);
void setNode(Node* node) { m_node = node; } void setNode(Node* node) { m_node = node; }
...@@ -68,11 +67,17 @@ public: ...@@ -68,11 +67,17 @@ public:
bool setProperty(int propertyID, int value, bool important = false, bool notifyChanged = true); bool setProperty(int propertyID, int value, bool important = false, bool notifyChanged = true);
bool setProperty(int propertyID, const String& value, bool important, bool notifyChanged, ExceptionCode&); bool setProperty(int propertyID, const String& value, bool important, bool notifyChanged, ExceptionCode&);
bool setProperty(int propertyId, const String& value, bool important = false, bool notifyChanged = true) bool setProperty(int propertyId, const String& value, bool important = false, bool notifyChanged = true)
{ ExceptionCode ec; return setProperty(propertyId, value, important, notifyChanged, ec); } {
ExceptionCode ec;
return setProperty(propertyId, value, important, notifyChanged, ec);
}
String removeProperty(int propertyID, bool notifyChanged, ExceptionCode&); String removeProperty(int propertyID, bool notifyChanged, ExceptionCode&);
String removeProperty(int propertyID, bool notifyChanged = true) String removeProperty(int propertyID, bool notifyChanged = true)
{ ExceptionCode ec; return removeProperty(propertyID, notifyChanged, ec); } {
ExceptionCode ec;
return removeProperty(propertyID, notifyChanged, ec);
}
void clear(); void clear();
...@@ -81,29 +86,29 @@ public: ...@@ -81,29 +86,29 @@ public:
// setLengthProperty treats integers as pixels! (Needed for conversion of HTML attributes.) // setLengthProperty treats integers as pixels! (Needed for conversion of HTML attributes.)
void setLengthProperty(int propertyId, const String& value, bool important, bool multiLength = false); void setLengthProperty(int propertyId, const String& value, bool important, bool multiLength = false);
void setStringProperty(int propertyId, const String& value, CSSPrimitiveValue::UnitTypes, bool important = false); // parsed string value void setStringProperty(int propertyId, const String& value, CSSPrimitiveValue::UnitTypes, bool important = false); // parsed string value
void setImageProperty(int propertyId, const String& URL, bool important = false); void setImageProperty(int propertyId, const String& url, bool important = false);
// The following parses an entire new style declaration. // The following parses an entire new style declaration.
void parseDeclaration(const String& styleDeclaration); void parseDeclaration(const String& styleDeclaration);
// Besides adding the properties, this also removes any existing properties with these IDs. // Besides adding the properties, this also removes any existing properties with these IDs.
// It does no notification since it's called by the parser. // It does no notification since it's called by the parser.
void addParsedProperties(const CSSProperty * const *, int numProperties); void addParsedProperties(const CSSProperty* const *, int numProperties);
PassRefPtr<CSSMutableStyleDeclaration> copyBlockProperties() const; PassRefPtr<CSSMutableStyleDeclaration> copyBlockProperties() const;
void removeBlockProperties(); void removeBlockProperties();
void removePropertiesInSet(const int* set, unsigned length, bool notifyChanged = true); void removePropertiesInSet(const int* set, unsigned length, bool notifyChanged = true);
void merge(CSSMutableStyleDeclaration*, bool argOverridesOnConflict = true); void merge(CSSMutableStyleDeclaration*, bool argOverridesOnConflict = true);
private: private:
String getShortHandValue(const int* properties, int number) const; String getShorthandValue(const int* properties, int number) const;
String get4Values(const int* properties) const; String get4Values(const int* properties) const;
DeprecatedValueList<CSSProperty> m_values; DeprecatedValueList<CSSProperty> m_values;
Node* m_node; Node* m_node;
}; };
} // namespace } // namespace WebCore
#endif #endif // CSSMutableStyleDeclaration_h
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
* Boston, MA 02111-1307, USA. * Boston, MA 02111-1307, USA.
*/ */
#ifndef CSSNamespace_H #ifndef CSSNamespace_h
#define CSSNamespace_H #define CSSNamespace_h
#include "AtomicString.h" #include "AtomicString.h"
...@@ -33,15 +33,17 @@ namespace WebCore { ...@@ -33,15 +33,17 @@ namespace WebCore {
AtomicString m_uri; AtomicString m_uri;
CSSNamespace* m_parent; CSSNamespace* m_parent;
CSSNamespace(const AtomicString& p, const AtomicString& u, CSSNamespace* parent) CSSNamespace(const AtomicString& prefix, const AtomicString& uri, CSSNamespace* parent)
: m_prefix(p) : m_prefix(prefix)
, m_uri(u) , m_uri(uri)
, m_parent(parent) {} , m_parent(parent)
{
}
~CSSNamespace() { delete m_parent; } ~CSSNamespace() { delete m_parent; }
const AtomicString& uri() { return m_uri; } const AtomicString& uri() { return m_uri; }
const AtomicString& prefix() { return m_prefix; } const AtomicString& prefix() { return m_prefix; }
CSSNamespace* namespaceForPrefix(const AtomicString& prefix) CSSNamespace* namespaceForPrefix(const AtomicString& prefix)
{ {
if (prefix == m_prefix) if (prefix == m_prefix)
...@@ -51,6 +53,7 @@ namespace WebCore { ...@@ -51,6 +53,7 @@ namespace WebCore {
return 0; return 0;
} }
}; };
}
#endif } // namespace WebCore
#endif // CSSNamespace_h
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
* Boston, MA 02111-1307, USA. * Boston, MA 02111-1307, USA.
*/ */
#ifndef CSSPrimitiveValue_H #ifndef CSSPrimitiveValue_h
#define CSSPrimitiveValue_H #define CSSPrimitiveValue_h
#include "CSSValue.h" #include "CSSValue.h"
#include <wtf/PassRefPtr.h> #include <wtf/PassRefPtr.h>
...@@ -37,8 +37,7 @@ class StringImpl; ...@@ -37,8 +37,7 @@ class StringImpl;
typedef int ExceptionCode; typedef int ExceptionCode;
class CSSPrimitiveValue : public CSSValue class CSSPrimitiveValue : public CSSValue {
{
public: public:
enum UnitTypes { enum UnitTypes {
CSS_UNKNOWN = 0, CSS_UNKNOWN = 0,
...@@ -117,30 +116,18 @@ public: ...@@ -117,30 +116,18 @@ public:
void setStringValue(unsigned short stringType, const String& stringValue, ExceptionCode&); void setStringValue(unsigned short stringType, const String& stringValue, ExceptionCode&);
String getStringValue() const; String getStringValue() const;
Counter* getCounterValue () const {
return m_type != CSS_COUNTER ? 0 : m_value.counter;
}
RectImpl* getRectValue () const { Counter* getCounterValue () const { return m_type != CSS_COUNTER ? 0 : m_value.counter; }
return m_type != CSS_RECT ? 0 : m_value.rect; RectImpl* getRectValue () const { return m_type != CSS_RECT ? 0 : m_value.rect; }
} unsigned getRGBColorValue() const { return m_type != CSS_RGBCOLOR ? 0 : m_value.rgbcolor; }
Pair* getPairValue() const { return m_type != CSS_PAIR ? 0 : m_value.pair; }
unsigned getRGBColorValue() const {
return m_type != CSS_RGBCOLOR ? 0 : m_value.rgbcolor;
}
Pair* getPairValue() const {
return m_type != CSS_PAIR ? 0 : m_value.pair;
}
#if PLATFORM(MAC) #if PLATFORM(MAC)
DashboardRegion *getDashboardRegionValue () const { DashboardRegion* getDashboardRegionValue () const { return m_type != CSS_DASHBOARD_REGION ? 0 : m_value.region; }
return m_type != CSS_DASHBOARD_REGION ? 0 : m_value.region;
}
#endif #endif
virtual bool isPrimitiveValue() const { return true; } virtual bool isPrimitiveValue() const { return true; }
virtual unsigned short cssValueType() const; virtual unsigned short cssValueType() const;
int getIdent(); int getIdent();
...@@ -166,6 +153,6 @@ protected: ...@@ -166,6 +153,6 @@ protected:
} m_value; } m_value;
}; };
} // namespace } // namespace WebCore
#endif #endif // CSSPrimitiveValue_h
...@@ -19,8 +19,10 @@ ...@@ -19,8 +19,10 @@
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330, * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA. * Boston, MA 02111-1307, USA.
*/ */
#include "config.h" #include "config.h"
#include "CSSProperty.h" #include "CSSProperty.h"
#include "PlatformString.h" #include "PlatformString.h"
// Not in any header, so just declare it here for now. // Not in any header, so just declare it here for now.
...@@ -33,9 +35,9 @@ String CSSProperty::cssText() const ...@@ -33,9 +35,9 @@ String CSSProperty::cssText() const
return getPropertyName(id()) + ": " + m_value->cssText() + (isImportant() ? " !important" : "") + "; "; return getPropertyName(id()) + ": " + m_value->cssText() + (isImportant() ? " !important" : "") + "; ";
} }
bool operator==(const CSSProperty &a, const CSSProperty &b) bool operator==(const CSSProperty& a, const CSSProperty& b)
{ {
return a.m_id == b.m_id && a.m_important == b.m_important && a.m_value == b.m_value; return a.m_id == b.m_id && a.m_important == b.m_important && a.m_value == b.m_value;
} }
} } // namespace WebCore
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
* Boston, MA 02111-1307, USA. * Boston, MA 02111-1307, USA.
*/ */
#ifndef CSSProperty_H #ifndef CSSProperty_h
#define CSSProperty_H #define CSSProperty_h
#include "CSSValue.h" #include "CSSValue.h"
#include <wtf/PassRefPtr.h> #include <wtf/PassRefPtr.h>
...@@ -39,19 +39,19 @@ public: ...@@ -39,19 +39,19 @@ public:
, m_value(value) , m_value(value)
{ {
} }
CSSProperty &operator=(const CSSProperty& o) CSSProperty& operator=(const CSSProperty& other)
{ {
m_id = o.m_id; m_id = other.m_id;
m_shorthandID = o.m_shorthandID; m_shorthandID = other.m_shorthandID;
m_important = o.m_important; m_important = other.m_important;
m_value = o.m_value; m_value = other.m_value;
return *this; return *this;
} }
int id() const { return m_id; } int id() const { return m_id; }
int shorthandID() const { return m_shorthandID; } int shorthandID() const { return m_shorthandID; }
bool isImportant() const { return m_important; } bool isImportant() const { return m_important; }
bool isImplicit() const { return m_implicit; } bool isImplicit() const { return m_implicit; }
...@@ -59,17 +59,17 @@ public: ...@@ -59,17 +59,17 @@ public:
String cssText() const; String cssText() const;
friend bool operator==(const CSSProperty&, const CSSProperty&);
// make sure the following fits in 4 bytes. // make sure the following fits in 4 bytes.
int m_id; int m_id;
int m_shorthandID; // If this property was set as part of a shorthand, gives the shorthand. int m_shorthandID; // If this property was set as part of a shorthand, gives the shorthand.
bool m_important : 1; bool m_important : 1;
bool m_implicit : 1; // Whether or not the property was set implicitly as the result of a shorthand. bool m_implicit : 1; // Whether or not the property was set implicitly as the result of a shorthand.
friend bool operator==(const CSSProperty &, const CSSProperty &);
RefPtr<CSSValue> m_value; RefPtr<CSSValue> m_value;
}; };
} // namespace } // namespace WebCore
#endif #endif // CSSProperty_h
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
* Boston, MA 02111-1307, USA. * Boston, MA 02111-1307, USA.
*/ */
#ifndef CSSQuirkPrimitiveValue_H #ifndef CSSQuirkPrimitiveValue_h
#define CSSQuirkPrimitiveValue_H #define CSSQuirkPrimitiveValue_h
#include "CSSPrimitiveValue.h" #include "CSSPrimitiveValue.h"
...@@ -31,15 +31,16 @@ namespace WebCore { ...@@ -31,15 +31,16 @@ namespace WebCore {
// The basic idea is that a stylesheet can use the value __qem (for quirky em) instead of em // The basic idea is that a stylesheet can use the value __qem (for quirky em) instead of em
// in a stylesheet. When the quirky value is used, if you're in quirks mode, the margin will // in a stylesheet. When the quirky value is used, if you're in quirks mode, the margin will
// collapse away inside a table cell. // collapse away inside a table cell.
class CSSQuirkPrimitiveValue : public CSSPrimitiveValue class CSSQuirkPrimitiveValue : public CSSPrimitiveValue {
{
public: public:
CSSQuirkPrimitiveValue(double num, UnitTypes type) CSSQuirkPrimitiveValue(double num, UnitTypes type)
: CSSPrimitiveValue(num, type) {} : CSSPrimitiveValue(num, type)
{
}
virtual bool isQuirkValue() { return true; } virtual bool isQuirkValue() { return true; }
}; };
} // namespace } // namespace WebCore
#endif #endif // CSSQuirkPrimitiveValue_h
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330, * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA. * Boston, MA 02111-1307, USA.
*/ */
#include "config.h" #include "config.h"
#include "CSSRuleList.h" #include "CSSRuleList.h"
...@@ -32,12 +33,12 @@ CSSRuleList::CSSRuleList() ...@@ -32,12 +33,12 @@ CSSRuleList::CSSRuleList()
{ {
} }
CSSRuleList::CSSRuleList(StyleList* lst, bool omitCharsetRules) CSSRuleList::CSSRuleList(StyleList* list, bool omitCharsetRules)
{ {
if (lst) { if (list) {
unsigned len = lst->length(); unsigned len = list->length();
for (unsigned i = 0; i < len; ++i) { for (unsigned i = 0; i < len; ++i) {
StyleBase* style = lst->item(i); StyleBase* style = list->item(i);
if (style->isRule() && !(omitCharsetRules && style->isCharsetRule())) if (style->isRule() && !(omitCharsetRules && style->isCharsetRule()))
append(static_cast<CSSRule*>(style)); append(static_cast<CSSRule*>(style));
} }
...@@ -57,7 +58,7 @@ void CSSRuleList::deleteRule(unsigned index) ...@@ -57,7 +58,7 @@ void CSSRuleList::deleteRule(unsigned index)
if (rule) if (rule)
rule->deref(); rule->deref();
else else
; // ### Throw INDEX_SIZE_ERR exception here (TODO) ; // FIXME: Throw INDEX_SIZE_ERR exception here
} }
void CSSRuleList::append(CSSRule* rule) void CSSRuleList::append(CSSRule* rule)
...@@ -72,8 +73,8 @@ unsigned CSSRuleList::insertRule(CSSRule* rule, unsigned index) ...@@ -72,8 +73,8 @@ unsigned CSSRuleList::insertRule(CSSRule* rule, unsigned index)
return index; return index;
} }
// ### Should throw INDEX_SIZE_ERR exception instead! (TODO) // FIXME: Should throw INDEX_SIZE_ERR exception instead!
return 0; return 0;
} }
} } // namespace WebCore
...@@ -21,36 +21,35 @@ ...@@ -21,36 +21,35 @@
* Boston, MA 02111-1307, USA. * Boston, MA 02111-1307, USA.
*/ */
#ifndef CSSRuleList_H #ifndef CSSRuleList_h
#define CSSRuleList_H #define CSSRuleList_h
#include "Shared.h"
#include "DeprecatedPtrList.h" #include "DeprecatedPtrList.h"
#include "Shared.h"
namespace WebCore { namespace WebCore {
class CSSRule; class CSSRule;
class StyleList; class StyleList;
class CSSRuleList : public Shared<CSSRuleList> class CSSRuleList : public Shared<CSSRuleList> {
{
public: public:
CSSRuleList(); CSSRuleList();
CSSRuleList(StyleList*, bool omitCharsetRules = false); CSSRuleList(StyleList*, bool omitCharsetRules = false);
~CSSRuleList(); ~CSSRuleList();
unsigned length() const { return m_lstCSSRules.count(); } unsigned length() const { return m_lstCSSRules.count(); }
CSSRule* item (unsigned index) { return m_lstCSSRules.at(index); } CSSRule* item(unsigned index) { return m_lstCSSRules.at(index); }
/* not part of the DOM */ /* not part of the DOM */
unsigned insertRule (CSSRule* rule, unsigned index); unsigned insertRule(CSSRule*, unsigned index);
void deleteRule (unsigned index); void deleteRule(unsigned index);
void append(CSSRule* rule); void append(CSSRule*);
protected: protected:
DeprecatedPtrList<CSSRule> m_lstCSSRules; DeprecatedPtrList<CSSRule> m_lstCSSRules;
}; };
} // namespace } // namespace WebCore
#endif #endif // CSSRuleList_h
...@@ -21,56 +21,58 @@ ...@@ -21,56 +21,58 @@
* Boston, MA 02111-1307, USA. * Boston, MA 02111-1307, USA.
*/ */
#ifndef CSSSelector_H #ifndef CSSSelector_h
#define CSSSelector_H #define CSSSelector_h
#include "QualifiedName.h" #include "QualifiedName.h"
namespace WebCore { namespace WebCore {
// this class represents a selector for a StyleRule // this class represents a selector for a StyleRule
class CSSSelector class CSSSelector {
{
public: public:
CSSSelector() CSSSelector()
: tagHistory(0) : m_tagHistory(0)
, simpleSelector(0) , m_simpleSelector(0)
, nextSelector(0) , m_nextSelector(0)
, argument(nullAtom) , m_argument(nullAtom)
, attr(anyQName()) , m_attr(anyQName())
, tag(anyQName()) , m_tag(anyQName())
, m_relation(Descendant) , m_relation(Descendant)
, match(None) , m_match(None)
, pseudoId(0) , m_pseudoType(PseudoNotParsed)
, _pseudoType(PseudoNotParsed) {
{} }
CSSSelector(const QualifiedName& qName) CSSSelector(const QualifiedName& qName)
: tagHistory(0) : m_tagHistory(0)
, simpleSelector(0) , m_simpleSelector(0)
, nextSelector(0) , m_nextSelector(0)
, argument(nullAtom) , m_argument(nullAtom)
, attr(anyQName()) , m_attr(anyQName())
, tag(qName) , m_tag(qName)
, m_relation(Descendant) , m_relation(Descendant)
, match(None) , m_match(None)
, pseudoId(0) , m_pseudoType(PseudoNotParsed)
, _pseudoType(PseudoNotParsed) {
{} }
~CSSSelector() { ~CSSSelector()
delete tagHistory; {
delete simpleSelector; delete m_tagHistory;
delete nextSelector; delete m_simpleSelector;
delete m_nextSelector;
} }
void append(CSSSelector* n) { void append(CSSSelector* n)
{
CSSSelector* end = this; CSSSelector* end = this;
while (end->nextSelector) while (end->m_nextSelector)
end = end->nextSelector; end = end->m_nextSelector;
end->nextSelector = n; end->m_nextSelector = n;
} }
CSSSelector* next() { return nextSelector; }
CSSSelector* next() { return m_nextSelector; }
/** /**
* Print debug output for this selector * Print debug output for this selector
...@@ -83,7 +85,7 @@ namespace WebCore { ...@@ -83,7 +85,7 @@ namespace WebCore {
String selectorText() const; String selectorText() const;
// checks if the 2 selectors (including sub selectors) agree. // checks if the 2 selectors (including sub selectors) agree.
bool operator ==(const CSSSelector&); bool operator==(const CSSSelector&);
// tag == -1 means apply to all elements (Selector = *) // tag == -1 means apply to all elements (Selector = *)
...@@ -154,33 +156,33 @@ namespace WebCore { ...@@ -154,33 +156,33 @@ namespace WebCore {
PseudoType pseudoType() const PseudoType pseudoType() const
{ {
if (_pseudoType == PseudoNotParsed) if (m_pseudoType == PseudoNotParsed)
extractPseudoType(); extractPseudoType();
return static_cast<PseudoType>(_pseudoType); return static_cast<PseudoType>(m_pseudoType);
} }
bool hasTag() const { return tag != anyQName(); } bool hasTag() const { return m_tag != anyQName(); }
bool hasAttribute() const { return attr != anyQName(); } bool hasAttribute() const { return m_attr != anyQName(); }
mutable AtomicString value;
CSSSelector* tagHistory;
CSSSelector* simpleSelector; // Used for :not.
CSSSelector* nextSelector; // used for ,-chained selectors
AtomicString argument; // Used for :contains, :lang and :nth-*
QualifiedName attr;
QualifiedName tag;
Relation relation() const { return static_cast<Relation>(m_relation); } Relation relation() const { return static_cast<Relation>(m_relation); }
unsigned m_relation : 3; // enum Relation mutable AtomicString m_value;
mutable unsigned match : 4; // enum Match CSSSelector* m_tagHistory;
unsigned pseudoId : 4; CSSSelector* m_simpleSelector; // Used for :not.
mutable unsigned _pseudoType : 6; // PseudoType CSSSelector* m_nextSelector; // used for ,-chained selectors
AtomicString m_argument; // Used for :contains, :lang and :nth-*
QualifiedName m_attr;
QualifiedName m_tag;
unsigned m_relation : 3; // enum Relation
mutable unsigned m_match : 4; // enum Match
mutable unsigned m_pseudoType : 6; // PseudoType
private: private:
void extractPseudoType() const; void extractPseudoType() const;
}; };
}
#endif } // namespace WebCore
#endif // CSSSelector_h
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
* Boston, MA 02111-1307, USA. * Boston, MA 02111-1307, USA.
*/ */
#ifndef CSSStyleDeclaration_H #ifndef CSSStyleDeclaration_h
#define CSSStyleDeclaration_H #define CSSStyleDeclaration_h
#include "StyleBase.h" #include "StyleBase.h"
#include <wtf/PassRefPtr.h> #include <wtf/PassRefPtr.h>
...@@ -81,6 +81,6 @@ private: ...@@ -81,6 +81,6 @@ private:
CSSStyleDeclaration& operator=(const CSSStyleDeclaration&); CSSStyleDeclaration& operator=(const CSSStyleDeclaration&);
}; };
} // namespace } // namespace WebCore
#endif #endif // CSSStyleDeclaration_h
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
* Boston, MA 02111-1307, USA. * Boston, MA 02111-1307, USA.
*/ */
#ifndef Counter_H #ifndef Counter_h
#define Counter_H #define Counter_h
#include "CSSPrimitiveValue.h" #include "CSSPrimitiveValue.h"
#include "PlatformString.h" #include "PlatformString.h"
...@@ -32,26 +32,29 @@ namespace WebCore { ...@@ -32,26 +32,29 @@ namespace WebCore {
class Counter : public Shared<Counter> { class Counter : public Shared<Counter> {
public: public:
Counter(PassRefPtr<CSSPrimitiveValue> identifier, PassRefPtr<CSSPrimitiveValue> listStyle, Counter(PassRefPtr<CSSPrimitiveValue> identifier, PassRefPtr<CSSPrimitiveValue> listStyle, PassRefPtr<CSSPrimitiveValue> separator)
PassRefPtr<CSSPrimitiveValue> separator) : m_identifier(identifier)
: m_identifier(identifier), m_listStyle(listStyle), m_separator(separator) { } , m_listStyle(listStyle)
, m_separator(separator)
{
}
String identifier() const { return m_identifier ? m_identifier->getStringValue() : String(); } String identifier() const { return m_identifier ? m_identifier->getStringValue() : String(); }
String listStyle() const { return m_listStyle ? m_listStyle->getStringValue() : String(); } String listStyle() const { return m_listStyle ? m_listStyle->getStringValue() : String(); }
String separator() const { return m_separator ? m_separator->getStringValue() : String(); } String separator() const { return m_separator ? m_separator->getStringValue() : String(); }
int listStyleNumber() const { return m_listStyle ? (int) m_listStyle->getFloatValue() : 0; } int listStyleNumber() const { return m_listStyle ? static_cast<int>(m_listStyle->getFloatValue()) : 0; }
void setIdentifier(PassRefPtr<CSSPrimitiveValue> identifier) { m_identifier = identifier; } void setIdentifier(PassRefPtr<CSSPrimitiveValue> identifier) { m_identifier = identifier; }
void setListStyle(PassRefPtr<CSSPrimitiveValue> listStyle) { m_listStyle = listStyle; } void setListStyle(PassRefPtr<CSSPrimitiveValue> listStyle) { m_listStyle = listStyle; }
void setSeparator(PassRefPtr<CSSPrimitiveValue> separator) { m_separator = separator; } void setSeparator(PassRefPtr<CSSPrimitiveValue> separator) { m_separator = separator; }
protected: protected:
RefPtr<CSSPrimitiveValue> m_identifier; // String RefPtr<CSSPrimitiveValue> m_identifier; // String
RefPtr<CSSPrimitiveValue> m_listStyle; // int RefPtr<CSSPrimitiveValue> m_listStyle; // int
RefPtr<CSSPrimitiveValue> m_separator; // String RefPtr<CSSPrimitiveValue> m_separator; // String
}; };
} //namespace } // namespace WebCore
#endif #endif // Counter_h
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment