Backout f8125b89352d (bug 747857) for frequent test failures

This commit is contained in:
Ed Morley 2012-05-04 15:24:42 +01:00
parent 0f21db0683
commit 635428fcdd
27 changed files with 1 additions and 594 deletions

View File

@ -411,12 +411,10 @@ protected:
bool HandleListSelection(nsIDOMEvent * aDOMEvent, PRInt32 selectedIndex);
void InitSelectionRange(PRInt32 aClickedIndex);
public:
nsSelectsAreaFrame* GetOptionsContainer() const {
return static_cast<nsSelectsAreaFrame*>(GetScrolledFrame());
}
protected:
nscoord HeightOfARow() {
return GetOptionsContainer()->HeightOfARow();
}

View File

@ -41,9 +41,6 @@
#include "FramePropertyTable.h"
#include "nsTextFragment.h"
#include "nsIFormControlFrame.h"
#include "nsTextControlFrame.h"
#include "nsListControlFrame.h"
#include "nsComboboxControlFrame.h"
#include "nsHTMLReflowState.h"
#include "nsTextFrameUtils.h"
@ -301,41 +298,6 @@ nsFontInflationData::ScanText()
mInflationEnabled = mTextAmount >= mTextThreshold;
}
static PRUint32
DoCharCountOfLargestOption(nsIFrame *aContainer)
{
PRUint32 result = 0;
for (nsIFrame* option = aContainer->GetFirstPrincipalChild();
option; option = option->GetNextSibling()) {
PRUint32 optionResult;
if (option->GetContent()->IsHTML(nsGkAtoms::optgroup)) {
optionResult = DoCharCountOfLargestOption(option);
} else {
// REVIEW: Check the frame structure for this!
optionResult = 0;
for (nsIFrame *optionChild = option->GetFirstPrincipalChild();
optionChild; optionChild = optionChild->GetNextSibling()) {
if (optionChild->GetType() == nsGkAtoms::textFrame) {
optionResult += nsTextFrameUtils::
ComputeApproximateLengthWithWhitespaceCompression(
optionChild->GetContent(), optionChild->GetStyleText());
}
}
}
if (optionResult > result) {
result = optionResult;
}
}
return result;
}
static PRUint32
CharCountOfLargestOption(nsIFrame *aListControlFrame)
{
return DoCharCountOfLargestOption(
static_cast<nsListControlFrame*>(aListControlFrame)->GetOptionsContainer());
}
void
nsFontInflationData::ScanTextIn(nsIFrame *aFrame)
{
@ -354,8 +316,7 @@ nsFontInflationData::ScanTextIn(nsIFrame *aFrame)
continue;
}
nsIAtom *fType = kid->GetType();
if (fType == nsGkAtoms::textFrame) {
if (kid->GetType() == nsGkAtoms::textFrame) {
nsIContent *content = kid->GetContent();
if (content && kid == content->GetPrimaryFrame()) {
PRUint32 len = nsTextFrameUtils::
@ -368,25 +329,6 @@ nsFontInflationData::ScanTextIn(nsIFrame *aFrame)
}
}
}
} else if (fType == nsGkAtoms::textInputFrame) {
// We don't want changes to the amount of text in a text input
// to change what we count towards inflation.
nscoord fontSize = kid->GetStyleFont()->mFont.size;
PRInt32 charCount = static_cast<nsTextControlFrame*>(kid)->GetCols();
mTextAmount += charCount * fontSize;
} else if (fType == nsGkAtoms::comboboxControlFrame) {
// See textInputFrame above (with s/amount of text/selected option/).
// Don't just recurse down to the list control inside, since we
// need to exclude the display frame.
nscoord fontSize = kid->GetStyleFont()->mFont.size;
PRInt32 charCount = CharCountOfLargestOption(
static_cast<nsComboboxControlFrame*>(kid)->GetDropDown());
mTextAmount += charCount * fontSize;
} else if (fType == nsGkAtoms::listControlFrame) {
// See textInputFrame above (with s/amount of text/selected option/).
nscoord fontSize = kid->GetStyleFont()->mFont.size;
PRInt32 charCount = CharCountOfLargestOption(kid);
mTextAmount += charCount * fontSize;
} else {
// recursive step
ScanTextIn(kid);

View File

@ -67,20 +67,3 @@ test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.lineTh
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.lineThreshold,100) == threshold-scope-cell-1.html threshold-scope-cell-1-ref.html
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.lineThreshold,100) == threshold-scope-cell-2.html threshold-scope-cell-2-ref.html
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.lineThreshold,100) == threshold-scope-cell-3.html threshold-scope-cell-3-ref.html
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.lineThreshold,100) == threshold-textarea-contents-under-1.html threshold-textarea-contents-under-1.html
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.lineThreshold,100) == threshold-textarea-contents-under-2.html threshold-textarea-contents-under-2.html
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.lineThreshold,100) == threshold-textarea-contents-at-1.html threshold-textarea-contents-at-1-ref.html
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.lineThreshold,100) == threshold-textarea-contents-at-2.html threshold-textarea-contents-at-2-ref.html
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.lineThreshold,100) == threshold-input-text-contents-under-1.html threshold-input-text-contents-under-1.html
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.lineThreshold,100) == threshold-input-text-contents-under-2.html threshold-input-text-contents-under-2.html
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.lineThreshold,100) == threshold-input-text-contents-at-1.html threshold-input-text-contents-at-1-ref.html
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.lineThreshold,100) == threshold-input-text-contents-at-2.html threshold-input-text-contents-at-2-ref.html
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.lineThreshold,100) == threshold-select-listbox-contents-under-1.html threshold-select-listbox-contents-under-1.html
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.lineThreshold,100) == threshold-select-listbox-contents-under-2.html threshold-select-listbox-contents-under-2.html
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.lineThreshold,100) == threshold-select-listbox-contents-at-1.html threshold-select-listbox-contents-at-1-ref.html
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.lineThreshold,100) == threshold-select-listbox-contents-at-2.html threshold-select-listbox-contents-at-2-ref.html
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.lineThreshold,100) == threshold-select-combobox-contents-under-1.html threshold-select-combobox-contents-under-1.html
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.lineThreshold,100) == threshold-select-combobox-contents-under-2.html threshold-select-combobox-contents-under-2.html
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.lineThreshold,100) == threshold-select-combobox-contents-at-1.html threshold-select-combobox-contents-at-1-ref.html
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.lineThreshold,100) == threshold-select-combobox-contents-at-2.html threshold-select-combobox-contents-at-2-ref.html

