/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/** * This frame type is used for input type=date, time, month, week, and * datetime-local.
*/
// The ISize of our content box, which is the available ISize // for our anonymous content: const nscoord contentBoxISize = aReflowInput.ComputedISize();
nscoord contentBoxBSize = aReflowInput.ComputedBSize();
// Figure out our border-box sizes as well (by adding borderPadding to // content-box sizes): constauto borderPadding = aReflowInput.ComputedLogicalBorderPadding(myWM); const nscoord borderBoxISize =
contentBoxISize + borderPadding.IStartEnd(myWM);
nscoord borderBoxBSize; if (contentBoxBSize != NS_UNCONSTRAINEDSIZE) {
borderBoxBSize = contentBoxBSize + borderPadding.BStartEnd(myWM);
} // else, we'll figure out borderBoxBSize after we resolve contentBoxBSize.
// Convert input area margin into my own writing-mode (in case it differs):
LogicalMargin childMargin = childReflowInput.ComputedLogicalMargin(myWM);
// offsets of input area frame within this frame:
LogicalPoint childOffset =
borderPadding.StartOffset(myWM) + childMargin.StartOffset(myWM);
nsReflowStatus childStatus; // We initially reflow the child with a dummy containerSize; positioning // will be fixed later. const nsSize dummyContainerSize;
ReflowChild(inputAreaFrame, aPresContext, childDesiredSize,
childReflowInput, myWM, childOffset, dummyContainerSize,
ReflowChildFlags::Default, childStatus);
MOZ_ASSERT(childStatus.IsFullyComplete(), "We gave our child unconstrained available block-size, " "so it should be complete");
if (contentBoxBSize == NS_UNCONSTRAINEDSIZE) { // We are intrinsically sized -- we should shrinkwrap the input area's // block-size, or our line-height:
contentBoxBSize =
std::max(aReflowInput.GetLineHeight(), childMarginBoxBSize);
// Make sure we obey min/max-bsize in the case when we're doing intrinsic // sizing (we get it for free when we have a non-intrinsic // aReflowInput.ComputedBSize()). Note that we do this before // adjusting for borderpadding, since ComputedMaxBSize and // ComputedMinBSize are content heights.
contentBoxBSize = aReflowInput.ApplyMinMaxBSize(contentBoxBSize);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.