| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 RefPtr<HTMLHtmlElement> rootElement = HTMLHtmlElement::create(document()); | 75 RefPtr<HTMLHtmlElement> rootElement = HTMLHtmlElement::create(document()); |
| 76 rootElement->insertedByParser(); | 76 rootElement->insertedByParser(); |
| 77 | 77 |
| 78 if (document()->frame()) | 78 if (document()->frame()) |
| 79 document()->frame()->loader()->dispatchDocumentElementAvailable(); | 79 document()->frame()->loader()->dispatchDocumentElementAvailable(); |
| 80 | 80 |
| 81 RefPtr<HTMLHeadElement> head = HTMLHeadElement::create(document()); | 81 RefPtr<HTMLHeadElement> head = HTMLHeadElement::create(document()); |
| 82 RefPtr<HTMLMetaElement> meta = HTMLMetaElement::create(document()); | 82 RefPtr<HTMLMetaElement> meta = HTMLMetaElement::create(document()); |
| 83 meta->setAttribute(nameAttr, "viewport"); | 83 meta->setAttribute(nameAttr, "viewport"); |
| 84 meta->setAttribute(contentAttr, "width=device-width"); | 84 meta->setAttribute(contentAttr, "width=device-width"); |
| 85 head->appendChild(meta.release(), ASSERT_NO_EXCEPTION_STATE); | 85 head->appendChild(meta.release(), ASSERT_NO_EXCEPTION); |
| 86 | 86 |
| 87 RefPtr<HTMLVideoElement> media = HTMLVideoElement::create(document()); | 87 RefPtr<HTMLVideoElement> media = HTMLVideoElement::create(document()); |
| 88 media->setAttribute(controlsAttr, ""); | 88 media->setAttribute(controlsAttr, ""); |
| 89 media->setAttribute(autoplayAttr, ""); | 89 media->setAttribute(autoplayAttr, ""); |
| 90 media->setAttribute(nameAttr, "media"); | 90 media->setAttribute(nameAttr, "media"); |
| 91 | 91 |
| 92 RefPtr<HTMLSourceElement> source = HTMLSourceElement::create(document()); | 92 RefPtr<HTMLSourceElement> source = HTMLSourceElement::create(document()); |
| 93 source->setSrc(document()->url()); | 93 source->setSrc(document()->url()); |
| 94 | 94 |
| 95 if (DocumentLoader* loader = document()->loader()) | 95 if (DocumentLoader* loader = document()->loader()) |
| 96 source->setType(loader->responseMIMEType()); | 96 source->setType(loader->responseMIMEType()); |
| 97 | 97 |
| 98 media->appendChild(source.release(), ASSERT_NO_EXCEPTION_STATE); | 98 media->appendChild(source.release(), ASSERT_NO_EXCEPTION); |
| 99 | 99 |
| 100 RefPtr<HTMLBodyElement> body = HTMLBodyElement::create(document()); | 100 RefPtr<HTMLBodyElement> body = HTMLBodyElement::create(document()); |
| 101 body->appendChild(media.release(), ASSERT_NO_EXCEPTION_STATE); | 101 body->appendChild(media.release(), ASSERT_NO_EXCEPTION); |
| 102 | 102 |
| 103 rootElement->appendChild(head.release(), ASSERT_NO_EXCEPTION_STATE); | 103 rootElement->appendChild(head.release(), ASSERT_NO_EXCEPTION); |
| 104 rootElement->appendChild(body.release(), ASSERT_NO_EXCEPTION_STATE); | 104 rootElement->appendChild(body.release(), ASSERT_NO_EXCEPTION); |
| 105 | 105 |
| 106 document()->appendChild(rootElement.release(), ASSERT_NO_EXCEPTION_STATE, At
tachLazily); | 106 document()->appendChild(rootElement.release(), ASSERT_NO_EXCEPTION, AttachLa
zily); |
| 107 m_didBuildDocumentStructure = true; | 107 m_didBuildDocumentStructure = true; |
| 108 } | 108 } |
| 109 | 109 |
| 110 size_t MediaDocumentParser::appendBytes(const char*, size_t) | 110 size_t MediaDocumentParser::appendBytes(const char*, size_t) |
| 111 { | 111 { |
| 112 if (m_didBuildDocumentStructure) | 112 if (m_didBuildDocumentStructure) |
| 113 return 0; | 113 return 0; |
| 114 | 114 |
| 115 createDocumentStructure(); | 115 createDocumentStructure(); |
| 116 finish(); | 116 finish(); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 if (video->canPlay()) | 159 if (video->canPlay()) |
| 160 video->play(); | 160 video->play(); |
| 161 } else | 161 } else |
| 162 video->pause(); | 162 video->pause(); |
| 163 event->setDefaultHandled(); | 163 event->setDefaultHandled(); |
| 164 } | 164 } |
| 165 } | 165 } |
| 166 } | 166 } |
| 167 | 167 |
| 168 } | 168 } |
| OLD | NEW |