Bug 703241. Part 3: nsLayoutUtils::GetTransformToAncestor should handle the case where aAncestor == aFrame. r=matspal

This commit is contained in:
Robert O'Callahan 2012-10-17 16:13:24 +13:00
parent 7ce96b9824
commit c899cd7b0c
2 changed files with 7 additions and 1 deletions

View File

@ -1302,7 +1302,11 @@ gfx3DMatrix
nsLayoutUtils::GetTransformToAncestor(nsIFrame *aFrame, const nsIFrame *aAncestor)
{
nsIFrame* parent;
gfx3DMatrix ctm = aFrame->GetTransformMatrix(aAncestor, &parent);
gfx3DMatrix ctm;
if (aFrame == aAncestor) {
return ctm;
}
ctm = aFrame->GetTransformMatrix(aAncestor, &parent);
while (parent && parent != aAncestor) {
if (!parent->Preserves3DChildren()) {
ctm.ProjectTo2D();

View File

@ -35,7 +35,9 @@ t.scrollTop = 0;
var targetY = target.getBoundingClientRect().top;
SimpleTest.waitForFocus(function() {
is(target.getBoundingClientRect().top, targetY, "Target should not have scrolled due to waitForFocus");
t.focus();
is(target.getBoundingClientRect().top, targetY, "Target should not have scrolled due to focus change");
// Move the caret to scroll it into view
sel.collapse(target.firstChild, 2);