Bug 1191109 - Clean up use of writing-modes in GetHypotheticalBoxContainer, eliminating a redundant ConvertTo call. r=dholbert

This commit is contained in:
Jonathan Kew 2015-08-12 11:02:02 +01:00
parent ae1c75cb4e
commit 98815c8022

View File

@ -1016,11 +1016,10 @@ nsHTMLReflowState::GetHypotheticalBoxContainer(nsIFrame* aFrame,
state = nullptr;
}
WritingMode wm = aFrame->GetWritingMode();
if (state) {
WritingMode stateWM = state->GetWritingMode();
aCBIStartEdge =
state->ComputedLogicalBorderPadding().ConvertTo(wm, stateWM).IStart(wm);
WritingMode wm = state->GetWritingMode();
NS_ASSERTION(wm == aFrame->GetWritingMode(), "unexpected writing mode");
aCBIStartEdge = state->ComputedLogicalBorderPadding().IStart(wm);
aCBSize = state->ComputedSize(wm);
} else {
/* Didn't find a reflow state for aFrame. Just compute the information we
@ -1028,6 +1027,7 @@ nsHTMLReflowState::GetHypotheticalBoxContainer(nsIFrame* aFrame,
ought to be true by now. */
NS_ASSERTION(!(aFrame->GetStateBits() & NS_FRAME_IN_REFLOW),
"aFrame shouldn't be in reflow; we'll lie if it is");
WritingMode wm = aFrame->GetWritingMode();
LogicalMargin borderPadding = aFrame->GetLogicalUsedBorderAndPadding(wm);
aCBIStartEdge = borderPadding.IStart(wm);
aCBSize = aFrame->GetLogicalSize(wm) - borderPadding.Size(wm);