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. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. |
4 * All rights reserved. | 4 * All rights reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 frameView()->updateLifecycleToCompositingCleanPlusScrolling(); | 122 frameView()->updateLifecycleToCompositingCleanPlusScrolling(); |
123 HitTestLatencyRecorder hitTestLatencyRecorder( | 123 HitTestLatencyRecorder hitTestLatencyRecorder( |
124 result.hitTestRequest().allowsChildFrameContent()); | 124 result.hitTestRequest().allowsChildFrameContent()); |
125 return hitTestNoLifecycleUpdate(result); | 125 return hitTestNoLifecycleUpdate(result); |
126 } | 126 } |
127 | 127 |
128 bool LayoutView::hitTestNoLifecycleUpdate(HitTestResult& result) { | 128 bool LayoutView::hitTestNoLifecycleUpdate(HitTestResult& result) { |
129 TRACE_EVENT_BEGIN0("blink,devtools.timeline", "HitTest"); | 129 TRACE_EVENT_BEGIN0("blink,devtools.timeline", "HitTest"); |
130 m_hitTestCount++; | 130 m_hitTestCount++; |
131 | 131 |
132 ASSERT(!result.hitTestLocation().isRectBasedTest() || | 132 DCHECK(!result.hitTestLocation().isRectBasedTest() || |
133 result.hitTestRequest().listBased()); | 133 result.hitTestRequest().listBased()); |
134 | 134 |
135 commitPendingSelection(); | 135 commitPendingSelection(); |
136 | 136 |
137 uint64_t domTreeVersion = document().domTreeVersion(); | 137 uint64_t domTreeVersion = document().domTreeVersion(); |
138 HitTestResult cacheResult = result; | 138 HitTestResult cacheResult = result; |
139 bool hitLayer = false; | 139 bool hitLayer = false; |
140 if (m_hitTestCache->lookupCachedResult(cacheResult, domTreeVersion)) { | 140 if (m_hitTestCache->lookupCachedResult(cacheResult, domTreeVersion)) { |
141 m_hitTestCacheHits++; | 141 m_hitTestCacheHits++; |
142 hitLayer = true; | 142 hitLayer = true; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 bool LayoutView::canHaveChildren() const { | 192 bool LayoutView::canHaveChildren() const { |
193 FrameOwner* owner = frame()->owner(); | 193 FrameOwner* owner = frame()->owner(); |
194 if (!owner) | 194 if (!owner) |
195 return true; | 195 return true; |
196 if (!RuntimeEnabledFeatures::displayNoneIFrameCreatesNoLayoutObjectEnabled()) | 196 if (!RuntimeEnabledFeatures::displayNoneIFrameCreatesNoLayoutObjectEnabled()) |
197 return true; | 197 return true; |
198 return !owner->isDisplayNone(); | 198 return !owner->isDisplayNone(); |
199 } | 199 } |
200 | 200 |
201 void LayoutView::layoutContent() { | 201 void LayoutView::layoutContent() { |
202 ASSERT(needsLayout()); | 202 DCHECK(needsLayout()); |
203 | 203 |
204 LayoutBlockFlow::layout(); | 204 LayoutBlockFlow::layout(); |
205 | 205 |
206 #if DCHECK_IS_ON() | 206 #if DCHECK_IS_ON() |
207 checkLayoutState(); | 207 checkLayoutState(); |
208 #endif | 208 #endif |
209 } | 209 } |
210 | 210 |
211 #if DCHECK_IS_ON() | 211 #if DCHECK_IS_ON() |
212 void LayoutView::checkLayoutState() { | 212 void LayoutView::checkLayoutState() { |
213 ASSERT(!m_layoutState->next()); | 213 DCHECK(!m_layoutState->next()); |
214 } | 214 } |
215 #endif | 215 #endif |
216 | 216 |
217 void LayoutView::setShouldDoFullPaintInvalidationOnResizeIfNeeded( | 217 void LayoutView::setShouldDoFullPaintInvalidationOnResizeIfNeeded( |
218 bool widthChanged, | 218 bool widthChanged, |
219 bool heightChanged) { | 219 bool heightChanged) { |
220 // When background-attachment is 'fixed', we treat the viewport (instead of | 220 // When background-attachment is 'fixed', we treat the viewport (instead of |
221 // the 'root' i.e. html or body) as the background positioning area, and we | 221 // the 'root' i.e. html or body) as the background positioning area, and we |
222 // should fully invalidate on viewport resize if the background image is not | 222 // should fully invalidate on viewport resize if the background image is not |
223 // composited and needs full paint invalidation on background positioning area | 223 // composited and needs full paint invalidation on background positioning area |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 child->style()->logicalMaxHeight().isPercentOrCalc()) | 279 child->style()->logicalMaxHeight().isPercentOrCalc()) |
280 layoutScope.setChildNeedsLayout(child); | 280 layoutScope.setChildNeedsLayout(child); |
281 } | 281 } |
282 | 282 |
283 if (document().svgExtensions()) | 283 if (document().svgExtensions()) |
284 document() | 284 document() |
285 .accessSVGExtensions() | 285 .accessSVGExtensions() |
286 .invalidateSVGRootsWithRelativeLengthDescendents(&layoutScope); | 286 .invalidateSVGRootsWithRelativeLengthDescendents(&layoutScope); |
287 } | 287 } |
288 | 288 |
289 ASSERT(!m_layoutState); | 289 DCHECK(!m_layoutState); |
290 if (!needsLayout()) | 290 if (!needsLayout()) |
291 return; | 291 return; |
292 | 292 |
293 LayoutState rootLayoutState(*this); | 293 LayoutState rootLayoutState(*this); |
294 | 294 |
295 layoutContent(); | 295 layoutContent(); |
296 | 296 |
297 #if DCHECK_IS_ON() | 297 #if DCHECK_IS_ON() |
298 checkLayoutState(); | 298 checkLayoutState(); |
299 #endif | 299 #endif |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 } | 558 } |
559 | 559 |
560 LayoutSize LayoutView::offsetForFixedPosition(bool includePendingScroll) const { | 560 LayoutSize LayoutView::offsetForFixedPosition(bool includePendingScroll) const { |
561 FloatSize adjustment; | 561 FloatSize adjustment; |
562 if (m_frameView) { | 562 if (m_frameView) { |
563 adjustment += m_frameView->getScrollOffset(); | 563 adjustment += m_frameView->getScrollOffset(); |
564 | 564 |
565 // FIXME: Paint invalidation should happen after scroll updates, so there | 565 // FIXME: Paint invalidation should happen after scroll updates, so there |
566 // should be no pending scroll delta. | 566 // should be no pending scroll delta. |
567 // However, we still have paint invalidation during layout, so we can't | 567 // However, we still have paint invalidation during layout, so we can't |
568 // ASSERT for now. crbug.com/434950. | 568 // DCHECK for now. crbug.com/434950. |
569 // ASSERT(m_frameView->pendingScrollDelta().isZero()); | 569 // DCHECK(m_frameView->pendingScrollDelta().isZero()); |
570 // If we have a pending scroll, invalidate the previous scroll position. | 570 // If we have a pending scroll, invalidate the previous scroll position. |
571 if (includePendingScroll && !m_frameView->pendingScrollDelta().isZero()) | 571 if (includePendingScroll && !m_frameView->pendingScrollDelta().isZero()) |
572 adjustment -= m_frameView->pendingScrollDelta(); | 572 adjustment -= m_frameView->pendingScrollDelta(); |
573 } | 573 } |
574 | 574 |
575 if (hasOverflowClip()) | 575 if (hasOverflowClip()) |
576 adjustment += FloatSize(scrolledContentOffset()); | 576 adjustment += FloatSize(scrolledContentOffset()); |
577 | 577 |
578 return roundedLayoutSize(adjustment); | 578 return roundedLayoutSize(adjustment); |
579 } | 579 } |
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1076 bool LayoutView::paintedOutputOfObjectHasNoEffectRegardlessOfSize() const { | 1076 bool LayoutView::paintedOutputOfObjectHasNoEffectRegardlessOfSize() const { |
1077 // Frame scroll corner is painted using LayoutView as the display item client. | 1077 // Frame scroll corner is painted using LayoutView as the display item client. |
1078 if (!RuntimeEnabledFeatures::rootLayerScrollingEnabled() && | 1078 if (!RuntimeEnabledFeatures::rootLayerScrollingEnabled() && |
1079 (frameView()->horizontalScrollbar() || frameView()->verticalScrollbar())) | 1079 (frameView()->horizontalScrollbar() || frameView()->verticalScrollbar())) |
1080 return false; | 1080 return false; |
1081 | 1081 |
1082 return LayoutBlockFlow::paintedOutputOfObjectHasNoEffectRegardlessOfSize(); | 1082 return LayoutBlockFlow::paintedOutputOfObjectHasNoEffectRegardlessOfSize(); |
1083 } | 1083 } |
1084 | 1084 |
1085 } // namespace blink | 1085 } // namespace blink |
OLD | NEW |