Changeset 201114 in webkit
- Timestamp:
- May 18, 2016, 4:25:47 PM (9 years ago)
- Location:
- trunk/Source
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r201113 r201114 1 2016-05-18 Zalan Bujtas <zalan@apple.com> 2 3 Remove LayoutUnit::operator unsigned(). 4 https://bugs.webkit.org/show_bug.cgi?id=157856 5 6 Reviewed by Simon Fraser. 7 8 Converting LayoutUnit values to unsigned is lossy. We should avoid 9 such implicit conversions. 10 11 No behaviour change. 12 13 * html/ImageInputType.cpp: 14 (WebCore::ImageInputType::height): 15 (WebCore::ImageInputType::width): 16 * page/EventHandler.cpp: 17 (WebCore::EventHandler::hitTestResultAtPoint): 18 * platform/LayoutUnit.h: 19 (WebCore::LayoutUnit::operator unsigned): Deleted. 20 * rendering/RenderBlockFlow.cpp: 21 (WebCore::RenderBlockFlow::computeColumnCountAndWidth): 22 1 23 2016-05-18 Alex Christensen <achristensen@webkit.org> 2 24 -
trunk/Source/WebCore/html/ImageInputType.cpp
r200041 r201114 183 183 HTMLImageLoader* imageLoader = element->imageLoader(); 184 184 if (imageLoader && imageLoader->image()) 185 return imageLoader->image()->imageSizeForRenderer(element->renderer(), 1).height() ;185 return imageLoader->image()->imageSizeForRenderer(element->renderer(), 1).height().toUnsigned(); 186 186 } 187 187 … … 204 204 HTMLImageLoader* imageLoader = element->imageLoader(); 205 205 if (imageLoader && imageLoader->image()) 206 return imageLoader->image()->imageSizeForRenderer(element->renderer(), 1).width() ;206 return imageLoader->image()->imageSizeForRenderer(element->renderer(), 1).width().toUnsigned(); 207 207 } 208 208 -
trunk/Source/WebCore/page/EventHandler.cpp
r200971 r201114 1132 1132 } 1133 1133 1134 HitTestResult result(point, padding.height(), padding.width(), padding.height(), padding.width()); 1134 unsigned nonNegativePaddingWidth = std::max<LayoutUnit>(0, padding.width()).toUnsigned(); 1135 unsigned nonNegativePaddingHeight = std::max<LayoutUnit>(0, padding.height()).toUnsigned(); 1136 HitTestResult result(point, nonNegativePaddingHeight, nonNegativePaddingWidth, nonNegativePaddingHeight, nonNegativePaddingWidth); 1135 1137 1136 1138 RenderView* renderView = m_frame.contentRenderer(); -
trunk/Source/WebCore/platform/LayoutUnit.h
r192357 r201114 115 115 116 116 operator int() const { return toInt(); } 117 operator unsigned() const { return toUnsigned(); }118 117 operator float() const { return toFloat(); } 119 118 operator double() const { return toDouble(); } -
trunk/Source/WebCore/rendering/RenderBlockFlow.cpp
r201104 r201114 413 413 LayoutUnit colGap = columnGap(); 414 414 LayoutUnit colWidth = std::max<LayoutUnit>(LayoutUnit::fromPixel(1), LayoutUnit(style().columnWidth())); 415 int colCount = std::max<int>(1, style().columnCount());415 unsigned colCount = std::max<unsigned>(1, style().columnCount()); 416 416 417 417 if (style().hasAutoColumnWidth() && !style().hasAutoColumnCount()) { … … 419 419 desiredColumnWidth = std::max<LayoutUnit>(0, (availWidth - ((desiredColumnCount - 1) * colGap)) / desiredColumnCount); 420 420 } else if (!style().hasAutoColumnWidth() && style().hasAutoColumnCount()) { 421 desiredColumnCount = std::max<LayoutUnit>(1, (availWidth + colGap) / (colWidth + colGap)) ;421 desiredColumnCount = std::max<LayoutUnit>(1, (availWidth + colGap) / (colWidth + colGap)).toUnsigned(); 422 422 desiredColumnWidth = ((availWidth + colGap) / desiredColumnCount) - colGap; 423 423 } else { 424 desiredColumnCount = std::max<LayoutUnit>(std::min<LayoutUnit>(colCount, (availWidth + colGap) / (colWidth + colGap)), 1) ;424 desiredColumnCount = std::max<LayoutUnit>(std::min<LayoutUnit>(colCount, (availWidth + colGap) / (colWidth + colGap)), 1).toUnsigned(); 425 425 desiredColumnWidth = ((availWidth + colGap) / desiredColumnCount) - colGap; 426 426 } -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r200588 r201114 5105 5105 LayoutUnit contentArea = pluginRenderBox.contentWidth() * pluginRenderBox.contentHeight(); 5106 5106 if (contentArea > candidatePlugInArea * primarySnapshottedPlugInSearchBucketSize) { 5107 candidatePlugInArea = contentArea ;5107 candidatePlugInArea = contentArea.toUnsigned(); 5108 5108 return true; 5109 5109 }
Note:
See TracChangeset
for help on using the changeset viewer.