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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutBoxModelObject.h

Issue 1308273010: Adapt and reland old position sticky implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Merge with master (removing horizontal-bt test) Created 5 years 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 * Copyright (C) 2003, 2006, 2007, 2009 Apple Inc. All rights reserved. 4 * Copyright (C) 2003, 2006, 2007, 2009 Apple Inc. All rights reserved.
5 * Copyright (C) 2010 Google Inc. All rights reserved. 5 * Copyright (C) 2010 Google Inc. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 BackgroundBleedClipLayer, 55 BackgroundBleedClipLayer,
56 }; 56 };
57 57
58 enum ContentChangeType { 58 enum ContentChangeType {
59 ImageChanged, 59 ImageChanged,
60 CanvasChanged, 60 CanvasChanged,
61 CanvasContextChanged 61 CanvasContextChanged
62 }; 62 };
63 63
64 class InlineFlowBox; 64 class InlineFlowBox;
65 class StickyPositionViewportConstraints;
65 66
66 // This class is the base class for all CSS objects. 67 // This class is the base class for all CSS objects.
67 // 68 //
68 // All CSS objects follow the box model object. See THE BOX MODEL section in 69 // All CSS objects follow the box model object. See THE BOX MODEL section in
69 // LayoutBox for more information. 70 // LayoutBox for more information.
70 // 71 //
71 // This class actually doesn't have the box model but it exposes some common 72 // This class actually doesn't have the box model but it exposes some common
72 // functions or concepts that sub-classes can extend upon. For example, there 73 // functions or concepts that sub-classes can extend upon. For example, there
73 // are accessors for margins, borders, paddings and borderBoundingBox(). 74 // are accessors for margins, borders, paddings and borderBoundingBox().
74 // 75 //
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 public: 134 public:
134 LayoutBoxModelObject(ContainerNode*); 135 LayoutBoxModelObject(ContainerNode*);
135 ~LayoutBoxModelObject() override; 136 ~LayoutBoxModelObject() override;
136 137
137 // This is the only way layers should ever be destroyed. 138 // This is the only way layers should ever be destroyed.
138 void destroyLayer(); 139 void destroyLayer();
139 140
140 LayoutSize relativePositionOffset() const; 141 LayoutSize relativePositionOffset() const;
141 LayoutSize relativePositionLogicalOffset() const { return style()->isHorizon talWritingMode() ? relativePositionOffset() : relativePositionOffset().transpose dSize(); } 142 LayoutSize relativePositionLogicalOffset() const { return style()->isHorizon talWritingMode() ? relativePositionOffset() : relativePositionOffset().transpose dSize(); }
142 143
144 // Populates StickyPositionConstraints, setting the sticky box rect, contain ing block rect and updating
145 // the constraint offsets according to the available space.
146 void computeStickyPositionConstraints(StickyPositionViewportConstraints&, co nst LayoutRect& constrainingRect) const;
147 LayoutRect computeStickyConstrainingRect() const;
148 LayoutSize stickyPositionOffset() const;
149
143 LayoutSize offsetForInFlowPosition() const; 150 LayoutSize offsetForInFlowPosition() const;
144 151
145 // IE extensions. Used to calculate offsetWidth/Height. Overridden by inlin es (LayoutFlow) 152 // IE extensions. Used to calculate offsetWidth/Height. Overridden by inlin es (LayoutFlow)
146 // to return the remaining width on a given line (and the height of a single line). 153 // to return the remaining width on a given line (and the height of a single line).
147 virtual LayoutUnit offsetLeft() const; 154 virtual LayoutUnit offsetLeft() const;
148 virtual LayoutUnit offsetTop() const; 155 virtual LayoutUnit offsetTop() const;
149 virtual LayoutUnit offsetWidth() const = 0; 156 virtual LayoutUnit offsetWidth() const = 0;
150 virtual LayoutUnit offsetHeight() const = 0; 157 virtual LayoutUnit offsetHeight() const = 0;
151 158
152 int pixelSnappedOffsetLeft() const { return roundToInt(offsetLeft()); } 159 int pixelSnappedOffsetLeft() const { return roundToInt(offsetLeft()); }
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 // The PaintLayer associated with this object. 372 // The PaintLayer associated with this object.
366 // |m_layer| can be nullptr depending on the return value of layerTypeRequir ed(). 373 // |m_layer| can be nullptr depending on the return value of layerTypeRequir ed().
367 OwnPtr<PaintLayer> m_layer; 374 OwnPtr<PaintLayer> m_layer;
368 }; 375 };
369 376
370 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBoxModelObject, isBoxModelObject()); 377 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBoxModelObject, isBoxModelObject());
371 378
372 } // namespace blink 379 } // namespace blink
373 380
374 #endif // LayoutBoxModelObject_h 381 #endif // LayoutBoxModelObject_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698