Changeset 86395 in webkit
- Timestamp:
- May 12, 2011 4:30:09 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r86394 r86395 1 2011-05-12 Emil A Eklund <eae@chromium.org> 2 3 Reviewed by Darin Adler. 4 5 Convert RenderBox::setLocation, setLogicalLocation and setLogicalSize to IntPoint/IntSize 6 https://bugs.webkit.org/show_bug.cgi?id=60585 7 8 Refactoring, covered by existing tests. 9 10 * rendering/RenderBox.cpp: 11 (WebCore::RenderBox::positionLineBox): 12 * rendering/RenderBox.h: 13 (WebCore::RenderBox::setLogicalLocation): 14 (WebCore::RenderBox::setLogicalSize): 15 (WebCore::RenderBox::setLocation): 16 * rendering/RenderFrameSet.cpp: 17 (WebCore::RenderFrameSet::positionFrames): 18 (WebCore::RenderFrameSet::positionFramesWithFlattening): 19 * rendering/RenderMedia.cpp: 20 (WebCore::RenderMedia::layout): 21 * rendering/RenderScrollbarPart.cpp: 22 (WebCore::RenderScrollbarPart::paintIntoRect): 23 * rendering/RenderTable.cpp: 24 (WebCore::RenderTable::adjustLogicalHeightForCaption): 25 (WebCore::RenderTable::layout): 26 * rendering/RenderTableSection.cpp: 27 (WebCore::RenderTableSection::layoutRows): 28 * rendering/RenderTextControlSingleLine.cpp: 29 (WebCore::RenderTextControlSingleLine::layout): 30 * rendering/svg/SVGRootInlineBox.cpp: 31 (WebCore::SVGRootInlineBox::layoutRootBox): 32 1 33 2011-05-12 Adrienne Walker <enne@google.com> 2 34 -
trunk/Source/WebCore/rendering/RenderBox.cpp
r86385 r86395 1370 1370 box->destroy(renderArena()); 1371 1371 } else if (isReplaced()) { 1372 setLocation( lroundf(box->x()), lroundf(box->y()));1372 setLocation(roundedIntPoint(FloatPoint(box->x(), box->y()))); 1373 1373 m_inlineBoxWrapper = box; 1374 1374 } -
trunk/Source/WebCore/rendering/RenderBox.h
r86385 r86395 76 76 setX(top); 77 77 } 78 void setLogicalLocation(const IntPoint& location) 79 { 80 if (style()->isHorizontalWritingMode()) 81 setLocation(location); 82 else 83 setLocation(location.transposedPoint()); 84 } 78 85 void setLogicalWidth(int size) 79 86 { … … 90 97 setWidth(size); 91 98 } 92 void setLogical Location(int left, int top)99 void setLogicalSize(const IntSize& size) 93 100 { 94 101 if (style()->isHorizontalWritingMode()) 95 set Location(left, top);102 setSize(size); 96 103 else 97 set Location(top, left);104 setSize(size.transposedSize()); 98 105 } 99 106 … … 103 110 104 111 void setLocation(const IntPoint& location) { m_frameRect.setLocation(location); } 105 void setLocation(int x, int y) { setLocation(IntPoint(x, y)); }106 112 107 113 void setSize(const IntSize& size) { m_frameRect.setSize(size); } -
trunk/Source/WebCore/rendering/RenderFrameSet.cpp
r86390 r86395 519 519 int height = m_rows.m_sizes[r]; 520 520 for (int c = 0; c < cols; c++) { 521 child->setLocation( xPos, yPos);521 child->setLocation(IntPoint(xPos, yPos)); 522 522 int width = m_cols.m_sizes[c]; 523 523 … … 616 616 IntRect oldRect = child->frameRect(); 617 617 618 child->setLocation( xPos, yPos);618 child->setLocation(IntPoint(xPos, yPos)); 619 619 child->setHeight(m_rows.m_sizes[r]); 620 620 child->setWidth(m_cols.m_sizes[c]); -
trunk/Source/WebCore/rendering/RenderMedia.cpp
r83397 r86395 75 75 LayoutStateMaintainer statePusher(view(), this, IntSize(x(), y()), hasTransform() || hasReflection() || style()->isFlippedBlocksWritingMode()); 76 76 77 controlsRenderer->setLocation( borderLeft() + paddingLeft(), borderTop() + paddingTop());77 controlsRenderer->setLocation(IntPoint(borderLeft(), borderTop()) + IntSize(paddingLeft(), paddingTop())); 78 78 controlsRenderer->style()->setHeight(Length(newSize.height(), Fixed)); 79 79 controlsRenderer->style()->setWidth(Length(newSize.width(), Fixed)); -
trunk/Source/WebCore/rendering/RenderScrollbarPart.cpp
r86197 r86395 163 163 { 164 164 // Make sure our dimensions match the rect. 165 setLocation(rect. x() - tx, rect.y() - ty);165 setLocation(rect.location() - IntSize(tx, ty)); 166 166 setWidth(rect.width()); 167 167 setHeight(rect.height()); -
trunk/Source/WebCore/rendering/RenderTable.cpp
r86384 r86395 258 258 IntRect captionRect(m_caption->x(), m_caption->y(), m_caption->width(), m_caption->height()); 259 259 260 m_caption->setLogicalLocation( m_caption->marginStart(), logicalHeight());260 m_caption->setLogicalLocation(IntPoint(m_caption->marginStart(), logicalHeight())); 261 261 if (!selfNeedsLayout() && m_caption->checkForRepaintDuringLayout()) 262 262 m_caption->repaintDuringLayoutIfMoved(captionRect); … … 375 375 movedSectionLogicalTop = min(logicalHeight(), section->logicalTop()) + (style()->isHorizontalWritingMode() ? section->minYVisualOverflow() : section->minXVisualOverflow()); 376 376 } 377 section->setLogicalLocation( sectionLogicalLeft, logicalHeight());377 section->setLogicalLocation(IntPoint(sectionLogicalLeft, logicalHeight())); 378 378 379 379 setLogicalHeight(logicalHeight() + section->logicalHeight()); -
trunk/Source/WebCore/rendering/RenderTableSection.cpp
r83255 r86395 494 494 // Set the row's x/y position and width/height. 495 495 if (RenderTableRow* rowRenderer = m_grid[r].rowRenderer) { 496 rowRenderer->setLocation( 0, m_rowPos[r]);496 rowRenderer->setLocation(IntPoint(0, m_rowPos[r])); 497 497 rowRenderer->setLogicalWidth(logicalWidth()); 498 498 rowRenderer->setLogicalHeight(m_rowPos[r + 1] - m_rowPos[r] - vspacing); … … 608 608 IntRect oldCellRect(cell->x(), cell->y() , cell->width(), cell->height()); 609 609 610 IntPoint cellLocation(0, m_rowPos[rindx]); 610 611 if (!style()->isLeftToRightDirection()) 611 cell ->setLogicalLocation(table()->columnPositions()[nEffCols] - table()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + hspacing, m_rowPos[rindx]);612 cellLocation.setX(table()->columnPositions()[nEffCols] - table()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + hspacing); 612 613 else 613 cell->setLogicalLocation(table()->columnPositions()[c] + hspacing, m_rowPos[rindx]); 614 cellLocation.setX(table()->columnPositions()[c] + hspacing); 615 cell->setLogicalLocation(cellLocation); 614 616 view()->addLayoutDelta(IntSize(oldCellRect.x() - cell->x(), oldCellRect.y() - cell->y())); 615 617 -
trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp
r86385 r86395 292 292 // Ignores the paddings for the inner spin button. 293 293 if (RenderBox* spinBox = m_innerSpinButton ? m_innerSpinButton->renderBox() : 0) { 294 spinBox->setLocation( spinBox->x() + paddingRight(), borderTop());294 spinBox->setLocation(IntPoint(spinBox->x() + paddingRight(), borderTop())); 295 295 spinBox->setHeight(height() - borderTop() - borderBottom()); 296 296 } … … 303 303 int x = width() - borderAndPaddingWidth() - button->width() - button->borderAndPaddingWidth(); 304 304 int y = (height() - button->height()) / 2; 305 button->setLocation( x, y);305 button->setLocation(IntPoint(x, y)); 306 306 } else { 307 307 int x = width() - borderRight() - paddingRight() - button->width(); … … 315 315 innerTextRenderer->setX(paddingLeft() + borderLeft() + (spinBox ? spinBox->width() : 0)); 316 316 int y = (height() - button->height()) / 2; 317 button->setLocation( x, y);317 button->setLocation(IntPoint(x, y)); 318 318 } 319 319 } … … 329 329 int y = (diff / 2) + (diff % 2); 330 330 int x = width() - borderRight() - paddingRight() - spinBox->width(); 331 spinBox->setLocation( x, y);331 spinBox->setLocation(IntPoint(x, y)); 332 332 } 333 333 } -
trunk/Source/WebCore/rendering/svg/SVGRootInlineBox.cpp
r84504 r86395 177 177 } 178 178 179 int xBlock = childRect.x();180 int yBlock = childRect.y();181 179 int widthBlock = childRect.width(); 182 180 int heightBlock = childRect.height(); 183 181 184 182 // Finally, assign the root block position, now that all content is laid out. 185 parentBlock->setLocation(xBlock, yBlock); 186 parentBlock->setWidth(widthBlock); 187 parentBlock->setHeight(heightBlock); 183 parentBlock->setLocation(childRect.location()); 184 parentBlock->setSize(childRect.size()); 188 185 189 186 // Position all children relative to the parent block. … … 192 189 if (!child->renderer()->node()) 193 190 continue; 194 child->adjustPosition(- xBlock, -yBlock);191 child->adjustPosition(-childRect.x(), -childRect.y()); 195 192 } 196 193
Note: See TracChangeset
for help on using the changeset viewer.