Bug 720987 - Don't use the existing overflow areas when calculating the new overflow areas after a style change. r=roc

This commit is contained in:
Mats Palmgren 2012-01-28 04:35:58 +01:00
parent 9ba0fda8fc
commit 37be13d7c9
4 changed files with 36 additions and 15 deletions

View File

@ -8021,21 +8021,7 @@ nsCSSFrameConstructor::ProcessRestyledFrames(nsStyleChangeList& aChangeList)
}
if (hint & nsChangeHint_UpdateOverflow) {
while (frame) {
nsOverflowAreas overflowAreas;
nsOverflowAreas* pre = static_cast<nsOverflowAreas*>
(frame->Properties().Get(frame->PreTransformOverflowAreasProperty()));
if (pre) {
// FinishAndStoreOverflow will change the overflow areas passed in,
// so make a copy.
overflowAreas = *pre;
} else {
// There is no transform yet on this frame, so we can just use its
// current overflow areas.
overflowAreas = frame->GetOverflowAreas();
}
frame->FinishAndStoreOverflow(overflowAreas, frame->GetSize());
frame->UpdateOverflow();
nsIFrame* next =
nsLayoutUtils::GetNextContinuationOrSpecialSibling(frame);
// Update the ancestors' overflow after we have updated the overflow

View File

@ -0,0 +1,5 @@
<!DOCTYPE html>
<html><body style="padding:100px;">
<a href="foo" style="outline:1px solid black">a</a>
</body>
</html>

View File

@ -0,0 +1,29 @@
<!DOCTYPE html>
<html class="reftest-wait"><head>
<script>
function doTest() {
var e = document.getElementById('a');
e.style.outline = "1px solid black"; document.body.getClientRects();
e.style.outline = ""; document.body.getClientRects();
e.style.outline = "1px solid black"; document.body.getClientRects();
e.style.outline = ""; document.body.getClientRects();
e.style.outline = "1px solid black"; document.body.getClientRects();
e.style.outline = ""; document.body.getClientRects();
e.style.outline = "1px solid black"; document.body.getClientRects();
e.style.outline = ""; document.body.getClientRects();
e.style.outline = "1px solid black"; document.body.getClientRects();
e.style.outline = ""; document.body.getClientRects();
e.style.outline = "1px solid black"; document.body.getClientRects();
e.style.outline = ""; document.body.getClientRects();
e.style.outline = "1px solid black"; document.body.getClientRects();
document.documentElement.removeAttribute("class");
}
</script>
</head>
<body style="padding:100px;">
<a id="a" href="foo">a</a>
<script>
window.addEventListener("MozReftestInvalidate", doTest, false);
</script>
</body>
</html>

View File

@ -1689,3 +1689,4 @@ needs-focus != 703186-1.html 703186-2.html
== 714519-2-as.html 714519-2-ref.html
== 714519-2-q.html 714519-2-ref.html
fuzzy-if(cocoaWidget,1,170) == 718521.html 718521-ref.html
== 720987.html 720987-ref.html