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

Side by Side Diff: Source/platform/LengthFunctions.cpp

Issue 82083002: Move viewport unit resolution to style recalc time (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: rebased Created 7 years 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 /* 1 /*
2 Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 Copyright (C) 2006, 2008 Apple Inc. All rights reserved. 3 Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
4 Copyright (C) 2011 Rik Cabanier (cabanier@adobe.com) 4 Copyright (C) 2011 Rik Cabanier (cabanier@adobe.com)
5 Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. 5 Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
6 Copyright (C) 2012 Motorola Mobility, Inc. All rights reserved. 6 Copyright (C) 2012 Motorola Mobility, Inc. All rights reserved.
7 7
8 This library is free software; you can redistribute it and/or 8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Library General Public 9 modify it under the terms of the GNU Library General Public
10 License as published by the Free Software Foundation; either 10 License as published by the Free Software Foundation; either
(...skipping 25 matching lines...) Expand all
36 switch (length.type()) { 36 switch (length.type()) {
37 case Fixed: 37 case Fixed:
38 return length.getFloatValue(); 38 return length.getFloatValue();
39 case Percent: 39 case Percent:
40 return static_cast<float>(maximumValue * length.percent() / 100.0f); 40 return static_cast<float>(maximumValue * length.percent() / 100.0f);
41 case FillAvailable: 41 case FillAvailable:
42 case Auto: 42 case Auto:
43 return static_cast<float>(maximumValue); 43 return static_cast<float>(maximumValue);
44 case Calculated: 44 case Calculated:
45 return length.nonNanCalculatedValue(maximumValue); 45 return length.nonNanCalculatedValue(maximumValue);
46 case ViewportPercentageWidth:
kenneth.r.christiansen 2013/12/16 10:08:19 Ain't you breaking @viewport { width: 100%; } when
Timothy Loh 2013/12/18 07:18:27 You probably mean 100vw here; this works because w
47 case ViewportPercentageHeight:
48 case ViewportPercentageMin:
49 case ViewportPercentageMax:
50 return 0;
51 case Intrinsic: 46 case Intrinsic:
52 case MinIntrinsic: 47 case MinIntrinsic:
53 case MinContent: 48 case MinContent:
54 case MaxContent: 49 case MaxContent:
55 case FitContent: 50 case FitContent:
56 case ExtendToZoom: 51 case ExtendToZoom:
52 case DeviceWidth:
53 case DeviceHeight:
57 case Undefined: 54 case Undefined:
58 ASSERT_NOT_REACHED(); 55 ASSERT_NOT_REACHED();
59 return 0; 56 return 0;
60 } 57 }
61 ASSERT_NOT_REACHED(); 58 ASSERT_NOT_REACHED();
62 return 0; 59 return 0;
63 } 60 }
64 61
65 } // namespace WebCore 62 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698