OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Eric Seidel <eric@webkit.org> | 2 * Copyright (C) 2006 Eric Seidel <eric@webkit.org> |
3 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. | 3 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. |
4 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 4 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 | 76 |
77 return page->chrome().client().isSVGImageChromeClient(); | 77 return page->chrome().client().isSVGImageChromeClient(); |
78 } | 78 } |
79 | 79 |
80 bool SVGImage::hasSingleSecurityOrigin() const | 80 bool SVGImage::hasSingleSecurityOrigin() const |
81 { | 81 { |
82 if (!m_page) | 82 if (!m_page) |
83 return true; | 83 return true; |
84 | 84 |
85 Frame* frame = m_page->mainFrame(); | 85 Frame* frame = m_page->mainFrame(); |
| 86 |
| 87 RELEASE_ASSERT(frame->document()->loadEventFinished()); |
| 88 |
86 SVGSVGElement* rootElement = toSVGDocument(frame->document())->rootElement()
; | 89 SVGSVGElement* rootElement = toSVGDocument(frame->document())->rootElement()
; |
87 if (!rootElement) | 90 if (!rootElement) |
88 return true; | 91 return true; |
89 | 92 |
90 // Don't allow foreignObject elements or images that are not known to be | 93 // Don't allow foreignObject elements or images that are not known to be |
91 // single-origin since these can leak cross-origin information. | 94 // single-origin since these can leak cross-origin information. |
92 ComposedShadowTreeWalker walker(rootElement); | 95 ComposedShadowTreeWalker walker(rootElement); |
93 while (Node* node = walker.get()) { | 96 while (Node* node = walker.get()) { |
94 if (node->hasTagName(SVGNames::foreignObjectTag)) | 97 if (node->hasTagName(SVGNames::foreignObjectTag)) |
95 return false; | 98 return false; |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 return m_page; | 413 return m_page; |
411 } | 414 } |
412 | 415 |
413 String SVGImage::filenameExtension() const | 416 String SVGImage::filenameExtension() const |
414 { | 417 { |
415 return "svg"; | 418 return "svg"; |
416 } | 419 } |
417 | 420 |
418 } | 421 } |
419 | 422 |
OLD | NEW |