Changeset 90302 in webkit
- Timestamp:
- Jul 1, 2011 5:16:52 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r90301 r90302 1 2011-07-01 Levi Weintraub <leviw@chromium.org> 2 3 Switch primary virtual layout functions to new layout types 4 https://bugs.webkit.org/show_bug.cgi?id=63852 5 6 Reviewed by Eric Seidel. 7 8 Switching the primary overloaded layout functions over to the new layout unit abstraction. 9 10 No new tests, no functionality changes. 11 12 * html/shadow/MediaControlElements.cpp: 13 (WebCore::RenderMediaVolumeSliderContainer::layout): 14 * page/FrameView.cpp: 15 (WebCore::FrameView::layout): 16 * rendering/AutoTableLayout.cpp: 17 (WebCore::AutoTableLayout::layout): 18 * rendering/FixedTableLayout.cpp: 19 (WebCore::FixedTableLayout::layout): 20 * rendering/RenderBox.cpp: 21 (WebCore::RenderBox::layout): 22 * rendering/RenderFrameSet.cpp: 23 (WebCore::RenderFrameSet::layout): 24 * rendering/RenderMedia.cpp: 25 (WebCore::RenderMedia::layout): 26 * rendering/RenderRubyRun.cpp: 27 (WebCore::RenderRubyRun::layout): 28 * rendering/RenderScrollbarPart.cpp: 29 (WebCore::RenderScrollbarPart::layout): 30 * rendering/RenderSlider.cpp: 31 (WebCore::RenderSlider::layout): 32 * rendering/RenderTable.cpp: 33 (WebCore::RenderTable::layout): 34 * rendering/RenderTableRow.cpp: 35 (WebCore::RenderTableRow::layout): 36 * rendering/RenderTableSection.cpp: 37 (WebCore::RenderTableSection::layout): 38 * rendering/RenderTextControlSingleLine.cpp: 39 (WebCore::RenderTextControlSingleLine::layout): 40 * rendering/RenderView.cpp: 41 (WebCore::RenderView::layout): 42 * rendering/RenderView.h: 43 (WebCore::RenderView::layoutDelta): 44 (WebCore::RenderView::addLayoutDelta): 45 * rendering/mathml/RenderMathMLRoot.cpp: 46 (WebCore::RenderMathMLRoot::layout): 47 * rendering/mathml/RenderMathMLRow.cpp: 48 (WebCore::RenderMathMLRow::layout): 49 * rendering/mathml/RenderMathMLSquareRoot.cpp: 50 (WebCore::RenderMathMLSquareRoot::layout): 51 * rendering/mathml/RenderMathMLSubSup.cpp: 52 (WebCore::RenderMathMLSubSup::layout): 53 * rendering/mathml/RenderMathMLUnderOver.cpp: 54 (WebCore::RenderMathMLUnderOver::layout): 55 1 56 2011-07-01 Sam Weinig <sam@webkit.org> 2 57 -
trunk/Source/WebCore/html/shadow/MediaControlElements.cpp
r89044 r90302 275 275 LayoutStateDisabler layoutStateDisabler(view()); 276 276 277 IntPoint offset = theme()->volumeSliderOffsetFromMuteButton(buttonBox, IntSize(width(), height()));277 LayoutPoint offset = theme()->volumeSliderOffsetFromMuteButton(buttonBox, size()); 278 278 setX(offset.x() + buttonBox->offsetLeft()); 279 279 setY(offset.y() + buttonBox->offsetTop()); -
trunk/Source/WebCore/page/FrameView.cpp
r90152 r90302 969 969 m_firstLayout = false; 970 970 m_firstLayoutCallbackPending = true; 971 m_lastLayoutSize = IntSize(width(), height());971 m_lastLayoutSize = LayoutSize(width(), height()); 972 972 m_lastZoomFactor = root->style()->zoom(); 973 973 … … 985 985 } 986 986 987 IntSize oldSize = m_size;988 989 m_size = IntSize(layoutWidth(), layoutHeight());987 LayoutSize oldSize = m_size; 988 989 m_size = LayoutSize(layoutWidth(), layoutHeight()); 990 990 991 991 if (oldSize != m_size) { … … 1033 1033 // Now update the positions of all layers. 1034 1034 beginDeferredRepaints(); 1035 IntPoint cachedOffset;1035 LayoutPoint cachedOffset; 1036 1036 if (m_doFullRepaint) 1037 1037 root->view()->repaint(); // FIXME: This isn't really right, since the RenderView doesn't fully encompass the visibleContentRect(). It just happens -
trunk/Source/WebCore/rendering/AutoTableLayout.cpp
r90069 r90302 478 478 { 479 479 // table layout based on the values collected in the layout structure. 480 int tableLogicalWidth = m_table->logicalWidth() - m_table->bordersPaddingAndSpacingInRowDirection();481 int available = tableLogicalWidth;480 LayoutUnit tableLogicalWidth = m_table->logicalWidth() - m_table->bordersPaddingAndSpacingInRowDirection(); 481 LayoutUnit available = tableLogicalWidth; 482 482 size_t nEffCols = m_table->numEffCols(); 483 483 … … 502 502 // fill up every cell with its minWidth 503 503 for (size_t i = 0; i < nEffCols; ++i) { 504 int cellLogicalWidth = m_layoutStruct[i].effectiveMinLogicalWidth;504 LayoutUnit cellLogicalWidth = m_layoutStruct[i].effectiveMinLogicalWidth; 505 505 m_layoutStruct[i].computedLogicalWidth = cellLogicalWidth; 506 506 available -= cellLogicalWidth; … … 538 538 Length& logicalWidth = m_layoutStruct[i].effectiveLogicalWidth; 539 539 if (logicalWidth.isPercent()) { 540 int cellLogicalWidth = max(m_layoutStruct[i].effectiveMinLogicalWidth, logicalWidth.calcMinValue(tableLogicalWidth));540 LayoutUnit cellLogicalWidth = max(m_layoutStruct[i].effectiveMinLogicalWidth, logicalWidth.calcMinValue(tableLogicalWidth)); 541 541 available += m_layoutStruct[i].computedLogicalWidth - cellLogicalWidth; 542 542 m_layoutStruct[i].computedLogicalWidth = cellLogicalWidth; … … 545 545 if (totalPercent > 100) { 546 546 // remove overallocated space from the last columns 547 int excess = tableLogicalWidth * (totalPercent - 100) / 100;547 LayoutUnit excess = tableLogicalWidth * (totalPercent - 100) / 100; 548 548 for (int i = nEffCols - 1; i >= 0; --i) { 549 549 if (m_layoutStruct[i].effectiveLogicalWidth.isPercent()) { 550 int cellLogicalWidth = m_layoutStruct[i].computedLogicalWidth;551 int reduction = min(cellLogicalWidth, excess);550 LayoutUnit cellLogicalWidth = m_layoutStruct[i].computedLogicalWidth; 551 LayoutUnit reduction = min(cellLogicalWidth, excess); 552 552 // the lines below might look inconsistent, but that's the way it's handled in mozilla 553 553 excess -= reduction; 554 int newLogicalWidth = max(m_layoutStruct[i].effectiveMinLogicalWidth, cellLogicalWidth - reduction);554 LayoutUnit newLogicalWidth = max(m_layoutStruct[i].effectiveMinLogicalWidth, cellLogicalWidth - reduction); 555 555 available += cellLogicalWidth - newLogicalWidth; 556 556 m_layoutStruct[i].computedLogicalWidth = newLogicalWidth; … … 577 577 if (logicalWidth.isRelative() && logicalWidth.value() != 0) { 578 578 // width=0* gets effMinWidth. 579 int cellLogicalWidth = logicalWidth.value() * tableLogicalWidth / totalRelative;579 LayoutUnit cellLogicalWidth = logicalWidth.value() * tableLogicalWidth / totalRelative; 580 580 available += m_layoutStruct[i].computedLogicalWidth - cellLogicalWidth; 581 581 m_layoutStruct[i].computedLogicalWidth = cellLogicalWidth; … … 590 590 Length& logicalWidth = m_layoutStruct[i].effectiveLogicalWidth; 591 591 if (logicalWidth.isAuto() && totalAuto && !m_layoutStruct[i].emptyCellsOnly) { 592 int cellLogicalWidth = max(m_layoutStruct[i].computedLogicalWidth, static_cast<int>(available * static_cast<float>(m_layoutStruct[i].effectiveMaxLogicalWidth) / totalAuto));592 LayoutUnit cellLogicalWidth = max(m_layoutStruct[i].computedLogicalWidth, static_cast<LayoutUnit>(available * static_cast<float>(m_layoutStruct[i].effectiveMaxLogicalWidth) / totalAuto)); 593 593 available -= cellLogicalWidth; 594 594 totalAuto -= m_layoutStruct[i].effectiveMaxLogicalWidth; … … 603 603 Length& logicalWidth = m_layoutStruct[i].effectiveLogicalWidth; 604 604 if (logicalWidth.isFixed()) { 605 int cellLogicalWidth = static_cast<int>(available * static_cast<float>(m_layoutStruct[i].effectiveMaxLogicalWidth) / totalFixed);605 LayoutUnit cellLogicalWidth = static_cast<LayoutUnit>(available * static_cast<float>(m_layoutStruct[i].effectiveMaxLogicalWidth) / totalFixed); 606 606 available -= cellLogicalWidth; 607 607 totalFixed -= m_layoutStruct[i].effectiveMaxLogicalWidth; … … 616 616 Length& logicalWidth = m_layoutStruct[i].effectiveLogicalWidth; 617 617 if (logicalWidth.isPercent()) { 618 int cellLogicalWidth = available * logicalWidth.percent() / totalPercent;618 LayoutUnit cellLogicalWidth = available * logicalWidth.percent() / totalPercent; 619 619 available -= cellLogicalWidth; 620 620 totalPercent -= logicalWidth.percent(); … … 634 634 if (m_layoutStruct[i].effectiveLogicalWidth.isAuto() && m_layoutStruct[i].emptyCellsOnly) 635 635 continue; 636 int cellLogicalWidth = available / total;636 LayoutUnit cellLogicalWidth = available / total; 637 637 available -= cellLogicalWidth; 638 638 total--; … … 651 651 // This is basically the reverse of how we grew the cells. 652 652 if (available < 0) { 653 int logicalWidthBeyondMin = 0;653 LayoutUnit logicalWidthBeyondMin = 0; 654 654 for (int i = nEffCols - 1; i >= 0; --i) { 655 655 Length& logicalWidth = m_layoutStruct[i].effectiveLogicalWidth; … … 661 661 Length& logicalWidth = m_layoutStruct[i].effectiveLogicalWidth; 662 662 if (logicalWidth.isAuto()) { 663 int minMaxDiff = m_layoutStruct[i].computedLogicalWidth - m_layoutStruct[i].effectiveMinLogicalWidth;664 int reduce = available * minMaxDiff / logicalWidthBeyondMin;663 LayoutUnit minMaxDiff = m_layoutStruct[i].computedLogicalWidth - m_layoutStruct[i].effectiveMinLogicalWidth; 664 LayoutUnit reduce = available * minMaxDiff / logicalWidthBeyondMin; 665 665 m_layoutStruct[i].computedLogicalWidth += reduce; 666 666 available -= reduce; … … 673 673 674 674 if (available < 0) { 675 int logicalWidthBeyondMin = 0;675 LayoutUnit logicalWidthBeyondMin = 0; 676 676 for (int i = nEffCols - 1; i >= 0; --i) { 677 677 Length& logicalWidth = m_layoutStruct[i].effectiveLogicalWidth; … … 683 683 Length& logicalWidth = m_layoutStruct[i].effectiveLogicalWidth; 684 684 if (logicalWidth.isRelative()) { 685 int minMaxDiff = m_layoutStruct[i].computedLogicalWidth - m_layoutStruct[i].effectiveMinLogicalWidth;686 int reduce = available * minMaxDiff / logicalWidthBeyondMin;685 LayoutUnit minMaxDiff = m_layoutStruct[i].computedLogicalWidth - m_layoutStruct[i].effectiveMinLogicalWidth; 686 LayoutUnit reduce = available * minMaxDiff / logicalWidthBeyondMin; 687 687 m_layoutStruct[i].computedLogicalWidth += reduce; 688 688 available -= reduce; … … 695 695 696 696 if (available < 0) { 697 int logicalWidthBeyondMin = 0;697 LayoutUnit logicalWidthBeyondMin = 0; 698 698 for (int i = nEffCols - 1; i >= 0; --i) { 699 699 Length& logicalWidth = m_layoutStruct[i].effectiveLogicalWidth; … … 705 705 Length& logicalWidth = m_layoutStruct[i].effectiveLogicalWidth; 706 706 if (logicalWidth.isFixed()) { 707 int minMaxDiff = m_layoutStruct[i].computedLogicalWidth - m_layoutStruct[i].effectiveMinLogicalWidth;708 int reduce = available * minMaxDiff / logicalWidthBeyondMin;707 LayoutUnit minMaxDiff = m_layoutStruct[i].computedLogicalWidth - m_layoutStruct[i].effectiveMinLogicalWidth; 708 LayoutUnit reduce = available * minMaxDiff / logicalWidthBeyondMin; 709 709 m_layoutStruct[i].computedLogicalWidth += reduce; 710 710 available -= reduce; … … 717 717 718 718 if (available < 0) { 719 int logicalWidthBeyondMin = 0;719 LayoutUnit logicalWidthBeyondMin = 0; 720 720 for (int i = nEffCols - 1; i >= 0; --i) { 721 721 Length& logicalWidth = m_layoutStruct[i].effectiveLogicalWidth; … … 727 727 Length& logicalWidth = m_layoutStruct[i].effectiveLogicalWidth; 728 728 if (logicalWidth.isPercent()) { 729 int minMaxDiff = m_layoutStruct[i].computedLogicalWidth - m_layoutStruct[i].effectiveMinLogicalWidth;730 int reduce = available * minMaxDiff / logicalWidthBeyondMin;729 LayoutUnit minMaxDiff = m_layoutStruct[i].computedLogicalWidth - m_layoutStruct[i].effectiveMinLogicalWidth; 730 LayoutUnit reduce = available * minMaxDiff / logicalWidthBeyondMin; 731 731 m_layoutStruct[i].computedLogicalWidth += reduce; 732 732 available -= reduce; … … 739 739 } 740 740 741 int pos = 0;741 LayoutUnit pos = 0; 742 742 for (size_t i = 0; i < nEffCols; ++i) { 743 743 m_table->columnPositions()[i] = pos; -
trunk/Source/WebCore/rendering/FixedTableLayout.cpp
r90069 r90302 229 229 void FixedTableLayout::layout() 230 230 { 231 int tableLogicalWidth = m_table->logicalWidth() - m_table->bordersPaddingAndSpacingInRowDirection();231 LayoutUnit tableLogicalWidth = m_table->logicalWidth() - m_table->bordersPaddingAndSpacingInRowDirection(); 232 232 int nEffCols = m_table->numEffCols(); 233 233 Vector<int> calcWidth(nEffCols, 0); 234 234 235 235 int numAuto = 0; 236 int autoSpan = 0;237 int totalFixedWidth = 0;238 int totalPercentWidth = 0;236 LayoutUnit autoSpan = 0; 237 LayoutUnit totalFixedWidth = 0; 238 LayoutUnit totalPercentWidth = 0; 239 239 float totalPercent = 0; 240 240 … … 257 257 } 258 258 259 int hspacing = m_table->hBorderSpacing();260 int totalWidth = totalFixedWidth + totalPercentWidth;259 LayoutUnit hspacing = m_table->hBorderSpacing(); 260 LayoutUnit totalWidth = totalFixedWidth + totalPercentWidth; 261 261 if (!numAuto || totalWidth > tableLogicalWidth) { 262 262 // If there are no auto columns, or if the total is too wide, take … … 286 286 } else { 287 287 // Divide the remaining width among the auto columns. 288 int remainingWidth = tableLogicalWidth - totalFixedWidth - totalPercentWidth - hspacing * (autoSpan - numAuto);288 LayoutUnit remainingWidth = tableLogicalWidth - totalFixedWidth - totalPercentWidth - hspacing * (autoSpan - numAuto); 289 289 int lastAuto = 0; 290 290 for (int i = 0; i < nEffCols; i++) { 291 291 if (m_width[i].isAuto()) { 292 int span = m_table->spanOfEffCol(i);293 int w = remainingWidth * span / autoSpan;292 LayoutUnit span = m_table->spanOfEffCol(i); 293 LayoutUnit w = remainingWidth * span / autoSpan; 294 294 calcWidth[i] = w + hspacing * (span - 1); 295 295 remainingWidth -= w; … … 309 309 if (totalWidth < tableLogicalWidth) { 310 310 // Spread extra space over columns. 311 int remainingWidth = tableLogicalWidth - totalWidth;311 LayoutUnit remainingWidth = tableLogicalWidth - totalWidth; 312 312 int total = nEffCols; 313 313 while (total) { 314 int w = remainingWidth / total;314 LayoutUnit w = remainingWidth / total; 315 315 remainingWidth -= w; 316 316 calcWidth[--total] += w; … … 320 320 } 321 321 322 int pos = 0;322 LayoutUnit pos = 0; 323 323 for (int i = 0; i < nEffCols; i++) { 324 324 m_table->columnPositions()[i] = pos; 325 325 pos += calcWidth[i] + hspacing; 326 326 } 327 int colPositionsSize = m_table->columnPositions().size();327 LayoutUnit colPositionsSize = m_table->columnPositions().size(); 328 328 if (colPositionsSize > 0) 329 329 m_table->columnPositions()[colPositionsSize - 1] = pos; -
trunk/Source/WebCore/rendering/RenderBox.cpp
r90288 r90302 392 392 } 393 393 394 LayoutStateMaintainer statePusher(view(), this, IntSize(x(), y()), style()->isFlippedBlocksWritingMode());394 LayoutStateMaintainer statePusher(view(), this, locationOffset(), style()->isFlippedBlocksWritingMode()); 395 395 while (child) { 396 396 child->layoutIfNeeded(); -
trunk/Source/WebCore/rendering/RenderFrameSet.cpp
r90048 r90302 462 462 463 463 bool doFullRepaint = selfNeedsLayout() && checkForRepaintDuringLayout(); 464 IntRect oldBounds;464 LayoutRect oldBounds; 465 465 if (doFullRepaint) 466 466 oldBounds = absoluteClippedOverflowRect(); … … 479 479 } 480 480 481 int borderThickness = frameSet()->border();481 LayoutUnit borderThickness = frameSet()->border(); 482 482 layOutAxis(m_rows, frameSet()->rowLengths(), height() - (rows - 1) * borderThickness); 483 483 layOutAxis(m_cols, frameSet()->colLengths(), width() - (cols - 1) * borderThickness); … … 494 494 if (doFullRepaint) { 495 495 view()->repaintViewRectangle(oldBounds); 496 IntRect newBounds = absoluteClippedOverflowRect();496 LayoutRect newBounds = absoluteClippedOverflowRect(); 497 497 if (newBounds != oldBounds) 498 498 view()->repaintViewRectangle(newBounds); -
trunk/Source/WebCore/rendering/RenderMedia.cpp
r87277 r90302 58 58 void RenderMedia::layout() 59 59 { 60 IntSize oldSize = contentBoxRect().size();60 LayoutSize oldSize = contentBoxRect().size(); 61 61 62 62 RenderImage::layout(); … … 66 66 return; 67 67 68 IntSize newSize = contentBoxRect().size();68 LayoutSize newSize = contentBoxRect().size(); 69 69 if (newSize == oldSize && !controlsRenderer->needsLayout()) 70 70 return; … … 73 73 // instantiate LayoutStateDisabler. Since using a LayoutStateMaintainer is slightly more efficient, 74 74 // and this method will be called many times per second during playback, use a LayoutStateMaintainer: 75 LayoutStateMaintainer statePusher(view(), this, IntSize(x(), y()), hasTransform() || hasReflection() || style()->isFlippedBlocksWritingMode());75 LayoutStateMaintainer statePusher(view(), this, locationOffset(), hasTransform() || hasReflection() || style()->isFlippedBlocksWritingMode()); 76 76 77 controlsRenderer->setLocation( IntPoint(borderLeft(), borderTop()) + IntSize(paddingLeft(), paddingTop()));77 controlsRenderer->setLocation(LayoutPoint(borderLeft(), borderTop()) + LayoutSize(paddingLeft(), paddingTop())); 78 78 controlsRenderer->style()->setHeight(Length(newSize.height(), Fixed)); 79 79 controlsRenderer->style()->setWidth(Length(newSize.width(), Fixed)); -
trunk/Source/WebCore/rendering/RenderRubyRun.cpp
r89304 r90302 233 233 return; 234 234 235 int lastLineRubyTextBottom = rt->logicalHeight();236 int firstLineRubyTextTop = 0;235 LayoutUnit lastLineRubyTextBottom = rt->logicalHeight(); 236 LayoutUnit firstLineRubyTextTop = 0; 237 237 RootInlineBox* rootBox = rt->lastRootBox(); 238 238 if (rootBox) { … … 243 243 244 244 if (!style()->isFlippedLinesWritingMode()) { 245 int firstLineTop = 0;245 LayoutUnit firstLineTop = 0; 246 246 if (RenderRubyBase* rb = rubyBase()) { 247 247 RootInlineBox* rootBox = rb->firstRootBox(); … … 253 253 rt->setLogicalTop(-lastLineRubyTextBottom + firstLineTop); 254 254 } else { 255 int lastLineBottom = logicalHeight();255 LayoutUnit lastLineBottom = logicalHeight(); 256 256 if (RenderRubyBase* rb = rubyBase()) { 257 257 RootInlineBox* rootBox = rb->lastRootBox(); -
trunk/Source/WebCore/rendering/RenderScrollbarPart.cpp
r88250 r90302 49 49 void RenderScrollbarPart::layout() 50 50 { 51 setLocation( IntPoint()); // We don't worry about positioning ourselves.We're just determining our minimum width/height.51 setLocation(LayoutPoint()); // We don't worry about positioning ourselves. We're just determining our minimum width/height. 52 52 if (m_scrollbar->orientation() == HorizontalScrollbar) 53 53 layoutHorizontalPart(); -
trunk/Source/WebCore/rendering/RenderSlider.cpp
r90069 r90302 102 102 if (!thumbBox) 103 103 return; 104 int heightDiff = thumbBox->height() - contentHeight();104 LayoutUnit heightDiff = thumbBox->height() - contentHeight(); 105 105 if (heightDiff > 0) 106 106 thumbBox->setY(thumbBox->y() - (heightDiff / 2)); -
trunk/Source/WebCore/rendering/RenderTable.cpp
r90069 r90302 275 275 276 276 LayoutRepainter repainter(*this, checkForRepaintDuringLayout()); 277 LayoutStateMaintainer statePusher(view(), this, IntSize(x(), y()), style()->isFlippedBlocksWritingMode());277 LayoutStateMaintainer statePusher(view(), this, locationOffset(), style()->isFlippedBlocksWritingMode()); 278 278 279 279 setLogicalHeight(0); … … 282 282 initMaxMarginValues(); 283 283 284 int oldLogicalWidth = logicalWidth();284 LayoutUnit oldLogicalWidth = logicalWidth(); 285 285 computeLogicalWidth(); 286 286 … … 297 297 setCellLogicalWidths(); 298 298 299 int totalSectionLogicalHeight = 0;300 int oldTableLogicalTop = m_caption ? m_caption->logicalHeight() + m_caption->marginBefore() + m_caption->marginAfter() : 0;299 LayoutUnit totalSectionLogicalHeight = 0; 300 LayoutUnit oldTableLogicalTop = m_caption ? m_caption->logicalHeight() + m_caption->marginBefore() + m_caption->marginAfter() : 0; 301 301 302 302 bool collapsing = collapseBorders(); … … 324 324 // did not shift). 325 325 bool sectionMoved = false; 326 int movedSectionLogicalTop = 0;326 LayoutUnit movedSectionLogicalTop = 0; 327 327 328 328 // FIXME: Collapse caption margin. … … 335 335 } 336 336 337 int borderAndPaddingBefore = borderBefore() + (collapsing ? 0 : paddingBefore());338 int borderAndPaddingAfter = borderAfter() + (collapsing ? 0 : paddingAfter());337 LayoutUnit borderAndPaddingBefore = borderBefore() + (collapsing ? 0 : paddingBefore()); 338 LayoutUnit borderAndPaddingAfter = borderAfter() + (collapsing ? 0 : paddingAfter()); 339 339 340 340 setLogicalHeight(logicalHeight() + borderAndPaddingBefore); … … 344 344 345 345 Length logicalHeightLength = style()->logicalHeight(); 346 int computedLogicalHeight = 0;346 LayoutUnit computedLogicalHeight = 0; 347 347 if (logicalHeightLength.isFixed()) { 348 348 // Tables size as though CSS height includes border/padding. … … 364 364 } 365 365 366 int sectionLogicalLeft = style()->isLeftToRightDirection() ? borderStart() : borderEnd();366 LayoutUnit sectionLogicalLeft = style()->isLeftToRightDirection() ? borderStart() : borderEnd(); 367 367 if (!collapsing) 368 368 sectionLogicalLeft += style()->isLeftToRightDirection() ? paddingStart() : paddingEnd(); … … 375 375 movedSectionLogicalTop = min(logicalHeight(), section->logicalTop()) + (style()->isHorizontalWritingMode() ? section->minYVisualOverflow() : section->minXVisualOverflow()); 376 376 } 377 section->setLogicalLocation( IntPoint(sectionLogicalLeft, logicalHeight()));377 section->setLogicalLocation(LayoutPoint(sectionLogicalLeft, logicalHeight())); 378 378 379 379 setLogicalHeight(logicalHeight() + section->logicalHeight()); … … 406 406 if (!didFullRepaint && sectionMoved) { 407 407 if (style()->isHorizontalWritingMode()) 408 repaintRectangle( IntRect(minXVisualOverflow(), movedSectionLogicalTop, maxXVisualOverflow() - minXVisualOverflow(), maxYVisualOverflow() - movedSectionLogicalTop));408 repaintRectangle(LayoutRect(minXVisualOverflow(), movedSectionLogicalTop, maxXVisualOverflow() - minXVisualOverflow(), maxYVisualOverflow() - movedSectionLogicalTop)); 409 409 else 410 repaintRectangle( IntRect(movedSectionLogicalTop, minYVisualOverflow(), maxXVisualOverflow() - movedSectionLogicalTop, maxYVisualOverflow() - minYVisualOverflow()));410 repaintRectangle(LayoutRect(movedSectionLogicalTop, minYVisualOverflow(), maxXVisualOverflow() - movedSectionLogicalTop, maxYVisualOverflow() - minYVisualOverflow())); 411 411 } 412 412 -
trunk/Source/WebCore/rendering/RenderTableRow.cpp
r90048 r90302 136 136 137 137 // Table rows do not add translation. 138 LayoutStateMaintainer statePusher(view(), this, IntSize(), style()->isFlippedBlocksWritingMode());138 LayoutStateMaintainer statePusher(view(), this, LayoutSize(), style()->isFlippedBlocksWritingMode()); 139 139 140 140 bool paginated = view()->layoutState()->isPaginated(); -
trunk/Source/WebCore/rendering/RenderTableSection.cpp
r90048 r90302 398 398 ASSERT(needsLayout()); 399 399 400 LayoutStateMaintainer statePusher(view(), this, IntSize(x(), y()), style()->isFlippedBlocksWritingMode());400 LayoutStateMaintainer statePusher(view(), this, locationOffset(), style()->isFlippedBlocksWritingMode()); 401 401 for (RenderObject* child = children()->firstChild(); child; child = child->nextSibling()) { 402 402 if (child->isTableRow()) { -
trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp
r90250 r90302 270 270 // because of compability. 271 271 272 int oldHeight = height();272 LayoutUnit oldHeight = height(); 273 273 computeLogicalHeight(); 274 274 275 int oldWidth = width();275 LayoutUnit oldWidth = width(); 276 276 computeLogicalWidth(); 277 277 … … 285 285 286 286 // Set the text block height 287 int desiredHeight = textBlockHeight();288 int currentHeight = innerTextRenderer->height();289 290 int heightLimit = (inputElement()->isSearchField() || !container) ? height() : contentHeight();287 LayoutUnit desiredHeight = textBlockHeight(); 288 LayoutUnit currentHeight = innerTextRenderer->height(); 289 290 LayoutUnit heightLimit = (inputElement()->isSearchField() || !container) ? height() : contentHeight(); 291 291 if (currentHeight > heightLimit) { 292 292 if (desiredHeight != currentHeight) … … 299 299 if (containerRenderer) { 300 300 containerRenderer->layoutIfNeeded(); 301 int containerHeight = containerRenderer->height();301 LayoutUnit containerHeight = containerRenderer->height(); 302 302 if (containerHeight > heightLimit) { 303 303 containerRenderer->style()->setHeight(Length(heightLimit, Fixed)); … … 314 314 currentHeight = innerTextRenderer->height(); 315 315 if (!container && currentHeight != contentHeight()) { 316 int heightDiff = currentHeight - contentHeight();316 LayoutUnit heightDiff = currentHeight - contentHeight(); 317 317 innerTextRenderer->setY(innerTextRenderer->y() - (heightDiff / 2 + heightDiff % 2)); 318 318 } else if (inputElement()->isSearchField() && containerRenderer && containerRenderer->height() > contentHeight()) { 319 319 // A quirk for find-in-page box on Safari Windows. 320 320 // http://webkit.org/b/63157 321 int heightDiff = containerRenderer->height() - contentHeight();321 LayoutUnit heightDiff = containerRenderer->height() - contentHeight(); 322 322 containerRenderer->setY(containerRenderer->y() - (heightDiff / 2 + heightDiff % 2)); 323 323 } … … 326 326 if (RenderBox* innerSpinBox = innerSpinButtonElement() ? innerSpinButtonElement()->renderBox() : 0) { 327 327 RenderBox* parentBox = innerSpinBox->parentBox(); 328 innerSpinBox->setLocation( IntPoint(parentBox->width() - innerSpinBox->width() + paddingRight(), -paddingTop()));328 innerSpinBox->setLocation(LayoutPoint(parentBox->width() - innerSpinBox->width() + paddingRight(), -paddingTop())); 329 329 innerSpinBox->setHeight(height() - borderTop() - borderBottom()); 330 330 } -
trunk/Source/WebCore/rendering/RenderView.cpp
r90048 r90302 130 130 RenderBlock::layout(); 131 131 132 ASSERT(layoutDelta() == IntSize());132 ASSERT(layoutDelta() == LayoutSize()); 133 133 ASSERT(m_layoutStateDisableCount == 0); 134 134 ASSERT(m_layoutState == &state); -
trunk/Source/WebCore/rendering/RenderView.h
r90048 r90302 104 104 // last layout location, in order to repaint correctly. 105 105 // If we're doing a full repaint m_layoutState will be 0, but in that case layoutDelta doesn't matter. 106 IntSize layoutDelta() const107 { 108 return m_layoutState ? m_layoutState->m_layoutDelta : IntSize();109 } 110 void addLayoutDelta(const IntSize& delta)106 LayoutSize layoutDelta() const 107 { 108 return m_layoutState ? m_layoutState->m_layoutDelta : LayoutSize(); 109 } 110 void addLayoutDelta(const LayoutSize& delta) 111 111 { 112 112 if (m_layoutState) -
trunk/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp
r88250 r90302 200 200 return; 201 201 202 int maxHeight = toRenderBoxModelObject(lastChild())->offsetHeight();202 LayoutUnit maxHeight = toRenderBoxModelObject(lastChild())->offsetHeight(); 203 203 204 204 RenderObject* current = lastChild()->firstChild(); … … 210 210 211 211 // Base height above which the shape of the root changes 212 int thresholdHeight = static_cast<int>(gThresholdBaseHeight * style()->fontSize());213 int topStartShift = 0;212 LayoutUnit thresholdHeight = static_cast<LayoutUnit>(gThresholdBaseHeight * style()->fontSize()); 213 LayoutUnit topStartShift = 0; 214 214 215 215 if (maxHeight > thresholdHeight && thresholdHeight) { … … 217 217 if (shift > 1.) 218 218 shift = 1.0f; 219 int frontWidth = static_cast<int>(style()->fontSize() * gRadicalWidth);220 topStartShift = static_cast< int>(gRadicalBottomPointXPos * frontWidth * shift);219 LayoutUnit frontWidth = static_cast<LayoutUnit>(style()->fontSize() * gRadicalWidth); 220 topStartShift = static_cast<LayoutUnit>(gRadicalBottomPointXPos * frontWidth * shift); 221 221 222 style()->setPaddingBottom(Length(static_cast< int>(gRootBottomPadding * style()->fontSize()), Fixed));222 style()->setPaddingBottom(Length(static_cast<LayoutUnit>(gRootBottomPadding * style()->fontSize()), Fixed)); 223 223 } 224 224 … … 231 231 return; 232 232 233 int indexShift = indexBox->offsetWidth() + topStartShift;234 int radicalHeight = static_cast<int>((1 - gRadicalTopLeftPointYPos) * maxHeight);235 int rootMarginTop = radicalHeight + style()->paddingBottom().value() + indexBox->offsetHeight() - (maxHeight + static_cast<int>(gRootPadding * style()->fontSize()));233 LayoutUnit indexShift = indexBox->offsetWidth() + topStartShift; 234 LayoutUnit radicalHeight = static_cast<LayoutUnit>((1 - gRadicalTopLeftPointYPos) * maxHeight); 235 LayoutUnit rootMarginTop = radicalHeight + style()->paddingBottom().value() + indexBox->offsetHeight() - (maxHeight + static_cast<LayoutUnit>(gRootPadding * style()->fontSize())); 236 236 237 237 style()->setPaddingLeft(Length(indexShift, Fixed)); 238 238 if (rootMarginTop > 0) 239 style()->setPaddingTop(Length(rootMarginTop + static_cast< int>(gRootPadding * style()->fontSize()), Fixed));239 style()->setPaddingTop(Length(rootMarginTop + static_cast<LayoutUnit>(gRootPadding * style()->fontSize()), Fixed)); 240 240 241 241 setNeedsLayout(true); -
trunk/Source/WebCore/rendering/mathml/RenderMathMLRow.cpp
r75353 r90302 67 67 RenderBlock::layout(); 68 68 69 int maxHeight = 0;69 LayoutUnit maxHeight = 0; 70 70 int childCount = 0; 71 71 int operatorCount = 0; 72 72 73 73 // Calculate the non-operator max height of the row. 74 int operatorHeight = 0;74 LayoutUnit operatorHeight = 0; 75 75 for (RenderObject* current = firstChild(); current; current = current->nextSibling()) { 76 76 childCount++; -
trunk/Source/WebCore/rendering/mathml/RenderMathMLSquareRoot.cpp
r88250 r90302 161 161 void RenderMathMLSquareRoot::layout() 162 162 { 163 int maxHeight = 0;163 LayoutUnit maxHeight = 0; 164 164 165 165 RenderObject* current = firstChild(); … … 180 180 181 181 182 if (maxHeight > static_cast< int>(gThresholdBaseHeight * style()->fontSize()))183 style()->setPaddingBottom(Length(static_cast< int>(gRootBottomPadding * style()->fontSize()), Fixed));182 if (maxHeight > static_cast<LayoutUnit>(gThresholdBaseHeight * style()->fontSize())) 183 style()->setPaddingBottom(Length(static_cast<LayoutUnit>(gRootBottomPadding * style()->fontSize()), Fixed)); 184 184 185 185 -
trunk/Source/WebCore/rendering/mathml/RenderMathMLSubSup.cpp
r89273 r90302 163 163 if (m_kind == SubSup) { 164 164 if (RenderObject* base = firstChild()) { 165 int maxHeight = 0;165 LayoutUnit maxHeight = 0; 166 166 RenderObject* current = base->firstChild(); 167 167 while (current) { 168 int height = getBoxModelObjectHeight(current);168 LayoutUnit height = getBoxModelObjectHeight(current); 169 169 if (height > maxHeight) 170 170 maxHeight = height; 171 171 current = current->nextSibling(); 172 172 } 173 int heightDiff = m_scripts ? (m_scripts->offsetHeight() - maxHeight) / 2 : 0;173 LayoutUnit heightDiff = m_scripts ? (m_scripts->offsetHeight() - maxHeight) / 2 : 0; 174 174 if (heightDiff < 0) 175 175 heightDiff = 0; -
trunk/Source/WebCore/rendering/mathml/RenderMathMLUnderOver.cpp
r89268 r90302 160 160 break; 161 161 162 int overSpacing = static_cast<int>(gOverSpacingAdjustment * (getOffsetHeight(over) - toRenderBoxModelObject(over->firstChild())->baselinePosition(AlphabeticBaseline, true, HorizontalLine)));162 LayoutUnit overSpacing = static_cast<LayoutUnit>(gOverSpacingAdjustment * (getOffsetHeight(over) - toRenderBoxModelObject(over->firstChild())->baselinePosition(AlphabeticBaseline, true, HorizontalLine))); 163 163 164 164 // base row wrapper … … 182 182 base = firstChild(); 183 183 if (base) { 184 int baseHeight = getOffsetHeight(base);184 LayoutUnit baseHeight = getOffsetHeight(base); 185 185 // actual base 186 186 base = base->firstChild(); … … 190 190 // FIXME: We need to look at the space between a single maximum height of 191 191 // the line boxes and the baseline and squeeze them together 192 int underSpacing = baseHeight - toRenderBoxModelObject(base)->baselinePosition(AlphabeticBaseline, true, HorizontalLine);192 LayoutUnit underSpacing = baseHeight - toRenderBoxModelObject(base)->baselinePosition(AlphabeticBaseline, true, HorizontalLine); 193 193 194 194 // adjust the base's intrusion into the under … … 211 211 if (!over->firstChild() || !over->firstChild()->isBoxModelObject()) 212 212 break; 213 int overSpacing = static_cast<int>(gOverSpacingAdjustment * (getOffsetHeight(over) - toRenderBoxModelObject(over->firstChild())->baselinePosition(AlphabeticBaseline, true, HorizontalLine)));213 LayoutUnit overSpacing = static_cast<LayoutUnit>(gOverSpacingAdjustment * (getOffsetHeight(over) - toRenderBoxModelObject(over->firstChild())->baselinePosition(AlphabeticBaseline, true, HorizontalLine))); 214 214 215 215 // base row wrapper … … 223 223 // adjust the placement of the under block. 224 224 225 int baseHeight = getOffsetHeight(base);225 LayoutUnit baseHeight = getOffsetHeight(base); 226 226 // actual base 227 227 base = base->firstChild(); … … 231 231 // FIXME: We need to look at the space between a single maximum height of 232 232 // the line boxes and the baseline and squeeze them together 233 int underSpacing = baseHeight - toRenderBoxModelObject(base)->baselinePosition(AlphabeticBaseline, true, HorizontalLine);233 LayoutUnit underSpacing = baseHeight - toRenderBoxModelObject(base)->baselinePosition(AlphabeticBaseline, true, HorizontalLine); 234 234 235 235 RenderObject* under = lastChild();
Note: See TracChangeset
for help on using the changeset viewer.