View File

@ -1,19 +0,0 @@
<!DOCTYPE HTML>
<title>font.size.inflation.lineThreshold test</title>
<style>
body { width: 600px; }
body, input { font-size: 44px }
p { margin: 0 }
</style>
<!--
In a 600px container, the minimum font size at 15em per line is 40px.
This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
Further, with a lineThreshold of 100, we need 50 characters of 12px
text to meet the line threshold.
-->
<p>123456789
123456789
<input size="10" value="hi">
123456789
1234567890</p>

View File

@ -1,19 +0,0 @@
<!DOCTYPE HTML>
<title>font.size.inflation.lineThreshold test</title>
<style>
body { width: 600px; }
body, input { font-size: 12px }
p { margin: 0 }
</style>
<!--
In a 600px container, the minimum font size at 15em per line is 40px.
This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
Further, with a lineThreshold of 100, we need 50 characters of 12px
text to meet the line threshold.
-->
<p>123456789
123456789
<input size="10" value="hi">
123456789
1234567890</p>

View File

@ -1,19 +0,0 @@
<!DOCTYPE HTML>
<title>font.size.inflation.lineThreshold test</title>
<style>
body { width: 600px; }
body, input { font-size: 44px }
p { margin: 0 }
</style>
<!--
In a 600px container, the minimum font size at 15em per line is 40px.
This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
Further, with a lineThreshold of 100, we need 50 characters of 12px
text to meet the line threshold.
-->
<p>123456789
123456789
<input size="10" value="this is a lot of text but it doesn't have an effect">
123456789
1234567890</p>

