Put the root element in the undisplayed map so that we reconstruct it when it has its 'display' changed from 'none' to something else. (Bug 283686) r+sr=bzbarsky
This commit is contained in:
Родитель
74a6bdf56d
Коммит
0f7678a292
|
@ -4142,6 +4142,7 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsFrameConstructorState& aState,
|
|||
#endif
|
||||
|
||||
if (NS_UNLIKELY(display->mDisplay == NS_STYLE_DISPLAY_NONE)) {
|
||||
aState.mFrameManager->SetUndisplayedContent(aDocElement, styleContext);
|
||||
mInitialContainingBlock = nsnull;
|
||||
mRootElementStyleFrame = nsnull;
|
||||
return NS_OK;
|
||||
|
|
|
@ -557,9 +557,6 @@ nsFrameManager::GetUndisplayedContent(nsIContent* aContent)
|
|||
return nsnull;
|
||||
|
||||
nsIContent* parent = aContent->GetParent();
|
||||
if (!parent)
|
||||
return nsnull;
|
||||
|
||||
for (UndisplayedNode* node = mUndisplayedMap->GetFirstNode(parent);
|
||||
node; node = node->mNext) {
|
||||
if (node->mContent == aContent)
|
||||
|
@ -586,10 +583,10 @@ nsFrameManager::SetUndisplayedContent(nsIContent* aContent,
|
|||
}
|
||||
if (mUndisplayedMap) {
|
||||
nsIContent* parent = aContent->GetParent();
|
||||
NS_ASSERTION(parent, "undisplayed content must have a parent");
|
||||
if (parent) {
|
||||
mUndisplayedMap->AddNodeFor(parent, aContent, aStyleContext);
|
||||
}
|
||||
NS_ASSERTION(parent || (mPresShell && mPresShell->GetDocument() &&
|
||||
mPresShell->GetDocument()->GetRootContent() == aContent),
|
||||
"undisplayed content must have a parent, unless it's the root content");
|
||||
mUndisplayedMap->AddNodeFor(parent, aContent, aStyleContext);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html style="display:none">
|
||||
<title>Testcase, bug 283686 (root element having display:none)</title>
|
||||
<p>Hello world!</p>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<title>Testcase, bug 283686 (root element having display:none)</title>
|
||||
<p>Hello world!</p>
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html class="reftest-wait" style="display:none">
|
||||
<script type="text/javascript">
|
||||
function run() {
|
||||
document.documentElement.style.display = '';
|
||||
document.documentElement.className = '';
|
||||
}
|
||||
</script>
|
||||
<body onload="run()">
|
||||
<title>Testcase, bug 283686 (root element having display:none)</title>
|
||||
<p>Hello world!</p>
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html class="reftest-wait">
|
||||
<script type="text/javascript">
|
||||
function run() {
|
||||
document.documentElement.style.display = 'none';
|
||||
document.documentElement.className = '';
|
||||
}
|
||||
</script>
|
||||
<body onload="run()">
|
||||
<title>Testcase, bug 283686 (root element having display:none)</title>
|
||||
<p>Hello world!</p>
|
||||
|
|
@ -213,6 +213,9 @@ random == 99850-1b.html 99850-1-ref.html # bug 471629
|
|||
== 271747-1a.html 271747-1-ref.html
|
||||
== 271747-1b.html 271747-1-ref.html
|
||||
== 273681-1.html 273681-1-ref.html
|
||||
== 283686-1.html about:blank
|
||||
== 283686-2.html 283686-2-ref.html
|
||||
== 283686-3.html about:blank
|
||||
fails-if(MOZ_WIDGET_TOOLKIT!="cocoa") HTTP == 289480.html#top 289480-ref.html # basically-verbatim acid2 test, HTTP for a 404 page -- bug 409329 for the non-Mac failures
|
||||
== 290129-1.html 290129-1-ref.html
|
||||
== 291078-1.html 291078-1-ref.html
|
||||
|
|
Загрузка…
Ссылка в новой задаче