Backout patch from Wladimir Palant from bug 393970 due to test failures in the new test from the patch.

This commit is contained in:
reed@reedloden.com 2007-09-17 16:10:23 -07:00
Родитель 0b23403dc8
Коммит 9c00a19941
4 изменённых файлов: 91 добавлений и 234 удалений

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

@ -44,9 +44,5 @@ include $(DEPTH)/config/autoconf.mk
DIRS = public src
ifdef MOZ_MOCHITEST
DIRS += test
endif
include $(topsrcdir)/config/rules.mk

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

@ -261,24 +261,23 @@ nsGridRowLeafLayout::ComputeChildSizes(nsIBox* aBox,
PRBool isHorizontal = aBox->IsHorizontal();
// go up the parent chain looking for scrollframes
nscoord diff = 0;
nsCOMPtr<nsIGridPart> parent;
nsIBox* parentBox;
GetParentGridPart(aBox, &parentBox, getter_AddRefs(parent));
while (parentBox) {
nsIBox* scrollbox = nsGrid::GetScrollBox(parentBox);
aBox = aBox->GetParentBox();
nsIBox* scrollbox = nsGrid::GetScrollBox(aBox);
nsCOMPtr<nsIScrollableFrame> scrollable = do_QueryInterface(scrollbox);
if (scrollable) {
nsMargin scrollbarSizes = scrollable->GetActualScrollbarSizes();
if (isHorizontal) {
diff += scrollbarSizes.left + scrollbarSizes.right;
} else {
diff += scrollbarSizes.top + scrollbarSizes.bottom;
}
}
nsRect ourRect(scrollbox->GetRect());
nsMargin padding(0,0,0,0);
scrollbox->GetBorderAndPadding(padding);
ourRect.Deflate(padding);
GetParentGridPart(parentBox, &parentBox, getter_AddRefs(parent));
nscoord diff;
if (isHorizontal) {
diff = scrollbarSizes.left + scrollbarSizes.right;
} else {
diff = scrollbarSizes.top + scrollbarSizes.bottom;
}
if (diff > 0) {
@ -298,8 +297,7 @@ nsGridRowLeafLayout::ComputeChildSizes(nsIBox* aBox,
if (last)
last->size -= diff;
return;
}
}
}

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

@ -1,51 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Wladimir Palant.
# Portions created by the Initial Developer are Copyright (C) 2007
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
DEPTH = ../../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
relativesrcdir = layout/xul/base/test
include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/rules.mk
_TEST_FILES = test_bug393970.xul \
$(NULL)
libs:: $(_TEST_FILES)
$(INSTALL) $^ $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)

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

@ -1,86 +0,0 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<?xml-stylesheet href="/tests/SimpleTest/test.css" type="text/css"?>
<?xml-stylesheet href="data:text/css,description {border: 1px solid black; padding: 2px;}" type="text/css"?>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=393970
-->
<window title="Mozilla Bug 393970"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript" src="/MochiKit/packed.js" />
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"/>
<!-- test resuls are displayed in the html:body -->
<body xmlns="http://www.w3.org/1999/xhtml">
<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=393970"
target="_blank">Mozilla Bug 393970</a>
</body>
<grid flex="1" style="visibility: hidden;">
<columns>
<column flex="1"/>
<column flex="2"/>
<column flex="3"/>
</columns>
<rows id="rows1">
<row>
<description id="cell11">test1</description>
<description id="cell12">test2</description>
<description id="cell13">test3</description>
</row>
<rows id="rows2" flex="1">
<row>
<description id="cell21">test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1</description>
<description id="cell22">test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2</description>
<description id="cell23">test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3</description>
</row>
<rows id="rows3">
<row>
<description id="cell31">test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1</description>
<description id="cell32">test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2</description>
<description id="cell33">test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3 test3</description>
</row>
</rows>
</rows>
</rows>
</grid>
<!-- test code goes here -->
<script type="application/javascript"><![CDATA[
/** Test for Bug 393970 **/
var tests = [
'overflow-x: hidden; overflow-y: hidden;',
'overflow-x: scroll; overflow-y: hidden;',
'overflow-x: hidden; overflow-y: scroll;',
'overflow-x: scroll; overflow-y: scroll;',
];
var currentTest = -1;
function runNextTest() {
currentTest++;
if (currentTest >= tests.length) {
SimpleTest.finish();
return;
}
$("rows2").setAttribute("style", tests[currentTest]);
setTimeout(checkPositions, 0, tests[currentTest]);
}
function checkPositions(variant) {
for (var col = 1; col <= 3; col++) {
is($('cell1' + col).boxObject.x, $('cell2' + col).boxObject.x, "Cells (1," + col + ") and (2," + col + ") line up horizontally (with " + variant + ")");
is($('cell2' + col).boxObject.x, $('cell3' + col).boxObject.x, "Cells (2," + col + ") and (3," + col + ") line up horizontally (with " + variant + ")");
}
for (var row = 1; row <= 3; row++) {
is($('cell' + row + '1').boxObject.y, $('cell' + row + '2').boxObject.y, "Cells (" + row + ",1) and (" + row + ",2) line up vertically (with " + variant + ")");
is($('cell' + row + '2').boxObject.y, $('cell' + row + '3').boxObject.y, "Cells (" + row + ",2) and (" + row + ",3) line up vertically (with " + variant + ")");
}
runNextTest();
}
addLoadEvent(runNextTest);
SimpleTest.waitForExplicitFinish()
]]></script>
</window>