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

Unified Diff: third_party/WebKit/Source/core/css/CSSSelector.h

Issue 1481383002: [Experimental] CSSSerializer Proof-of-concept Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: snapshot: top_25 sites ser/dser now works Created 4 years, 11 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/css/CSSSelector.h
diff --git a/third_party/WebKit/Source/core/css/CSSSelector.h b/third_party/WebKit/Source/core/css/CSSSelector.h
index c95b98d77664a8aad838ee1c1d9c90c581964461..f997e2d922b8c8b048798eeb04747acc6c956fc4 100644
--- a/third_party/WebKit/Source/core/css/CSSSelector.h
+++ b/third_party/WebKit/Source/core/css/CSSSelector.h
@@ -29,7 +29,9 @@
#include "wtf/PassOwnPtr.h"
namespace blink {
+class CSSDeserializeStream;
class CSSSelectorList;
+class CSSSerializeStream;
// This class represents a selector for a StyleRule.
@@ -79,6 +81,7 @@ class CORE_EXPORT CSSSelector {
public:
CSSSelector();
CSSSelector(const CSSSelector&);
+ CSSSelector(CSSDeserializeStream*);
explicit CSSSelector(const QualifiedName&, bool tagIsImplicit = false);
~CSSSelector();
@@ -287,16 +290,23 @@ public:
bool relationIsAffectedByPseudoContent() const { return m_relationIsAffectedByPseudoContent; }
void setRelationIsAffectedByPseudoContent() { m_relationIsAffectedByPseudoContent = true; }
+ void serialize(CSSSerializeStream*) const;
+
private:
- unsigned m_relation : 3; // enum Relation
- unsigned m_match : 4; // enum Match
- unsigned m_pseudoType : 8; // enum PseudoType
- unsigned m_isLastInSelectorList : 1;
- unsigned m_isLastInTagHistory : 1;
- unsigned m_hasRareData : 1;
- unsigned m_isForPage : 1;
- unsigned m_tagIsImplicit : 1;
- unsigned m_relationIsAffectedByPseudoContent : 1;
+ union {
+ struct {
+ unsigned m_relation : 3; // enum Relation
+ unsigned m_match : 4; // enum Match
+ unsigned m_pseudoType : 8; // enum PseudoType
+ unsigned m_isLastInSelectorList : 1;
+ unsigned m_isLastInTagHistory : 1;
+ unsigned m_hasRareData : 1;
+ unsigned m_isForPage : 1;
+ unsigned m_tagIsImplicit : 1;
+ unsigned m_relationIsAffectedByPseudoContent : 1;
+ };
+ unsigned m_bitfields;
+ };
void setPseudoType(PseudoType pseudoType)
{
@@ -312,11 +322,13 @@ private:
struct RareData : public RefCounted<RareData> {
static PassRefPtr<RareData> create(const AtomicString& value) { return adoptRef(new RareData(value)); }
+ static PassRefPtr<RareData> deserialize(CSSDeserializeStream*);
~RareData();
bool matchNth(int count);
int nthAValue() const { return m_bits.m_nth.m_a; }
int nthBValue() const { return m_bits.m_nth.m_b; }
+ void serialize(CSSSerializeStream*);
AtomicString m_matchingValue;
AtomicString m_serializingValue;
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSQuadValue.cpp ('k') | third_party/WebKit/Source/core/css/CSSSelector.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698