Changeset 90302 in webkit


Ignore:
Timestamp:
Jul 1, 2011 5:16:52 PM (13 years ago)
Author:
leviw@chromium.org
Message:

2011-07-01 Levi Weintraub <leviw@chromium.org>

Switch primary virtual layout functions to new layout types
https://bugs.webkit.org/show_bug.cgi?id=63852

Reviewed by Eric Seidel.

Switching the primary overloaded layout functions over to the new layout unit abstraction.

No new tests, no functionality changes.

  • html/shadow/MediaControlElements.cpp: (WebCore::RenderMediaVolumeSliderContainer::layout):
  • page/FrameView.cpp: (WebCore::FrameView::layout):
  • rendering/AutoTableLayout.cpp: (WebCore::AutoTableLayout::layout):
  • rendering/FixedTableLayout.cpp: (WebCore::FixedTableLayout::layout):
  • rendering/RenderBox.cpp: (WebCore::RenderBox::layout):
  • rendering/RenderFrameSet.cpp: (WebCore::RenderFrameSet::layout):
  • rendering/RenderMedia.cpp: (WebCore::RenderMedia::layout):
  • rendering/RenderRubyRun.cpp: (WebCore::RenderRubyRun::layout):
  • rendering/RenderScrollbarPart.cpp: (WebCore::RenderScrollbarPart::layout):
  • rendering/RenderSlider.cpp: (WebCore::RenderSlider::layout):
  • rendering/RenderTable.cpp: (WebCore::RenderTable::layout):
  • rendering/RenderTableRow.cpp: (WebCore::RenderTableRow::layout):
  • rendering/RenderTableSection.cpp: (WebCore::RenderTableSection::layout):
  • rendering/RenderTextControlSingleLine.cpp: (WebCore::RenderTextControlSingleLine::layout):
  • rendering/RenderView.cpp: (WebCore::RenderView::layout):
  • rendering/RenderView.h: (WebCore::RenderView::layoutDelta): (WebCore::RenderView::addLayoutDelta):
  • rendering/mathml/RenderMathMLRoot.cpp: (WebCore::RenderMathMLRoot::layout):
  • rendering/mathml/RenderMathMLRow.cpp: (WebCore::RenderMathMLRow::layout):
  • rendering/mathml/RenderMathMLSquareRoot.cpp: (WebCore::RenderMathMLSquareRoot::layout):
  • rendering/mathml/RenderMathMLSubSup.cpp: (WebCore::RenderMathMLSubSup::layout):
  • rendering/mathml/RenderMathMLUnderOver.cpp: (WebCore::RenderMathMLUnderOver::layout):
