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

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

Issue 2065233002: Force flattening for elements with non-initial value of opacity (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
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 reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. 4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 1241 matching lines...) Expand 10 before | Expand all | Expand 10 after
1252 return *rareNonInheritedData->m_animations; 1252 return *rareNonInheritedData->m_animations;
1253 } 1253 }
1254 1254
1255 CSSTransitionData& ComputedStyle::accessTransitions() 1255 CSSTransitionData& ComputedStyle::accessTransitions()
1256 { 1256 {
1257 if (!rareNonInheritedData.access()->m_transitions) 1257 if (!rareNonInheritedData.access()->m_transitions)
1258 rareNonInheritedData.access()->m_transitions = CSSTransitionData::create (); 1258 rareNonInheritedData.access()->m_transitions = CSSTransitionData::create ();
1259 return *rareNonInheritedData->m_transitions; 1259 return *rareNonInheritedData->m_transitions;
1260 } 1260 }
1261 1261
1262 ETransformStyle3D ComputedStyle::usedTransformStyle3D() const
1263 {
1264 // Quick rejection. Technically no-op.
1265 if (transformStyle3D() == TransformStyle3DFlat)
chrishtr 2016/06/15 16:06:41 Does this really matter for performance?
trchen 2016/06/18 00:27:09 I don't have numbers, but checking will-change lis
chrishtr 2016/06/18 08:22:53 All this saves is a call to hasGroupingProperty. I
1266 return TransformStyle3DFlat;
1267
1268 return hasGroupingProperty() ? TransformStyle3DFlat : transformStyle3D();
1269 }
1270
1262 const Font& ComputedStyle::font() const { return inherited->font; } 1271 const Font& ComputedStyle::font() const { return inherited->font; }
1263 const FontMetrics& ComputedStyle::getFontMetrics() const { return inherited->fon t.getFontMetrics(); } 1272 const FontMetrics& ComputedStyle::getFontMetrics() const { return inherited->fon t.getFontMetrics(); }
1264 const FontDescription& ComputedStyle::getFontDescription() const { return inheri ted->font.getFontDescription(); } 1273 const FontDescription& ComputedStyle::getFontDescription() const { return inheri ted->font.getFontDescription(); }
1265 float ComputedStyle::specifiedFontSize() const { return getFontDescription().spe cifiedSize(); } 1274 float ComputedStyle::specifiedFontSize() const { return getFontDescription().spe cifiedSize(); }
1266 float ComputedStyle::computedFontSize() const { return getFontDescription().comp utedSize(); } 1275 float ComputedStyle::computedFontSize() const { return getFontDescription().comp utedSize(); }
1267 int ComputedStyle::fontSize() const { return getFontDescription().computedPixelS ize(); } 1276 int ComputedStyle::fontSize() const { return getFontDescription().computedPixelS ize(); }
1268 float ComputedStyle::fontSizeAdjust() const { return getFontDescription().sizeAd just(); } 1277 float ComputedStyle::fontSizeAdjust() const { return getFontDescription().sizeAd just(); }
1269 bool ComputedStyle::hasFontSizeAdjust() const { return getFontDescription().hasS izeAdjust(); } 1278 bool ComputedStyle::hasFontSizeAdjust() const { return getFontDescription().hasS izeAdjust(); }
1270 FontWeight ComputedStyle::fontWeight() const { return getFontDescription().weigh t(); } 1279 FontWeight ComputedStyle::fontWeight() const { return getFontDescription().weigh t(); }
1271 FontStretch ComputedStyle::fontStretch() const { return getFontDescription().str etch(); } 1280 FontStretch ComputedStyle::fontStretch() const { return getFontDescription().str etch(); }
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
1873 if (value < 0) 1882 if (value < 0)
1874 fvalue -= 0.5f; 1883 fvalue -= 0.5f;
1875 else 1884 else
1876 fvalue += 0.5f; 1885 fvalue += 0.5f;
1877 } 1886 }
1878 1887
1879 return roundForImpreciseConversion<int>(fvalue / zoomFactor); 1888 return roundForImpreciseConversion<int>(fvalue / zoomFactor);
1880 } 1889 }
1881 1890
1882 } // namespace blink 1891 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698