summaryrefslogtreecommitdiff
path: root/Source/WebCore/css/PropertySetCSSStyleDeclaration.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/PropertySetCSSStyleDeclaration.h
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/WebCore/css/PropertySetCSSStyleDeclaration.h')
-rw-r--r--Source/WebCore/css/PropertySetCSSStyleDeclaration.h104
1 files changed, 53 insertions, 51 deletions
diff --git a/Source/WebCore/css/PropertySetCSSStyleDeclaration.h b/Source/WebCore/css/PropertySetCSSStyleDeclaration.h
index 6741ddddd..564cb1da2 100644
--- a/Source/WebCore/css/PropertySetCSSStyleDeclaration.h
+++ b/Source/WebCore/css/PropertySetCSSStyleDeclaration.h
@@ -10,10 +10,10 @@
* 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 COMPUTER, INC. ``AS IS'' AND ANY
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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 COMPUTER, INC. OR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* 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
@@ -23,9 +23,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef PropertySetCSSStyleDeclaration_h
-#define PropertySetCSSStyleDeclaration_h
+#pragma once
+#include "CSSParserMode.h"
#include "CSSStyleDeclaration.h"
#include <memory>
#include <wtf/HashMap.h>
@@ -36,6 +36,7 @@ namespace WebCore {
class CSSRule;
class CSSProperty;
class CSSValue;
+class DeprecatedCSSOMValue;
class MutableStyleProperties;
class StyleSheetContents;
class StyledElement;
@@ -43,93 +44,94 @@ class StyledElement;
class PropertySetCSSStyleDeclaration : public CSSStyleDeclaration {
public:
PropertySetCSSStyleDeclaration(MutableStyleProperties* propertySet) : m_propertySet(propertySet) { }
-
- virtual StyledElement* parentElement() const { return 0; }
+
virtual void clearParentElement() { ASSERT_NOT_REACHED(); }
+
StyleSheetContents* contextStyleSheet() const;
-
- virtual void ref() override;
- virtual void deref() override;
+
+protected:
+ enum MutationType { NoChanges, PropertyChanged };
+
+ virtual CSSParserContext cssParserContext() const;
+
+ MutableStyleProperties* m_propertySet;
+ std::unique_ptr<HashMap<CSSValue*, RefPtr<DeprecatedCSSOMValue>>> m_cssomValueWrappers;
private:
- virtual CSSRule* parentRule() const override { return 0; };
- virtual unsigned length() const override;
- virtual String item(unsigned index) const override;
- virtual PassRefPtr<CSSValue> getPropertyCSSValue(const String& propertyName) override;
- virtual String getPropertyValue(const String& propertyName) override;
- virtual String getPropertyPriority(const String& propertyName) override;
- virtual String getPropertyShorthand(const String& propertyName) override;
- virtual bool isPropertyImplicit(const String& propertyName) override;
- virtual void setProperty(const String& propertyName, const String& value, const String& priority, ExceptionCode&) override;
- virtual String removeProperty(const String& propertyName, ExceptionCode&) override;
- virtual String cssText() const override;
- virtual void setCssText(const String&, ExceptionCode&) override;
- virtual PassRefPtr<CSSValue> getPropertyCSSValueInternal(CSSPropertyID) override;
- virtual String getPropertyValueInternal(CSSPropertyID) override;
- virtual void setPropertyInternal(CSSPropertyID, const String& value, bool important, ExceptionCode&) override;
+ void ref() override;
+ void deref() override;
+
+ CSSRule* parentRule() const override { return nullptr; }
+ unsigned length() const final;
+ String item(unsigned index) const final;
+ RefPtr<DeprecatedCSSOMValue> getPropertyCSSValue(const String& propertyName) final;
+ String getPropertyValue(const String& propertyName) final;
+ String getPropertyPriority(const String& propertyName) final;
+ String getPropertyShorthand(const String& propertyName) final;
+ bool isPropertyImplicit(const String& propertyName) final;
+ ExceptionOr<void> setProperty(const String& propertyName, const String& value, const String& priority) final;
+ ExceptionOr<String> removeProperty(const String& propertyName) final;
+ String cssText() const final;
+ ExceptionOr<void> setCssText(const String&) final;
+ RefPtr<CSSValue> getPropertyCSSValueInternal(CSSPropertyID) final;
+ String getPropertyValueInternal(CSSPropertyID) final;
+ ExceptionOr<bool> setPropertyInternal(CSSPropertyID, const String& value, bool important) final;
- virtual PassRef<MutableStyleProperties> copyProperties() const override;
+ Ref<MutableStyleProperties> copyProperties() const final;
- CSSValue* cloneAndCacheForCSSOM(CSSValue*);
+ DeprecatedCSSOMValue* wrapForDeprecatedCSSOM(CSSValue*);
-protected:
- enum MutationType { NoChanges, PropertyChanged };
virtual bool willMutate() WARN_UNUSED_RETURN { return true; }
virtual void didMutate(MutationType) { }
-
- MutableStyleProperties* m_propertySet;
- std::unique_ptr<HashMap<CSSValue*, RefPtr<CSSValue>>> m_cssomCSSValueClones;
};
-class StyleRuleCSSStyleDeclaration : public PropertySetCSSStyleDeclaration
-{
+class StyleRuleCSSStyleDeclaration final : public PropertySetCSSStyleDeclaration {
public:
- static PassRefPtr<StyleRuleCSSStyleDeclaration> create(MutableStyleProperties& propertySet, CSSRule& parentRule)
+ static Ref<StyleRuleCSSStyleDeclaration> create(MutableStyleProperties& propertySet, CSSRule& parentRule)
{
- return adoptRef(new StyleRuleCSSStyleDeclaration(propertySet, parentRule));
+ return adoptRef(*new StyleRuleCSSStyleDeclaration(propertySet, parentRule));
}
virtual ~StyleRuleCSSStyleDeclaration();
- void clearParentRule() { m_parentRule = 0; }
+ void clearParentRule() { m_parentRule = nullptr; }
- virtual void ref() override;
- virtual void deref() override;
+ void ref() final;
+ void deref() final;
void reattach(MutableStyleProperties&);
private:
StyleRuleCSSStyleDeclaration(MutableStyleProperties&, CSSRule&);
- virtual CSSStyleSheet* parentStyleSheet() const override;
+ CSSStyleSheet* parentStyleSheet() const final;
- virtual CSSRule* parentRule() const override { return m_parentRule; }
+ CSSRule* parentRule() const final { return m_parentRule; }
- virtual bool willMutate() override WARN_UNUSED_RETURN;
- virtual void didMutate(MutationType) override;
+ bool willMutate() final WARN_UNUSED_RETURN;
+ void didMutate(MutationType) final;
+ CSSParserContext cssParserContext() const final;
unsigned m_refCount;
CSSRule* m_parentRule;
};
-class InlineCSSStyleDeclaration : public PropertySetCSSStyleDeclaration
-{
+class InlineCSSStyleDeclaration final : public PropertySetCSSStyleDeclaration {
public:
InlineCSSStyleDeclaration(MutableStyleProperties* propertySet, StyledElement* parentElement)
: PropertySetCSSStyleDeclaration(propertySet)
, m_parentElement(parentElement)
{
}
-
+
private:
- virtual CSSStyleSheet* parentStyleSheet() const override;
- virtual StyledElement* parentElement() const override { return m_parentElement; }
- virtual void clearParentElement() override { m_parentElement = 0; }
+ CSSStyleSheet* parentStyleSheet() const final;
+ StyledElement* parentElement() const final { return m_parentElement; }
+ void clearParentElement() final { m_parentElement = nullptr; }
- virtual void didMutate(MutationType) override;
+ void didMutate(MutationType) final;
+ CSSParserContext cssParserContext() const final;
StyledElement* m_parentElement;
};
} // namespace WebCore
-
-#endif