Changeset 90517 in webkit
- Timestamp:
- Jul 6, 2011 4:55:06 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r90515 r90517 1 2011-07-06 Levi Weintraub <leviw@chromium.org> 2 3 Switch Overflow and FrameRect methods in InlineBox to Layout Units 4 https://bugs.webkit.org/show_bug.cgi?id=64034 5 6 Reviewed by Eric Seidel. 7 8 Switching Overflow and FrameRect methods on InlineBox to new Layout Unit abstraction and 9 cleaning up some compilation errors that crop up when building with floating point layout units. 10 11 No new tests, no functionality changes. 12 13 * css/CSSComputedStyleDeclaration.cpp: 14 (WebCore::sizingBox): 15 * dom/Document.h: 16 * editing/DeleteButtonController.cpp: 17 (WebCore::isDeletableElement): 18 * inspector/DOMNodeHighlighter.cpp: 19 (WebCore::DOMNodeHighlighter::drawNodeHighlight): 20 * page/animation/AnimationBase.cpp: 21 (WebCore::blendFunc): 22 * platform/ScrollView.h: 23 (WebCore::ScrollView::visibleWidth): 24 (WebCore::ScrollView::visibleHeight): 25 * platform/ScrollableArea.h: 26 (WebCore::ScrollableArea::visibleHeight): 27 (WebCore::ScrollableArea::visibleWidth): 28 * platform/graphics/FloatPoint.h: Adding FloatPoint and FloatSize move[By] functions 29 (WebCore::FloatPoint::move): 30 (WebCore::FloatPoint::moveBy): 31 * rendering/AutoTableLayout.cpp: 32 (WebCore::AutoTableLayout::computePreferredLogicalWidths): 33 (WebCore::AutoTableLayout::layout): 34 * rendering/InlineFlowBox.h: 35 (WebCore::InlineFlowBox::layoutOverflowRect): 36 (WebCore::InlineFlowBox::logicalLeftLayoutOverflow): 37 (WebCore::InlineFlowBox::logicalRightLayoutOverflow): 38 (WebCore::InlineFlowBox::logicalTopLayoutOverflow): 39 (WebCore::InlineFlowBox::logicalBottomLayoutOverflow): 40 (WebCore::InlineFlowBox::logicalLayoutOverflowRect): 41 (WebCore::InlineFlowBox::visualOverflowRect): 42 (WebCore::InlineFlowBox::logicalLeftVisualOverflow): 43 (WebCore::InlineFlowBox::logicalRightVisualOverflow): 44 (WebCore::InlineFlowBox::logicalTopVisualOverflow): 45 (WebCore::InlineFlowBox::logicalBottomVisualOverflow): 46 (WebCore::InlineFlowBox::logicalVisualOverflowRect): 47 (WebCore::InlineFlowBox::frameRectIncludingLineHeight): 48 (WebCore::InlineFlowBox::logicalFrameRectIncludingLineHeight): 49 * rendering/RenderBlock.h: 50 (WebCore::RenderBlock::RenderBlockRareData::positiveMarginBeforeDefault): 51 (WebCore::RenderBlock::RenderBlockRareData::negativeMarginBeforeDefault): 52 (WebCore::RenderBlock::RenderBlockRareData::positiveMarginAfterDefault): 53 (WebCore::RenderBlock::RenderBlockRareData::negativeMarginAfterDefault): 54 1 55 2011-07-06 Emil A Eklund <eae@chromium.org> 2 56 -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r88526 r90517 445 445 } 446 446 447 static IntRect sizingBox(RenderObject* renderer)447 static LayoutRect sizingBox(RenderObject* renderer) 448 448 { 449 449 if (!renderer->isBox()) 450 return IntRect();450 return LayoutRect(); 451 451 452 452 RenderBox* box = toRenderBox(renderer); -
trunk/Source/WebCore/dom/Document.h
r90471 r90517 36 36 #include "IconURL.h" 37 37 #include "IntRect.h" 38 #include "LayoutTypes.h" 38 39 #include "PageVisibilityState.h" 39 40 #include "QualifiedName.h" … … 1379 1380 Deque<RefPtr<Element> > m_fullScreenChangeEventTargetQueue; 1380 1381 bool m_isAnimatingFullScreen; 1381 IntRect m_savedPlaceholderFrameRect;1382 LayoutRect m_savedPlaceholderFrameRect; 1382 1383 RefPtr<RenderStyle> m_savedPlaceholderRenderStyle; 1383 1384 #endif -
trunk/Source/WebCore/editing/DeleteButtonController.cpp
r85864 r90517 91 91 92 92 RenderBox* box = toRenderBox(renderer); 93 IntRect borderBoundingBox = box->borderBoundingBox();93 LayoutRect borderBoundingBox = box->borderBoundingBox(); 94 94 if (borderBoundingBox.width() < minimumWidth || borderBoundingBox.height() < minimumHeight) 95 95 return false; -
trunk/Source/WebCore/inspector/DOMNodeHighlighter.cpp
r89815 r90517 232 232 return; 233 233 234 IntSize mainFrameOffset = frameToMainFrameOffset(containingFrame);235 IntRect boundingBox = renderer->absoluteBoundingBoxRect(true);234 LayoutSize mainFrameOffset = frameToMainFrameOffset(containingFrame); 235 LayoutRect boundingBox = renderer->absoluteBoundingBoxRect(true); 236 236 237 237 boundingBox.move(mainFrameOffset); … … 256 256 257 257 // RenderBox returns the "pure" content area box, exclusive of the scrollbars (if present), which also count towards the content area in CSS. 258 IntRect contentBox = renderBox->contentBoxRect();258 LayoutRect contentBox = renderBox->contentBoxRect(); 259 259 contentBox.setWidth(contentBox.width() + renderBox->verticalScrollbarWidth()); 260 260 contentBox.setHeight(contentBox.height() + renderBox->horizontalScrollbarHeight()); 261 261 262 IntRect paddingBox(contentBox.x() - renderBox->paddingLeft(), contentBox.y() - renderBox->paddingTop(),262 LayoutRect paddingBox(contentBox.x() - renderBox->paddingLeft(), contentBox.y() - renderBox->paddingTop(), 263 263 contentBox.width() + renderBox->paddingLeft() + renderBox->paddingRight(), contentBox.height() + renderBox->paddingTop() + renderBox->paddingBottom()); 264 IntRect borderBox(paddingBox.x() - renderBox->borderLeft(), paddingBox.y() - renderBox->borderTop(),264 LayoutRect borderBox(paddingBox.x() - renderBox->borderLeft(), paddingBox.y() - renderBox->borderTop(), 265 265 paddingBox.width() + renderBox->borderLeft() + renderBox->borderRight(), paddingBox.height() + renderBox->borderTop() + renderBox->borderBottom()); 266 IntRect marginBox(borderBox.x() - renderBox->marginLeft(), borderBox.y() - renderBox->marginTop(),266 LayoutRect marginBox(borderBox.x() - renderBox->marginLeft(), borderBox.y() - renderBox->marginTop(), 267 267 borderBox.width() + renderBox->marginLeft() + renderBox->marginRight(), borderBox.height() + renderBox->marginTop() + renderBox->marginBottom()); 268 268 -
trunk/Source/WebCore/page/animation/AnimationBase.cpp
r88804 r90517 176 176 } else { 177 177 // Convert the TransformOperations into matrices 178 IntSize size = anim->renderer()->isBox() ? toRenderBox(anim->renderer())->borderBoxRect().size() : IntSize();178 LayoutSize size = anim->renderer()->isBox() ? toRenderBox(anim->renderer())->borderBoxRect().size() : LayoutSize(); 179 179 TransformationMatrix fromT; 180 180 TransformationMatrix toT; -
trunk/Source/WebCore/platform/ScrollView.h
r89753 r90517 146 146 IntRect actualVisibleContentRect() const { return m_actualVisibleContentRect.isEmpty() ? visibleContentRect() : m_actualVisibleContentRect; } 147 147 void setActualVisibleContentRect(const IntRect& actualVisibleContentRect) { m_actualVisibleContentRect = actualVisibleContentRect; } 148 int visibleWidth() const { return visibleContentRect().width(); }149 int visibleHeight() const { return visibleContentRect().height(); }148 LayoutUnit visibleWidth() const { return visibleContentRect().width(); } 149 LayoutUnit visibleHeight() const { return visibleContentRect().height(); } 150 150 151 151 // Functions for getting/setting the size webkit should use to layout the contents. By default this is the same as the visible -
trunk/Source/WebCore/platform/ScrollableArea.h
r90152 r90517 27 27 #define ScrollableArea_h 28 28 29 #include " IntRect.h"29 #include "LayoutTypes.h" 30 30 #include "Scrollbar.h" 31 31 #include <wtf/Vector.h> … … 123 123 virtual IntPoint maximumScrollPosition() const { ASSERT_NOT_REACHED(); return IntPoint(); } 124 124 virtual IntRect visibleContentRect(bool /*includeScrollbars*/ = false) const { ASSERT_NOT_REACHED(); return IntRect(); } 125 virtual int visibleHeight() const { ASSERT_NOT_REACHED(); return 0; }126 virtual int visibleWidth() const { ASSERT_NOT_REACHED(); return 0; }125 virtual LayoutUnit visibleHeight() const { ASSERT_NOT_REACHED(); return 0; } 126 virtual LayoutUnit visibleWidth() const { ASSERT_NOT_REACHED(); return 0; } 127 127 virtual IntSize contentsSize() const { ASSERT_NOT_REACHED(); return IntSize(); } 128 128 virtual IntSize overhangAmount() const { ASSERT_NOT_REACHED(); return IntSize(); } -
trunk/Source/WebCore/platform/graphics/FloatPoint.h
r90167 r90517 97 97 m_y += a.height(); 98 98 } 99 void move(const FloatSize& a) 100 { 101 m_x += a.width(); 102 m_y += a.height(); 103 } 99 104 void moveBy(const IntPoint& a) 105 { 106 m_x += a.x(); 107 m_y += a.y(); 108 } 109 void moveBy(const FloatPoint& a) 100 110 { 101 111 m_x += a.x(); -
trunk/Source/WebCore/rendering/AutoTableLayout.cpp
r90302 r90517 253 253 maxNonPercent = maxNonPercent * 100 / max(remainingPercent, epsilon); 254 254 // FIXME: Remove unnecessary rounding when layout is off ints: webkit.org/b/63656 255 maxWidth = max (maxWidth, static_cast<int>(min(maxNonPercent, numeric_limits<LayoutUnit>::max() / 2.0f)));256 maxWidth = max (maxWidth, static_cast<int>(min(maxPercent, numeric_limits<LayoutUnit>::max() / 2.0f)));255 maxWidth = max<LayoutUnit>(maxWidth, static_cast<LayoutUnit>(min(maxNonPercent, numeric_limits<LayoutUnit>::max() / 2.0f))); 256 maxWidth = max<LayoutUnit>(maxWidth, static_cast<LayoutUnit>(min(maxPercent, numeric_limits<LayoutUnit>::max() / 2.0f))); 257 257 } 258 258 … … 265 265 Length tableLogicalWidth = m_table->style()->logicalWidth(); 266 266 if (tableLogicalWidth.isFixed() && tableLogicalWidth.value() > 0) { 267 minWidth = max (minWidth, tableLogicalWidth.value());267 minWidth = max<LayoutUnit>(minWidth, tableLogicalWidth.value()); 268 268 maxWidth = minWidth; 269 269 } else if (!remainingPercent && maxNonPercent) { … … 552 552 // the lines below might look inconsistent, but that's the way it's handled in mozilla 553 553 excess -= reduction; 554 LayoutUnit newLogicalWidth = max (m_layoutStruct[i].effectiveMinLogicalWidth, cellLogicalWidth - reduction);554 LayoutUnit newLogicalWidth = max<LayoutUnit>(m_layoutStruct[i].effectiveMinLogicalWidth, cellLogicalWidth - reduction); 555 555 available += cellLogicalWidth - newLogicalWidth; 556 556 m_layoutStruct[i].computedLogicalWidth = newLogicalWidth; … … 590 590 Length& logicalWidth = m_layoutStruct[i].effectiveLogicalWidth; 591 591 if (logicalWidth.isAuto() && totalAuto && !m_layoutStruct[i].emptyCellsOnly) { 592 LayoutUnit cellLogicalWidth = max (m_layoutStruct[i].computedLogicalWidth, static_cast<LayoutUnit>(available * static_cast<float>(m_layoutStruct[i].effectiveMaxLogicalWidth) / totalAuto));592 LayoutUnit cellLogicalWidth = max<LayoutUnit>(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; -
trunk/Source/WebCore/rendering/InlineFlowBox.h
r90515 r90517 197 197 // For horizontal-tb and vertical-lr they will match physical directions, but for horizontal-bt and vertical-rl, the top/bottom and left/right 198 198 // respectively are flipped when compared to their physical counterparts. For example minX is on the left in vertical-lr, but it is on the right in vertical-rl. 199 IntRect layoutOverflowRect(int lineTop, int lineBottom) const199 LayoutRect layoutOverflowRect(LayoutUnit lineTop, LayoutUnit lineBottom) const 200 200 { 201 201 return m_overflow ? m_overflow->layoutOverflowRect() : enclosingIntRect(frameRectIncludingLineHeight(lineTop, lineBottom)); 202 202 } 203 int logicalLeftLayoutOverflow() const { return m_overflow ? (isHorizontal() ? m_overflow->minXLayoutOverflow() : m_overflow->minYLayoutOverflow()) : logicalLeft(); }204 int logicalRightLayoutOverflow() const { return m_overflow ? (isHorizontal() ? m_overflow->maxXLayoutOverflow() : m_overflow->maxYLayoutOverflow()) : ceilf(logicalRight()); }205 int logicalTopLayoutOverflow(int lineTop) const203 LayoutUnit logicalLeftLayoutOverflow() const { return m_overflow ? (isHorizontal() ? m_overflow->minXLayoutOverflow() : m_overflow->minYLayoutOverflow()) : logicalLeft(); } 204 LayoutUnit logicalRightLayoutOverflow() const { return m_overflow ? (isHorizontal() ? m_overflow->maxXLayoutOverflow() : m_overflow->maxYLayoutOverflow()) : ceilf(logicalRight()); } 205 LayoutUnit logicalTopLayoutOverflow(LayoutUnit lineTop) const 206 206 { 207 207 if (m_overflow) … … 209 209 return lineTop; 210 210 } 211 int logicalBottomLayoutOverflow(int lineBottom) const211 LayoutUnit logicalBottomLayoutOverflow(LayoutUnit lineBottom) const 212 212 { 213 213 if (m_overflow) … … 215 215 return lineBottom; 216 216 } 217 IntRect logicalLayoutOverflowRect(int lineTop, int lineBottom) const218 { 219 IntRect result = layoutOverflowRect(lineTop, lineBottom);217 LayoutRect logicalLayoutOverflowRect(LayoutUnit lineTop, LayoutUnit lineBottom) const 218 { 219 LayoutRect result = layoutOverflowRect(lineTop, lineBottom); 220 220 if (!renderer()->isHorizontalWritingMode()) 221 221 result = result.transposedRect(); … … 223 223 } 224 224 225 IntRect visualOverflowRect(int lineTop, int lineBottom) const225 LayoutRect visualOverflowRect(LayoutUnit lineTop, LayoutUnit lineBottom) const 226 226 { 227 227 return m_overflow ? m_overflow->visualOverflowRect() : enclosingIntRect(frameRectIncludingLineHeight(lineTop, lineBottom)); 228 228 } 229 int logicalLeftVisualOverflow() const { return m_overflow ? (isHorizontal() ? m_overflow->minXVisualOverflow() : m_overflow->minYVisualOverflow()) : logicalLeft(); }230 int logicalRightVisualOverflow() const { return m_overflow ? (isHorizontal() ? m_overflow->maxXVisualOverflow() : m_overflow->maxYVisualOverflow()) : ceilf(logicalRight()); }231 int logicalTopVisualOverflow(int lineTop) const229 LayoutUnit logicalLeftVisualOverflow() const { return m_overflow ? (isHorizontal() ? m_overflow->minXVisualOverflow() : m_overflow->minYVisualOverflow()) : logicalLeft(); } 230 LayoutUnit logicalRightVisualOverflow() const { return m_overflow ? (isHorizontal() ? m_overflow->maxXVisualOverflow() : m_overflow->maxYVisualOverflow()) : ceilf(logicalRight()); } 231 LayoutUnit logicalTopVisualOverflow(LayoutUnit lineTop) const 232 232 { 233 233 if (m_overflow) … … 235 235 return lineTop; 236 236 } 237 int logicalBottomVisualOverflow(int lineBottom) const237 LayoutUnit logicalBottomVisualOverflow(LayoutUnit lineBottom) const 238 238 { 239 239 if (m_overflow) … … 241 241 return lineBottom; 242 242 } 243 IntRect logicalVisualOverflowRect(int lineTop, int lineBottom) const244 { 245 IntRect result = visualOverflowRect(lineTop, lineBottom);243 LayoutRect logicalVisualOverflowRect(LayoutUnit lineTop, LayoutUnit lineBottom) const 244 { 245 LayoutRect result = visualOverflowRect(lineTop, lineBottom); 246 246 if (!renderer()->isHorizontalWritingMode()) 247 247 result = result.transposedRect(); … … 249 249 } 250 250 251 void setOverflowFromLogicalRects(const IntRect& logicalLayoutOverflow, const IntRect& logicalVisualOverflow, int lineTop, int lineBottom);252 void setLayoutOverflow(const IntRect&, int lineTop, int lineBottom);253 void setVisualOverflow(const IntRect&, int lineTop, int lineBottom);254 255 FloatRect frameRectIncludingLineHeight( int lineTop, int lineBottom) const251 void setOverflowFromLogicalRects(const LayoutRect& logicalLayoutOverflow, const IntRect& logicalVisualOverflow, LayoutUnit lineTop, LayoutUnit lineBottom); 252 void setLayoutOverflow(const LayoutRect&, LayoutUnit lineTop, LayoutUnit lineBottom); 253 void setVisualOverflow(const LayoutRect&, LayoutUnit lineTop, LayoutUnit lineBottom); 254 255 FloatRect frameRectIncludingLineHeight(LayoutUnit lineTop, LayoutUnit lineBottom) const 256 256 { 257 257 if (isHorizontal()) … … 260 260 } 261 261 262 FloatRect logicalFrameRectIncludingLineHeight( int lineTop, int lineBottom) const262 FloatRect logicalFrameRectIncludingLineHeight(LayoutUnit lineTop, LayoutUnit lineBottom) const 263 263 { 264 264 return FloatRect(logicalLeft(), lineTop, logicalWidth(), lineBottom - lineTop); -
trunk/Source/WebCore/rendering/RenderBlock.h
r90515 r90517 807 807 static int positiveMarginBeforeDefault(const RenderBlock* block) 808 808 { 809 return std::max (block->marginBefore(), 0);809 return std::max<LayoutUnit>(block->marginBefore(), 0); 810 810 } 811 811 812 812 static int negativeMarginBeforeDefault(const RenderBlock* block) 813 813 { 814 return std::max (-block->marginBefore(), 0);814 return std::max<LayoutUnit>(-block->marginBefore(), 0); 815 815 } 816 816 static int positiveMarginAfterDefault(const RenderBlock* block) 817 817 { 818 return std::max (block->marginAfter(), 0);818 return std::max<LayoutUnit>(block->marginAfter(), 0); 819 819 } 820 820 static int negativeMarginAfterDefault(const RenderBlock* block) 821 821 { 822 return std::max (-block->marginAfter(), 0);822 return std::max<LayoutUnit>(-block->marginAfter(), 0); 823 823 } 824 824
Note: See TracChangeset
for help on using the changeset viewer.