Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp

Issue 1660863002: Force all LayoutUnit construction to be explicit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Also fix LayoutRectTest.cpp Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
5 * 5 *
6 * Other contributors: 6 * Other contributors:
7 * Robert O'Callahan <roc+@cs.cmu.edu> 7 * Robert O'Callahan <roc+@cs.cmu.edu>
8 * David Baron <dbaron@fas.harvard.edu> 8 * David Baron <dbaron@fas.harvard.edu>
9 * Christian Biesinger <cbiesinger@gmail.com> 9 * Christian Biesinger <cbiesinger@gmail.com>
10 * Randall Jesup <rjesup@wgate.com> 10 * Randall Jesup <rjesup@wgate.com>
(...skipping 1263 matching lines...) Expand 10 before | Expand all | Expand 10 after
1274 bool isBoxSizingBorder = box().style()->boxSizing() == BORDER_BOX; 1274 bool isBoxSizingBorder = box().style()->boxSizing() == BORDER_BOX;
1275 1275
1276 EResize resize = box().style()->resize(); 1276 EResize resize = box().style()->resize();
1277 if (resize != RESIZE_VERTICAL && difference.width()) { 1277 if (resize != RESIZE_VERTICAL && difference.width()) {
1278 if (element->isFormControlElement()) { 1278 if (element->isFormControlElement()) {
1279 // Make implicit margins from the theme explicit (see <http://bugs.w ebkit.org/show_bug.cgi?id=9547>). 1279 // Make implicit margins from the theme explicit (see <http://bugs.w ebkit.org/show_bug.cgi?id=9547>).
1280 element->setInlineStyleProperty(CSSPropertyMarginLeft, box().marginL eft() / zoomFactor, CSSPrimitiveValue::UnitType::Pixels); 1280 element->setInlineStyleProperty(CSSPropertyMarginLeft, box().marginL eft() / zoomFactor, CSSPrimitiveValue::UnitType::Pixels);
1281 element->setInlineStyleProperty(CSSPropertyMarginRight, box().margin Right() / zoomFactor, CSSPrimitiveValue::UnitType::Pixels); 1281 element->setInlineStyleProperty(CSSPropertyMarginRight, box().margin Right() / zoomFactor, CSSPrimitiveValue::UnitType::Pixels);
1282 } 1282 }
1283 LayoutUnit baseWidth = box().size().width() - (isBoxSizingBorder ? Layou tUnit() : box().borderAndPaddingWidth()); 1283 LayoutUnit baseWidth = box().size().width() - (isBoxSizingBorder ? Layou tUnit() : box().borderAndPaddingWidth());
1284 baseWidth = baseWidth / zoomFactor; 1284 baseWidth = LayoutUnit(baseWidth / zoomFactor);
1285 element->setInlineStyleProperty(CSSPropertyWidth, roundToInt(baseWidth + difference.width()), CSSPrimitiveValue::UnitType::Pixels); 1285 element->setInlineStyleProperty(CSSPropertyWidth, roundToInt(baseWidth + difference.width()), CSSPrimitiveValue::UnitType::Pixels);
1286 } 1286 }
1287 1287
1288 if (resize != RESIZE_HORIZONTAL && difference.height()) { 1288 if (resize != RESIZE_HORIZONTAL && difference.height()) {
1289 if (element->isFormControlElement()) { 1289 if (element->isFormControlElement()) {
1290 // Make implicit margins from the theme explicit (see <http://bugs.w ebkit.org/show_bug.cgi?id=9547>). 1290 // Make implicit margins from the theme explicit (see <http://bugs.w ebkit.org/show_bug.cgi?id=9547>).
1291 element->setInlineStyleProperty(CSSPropertyMarginTop, box().marginTo p() / zoomFactor, CSSPrimitiveValue::UnitType::Pixels); 1291 element->setInlineStyleProperty(CSSPropertyMarginTop, box().marginTo p() / zoomFactor, CSSPrimitiveValue::UnitType::Pixels);
1292 element->setInlineStyleProperty(CSSPropertyMarginBottom, box().margi nBottom() / zoomFactor, CSSPrimitiveValue::UnitType::Pixels); 1292 element->setInlineStyleProperty(CSSPropertyMarginBottom, box().margi nBottom() / zoomFactor, CSSPrimitiveValue::UnitType::Pixels);
1293 } 1293 }
1294 LayoutUnit baseHeight = box().size().height() - (isBoxSizingBorder ? Lay outUnit() : box().borderAndPaddingHeight()); 1294 LayoutUnit baseHeight = box().size().height() - (isBoxSizingBorder ? Lay outUnit() : box().borderAndPaddingHeight());
1295 baseHeight = baseHeight / zoomFactor; 1295 baseHeight = LayoutUnit(baseHeight / zoomFactor);
1296 element->setInlineStyleProperty(CSSPropertyHeight, roundToInt(baseHeight + difference.height()), CSSPrimitiveValue::UnitType::Pixels); 1296 element->setInlineStyleProperty(CSSPropertyHeight, roundToInt(baseHeight + difference.height()), CSSPrimitiveValue::UnitType::Pixels);
1297 } 1297 }
1298 1298
1299 document.updateLayout(); 1299 document.updateLayout();
1300 1300
1301 // FIXME (Radar 4118564): We should also autoscroll the window as necessary to keep the point under the cursor in view. 1301 // FIXME (Radar 4118564): We should also autoscroll the window as necessary to keep the point under the cursor in view.
1302 } 1302 }
1303 1303
1304 LayoutRect PaintLayerScrollableArea::scrollIntoView(const LayoutRect& rect, cons t ScrollAlignment& alignX, const ScrollAlignment& alignY, ScrollType scrollType) 1304 LayoutRect PaintLayerScrollableArea::scrollIntoView(const LayoutRect& rect, cons t ScrollAlignment& alignX, const ScrollAlignment& alignY, ScrollType scrollType)
1305 { 1305 {
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
1534 } 1534 }
1535 1535
1536 DEFINE_TRACE(PaintLayerScrollableArea::ScrollbarManager) 1536 DEFINE_TRACE(PaintLayerScrollableArea::ScrollbarManager)
1537 { 1537 {
1538 visitor->trace(m_scrollableArea); 1538 visitor->trace(m_scrollableArea);
1539 visitor->trace(m_hBar); 1539 visitor->trace(m_hBar);
1540 visitor->trace(m_vBar); 1540 visitor->trace(m_vBar);
1541 } 1541 }
1542 1542
1543 } // namespace blink 1543 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698