mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 407227. Include end-of-linebreaker-textrun break opportunity in min-width calculation. r+sr=dbaron,a=schrep
This commit is contained in:
parent
21900626e0
commit
079aadfbec
@ -4723,23 +4723,23 @@ nsTextFrame::PeekOffsetWord(PRBool aForward, PRBool aWordSelectEatSpace, PRBool
|
||||
|
||||
do {
|
||||
PRBool isPunctuation = cIter.IsPunctuation();
|
||||
PRBool isWhitespace = cIter.IsWhitespace();
|
||||
if (aWordSelectEatSpace == isWhitespace && !aState->mSawBeforeType) {
|
||||
if (aWordSelectEatSpace == cIter.IsWhitespace() && !aState->mSawBeforeType) {
|
||||
aState->SetSawBeforeType();
|
||||
aState->Update(isPunctuation, isWhitespace);
|
||||
aState->Update(isPunctuation);
|
||||
continue;
|
||||
}
|
||||
// See if we can break before the current cluster
|
||||
if (!aState->mAtStart) {
|
||||
PRBool canBreak = isPunctuation != aState->mLastCharWasPunctuation
|
||||
? BreakWordBetweenPunctuation(aState, isPunctuation, isWhitespace, aIsKeyboardSelect)
|
||||
? BreakWordBetweenPunctuation(aForward ? aState->mLastCharWasPunctuation : isPunctuation,
|
||||
aIsKeyboardSelect)
|
||||
: cIter.HaveWordBreakBefore() && aState->mSawBeforeType;
|
||||
if (canBreak) {
|
||||
*aOffset = cIter.GetBeforeOffset() - mContentOffset;
|
||||
return PR_TRUE;
|
||||
}
|
||||
}
|
||||
aState->Update(isPunctuation, isWhitespace);
|
||||
aState->Update(isPunctuation);
|
||||
} while (cIter.NextCluster());
|
||||
|
||||
*aOffset = cIter.GetAfterOffset() - mContentOffset;
|
||||
@ -4918,7 +4918,9 @@ nsTextFrame::AddInlineMinWidthForFlow(nsIRenderingContext *aRenderingContext,
|
||||
}
|
||||
}
|
||||
|
||||
if (i < flowEndInTextRun) {
|
||||
if (i < flowEndInTextRun ||
|
||||
(i == mTextRun->GetLength() &&
|
||||
(mTextRun->GetFlags() & nsTextFrameUtils::TEXT_HAS_TRAILING_BREAK))) {
|
||||
if (preformattedNewline) {
|
||||
aData->ForceBreak(aRenderingContext);
|
||||
} else {
|
||||
|
13
layout/reftests/bugs/407227-1-ref.html
Normal file
13
layout/reftests/bugs/407227-1-ref.html
Normal file
@ -0,0 +1,13 @@
|
||||
<html>
|
||||
<body>
|
||||
<table bgcolor="lightgray" width="70">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td bgcolor="red">
|
||||
<img width="50" height="50"><br><img width="50" height="50">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
13
layout/reftests/bugs/407227-1.html
Normal file
13
layout/reftests/bugs/407227-1.html
Normal file
@ -0,0 +1,13 @@
|
||||
<html>
|
||||
<body>
|
||||
<table bgcolor="lightgray" width="70">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td bgcolor="red">
|
||||
<img width="50" height="50"> <img width="50" height="50">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
@ -509,4 +509,5 @@ random == 403134-1.html 403134-1-ref.html # bug 405377
|
||||
== 405584-1.html 405584-1-ref.html
|
||||
== 406484-1.html 406484-1-ref.html
|
||||
== 406568-1.html 406568-1-ref.html
|
||||
== 407227-1.html 407227-1-ref.html
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user