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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSToLengthConversionData.cpp

Issue 1573283002: Don't change layout size due to top control show/hide (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove redundant call to viewportSizeForViewportUnits Created 4 years, 11 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 return m_font->fontMetrics().xHeight(); 61 return m_font->fontMetrics().xHeight();
62 } 62 }
63 63
64 float CSSToLengthConversionData::FontSizes::ch() const 64 float CSSToLengthConversionData::FontSizes::ch() const
65 { 65 {
66 ASSERT(m_font); 66 ASSERT(m_font);
67 return m_font->fontMetrics().zeroWidth(); 67 return m_font->fontMetrics().zeroWidth();
68 } 68 }
69 69
70 CSSToLengthConversionData::ViewportSize::ViewportSize(const LayoutView* layoutVi ew) 70 CSSToLengthConversionData::ViewportSize::ViewportSize(const LayoutView* layoutVi ew)
71 : m_width(layoutView ? layoutView->layoutViewportWidth() : 0) 71 : m_size(layoutView ? layoutView->viewportSizeForViewportUnits() : DoubleSiz e())
72 , m_height(layoutView ? layoutView->layoutViewportHeight() : 0)
73 { 72 {
74 } 73 }
75 74
76 CSSToLengthConversionData::CSSToLengthConversionData(const ComputedStyle* style, const FontSizes& fontSizes, const ViewportSize& viewportSize, float zoom) 75 CSSToLengthConversionData::CSSToLengthConversionData(const ComputedStyle* style, const FontSizes& fontSizes, const ViewportSize& viewportSize, float zoom)
77 : m_style(style) 76 : m_style(style)
78 , m_fontSizes(fontSizes) 77 , m_fontSizes(fontSizes)
79 , m_viewportSize(viewportSize) 78 , m_viewportSize(viewportSize)
80 , m_zoom(clampTo<float>(zoom, std::numeric_limits<float>::denorm_min())) 79 , m_zoom(clampTo<float>(zoom, std::numeric_limits<float>::denorm_min()))
81 { 80 {
82 ASSERT(m_style); 81 ASSERT(m_style);
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 case CSSPrimitiveValue::UnitType::Chs: 166 case CSSPrimitiveValue::UnitType::Chs:
168 return value * chFontSize(); 167 return value * chFontSize();
169 168
170 default: 169 default:
171 ASSERT_NOT_REACHED(); 170 ASSERT_NOT_REACHED();
172 return 0; 171 return 0;
173 } 172 }
174 } 173 }
175 174
176 } // namespace blink 175 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698