Changeset 115691 in webkit
- Timestamp:
- Apr 30, 2012 5:06:37 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r115689 r115691 1 2012-04-30 Levi Weintraub <leviw@chromium.org> 2 3 Add absoluteValue method for LayoutUnits to allow overloading abs() 4 https://bugs.webkit.org/show_bug.cgi?id=85214 5 6 Reviewed by Eric Seidel. 7 8 Adding an absoluteValue free inline function that operates on LayoutUnits, which 9 allows us to have one function signature for ints or FractionalLayoutUnits. We 10 can't simply add a FractionalLayoutUnit flavor of abs because it confuses 11 some compilers due to the implicit FractionalLayoutUnit constructors that take 12 ints and floats. 13 14 No new tests. No change in behavior. 15 16 * page/SpatialNavigation.cpp: 17 (WebCore::distanceDataForNode): 18 * rendering/LayoutTypes.h: 19 (WebCore::absoluteValue): 20 (WebCore): 21 * rendering/RenderBlockLineLayout.cpp: 22 (WebCore::RenderBlock::checkPaginationAndFloatsAtEndLine): 23 * rendering/RenderLineBoxList.cpp: 24 (WebCore::RenderLineBoxList::rangeIntersectsRect): 25 * rendering/RenderObject.cpp: 26 (WebCore::RenderObject::repaintAfterLayoutIfNeeded): 27 1 28 2012-04-30 Levi Weintraub <leviw@chromium.org> 2 29 -
trunk/Source/WebCore/page/SpatialNavigation.cpp
r111243 r115691 646 646 case FocusDirectionLeft: 647 647 sameAxisDistance = exitPoint.x() - entryPoint.x(); 648 otherAxisDistance = abs (exitPoint.y() - entryPoint.y());648 otherAxisDistance = absoluteValue(exitPoint.y() - entryPoint.y()); 649 649 break; 650 650 case FocusDirectionUp: 651 651 sameAxisDistance = exitPoint.y() - entryPoint.y(); 652 otherAxisDistance = abs (exitPoint.x() - entryPoint.x());652 otherAxisDistance = absoluteValue(exitPoint.x() - entryPoint.x()); 653 653 break; 654 654 case FocusDirectionRight: 655 655 sameAxisDistance = entryPoint.x() - exitPoint.x(); 656 otherAxisDistance = abs (entryPoint.y() - exitPoint.y());656 otherAxisDistance = absoluteValue(entryPoint.y() - exitPoint.y()); 657 657 break; 658 658 case FocusDirectionDown: 659 659 sameAxisDistance = entryPoint.y() - exitPoint.y(); 660 otherAxisDistance = abs (entryPoint.x() - exitPoint.x());660 otherAxisDistance = absoluteValue(entryPoint.x() - exitPoint.x()); 661 661 break; 662 662 default: -
trunk/Source/WebCore/rendering/LayoutTypes.h
r113665 r115691 144 144 } 145 145 146 inline LayoutUnit absoluteValue(const LayoutUnit& value) 147 { 148 return abs(value); 149 } 150 146 151 inline LayoutSize toLayoutSize(const LayoutPoint& p) 147 152 { -
trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp
r114032 r115691 1758 1758 lastLine = nextLine; 1759 1759 1760 LayoutUnit logicalBottom = lastLine->lineBottomWithLeading() + abs (lineDelta);1760 LayoutUnit logicalBottom = lastLine->lineBottomWithLeading() + absoluteValue(lineDelta); 1761 1761 1762 1762 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); -
trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp
r115687 r115691 559 559 } 560 560 } 561 } while (abs (groupRemainingSpace) >= 1);561 } while (absoluteValue(groupRemainingSpace) >= 1); 562 562 } 563 563 … … 810 810 } 811 811 } 812 } while (abs (groupRemainingSpace) >= 1);812 } while (absoluteValue(groupRemainingSpace) >= 1); 813 813 } 814 814 -
trunk/Source/WebCore/rendering/RenderLineBoxList.cpp
r115343 r115691 156 156 LayoutUnit physicalStart = block->flipForWritingMode(logicalTop); 157 157 LayoutUnit physicalEnd = block->flipForWritingMode(logicalBottom); 158 LayoutUnit physicalExtent = abs (physicalEnd - physicalStart);158 LayoutUnit physicalExtent = absoluteValue(physicalEnd - physicalStart); 159 159 physicalStart = min(physicalStart, physicalEnd); 160 160 -
trunk/Source/WebCore/rendering/RenderObject.cpp
r115343 r115691 1430 1430 RenderStyle* outlineStyle = outlineStyleForRepaint(); 1431 1431 LayoutUnit ow = outlineStyle->outlineSize(); 1432 LayoutUnit width = abs (newOutlineBox.width() - oldOutlineBox.width());1432 LayoutUnit width = absoluteValue(newOutlineBox.width() - oldOutlineBox.width()); 1433 1433 if (width) { 1434 1434 LayoutUnit shadowLeft; … … 1449 1449 } 1450 1450 } 1451 LayoutUnit height = abs (newOutlineBox.height() - oldOutlineBox.height());1451 LayoutUnit height = absoluteValue(newOutlineBox.height() - oldOutlineBox.height()); 1452 1452 if (height) { 1453 1453 LayoutUnit shadowTop;
Note: See TracChangeset
for help on using the changeset viewer.