зеркало из https://github.com/mozilla/gecko-dev.git
Bug 974347 - Improve bounds handling of non-rendered elements. r=jwatt
This commit is contained in:
Родитель
b430dec40e
Коммит
a8faa214d5
|
@ -60,6 +60,15 @@ nsSVGPolyElement::IsAttributeMapped(const nsIAtom* name) const
|
|||
nsSVGPolyElementBase::IsAttributeMapped(name);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsSVGElement methods
|
||||
|
||||
/* virtual */ bool
|
||||
nsSVGPolyElement::HasValidDimensions() const
|
||||
{
|
||||
return !mPoints.GetAnimValue().IsEmpty();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsSVGPathGeometryElement methods
|
||||
|
||||
|
|
|
@ -38,6 +38,9 @@ public:
|
|||
return nsGkAtoms::points;
|
||||
}
|
||||
|
||||
// nsSVGElement methods:
|
||||
virtual bool HasValidDimensions() const MOZ_OVERRIDE;
|
||||
|
||||
// nsSVGPathGeometryElement methods:
|
||||
virtual bool AttributeDefinesGeometry(const nsIAtom *aName) MOZ_OVERRIDE;
|
||||
virtual bool IsMarkable() MOZ_OVERRIDE { return true; }
|
||||
|
|
|
@ -21,7 +21,11 @@
|
|||
<g id="e">
|
||||
<!-- empty container should not affect parent's bbox -->
|
||||
<g/>
|
||||
<!-- nor should an empty text element -->
|
||||
<!-- neither should a path, -->
|
||||
<path/>
|
||||
<!-- a polygon -->
|
||||
<polygon/>
|
||||
<!-- or an empty text element -->
|
||||
<text x="185" y="25"/>
|
||||
<circle cx="100" cy="100" r="5"/>
|
||||
<g/>
|
||||
|
|
До Ширина: | Высота: | Размер: 855 B После Ширина: | Высота: | Размер: 933 B |
|
@ -146,6 +146,7 @@ nsSVGDisplayContainerFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
const nsRect& aDirtyRect,
|
||||
const nsDisplayListSet& aLists)
|
||||
{
|
||||
// mContent could be a XUL element so check for an SVG element before casting
|
||||
if (mContent->IsSVG() &&
|
||||
!static_cast<const nsSVGElement*>(mContent)->HasValidDimensions()) {
|
||||
return;
|
||||
|
@ -233,6 +234,7 @@ nsSVGDisplayContainerFrame::IsSVGTransformed(gfx::Matrix *aOwnTransform,
|
|||
HasChildrenOnlyTransform(aFromParentTransform);
|
||||
}
|
||||
|
||||
// mContent could be a XUL element so check for an SVG element before casting
|
||||
if (mContent->IsSVG()) {
|
||||
nsSVGElement *content = static_cast<nsSVGElement*>(mContent);
|
||||
nsSVGAnimatedTransformList* transformList =
|
||||
|
@ -399,10 +401,13 @@ nsSVGDisplayContainerFrame::GetBBoxContribution(
|
|||
|
||||
nsIFrame* kid = mFrames.FirstChild();
|
||||
while (kid) {
|
||||
nsIContent *content = kid->GetContent();
|
||||
nsISVGChildFrame* svgKid = do_QueryFrame(kid);
|
||||
if (svgKid) {
|
||||
// content could be a XUL element so check for an SVG element before casting
|
||||
if (svgKid && (!content->IsSVG() ||
|
||||
static_cast<const nsSVGElement*>(content)->HasValidDimensions())) {
|
||||
|
||||
gfxMatrix transform = gfx::ThebesMatrix(aToBBoxUserspace);
|
||||
nsIContent *content = kid->GetContent();
|
||||
if (content->IsSVG()) {
|
||||
transform = static_cast<nsSVGElement*>(content)->
|
||||
PrependLocalTransformsTo(transform);
|
||||
|
|
Загрузка…
Ссылка в новой задаче