| 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 } | 119 } |
| 120 } | 120 } |
| 121 | 121 |
| 122 bool m_clicked; | 122 bool m_clicked; |
| 123 }; | 123 }; |
| 124 | 124 |
| 125 void MediaDocumentParser::createDocumentStructure() | 125 void MediaDocumentParser::createDocumentStructure() |
| 126 { | 126 { |
| 127 ASSERT(document()); | 127 ASSERT(document()); |
| 128 HTMLHtmlElement* rootElement = HTMLHtmlElement::create(*document()); | 128 HTMLHtmlElement* rootElement = HTMLHtmlElement::create(*document()); |
| 129 document()->appendChild(rootElement); |
| 129 rootElement->insertedByParser(); | 130 rootElement->insertedByParser(); |
| 130 document()->appendChild(rootElement); | |
| 131 | 131 |
| 132 document()->frame()->loader().dispatchDocumentElementAvailable(); | |
| 133 document()->frame()->loader().runScriptsAtDocumentElementAvailable(); | |
| 134 if (isDetached()) | 132 if (isDetached()) |
| 135 return; // runScriptsAtDocumentElementAvailable can detach the frame. | 133 return; // runScriptsAtDocumentElementAvailable can detach the frame. |
| 136 | 134 |
| 137 HTMLHeadElement* head = HTMLHeadElement::create(*document()); | 135 HTMLHeadElement* head = HTMLHeadElement::create(*document()); |
| 138 HTMLMetaElement* meta = HTMLMetaElement::create(*document()); | 136 HTMLMetaElement* meta = HTMLMetaElement::create(*document()); |
| 139 meta->setAttribute(nameAttr, "viewport"); | 137 meta->setAttribute(nameAttr, "viewport"); |
| 140 meta->setAttribute(contentAttr, "width=device-width"); | 138 meta->setAttribute(contentAttr, "width=device-width"); |
| 141 head->appendChild(meta); | 139 head->appendChild(meta); |
| 142 | 140 |
| 143 HTMLVideoElement* media = HTMLVideoElement::create(*document()); | 141 HTMLVideoElement* media = HTMLVideoElement::create(*document()); |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 KeyboardEvent* keyboardEvent = toKeyboardEvent(event); | 256 KeyboardEvent* keyboardEvent = toKeyboardEvent(event); |
| 259 if (keyboardEvent->keyIdentifier() == "U+0020" || keyboardEvent->keyCode
() == VKEY_MEDIA_PLAY_PAUSE) { | 257 if (keyboardEvent->keyIdentifier() == "U+0020" || keyboardEvent->keyCode
() == VKEY_MEDIA_PLAY_PAUSE) { |
| 260 // space or media key (play/pause) | 258 // space or media key (play/pause) |
| 261 video->togglePlayState(); | 259 video->togglePlayState(); |
| 262 event->setDefaultHandled(); | 260 event->setDefaultHandled(); |
| 263 } | 261 } |
| 264 } | 262 } |
| 265 } | 263 } |
| 266 | 264 |
| 267 } // namespace blink | 265 } // namespace blink |
| OLD | NEW |