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: 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: Fixed review issues. 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
Index: Source/core/dom/Document.h
diff --git a/Source/core/dom/Document.h b/Source/core/dom/Document.h
index b5fc9e6759344aaab4c94996e5abf9f17d07b9cc..f73327b7e2d28a0bc3d01ab2087e5bf06aa46f44 100644
--- a/Source/core/dom/Document.h
+++ b/Source/core/dom/Document.h
@@ -289,8 +289,11 @@ 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; }
+ // When no author style for @viewport is present, and a meta tag for defining the
+ // viewport is present, apply the meta tag viewport arguments instead of the UA styles.
+ bool useLegacyViewportArguments();
kenneth.r.christiansen 2013/09/02 11:55:28 We should really rename this ViewportArgument clas
rune 2013/09/02 12:05:53 How about just useLegacyViewport() ?
rune 2013/09/03 08:27:10 Method now removed.
#ifndef NDEBUG
bool didDispatchViewportPropertiesChanged() const { return m_didDispatchViewportPropertiesChanged; }
#endif
@@ -417,6 +420,7 @@ public:
bool isFrameSet() const;
bool isSrcdocDocument() const { return m_isSrcdocDocument; }
+ bool isMobileDocument() const { return m_isMobileDocument; }
StyleResolver* styleResolverIfExists() const { return m_styleResolver.get(); }
@@ -1308,6 +1312,7 @@ private:
bool m_isViewSource;
bool m_sawElementsInKnownNamespaces;
bool m_isSrcdocDocument;
+ bool m_isMobileDocument;
RenderObject* m_renderer;
RefPtr<DocumentEventQueue> m_eventQueue;
@@ -1324,6 +1329,7 @@ private:
Timer<Document> m_loadEventDelayTimer;
ViewportArguments m_viewportArguments;
+ ViewportArguments m_legacyViewportArguments;
ReferrerPolicy m_referrerPolicy;
@@ -1397,6 +1403,21 @@ inline const Document* Document::templateDocument() const
return m_templateDocument.get();
}
+inline void Document::setViewportArguments(const ViewportArguments& viewportArguments)
+{
+ m_viewportArguments = viewportArguments;
+ updateViewportArguments();
+}
+
+inline bool Document::useLegacyViewportArguments()
+{
+ if (m_legacyViewportArguments.type == ViewportArguments::UserAgentStyleSheet)
+ return false;
+
+ setViewportArguments(m_legacyViewportArguments);
+ return true;
+}
+
inline Document* toDocument(ScriptExecutionContext* scriptExecutionContext)
{
ASSERT_WITH_SECURITY_IMPLICATION(!scriptExecutionContext || scriptExecutionContext->isDocument());

Powered by Google App Engine
This is Rietveld 408576698