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

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

Issue 2261663002: Disallow cast/implicit conversion from LayoutUnit to int/unsigned (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: - Created 4 years, 4 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/paint/BoxPainter.h" 5 #include "core/paint/BoxPainter.h"
6 6
7 #include "core/HTMLNames.h" 7 #include "core/HTMLNames.h"
8 #include "core/frame/Settings.h" 8 #include "core/frame/Settings.h"
9 #include "core/html/HTMLFrameOwnerElement.h" 9 #include "core/html/HTMLFrameOwnerElement.h"
10 #include "core/layout/ImageQualityController.h" 10 #include "core/layout/ImageQualityController.h"
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 private: 271 private:
272 GraphicsContextStateSaver m_saver; 272 GraphicsContextStateSaver m_saver;
273 }; 273 };
274 274
275 FloatRoundedRect getBackgroundRoundedRect(const LayoutObject& obj, const LayoutR ect& borderRect, 275 FloatRoundedRect getBackgroundRoundedRect(const LayoutObject& obj, const LayoutR ect& borderRect,
276 const InlineFlowBox* box, LayoutUnit inlineBoxWidth, LayoutUnit inlineBoxHei ght, 276 const InlineFlowBox* box, LayoutUnit inlineBoxWidth, LayoutUnit inlineBoxHei ght,
277 bool includeLogicalLeftEdge, bool includeLogicalRightEdge) 277 bool includeLogicalLeftEdge, bool includeLogicalRightEdge)
278 { 278 {
279 FloatRoundedRect border = obj.style()->getRoundedBorderFor(borderRect, inclu deLogicalLeftEdge, includeLogicalRightEdge); 279 FloatRoundedRect border = obj.style()->getRoundedBorderFor(borderRect, inclu deLogicalLeftEdge, includeLogicalRightEdge);
280 if (box && (box->nextLineBox() || box->prevLineBox())) { 280 if (box && (box->nextLineBox() || box->prevLineBox())) {
281 FloatRoundedRect segmentBorder = obj.style()->getRoundedBorderFor(Layout Rect(0, 0, inlineBoxWidth, inlineBoxHeight), 281 // TODO(crbug.com/638981): Are the conversions to int (in LayoutRect(0, 0, ...)) intentional?
Stephen Chennney 2016/08/22 17:46:10 Yes, in this case I believe they are.
Xianzhu 2016/08/22 18:14:37 Done.
282 FloatRoundedRect segmentBorder = obj.style()->getRoundedBorderFor(Layout Rect(0, 0, inlineBoxWidth.toInt(), inlineBoxHeight.toInt()),
282 includeLogicalLeftEdge, includeLogicalRightEdge); 283 includeLogicalLeftEdge, includeLogicalRightEdge);
283 border.setRadii(segmentBorder.getRadii()); 284 border.setRadii(segmentBorder.getRadii());
284 } 285 }
285 return border; 286 return border;
286 } 287 }
287 288
288 FloatRoundedRect backgroundRoundedRectAdjustedForBleedAvoidance(const LayoutObje ct& obj, 289 FloatRoundedRect backgroundRoundedRectAdjustedForBleedAvoidance(const LayoutObje ct& obj,
289 const LayoutRect& borderRect, BackgroundBleedAvoidance bleedAvoidance, const InlineFlowBox* box, 290 const LayoutRect& borderRect, BackgroundBleedAvoidance bleedAvoidance, const InlineFlowBox* box,
290 const LayoutSize& boxSize, bool includeLogicalLeftEdge, bool includeLogicalR ightEdge) 291 const LayoutSize& boxSize, bool includeLogicalLeftEdge, bool includeLogicalR ightEdge)
291 { 292 {
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 } 868 }
868 } 869 }
869 870
870 bool BoxPainter::shouldForceWhiteBackgroundForPrintEconomy(const ComputedStyle& style, const Document& document) 871 bool BoxPainter::shouldForceWhiteBackgroundForPrintEconomy(const ComputedStyle& style, const Document& document)
871 { 872 {
872 return document.printing() && style.getPrintColorAdjust() == PrintColorAdjus tEconomy 873 return document.printing() && style.getPrintColorAdjust() == PrintColorAdjus tEconomy
873 && (!document.settings() || !document.settings()->shouldPrintBackgrounds ()); 874 && (!document.settings() || !document.settings()->shouldPrintBackgrounds ());
874 } 875 }
875 876
876 } // namespace blink 877 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698