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

Issue 1412103005: Make sure line widths in the range of 0px and 1px are rounded up to 1px for visibility. (Closed)

Created:
5 years, 2 months ago by nainar
Modified:
5 years, 1 month ago
CC:
darktears, apavlov+blink_chromium.org, blink-reviews, blink-reviews-css, blink-reviews-style_chromium.org, chromium-reviews, dglazkov+blink, rwlbuis
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make sure line widths in the range of 0px and 1px are rounded up to 1px for visibility. Currently if a border/outline computes to less than 1px, convertLineWidth casts the value to unsigned int or short and hence returns a 0. This is inconsistent with FF and IE. This patch fixes that issue by performing all computation on a double and returning a 1 if computeLength returns a value between 0 and 1. Otherwise it returns a type casted result of computeLength. It fixes this in both StyleBuilder and AnimatableStyleBuilder. It also rebaselines the relevant tests. BUG=229428, 382483 Committed: https://crrev.com/f73426be35a4b02a6d029407db459a87bc5e4688 Cr-Commit-Position: refs/heads/master@{#357305}

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : #

Total comments: 6

Patch Set 7 : #

Total comments: 2

Patch Set 8 : #

Patch Set 9 : #

Total comments: 1

Patch Set 10 : #

Total comments: 2

Patch Set 11 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+62 lines, -16 lines) Patch
M third_party/WebKit/LayoutTests/TestExpectations View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/animations/interpolation/border-width-interpolation.html View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
A third_party/WebKit/LayoutTests/fast/css/round-up-all-line-width-less-than-1-greater-than-0.html View 1 2 3 4 5 6 7 8 9 1 chunk +37 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/resolver/AnimatedStyleBuilder.cpp View 1 2 3 4 6 chunks +13 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +9 lines, -9 lines 0 comments Download

Messages

Total messages: 23 (9 generated)
nainar
PTAL? Thanks!
5 years, 2 months ago (2015-10-20 05:15:59 UTC) #2
sashab
I don't think this is actually what we want. Some code (like animations code) needs ...
5 years, 2 months ago (2015-10-20 23:42:46 UTC) #3
nainar
PTAL? Thanks!
5 years, 2 months ago (2015-10-21 07:20:26 UTC) #5
alancutter (OOO until 2018)
https://codereview.chromium.org/1412103005/diff/100001/third_party/WebKit/LayoutTests/fast/css/round-up-all-line-width-less-than-1-greater-than-0.html File third_party/WebKit/LayoutTests/fast/css/round-up-all-line-width-less-than-1-greater-than-0.html (right): https://codereview.chromium.org/1412103005/diff/100001/third_party/WebKit/LayoutTests/fast/css/round-up-all-line-width-less-than-1-greater-than-0.html#newcode10 third_party/WebKit/LayoutTests/fast/css/round-up-all-line-width-less-than-1-greater-than-0.html:10: var expectedValues = ["0px", "1px", "1px", "1px", "1px", "1px", ...
5 years, 1 month ago (2015-10-27 04:10:32 UTC) #7
nainar
PTAL? Thanks! https://codereview.chromium.org/1412103005/diff/100001/third_party/WebKit/LayoutTests/fast/css/round-up-all-line-width-less-than-1-greater-than-0.html File third_party/WebKit/LayoutTests/fast/css/round-up-all-line-width-less-than-1-greater-than-0.html (right): https://codereview.chromium.org/1412103005/diff/100001/third_party/WebKit/LayoutTests/fast/css/round-up-all-line-width-less-than-1-greater-than-0.html#newcode10 third_party/WebKit/LayoutTests/fast/css/round-up-all-line-width-less-than-1-greater-than-0.html:10: var expectedValues = ["0px", "1px", "1px", "1px", ...
5 years, 1 month ago (2015-10-27 05:30:18 UTC) #8
nainar
Alan, Made the changes you asked for, PTAL? Thanks! https://codereview.chromium.org/1412103005/diff/120001/third_party/WebKit/LayoutTests/fast/css/round-up-all-line-width-less-than-1-greater-than-0.html File third_party/WebKit/LayoutTests/fast/css/round-up-all-line-width-less-than-1-greater-than-0.html (right): https://codereview.chromium.org/1412103005/diff/120001/third_party/WebKit/LayoutTests/fast/css/round-up-all-line-width-less-than-1-greater-than-0.html#newcode9 third_party/WebKit/LayoutTests/fast/css/round-up-all-line-width-less-than-1-greater-than-0.html:9: ...
5 years, 1 month ago (2015-10-29 03:59:40 UTC) #11
nainar
https://codereview.chromium.org/1412103005/diff/160001/third_party/WebKit/LayoutTests/fast/css/round-up-all-line-width-less-than-1-greater-than-0.html File third_party/WebKit/LayoutTests/fast/css/round-up-all-line-width-less-than-1-greater-than-0.html (right): https://codereview.chromium.org/1412103005/diff/160001/third_party/WebKit/LayoutTests/fast/css/round-up-all-line-width-less-than-1-greater-than-0.html#newcode9 third_party/WebKit/LayoutTests/fast/css/round-up-all-line-width-less-than-1-greater-than-0.html:9: var values = [ Indented
5 years, 1 month ago (2015-10-29 04:07:55 UTC) #12
alancutter (OOO until 2018)
lgtm
5 years, 1 month ago (2015-10-29 04:10:05 UTC) #13
Timothy Loh
Probably OK but I'll defer to Emil who might have opinions on sub-pixel stuff :)
5 years, 1 month ago (2015-11-02 02:52:09 UTC) #15
eae
https://codereview.chromium.org/1412103005/diff/180001/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.h File third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.h (right): https://codereview.chromium.org/1412103005/diff/180001/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.h#newcode138 third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.h:138: double result = primitiveValue.computeLength<double>(state.cssToLengthConversionData()); I'd argue that a border ...
5 years, 1 month ago (2015-11-02 03:02:02 UTC) #16
eae
LGTM https://codereview.chromium.org/1412103005/diff/180001/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.h File third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.h (right): https://codereview.chromium.org/1412103005/diff/180001/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.h#newcode138 third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.h:138: double result = primitiveValue.computeLength<double>(state.cssToLengthConversionData()); It's probably more important ...
5 years, 1 month ago (2015-11-02 03:14:46 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1412103005/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1412103005/200001
5 years, 1 month ago (2015-11-02 03:27:28 UTC) #20
commit-bot: I haz the power
Committed patchset #11 (id:200001)
5 years, 1 month ago (2015-11-02 04:25:21 UTC) #22
commit-bot: I haz the power
5 years, 1 month ago (2015-11-02 04:26:59 UTC) #23
Message was sent while issue was closed.
Patchset 11 (id:??) landed as
https://crrev.com/f73426be35a4b02a6d029407db459a87bc5e4688
Cr-Commit-Position: refs/heads/master@{#357305}

Powered by Google App Engine
This is Rietveld 408576698