| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 } | 184 } |
| 185 | 185 |
| 186 void ImageDocument::createDocumentStructure() | 186 void ImageDocument::createDocumentStructure() |
| 187 { | 187 { |
| 188 RefPtr<Element> rootElement = Document::createElement(htmlTag, false); | 188 RefPtr<Element> rootElement = Document::createElement(htmlTag, false); |
| 189 appendChild(rootElement, IGNORE_EXCEPTION); | 189 appendChild(rootElement, IGNORE_EXCEPTION); |
| 190 static_cast<HTMLHtmlElement*>(rootElement.get())->insertedByParser(); | 190 static_cast<HTMLHtmlElement*>(rootElement.get())->insertedByParser(); |
| 191 | 191 |
| 192 if (frame() && frame()->loader()) | 192 if (frame() && frame()->loader()) |
| 193 frame()->loader()->dispatchDocumentElementAvailable(); | 193 frame()->loader()->dispatchDocumentElementAvailable(); |
| 194 | 194 |
| 195 RefPtr<Element> head = document()->createElement(headTag, false); |
| 196 rootElement->appendChild(head, IGNORE_EXCEPTION); |
| 197 |
| 198 RefPtr<Element> meta = document()->createElement(metaTag, false); |
| 199 meta->setAttribute(nameAttr, "viewport"); |
| 200 meta->setAttribute(contentAttr, "width=device-width"); |
| 201 head->appendChild(meta, IGNORE_EXCEPTION); |
| 202 |
| 195 RefPtr<Element> body = Document::createElement(bodyTag, false); | 203 RefPtr<Element> body = Document::createElement(bodyTag, false); |
| 196 body->setAttribute(styleAttr, "margin: 0px;"); | 204 body->setAttribute(styleAttr, "margin: 0px;"); |
| 197 | 205 |
| 198 rootElement->appendChild(body, IGNORE_EXCEPTION); | 206 rootElement->appendChild(body, IGNORE_EXCEPTION); |
| 199 | 207 |
| 200 RefPtr<ImageDocumentElement> imageElement = ImageDocumentElement::create(thi
s); | 208 RefPtr<ImageDocumentElement> imageElement = ImageDocumentElement::create(thi
s); |
| 201 | 209 |
| 202 imageElement->setAttribute(styleAttr, "-webkit-user-select: none"); | 210 imageElement->setAttribute(styleAttr, "-webkit-user-select: none"); |
| 203 imageElement->setLoadManually(true); | 211 imageElement->setLoadManually(true); |
| 204 imageElement->setSrc(url().string()); | 212 imageElement->setSrc(url().string()); |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 void ImageDocumentElement::didMoveToNewDocument(Document* oldDocument) | 406 void ImageDocumentElement::didMoveToNewDocument(Document* oldDocument) |
| 399 { | 407 { |
| 400 if (m_imageDocument) { | 408 if (m_imageDocument) { |
| 401 m_imageDocument->disconnectImageElement(); | 409 m_imageDocument->disconnectImageElement(); |
| 402 m_imageDocument = 0; | 410 m_imageDocument = 0; |
| 403 } | 411 } |
| 404 HTMLImageElement::didMoveToNewDocument(oldDocument); | 412 HTMLImageElement::didMoveToNewDocument(oldDocument); |
| 405 } | 413 } |
| 406 | 414 |
| 407 } | 415 } |
| OLD | NEW |