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

Issue 2261663002: Disallow cast/implicit conversion from LayoutUnit to int/unsigned (Closed)

Created:
4 years, 4 months ago by Xianzhu
Modified:
4 years, 4 months ago
CC:
chromium-reviews, blink-reviews-html_chromium.org, blink-reviews-platform-graphics_chromium.org, nzolghadr+blinkwatch_chromium.org, dshwang, eae+blinkwatch, apavlov+blink_chromium.org, kinuko+watch, rwlbuis, caseq+blink_chromium.org, krit, drott+blinkwatch_chromium.org, szager+layoutwatch_chromium.org, Justin Novosad, dglazkov+blink, Rik, jchaffraix+rendering, blink-reviews-paint_chromium.org, blink-reviews, ajuma+watch_chromium.org, jfernandez, blink-reviews-style_chromium.org, zoltan1, Manuel Rego, blink-reviews-layout_chromium.org, devtools-reviews_chromium.org, jbroman, lushnikov+blink_chromium.org, pdr+graphicswatchlist_chromium.org, Stephen Chennney, dtapuska+blinkwatch_chromium.org, svillar, pdr+renderingwatchlist_chromium.org, leviw+renderwatch, slimming-paint-reviews_chromium.org, pfeldman+blink_chromium.org, f(malita), danakj+watch_chromium.org, kozyatinskiy+blink_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Disallow cast/implicit conversion from LayoutUnit to int/unsigned Conversion from LayoutUnit to int/unsigned is lossy. Allowing implicit conversion also causes unexpected conversion when LayoutUnits and ints are mixed in invocation of overloaded functions which have both the all-LayoutUnit and all-int variations: the all-int variation is chosen instead of the all-LayoutUnit one, which might not the intention of the author. BUG=638981 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 Committed: https://crrev.com/7d87acb1c709a75cc6859bd75960744ee612d7bf Cr-Commit-Position: refs/heads/master@{#413578}

Patch Set 1 #

Patch Set 2 : - #

Patch Set 3 : - #

Patch Set 4 : - #

Patch Set 5 : - #

Patch Set 6 : - #

Total comments: 14

Patch Set 7 : - #

Unified diffs Side-by-side diffs Delta from patch set Stats (+243 lines, -239 lines) Patch
M third_party/WebKit/Source/core/editing/Editor.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/events/MouseRelatedEvent.h View 1 chunk +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/events/MouseRelatedEvent.cpp View 2 chunks +6 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/core/frame/FrameView.cpp View 1 2 3 4 5 6 chunks +12 lines, -11 lines 0 comments Download
M third_party/WebKit/Source/core/frame/FrameViewAutoSizeInfo.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLImageElement.cpp View 1 5 chunks +5 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/html/ImageDocument.cpp View 1 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/html/forms/ImageInputType.cpp View 2 chunks +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/input/EventHandler.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp View 1 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutBlock.cpp View 1 2 5 chunks +7 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp View 2 chunks +5 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp View 4 chunks +5 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutBox.cpp View 1 2 3 4 5 2 chunks +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutButton.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutDeprecatedFlexibleBox.cpp View 3 chunks +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutFieldset.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutFileUploadControl.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp View 1 2 3 3 chunks +7 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutFrameSet.cpp View 1 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutInline.cpp View 1 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutListMarker.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThread.cpp View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutReplaced.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutRubyBase.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutRubyRun.cpp View 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutRubyText.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutScrollbar.cpp View 1 2 3 4 chunks +10 lines, -10 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutScrollbarPart.cpp View 3 chunks +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutSlider.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutTable.h View 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutTable.cpp View 1 2 3 chunks +5 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutTableCell.h View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutTableCell.cpp View 2 chunks +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutTableSection.cpp View 3 chunks +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutText.cpp View 4 chunks +5 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutTextControl.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutTextControlSingleLine.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutTheme.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutTreeAsText.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutVTTCue.cpp View 1 chunk +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutView.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/MultiColumnFragmentainerGroup.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/TableLayoutAlgorithmAuto.cpp View 1 2 5 chunks +7 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/core/layout/TableLayoutAlgorithmFixed.cpp View 3 chunks +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/line/EllipsisBox.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/line/InlineBox.h View 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/layout/line/InlineBox.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/line/InlineFlowBox.h View 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp View 2 chunks +5 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/layout/line/InlineTextBox.cpp View 3 chunks +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/layout/line/LineBoxList.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/layout/line/RootInlineBox.cpp View 4 chunks +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/layout/shapes/RasterShape.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/page/FocusController.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/page/SpatialNavigation.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/paint/BackgroundImageGeometry.cpp View 1 2 3 4 5 6 5 chunks +5 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/paint/BoxPainter.cpp View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/paint/EllipsisBoxPainter.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp View 1 2 7 chunks +14 lines, -12 lines 0 comments Download
M third_party/WebKit/Source/core/paint/NinePieceImageGrid.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/paint/PaintLayer.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp View 1 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp View 1 6 chunks +15 lines, -13 lines 0 comments Download
M third_party/WebKit/Source/core/paint/TableSectionPainter.cpp View 1 2 3 4 5 6 1 chunk +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/paint/ThemePainterDefault.cpp View 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/paint/ViewPainter.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/style/ComputedStyle.cpp View 1 2 3 4 5 2 chunks +5 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/testing/Internals.cpp View 1 2 3 4 5 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/LayoutUnit.h View 1 2 3 4 5 6 1 chunk +6 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/LengthFunctions.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/geometry/IntRect.cpp View 1 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/web/RotationViewportAnchor.cpp View 2 chunks +2 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/web/WebInputEventConversion.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/web/WebPluginContainerImpl.cpp View 2 chunks +3 lines, -3 lines 0 comments Download

