Bug 858803. Fix coordinate system of subdocument frame bounds. r=mattwoodrow

--HG--
extra : rebase_source : 3fd0436f141542dcf50f318a47670329c9c7a814
This commit is contained in:
Robert O'Callahan 2013-04-10 00:30:51 +12:00
parent e21f85a30b
commit a7bc9f4f3c
4 changed files with 18 additions and 5 deletions

View File

@ -415,12 +415,10 @@ nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// it need to have underlying frames from the subdocument. So we need to
// calculate the bounds based on which frame will be the underlying frame
// for the canvas background color item.
nsRect bounds;
nsRect subdocBoundsInParentUnits = GetContentRectRelativeToSelf();
nsRect bounds = GetContentRectRelativeToSelf() +
aBuilder->ToReferenceFrame(this);
if (subdocRootFrame) {
bounds = subdocBoundsInParentUnits.ConvertAppUnitsRoundOut(parentAPD, subdocAPD);
} else {
bounds = subdocBoundsInParentUnits;
bounds = bounds.ConvertAppUnitsRoundOut(parentAPD, subdocAPD);
}
// If we are in print preview/page layout we want to paint the grey

View File

@ -0,0 +1,6 @@
<!DOCTYPE HTML>
<html>
<body>
<div style="position:absolute; left:100px; top:100px; width:300px; height:300px; border:1px solid black; background:yellow"></div>
</body>
</html>

View File

@ -0,0 +1,8 @@
<!DOCTYPE HTML>
<html>
<body>
<iframe src="data:application/vnd.mozilla.xul+xml,<?xml version='1.0' encoding='UTF-8'?><window xmlns='http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul' style='background:yellow'></window>"
style="position:absolute; left:100px; top:100px; width:300px; height:300px; border:1px solid black;">
</iframe>
</body>
</html>

View File

@ -1753,3 +1753,4 @@ skip-if(B2G) == 818276-1.html 818276-1-ref.html
== 847850-1.html 847850-1-ref.html
== 848421-1.html 848421-1-ref.html
test-pref(layout.css.flexbox.enabled,true) == 849407-1.html 849407-1-ref.html
== 858803-1.html 858803-1-ref.html