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

Side by Side Diff: sky/engine/core/frame/LocalFrame.cpp

Issue 688213002: First pass at removing dead vertical writing mode code. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 | « sky/engine/core/frame/FrameView.cpp ('k') | sky/engine/core/page/EventHandler.cpp » ('j') | 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) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Simon Hausmann <hausmann@kde.org> 5 * 2000 Simon Hausmann <hausmann@kde.org>
6 * 2000 Stefan Schimanski <1Stein@gmx.de> 6 * 2000 Stefan Schimanski <1Stein@gmx.de>
7 * 2001 George Staikos <staikos@kde.org> 7 * 2001 George Staikos <staikos@kde.org>
8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> 9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com>
10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 158
159 m_view = view; 159 m_view = view;
160 } 160 }
161 161
162 FloatSize LocalFrame::resizePageRectsKeepingRatio(const FloatSize& originalSize, const FloatSize& expectedSize) 162 FloatSize LocalFrame::resizePageRectsKeepingRatio(const FloatSize& originalSize, const FloatSize& expectedSize)
163 { 163 {
164 FloatSize resultSize; 164 FloatSize resultSize;
165 if (!contentRenderer()) 165 if (!contentRenderer())
166 return FloatSize(); 166 return FloatSize();
167 167
168 if (contentRenderer()->style()->isHorizontalWritingMode()) { 168 ASSERT(fabs(originalSize.width()) > std::numeric_limits<float>::epsilon());
169 ASSERT(fabs(originalSize.width()) > std::numeric_limits<float>::epsilon( )); 169 float ratio = originalSize.height() / originalSize.width();
170 float ratio = originalSize.height() / originalSize.width(); 170 resultSize.setWidth(floorf(expectedSize.width()));
171 resultSize.setWidth(floorf(expectedSize.width())); 171 resultSize.setHeight(floorf(resultSize.width() * ratio));
172 resultSize.setHeight(floorf(resultSize.width() * ratio));
173 } else {
174 ASSERT(fabs(originalSize.height()) > std::numeric_limits<float>::epsilon ());
175 float ratio = originalSize.width() / originalSize.height();
176 resultSize.setHeight(floorf(expectedSize.height()));
177 resultSize.setWidth(floorf(resultSize.height() * ratio));
178 }
179 return resultSize; 172 return resultSize;
180 } 173 }
181 174
182 void LocalFrame::setDOMWindow(PassRefPtr<LocalDOMWindow> domWindow) 175 void LocalFrame::setDOMWindow(PassRefPtr<LocalDOMWindow> domWindow)
183 { 176 {
184 if (m_domWindow) { 177 if (m_domWindow) {
185 console().messageStorage()->frameWindowDiscarded(m_domWindow.get()); 178 console().messageStorage()->frameWindowDiscarded(m_domWindow.get());
186 } 179 }
187 if (domWindow) 180 if (domWindow)
188 script().clearWindowProxy(); 181 script().clearWindowProxy();
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 { 409 {
417 if (!m_host) 410 if (!m_host)
418 return 0; 411 return 0;
419 412
420 double ratio = m_host->deviceScaleFactor(); 413 double ratio = m_host->deviceScaleFactor();
421 ratio *= pageZoomFactor(); 414 ratio *= pageZoomFactor();
422 return ratio; 415 return ratio;
423 } 416 }
424 417
425 } // namespace blink 418 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/frame/FrameView.cpp ('k') | sky/engine/core/page/EventHandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698