| 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 , m_layoutState(nullptr) | 88 , m_layoutState(nullptr) |
| 89 , m_layoutQuoteHead(nullptr) | 89 , m_layoutQuoteHead(nullptr) |
| 90 , m_layoutCounterCount(0) | 90 , m_layoutCounterCount(0) |
| 91 , m_hitTestCount(0) | 91 , m_hitTestCount(0) |
| 92 , m_hitTestCacheHits(0) | 92 , m_hitTestCacheHits(0) |
| 93 , m_hitTestCache(HitTestCache::create()) | 93 , m_hitTestCache(HitTestCache::create()) |
| 94 { | 94 { |
| 95 // init LayoutObject attributes | 95 // init LayoutObject attributes |
| 96 setInline(false); | 96 setInline(false); |
| 97 | 97 |
| 98 m_minPreferredLogicalWidth = 0; | 98 m_minPreferredLogicalWidth = LayoutUnit(); |
| 99 m_maxPreferredLogicalWidth = 0; | 99 m_maxPreferredLogicalWidth = LayoutUnit(); |
| 100 | 100 |
| 101 setPreferredLogicalWidthsDirty(MarkOnlyThis); | 101 setPreferredLogicalWidthsDirty(MarkOnlyThis); |
| 102 | 102 |
| 103 setPositionState(AbsolutePosition); // to 0,0 :) | 103 setPositionState(AbsolutePosition); // to 0,0 :) |
| 104 } | 104 } |
| 105 | 105 |
| 106 LayoutView::~LayoutView() | 106 LayoutView::~LayoutView() |
| 107 { | 107 { |
| 108 } | 108 } |
| 109 | 109 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 | 156 |
| 157 void LayoutView::clearHitTestCache() | 157 void LayoutView::clearHitTestCache() |
| 158 { | 158 { |
| 159 m_hitTestCache->clear(); | 159 m_hitTestCache->clear(); |
| 160 if (LayoutPart* frameLayoutObject = frame()->ownerLayoutObject()) | 160 if (LayoutPart* frameLayoutObject = frame()->ownerLayoutObject()) |
| 161 frameLayoutObject->view()->clearHitTestCache(); | 161 frameLayoutObject->view()->clearHitTestCache(); |
| 162 } | 162 } |
| 163 | 163 |
| 164 void LayoutView::computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit, Logi
calExtentComputedValues& computedValues) const | 164 void LayoutView::computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit, Logi
calExtentComputedValues& computedValues) const |
| 165 { | 165 { |
| 166 computedValues.m_extent = viewLogicalHeightForBoxSizing(); | 166 computedValues.m_extent = LayoutUnit(viewLogicalHeightForBoxSizing()); |
| 167 } | 167 } |
| 168 | 168 |
| 169 void LayoutView::updateLogicalWidth() | 169 void LayoutView::updateLogicalWidth() |
| 170 { | 170 { |
| 171 setLogicalWidth(viewLogicalWidthForBoxSizing()); | 171 setLogicalWidth(LayoutUnit(viewLogicalWidthForBoxSizing())); |
| 172 } | 172 } |
| 173 | 173 |
| 174 bool LayoutView::isChildAllowed(LayoutObject* child, const ComputedStyle&) const | 174 bool LayoutView::isChildAllowed(LayoutObject* child, const ComputedStyle&) const |
| 175 { | 175 { |
| 176 return child->isBox(); | 176 return child->isBox(); |
| 177 } | 177 } |
| 178 | 178 |
| 179 void LayoutView::layoutContent() | 179 void LayoutView::layoutContent() |
| 180 { | 180 { |
| 181 ASSERT(needsLayout()); | 181 ASSERT(needsLayout()); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 } | 230 } |
| 231 | 231 |
| 232 bool LayoutView::doingFullPaintInvalidation() const | 232 bool LayoutView::doingFullPaintInvalidation() const |
| 233 { | 233 { |
| 234 return m_frameView->needsFullPaintInvalidation(); | 234 return m_frameView->needsFullPaintInvalidation(); |
| 235 } | 235 } |
| 236 | 236 |
| 237 void LayoutView::layout() | 237 void LayoutView::layout() |
| 238 { | 238 { |
| 239 if (!document().paginated()) | 239 if (!document().paginated()) |
| 240 setPageLogicalHeight(0); | 240 setPageLogicalHeight(LayoutUnit()); |
| 241 | 241 |
| 242 if (pageLogicalHeight() && shouldUsePrintingLayout()) { | 242 if (pageLogicalHeight() && shouldUsePrintingLayout()) { |
| 243 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = logicalWidth()
; | 243 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = logicalWidth()
; |
| 244 if (!m_fragmentationContext) | 244 if (!m_fragmentationContext) |
| 245 m_fragmentationContext = adoptPtr(new ViewFragmentationContext(*this
)); | 245 m_fragmentationContext = adoptPtr(new ViewFragmentationContext(*this
)); |
| 246 } else if (m_fragmentationContext) { | 246 } else if (m_fragmentationContext) { |
| 247 m_fragmentationContext.clear(); | 247 m_fragmentationContext.clear(); |
| 248 } | 248 } |
| 249 | 249 |
| 250 SubtreeLayoutScope layoutScope(*this); | 250 SubtreeLayoutScope layoutScope(*this); |
| (...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 897 | 897 |
| 898 int LayoutView::viewLogicalHeightForBoxSizing() const | 898 int LayoutView::viewLogicalHeightForBoxSizing() const |
| 899 { | 899 { |
| 900 return viewLogicalHeight(document().settings() && document().settings()->roo
tLayerScrolls() ? IncludeScrollbars : ExcludeScrollbars); | 900 return viewLogicalHeight(document().settings() && document().settings()->roo
tLayerScrolls() ? IncludeScrollbars : ExcludeScrollbars); |
| 901 } | 901 } |
| 902 | 902 |
| 903 LayoutUnit LayoutView::viewLogicalHeightForPercentages() const | 903 LayoutUnit LayoutView::viewLogicalHeightForPercentages() const |
| 904 { | 904 { |
| 905 if (shouldUsePrintingLayout()) | 905 if (shouldUsePrintingLayout()) |
| 906 return pageLogicalHeight(); | 906 return pageLogicalHeight(); |
| 907 return viewLogicalHeight(); | 907 return LayoutUnit(viewLogicalHeight()); |
| 908 } | 908 } |
| 909 | 909 |
| 910 float LayoutView::zoomFactor() const | 910 float LayoutView::zoomFactor() const |
| 911 { | 911 { |
| 912 return m_frameView->frame().pageZoomFactor(); | 912 return m_frameView->frame().pageZoomFactor(); |
| 913 } | 913 } |
| 914 | 914 |
| 915 void LayoutView::updateHitTestResult(HitTestResult& result, const LayoutPoint& p
oint) | 915 void LayoutView::updateHitTestResult(HitTestResult& result, const LayoutPoint& p
oint) |
| 916 { | 916 { |
| 917 if (result.innerNode()) | 917 if (result.innerNode()) |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 989 } | 989 } |
| 990 | 990 |
| 991 void LayoutView::sendMediaPositionChangeNotifications(const IntRect& visibleRect
) | 991 void LayoutView::sendMediaPositionChangeNotifications(const IntRect& visibleRect
) |
| 992 { | 992 { |
| 993 for (auto& media : m_mediaForPositionNotification) { | 993 for (auto& media : m_mediaForPositionNotification) { |
| 994 media->notifyPositionMayHaveChanged(visibleRect); | 994 media->notifyPositionMayHaveChanged(visibleRect); |
| 995 } | 995 } |
| 996 } | 996 } |
| 997 | 997 |
| 998 } // namespace blink | 998 } // namespace blink |
| OLD | NEW |