mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-05 22:05:40 +00:00
Bug 444375. Take TEXT_HAS_TRAILING_BREAK into account when computing min-width for text which has entirely collapsed away. r=smontagu
This commit is contained in:
parent
192d52dd0e
commit
94d689d854
@ -5279,8 +5279,6 @@ nsTextFrame::AddInlineMinWidthForFlow(nsIRenderingContext *aRenderingContext,
|
||||
gfxFloat tabWidth = -1;
|
||||
PRUint32 start =
|
||||
FindStartAfterSkippingWhitespace(&provider, aData, textStyle, &iter, flowEndInTextRun);
|
||||
if (start >= flowEndInTextRun)
|
||||
return;
|
||||
|
||||
// XXX Should we consider hyphenation here?
|
||||
for (PRUint32 i = start, wordStart = start; i <= flowEndInTextRun; ++i) {
|
||||
@ -5342,11 +5340,13 @@ nsTextFrame::AddInlineMinWidthForFlow(nsIRenderingContext *aRenderingContext,
|
||||
}
|
||||
}
|
||||
|
||||
// Check if we have collapsible whitespace at the end
|
||||
aData->skipWhitespace =
|
||||
IsTrimmableSpace(provider.GetFragment(),
|
||||
iter.ConvertSkippedToOriginal(flowEndInTextRun - 1),
|
||||
textStyle);
|
||||
if (start < flowEndInTextRun) {
|
||||
// Check if we have collapsible whitespace at the end
|
||||
aData->skipWhitespace =
|
||||
IsTrimmableSpace(provider.GetFragment(),
|
||||
iter.ConvertSkippedToOriginal(flowEndInTextRun - 1),
|
||||
textStyle);
|
||||
}
|
||||
}
|
||||
|
||||
// XXX Need to do something here to avoid incremental reflow bugs due to
|
||||
@ -5398,8 +5398,6 @@ nsTextFrame::AddInlinePrefWidthForFlow(nsIRenderingContext *aRenderingContext,
|
||||
gfxFloat tabWidth = -1;
|
||||
PRUint32 start =
|
||||
FindStartAfterSkippingWhitespace(&provider, aData, textStyle, &iter, flowEndInTextRun);
|
||||
if (start >= flowEndInTextRun)
|
||||
return;
|
||||
|
||||
// XXX Should we consider hyphenation here?
|
||||
// If newlines and tabs aren't preformatted, nothing to do inside
|
||||
@ -5458,10 +5456,12 @@ nsTextFrame::AddInlinePrefWidthForFlow(nsIRenderingContext *aRenderingContext,
|
||||
}
|
||||
|
||||
// Check if we have collapsible whitespace at the end
|
||||
aData->skipWhitespace =
|
||||
IsTrimmableSpace(provider.GetFragment(),
|
||||
iter.ConvertSkippedToOriginal(flowEndInTextRun - 1),
|
||||
textStyle);
|
||||
if (start < flowEndInTextRun) {
|
||||
aData->skipWhitespace =
|
||||
IsTrimmableSpace(provider.GetFragment(),
|
||||
iter.ConvertSkippedToOriginal(flowEndInTextRun - 1),
|
||||
textStyle);
|
||||
}
|
||||
}
|
||||
|
||||
// XXX Need to do something here to avoid incremental reflow bugs due to
|
||||
|
15
layout/reftests/bugs/444375-1-ref.html
Normal file
15
layout/reftests/bugs/444375-1-ref.html
Normal file
@ -0,0 +1,15 @@
|
||||
<html>
|
||||
<head>
|
||||
<style>
|
||||
span {
|
||||
font-size: 200%;
|
||||
}
|
||||
img {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body style="width: 150px; border: 1px solid black; white-space:pre;"><table><tbody><tr><td><img>
|
||||
<span><img></span></td></tr></tbody></table></body>
|
||||
</html>
|
16
layout/reftests/bugs/444375-1.html
Normal file
16
layout/reftests/bugs/444375-1.html
Normal file
@ -0,0 +1,16 @@
|
||||
<html>
|
||||
<head>
|
||||
<style>
|
||||
span {
|
||||
font-size: 200%;
|
||||
}
|
||||
img {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body style="width: 150px; border: 1px solid black;">
|
||||
<table><tbody><tr><td><img> <span> <img></span></td></tr></tbody></table>
|
||||
</body>
|
||||
</html>
|
@ -915,6 +915,7 @@ random == 429849-1.html 429849-1-ref.html # bug 432288
|
||||
fails == 441259-2.html 441259-2-ref.html # bug 441400
|
||||
== 442542-1.html 442542-1-ref.html
|
||||
== 444015-1.html 444015-1-ref.html
|
||||
== 444375-1.html 444375-1-ref.html
|
||||
== 444928-1.html 444928-1-ref.html
|
||||
== 444928-2.html 444928-2-ref.html
|
||||
!= 444928-3.html 444928-3-notref.html
|
||||
|
Loading…
x
Reference in New Issue
Block a user