mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1117597 - Sync bounds of ruby annotation containers. r=roc
--HG-- extra : rebase_source : 336b023e6d44031a3a2adfde42a510b6729d83a3 extra : source : a2e4eb7e9c71f299685e8e4c9175bfb31a27a70b
This commit is contained in:
parent
b78667c434
commit
75e692f4de
@ -996,6 +996,8 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
|
|||||||
} else {
|
} else {
|
||||||
if (nsGkAtoms::letterFrame==frameType) {
|
if (nsGkAtoms::letterFrame==frameType) {
|
||||||
pfd->mIsLetterFrame = true;
|
pfd->mIsLetterFrame = true;
|
||||||
|
} else if (nsGkAtoms::rubyFrame == frameType) {
|
||||||
|
SyncAnnotationContainersBounds(pfd);
|
||||||
}
|
}
|
||||||
if (pfd->mSpan) {
|
if (pfd->mSpan) {
|
||||||
isEmpty = !pfd->mSpan->mHasNonemptyContent && pfd->mFrame->IsSelfEmpty();
|
isEmpty = !pfd->mSpan->mHasNonemptyContent && pfd->mFrame->IsSelfEmpty();
|
||||||
@ -1205,6 +1207,30 @@ nsLineLayout::GetCurrentFrameInlineDistanceFromBlock()
|
|||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method syncs all ruby annotation containers' bounds in their
|
||||||
|
* PerFrameData from their rect. It is necessary to do so because the
|
||||||
|
* containers are not part of line in their levels, which means their
|
||||||
|
* bounds are not set properly before.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
nsLineLayout::SyncAnnotationContainersBounds(PerFrameData* aRubyFrame)
|
||||||
|
{
|
||||||
|
MOZ_ASSERT(aRubyFrame->mFrame->GetType() == nsGkAtoms::rubyFrame);
|
||||||
|
MOZ_ASSERT(aRubyFrame->mSpan);
|
||||||
|
|
||||||
|
PerSpanData* span = aRubyFrame->mSpan;
|
||||||
|
WritingMode lineWM = mRootSpan->mWritingMode;
|
||||||
|
nscoord containerWidth = ContainerWidthForSpan(span);
|
||||||
|
for (PerFrameData* pfd = span->mFirstFrame; pfd; pfd = pfd->mNext) {
|
||||||
|
for (PerFrameData* annotation = pfd->mNextAnnotation;
|
||||||
|
annotation; annotation = annotation->mNextAnnotation) {
|
||||||
|
LogicalRect bounds(lineWM, annotation->mFrame->GetRect(), containerWidth);
|
||||||
|
annotation->mBounds = bounds;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* See if the frame can be placed now that we know it's desired size.
|
* See if the frame can be placed now that we know it's desired size.
|
||||||
* We can always place the frame if the line is empty. Note that we
|
* We can always place the frame if the line is empty. Note that we
|
||||||
@ -2639,8 +2665,7 @@ nsLineLayout::AdvanceAnnotationInlineBounds(PerFrameData* aPFD,
|
|||||||
|
|
||||||
PerSpanData* psd = aPFD->mSpan;
|
PerSpanData* psd = aPFD->mSpan;
|
||||||
WritingMode lineWM = mRootSpan->mWritingMode;
|
WritingMode lineWM = mRootSpan->mWritingMode;
|
||||||
LogicalRect bounds(lineWM, frame->GetRect(), aContainerWidth);
|
aPFD->mBounds.IStart(lineWM) += aDeltaICoord;
|
||||||
bounds.IStart(lineWM) += aDeltaICoord;
|
|
||||||
|
|
||||||
// Check whether this expansion should be counted into the reserved
|
// Check whether this expansion should be counted into the reserved
|
||||||
// isize or not. When it is a ruby text container, and it has some
|
// isize or not. When it is a ruby text container, and it has some
|
||||||
@ -2659,10 +2684,9 @@ nsLineLayout::AdvanceAnnotationInlineBounds(PerFrameData* aPFD,
|
|||||||
} else {
|
} else {
|
||||||
// It is a normal ruby text container. Its children will expand
|
// It is a normal ruby text container. Its children will expand
|
||||||
// themselves properly. We only need to expand its own size here.
|
// themselves properly. We only need to expand its own size here.
|
||||||
bounds.ISize(lineWM) += aDeltaISize;
|
aPFD->mBounds.ISize(lineWM) += aDeltaISize;
|
||||||
}
|
}
|
||||||
aPFD->mBounds = bounds;
|
aPFD->mFrame->SetRect(lineWM, aPFD->mBounds, aContainerWidth);
|
||||||
aPFD->mFrame->SetRect(lineWM, bounds, aContainerWidth);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -646,6 +646,8 @@ protected:
|
|||||||
void AllowForStartMargin(PerFrameData* pfd,
|
void AllowForStartMargin(PerFrameData* pfd,
|
||||||
nsHTMLReflowState& aReflowState);
|
nsHTMLReflowState& aReflowState);
|
||||||
|
|
||||||
|
void SyncAnnotationContainersBounds(PerFrameData* aRubyFrame);
|
||||||
|
|
||||||
bool CanPlaceFrame(PerFrameData* pfd,
|
bool CanPlaceFrame(PerFrameData* pfd,
|
||||||
bool aNotSafeToBreak,
|
bool aNotSafeToBreak,
|
||||||
bool aFrameCanContinueTextRun,
|
bool aFrameCanContinueTextRun,
|
||||||
|
@ -22,6 +22,7 @@ fuzzy-if(winWidget,28,1) == dynamic-removal-3.html dynamic-removal-3-ref.html #
|
|||||||
== inlinize-blocks-5.html inlinize-blocks-5-ref.html
|
== inlinize-blocks-5.html inlinize-blocks-5-ref.html
|
||||||
== justification-1.html justification-1-ref.html
|
== justification-1.html justification-1-ref.html
|
||||||
== justification-2.html justification-2-ref.html
|
== justification-2.html justification-2-ref.html
|
||||||
|
== ruby-span-1.html ruby-span-1-ref.html
|
||||||
== ruby-whitespace-1.html ruby-whitespace-1-ref.html
|
== ruby-whitespace-1.html ruby-whitespace-1-ref.html
|
||||||
== ruby-whitespace-2.html ruby-whitespace-2-ref.html
|
== ruby-whitespace-2.html ruby-whitespace-2-ref.html
|
||||||
== ruby-position-horizontal.html ruby-position-horizontal-ref.html
|
== ruby-position-horizontal.html ruby-position-horizontal-ref.html
|
||||||
|
11
layout/reftests/css-ruby/ruby-span-1-ref.html
Normal file
11
layout/reftests/css-ruby/ruby-span-1-ref.html
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Bug 1117597</title>
|
||||||
|
<link rel="stylesheet" href="common.css">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<ruby><rb>The Ruby Base</rb><rtc><rt>span</rt></rtc></ruby>
|
||||||
|
</body>
|
||||||
|
</html>
|
11
layout/reftests/css-ruby/ruby-span-1.html
Normal file
11
layout/reftests/css-ruby/ruby-span-1.html
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Bug 1117597</title>
|
||||||
|
<link rel="stylesheet" href="common.css">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<ruby><rb>The Ruby Base</rb><rtc>span</rtc></ruby>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in New Issue
Block a user