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

Side by Side Diff: sky/engine/core/rendering/RenderLayerScrollableArea.cpp

Issue 694703002: Remove lots of dead virtuals from Element. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « sky/engine/core/rendering/RenderBox.cpp ('k') | sky/engine/public/web/WebElement.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1164 matching lines...) Expand 10 before | Expand all | Expand 10 after
1175 newOffset.setWidth(-newOffset.width()); 1175 newOffset.setWidth(-newOffset.width());
1176 adjustedOldOffset.setWidth(-adjustedOldOffset.width()); 1176 adjustedOldOffset.setWidth(-adjustedOldOffset.width());
1177 } 1177 }
1178 1178
1179 LayoutSize difference = (currentSize + newOffset - adjustedOldOffset).expand edTo(minimumSize) - currentSize; 1179 LayoutSize difference = (currentSize + newOffset - adjustedOldOffset).expand edTo(minimumSize) - currentSize;
1180 1180
1181 bool isBoxSizingBorder = box().style()->boxSizing() == BORDER_BOX; 1181 bool isBoxSizingBorder = box().style()->boxSizing() == BORDER_BOX;
1182 1182
1183 EResize resize = box().style()->resize(); 1183 EResize resize = box().style()->resize();
1184 if (resize != RESIZE_VERTICAL && difference.width()) { 1184 if (resize != RESIZE_VERTICAL && difference.width()) {
1185 if (element->isFormControlElement()) {
1186 // Make implicit margins from the theme explicit (see <http://bugs.w ebkit.org/show_bug.cgi?id=9547>).
1187 element->setInlineStyleProperty(CSSPropertyMarginLeft, box().marginL eft() / zoomFactor, CSSPrimitiveValue::CSS_PX);
1188 element->setInlineStyleProperty(CSSPropertyMarginRight, box().margin Right() / zoomFactor, CSSPrimitiveValue::CSS_PX);
1189 }
1190 LayoutUnit baseWidth = box().width() - (isBoxSizingBorder ? LayoutUnit() : box().borderAndPaddingWidth()); 1185 LayoutUnit baseWidth = box().width() - (isBoxSizingBorder ? LayoutUnit() : box().borderAndPaddingWidth());
1191 baseWidth = baseWidth / zoomFactor; 1186 baseWidth = baseWidth / zoomFactor;
1192 element->setInlineStyleProperty(CSSPropertyWidth, roundToInt(baseWidth + difference.width()), CSSPrimitiveValue::CSS_PX); 1187 element->setInlineStyleProperty(CSSPropertyWidth, roundToInt(baseWidth + difference.width()), CSSPrimitiveValue::CSS_PX);
1193 } 1188 }
1194 1189
1195 if (resize != RESIZE_HORIZONTAL && difference.height()) { 1190 if (resize != RESIZE_HORIZONTAL && difference.height()) {
1196 if (element->isFormControlElement()) {
1197 // Make implicit margins from the theme explicit (see <http://bugs.w ebkit.org/show_bug.cgi?id=9547>).
1198 element->setInlineStyleProperty(CSSPropertyMarginTop, box().marginTo p() / zoomFactor, CSSPrimitiveValue::CSS_PX);
1199 element->setInlineStyleProperty(CSSPropertyMarginBottom, box().margi nBottom() / zoomFactor, CSSPrimitiveValue::CSS_PX);
1200 }
1201 LayoutUnit baseHeight = box().height() - (isBoxSizingBorder ? LayoutUnit () : box().borderAndPaddingHeight()); 1191 LayoutUnit baseHeight = box().height() - (isBoxSizingBorder ? LayoutUnit () : box().borderAndPaddingHeight());
1202 baseHeight = baseHeight / zoomFactor; 1192 baseHeight = baseHeight / zoomFactor;
1203 element->setInlineStyleProperty(CSSPropertyHeight, roundToInt(baseHeight + difference.height()), CSSPrimitiveValue::CSS_PX); 1193 element->setInlineStyleProperty(CSSPropertyHeight, roundToInt(baseHeight + difference.height()), CSSPrimitiveValue::CSS_PX);
1204 } 1194 }
1205 1195
1206 document.updateLayout(); 1196 document.updateLayout();
1207 1197
1208 // FIXME (Radar 4118564): We should also autoscroll the window as necessary to keep the point under the cursor in view. 1198 // FIXME (Radar 4118564): We should also autoscroll the window as necessary to keep the point under the cursor in view.
1209 } 1199 }
1210 1200
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
1295 void RenderLayerScrollableArea::setTopmostScrollChild(RenderLayer* scrollChild) 1285 void RenderLayerScrollableArea::setTopmostScrollChild(RenderLayer* scrollChild)
1296 { 1286 {
1297 // We only want to track the topmost scroll child for scrollable areas with 1287 // We only want to track the topmost scroll child for scrollable areas with
1298 // overlay scrollbars. 1288 // overlay scrollbars.
1299 if (!hasOverlayScrollbars()) 1289 if (!hasOverlayScrollbars())
1300 return; 1290 return;
1301 m_nextTopmostScrollChild = scrollChild; 1291 m_nextTopmostScrollChild = scrollChild;
1302 } 1292 }
1303 1293
1304 } // namespace blink 1294 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/RenderBox.cpp ('k') | sky/engine/public/web/WebElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698