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

Side by Side Diff: third_party/WebKit/Source/core/style/ComputedStyle.cpp

Issue 2879813002: Make ComputedStyleBase a templated class to allow it to use functions on ComputedStyle (Closed)
Patch Set: Formatting merge Created 3 years, 7 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
« no previous file with comments | « third_party/WebKit/Source/core/style/ComputedStyle.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
4 * reserved. 4 * reserved.
5 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. 5 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 struct ComputedStyleBase { 74 struct ComputedStyleBase {
75 void* data_refs[4]; 75 void* data_refs[4];
76 unsigned bitfields_[4]; 76 unsigned bitfields_[4];
77 } base_; 77 } base_;
78 78
79 void* data_refs[3]; 79 void* data_refs[3];
80 void* own_ptrs[1]; 80 void* own_ptrs[1];
81 void* data_ref_svg_style; 81 void* data_ref_svg_style;
82 }; 82 };
83 83
84 // If this fails, the packing algorithm in make_computed_style_base.py has
85 // failed to produce the optimal packed size. To fix, update the algorithm to
86 // ensure that the buckets are placed so that each takes up at most 1 word.
87 ASSERT_SIZE(ComputedStyleBase<ComputedStyle>, SameSizeAsComputedStyleBase);
88
84 // If this assert fails, it means that size of ComputedStyle has changed. Please 89 // If this assert fails, it means that size of ComputedStyle has changed. Please
85 // check that you really *do* what to increase the size of ComputedStyle, then 90 // check that you really *do* what to increase the size of ComputedStyle, then
86 // update the SameSizeAsComputedStyle struct to match the updated storage of 91 // update the SameSizeAsComputedStyle struct to match the updated storage of
87 // ComputedStyle. 92 // ComputedStyle.
88 ASSERT_SIZE(ComputedStyle, SameSizeAsComputedStyle); 93 ASSERT_SIZE(ComputedStyle, SameSizeAsComputedStyle);
89 94
90 PassRefPtr<ComputedStyle> ComputedStyle::Create() { 95 PassRefPtr<ComputedStyle> ComputedStyle::Create() {
91 return AdoptRef(new ComputedStyle(InitialStyle())); 96 return AdoptRef(new ComputedStyle(InitialStyle()));
92 } 97 }
93 98
(...skipping 2424 matching lines...) Expand 10 before | Expand all | Expand 10 after
2518 if (value < 0) 2523 if (value < 0)
2519 fvalue -= 0.5f; 2524 fvalue -= 0.5f;
2520 else 2525 else
2521 fvalue += 0.5f; 2526 fvalue += 0.5f;
2522 } 2527 }
2523 2528
2524 return RoundForImpreciseConversion<int>(fvalue / zoom_factor); 2529 return RoundForImpreciseConversion<int>(fvalue / zoom_factor);
2525 } 2530 }
2526 2531
2527 } // namespace blink 2532 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/style/ComputedStyle.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698