| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 , m_selectionEnd(nullptr) | 57 , m_selectionEnd(nullptr) |
| 58 , m_selectionStartPos(-1) | 58 , m_selectionStartPos(-1) |
| 59 , m_selectionEndPos(-1) | 59 , m_selectionEndPos(-1) |
| 60 , m_pageLogicalHeight(0) | 60 , m_pageLogicalHeight(0) |
| 61 , m_pageLogicalHeightChanged(false) | 61 , m_pageLogicalHeightChanged(false) |
| 62 , m_layoutState(nullptr) | 62 , m_layoutState(nullptr) |
| 63 , m_layoutQuoteHead(nullptr) | 63 , m_layoutQuoteHead(nullptr) |
| 64 , m_layoutCounterCount(0) | 64 , m_layoutCounterCount(0) |
| 65 , m_hitTestCount(0) | 65 , m_hitTestCount(0) |
| 66 , m_hitTestCacheHits(0) | 66 , m_hitTestCacheHits(0) |
| 67 , m_hitTestCache(HitTestCache::create()) | |
| 68 , m_pendingSelection(PendingSelection::create()) | 67 , m_pendingSelection(PendingSelection::create()) |
| 69 { | 68 { |
| 70 // init LayoutObject attributes | 69 // init LayoutObject attributes |
| 71 setInline(false); | 70 setInline(false); |
| 72 | 71 |
| 73 m_minPreferredLogicalWidth = 0; | 72 m_minPreferredLogicalWidth = 0; |
| 74 m_maxPreferredLogicalWidth = 0; | 73 m_maxPreferredLogicalWidth = 0; |
| 75 | 74 |
| 76 setPreferredLogicalWidthsDirty(MarkOnlyThis); | 75 setPreferredLogicalWidthsDirty(MarkOnlyThis); |
| 77 | 76 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 92 // 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 |
| 93 // 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 |
| 94 // that are higher up in the call stack, leading to crashes. | 93 // that are higher up in the call stack, leading to crashes. |
| 95 // Note that Document::updateLayout calls its parent's updateLayout. | 94 // Note that Document::updateLayout calls its parent's updateLayout. |
| 96 // FIXME: It should be the caller's responsibility to ensure an up-to-date l
ayout. | 95 // FIXME: It should be the caller's responsibility to ensure an up-to-date l
ayout. |
| 97 frameView()->updateLayoutAndStyleForPainting(); | 96 frameView()->updateLayoutAndStyleForPainting(); |
| 98 commitPendingSelection(); | 97 commitPendingSelection(); |
| 99 | 98 |
| 100 uint64_t domTreeVersion = document().domTreeVersion(); | 99 uint64_t domTreeVersion = document().domTreeVersion(); |
| 101 HitTestResult cacheResult = result; | 100 HitTestResult cacheResult = result; |
| 102 bool cacheHit = m_hitTestCache->lookupCachedResult(cacheResult, domTreeVersi
on); | 101 bool cacheHit = m_hitTestCache.lookupCachedResult(cacheResult, domTreeVersio
n); |
| 103 bool hitLayer = layer()->hitTest(result); | 102 bool hitLayer = layer()->hitTest(result); |
| 104 | 103 |
| 105 // FrameView scrollbars are not the same as Layer scrollbars tested by Layer
::hitTestOverflowControls, | 104 // FrameView scrollbars are not the same as Layer scrollbars tested by Layer
::hitTestOverflowControls, |
| 106 // so we need to test FrameView scrollbars separately here. Note that it's i
mportant we do this after | 105 // so we need to test FrameView scrollbars separately here. Note that it's i
mportant we do this after |
| 107 // the hit test above, because that may overwrite the entire HitTestResult w
hen it finds a hit. | 106 // the hit test above, because that may overwrite the entire HitTestResult w
hen it finds a hit. |
| 108 IntPoint framePoint = frameView()->contentsToFrame(result.hitTestLocation().
roundedPoint()); | 107 IntPoint framePoint = frameView()->contentsToFrame(result.hitTestLocation().
roundedPoint()); |
| 109 if (Scrollbar* frameScrollbar = frameView()->scrollbarAtFramePoint(framePoin
t)) | 108 if (Scrollbar* frameScrollbar = frameView()->scrollbarAtFramePoint(framePoin
t)) |
| 110 result.setScrollbar(frameScrollbar); | 109 result.setScrollbar(frameScrollbar); |
| 111 | 110 |
| 112 if (cacheHit) { | 111 if (cacheHit) { |
| 113 m_hitTestCacheHits++; | 112 m_hitTestCacheHits++; |
| 114 m_hitTestCache->verifyCachedResult(result, cacheResult); | 113 m_hitTestCache.verifyCachedResult(result, cacheResult); |
| 115 } | 114 } |
| 116 | 115 |
| 117 if (hitLayer) { | 116 if (hitLayer) { |
| 118 m_hitTestCache->addCachedResult(result, domTreeVersion); | 117 m_hitTestCache.addCachedResult(result, domTreeVersion); |
| 119 | 118 |
| 120 if (layer()->graphicsLayerBacking()) { | 119 if (layer()->graphicsLayerBacking()) { |
| 121 layer()->graphicsLayerBacking()->platformLayer()->setHitTestCacheRec
t(enclosingIntRect(result.validityRect())); | 120 layer()->graphicsLayerBacking()->platformLayer()->setHitTestCacheRec
t(enclosingIntRect(result.validityRect())); |
| 122 } | 121 } |
| 123 } | 122 } |
| 124 | 123 |
| 125 TRACE_EVENT_END1("blink,devtools.timeline", "HitTest", "endData", InspectorH
itTestEvent::endData(result.hitTestRequest(), result.hitTestLocation(), result))
; | 124 TRACE_EVENT_END1("blink,devtools.timeline", "HitTest", "endData", InspectorH
itTestEvent::endData(result.hitTestRequest(), result.hitTestLocation(), result))
; |
| 126 return hitLayer; | 125 return hitLayer; |
| 127 } | 126 } |
| 128 | 127 |
| (...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 964 return viewHeight(IncludeScrollbars) / scale; | 963 return viewHeight(IncludeScrollbars) / scale; |
| 965 } | 964 } |
| 966 | 965 |
| 967 void LayoutView::willBeDestroyed() | 966 void LayoutView::willBeDestroyed() |
| 968 { | 967 { |
| 969 LayoutBlockFlow::willBeDestroyed(); | 968 LayoutBlockFlow::willBeDestroyed(); |
| 970 m_compositor.clear(); | 969 m_compositor.clear(); |
| 971 } | 970 } |
| 972 | 971 |
| 973 } // namespace blink | 972 } // namespace blink |
| OLD | NEW |