Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(679)

Unified Diff: third_party/WebKit/Source/core/style/ContentData.h

Issue 1812763002: Pseudo and non pseudo elements should return correct computed content value (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/style/ContentData.h
diff --git a/third_party/WebKit/Source/core/style/ContentData.h b/third_party/WebKit/Source/core/style/ContentData.h
index 1947050f38e362be24a815244ff5b3e1444a3cad..c3355bd789fad73828e876a9fbae47a27d0d3579 100644
--- a/third_party/WebKit/Source/core/style/ContentData.h
+++ b/third_party/WebKit/Source/core/style/ContentData.h
@@ -25,6 +25,7 @@
#ifndef ContentData_h
#define ContentData_h
+#include "core/CSSValueKeywords.h"
#include "core/style/CounterContent.h"
#include "core/style/StyleImage.h"
#include "wtf/OwnPtr.h"
@@ -43,6 +44,7 @@ public:
static PassOwnPtrWillBeRawPtr<ContentData> create(const String&);
static PassOwnPtrWillBeRawPtr<ContentData> create(PassOwnPtr<CounterContent>);
static PassOwnPtrWillBeRawPtr<ContentData> create(QuoteType);
+ static PassOwnPtrWillBeRawPtr<ContentData> create(CSSValueID);
virtual ~ContentData() { }
@@ -50,6 +52,7 @@ public:
virtual bool isImage() const { return false; }
virtual bool isQuote() const { return false; }
virtual bool isText() const { return false; }
+ virtual bool isCSSValueID() const { return false; }
virtual LayoutObject* createLayoutObject(Document&, ComputedStyle&) const = 0;
@@ -199,6 +202,35 @@ private:
DEFINE_CONTENT_DATA_TYPE_CASTS(Quote);
+class CSSValueIDContentData final : public ContentData {
+ friend class ContentData;
+public:
+ CSSValueID cssValueID() const { return m_cssValueID; }
+ void setCSSValueID(CSSValueID cssValueID) { m_cssValueID = cssValueID; }
+
+ bool isCSSValueID() const override { return true; }
+ LayoutObject* createLayoutObject(Document&, ComputedStyle&) const override;
+
+ bool equals(const ContentData& data) const override
+ {
+ if (!data.isCSSValueID())
+ return false;
+ return static_cast<const CSSValueIDContentData&>(data).cssValueID() == cssValueID();
+ }
+
+private:
+ CSSValueIDContentData(CSSValueID cssValueID)
+ : m_cssValueID(cssValueID)
+ {
+ }
+
+ PassOwnPtrWillBeRawPtr<ContentData> cloneInternal() const override { return create(cssValueID()); }
+
+ CSSValueID m_cssValueID;
alancutter (OOO until 2018) 2016/03/19 08:01:23 How many different CSSValueIDs could be stored her
nainar 2016/03/21 00:12:08 Done.
+};
+
+DEFINE_CONTENT_DATA_TYPE_CASTS(CSSValueID);
+
inline bool operator==(const ContentData& a, const ContentData& b)
{
return a.equals(b);
« no previous file with comments | « third_party/WebKit/Source/core/style/ComputedStyle.cpp ('k') | third_party/WebKit/Source/core/style/ContentData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698