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