OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 #include "core/page/PageAnimator.h" | 6 #include "core/page/PageAnimator.h" |
7 | 7 |
8 #include "core/animation/DocumentAnimations.h" | 8 #include "core/animation/DocumentAnimations.h" |
9 #include "core/dom/Document.h" | 9 #include "core/dom/Document.h" |
10 #include "core/frame/FrameView.h" | 10 #include "core/frame/FrameView.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 void PageAnimator::scheduleVisualUpdate() | 58 void PageAnimator::scheduleVisualUpdate() |
59 { | 59 { |
60 // FIXME: also include m_animationFramePending here. It is currently not the
re due to crbug.com/353756. | 60 // FIXME: also include m_animationFramePending here. It is currently not the
re due to crbug.com/353756. |
61 if (m_servicingAnimations || m_updatingLayoutAndStyleForPainting) | 61 if (m_servicingAnimations || m_updatingLayoutAndStyleForPainting) |
62 return; | 62 return; |
63 m_page->chrome().scheduleAnimation(); | 63 m_page->chrome().scheduleAnimation(); |
64 } | 64 } |
65 | 65 |
66 void PageAnimator::updateLayoutAndStyleForPainting() | 66 void PageAnimator::updateLayoutAndStyleForPainting() |
67 { | 67 { |
68 RefPtr<FrameView> view = m_page->mainFrame()->view(); | 68 if (!m_page->mainFrame()->isLocalFrame()) |
| 69 return; |
| 70 |
| 71 RefPtr<FrameView> view = m_page->deprecatedLocalMainFrame()->view(); |
69 | 72 |
70 TemporaryChange<bool> servicing(m_updatingLayoutAndStyleForPainting, true); | 73 TemporaryChange<bool> servicing(m_updatingLayoutAndStyleForPainting, true); |
71 | 74 |
72 // In order for our child HWNDs (NativeWindowWidgets) to update properly, | 75 // In order for our child HWNDs (NativeWindowWidgets) to update properly, |
73 // they need to be told that we are updating the screen. The problem is that | 76 // they need to be told that we are updating the screen. The problem is that |
74 // the native widgets need to recalculate their clip region and not overlap | 77 // the native widgets need to recalculate their clip region and not overlap |
75 // any of our non-native widgets. To force the resizing, call | 78 // any of our non-native widgets. To force the resizing, call |
76 // setFrameRect(). This will be a quick operation for most frames, but the | 79 // setFrameRect(). This will be a quick operation for most frames, but the |
77 // NativeWindowWidgets will update a proper clipping region. | 80 // NativeWindowWidgets will update a proper clipping region. |
78 view->setFrameRect(view->frameRect()); | 81 view->setFrameRect(view->frameRect()); |
79 | 82 |
80 // setFrameRect may have the side-effect of causing existing page layout to | 83 // setFrameRect may have the side-effect of causing existing page layout to |
81 // be invalidated, so layout needs to be called last. | 84 // be invalidated, so layout needs to be called last. |
82 view->updateLayoutAndStyleForPainting(); | 85 view->updateLayoutAndStyleForPainting(); |
83 } | 86 } |
84 | 87 |
85 } | 88 } |
OLD | NEW |