Bug 491323. Allow splitters to collapse siblings that aren't XUL elements. Also fix the logic for finding the right sibling. r+sr=bzbarsky

--HG--
extra : rebase_source : 2b9728903dc6c8516ad3590398c5459a999e5a91
This commit is contained in:
Robert O'Callahan 2009-05-21 14:50:17 +12:00
Родитель 456857d28c
Коммит 6d91bd0794
4 изменённых файлов: 28 добавлений и 3 удалений

Просмотреть файл

@ -0,0 +1,8 @@
<?xml version="1.0"?>
<window xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<hbox flex="1">
<splitter collapse="before" resizeafter="farthest" width="200" id="s">
</splitter>
</hbox>
</window>

Просмотреть файл

@ -0,0 +1,16 @@
<?xml version="1.0"?>
<window xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="loaded()">
<hbox flex="1">
<script>
function loaded() {
document.documentElement.getBoundingClientRect();
document.getElementById("s").setAttribute("state", "collapsed");
}
</script>
<iframe width="200" src="data:text/html,hello"/>
<splitter collapse="before" resizeafter="farthest" width="200" id="s">
</splitter>
</hbox>
</window>

Просмотреть файл

@ -1232,9 +1232,10 @@ fails-if(MOZ_WIDGET_TOOLKIT=="gtk2") == 481948-3.html 481948-3-ref.html # differ
== 488390-1.html 488390-1-ref.html
== 488649-1.html 488649-1-ref.html
== 488685-1.html 488685-1-ref.html
fails-if(MOZ_WIDGET_TOOLKIT!="cocoa") == 488692-1.html 488692-1-ref.html # needs EXTEND_PAD on non-Mac for correct scaling behaviour
== 492661-1.html 492661-1-ref.html
== 490182-1a.html 490182-1-ref.html
== 490182-1b.html 490182-1-ref.html
== 490173-1.html 490173-1-ref.html
== 490173-2.html 490173-2-ref.html
fails-if(MOZ_WIDGET_TOOLKIT!="cocoa") == 488692-1.html 488692-1-ref.html # needs EXTEND_PAD on non-Mac for correct scaling behaviour
== 491323-1.xul 491323-1-ref.xul

Просмотреть файл

@ -981,12 +981,12 @@ nsSplitterFrameInner::UpdateState()
nsIFrame* splitterSibling;
if (newState == CollapsedBefore || mState == CollapsedBefore) {
splitterSibling =
nsFrameList(mOuter->GetParent()).GetPrevSiblingFor(mOuter);
nsFrameList(mOuter->GetParent()->GetFirstChild(nsnull)).GetPrevSiblingFor(mOuter);
} else {
splitterSibling = mOuter->GetNextSibling();
}
if (splitterSibling && splitterSibling->IsBoxFrame()) {
if (splitterSibling) {
nsCOMPtr<nsIContent> sibling = splitterSibling->GetContent();
if (sibling) {
if (mState == CollapsedBefore || mState == CollapsedAfter) {