Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(229)

Side by Side Diff: Source/core/rendering/svg/RenderSVGForeignObject.cpp

Issue 133873003: Convert SVG <foreignObject> to use RenderObject::isChildAllowed (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Reupload. Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 Apple Computer, Inc. 2 * Copyright (C) 2006 Apple Computer, Inc.
3 * Copyright (C) 2009 Google, Inc. 3 * Copyright (C) 2009 Google, Inc.
4 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 4 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 27 matching lines...) Expand all
38 RenderSVGForeignObject::RenderSVGForeignObject(SVGForeignObjectElement* node) 38 RenderSVGForeignObject::RenderSVGForeignObject(SVGForeignObjectElement* node)
39 : RenderSVGBlock(node) 39 : RenderSVGBlock(node)
40 , m_needsTransformUpdate(true) 40 , m_needsTransformUpdate(true)
41 { 41 {
42 } 42 }
43 43
44 RenderSVGForeignObject::~RenderSVGForeignObject() 44 RenderSVGForeignObject::~RenderSVGForeignObject()
45 { 45 {
46 } 46 }
47 47
48 bool RenderSVGForeignObject::isChildAllowed(RenderObject* child, RenderStyle* st yle) const
49 {
50 // Disallow arbitary SVG content. Only allow proper <svg xmlns="svgNS"> subd ocuments.
51 return !child->isSVG() || child->isSVGRoot();
52 }
53
48 void RenderSVGForeignObject::paint(PaintInfo& paintInfo, const LayoutPoint&) 54 void RenderSVGForeignObject::paint(PaintInfo& paintInfo, const LayoutPoint&)
49 { 55 {
50 if (paintInfo.context->paintingDisabled() 56 if (paintInfo.context->paintingDisabled()
51 || (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintP haseSelection)) 57 || (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintP haseSelection))
52 return; 58 return;
53 59
54 PaintInfo childPaintInfo(paintInfo); 60 PaintInfo childPaintInfo(paintInfo);
55 GraphicsContextStateSaver stateSaver(*childPaintInfo.context); 61 GraphicsContextStateSaver stateSaver(*childPaintInfo.context);
56 childPaintInfo.applyTransform(localTransform()); 62 childPaintInfo.applyTransform(localTransform());
57 63
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 return false; 174 return false;
169 175
170 // FOs establish a stacking context, so we need to hit-test all layers. 176 // FOs establish a stacking context, so we need to hit-test all layers.
171 HitTestLocation hitTestLocation(roundedLayoutPoint(localPoint)); 177 HitTestLocation hitTestLocation(roundedLayoutPoint(localPoint));
172 return RenderBlock::nodeAtPoint(request, result, hitTestLocation, LayoutPoin t(), HitTestForeground) 178 return RenderBlock::nodeAtPoint(request, result, hitTestLocation, LayoutPoin t(), HitTestForeground)
173 || RenderBlock::nodeAtPoint(request, result, hitTestLocation, LayoutPoin t(), HitTestFloat) 179 || RenderBlock::nodeAtPoint(request, result, hitTestLocation, LayoutPoin t(), HitTestFloat)
174 || RenderBlock::nodeAtPoint(request, result, hitTestLocation, LayoutPoin t(), HitTestChildBlockBackgrounds); 180 || RenderBlock::nodeAtPoint(request, result, hitTestLocation, LayoutPoin t(), HitTestChildBlockBackgrounds);
175 } 181 }
176 182
177 } 183 }
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/RenderSVGForeignObject.h ('k') | Source/core/svg/SVGForeignObjectElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698