Chromium Code Reviews| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 53 , m_frameView(document->view()) | 53 , m_frameView(document->view()) |
| 54 , m_selectionStart(0) | 54 , m_selectionStart(0) |
| 55 , m_selectionEnd(0) | 55 , m_selectionEnd(0) |
| 56 , m_selectionStartPos(-1) | 56 , m_selectionStartPos(-1) |
| 57 , m_selectionEndPos(-1) | 57 , m_selectionEndPos(-1) |
| 58 , m_pageLogicalHeight(0) | 58 , m_pageLogicalHeight(0) |
| 59 , m_pageLogicalHeightChanged(false) | 59 , m_pageLogicalHeightChanged(false) |
| 60 , m_layoutState(0) | 60 , m_layoutState(0) |
| 61 , m_renderQuoteHead(0) | 61 , m_renderQuoteHead(0) |
| 62 , m_renderCounterCount(0) | 62 , m_renderCounterCount(0) |
| 63 , m_hitTestCount(0) | |
| 63 { | 64 { |
| 64 // init RenderObject attributes | 65 // init RenderObject attributes |
| 65 setInline(false); | 66 setInline(false); |
| 66 | 67 |
| 67 m_minPreferredLogicalWidth = 0; | 68 m_minPreferredLogicalWidth = 0; |
| 68 m_maxPreferredLogicalWidth = 0; | 69 m_maxPreferredLogicalWidth = 0; |
| 69 | 70 |
| 70 setPreferredLogicalWidthsDirty(MarkOnlyThis); | 71 setPreferredLogicalWidthsDirty(MarkOnlyThis); |
| 71 | 72 |
| 72 setPositionState(AbsolutePosition); // to 0,0 :) | 73 setPositionState(AbsolutePosition); // to 0,0 :) |
| 73 } | 74 } |
| 74 | 75 |
| 75 RenderView::~RenderView() | 76 RenderView::~RenderView() |
| 76 { | 77 { |
| 77 } | 78 } |
| 78 | 79 |
| 79 bool RenderView::hitTest(const HitTestRequest& request, HitTestResult& result) | 80 bool RenderView::hitTest(const HitTestRequest& request, HitTestResult& result) |
| 80 { | 81 { |
| 81 return hitTest(request, result.hitTestLocation(), result); | 82 return hitTest(request, result.hitTestLocation(), result); |
| 82 } | 83 } |
| 83 | 84 |
| 84 bool RenderView::hitTest(const HitTestRequest& request, const HitTestLocation& l ocation, HitTestResult& result) | 85 bool RenderView::hitTest(const HitTestRequest& request, const HitTestLocation& l ocation, HitTestResult& result) |
| 85 { | 86 { |
| 86 TRACE_EVENT0("blink", "RenderView::hitTest"); | 87 TRACE_EVENT0("blink", "RenderView::hitTest"); |
| 88 m_hitTestCount++; | |
| 87 | 89 |
| 88 // We have to recursively update layout/style here because otherwise, when t he hit test recurses | 90 // We have to recursively update layout/style here because otherwise, when t he hit test recurses |
| 89 // into a child document, it could trigger a layout on the parent document, which can destroy RenderLayers | 91 // into a child document, it could trigger a layout on the parent document, which can destroy RenderLayers |
| 90 // that are higher up in the call stack, leading to crashes. | 92 // that are higher up in the call stack, leading to crashes. |
| 91 // Note that Document::updateLayout calls its parent's updateLayout. | 93 // Note that Document::updateLayout calls its parent's updateLayout. |
| 92 // FIXME: It should be the caller's responsibility to ensure an up-to-date l ayout. | 94 // FIXME: It should be the caller's responsibility to ensure an up-to-date l ayout. |
| 93 frameView()->updateLayoutAndStyleIfNeededRecursive(); | 95 frameView()->updateLayoutAndStyleIfNeededRecursive(); |
| 94 return layer()->hitTest(request, location, result); | 96 return layer()->hitTest(request, location, result); |
| 95 } | 97 } |
| 96 | 98 |
| 99 unsigned RenderView::hitTestCountDelta() | |
|
esprehn
2014/06/26 02:33:50
This should just be a const inline getter, remove
Rick Byers
2014/06/26 15:35:18
Done.
| |
| 100 { | |
| 101 unsigned count = m_hitTestCount; | |
| 102 m_hitTestCount = 0; | |
| 103 return count; | |
| 104 } | |
| 105 | |
| 97 void RenderView::computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit, Logi calExtentComputedValues& computedValues) const | 106 void RenderView::computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit, Logi calExtentComputedValues& computedValues) const |
| 98 { | 107 { |
| 99 computedValues.m_extent = (!shouldUsePrintingLayout() && m_frameView) ? Layo utUnit(viewLogicalHeight()) : logicalHeight; | 108 computedValues.m_extent = (!shouldUsePrintingLayout() && m_frameView) ? Layo utUnit(viewLogicalHeight()) : logicalHeight; |
| 100 } | 109 } |
| 101 | 110 |
| 102 void RenderView::updateLogicalWidth() | 111 void RenderView::updateLogicalWidth() |
| 103 { | 112 { |
| 104 if (!shouldUsePrintingLayout() && m_frameView) | 113 if (!shouldUsePrintingLayout() && m_frameView) |
| 105 setLogicalWidth(viewLogicalWidth()); | 114 setLogicalWidth(viewLogicalWidth()); |
| 106 } | 115 } |
| (...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 992 return viewWidth(IncludeScrollbars) / scale; | 1001 return viewWidth(IncludeScrollbars) / scale; |
| 993 } | 1002 } |
| 994 | 1003 |
| 995 double RenderView::layoutViewportHeight() const | 1004 double RenderView::layoutViewportHeight() const |
| 996 { | 1005 { |
| 997 float scale = m_frameView ? m_frameView->frame().pageZoomFactor() : 1; | 1006 float scale = m_frameView ? m_frameView->frame().pageZoomFactor() : 1; |
| 998 return viewHeight(IncludeScrollbars) / scale; | 1007 return viewHeight(IncludeScrollbars) / scale; |
| 999 } | 1008 } |
| 1000 | 1009 |
| 1001 } // namespace WebCore | 1010 } // namespace WebCore |
| OLD | NEW |