зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1133697 part 3 - Make ruby text frame not continue text run. r=roc
--HG-- extra : source : b9d1f775565347a2bc506b163b91b5c522e0a366
This commit is contained in:
Родитель
46ca97ae38
Коммит
af2bbac201
|
@ -80,7 +80,8 @@ nsLineLayout::nsLineLayout(nsPresContext* aPresContext,
|
|||
mHasBullet(false),
|
||||
mDirtyNextLine(false),
|
||||
mLineAtStart(false),
|
||||
mHasRuby(false)
|
||||
mHasRuby(false),
|
||||
mSuppressLineWrap(aOuterReflowState->frame->IsSVGText())
|
||||
{
|
||||
MOZ_ASSERT(aOuterReflowState, "aOuterReflowState must not be null");
|
||||
NS_ASSERTION(aFloatManager || aOuterReflowState->frame->GetType() ==
|
||||
|
@ -225,8 +226,7 @@ nsLineLayout::BeginLineReflow(nscoord aICoord, nscoord aBCoord,
|
|||
|
||||
mBStartEdge = aBCoord;
|
||||
|
||||
psd->mNoWrap =
|
||||
!mStyleText->WhiteSpaceCanWrapStyle() || LineContainerFrame()->IsSVGText();
|
||||
psd->mNoWrap = !mStyleText->WhiteSpaceCanWrapStyle() || mSuppressLineWrap;
|
||||
psd->mWritingMode = aWritingMode;
|
||||
|
||||
// If this is the first line of a block then see if the text-indent
|
||||
|
@ -457,6 +457,7 @@ nsLineLayout::BeginSpan(nsIFrame* aFrame,
|
|||
|
||||
nsIFrame* frame = aSpanReflowState->frame;
|
||||
psd->mNoWrap = !frame->StyleText()->WhiteSpaceCanWrap(frame) ||
|
||||
mSuppressLineWrap ||
|
||||
frame->StyleContext()->IsInlineDescendantOfRuby();
|
||||
psd->mWritingMode = aSpanReflowState->GetWritingMode();
|
||||
|
||||
|
|
|
@ -368,6 +368,8 @@ public:
|
|||
*/
|
||||
nscoord GetCurrentICoord() { return mCurrentSpan->mICoord; }
|
||||
|
||||
void SetSuppressLineWrap(bool aEnabled) { mSuppressLineWrap = aEnabled; }
|
||||
|
||||
protected:
|
||||
// This state is constant for a given block frame doing line layout
|
||||
nsFloatManager* mFloatManager;
|
||||
|
@ -598,6 +600,7 @@ protected:
|
|||
bool mDirtyNextLine : 1;
|
||||
bool mLineAtStart : 1;
|
||||
bool mHasRuby : 1;
|
||||
bool mSuppressLineWrap : 1;
|
||||
|
||||
int32_t mSpanDepth;
|
||||
#ifdef DEBUG
|
||||
|
|
|
@ -376,6 +376,7 @@ nsRubyBaseContainerFrame::Reflow(nsPresContext* aPresContext,
|
|||
reflowState->mFloatManager,
|
||||
reflowState, nullptr,
|
||||
aReflowState.mLineLayout);
|
||||
lineLayout->SetSuppressLineWrap(true);
|
||||
lineLayouts.AppendElement(lineLayout);
|
||||
|
||||
// Line number is useless for ruby text
|
||||
|
|
|
@ -44,6 +44,12 @@ nsRubyTextFrame::GetType() const
|
|||
return nsGkAtoms::rubyTextFrame;
|
||||
}
|
||||
|
||||
/* virtual */ bool
|
||||
nsRubyTextFrame::CanContinueTextRun() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_FRAME_DUMP
|
||||
nsresult
|
||||
nsRubyTextFrame::GetFrameName(nsAString& aResult) const
|
||||
|
|
|
@ -29,6 +29,7 @@ public:
|
|||
|
||||
// nsIFrame overrides
|
||||
virtual nsIAtom* GetType() const MOZ_OVERRIDE;
|
||||
virtual bool CanContinueTextRun() const MOZ_OVERRIDE;
|
||||
|
||||
#ifdef DEBUG_FRAME_DUMP
|
||||
virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE;
|
||||
|
|
|
@ -29,7 +29,7 @@ default-preferences pref(layout.css.ruby.enabled,true)
|
|||
== intra-level-whitespace-3.html intra-level-whitespace-3-ref.html
|
||||
== justification-1.html justification-1-ref.html
|
||||
== justification-2.html justification-2-ref.html
|
||||
asserts-if(winWidget,0-1) == line-breaking-1.html line-breaking-1-ref.html # bug 1133697
|
||||
== line-breaking-1.html line-breaking-1-ref.html
|
||||
== line-height-1.html line-height-1-ref.html
|
||||
== line-height-2.html line-height-2-ref.html
|
||||
== line-height-3.html line-height-3-ref.html
|
||||
|
|
Загрузка…
Ссылка в новой задаче