View File

@ -1,19 +0,0 @@
<!DOCTYPE HTML>
<title>font.size.inflation.lineThreshold test</title>
<style>
body { width: 600px; }
body, input { font-size: 12px }
p { margin: 0 }
</style>
<!--
In a 600px container, the minimum font size at 15em per line is 40px.
This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
Further, with a lineThreshold of 100, we need 50 characters of 12px
text to meet the line threshold.
-->
<p>123456789
123456789
<input size="10" value="this is a lot of text but it doesn't have an effect">
123456789
1234567890</p>

View File

@ -1,19 +0,0 @@
<!DOCTYPE HTML>
<title>font.size.inflation.lineThreshold test</title>
<style>
body { width: 600px; }
body, input { font-size: 12px }
p { margin: 0 }
</style>
<!--
In a 600px container, the minimum font size at 15em per line is 40px.
This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
Further, with a lineThreshold of 100, we need 50 characters of 12px
text to meet the line threshold.
-->
<p>123456789
123456789
<input size="9" value="hi">
123456789
1234567890</p>

View File

@ -1,19 +0,0 @@
<!DOCTYPE HTML>
<title>font.size.inflation.lineThreshold test</title>
<style>
body { width: 600px; }
body, input { font-size: 12px }
p { margin: 0 }
</style>
<!--
In a 600px container, the minimum font size at 15em per line is 40px.
This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
Further, with a lineThreshold of 100, we need 50 characters of 12px
text to meet the line threshold.
-->
<p>123456789
123456789
<input size="9" value="this is a lot of text but it doesn't have an effect">
123456789
1234567890</p>

View File

@ -1,23 +0,0 @@
<!DOCTYPE HTML>
<title>font.size.inflation.lineThreshold test</title>
<style>
body { width: 600px; }
body, select, option { font-size: 44px }
p { margin: 0 }
</style>
<!--
In a 600px container, the minimum font size at 15em per line is 40px.
This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
Further, with a lineThreshold of 100, we need 50 characters of 12px
text to meet the line threshold.
-->
<p>123456789
123456789
<select>
<option>1234567890</option>
<option>2</option>
<option>3</option>
</select>
123456789
1234567890</p>

View File

@ -1,23 +0,0 @@
<!DOCTYPE HTML>
<title>font.size.inflation.lineThreshold test</title>
<style>
body { width: 600px; }
body, select, option { font-size: 12px }
p { margin: 0 }
</style>
<!--
In a 600px container, the minimum font size at 15em per line is 40px.
This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
Further, with a lineThreshold of 100, we need 50 characters of 12px
text to meet the line threshold.
-->
<p>123456789
123456789
<select>
<option>1234567890</option>
<option>2</option>
<option>3</option>
</select>
123456789
1234567890</p>

View File

@ -1,23 +0,0 @@
<!DOCTYPE HTML>
<title>font.size.inflation.lineThreshold test</title>
<style>
body { width: 600px; }
body, select, option { font-size: 44px }
p { margin: 0 }
</style>
<!--
In a 600px container, the minimum font size at 15em per line is 40px.
This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
Further, with a lineThreshold of 100, we need 50 characters of 12px
text to meet the line threshold.
-->
<p>123456789
123456789
<select>
<option>1234567890</option>
<option>23456789</option>
<option>3</option>
</select>
123456789
1234567890</p>

View File

@ -1,23 +0,0 @@
<!DOCTYPE HTML>
<title>font.size.inflation.lineThreshold test</title>
<style>
body { width: 600px; }
body, select, option { font-size: 12px }
p { margin: 0 }
</style>
<!--
In a 600px container, the minimum font size at 15em per line is 40px.
This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
Further, with a lineThreshold of 100, we need 50 characters of 12px
text to meet the line threshold.
-->
<p>123456789
123456789
<select>
<option>1234567890</option>
<option>23456789</option>
<option>3</option>
</select>
123456789
1234567890</p>

View File

