mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 04:38:02 +00:00
Backing out 400813, sigh
This commit is contained in:
parent
d1db25903c
commit
0b989b691c
@ -395,7 +395,6 @@ nsLineLayout::NewPerSpanData(PerSpanData** aResult)
|
||||
psd->mLastFrame = nsnull;
|
||||
psd->mContainsFloat = PR_FALSE;
|
||||
psd->mZeroEffectiveSpanBox = PR_FALSE;
|
||||
psd->mHasNonemptyContent = PR_FALSE;
|
||||
|
||||
#ifdef DEBUG
|
||||
mSpansAllocated++;
|
||||
@ -888,11 +887,11 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
|
||||
else if (nsGkAtoms::textFrame == frameType) {
|
||||
// Note non-empty text-frames for inline frame compatibility hackery
|
||||
pfd->SetFlag(PFD_ISTEXTFRAME, PR_TRUE);
|
||||
nsTextFrame* textFrame = static_cast<nsTextFrame*>(pfd->mFrame);
|
||||
if (textFrame->HasNoncollapsedCharacters()) {
|
||||
psd->mHasNonemptyContent = PR_TRUE;
|
||||
// XXX An empty text frame at the end of the line seems not
|
||||
// to have zero width.
|
||||
if (metrics.width) {
|
||||
pfd->SetFlag(PFD_ISNONEMPTYTEXTFRAME, PR_TRUE);
|
||||
nsIContent* content = textFrame->GetContent();
|
||||
nsIContent* content = pfd->mFrame->GetContent();
|
||||
|
||||
const nsTextFragment* frag = content->GetText();
|
||||
if (frag) {
|
||||
@ -922,13 +921,6 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
|
||||
}
|
||||
else if (nsGkAtoms::brFrame == frameType) {
|
||||
pfd->SetFlag(PFD_SKIPWHENTRIMMINGWHITESPACE, PR_TRUE);
|
||||
psd->mHasNonemptyContent = PR_TRUE;
|
||||
} else if (pfd->mSpan) {
|
||||
if (pfd->mSpan->mHasNonemptyContent || !pfd->mFrame->IsSelfEmpty()) {
|
||||
psd->mHasNonemptyContent = PR_TRUE;
|
||||
}
|
||||
} else {
|
||||
psd->mHasNonemptyContent = PR_TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1312,9 +1304,7 @@ nsLineLayout::PlaceFrame(PerFrameData* pfd, nsHTMLReflowMetrics& aMetrics)
|
||||
// Count the number of non-empty frames on the line...
|
||||
if (!emptyFrame) {
|
||||
mTotalPlacedFrames++;
|
||||
NS_ASSERTION(psd->mHasNonemptyContent, "We should have detected this nonempty content");
|
||||
}
|
||||
// XXX roc why not just check !emptyFrame again here?
|
||||
if (psd->mX != psd->mLeftEdge || pfd->mBounds.x != psd->mLeftEdge) {
|
||||
// As soon as a frame placed on the line advances an X coordinate
|
||||
// of any span we can no longer place a float on the line.
|
||||
@ -2067,7 +2057,7 @@ nsLineLayout::VerticalAlignFrames(PerSpanData* psd)
|
||||
}
|
||||
}
|
||||
if (applyMinLH) {
|
||||
if (psd->mHasNonemptyContent || preMode || foundLI) {
|
||||
if ((psd->mX != psd->mLeftEdge) || preMode || foundLI) {
|
||||
#ifdef NOISY_VERTICAL_ALIGN
|
||||
printf(" [span]==> adjusting min/maxY: currentValues: %d,%d", minY, maxY);
|
||||
#endif
|
||||
|
@ -468,7 +468,6 @@ protected:
|
||||
PRPackedBool mChangedFrameDirection;
|
||||
PRPackedBool mZeroEffectiveSpanBox;
|
||||
PRPackedBool mContainsFloat;
|
||||
PRPackedBool mHasNonemptyContent;
|
||||
|
||||
nscoord mLeftEdge;
|
||||
nscoord mX;
|
||||
|
@ -58,10 +58,6 @@
|
||||
class nsTextPaintStyle;
|
||||
class PropertyProvider;
|
||||
|
||||
// This state bit is set on frames that have some non-collapsed characters after
|
||||
// reflow
|
||||
#define TEXT_HAS_NONCOLLAPSED_CHARACTERS 0x02000000
|
||||
|
||||
class nsTextFrame : public nsFrame {
|
||||
public:
|
||||
friend class nsContinuingTextFrame;
|
||||
@ -193,14 +189,6 @@ public:
|
||||
*/
|
||||
PRBool IsAtEndOfLine() const;
|
||||
|
||||
/**
|
||||
* Call this only after reflow the frame. Returns true if non-collapsed
|
||||
* characters are present.
|
||||
*/
|
||||
PRBool HasNoncollapsedCharacters() const {
|
||||
return (GetStateBits() & TEXT_HAS_NONCOLLAPSED_CHARACTERS) != 0;
|
||||
}
|
||||
|
||||
#ifdef ACCESSIBILITY
|
||||
NS_IMETHOD GetAccessible(nsIAccessible** aAccessible);
|
||||
#endif
|
||||
|
@ -145,10 +145,7 @@
|
||||
|
||||
#define TEXT_REFLOW_FLAGS \
|
||||
(TEXT_FIRST_LETTER|TEXT_START_OF_LINE|TEXT_END_OF_LINE|TEXT_HYPHEN_BREAK| \
|
||||
TEXT_TRIMMED_TRAILING_WHITESPACE|TEXT_HAS_NONCOLLAPSED_CHARACTERS)
|
||||
|
||||
// defined in nsTextFrame.h
|
||||
// #define TEXT_HAS_NONCOLLAPSED_CHARACTERS 0x02000000
|
||||
TEXT_TRIMMED_TRAILING_WHITESPACE)
|
||||
|
||||
// Cache bits for IsEmpty().
|
||||
// Set this bit if the textframe is known to be only collapsible whitespace.
|
||||
@ -5516,7 +5513,6 @@ nsTextFrame::Reflow(nsPresContext* aPresContext,
|
||||
// frame to accumulate with trimmable width from this frame.)
|
||||
if (transformedCharsFit > 0) {
|
||||
lineLayout.SetTrimmableWidth(NSToCoordFloor(trimmableWidth));
|
||||
AddStateBits(TEXT_HAS_NONCOLLAPSED_CHARACTERS);
|
||||
}
|
||||
if (charsFit > 0 && charsFit == length &&
|
||||
HasSoftHyphenBefore(frag, mTextRun, offset, end)) {
|
||||
@ -5864,7 +5860,7 @@ nsIAtom*
|
||||
nsTextFrame::GetType() const
|
||||
{
|
||||
return nsGkAtoms::textFrame;
|
||||
}
|
||||
}
|
||||
|
||||
/* virtual */ PRBool
|
||||
nsTextFrame::IsEmpty()
|
||||
|
@ -2,8 +2,7 @@
|
||||
<html>
|
||||
<body>
|
||||
<div style="height:100px; background-color:blue;"></div>
|
||||
<div style="padding:100px 0; opacity:0;">blank line</div>
|
||||
<div style="height:200px;"></div>
|
||||
<div style="height:100px; background-color:blue;"></div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
@ -680,7 +680,7 @@ random == 403134-1.html 403134-1-ref.html # bug 405377
|
||||
!= 409659-1b.html 409659-1-ref.html
|
||||
!= 409659-1c.html 409659-1-ref.html
|
||||
== 409659-1d.html 409659-1-ref.html
|
||||
== 400813-1.html 400813-1-ref.html
|
||||
# == 400813-1.html 400813-1-ref.html
|
||||
== 412679-1.html 412679-1-ref.html
|
||||
== 412679-2.html 412679-2-ref.html
|
||||
== 411334-1.xml 411334-1-ref.xml
|
||||
|
@ -1,4 +1,3 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<style type="text/css"> p { margin: 5px 1em; width: 0; white-space: nowrap; } p > span { background-color: silver; } </style>
|
||||
|
@ -1,4 +1,3 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<style type="text/css"> p { margin: 5px 1em; width: 0; } p > span { background-color: silver; } </style>
|
||||
|
Loading…
x
Reference in New Issue
Block a user