OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 { | 68 { |
69 // init LayoutObject attributes | 69 // init LayoutObject attributes |
70 setInline(false); | 70 setInline(false); |
71 | 71 |
72 m_minPreferredLogicalWidth = 0; | 72 m_minPreferredLogicalWidth = 0; |
73 m_maxPreferredLogicalWidth = 0; | 73 m_maxPreferredLogicalWidth = 0; |
74 | 74 |
75 setPreferredLogicalWidthsDirty(MarkOnlyThis); | 75 setPreferredLogicalWidthsDirty(MarkOnlyThis); |
76 | 76 |
77 setPositionState(AbsolutePosition); // to 0,0 :) | 77 setPositionState(AbsolutePosition); // to 0,0 :) |
| 78 |
| 79 if (document->page()) |
| 80 document->page()->memoryPurgeController().addListener(this); |
78 } | 81 } |
79 | 82 |
80 LayoutView::~LayoutView() | 83 LayoutView::~LayoutView() |
81 { | 84 { |
| 85 if (document().page()) |
| 86 document().page()->memoryPurgeController().removeListener(this); |
82 } | 87 } |
83 | 88 |
84 bool LayoutView::hitTest(HitTestResult& result) | 89 bool LayoutView::hitTest(HitTestResult& result) |
85 { | 90 { |
86 // We have to recursively update layout/style here because otherwise, when t
he hit test recurses | 91 // We have to recursively update layout/style here because otherwise, when t
he hit test recurses |
87 // into a child document, it could trigger a layout on the parent document,
which can destroy DeprecatedPaintLayer | 92 // into a child document, it could trigger a layout on the parent document,
which can destroy DeprecatedPaintLayer |
88 // that are higher up in the call stack, leading to crashes. | 93 // that are higher up in the call stack, leading to crashes. |
89 // Note that Document::updateLayout calls its parent's updateLayout. | 94 // Note that Document::updateLayout calls its parent's updateLayout. |
90 frameView()->updateLifecycleToCompositingCleanPlusScrolling(); | 95 frameView()->updateLifecycleToCompositingCleanPlusScrolling(); |
91 return hitTestNoLifecycleUpdate(result); | 96 return hitTestNoLifecycleUpdate(result); |
(...skipping 913 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1005 float scale = m_frameView ? m_frameView->frame().pageZoomFactor() : 1; | 1010 float scale = m_frameView ? m_frameView->frame().pageZoomFactor() : 1; |
1006 return viewHeight(IncludeScrollbars) / scale; | 1011 return viewHeight(IncludeScrollbars) / scale; |
1007 } | 1012 } |
1008 | 1013 |
1009 void LayoutView::willBeDestroyed() | 1014 void LayoutView::willBeDestroyed() |
1010 { | 1015 { |
1011 LayoutBlockFlow::willBeDestroyed(); | 1016 LayoutBlockFlow::willBeDestroyed(); |
1012 m_compositor.clear(); | 1017 m_compositor.clear(); |
1013 } | 1018 } |
1014 | 1019 |
| 1020 // TODO(bashi): Remove |
| 1021 void LayoutView::purgeMemory(MemoryPurgeMode, DeviceKind) |
| 1022 { |
| 1023 m_hitTestCache.clear(); |
| 1024 } |
| 1025 |
1015 } // namespace blink | 1026 } // namespace blink |
OLD | NEW |