@ -1,23 +0,0 @@
<!DOCTYPE HTML>
<title>font.size.inflation.lineThreshold test</title>
<style>
body { width: 600px; }
body, select, option { font-size: 12px }
p { margin: 0 }
</style>
<!--
In a 600px container, the minimum font size at 15em per line is 40px.
This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
Further, with a lineThreshold of 100, we need 50 characters of 12px
text to meet the line threshold.
-->
<p>123456789
123456789
<select>
<option>123456789</option>
<option>2</option>
<option>3</option>
</select>
123456789
1234567890</p>

View File

@ -1,23 +0,0 @@
<!DOCTYPE HTML>
<title>font.size.inflation.lineThreshold test</title>
<style>
body { width: 600px; }
body, select, option { font-size: 12px }
p { margin: 0 }
</style>
<!--
In a 600px container, the minimum font size at 15em per line is 40px.
This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
Further, with a lineThreshold of 100, we need 50 characters of 12px
text to meet the line threshold.
-->
<p>123456789
123456789
<select>
<option>123456789</option>
<option>23456789</option>
<option>3</option>
</select>
123456789
1234567890</p>

View File

@ -1,23 +0,0 @@
<!DOCTYPE HTML>
<title>font.size.inflation.lineThreshold test</title>
<style>
body { width: 600px; }
body, select, option { font-size: 44px }
p { margin: 0 }
</style>
<!--
In a 600px container, the minimum font size at 15em per line is 40px.
This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
Further, with a lineThreshold of 100, we need 50 characters of 12px
text to meet the line threshold.
-->
<p>123456789
123456789
<select size="3">
<option>1234567890</option>
<option>2</option>
<option>3</option>
</select>
123456789
1234567890</p>

View File

@ -1,23 +0,0 @@
<!DOCTYPE HTML>
<title>font.size.inflation.lineThreshold test</title>
<style>
body { width: 600px; }
body, select, option { font-size: 12px }
p { margin: 0 }
</style>
<!--
In a 600px container, the minimum font size at 15em per line is 40px.
This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
Further, with a lineThreshold of 100, we need 50 characters of 12px
text to meet the line threshold.
-->
<p>123456789
123456789
<select size="3">
<option>1234567890</option>
<option>2</option>
<option>3</option>
</select>
123456789
1234567890</p>

View File

@ -1,23 +0,0 @@
<!DOCTYPE HTML>
<title>font.size.inflation.lineThreshold test</title>
<style>
body { width: 600px; }
body, select, option { font-size: 44px }
p { margin: 0 }
</style>
<!--
In a 600px container, the minimum font size at 15em per line is 40px.
This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
Further, with a lineThreshold of 100, we need 50 characters of 12px
text to meet the line threshold.
-->
<p>123456789
123456789
<select size="3">
<option>1234567890</option>
<option>23456789</option>
<option>3</option>
</select>
123456789
1234567890</p>

View File

@ -1,23 +0,0 @@
<!DOCTYPE HTML>
<title>font.size.inflation.lineThreshold test</title>
<style>
body { width: 600px; }
body, select, option { font-size: 12px }
p { margin: 0 }
</style>
<!--
In a 600px container, the minimum font size at 15em per line is 40px.
This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
Further, with a lineThreshold of 100, we need 50 characters of 12px
text to meet the line threshold.
-->
<p>123456789
123456789
<select size="3">
<option>1234567890</option>
<option>23456789</option>
<option>3</option>
</select>
123456789
1234567890</p>

View File

@ -1,23 +0,0 @@
<!DOCTYPE HTML>
<title>font.size.inflation.lineThreshold test</title>
<style>
body { width: 600px; }
body, select, option { font-size: 12px }
p { margin: 0 }
</style>
<!--
In a 600px container, the minimum font size at 15em per line is 40px.
This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
Further, with a lineThreshold of 100, we need 50 characters of 12px
text to meet the line threshold.
-->
<p>123456789
123456789
<select size="3">
<option>123456789</option>
<option>2</option>
<option>3</option>
</select>
123456789
1234567890</p>

View File

