Index: Source/core/dom/Document.h |
diff --git a/Source/core/dom/Document.h b/Source/core/dom/Document.h |
index 5b5af6f77ddcfe95627bca412c554ccde6ab0ca9..f8c2956091927524bdf5ad3a7ad919fd66277fa7 100644 |
--- a/Source/core/dom/Document.h |
+++ b/Source/core/dom/Document.h |
@@ -289,11 +289,12 @@ public: |
DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitvisibilitychange); |
DEFINE_ATTRIBUTE_EVENT_LISTENER(securitypolicyviolation); |
- void setViewportArguments(const ViewportArguments& viewportArguments) { m_viewportArguments = viewportArguments; } |
+ void setViewportArguments(const ViewportArguments&); |
const ViewportArguments& viewportArguments() const { return m_viewportArguments; } |
#ifndef NDEBUG |
bool didDispatchViewportPropertiesChanged() const { return m_didDispatchViewportPropertiesChanged; } |
#endif |
+ bool hasLegacyViewportTag() const { return m_legacyViewportArguments.type != ViewportArguments::UserAgentStyleSheet; } |
kenneth.r.christiansen
2013/09/03 08:55:57
What about the CSSDeviceAdaptation type (which I t
rune
2013/09/03 09:25:00
Done.
|
void setReferrerPolicy(ReferrerPolicy referrerPolicy) { m_referrerPolicy = referrerPolicy; } |
ReferrerPolicy referrerPolicy() const { return m_referrerPolicy; } |
@@ -417,6 +418,7 @@ public: |
bool isFrameSet() const; |
bool isSrcdocDocument() const { return m_isSrcdocDocument; } |
+ bool isMobileDocument() const { return m_isMobileDocument; } |
StyleResolver* styleResolverIfExists() const { return m_styleResolver.get(); } |
@@ -1310,6 +1312,7 @@ private: |
bool m_isViewSource; |
bool m_sawElementsInKnownNamespaces; |
bool m_isSrcdocDocument; |
+ bool m_isMobileDocument; |
RenderObject* m_renderer; |
RefPtr<DocumentEventQueue> m_eventQueue; |
@@ -1327,6 +1330,7 @@ private: |
Timer<Document> m_loadEventDelayTimer; |
ViewportArguments m_viewportArguments; |
+ ViewportArguments m_legacyViewportArguments; |
ReferrerPolicy m_referrerPolicy; |
@@ -1400,6 +1404,17 @@ inline const Document* Document::templateDocument() const |
return m_templateDocument.get(); |
} |
+inline void Document::setViewportArguments(const ViewportArguments& viewportArguments) |
+{ |
+ // If the legacy viewport tag has higher priority than the cascaded @viewport |
+ // descriptors, use the values from the legacy tag. |
+ if (viewportArguments.type < m_legacyViewportArguments.type) |
+ m_viewportArguments = m_legacyViewportArguments; |
+ else |
+ m_viewportArguments = viewportArguments; |
+ updateViewportArguments(); |
+} |
+ |
inline Document* toDocument(ScriptExecutionContext* scriptExecutionContext) |
{ |
ASSERT_WITH_SECURITY_IMPLICATION(!scriptExecutionContext || scriptExecutionContext->isDocument()); |