Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(672)

Side by Side Diff: sky/engine/core/rendering/RenderLayerModelObject.cpp

Issue 686633002: First pass at removing position:fixed. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
7 * Copyright (C) 2010, 2012 Google Inc. All rights reserved. 7 * Copyright (C) 2010, 2012 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 return m_layer && m_layer->isSelfPaintingLayer(); 64 return m_layer && m_layer->isSelfPaintingLayer();
65 } 65 }
66 66
67 ScrollableArea* RenderLayerModelObject::scrollableArea() const 67 ScrollableArea* RenderLayerModelObject::scrollableArea() const
68 { 68 {
69 return m_layer ? m_layer->scrollableArea() : 0; 69 return m_layer ? m_layer->scrollableArea() : 0;
70 } 70 }
71 71
72 void RenderLayerModelObject::willBeDestroyed() 72 void RenderLayerModelObject::willBeDestroyed()
73 { 73 {
74 if (isPositioned()) {
75 // Don't use this->view() because the document's renderView has been set to 0 during destruction.
76 if (LocalFrame* frame = this->frame()) {
77 if (FrameView* frameView = frame->view()) {
78 if (style()->hasViewportConstrainedPosition())
79 frameView->removeViewportConstrainedObject(this);
80 }
81 }
82 }
83
84 RenderObject::willBeDestroyed(); 74 RenderObject::willBeDestroyed();
85
86 destroyLayer(); 75 destroyLayer();
87 } 76 }
88 77
89 void RenderLayerModelObject::styleWillChange(StyleDifference diff, const RenderS tyle& newStyle) 78 void RenderLayerModelObject::styleWillChange(StyleDifference diff, const RenderS tyle& newStyle)
90 { 79 {
91 s_wasFloating = isFloating(); 80 s_wasFloating = isFloating();
92 81
93 if (RenderStyle* oldStyle = style()) { 82 if (RenderStyle* oldStyle = style()) {
94 if (parent() && diff.needsPaintInvalidationLayer()) { 83 if (parent() && diff.needsPaintInvalidationLayer()) {
95 if (oldStyle->hasAutoClip() != newStyle.hasAutoClip() 84 if (oldStyle->hasAutoClip() != newStyle.hasAutoClip()
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 if (hadTransform) 119 if (hadTransform)
131 setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(); 120 setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation();
132 } 121 }
133 122
134 if (layer()) { 123 if (layer()) {
135 // FIXME: Ideally we shouldn't need this setter but we can't easily infe r an overflow-only layer 124 // FIXME: Ideally we shouldn't need this setter but we can't easily infe r an overflow-only layer
136 // from the style. 125 // from the style.
137 layer()->setLayerType(type); 126 layer()->setLayerType(type);
138 layer()->styleChanged(diff, oldStyle); 127 layer()->styleChanged(diff, oldStyle);
139 } 128 }
140
141 if (FrameView *frameView = view()->frameView()) {
142 bool newStyleIsViewportConstained = style()->hasViewportConstrainedPosit ion();
143 bool oldStyleIsViewportConstrained = oldStyle && oldStyle->hasViewportCo nstrainedPosition();
144 if (newStyleIsViewportConstained != oldStyleIsViewportConstrained) {
145 if (newStyleIsViewportConstained && layer())
146 frameView->addViewportConstrainedObject(this);
147 else
148 frameView->removeViewportConstrainedObject(this);
149 }
150 }
151 } 129 }
152 130
153 void RenderLayerModelObject::addLayerHitTestRects(LayerHitTestRects& rects, cons t RenderLayer* currentLayer, const LayoutPoint& layerOffset, const LayoutRect& c ontainerRect) const 131 void RenderLayerModelObject::addLayerHitTestRects(LayerHitTestRects& rects, cons t RenderLayer* currentLayer, const LayoutPoint& layerOffset, const LayoutRect& c ontainerRect) const
154 { 132 {
155 if (hasLayer()) { 133 if (hasLayer()) {
156 if (isRenderView()) { 134 if (isRenderView()) {
157 // RenderView is handled with a special fast-path, but it needs to k now the current layer. 135 // RenderView is handled with a special fast-path, but it needs to k now the current layer.
158 RenderObject::addLayerHitTestRects(rects, layer(), LayoutPoint(), La youtRect()); 136 RenderObject::addLayerHitTestRects(rects, layer(), LayoutPoint(), La youtRect());
159 } else { 137 } else {
160 // Since a RenderObject never lives outside it's container RenderLay er, we can switch 138 // Since a RenderObject never lives outside it's container RenderLay er, we can switch
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 InvalidationReason reason = invalidatePaintIfNeeded(paintInvalidationState, newPaintInvalidationContainer); 177 InvalidationReason reason = invalidatePaintIfNeeded(paintInvalidationState, newPaintInvalidationContainer);
200 178
201 PaintInvalidationState childTreeWalkState(paintInvalidationState, *this, new PaintInvalidationContainer); 179 PaintInvalidationState childTreeWalkState(paintInvalidationState, *this, new PaintInvalidationContainer);
202 if (reason == InvalidationLocationChange || reason == InvalidationFull) 180 if (reason == InvalidationLocationChange || reason == InvalidationFull)
203 childTreeWalkState.setForceCheckForPaintInvalidation(); 181 childTreeWalkState.setForceCheckForPaintInvalidation();
204 RenderObject::invalidateTreeIfNeeded(childTreeWalkState); 182 RenderObject::invalidateTreeIfNeeded(childTreeWalkState);
205 } 183 }
206 184
207 } // namespace blink 185 } // namespace blink
208 186
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/RenderLayerClipper.cpp ('k') | sky/engine/core/rendering/RenderObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698