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

Unified Diff: Source/core/dom/Document.h

Issue 23742003: Use css-device-adapt constraining for legacy viewport tags. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Review issue: one assignent per line/statement Created 7 years, 3 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
« no previous file with comments | « Source/core/css/xhtmlmp.css ('k') | Source/core/dom/Document.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Document.h
diff --git a/Source/core/dom/Document.h b/Source/core/dom/Document.h
index 2ae94a168745b15e378a5ae9b8c814e78ba24f8a..3f64812e17fb64ab2c9b25314a48d6edb1b1e988 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.isLegacyViewportType(); }
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;
@@ -1326,6 +1329,7 @@ private:
Timer<Document> m_loadEventDelayTimer;
ViewportArguments m_viewportArguments;
+ ViewportArguments m_legacyViewportArguments;
ReferrerPolicy m_referrerPolicy;
@@ -1399,6 +1403,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());
« no previous file with comments | « Source/core/css/xhtmlmp.css ('k') | Source/core/dom/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698