summaryrefslogtreecommitdiff
path: root/Source/WebCore/css/Counter.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/css/Counter.h
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/WebCore/css/Counter.h')
-rw-r--r--Source/WebCore/css/Counter.h50
1 files changed, 22 insertions, 28 deletions
diff --git a/Source/WebCore/css/Counter.h b/Source/WebCore/css/Counter.h
index 205bf8bbe..76c3baee5 100644
--- a/Source/WebCore/css/Counter.h
+++ b/Source/WebCore/css/Counter.h
@@ -18,30 +18,33 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef Counter_h
-#define Counter_h
+#pragma once
#include "CSSPrimitiveValue.h"
#include <wtf/text/WTFString.h>
namespace WebCore {
-class Counter : public RefCounted<Counter> {
+class Counter final : public RefCounted<Counter> {
public:
- static PassRefPtr<Counter> create(PassRefPtr<CSSPrimitiveValue> identifier, PassRefPtr<CSSPrimitiveValue> listStyle, PassRefPtr<CSSPrimitiveValue> separator)
+ static Ref<Counter> create(Ref<CSSPrimitiveValue>&& identifier, Ref<CSSPrimitiveValue>&& listStyle, Ref<CSSPrimitiveValue>&& separator)
{
- return adoptRef(new Counter(identifier, listStyle, separator));
+ return adoptRef(*new Counter(WTFMove(identifier), WTFMove(listStyle), WTFMove(separator)));
}
- String identifier() const { return m_identifier ? m_identifier->getStringValue() : String(); }
- String listStyle() const { return m_listStyle ? m_listStyle->getStringValue() : String(); }
- String separator() const { return m_separator ? m_separator->getStringValue() : String(); }
+ String identifier() const { return m_identifier->stringValue(); }
+ String listStyle() const { return m_listStyle->stringValue(); }
+ String separator() const { return m_separator->stringValue(); }
- CSSValueID listStyleIdent() const { return m_listStyle ? m_listStyle->getValueID() : CSSValueInvalid; }
+ const CSSPrimitiveValue& identifierValue() const { return m_identifier; }
+ const CSSPrimitiveValue& listStyleValue() const { return m_listStyle; }
+ const CSSPrimitiveValue& separatorValue() const { return m_separator; }
+
+ CSSValueID listStyleIdent() const { return m_listStyle->valueID(); }
- void setIdentifier(PassRefPtr<CSSPrimitiveValue> identifier) { m_identifier = identifier; }
- void setListStyle(PassRefPtr<CSSPrimitiveValue> listStyle) { m_listStyle = listStyle; }
- void setSeparator(PassRefPtr<CSSPrimitiveValue> separator) { m_separator = separator; }
+ void setIdentifier(Ref<CSSPrimitiveValue>&& identifier) { m_identifier = WTFMove(identifier); }
+ void setListStyle(Ref<CSSPrimitiveValue>&& listStyle) { m_listStyle = WTFMove(listStyle); }
+ void setSeparator(Ref<CSSPrimitiveValue>&& separator) { m_separator = WTFMove(separator); }
bool equals(const Counter& other) const
{
@@ -49,27 +52,18 @@ public:
&& listStyle() == other.listStyle()
&& separator() == other.separator();
}
-
- PassRefPtr<Counter> cloneForCSSOM() const
- {
- return create(m_identifier ? m_identifier->cloneForCSSOM() : 0
- , m_listStyle ? m_listStyle->cloneForCSSOM() : 0
- , m_separator ? m_separator->cloneForCSSOM() : 0);
- }
private:
- Counter(PassRefPtr<CSSPrimitiveValue> identifier, PassRefPtr<CSSPrimitiveValue> listStyle, PassRefPtr<CSSPrimitiveValue> separator)
- : m_identifier(identifier)
- , m_listStyle(listStyle)
- , m_separator(separator)
+ Counter(Ref<CSSPrimitiveValue>&& identifier, Ref<CSSPrimitiveValue>&& listStyle, Ref<CSSPrimitiveValue>&& separator)
+ : m_identifier(WTFMove(identifier))
+ , m_listStyle(WTFMove(listStyle))
+ , m_separator(WTFMove(separator))
{
}
- RefPtr<CSSPrimitiveValue> m_identifier; // string
- RefPtr<CSSPrimitiveValue> m_listStyle; // ident
- RefPtr<CSSPrimitiveValue> m_separator; // string
+ Ref<CSSPrimitiveValue> m_identifier; // string
+ Ref<CSSPrimitiveValue> m_listStyle; // ident
+ Ref<CSSPrimitiveValue> m_separator; // string
};
} // namespace WebCore
-
-#endif // Counter_h