| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 // FIXME: Assert we have a loader to figure out why the original null checks | 74 // FIXME: Assert we have a loader to figure out why the original null checks |
| 75 // and assert were added for the security bug in http://trac.webkit.org/chan
geset/87566 | 75 // and assert were added for the security bug in http://trac.webkit.org/chan
geset/87566 |
| 76 ASSERT(document()); | 76 ASSERT(document()); |
| 77 RELEASE_ASSERT(document()->loader()); | 77 RELEASE_ASSERT(document()->loader()); |
| 78 | 78 |
| 79 Frame* frame = document()->frame(); | 79 Frame* frame = document()->frame(); |
| 80 if (!frame) | 80 if (!frame) |
| 81 return; | 81 return; |
| 82 | 82 |
| 83 // FIXME: Why does this check settings? | 83 // FIXME: Why does this check settings? |
| 84 if (!frame->settings() || !frame->loader()->allowPlugins(NotAboutToInstantia
tePlugin)) | 84 if (!frame->settings() || !frame->loader().allowPlugins(NotAboutToInstantiat
ePlugin)) |
| 85 return; | 85 return; |
| 86 | 86 |
| 87 RefPtr<HTMLHtmlElement> rootElement = HTMLHtmlElement::create(*document()); | 87 RefPtr<HTMLHtmlElement> rootElement = HTMLHtmlElement::create(*document()); |
| 88 rootElement->insertedByParser(); | 88 rootElement->insertedByParser(); |
| 89 document()->appendChild(rootElement); | 89 document()->appendChild(rootElement); |
| 90 frame->loader()->dispatchDocumentElementAvailable(); | 90 frame->loader().dispatchDocumentElementAvailable(); |
| 91 | 91 |
| 92 RefPtr<HTMLBodyElement> body = HTMLBodyElement::create(*document()); | 92 RefPtr<HTMLBodyElement> body = HTMLBodyElement::create(*document()); |
| 93 body->setAttribute(marginwidthAttr, "0"); | 93 body->setAttribute(marginwidthAttr, "0"); |
| 94 body->setAttribute(marginheightAttr, "0"); | 94 body->setAttribute(marginheightAttr, "0"); |
| 95 body->setAttribute(styleAttr, "background-color: rgb(38,38,38)"); | 95 body->setAttribute(styleAttr, "background-color: rgb(38,38,38)"); |
| 96 rootElement->appendChild(body); | 96 rootElement->appendChild(body); |
| 97 | 97 |
| 98 m_embedElement = HTMLEmbedElement::create(*document()); | 98 m_embedElement = HTMLEmbedElement::create(*document()); |
| 99 m_embedElement->setAttribute(widthAttr, "100%"); | 99 m_embedElement->setAttribute(widthAttr, "100%"); |
| 100 m_embedElement->setAttribute(heightAttr, "100%"); | 100 m_embedElement->setAttribute(heightAttr, "100%"); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 HTMLDocument::detach(context); | 184 HTMLDocument::detach(context); |
| 185 } | 185 } |
| 186 | 186 |
| 187 void PluginDocument::cancelManualPluginLoad() | 187 void PluginDocument::cancelManualPluginLoad() |
| 188 { | 188 { |
| 189 // PluginDocument::cancelManualPluginLoad should only be called once, but th
ere are issues | 189 // PluginDocument::cancelManualPluginLoad should only be called once, but th
ere are issues |
| 190 // with how many times we call beforeload on object elements. <rdar://proble
m/8441094>. | 190 // with how many times we call beforeload on object elements. <rdar://proble
m/8441094>. |
| 191 if (!shouldLoadPluginManually()) | 191 if (!shouldLoadPluginManually()) |
| 192 return; | 192 return; |
| 193 | 193 |
| 194 DocumentLoader* documentLoader = frame()->loader()->activeDocumentLoader(); | 194 DocumentLoader* documentLoader = frame()->loader().activeDocumentLoader(); |
| 195 documentLoader->cancelMainResourceLoad(ResourceError::cancelledError(documen
tLoader->request().url())); | 195 documentLoader->cancelMainResourceLoad(ResourceError::cancelledError(documen
tLoader->request().url())); |
| 196 setShouldLoadPluginManually(false); | 196 setShouldLoadPluginManually(false); |
| 197 } | 197 } |
| 198 | 198 |
| 199 } | 199 } |
| OLD | NEW |