OLD | NEW |
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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 #include "core/rendering/RenderView.h" | 59 #include "core/rendering/RenderView.h" |
60 #include "core/rendering/compositing/RenderLayerCompositor.h" | 60 #include "core/rendering/compositing/RenderLayerCompositor.h" |
61 #include "core/svg/SVGDocumentExtensions.h" | 61 #include "core/svg/SVGDocumentExtensions.h" |
62 #include "platform/DragImage.h" | 62 #include "platform/DragImage.h" |
63 #include "platform/graphics/GraphicsContext.h" | 63 #include "platform/graphics/GraphicsContext.h" |
64 #include "platform/graphics/ImageBuffer.h" | 64 #include "platform/graphics/ImageBuffer.h" |
65 #include "platform/text/TextStream.h" | 65 #include "platform/text/TextStream.h" |
66 #include "wtf/PassOwnPtr.h" | 66 #include "wtf/PassOwnPtr.h" |
67 #include "wtf/StdLibExtras.h" | 67 #include "wtf/StdLibExtras.h" |
68 | 68 |
69 using namespace std; | |
70 | |
71 namespace WebCore { | 69 namespace WebCore { |
72 | 70 |
73 using namespace HTMLNames; | 71 using namespace HTMLNames; |
74 | 72 |
75 static inline float parentPageZoomFactor(LocalFrame* frame) | 73 static inline float parentPageZoomFactor(LocalFrame* frame) |
76 { | 74 { |
77 Frame* parent = frame->tree().parent(); | 75 Frame* parent = frame->tree().parent(); |
78 if (!parent || !parent->isLocalFrame()) | 76 if (!parent || !parent->isLocalFrame()) |
79 return 1; | 77 return 1; |
80 return toLocalFrame(parent)->pageZoomFactor(); | 78 return toLocalFrame(parent)->pageZoomFactor(); |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 return document()->printing() && (!tree().parent() || !tree().parent()->isLo
calFrame() || !toLocalFrame(tree().parent())->document()->printing()); | 216 return document()->printing() && (!tree().parent() || !tree().parent()->isLo
calFrame() || !toLocalFrame(tree().parent())->document()->printing()); |
219 } | 217 } |
220 | 218 |
221 FloatSize LocalFrame::resizePageRectsKeepingRatio(const FloatSize& originalSize,
const FloatSize& expectedSize) | 219 FloatSize LocalFrame::resizePageRectsKeepingRatio(const FloatSize& originalSize,
const FloatSize& expectedSize) |
222 { | 220 { |
223 FloatSize resultSize; | 221 FloatSize resultSize; |
224 if (!contentRenderer()) | 222 if (!contentRenderer()) |
225 return FloatSize(); | 223 return FloatSize(); |
226 | 224 |
227 if (contentRenderer()->style()->isHorizontalWritingMode()) { | 225 if (contentRenderer()->style()->isHorizontalWritingMode()) { |
228 ASSERT(fabs(originalSize.width()) > numeric_limits<float>::epsilon()); | 226 ASSERT(fabs(originalSize.width()) > std::numeric_limits<float>::epsilon(
)); |
229 float ratio = originalSize.height() / originalSize.width(); | 227 float ratio = originalSize.height() / originalSize.width(); |
230 resultSize.setWidth(floorf(expectedSize.width())); | 228 resultSize.setWidth(floorf(expectedSize.width())); |
231 resultSize.setHeight(floorf(resultSize.width() * ratio)); | 229 resultSize.setHeight(floorf(resultSize.width() * ratio)); |
232 } else { | 230 } else { |
233 ASSERT(fabs(originalSize.height()) > numeric_limits<float>::epsilon()); | 231 ASSERT(fabs(originalSize.height()) > std::numeric_limits<float>::epsilon
()); |
234 float ratio = originalSize.width() / originalSize.height(); | 232 float ratio = originalSize.width() / originalSize.height(); |
235 resultSize.setHeight(floorf(expectedSize.height())); | 233 resultSize.setHeight(floorf(expectedSize.height())); |
236 resultSize.setWidth(floorf(resultSize.height() * ratio)); | 234 resultSize.setWidth(floorf(resultSize.height() * ratio)); |
237 } | 235 } |
238 return resultSize; | 236 return resultSize; |
239 } | 237 } |
240 | 238 |
241 void LocalFrame::setDOMWindow(PassRefPtrWillBeRawPtr<DOMWindow> domWindow) | 239 void LocalFrame::setDOMWindow(PassRefPtrWillBeRawPtr<DOMWindow> domWindow) |
242 { | 240 { |
243 InspectorInstrumentation::frameWindowDiscarded(this, m_domWindow.get()); | 241 InspectorInstrumentation::frameWindowDiscarded(this, m_domWindow.get()); |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
656 LocalFrame* LocalFrame::localFrameRoot() | 654 LocalFrame* LocalFrame::localFrameRoot() |
657 { | 655 { |
658 LocalFrame* curFrame = this; | 656 LocalFrame* curFrame = this; |
659 while (curFrame && curFrame->tree().parent() && curFrame->tree().parent()->i
sLocalFrame()) | 657 while (curFrame && curFrame->tree().parent() && curFrame->tree().parent()->i
sLocalFrame()) |
660 curFrame = toLocalFrame(curFrame->tree().parent()); | 658 curFrame = toLocalFrame(curFrame->tree().parent()); |
661 | 659 |
662 return curFrame; | 660 return curFrame; |
663 } | 661 } |
664 | 662 |
665 } // namespace WebCore | 663 } // namespace WebCore |
OLD | NEW |