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 |
| 1722 page->chromeClient().clearCompositedSelection(); | 1722 if (localFrame && computeCompositedSelection(*localFrame, selection)) { |
| 1723 return; | 1723 page->chromeClient().updateCompositedSelection(localFrame, selection); |
| 1724 } else { | |
| 1725 if (localFrame) { | |
| 1726 page->chromeClient().clearCompositedSelection(localFrame); | |
| 1727 } else { | |
| 1728 // Clearing the mainframe when there is no focused frame (and hence | |
| 1729 // no localFrame) is legacy behaviour, and implemented here to | |
| 1730 // satisfy ParameterizedWebFrameTest.CompositedSelectionBoundsCleare d's | |
| 1731 // first check that the composited selection has been cleared even | |
| 1732 // though no frame has focus yet. If this is not desired, then the | |
| 1733 // expectation needs to be removed from the test. | |
| 1734 LocalFrame* mainLocalFrame = m_frame->localFrameRoot(); | |
| 1735 if (mainLocalFrame) | |
| 1736 page->chromeClient().clearCompositedSelection(mainLocalFrame); | |
|
bokan
2016/08/11 14:40:09
IMO, it's a little clearer if there's just one cle
| |
| 1737 } | |
| 1724 } | 1738 } |
| 1725 | |
| 1726 page->chromeClient().updateCompositedSelection(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 2511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4248 } | 4260 } |
| 4249 | 4261 |
| 4250 bool FrameView::canThrottleRendering() const | 4262 bool FrameView::canThrottleRendering() const |
| 4251 { | 4263 { |
| 4252 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) | 4264 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) |
| 4253 return false; | 4265 return false; |
| 4254 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling); | 4266 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling); |
| 4255 } | 4267 } |
| 4256 | 4268 |
| 4257 } // namespace blink | 4269 } // namespace blink |
| OLD | NEW |