зеркало из https://github.com/mozilla/gecko-dev.git
Bug 341695. Never look at the mRect coordinates of SVG foreignobject frames, SVG uses them for other things. r+sr=tor
This commit is contained in:
Родитель
462cb1e027
Коммит
9c2da8d1b9
|
@ -7855,6 +7855,9 @@ nsCSSFrameConstructor::ConstructSVGFrame(nsFrameConstructorState& aState,
|
|||
rv = ConstructBlock(aState, disp, aContent,
|
||||
newFrame, newFrame, innerPseudoStyle,
|
||||
&blockFrame, childItems, PR_TRUE);
|
||||
// Give the blockFrame a view so that GetOffsetTo works for descendants
|
||||
// of blockFrame with views...
|
||||
nsHTMLContainerFrame::CreateViewForFrame(blockFrame, nsnull, PR_TRUE);
|
||||
} else
|
||||
#endif // MOZ_SVG_FOREIGNOBJECT
|
||||
{
|
||||
|
|
|
@ -503,12 +503,12 @@ nsLayoutUtils::GetEventCoordinatesRelativeTo(nsEvent* aEvent, nsIFrame* aFrame)
|
|||
nsIFrame* rootFrame = aFrame;
|
||||
for (nsIFrame* f = aFrame; f; f = GetCrossDocParentFrame(f)) {
|
||||
#ifdef MOZ_SVG_FOREIGNOBJECT
|
||||
if (f->IsFrameOfType(nsIFrame::eSVGForeignObject)) {
|
||||
if (f->IsFrameOfType(nsIFrame::eSVGForeignObject) && f->GetFirstChild(nsnull)) {
|
||||
nsSVGForeignObjectFrame* fo = NS_STATIC_CAST(nsSVGForeignObjectFrame*, f);
|
||||
nsIFrame* outer = nsSVGUtils::GetOuterSVGFrame(fo);
|
||||
return fo->TransformPointFromOuter(
|
||||
GetEventCoordinatesRelativeTo(aEvent, outer)) -
|
||||
aFrame->GetOffsetTo(fo);
|
||||
aFrame->GetOffsetTo(fo->GetFirstChild(nsnull));
|
||||
}
|
||||
#endif
|
||||
rootFrame = f;
|
||||
|
|
|
@ -255,11 +255,16 @@ nsSVGForeignObjectFrame::TransformPointFromOuterPx(float aX, float aY, nsPoint*
|
|||
NS_IMETHODIMP
|
||||
nsSVGForeignObjectFrame::GetFrameForPointSVG(float x, float y, nsIFrame** hit)
|
||||
{
|
||||
nsIFrame* kid = GetFirstChild(nsnull);
|
||||
if (!kid) {
|
||||
*hit = nsnull;
|
||||
return NS_OK;
|
||||
}
|
||||
nsPoint pt;
|
||||
nsresult rv = TransformPointFromOuterPx(x, y, &pt);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
*hit = nsLayoutUtils::GetFrameForPoint(this, pt);
|
||||
*hit = nsLayoutUtils::GetFrameForPoint(kid, pt);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче