From dfeed3a85d38f6beec88f1a901c36e76ebcc8620 Mon Sep 17 00:00:00 2001 From: Mats Palmgren Date: Sat, 31 Dec 2016 18:16:32 +0100 Subject: [PATCH] Bug 1325355 part 2 - Rename nsIFrame::GetWritingMode to WritingModeForLine to make its purpose clearer. r=jfkthame --- layout/generic/nsBlockFrame.cpp | 2 +- layout/generic/nsFirstLetterFrame.cpp | 2 +- layout/generic/nsFrame.cpp | 3 ++- layout/generic/nsIFrame.h | 13 +++++++------ 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp index 51a7191ff755..90eb121614f0 100644 --- a/layout/generic/nsBlockFrame.cpp +++ b/layout/generic/nsBlockFrame.cpp @@ -3893,7 +3893,7 @@ nsBlockFrame::DoReflowInlineFrames(BlockReflowInput& aState, #endif WritingMode outerWM = aState.mReflowInput.GetWritingMode(); - WritingMode lineWM = GetWritingMode(outerWM, aLine->mFirstChild); + WritingMode lineWM = WritingModeForLine(outerWM, aLine->mFirstChild); LogicalRect lineRect = aFloatAvailableSpace.mRect.ConvertTo(lineWM, outerWM, aState.ContainerSize()); diff --git a/layout/generic/nsFirstLetterFrame.cpp b/layout/generic/nsFirstLetterFrame.cpp index fa97b53bb5b4..7019bf495535 100644 --- a/layout/generic/nsFirstLetterFrame.cpp +++ b/layout/generic/nsFirstLetterFrame.cpp @@ -195,7 +195,7 @@ nsFirstLetterFrame::Reflow(nsPresContext* aPresContext, // When there is no lineLayout provided, we provide our own. The // only time that the first-letter-frame is not reflowing in a // line context is when its floating. - WritingMode kidWritingMode = GetWritingMode(wm, kid); + WritingMode kidWritingMode = WritingModeForLine(wm, kid); LogicalSize kidAvailSize = availSize.ConvertTo(kidWritingMode, wm); ReflowInput rs(aPresContext, aReflowInput, kid, kidAvailSize); nsLineLayout ll(aPresContext, nullptr, &aReflowInput, nullptr, nullptr); diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index 0e449ec5c7ef..f9f7354821a4 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -1116,7 +1116,8 @@ nsIFrame::GetPaddingRect() const } WritingMode -nsIFrame::GetWritingMode(WritingMode aSelfWM, nsIFrame* aSubFrame) const +nsIFrame::WritingModeForLine(WritingMode aSelfWM, + nsIFrame* aSubFrame) const { MOZ_ASSERT(aSelfWM == GetWritingMode()); WritingMode writingMode = aSelfWM; diff --git a/layout/generic/nsIFrame.h b/layout/generic/nsIFrame.h index 958f8fb0b900..b4d46bddbc43 100644 --- a/layout/generic/nsIFrame.h +++ b/layout/generic/nsIFrame.h @@ -765,15 +765,16 @@ public: } /** - * Get the writing mode of this frame, but if it is styled with - * unicode-bidi: plaintext, reset the direction to the resolved paragraph + * Construct a writing mode for line layout in this frame. This is + * the writing mode of this frame, except that if this frame is styled with + * unicode-bidi:plaintext, we reset the direction to the resolved paragraph * level of the given subframe (typically the first frame on the line), - * not this frame's writing mode, because the container frame could be split - * by hard line breaks into multiple paragraphs with different base direction. + * because the container frame could be split by hard line breaks into + * multiple paragraphs with different base direction. * @param aSelfWM the WM of 'this' */ - mozilla::WritingMode GetWritingMode(mozilla::WritingMode aSelfWM, - nsIFrame* aSubFrame) const; + mozilla::WritingMode WritingModeForLine(mozilla::WritingMode aSelfWM, + nsIFrame* aSubFrame) const; /** * Bounding rect of the frame. The values are in app units, and the origin is