void LayoutSliderContainer::computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logicalTop, LogicalExtentComputedValues& computedValues) const { HTMLInputElement* input = toHTMLInputElement(node()->shadowHost()); bool isVertical = hasVerticalAppearance(input); if (input->layoutObject()->isSlider() && !isVertical && input->list()) { int offsetFromCenter = LayoutTheme::theme().sliderTickOffsetFromTrackCenter(); LayoutUnit trackHeight = 0; if (offsetFromCenter < 0) { trackHeight = -2 * offsetFromCenter; } else { int tickLength = LayoutTheme::theme().sliderTickSize().height(); trackHeight = 2 * (offsetFromCenter + tickLength); } float zoomFactor = style()->effectiveZoom(); if (zoomFactor != 1.0) trackHeight *= zoomFactor; // FIXME: The trackHeight should have been added before updateLogicalHeight was called to avoid this hack. setIntrinsicContentLogicalHeight(trackHeight); LayoutBox::computeLogicalHeight(trackHeight, logicalTop, computedValues); return; } if (isVertical) logicalHeight = LayoutSlider::defaultTrackLength; // FIXME: The trackHeight should have been added before updateLogicalHeight was called to avoid this hack. setIntrinsicContentLogicalHeight(logicalHeight); LayoutBox::computeLogicalHeight(logicalHeight, logicalTop, computedValues); }
void LayoutTextControl::computeLogicalHeight( LayoutUnit logicalHeight, LayoutUnit logicalTop, LogicalExtentComputedValues& computedValues) const { HTMLElement* innerEditor = innerEditorElement(); ASSERT(innerEditor); if (LayoutBox* innerEditorBox = innerEditor->layoutBox()) { LayoutUnit nonContentHeight = innerEditorBox->borderAndPaddingHeight() + innerEditorBox->marginHeight(); logicalHeight = computeControlLogicalHeight( innerEditorBox->lineHeight(true, HorizontalLine, PositionOfInteriorLineBoxes), nonContentHeight); // We are able to have a horizontal scrollbar if the overflow style is // scroll, or if its auto and there's no word wrap. if (style()->overflowInlineDirection() == OverflowScroll || (style()->overflowInlineDirection() == OverflowAuto && innerEditor->layoutObject()->style()->overflowWrap() == NormalOverflowWrap)) logicalHeight += scrollbarThickness(); // FIXME: The logical height of the inner text box should have been added // before calling computeLogicalHeight to avoid this hack. setIntrinsicContentLogicalHeight(logicalHeight); logicalHeight += borderAndPaddingHeight(); } LayoutBox::computeLogicalHeight(logicalHeight, logicalTop, computedValues); }
void LayoutListBox::computeLogicalHeight( LayoutUnit, LayoutUnit logicalTop, LogicalExtentComputedValues& computedValues) const { LayoutUnit height = itemHeight() * size(); // FIXME: The item height should have been added before updateLogicalHeight // was called to avoid this hack. setIntrinsicContentLogicalHeight(height); height += borderAndPaddingHeight(); LayoutBox::computeLogicalHeight(height, logicalTop, computedValues); }