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

Unified Diff: Source/core/html/MediaDocument.cpp

Issue 18034007: Add viewport settings for ImageDocument and MediaDocument (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: LayoutTests Created 7 years, 5 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/html/ImageDocument.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/MediaDocument.cpp
diff --git a/Source/core/html/MediaDocument.cpp b/Source/core/html/MediaDocument.cpp
index 4be22afc3f12574c744c81be4b02ffeb936e6b61..aeacbcfec72f6fb0448537c6d18f9004811ddb07 100644
--- a/Source/core/html/MediaDocument.cpp
+++ b/Source/core/html/MediaDocument.cpp
@@ -76,7 +76,15 @@ void MediaDocumentParser::createDocumentStructure()
if (document()->frame())
document()->frame()->loader()->dispatchDocumentElementAvailable();
-
+
+ RefPtr<Element> head = document()->createElement(headTag, false);
+ rootElement->appendChild(head, IGNORE_EXCEPTION);
+
+ RefPtr<Element> meta = document()->createElement(metaTag, false);
+ meta->setAttribute(nameAttr, "viewport");
+ meta->setAttribute(contentAttr, "width=device-width");
+ head->appendChild(meta, IGNORE_EXCEPTION);
+
RefPtr<Element> body = document()->createElement(bodyTag, false);
rootElement->appendChild(body, IGNORE_EXCEPTION);
« no previous file with comments | « Source/core/html/ImageDocument.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698