@ -1,23 +0,0 @@
<!DOCTYPE HTML>
<title>font.size.inflation.lineThreshold test</title>
<style>
body { width: 600px; }
body, select, option { font-size: 12px }
p { margin: 0 }
</style>
<!--
In a 600px container, the minimum font size at 15em per line is 40px.
This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
Further, with a lineThreshold of 100, we need 50 characters of 12px
text to meet the line threshold.
-->
<p>123456789
123456789
<select size="3">
<option>123456789</option>
<option>23456789</option>
<option>3</option>
</select>
123456789
1234567890</p>

View File

@ -1,21 +0,0 @@
<!DOCTYPE HTML>
<title>font.size.inflation.lineThreshold test</title>
<style>
body { width: 600px; }
body, textarea { font-size: 44px }
p { margin: 0 }
</style>
<!--
In a 600px container, the minimum font size at 15em per line is 40px.
This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
Further, with a lineThreshold of 100, we need 50 characters of 12px
text to meet the line threshold.
-->
<p>123456789
123456789
<textarea rows="2" cols="10">
hi
</textarea>
123456789
1234567890</p>

View File

@ -1,21 +0,0 @@
<!DOCTYPE HTML>
<title>font.size.inflation.lineThreshold test</title>
<style>
body { width: 600px; }
body, textarea { font-size: 12px }
p { margin: 0 }
</style>
<!--
In a 600px container, the minimum font size at 15em per line is 40px.
This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
Further, with a lineThreshold of 100, we need 50 characters of 12px
text to meet the line threshold.
-->
<p>123456789
123456789
<textarea rows="2" cols="10">
hi
</textarea>
123456789
1234567890</p>

View File

@ -1,21 +0,0 @@
<!DOCTYPE HTML>
<title>font.size.inflation.lineThreshold test</title>
<style>
body { width: 600px; }
body, textarea { font-size: 44px }
p { margin: 0 }
</style>
<!--
In a 600px container, the minimum font size at 15em per line is 40px.
This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
Further, with a lineThreshold of 100, we need 50 characters of 12px
text to meet the line threshold.
-->
<p>123456789
123456789
<textarea rows="2" cols="10">
this is a lot of text but it doesn't have an effect
</textarea>
123456789
1234567890</p>

View File

@ -1,21 +0,0 @@
<!DOCTYPE HTML>
<title>font.size.inflation.lineThreshold test</title>
<style>
body { width: 600px; }
body, textarea { font-size: 12px }
p { margin: 0 }
</style>
<!--
In a 600px container, the minimum font size at 15em per line is 40px.
This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
Further, with a lineThreshold of 100, we need 50 characters of 12px
text to meet the line threshold.
-->
<p>123456789
123456789
<textarea rows="2" cols="10">
this is a lot of text but it doesn't have an effect
</textarea>
123456789
1234567890</p>

View File

@ -1,21 +0,0 @@
<!DOCTYPE HTML>
<title>font.size.inflation.lineThreshold test</title>
<style>
body { width: 600px; }
body, textarea { font-size: 12px }
p { margin: 0 }
</style>
<!--
In a 600px container, the minimum font size at 15em per line is 40px.
This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
Further, with a lineThreshold of 100, we need 50 characters of 12px
text to meet the line threshold.
-->
<p>123456789
123456789
<textarea rows="2" cols="9">
hi
</textarea>
123456789
1234567890</p>

View File

@ -1,21 +0,0 @@
<!DOCTYPE HTML>
<title>font.size.inflation.lineThreshold test</title>
<style>
body { width: 600px; }
body, textarea { font-size: 12px }
p { margin: 0 }
</style>
<!--
In a 600px container, the minimum font size at 15em per line is 40px.
This means we map 0px-60px into 40px-60px, so 12px gets mapped to 44px.
Further, with a lineThreshold of 100, we need 50 characters of 12px
text to meet the line threshold.
-->
<p>123456789
123456789
<textarea rows="2" cols="9">
this is a lot of text but it doesn't have an effect
</textarea>
123456789
1234567890</p>