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

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: Fix multicol 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@web.de> 9 * Christian Biesinger <cbiesinger@web.de>
10 * Randall Jesup <rjesup@wgate.com> 10 * Randall Jesup <rjesup@wgate.com>
(...skipping 1283 matching lines...) Expand 10 before | Expand all | Expand 10 after
1294 bool isBoxSizingBorder = box().style()->boxSizing() == BORDER_BOX; 1294 bool isBoxSizingBorder = box().style()->boxSizing() == BORDER_BOX;
1295 1295
1296 EResize resize = box().style()->resize(); 1296 EResize resize = box().style()->resize();
1297 if (resize != RESIZE_VERTICAL && difference.width()) { 1297 if (resize != RESIZE_VERTICAL && difference.width()) {
1298 if (element->isFormControlElement()) { 1298 if (element->isFormControlElement()) {
1299 // Make implicit margins from the theme explicit (see <http://bugs.w ebkit.org/show_bug.cgi?id=9547>). 1299 // Make implicit margins from the theme explicit (see <http://bugs.w ebkit.org/show_bug.cgi?id=9547>).
1300 element->setInlineStyleProperty(CSSPropertyMarginLeft, box().marginL eft() / zoomFactor, CSSPrimitiveValue::UnitType::Pixels); 1300 element->setInlineStyleProperty(CSSPropertyMarginLeft, box().marginL eft() / zoomFactor, CSSPrimitiveValue::UnitType::Pixels);
1301 element->setInlineStyleProperty(CSSPropertyMarginRight, box().margin Right() / zoomFactor, CSSPrimitiveValue::UnitType::Pixels); 1301 element->setInlineStyleProperty(CSSPropertyMarginRight, box().margin Right() / zoomFactor, CSSPrimitiveValue::UnitType::Pixels);
1302 } 1302 }
1303 LayoutUnit baseWidth = box().size().width() - (isBoxSizingBorder ? Layou tUnit() : box().borderAndPaddingWidth()); 1303 LayoutUnit baseWidth = box().size().width() - (isBoxSizingBorder ? Layou tUnit() : box().borderAndPaddingWidth());
1304 baseWidth = baseWidth / zoomFactor; 1304 baseWidth = LayoutUnit(baseWidth / zoomFactor);
1305 element->setInlineStyleProperty(CSSPropertyWidth, roundToInt(baseWidth + difference.width()), CSSPrimitiveValue::UnitType::Pixels); 1305 element->setInlineStyleProperty(CSSPropertyWidth, roundToInt(baseWidth + difference.width()), CSSPrimitiveValue::UnitType::Pixels);
1306 } 1306 }
1307 1307
1308 if (resize != RESIZE_HORIZONTAL && difference.height()) { 1308 if (resize != RESIZE_HORIZONTAL && difference.height()) {
1309 if (element->isFormControlElement()) { 1309 if (element->isFormControlElement()) {
1310 // Make implicit margins from the theme explicit (see <http://bugs.w ebkit.org/show_bug.cgi?id=9547>). 1310 // Make implicit margins from the theme explicit (see <http://bugs.w ebkit.org/show_bug.cgi?id=9547>).
1311 element->setInlineStyleProperty(CSSPropertyMarginTop, box().marginTo p() / zoomFactor, CSSPrimitiveValue::UnitType::Pixels); 1311 element->setInlineStyleProperty(CSSPropertyMarginTop, box().marginTo p() / zoomFactor, CSSPrimitiveValue::UnitType::Pixels);
1312 element->setInlineStyleProperty(CSSPropertyMarginBottom, box().margi nBottom() / zoomFactor, CSSPrimitiveValue::UnitType::Pixels); 1312 element->setInlineStyleProperty(CSSPropertyMarginBottom, box().margi nBottom() / zoomFactor, CSSPrimitiveValue::UnitType::Pixels);
1313 } 1313 }
1314 LayoutUnit baseHeight = box().size().height() - (isBoxSizingBorder ? Lay outUnit() : box().borderAndPaddingHeight()); 1314 LayoutUnit baseHeight = box().size().height() - (isBoxSizingBorder ? Lay outUnit() : box().borderAndPaddingHeight());
1315 baseHeight = baseHeight / zoomFactor; 1315 baseHeight = LayoutUnit(baseHeight / zoomFactor);
1316 element->setInlineStyleProperty(CSSPropertyHeight, roundToInt(baseHeight + difference.height()), CSSPrimitiveValue::UnitType::Pixels); 1316 element->setInlineStyleProperty(CSSPropertyHeight, roundToInt(baseHeight + difference.height()), CSSPrimitiveValue::UnitType::Pixels);
1317 } 1317 }
1318 1318
1319 document.updateLayout(); 1319 document.updateLayout();
1320 1320
1321 // FIXME (Radar 4118564): We should also autoscroll the window as necessary to keep the point under the cursor in view. 1321 // FIXME (Radar 4118564): We should also autoscroll the window as necessary to keep the point under the cursor in view.
1322 } 1322 }
1323 1323
1324 LayoutRect PaintLayerScrollableArea::scrollIntoView(const LayoutRect& rect, cons t ScrollAlignment& alignX, const ScrollAlignment& alignY, ScrollType scrollType) 1324 LayoutRect PaintLayerScrollableArea::scrollIntoView(const LayoutRect& rect, cons t ScrollAlignment& alignX, const ScrollAlignment& alignY, ScrollType scrollType)
1325 { 1325 {
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
1554 } 1554 }
1555 1555
1556 DEFINE_TRACE(PaintLayerScrollableArea::ScrollbarManager) 1556 DEFINE_TRACE(PaintLayerScrollableArea::ScrollbarManager)
1557 { 1557 {
1558 visitor->trace(m_scrollableArea); 1558 visitor->trace(m_scrollableArea);
1559 visitor->trace(m_hBar); 1559 visitor->trace(m_hBar);
1560 visitor->trace(m_vBar); 1560 visitor->trace(m_vBar);
1561 } 1561 }
1562 1562
1563 } // namespace blink 1563 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698