| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 #include "wtf/StdLibExtras.h" | 71 #include "wtf/StdLibExtras.h" |
| 72 | 72 |
| 73 using namespace std; | 73 using namespace std; |
| 74 | 74 |
| 75 namespace WebCore { | 75 namespace WebCore { |
| 76 | 76 |
| 77 using namespace HTMLNames; | 77 using namespace HTMLNames; |
| 78 | 78 |
| 79 DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, frameCounter, ("Frame")); | 79 DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, frameCounter, ("Frame")); |
| 80 | 80 |
| 81 static inline Frame* parentFromOwnerElement(HTMLFrameOwnerElement* ownerElement) | |
| 82 { | |
| 83 if (!ownerElement) | |
| 84 return 0; | |
| 85 return ownerElement->document().frame(); | |
| 86 } | |
| 87 | |
| 88 static inline float parentPageZoomFactor(Frame* frame) | 81 static inline float parentPageZoomFactor(Frame* frame) |
| 89 { | 82 { |
| 90 Frame* parent = frame->tree().parent(); | 83 Frame* parent = frame->tree().parent(); |
| 91 if (!parent) | 84 if (!parent) |
| 92 return 1; | 85 return 1; |
| 93 return parent->pageZoomFactor(); | 86 return parent->pageZoomFactor(); |
| 94 } | 87 } |
| 95 | 88 |
| 96 static inline float parentTextZoomFactor(Frame* frame) | 89 static inline float parentTextZoomFactor(Frame* frame) |
| 97 { | 90 { |
| 98 Frame* parent = frame->tree().parent(); | 91 Frame* parent = frame->tree().parent(); |
| 99 if (!parent) | 92 if (!parent) |
| 100 return 1; | 93 return 1; |
| 101 return parent->textZoomFactor(); | 94 return parent->textZoomFactor(); |
| 102 } | 95 } |
| 103 | 96 |
| 104 inline Frame::Frame(PassRefPtr<FrameInit> frameInit) | 97 inline Frame::Frame(PassRefPtr<FrameInit> frameInit) |
| 105 : m_host(frameInit->frameHost()) | 98 : m_host(frameInit->frameHost()) |
| 106 , m_treeNode(this, parentFromOwnerElement(frameInit->ownerElement())) | 99 , m_treeNode(this) |
| 107 , m_loader(this, frameInit->frameLoaderClient()) | 100 , m_loader(this, frameInit->frameLoaderClient()) |
| 108 , m_navigationScheduler(this) | 101 , m_navigationScheduler(this) |
| 109 , m_script(adoptPtr(new ScriptController(this))) | 102 , m_script(adoptPtr(new ScriptController(this))) |
| 110 , m_editor(Editor::create(*this)) | 103 , m_editor(Editor::create(*this)) |
| 111 , m_spellChecker(SpellChecker::create(*this)) | 104 , m_spellChecker(SpellChecker::create(*this)) |
| 112 , m_selection(adoptPtr(new FrameSelection(this))) | 105 , m_selection(adoptPtr(new FrameSelection(this))) |
| 113 , m_eventHandler(adoptPtr(new EventHandler(this))) | 106 , m_eventHandler(adoptPtr(new EventHandler(this))) |
| 114 , m_inputMethodController(InputMethodController::create(*this)) | 107 , m_inputMethodController(InputMethodController::create(*this)) |
| 115 , m_frameInit(frameInit) | 108 , m_frameInit(frameInit) |
| 116 , m_pageZoomFactor(parentPageZoomFactor(this)) | 109 , m_pageZoomFactor(parentPageZoomFactor(this)) |
| (...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 733 { | 726 { |
| 734 if (!m_host) | 727 if (!m_host) |
| 735 return 0; | 728 return 0; |
| 736 | 729 |
| 737 double ratio = m_host->deviceScaleFactor(); | 730 double ratio = m_host->deviceScaleFactor(); |
| 738 ratio *= pageZoomFactor(); | 731 ratio *= pageZoomFactor(); |
| 739 return ratio; | 732 return ratio; |
| 740 } | 733 } |
| 741 | 734 |
| 742 } // namespace WebCore | 735 } // namespace WebCore |
| OLD | NEW |