Messages

Total messages: 39 (28 generated)
Xianzhu
Ptal: eae@: Source/core/layout schenney@: Other directories.
4 years, 4 months ago (2016-08-22 17:00:52 UTC) #20
Stephen Chennney
LGTM for all of the non core/layout files. Where I could answer your "is this ...
4 years, 4 months ago (2016-08-22 17:46:10 UTC) #21
eae
LGTM for core/layout
4 years, 4 months ago (2016-08-22 17:58:54 UTC) #22
mstensho (USE GERRIT)
https://codereview.chromium.org/2261663002/diff/100001/third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThread.cpp File third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThread.cpp (right): https://codereview.chromium.org/2261663002/diff/100001/third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThread.cpp#newcode592 third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThread.cpp:592: count = std::max(count, 1u); What's this for? The line ...
4 years, 4 months ago (2016-08-22 18:05:18 UTC) #24
Xianzhu
https://codereview.chromium.org/2261663002/diff/100001/third_party/WebKit/Source/core/paint/BackgroundImageGeometry.cpp File third_party/WebKit/Source/core/paint/BackgroundImageGeometry.cpp (right): https://codereview.chromium.org/2261663002/diff/100001/third_party/WebKit/Source/core/paint/BackgroundImageGeometry.cpp#newcode234 third_party/WebKit/Source/core/paint/BackgroundImageGeometry.cpp:234: // TODO(crbug.com/638981): Is the conversion to int intentional? On ...
4 years, 4 months ago (2016-08-22 18:14:38 UTC) #25
Xianzhu
https://codereview.chromium.org/2261663002/diff/100001/third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThread.cpp File third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThread.cpp (right): https://codereview.chromium.org/2261663002/diff/100001/third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThread.cpp#newcode592 third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThread.cpp:592: count = std::max(count, 1u); On 2016/08/22 18:05:17, mstensho wrote: ...
4 years, 4 months ago (2016-08-22 18:15:37 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2261663002/120001
4 years, 4 months ago (2016-08-22 18:34:44 UTC) #29
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_x64_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_rel_ng/builds/266207)
4 years, 4 months ago (2016-08-22 21:55:24 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2261663002/120001
4 years, 4 months ago (2016-08-22 22:04:03 UTC) #35
commit-bot: I haz the power
Committed patchset #7 (id:120001)
4 years, 4 months ago (2016-08-22 23:28:43 UTC) #37
commit-bot: I haz the power
4 years, 4 months ago (2016-08-22 23:30:42 UTC) #39
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/7d87acb1c709a75cc6859bd75960744ee612d7bf
Cr-Commit-Position: refs/heads/master@{#413578}

Powered by Google App Engine
This is Rietveld 408576698