Chromium Code Reviews| 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 1700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1711 return; | 1711 return; |
| 1712 | 1712 |
| 1713 TRACE_EVENT0("blink", "FrameView::updateCompositedSelectionIfNeeded"); | 1713 TRACE_EVENT0("blink", "FrameView::updateCompositedSelectionIfNeeded"); |
| 1714 | 1714 |
| 1715 Page* page = frame().page(); | 1715 Page* page = frame().page(); |
| 1716 ASSERT(page); | 1716 ASSERT(page); |
| 1717 | 1717 |
| 1718 CompositedSelection selection; | 1718 CompositedSelection selection; |
| 1719 LocalFrame* focusedFrame = page->focusController().focusedFrame(); | 1719 LocalFrame* focusedFrame = page->focusController().focusedFrame(); |
| 1720 LocalFrame* localFrame = (focusedFrame && (focusedFrame->localFrameRoot() == m_frame->localFrameRoot())) ? focusedFrame : nullptr; | 1720 LocalFrame* localFrame = (focusedFrame && (focusedFrame->localFrameRoot() == m_frame->localFrameRoot())) ? focusedFrame : nullptr; |
| 1721 if (!localFrame || !computeCompositedSelection(*localFrame, selection)) { | 1721 if (!localFrame || !computeCompositedSelection(*localFrame, selection)) { |
|
bokan
2016/08/11 14:14:06
These `if` statements can be simplified to:
if (l
wjmaclean
2016/08/11 14:35:06
Done.
Sorry, I had thought about doing this, then
| |
| 1722 page->chromeClient().clearCompositedSelection(); | 1722 if (localFrame) { |
| 1723 page->chromeClient().clearCompositedSelection(localFrame); | |
| 1724 } else { | |
| 1725 // Clearing the mainframe when there is no focused frame (and hence | |
| 1726 // no localFrame) is legacy behaviour, and implemented here to | |
| 1727 // satisfy ParameterizedWebFrameTest.CompositedSelectionBoundsCleare d's | |
| 1728 // first check that the composited selection has been cleared even | |
| 1729 // though no frame has focus yet. If this is not desired, then the | |
| 1730 // expectation needs to be removed from the test. | |
| 1731 auto mainLocalFrame = m_frame->localFrameRoot(); | |
|
bokan
2016/08/11 14:14:06
IMO, readability is a bit better with s/auto/Local
wjmaclean
2016/08/11 14:35:06
Done.
| |
| 1732 if (mainLocalFrame) | |
| 1733 page->chromeClient().clearCompositedSelection(mainLocalFrame); | |
| 1734 } | |
| 1723 return; | 1735 return; |
| 1724 } | 1736 } |
| 1725 | 1737 |
| 1726 page->chromeClient().updateCompositedSelection(selection); | 1738 page->chromeClient().updateCompositedSelection(localFrame, selection); |
| 1727 } | 1739 } |
| 1728 | 1740 |
| 1729 HostWindow* FrameView::getHostWindow() const | 1741 HostWindow* FrameView::getHostWindow() const |
| 1730 { | 1742 { |
| 1731 Page* page = frame().page(); | 1743 Page* page = frame().page(); |
| 1732 if (!page) | 1744 if (!page) |
| 1733 return nullptr; | 1745 return nullptr; |
| 1734 return &page->chromeClient(); | 1746 return &page->chromeClient(); |
| 1735 } | 1747 } |
| 1736 | 1748 |
| (...skipping 2510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4247 } | 4259 } |
| 4248 | 4260 |
| 4249 bool FrameView::canThrottleRendering() const | 4261 bool FrameView::canThrottleRendering() const |
| 4250 { | 4262 { |
| 4251 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) | 4263 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) |
| 4252 return false; | 4264 return false; |
| 4253 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling); | 4265 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling); |
| 4254 } | 4266 } |
| 4255 | 4267 |
| 4256 } // namespace blink | 4268 } // namespace blink |
| OLD | NEW |