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

Unified Diff: Source/core/html/HTMLMetaElement.h

Issue 19555002: Translate viewport related meta tags into @viewport descriptors as suggested by the CSS Device Adap… (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 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: Source/core/html/HTMLMetaElement.h
diff --git a/Source/core/html/HTMLMetaElement.h b/Source/core/html/HTMLMetaElement.h
index f9255b11430cac2535f655c5e1e3b0e4b759ba33..52708d57615e8d6bb6af2dfc41b6c9121ec082e7 100644
--- a/Source/core/html/HTMLMetaElement.h
+++ b/Source/core/html/HTMLMetaElement.h
@@ -23,6 +23,7 @@
#ifndef HTMLMetaElement_h
#define HTMLMetaElement_h
+#include "core/css/StyleRule.h"
#include "core/html/HTMLElement.h"
namespace WebCore {
@@ -31,18 +32,52 @@ class HTMLMetaElement FINAL : public HTMLElement {
public:
static PassRefPtr<HTMLMetaElement> create(Document*);
static PassRefPtr<HTMLMetaElement> create(const QualifiedName&, Document*);
+ ~HTMLMetaElement();
String content() const;
String httpEquiv() const;
String name() const;
+ CSSStyleSheet* sheet() const { return m_sheet.get(); }
+
private:
HTMLMetaElement(const QualifiedName&, Document*);
- virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE;
+ virtual void removedFrom(ContainerNode*) OVERRIDE;
+
+ enum ErrorType {
+ NoError,
+ InvalidPropertySeparatorError,
+ InvalidPropertyError,
+ InvalidValueError,
+ OutOfBoundsValueError,
+ TruncatedValueError,
+ };
+
+ void reportError(ErrorType, const String& property, const String& value);
+
+ typedef void (*PropertyCollector)(HTMLMetaElement*, MutableStylePropertySet*, const String& property, const String& value);
+ static void viewportPropertyCollector(HTMLMetaElement*, MutableStylePropertySet*, const String& property, const String& value);
+
+ virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
+ void parseContentAttribute(MutableStylePropertySet*, const String&, PropertyCollector);
+
+ float parsePositiveNumber(const String& property, const String& value, float minValue, float maxValue);
+ CSSValueID parseViewportValueAsUserZoom(const String& property, const String& value);
+ PassRefPtr<CSSValue> parseViewportValueAsLength(const String& property, const String& value);
+ PassRefPtr<CSSValue> parseViewportValueAsZoom(const String& property, const String& value);
+ PassRefPtr<CSSValue> parseViewportValueAsDPI(const String& property, const String& value);
+
+ PassRefPtr<StyleRuleBase> parseViewportContent(const String&);
+ PassRefPtr<StyleRuleBase> parseHandheldFriendlyContent(const String&);
+ PassRefPtr<StyleRuleBase> parseMobileOptimizedContent(const String&);
void process();
+ void addStyleSheetForRule(PassRefPtr<StyleRuleBase>);
+ void removeStyleSheet();
+
+ RefPtr<CSSStyleSheet> m_sheet;
};
} //namespace

Powered by Google App Engine
This is Rietveld 408576698