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

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

Issue 1611693002: Revert of Don't change layout size due to top control show/hide (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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_size(layoutView ? layoutView->viewportSizeForViewportUnits() : DoubleSiz e()) 71 : m_width(layoutView ? layoutView->layoutViewportWidth() : 0)
72 , m_height(layoutView ? layoutView->layoutViewportHeight() : 0)
72 { 73 {
73 } 74 }
74 75
75 CSSToLengthConversionData::CSSToLengthConversionData(const ComputedStyle* style, const FontSizes& fontSizes, const ViewportSize& viewportSize, float zoom) 76 CSSToLengthConversionData::CSSToLengthConversionData(const ComputedStyle* style, const FontSizes& fontSizes, const ViewportSize& viewportSize, float zoom)
76 : m_style(style) 77 : m_style(style)
77 , m_fontSizes(fontSizes) 78 , m_fontSizes(fontSizes)
78 , m_viewportSize(viewportSize) 79 , m_viewportSize(viewportSize)
79 , m_zoom(clampTo<float>(zoom, std::numeric_limits<float>::denorm_min())) 80 , m_zoom(clampTo<float>(zoom, std::numeric_limits<float>::denorm_min()))
80 { 81 {
81 ASSERT(m_style); 82 ASSERT(m_style);
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 case CSSPrimitiveValue::UnitType::Chs: 167 case CSSPrimitiveValue::UnitType::Chs:
167 return value * chFontSize(); 168 return value * chFontSize();
168 169
169 default: 170 default:
170 ASSERT_NOT_REACHED(); 171 ASSERT_NOT_REACHED();
171 return 0; 172 return 0;
172 } 173 }
173 } 174 }
174 175
175 } // namespace blink 176 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698