diff options
author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2012-01-21 22:34:33 +0100 |
---|---|---|
committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2012-01-21 22:34:33 +0100 |
commit | e7b4b73969b02708142321001c1979f0c398ef8e (patch) | |
tree | 57991de5daf924d65f00cae2509b7c72d5c78b0a /src/css.hh | |
parent | ca3f6616f18019feec480af2e4d5898bad3969d0 (diff) |
ignore remote CSS rules that could reveal browser history
For a discussion of the problem see:
http://dbaron.org/mozilla/visited-privacy
Diffstat (limited to 'src/css.hh')
-rw-r--r-- | src/css.hh | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -297,11 +297,13 @@ class CssProperty { class CssPropertyList : public lout::misc::SimpleVector <CssProperty> { int refCount; bool ownerOfStrings; + bool safe; public: inline CssPropertyList(bool ownerOfStrings = false) : lout::misc::SimpleVector <CssProperty> (1) { refCount = 0; + safe = true; this->ownerOfStrings = ownerOfStrings; }; CssPropertyList(const CssPropertyList &p, bool deep = false); @@ -310,6 +312,7 @@ class CssPropertyList : public lout::misc::SimpleVector <CssProperty> { void set (CssPropertyName name, CssValueType type, CssPropertyValue value); void apply (CssPropertyList *props); + bool isSafe () { return safe; }; void print (); inline void ref () { refCount++; } inline void unref () { if (--refCount == 0) delete this; } @@ -385,6 +388,7 @@ class CssSelector { return match (dt, node, selectorList->size () - 1, COMB_NONE); }; int specificity (); + bool checksPseudoClass (); void print (); inline void ref () { refCount++; } inline void unref () { if (--refCount == 0) delete this; } @@ -408,6 +412,9 @@ class CssRule { void apply (CssPropertyList *props, Doctree *docTree, const DoctreeNode *node); + inline bool isSafe () { + return !selector->checksPseudoClass () || props->isSafe (); + }; inline int specificity () { return spec; }; inline int position () { return pos; }; void print (); |