OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 | 69 |
70 void MediaDocumentParser::createDocumentStructure() | 70 void MediaDocumentParser::createDocumentStructure() |
71 { | 71 { |
72 RefPtr<Element> rootElement = document()->createElement(htmlTag, false); | 72 RefPtr<Element> rootElement = document()->createElement(htmlTag, false); |
73 document()->appendChild(rootElement, IGNORE_EXCEPTION); | 73 document()->appendChild(rootElement, IGNORE_EXCEPTION); |
74 document()->setCSSTarget(rootElement.get()); | 74 document()->setCSSTarget(rootElement.get()); |
75 static_cast<HTMLHtmlElement*>(rootElement.get())->insertedByParser(); | 75 static_cast<HTMLHtmlElement*>(rootElement.get())->insertedByParser(); |
76 | 76 |
77 if (document()->frame()) | 77 if (document()->frame()) |
78 document()->frame()->loader()->dispatchDocumentElementAvailable(); | 78 document()->frame()->loader()->dispatchDocumentElementAvailable(); |
79 | 79 |
| 80 RefPtr<Element> head = document()->createElement(headTag, false); |
| 81 rootElement->appendChild(head, IGNORE_EXCEPTION); |
| 82 |
| 83 RefPtr<Element> meta = document()->createElement(metaTag, false); |
| 84 meta->setAttribute(nameAttr, "viewport"); |
| 85 meta->setAttribute(contentAttr, "width=device-width"); |
| 86 head->appendChild(meta, IGNORE_EXCEPTION); |
| 87 |
80 RefPtr<Element> body = document()->createElement(bodyTag, false); | 88 RefPtr<Element> body = document()->createElement(bodyTag, false); |
81 rootElement->appendChild(body, IGNORE_EXCEPTION); | 89 rootElement->appendChild(body, IGNORE_EXCEPTION); |
82 | 90 |
83 RefPtr<Element> mediaElement = document()->createElement(videoTag, false); | 91 RefPtr<Element> mediaElement = document()->createElement(videoTag, false); |
84 | 92 |
85 m_mediaElement = static_cast<HTMLVideoElement*>(mediaElement.get()); | 93 m_mediaElement = static_cast<HTMLVideoElement*>(mediaElement.get()); |
86 m_mediaElement->setAttribute(controlsAttr, ""); | 94 m_mediaElement->setAttribute(controlsAttr, ""); |
87 m_mediaElement->setAttribute(autoplayAttr, ""); | 95 m_mediaElement->setAttribute(autoplayAttr, ""); |
88 | 96 |
89 m_mediaElement->setAttribute(nameAttr, "media"); | 97 m_mediaElement->setAttribute(nameAttr, "media"); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 if (video->canPlay()) | 164 if (video->canPlay()) |
157 video->play(); | 165 video->play(); |
158 } else | 166 } else |
159 video->pause(); | 167 video->pause(); |
160 event->setDefaultHandled(); | 168 event->setDefaultHandled(); |
161 } | 169 } |
162 } | 170 } |
163 } | 171 } |
164 | 172 |
165 } | 173 } |
OLD | NEW |