mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 736031 - getBBox returns incorrect results with empty containers. r=jwatt
This commit is contained in:
parent
fcdd24818f
commit
9c2b5601f7
@ -14,4 +14,9 @@
|
||||
<circle cx="200" cy="50" r="5"/>
|
||||
<path d="M 200,100 L 300,100"/>
|
||||
</g>
|
||||
<g id="e">
|
||||
<!-- empty container should not affect parent's bbox -->
|
||||
<g/>
|
||||
<circle cx="100" cy="100" r="5"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 474 B After Width: | Height: | Size: 602 B |
@ -44,6 +44,7 @@ function run()
|
||||
checkBBoxHeight("a", "y");
|
||||
checkBBox("v", 95, 45, 10, 155);
|
||||
checkBBox("h", 195, 45, 105, 55);
|
||||
checkBBox("e", 95, 95, 10, 10);
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
@ -263,7 +263,7 @@ nsSVGDisplayContainerFrame::GetBBoxContribution(
|
||||
if (svgKid) {
|
||||
gfxMatrix transform = aToBBoxUserspace;
|
||||
nsIContent *content = kid->GetContent();
|
||||
if (content->IsSVG() && !content->IsNodeOfType(nsINode::eTEXT)) {
|
||||
if (content->IsSVG()) {
|
||||
transform = static_cast<nsSVGElement*>(content)->
|
||||
PrependLocalTransformsTo(aToBBoxUserspace);
|
||||
}
|
||||
@ -271,7 +271,7 @@ nsSVGDisplayContainerFrame::GetBBoxContribution(
|
||||
// to use UnionEdges, but we must special case the first bbox so that we don't
|
||||
// include the initial gfxRect(0,0,0,0).
|
||||
gfxRect childBBox = svgKid->GetBBoxContribution(transform, aFlags);
|
||||
if (firstChild) {
|
||||
if (firstChild && (childBBox.Width() > 0 || childBBox.Height() > 0)) {
|
||||
bboxUnion = childBBox;
|
||||
firstChild = false;
|
||||
continue;
|
||||
|
@ -226,7 +226,7 @@ nsSVGMarkerFrame::GetMarkBBoxContribution(const gfxMatrix &aToBBoxUserspace,
|
||||
// to use UnionEdges, but we must special case the first bbox so that we don't
|
||||
// include the initial gfxRect(0,0,0,0).
|
||||
gfxRect childBBox = child->GetBBoxContribution(tm, aFlags);
|
||||
if (firstChild) {
|
||||
if (firstChild && (childBBox.Width() > 0 || childBBox.Height() > 0)) {
|
||||
bbox = childBBox;
|
||||
firstChild = false;
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user