OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 m_embedElement->setAttribute(nameAttr, "plugin"); | 110 m_embedElement->setAttribute(nameAttr, "plugin"); |
111 m_embedElement->setAttribute(idAttr, "plugin"); | 111 m_embedElement->setAttribute(idAttr, "plugin"); |
112 m_embedElement->setAttribute(srcAttr, AtomicString(document()->url().getStri
ng())); | 112 m_embedElement->setAttribute(srcAttr, AtomicString(document()->url().getStri
ng())); |
113 m_embedElement->setAttribute(typeAttr, document()->loader()->mimeType()); | 113 m_embedElement->setAttribute(typeAttr, document()->loader()->mimeType()); |
114 body->appendChild(m_embedElement); | 114 body->appendChild(m_embedElement); |
115 if (isStopped()) | 115 if (isStopped()) |
116 return; // Possibly detached by a mutation event listener installed in r
unScriptsAtDocumentElementAvailable. | 116 return; // Possibly detached by a mutation event listener installed in r
unScriptsAtDocumentElementAvailable. |
117 | 117 |
118 toPluginDocument(document())->setPluginNode(m_embedElement.get()); | 118 toPluginDocument(document())->setPluginNode(m_embedElement.get()); |
119 | 119 |
120 document()->updateLayout(); | 120 document()->updateStyleAndLayout(); |
121 | 121 |
122 // We need the plugin to load synchronously so we can get the PluginView | 122 // We need the plugin to load synchronously so we can get the PluginView |
123 // below so flush the layout tasks now instead of waiting on the timer. | 123 // below so flush the layout tasks now instead of waiting on the timer. |
124 frame->view()->flushAnyPendingPostLayoutTasks(); | 124 frame->view()->flushAnyPendingPostLayoutTasks(); |
125 // Focus the plugin here, as the line above is where the plugin is created. | 125 // Focus the plugin here, as the line above is where the plugin is created. |
126 if (frame->isMainFrame()) { | 126 if (frame->isMainFrame()) { |
127 m_embedElement->focus(); | 127 m_embedElement->focus(); |
128 if (isStopped()) | 128 if (isStopped()) |
129 return; // Possibly detached by a focus event listener installed in
runScriptsAtDocumentElementAvailable. | 129 return; // Possibly detached by a focus event listener installed in
runScriptsAtDocumentElementAvailable. |
130 } | 130 } |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 HTMLDocument::detach(context); | 198 HTMLDocument::detach(context); |
199 } | 199 } |
200 | 200 |
201 DEFINE_TRACE(PluginDocument) | 201 DEFINE_TRACE(PluginDocument) |
202 { | 202 { |
203 visitor->trace(m_pluginNode); | 203 visitor->trace(m_pluginNode); |
204 HTMLDocument::trace(visitor); | 204 HTMLDocument::trace(visitor); |
205 } | 205 } |
206 | 206 |
207 } // namespace blink | 207 } // namespace blink |
OLD | NEW |