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

Unified Diff: Source/core/html/ImageDocument.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
Index: Source/core/html/ImageDocument.cpp
diff --git a/Source/core/html/ImageDocument.cpp b/Source/core/html/ImageDocument.cpp
index eb594be11f70d34d54a0741142c7a7222f1e1ae9..743b3b6943c624666335cd211a89273c1cc10053 100644
--- a/Source/core/html/ImageDocument.cpp
+++ b/Source/core/html/ImageDocument.cpp
@@ -191,7 +191,15 @@ void ImageDocument::createDocumentStructure()
if (frame() && frame()->loader())
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);
body->setAttribute(styleAttr, "margin: 0px;");
« no previous file with comments | « LayoutTests/fast/media/viewport-in-standalone-media-document-expected.txt ('k') | Source/core/html/MediaDocument.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698