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

Issue 993013002: Perspective property should only allow positive lengths (Closed)

Created:
5 years, 9 months ago by rwlbuis
Modified:
5 years, 9 months ago
CC:
darktears, apavlov+blink_chromium.org, blink-reviews, blink-reviews-css, dglazkov+blink, ed+blinkwatch_opera.com
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Perspective property should only allow positive lengths Perspective property did check for non-negative lengths, but not zero lengths, so add that check for both prefixed and unprefixed versions. transforms/perspective-parsing.html now passes. BUG=301241 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=192019

Patch Set 1 #

Patch Set 2 : It is a matter of perspective #

Patch Set 3 : Address review comments #

Patch Set 4 : Fix ASSERT #

Total comments: 1

Patch Set 5 : #

Total comments: 1

Patch Set 6 : Patch for landing #

Unified diffs Side-by-side diffs Delta from patch set Stats (+23 lines, -28 lines) Patch
M LayoutTests/transforms/perspective-parsing.html View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
D LayoutTests/transforms/perspective-parsing-expected.txt View 1 1 chunk +0 lines, -15 lines 0 comments Download
A + LayoutTests/transforms/webkit-perspective-parsing.html View 1 2 3 4 2 chunks +9 lines, -2 lines 0 comments Download
M Source/core/css/parser/CSSPropertyParser.cpp View 1 2 3 4 5 1 chunk +10 lines, -11 lines 0 comments Download

Messages

Total messages: 21 (8 generated)
rwlbuis
PTAL
5 years, 9 months ago (2015-03-10 21:52:52 UTC) #2
dstockwell
lgtm
5 years, 9 months ago (2015-03-10 22:32:26 UTC) #3
Timothy Loh
On 2015/03/10 21:52:52, rwlbuis wrote: > PTAL I can't imagine this working properly for calcs ...
5 years, 9 months ago (2015-03-10 23:17:20 UTC) #5
rwlbuis
On 2015/03/10 23:17:20, Timothy Loh wrote: > On 2015/03/10 21:52:52, rwlbuis wrote: > > PTAL ...
5 years, 9 months ago (2015-03-12 01:35:53 UTC) #6
alancutter (OOO until 2018)
https://codereview.chromium.org/993013002/diff/60001/Source/core/css/CSSCalculationValue.h File Source/core/css/CSSCalculationValue.h (right): https://codereview.chromium.org/993013002/diff/60001/Source/core/css/CSSCalculationValue.h#newcode122 Source/core/css/CSSCalculationValue.h:122: bool isPositive() const { return m_expression->doubleValue() > 0; } ...
5 years, 9 months ago (2015-03-12 03:43:08 UTC) #8
rwlbuis
On 2015/03/12 03:43:08, alancutter wrote: > https://codereview.chromium.org/993013002/diff/60001/Source/core/css/CSSCalculationValue.h > File Source/core/css/CSSCalculationValue.h (right): > > https://codereview.chromium.org/993013002/diff/60001/Source/core/css/CSSCalculationValue.h#newcode122 > ...
5 years, 9 months ago (2015-03-12 21:18:57 UTC) #9
alancutter (OOO until 2018)
On 2015/03/12 at 21:18:57, rob.buis wrote: > On 2015/03/12 03:43:08, alancutter wrote: > > https://codereview.chromium.org/993013002/diff/60001/Source/core/css/CSSCalculationValue.h ...
5 years, 9 months ago (2015-03-13 01:46:41 UTC) #10
rwlbuis
On 2015/03/13 01:46:41, alancutter wrote: > On 2015/03/12 at 21:18:57, rob.buis wrote: > > Maybe ...
5 years, 9 months ago (2015-03-16 21:31:36 UTC) #14
alancutter (OOO until 2018)
lgtm with nit. I'm fine with having the calc clamping in a separate patch. https://codereview.chromium.org/993013002/diff/80001/Source/core/css/parser/CSSPropertyParser.cpp ...
5 years, 9 months ago (2015-03-16 23:33:15 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/993013002/100001
5 years, 9 months ago (2015-03-17 13:52:06 UTC) #18
rwlbuis
On 2015/03/16 23:33:15, alancutter wrote: > lgtm with nit. > > I'm fine with having ...
5 years, 9 months ago (2015-03-17 14:39:03 UTC) #19
commit-bot: I haz the power
Committed patchset #6 (id:100001) as https://src.chromium.org/viewvc/blink?view=rev&revision=192019
5 years, 9 months ago (2015-03-17 16:28:26 UTC) #20
alancutter (OOO until 2018)
5 years, 9 months ago (2015-03-17 22:59:28 UTC) #21
Message was sent while issue was closed.
On 2015/03/17 at 14:39:03, rob.buis wrote:
> On 2015/03/16 23:33:15, alancutter wrote:
> > lgtm with nit.
> > 
> > I'm fine with having the calc clamping in a separate patch.
> 
> Actually it seems we are in luck. StyleBuilderConverter::convertPerspective
already
> clamps to 0.0. Also LayoutStyle::hasPerspective does check for perspective >
0, so
> negative and zero values for perspective will not have any effect.

This is actually a problem as 0 is not a valid value for perspective, we just
use it internally to represent none. We should be clamping to something > 0
instead.
calcs that resolve to values outside the allowed range are supposed to get
clamped accordingly. It doesn't make sense that clamping -1px to the range (0,
inf) would result in the keyword 'none'.
The perspective spec still needs updating to clarify appropriate clamping
behaviour for an open range such as (0, inf) but in the meantime tab has
indicated that clamping to a user agent decided value like 1e-8 is fine.

Powered by Google App Engine
This is Rietveld 408576698