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 Dirk Mueller <mueller@kde.org> | 5 * 2000 Dirk Mueller <mueller@kde.org> |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
9 * Copyright (C) 2009 Google Inc. All rights reserved. | 9 * Copyright (C) 2009 Google Inc. All rights reserved. |
10 * | 10 * |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
167 m_hasPendingLayout(false), | 167 m_hasPendingLayout(false), |
168 m_inSynchronousPostLayout(false), | 168 m_inSynchronousPostLayout(false), |
169 m_postLayoutTasksTimer( | 169 m_postLayoutTasksTimer( |
170 TaskRunnerHelper::get(TaskType::UnspecedTimer, &frame), | 170 TaskRunnerHelper::get(TaskType::UnspecedTimer, &frame), |
171 this, | 171 this, |
172 &FrameView::postLayoutTimerFired), | 172 &FrameView::postLayoutTimerFired), |
173 m_updatePluginsTimer( | 173 m_updatePluginsTimer( |
174 TaskRunnerHelper::get(TaskType::UnspecedTimer, &frame), | 174 TaskRunnerHelper::get(TaskType::UnspecedTimer, &frame), |
175 this, | 175 this, |
176 &FrameView::updatePluginsTimerFired), | 176 &FrameView::updatePluginsTimerFired), |
177 m_isTransparent(false), | |
178 m_baseBackgroundColor(Color::white), | 177 m_baseBackgroundColor(Color::white), |
179 m_mediaType(MediaTypeNames::screen), | 178 m_mediaType(MediaTypeNames::screen), |
180 m_safeToPropagateScrollToParent(true), | 179 m_safeToPropagateScrollToParent(true), |
181 m_scrollCorner(nullptr), | 180 m_scrollCorner(nullptr), |
182 m_stickyPositionObjectCount(0), | 181 m_stickyPositionObjectCount(0), |
183 m_inputEventsScaleFactorForEmulation(1), | 182 m_inputEventsScaleFactorForEmulation(1), |
184 m_layoutSizeFixedToFrameSize(true), | 183 m_layoutSizeFixedToFrameSize(true), |
185 m_didScrollTimer(TaskRunnerHelper::get(TaskType::UnspecedTimer, &frame), | 184 m_didScrollTimer(TaskRunnerHelper::get(TaskType::UnspecedTimer, &frame), |
186 this, | 185 this, |
187 &FrameView::didScrollTimerFired), | 186 &FrameView::didScrollTimerFired), |
(...skipping 2133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2321 LayoutViewItem layoutViewItem = this->layoutViewItem(); | 2320 LayoutViewItem layoutViewItem = this->layoutViewItem(); |
2322 if (layoutViewItem.isNull()) | 2321 if (layoutViewItem.isNull()) |
2323 return; | 2322 return; |
2324 // TODO(crbug.com/590856): It's still broken if we choose not to crash when | 2323 // TODO(crbug.com/590856): It's still broken if we choose not to crash when |
2325 // the check fails. | 2324 // the check fails. |
2326 if (!checkLayoutInvalidationIsAllowed()) | 2325 if (!checkLayoutInvalidationIsAllowed()) |
2327 return; | 2326 return; |
2328 layoutViewItem.setNeedsLayout(LayoutInvalidationReason::Unknown); | 2327 layoutViewItem.setNeedsLayout(LayoutInvalidationReason::Unknown); |
2329 } | 2328 } |
2330 | 2329 |
2331 bool FrameView::isTransparent() const { | |
2332 return m_isTransparent; | |
2333 } | |
2334 | |
2335 void FrameView::setTransparent(bool isTransparent) { | |
2336 m_isTransparent = isTransparent; | |
2337 DisableCompositingQueryAsserts disabler; | |
2338 if (!layoutViewItem().isNull() && | |
2339 layoutViewItem().layer()->hasCompositedLayerMapping()) | |
2340 layoutViewItem().layer()->compositedLayerMapping()->updateContentsOpaque(); | |
2341 } | |
2342 | |
2343 bool FrameView::hasOpaqueBackground() const { | 2330 bool FrameView::hasOpaqueBackground() const { |
2344 return !m_isTransparent && !m_baseBackgroundColor.hasAlpha(); | 2331 return !m_baseBackgroundColor.hasAlpha(); |
2345 } | 2332 } |
2346 | 2333 |
2347 Color FrameView::baseBackgroundColor() const { | 2334 Color FrameView::baseBackgroundColor() const { |
2348 return m_baseBackgroundColor; | 2335 return m_baseBackgroundColor; |
2349 } | 2336 } |
2350 | 2337 |
2351 void FrameView::setBaseBackgroundColor(const Color& backgroundColor) { | 2338 void FrameView::setBaseBackgroundColor(const Color& backgroundColor) { |
2352 m_baseBackgroundColor = backgroundColor; | 2339 m_baseBackgroundColor = backgroundColor; |
2353 | 2340 |
2354 if (!layoutViewItem().isNull() && | 2341 if (!layoutViewItem().isNull() && |
2355 layoutViewItem().layer()->hasCompositedLayerMapping()) { | 2342 layoutViewItem().layer()->hasCompositedLayerMapping()) { |
2356 CompositedLayerMapping* compositedLayerMapping = | 2343 CompositedLayerMapping* compositedLayerMapping = |
2357 layoutViewItem().layer()->compositedLayerMapping(); | 2344 layoutViewItem().layer()->compositedLayerMapping(); |
2358 compositedLayerMapping->updateContentsOpaque(); | 2345 compositedLayerMapping->updateContentsOpaque(); |
2359 if (compositedLayerMapping->mainGraphicsLayer()) | 2346 if (compositedLayerMapping->mainGraphicsLayer()) |
2360 compositedLayerMapping->mainGraphicsLayer()->setNeedsDisplay(); | 2347 compositedLayerMapping->mainGraphicsLayer()->setNeedsDisplay(); |
2361 } | 2348 } |
2362 recalculateScrollbarOverlayColorTheme(documentBackgroundColor()); | 2349 recalculateScrollbarOverlayColorTheme(documentBackgroundColor()); |
2363 | 2350 |
2364 if (!shouldThrottleRendering()) | 2351 if (!shouldThrottleRendering()) |
2365 page()->animator().scheduleVisualUpdate(m_frame.get()); | 2352 page()->animator().scheduleVisualUpdate(m_frame.get()); |
2366 } | 2353 } |
2367 | 2354 |
2368 void FrameView::updateBackgroundRecursively(const Color& backgroundColor, | 2355 void FrameView::updateBaseBackgroundColorRecursively( |
2369 bool transparent) { | 2356 const Color& baseBackgroundColor) { |
2370 forAllNonThrottledFrameViews( | 2357 forAllNonThrottledFrameViews([baseBackgroundColor](FrameView& frameView) { |
dcheng
2017/03/31 01:21:15
Btw, I'm wondering something: we only call this fr
Eric Seckler
2017/03/31 08:32:28
I'm not sure if there is a way for children to be
| |
2371 [backgroundColor, transparent](FrameView& frameView) { | 2358 frameView.setBaseBackgroundColor(baseBackgroundColor); |
2372 frameView.setTransparent(transparent); | 2359 }); |
2373 frameView.setBaseBackgroundColor(backgroundColor); | |
2374 }); | |
2375 } | 2360 } |
2376 | 2361 |
2377 void FrameView::scrollToFragmentAnchor() { | 2362 void FrameView::scrollToFragmentAnchor() { |
2378 Node* anchorNode = m_fragmentAnchor; | 2363 Node* anchorNode = m_fragmentAnchor; |
2379 if (!anchorNode) | 2364 if (!anchorNode) |
2380 return; | 2365 return; |
2381 | 2366 |
2382 // Scrolling is disabled during updateScrollbars (see | 2367 // Scrolling is disabled during updateScrollbars (see |
2383 // isProgrammaticallyScrollable). Bail now to avoid clearing m_fragmentAnchor | 2368 // isProgrammaticallyScrollable). Bail now to avoid clearing m_fragmentAnchor |
2384 // before we actually have a chance to scroll. | 2369 // before we actually have a chance to scroll. |
(...skipping 2877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5262 void FrameView::setAnimationHost( | 5247 void FrameView::setAnimationHost( |
5263 std::unique_ptr<CompositorAnimationHost> host) { | 5248 std::unique_ptr<CompositorAnimationHost> host) { |
5264 m_animationHost = std::move(host); | 5249 m_animationHost = std::move(host); |
5265 } | 5250 } |
5266 | 5251 |
5267 LayoutUnit FrameView::caretWidth() const { | 5252 LayoutUnit FrameView::caretWidth() const { |
5268 return LayoutUnit(getHostWindow()->windowToViewportScalar(1)); | 5253 return LayoutUnit(getHostWindow()->windowToViewportScalar(1)); |
5269 } | 5254 } |
5270 | 5255 |
5271 } // namespace blink | 5256 } // namespace blink |
OLD | NEW |