Location:
trunk/Source/WebCore
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r90301 r90302  
     12011-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
    1562011-07-01  Sam Weinig  <sam@webkit.org>
    257
  • trunk/Source/WebCore/html/shadow/MediaControlElements.cpp

    r89044 r90302  
    275275    LayoutStateDisabler layoutStateDisabler(view());
    276276
    277     IntPoint offset = theme()->volumeSliderOffsetFromMuteButton(buttonBox, IntSize(width(), height()));
     277    LayoutPoint offset = theme()->volumeSliderOffsetFromMuteButton(buttonBox, size());
    278278    setX(offset.x() + buttonBox->offsetLeft());
    279279    setY(offset.y() + buttonBox->offsetTop());
  • trunk/Source/WebCore/page/FrameView.cpp

    r90152 r90302  
    969969                m_firstLayout = false;
    970970                m_firstLayoutCallbackPending = true;
    971                 m_lastLayoutSize = IntSize(width(), height());
     971                m_lastLayoutSize = LayoutSize(width(), height());
    972972                m_lastZoomFactor = root->style()->zoom();
    973973
     
    985985        }
    986986
    987         IntSize oldSize = m_size;
    988 
    989         m_size = IntSize(layoutWidth(), layoutHeight());
     987        LayoutSize oldSize = m_size;
     988
     989        m_size = LayoutSize(layoutWidth(), layoutHeight());
    990990
    991991        if (oldSize != m_size) {
     
    10331033    // Now update the positions of all layers.
    10341034    beginDeferredRepaints();
    1035     IntPoint cachedOffset;
     1035    LayoutPoint cachedOffset;
    10361036    if (m_doFullRepaint)
    10371037        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  
    478478{
    479479    // 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;
    482482    size_t nEffCols = m_table->numEffCols();
    483483
     
    502502    // fill up every cell with its minWidth
    503503    for (size_t i = 0; i < nEffCols; ++i) {
    504         int cellLogicalWidth = m_layoutStruct[i].effectiveMinLogicalWidth;
     504        LayoutUnit cellLogicalWidth = m_layoutStruct[i].effectiveMinLogicalWidth;
    505505        m_layoutStruct[i].computedLogicalWidth = cellLogicalWidth;
    506506        available -= cellLogicalWidth;
     
    538538            Length& logicalWidth = m_layoutStruct[i].effectiveLogicalWidth;
    539539            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));
    541541                available += m_layoutStruct[i].computedLogicalWidth - cellLogicalWidth;
    542542                m_layoutStruct[i].computedLogicalWidth = cellLogicalWidth;
     
    545545        if (totalPercent > 100) {
    546546            // remove overallocated space from the last columns
    547             int excess = tableLogicalWidth * (totalPercent - 100) / 100;
     547            LayoutUnit excess = tableLogicalWidth * (totalPercent - 100) / 100;
    548548            for (int i = nEffCols - 1; i >= 0; --i) {
    549549                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);
    552552                    // the lines below might look inconsistent, but that's the way it's handled in mozilla
    553553                    excess -= reduction;
    554                     int newLogicalWidth = max(m_layoutStruct[i].effectiveMinLogicalWidth, cellLogicalWidth - reduction);
     554                    LayoutUnit newLogicalWidth = max(m_layoutStruct[i].effectiveMinLogicalWidth, cellLogicalWidth - reduction);
    555555                    available += cellLogicalWidth - newLogicalWidth;
    556556                    m_layoutStruct[i].computedLogicalWidth = newLogicalWidth;
     
    577577            if (logicalWidth.isRelative() && logicalWidth.value() != 0) {
    578578                // width=0* gets effMinWidth.
    579                 int cellLogicalWidth = logicalWidth.value() * tableLogicalWidth / totalRelative;
     579                LayoutUnit cellLogicalWidth = logicalWidth.value() * tableLogicalWidth / totalRelative;
    580580                available += m_layoutStruct[i].computedLogicalWidth - cellLogicalWidth;
    581581                m_layoutStruct[i].computedLogicalWidth = cellLogicalWidth;
     
    590590            Length& logicalWidth = m_layoutStruct[i].effectiveLogicalWidth;
    591591            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));
    593593                available -= cellLogicalWidth;
    594594                totalAuto -= m_layoutStruct[i].effectiveMaxLogicalWidth;
     
    603603            Length& logicalWidth = m_layoutStruct[i].effectiveLogicalWidth;
    604604            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);
    606606                available -= cellLogicalWidth;
    607607                totalFixed -= m_layoutStruct[i].effectiveMaxLogicalWidth;
     
    616616            Length& logicalWidth = m_layoutStruct[i].effectiveLogicalWidth;
    617617            if (logicalWidth.isPercent()) {
    618                 int cellLogicalWidth = available * logicalWidth.percent() / totalPercent;
     618                LayoutUnit cellLogicalWidth = available * logicalWidth.percent() / totalPercent;
    619619                available -= cellLogicalWidth;
    620620                totalPercent -= logicalWidth.percent();
     
    634634            if (m_layoutStruct[i].effectiveLogicalWidth.isAuto() && m_layoutStruct[i].emptyCellsOnly)
    635635                continue;
    636             int cellLogicalWidth = available / total;
     636            LayoutUnit cellLogicalWidth = available / total;
    637637            available -= cellLogicalWidth;
    638638            total--;
     
    651651        // This is basically the reverse of how we grew the cells.
    652652        if (available < 0) {
    653             int logicalWidthBeyondMin = 0;
     653            LayoutUnit logicalWidthBeyondMin = 0;
    654654            for (int i = nEffCols - 1; i >= 0; --i) {
    655655                Length& logicalWidth = m_layoutStruct[i].effectiveLogicalWidth;
     
    661661                Length& logicalWidth = m_layoutStruct[i].effectiveLogicalWidth;
    662662                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;
    665665                    m_layoutStruct[i].computedLogicalWidth += reduce;
    666666                    available -= reduce;
     
    673673
    674674        if (available < 0) {
    675             int logicalWidthBeyondMin = 0;
     675            LayoutUnit logicalWidthBeyondMin = 0;
    676676            for (int i = nEffCols - 1; i >= 0; --i) {
    677677                Length& logicalWidth = m_layoutStruct[i].effectiveLogicalWidth;
     
    683683                Length& logicalWidth = m_layoutStruct[i].effectiveLogicalWidth;
    684684                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;
    687687                    m_layoutStruct[i].computedLogicalWidth += reduce;
    688688                    available -= reduce;
     
    695695
    696696        if (available < 0) {
    697             int logicalWidthBeyondMin = 0;
     697            LayoutUnit logicalWidthBeyondMin = 0;
    698698            for (int i = nEffCols - 1; i >= 0; --i) {
    699699                Length& logicalWidth = m_layoutStruct[i].effectiveLogicalWidth;
     
    705705                Length& logicalWidth = m_layoutStruct[i].effectiveLogicalWidth;
    706706                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;
    709709                    m_layoutStruct[i].computedLogicalWidth += reduce;
    710710                    available -= reduce;
     
    717717
    718718        if (available < 0) {
    719             int logicalWidthBeyondMin = 0;
     719            LayoutUnit logicalWidthBeyondMin = 0;
    720720            for (int i = nEffCols - 1; i >= 0; --i) {
    721721                Length& logicalWidth = m_layoutStruct[i].effectiveLogicalWidth;
     
    727727                Length& logicalWidth = m_layoutStruct[i].effectiveLogicalWidth;
    728728                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;
    731731                    m_layoutStruct[i].computedLogicalWidth += reduce;
    732732                    available -= reduce;
     
    739739    }
    740740
    741     int pos = 0;
     741    LayoutUnit pos = 0;
    742742    for (size_t i = 0; i < nEffCols; ++i) {
    743743        m_table->columnPositions()[i] = pos;
  • trunk/Source/WebCore/rendering/FixedTableLayout.cpp

    r90069 r90302  
    229229void FixedTableLayout::layout()
    230230{
    231     int tableLogicalWidth = m_table->logicalWidth() - m_table->bordersPaddingAndSpacingInRowDirection();
     231    LayoutUnit tableLogicalWidth = m_table->logicalWidth() - m_table->bordersPaddingAndSpacingInRowDirection();
    232232    int nEffCols = m_table->numEffCols();
    233233    Vector<int> calcWidth(nEffCols, 0);
    234234
    235235    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;
    239239    float totalPercent = 0;
    240240
     
    257257    }
    258258
    259     int hspacing = m_table->hBorderSpacing();
    260     int totalWidth = totalFixedWidth + totalPercentWidth;
     259    LayoutUnit hspacing = m_table->hBorderSpacing();
     260    LayoutUnit totalWidth = totalFixedWidth + totalPercentWidth;
    261261    if (!numAuto || totalWidth > tableLogicalWidth) {
    262262        // If there are no auto columns, or if the total is too wide, take
     
    286286    } else {
    287287        // 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);
    289289        int lastAuto = 0;
    290290        for (int i = 0; i < nEffCols; i++) {
    291291            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;
    294294                calcWidth[i] = w + hspacing * (span - 1);
    295295                remainingWidth -= w;
     
    309309    if (totalWidth < tableLogicalWidth) {
    310310        // Spread extra space over columns.
    311         int remainingWidth = tableLogicalWidth - totalWidth;
     311        LayoutUnit remainingWidth = tableLogicalWidth - totalWidth;
    312312        int total = nEffCols;
    313313        while (total) {
    314             int w = remainingWidth / total;
     314            LayoutUnit w = remainingWidth / total;
    315315            remainingWidth -= w;
    316316            calcWidth[--total] += w;
     
    320320    }
    321321   
    322     int pos = 0;
     322    LayoutUnit pos = 0;
    323323    for (int i = 0; i < nEffCols; i++) {
    324324        m_table->columnPositions()[i] = pos;
    325325        pos += calcWidth[i] + hspacing;
    326326    }
    327     int colPositionsSize = m_table->columnPositions().size();
     327    LayoutUnit colPositionsSize = m_table->columnPositions().size();
    328328    if (colPositionsSize > 0)
    329329        m_table->columnPositions()[colPositionsSize - 1] = pos;
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r90288 r90302  
    392392    }
    393393
    394     LayoutStateMaintainer statePusher(view(), this, IntSize(x(), y()), style()->isFlippedBlocksWritingMode());
     394    LayoutStateMaintainer statePusher(view(), this, locationOffset(), style()->isFlippedBlocksWritingMode());
    395395    while (child) {
    396396        child->layoutIfNeeded();
  • trunk/Source/WebCore/rendering/RenderFrameSet.cpp

    r90048 r90302  
    462462
    463463    bool doFullRepaint = selfNeedsLayout() && checkForRepaintDuringLayout();
    464     IntRect oldBounds;
     464    LayoutRect oldBounds;
    465465    if (doFullRepaint)
    466466        oldBounds = absoluteClippedOverflowRect();
     
    479479    }
    480480
    481     int borderThickness = frameSet()->border();
     481    LayoutUnit borderThickness = frameSet()->border();
    482482    layOutAxis(m_rows, frameSet()->rowLengths(), height() - (rows - 1) * borderThickness);
    483483    layOutAxis(m_cols, frameSet()->colLengths(), width() - (cols - 1) * borderThickness);
     
    494494    if (doFullRepaint) {
    495495        view()->repaintViewRectangle(oldBounds);
    496         IntRect newBounds = absoluteClippedOverflowRect();
     496        LayoutRect newBounds = absoluteClippedOverflowRect();
    497497        if (newBounds != oldBounds)
    498498            view()->repaintViewRectangle(newBounds);
  • trunk/Source/WebCore/rendering/RenderMedia.cpp

    r87277 r90302  
    5858void RenderMedia::layout()
    5959{
    60     IntSize oldSize = contentBoxRect().size();
     60    LayoutSize oldSize = contentBoxRect().size();
    6161
    6262    RenderImage::layout();
     
    6666        return;
    6767
    68     IntSize newSize = contentBoxRect().size();
     68    LayoutSize newSize = contentBoxRect().size();
    6969    if (newSize == oldSize && !controlsRenderer->needsLayout())
    7070        return;
     
    7373    // instantiate LayoutStateDisabler. Since using a LayoutStateMaintainer is slightly more efficient,
    7474    // 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());
    7676
    77     controlsRenderer->setLocation(IntPoint(borderLeft(), borderTop()) + IntSize(paddingLeft(), paddingTop()));
     77    controlsRenderer->setLocation(LayoutPoint(borderLeft(), borderTop()) + LayoutSize(paddingLeft(), paddingTop()));
    7878    controlsRenderer->style()->setHeight(Length(newSize.height(), Fixed));
    7979    controlsRenderer->style()->setWidth(Length(newSize.width(), Fixed));
  • trunk/Source/WebCore/rendering/RenderRubyRun.cpp

    r89304 r90302  
    233233        return;
    234234   
    235     int lastLineRubyTextBottom = rt->logicalHeight();
    236     int firstLineRubyTextTop = 0;
     235    LayoutUnit lastLineRubyTextBottom = rt->logicalHeight();
     236    LayoutUnit firstLineRubyTextTop = 0;
    237237    RootInlineBox* rootBox = rt->lastRootBox();
    238238    if (rootBox) {
     
    243243
    244244    if (!style()->isFlippedLinesWritingMode()) {
    245         int firstLineTop = 0;
     245        LayoutUnit firstLineTop = 0;
    246246        if (RenderRubyBase* rb = rubyBase()) {
    247247            RootInlineBox* rootBox = rb->firstRootBox();
     
    253253        rt->setLogicalTop(-lastLineRubyTextBottom + firstLineTop);
    254254    } else {
    255         int lastLineBottom = logicalHeight();
     255        LayoutUnit lastLineBottom = logicalHeight();
    256256        if (RenderRubyBase* rb = rubyBase()) {
    257257            RootInlineBox* rootBox = rb->lastRootBox();
  • trunk/Source/WebCore/rendering/RenderScrollbarPart.cpp

    r88250 r90302  
    4949void RenderScrollbarPart::layout()
    5050{
    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.
    5252    if (m_scrollbar->orientation() == HorizontalScrollbar)
    5353        layoutHorizontalPart();
  • trunk/Source/WebCore/rendering/RenderSlider.cpp

    r90069 r90302  
    102102    if (!thumbBox)
    103103        return;
    104     int heightDiff = thumbBox->height() - contentHeight();
     104    LayoutUnit heightDiff = thumbBox->height() - contentHeight();
    105105    if (heightDiff > 0)
    106106        thumbBox->setY(thumbBox->y() - (heightDiff / 2));
  • trunk/Source/WebCore/rendering/RenderTable.cpp

    r90069 r90302  
    275275       
    276276    LayoutRepainter repainter(*this, checkForRepaintDuringLayout());
    277     LayoutStateMaintainer statePusher(view(), this, IntSize(x(), y()), style()->isFlippedBlocksWritingMode());
     277    LayoutStateMaintainer statePusher(view(), this, locationOffset(), style()->isFlippedBlocksWritingMode());
    278278
    279279    setLogicalHeight(0);
     
    282282    initMaxMarginValues();
    283283   
    284     int oldLogicalWidth = logicalWidth();
     284    LayoutUnit oldLogicalWidth = logicalWidth();
    285285    computeLogicalWidth();
    286286
     
    297297    setCellLogicalWidths();
    298298
    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;
    301301
    302302    bool collapsing = collapseBorders();
     
    324324    // did not shift).
    325325    bool sectionMoved = false;
    326     int movedSectionLogicalTop = 0;
     326    LayoutUnit movedSectionLogicalTop = 0;
    327327
    328328    // FIXME: Collapse caption margin.
     
    335335    }
    336336
    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());
    339339
    340340    setLogicalHeight(logicalHeight() + borderAndPaddingBefore);
     
    344344
    345345    Length logicalHeightLength = style()->logicalHeight();
    346     int computedLogicalHeight = 0;
     346    LayoutUnit computedLogicalHeight = 0;
    347347    if (logicalHeightLength.isFixed()) {
    348348        // Tables size as though CSS height includes border/padding.
     
    364364    }
    365365
    366     int sectionLogicalLeft = style()->isLeftToRightDirection() ? borderStart() : borderEnd();
     366    LayoutUnit sectionLogicalLeft = style()->isLeftToRightDirection() ? borderStart() : borderEnd();
    367367    if (!collapsing)
    368368        sectionLogicalLeft += style()->isLeftToRightDirection() ? paddingStart() : paddingEnd();
     
    375375            movedSectionLogicalTop = min(logicalHeight(), section->logicalTop()) + (style()->isHorizontalWritingMode() ? section->minYVisualOverflow() : section->minXVisualOverflow());
    376376        }
    377         section->setLogicalLocation(IntPoint(sectionLogicalLeft, logicalHeight()));
     377        section->setLogicalLocation(LayoutPoint(sectionLogicalLeft, logicalHeight()));
    378378
    379379        setLogicalHeight(logicalHeight() + section->logicalHeight());
     
    406406    if (!didFullRepaint && sectionMoved) {
    407407        if (style()->isHorizontalWritingMode())
    408             repaintRectangle(IntRect(minXVisualOverflow(), movedSectionLogicalTop, maxXVisualOverflow() - minXVisualOverflow(), maxYVisualOverflow() - movedSectionLogicalTop));
     408            repaintRectangle(LayoutRect(minXVisualOverflow(), movedSectionLogicalTop, maxXVisualOverflow() - minXVisualOverflow(), maxYVisualOverflow() - movedSectionLogicalTop));
    409409        else
    410             repaintRectangle(IntRect(movedSectionLogicalTop, minYVisualOverflow(), maxXVisualOverflow() - movedSectionLogicalTop, maxYVisualOverflow() - minYVisualOverflow()));
     410            repaintRectangle(LayoutRect(movedSectionLogicalTop, minYVisualOverflow(), maxXVisualOverflow() - movedSectionLogicalTop, maxYVisualOverflow() - minYVisualOverflow()));
    411411    }
    412412
  • trunk/Source/WebCore/rendering/RenderTableRow.cpp

    r90048 r90302  
    136136
    137137    // Table rows do not add translation.
    138     LayoutStateMaintainer statePusher(view(), this, IntSize(), style()->isFlippedBlocksWritingMode());
     138    LayoutStateMaintainer statePusher(view(), this, LayoutSize(), style()->isFlippedBlocksWritingMode());
    139139
    140140    bool paginated = view()->layoutState()->isPaginated();
  • trunk/Source/WebCore/rendering/RenderTableSection.cpp

    r90048 r90302  
    398398    ASSERT(needsLayout());
    399399
    400     LayoutStateMaintainer statePusher(view(), this, IntSize(x(), y()), style()->isFlippedBlocksWritingMode());
     400    LayoutStateMaintainer statePusher(view(), this, locationOffset(), style()->isFlippedBlocksWritingMode());
    401401    for (RenderObject* child = children()->firstChild(); child; child = child->nextSibling()) {
    402402        if (child->isTableRow()) {
  • trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp

    r90250 r90302  
    270270    // because of compability.
    271271
    272     int oldHeight = height();
     272    LayoutUnit oldHeight = height();
    273273    computeLogicalHeight();
    274274
    275     int oldWidth = width();
     275    LayoutUnit oldWidth = width();
    276276    computeLogicalWidth();
    277277
     
    285285
    286286    // 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();
    291291    if (currentHeight > heightLimit) {
    292292        if (desiredHeight != currentHeight)
     
    299299    if (containerRenderer) {
    300300        containerRenderer->layoutIfNeeded();
    301         int containerHeight = containerRenderer->height();
     301        LayoutUnit containerHeight = containerRenderer->height();
    302302        if (containerHeight > heightLimit) {
    303303            containerRenderer->style()->setHeight(Length(heightLimit, Fixed));
     
    314314    currentHeight = innerTextRenderer->height();
    315315    if (!container && currentHeight != contentHeight()) {
    316         int heightDiff = currentHeight - contentHeight();
     316        LayoutUnit heightDiff = currentHeight - contentHeight();
    317317        innerTextRenderer->setY(innerTextRenderer->y() - (heightDiff / 2 + heightDiff % 2));
    318318    } else if (inputElement()->isSearchField() && containerRenderer && containerRenderer->height() > contentHeight()) {
    319319        // A quirk for find-in-page box on Safari Windows.
    320320        // http://webkit.org/b/63157
    321         int heightDiff = containerRenderer->height() - contentHeight();
     321        LayoutUnit heightDiff = containerRenderer->height() - contentHeight();
    322322        containerRenderer->setY(containerRenderer->y() - (heightDiff / 2 + heightDiff % 2));
    323323    }
     
    326326    if (RenderBox* innerSpinBox = innerSpinButtonElement() ? innerSpinButtonElement()->renderBox() : 0) {
    327327        RenderBox* parentBox = innerSpinBox->parentBox();
    328         innerSpinBox->setLocation(IntPoint(parentBox->width() - innerSpinBox->width() + paddingRight(), -paddingTop()));
     328        innerSpinBox->setLocation(LayoutPoint(parentBox->width() - innerSpinBox->width() + paddingRight(), -paddingTop()));
    329329        innerSpinBox->setHeight(height() - borderTop() - borderBottom());
    330330    }
  • trunk/Source/WebCore/rendering/RenderView.cpp

    r90048 r90302  
    130130        RenderBlock::layout();
    131131
    132     ASSERT(layoutDelta() == IntSize());
     132    ASSERT(layoutDelta() == LayoutSize());
    133133    ASSERT(m_layoutStateDisableCount == 0);
    134134    ASSERT(m_layoutState == &state);
  • trunk/Source/WebCore/rendering/RenderView.h

    r90048 r90302  
    104104    // last layout location, in order to repaint correctly.
    105105    // If we're doing a full repaint m_layoutState will be 0, but in that case layoutDelta doesn't matter.
    106     IntSize layoutDelta() const
    107     {
    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)
    111111    {
    112112        if (m_layoutState)
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp

    r88250 r90302  
    200200        return;
    201201
    202     int maxHeight = toRenderBoxModelObject(lastChild())->offsetHeight();
     202    LayoutUnit maxHeight = toRenderBoxModelObject(lastChild())->offsetHeight();
    203203   
    204204    RenderObject* current = lastChild()->firstChild();
     
    210210   
    211211    // 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;
    214214   
    215215    if (maxHeight > thresholdHeight && thresholdHeight) {
     
    217217        if (shift > 1.)
    218218            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);
    221221       
    222         style()->setPaddingBottom(Length(static_cast<int>(gRootBottomPadding * style()->fontSize()), Fixed));
     222        style()->setPaddingBottom(Length(static_cast<LayoutUnit>(gRootBottomPadding * style()->fontSize()), Fixed));
    223223    }
    224224   
     
    231231        return;
    232232   
    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()));
    236236   
    237237    style()->setPaddingLeft(Length(indexShift, Fixed));
    238238    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));
    240240   
    241241    setNeedsLayout(true);
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLRow.cpp

    r75353 r90302  
    6767    RenderBlock::layout();
    6868   
    69     int maxHeight = 0;
     69    LayoutUnit maxHeight = 0;
    7070    int childCount = 0;
    7171    int operatorCount = 0;
    7272
    7373    // Calculate the non-operator max height of the row.
    74     int operatorHeight = 0;
     74    LayoutUnit operatorHeight = 0;
    7575    for (RenderObject* current = firstChild(); current; current = current->nextSibling()) {
    7676        childCount++;
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLSquareRoot.cpp

    r88250 r90302  
    161161void RenderMathMLSquareRoot::layout()
    162162{
    163     int maxHeight = 0;
     163    LayoutUnit maxHeight = 0;
    164164   
    165165    RenderObject* current = firstChild();
     
    180180
    181181   
    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));
    184184
    185185   
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLSubSup.cpp

    r89273 r90302  
    163163    if (m_kind == SubSup) {
    164164        if (RenderObject* base = firstChild()) {
    165             int maxHeight = 0;
     165            LayoutUnit maxHeight = 0;
    166166            RenderObject* current = base->firstChild();
    167167            while (current) {
    168                 int height = getBoxModelObjectHeight(current);
     168                LayoutUnit height = getBoxModelObjectHeight(current);
    169169                if (height > maxHeight)
    170170                    maxHeight = height;
    171171                current = current->nextSibling();
    172172            }
    173             int heightDiff = m_scripts ? (m_scripts->offsetHeight() - maxHeight) / 2 : 0;
     173            LayoutUnit heightDiff = m_scripts ? (m_scripts->offsetHeight() - maxHeight) / 2 : 0;
    174174            if (heightDiff < 0)
    175175                heightDiff = 0;
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLUnderOver.cpp

    r89268 r90302  
    160160                break;
    161161           
    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)));
    163163           
    164164            // base row wrapper
     
    182182        base = firstChild();
    183183        if (base) {
    184             int baseHeight = getOffsetHeight(base);
     184            LayoutUnit baseHeight = getOffsetHeight(base);
    185185            // actual base
    186186            base = base->firstChild();
     
    190190            // FIXME: We need to look at the space between a single maximum height of
    191191            //        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);
    193193           
    194194            // adjust the base's intrusion into the under
     
    211211            if (!over->firstChild() || !over->firstChild()->isBoxModelObject())
    212212                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)));
    214214           
    215215            // base row wrapper
     
    223223                // adjust the placement of the under block.
    224224               
    225                 int baseHeight = getOffsetHeight(base);
     225                LayoutUnit baseHeight = getOffsetHeight(base);
    226226                // actual base
    227227                base = base->firstChild();
     
    231231                // FIXME: We need to look at the space between a single maximum height of
    232232                //        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);
    234234               
    235235                RenderObject* under = lastChild();
Note: See TracChangeset for help on using the changeset viewer.