|
Lines 30-40
a/Source/WebCore/svg/graphics/SVGImage.cpp_sec1
|
| 30 |
#if ENABLE(SVG) |
30 |
#if ENABLE(SVG) |
| 31 |
#include "SVGImage.h" |
31 |
#include "SVGImage.h" |
| 32 |
|
32 |
|
|
|
33 |
#include "Chrome.h" |
| 33 |
#include "DocumentLoader.h" |
34 |
#include "DocumentLoader.h" |
| 34 |
#include "FrameView.h" |
35 |
#include "FrameView.h" |
| 35 |
#include "ImageBuffer.h" |
36 |
#include "ImageBuffer.h" |
| 36 |
#include "ImageObserver.h" |
37 |
#include "ImageObserver.h" |
| 37 |
#include "IntRect.h" |
38 |
#include "IntRect.h" |
|
|
39 |
#include "NodeTraversal.h" |
| 38 |
#include "RenderSVGRoot.h" |
40 |
#include "RenderSVGRoot.h" |
| 39 |
#include "RenderStyle.h" |
41 |
#include "RenderStyle.h" |
| 40 |
#include "SVGDocument.h" |
42 |
#include "SVGDocument.h" |
|
Lines 61-66
SVGImage::~SVGImage()
a/Source/WebCore/svg/graphics/SVGImage.cpp_sec2
|
| 61 |
ASSERT(!m_chromeClient || !m_chromeClient->image()); |
63 |
ASSERT(!m_chromeClient || !m_chromeClient->image()); |
| 62 |
} |
64 |
} |
| 63 |
|
65 |
|
|
|
66 |
bool SVGImage::hasSingleSecurityOrigin() const |
| 67 |
{ |
| 68 |
if (!m_page) |
| 69 |
return true; |
| 70 |
|
| 71 |
Frame* frame = m_page->mainFrame(); |
| 72 |
SVGSVGElement* rootElement = toSVGDocument(frame->document())->rootElement(); |
| 73 |
if (!rootElement) |
| 74 |
return true; |
| 75 |
|
| 76 |
// Don't allow foreignObject elements since they can leak information with arbitrary HTML (like spellcheck or control theme). |
| 77 |
for (Element* current = ElementTraversal::firstWithin(rootElement); current; current = ElementTraversal::next(current, rootElement)) { |
| 78 |
if (current->hasTagName(SVGNames::foreignObjectTag)) |
| 79 |
return false; |
| 80 |
} |
| 81 |
|
| 82 |
// Because SVG image rendering disallows external resources and links, |
| 83 |
// these images effectively are restricted to a single security origin. |
| 84 |
return true; |
| 85 |
} |
| 86 |
|
| 64 |
void SVGImage::setContainerSize(const IntSize& size) |
87 |
void SVGImage::setContainerSize(const IntSize& size) |
| 65 |
{ |
88 |
{ |
| 66 |
if (!m_page || !usesContainerSize()) |
89 |
if (!m_page || !usesContainerSize()) |
|
Lines 371-376
String SVGImage::filenameExtension() const
a/Source/WebCore/svg/graphics/SVGImage.cpp_sec3
|
| 371 |
return "svg"; |
394 |
return "svg"; |
| 372 |
} |
395 |
} |
| 373 |
|
396 |
|
|
|
397 |
bool isInSVGImage(const Element* element) |
| 398 |
{ |
| 399 |
ASSERT(element); |
| 400 |
|
| 401 |
Page* page = element->document()->page(); |
| 402 |
if (!page) |
| 403 |
return false; |
| 404 |
|
| 405 |
ChromeClient* chromeClient = page->chrome().client(); |
| 406 |
return chromeClient && chromeClient->isSVGImageChromeClient(); |
| 407 |
} |
| 408 |
|
| 374 |
} |
409 |
} |
| 375 |
|
410 |
|
| 376 |
#endif // ENABLE(SVG) |
411 |
#endif // ENABLE(SVG) |