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

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

Issue 2013833002: ComputedStyle.h doesn't need CSSPrimitiveValue.h if adjustForAbsoluteZoom(int, float) isn't inline. (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
« 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 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 *
11 * This library is distributed in the hope that it will be useful, 11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details. 14 * Library General Public License for more details.
15 * 15 *
16 * You should have received a copy of the GNU Library General Public License 16 * You should have received a copy of the GNU Library General Public License
17 * along with this library; see the file COPYING.LIB. If not, write to 17 * along with this library; see the file COPYING.LIB. If not, write to
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA. 19 * Boston, MA 02110-1301, USA.
20 * 20 *
21 */ 21 */
22 22
23 #include "core/style/ComputedStyle.h" 23 #include "core/style/ComputedStyle.h"
24 24
25 #include "core/animation/css/CSSAnimationData.h" 25 #include "core/animation/css/CSSAnimationData.h"
26 #include "core/animation/css/CSSTransitionData.h" 26 #include "core/animation/css/CSSTransitionData.h"
27 #include "core/css/CSSPaintValue.h" 27 #include "core/css/CSSPaintValue.h"
28 #include "core/css/CSSPrimitiveValue.h"
28 #include "core/css/CSSPropertyEquality.h" 29 #include "core/css/CSSPropertyEquality.h"
29 #include "core/css/resolver/StyleResolver.h" 30 #include "core/css/resolver/StyleResolver.h"
30 #include "core/layout/LayoutTheme.h" 31 #include "core/layout/LayoutTheme.h"
31 #include "core/layout/TextAutosizer.h" 32 #include "core/layout/TextAutosizer.h"
32 #include "core/style/AppliedTextDecoration.h" 33 #include "core/style/AppliedTextDecoration.h"
33 #include "core/style/BorderEdge.h" 34 #include "core/style/BorderEdge.h"
34 #include "core/style/ContentData.h" 35 #include "core/style/ContentData.h"
35 #include "core/style/DataEquivalency.h" 36 #include "core/style/DataEquivalency.h"
36 #include "core/style/ComputedStyleConstants.h" 37 #include "core/style/ComputedStyleConstants.h"
37 #include "core/style/CursorData.h" 38 #include "core/style/CursorData.h"
(...skipping 1817 matching lines...) Expand 10 before | Expand all | Expand 10 after
1855 { 1856 {
1856 if (!shadowList) 1857 if (!shadowList)
1857 return false; 1858 return false;
1858 for (size_t i = shadowList->shadows().size(); i--; ) { 1859 for (size_t i = shadowList->shadows().size(); i--; ) {
1859 if (shadowList->shadows()[i].color().isCurrentColor()) 1860 if (shadowList->shadows()[i].color().isCurrentColor())
1860 return true; 1861 return true;
1861 } 1862 }
1862 return false; 1863 return false;
1863 } 1864 }
1864 1865
1866 int adjustForAbsoluteZoom(int value, float zoomFactor)
1867 {
1868 if (zoomFactor == 1)
1869 return value;
1870 // Needed because computeLengthInt truncates (rather than rounds) when scali ng up.
1871 float fvalue = value;
1872 if (zoomFactor > 1) {
1873 if (value < 0)
1874 fvalue -= 0.5f;
1875 else
1876 fvalue += 0.5f;
1877 }
1878
1879 return roundForImpreciseConversion<int>(fvalue / zoomFactor);
1880 }
1881
1865 } // namespace blink 1882 } // 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