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

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

Issue 2051703002: Implement closed shadow adjustment for Element.offsetParent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Re-revert the previous and check position:fixed in layout code. Created 4 years, 5 months 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 // Populates StickyPositionConstraints, setting the sticky box rect, contain ing block rect and updating 143 // Populates StickyPositionConstraints, setting the sticky box rect, contain ing block rect and updating
144 // the constraint offsets according to the available space. 144 // the constraint offsets according to the available space.
145 FloatRect computeStickyConstrainingRect() const; 145 FloatRect computeStickyConstrainingRect() const;
146 void updateStickyPositionConstraints() const; 146 void updateStickyPositionConstraints() const;
147 LayoutSize stickyPositionOffset() const; 147 LayoutSize stickyPositionOffset() const;
148 148
149 LayoutSize offsetForInFlowPosition() const; 149 LayoutSize offsetForInFlowPosition() const;
150 150
151 // IE extensions. Used to calculate offsetWidth/Height. Overridden by inlin es (LayoutFlow) 151 // IE extensions. Used to calculate offsetWidth/Height. Overridden by inlin es (LayoutFlow)
152 // to return the remaining width on a given line (and the height of a single line). 152 // to return the remaining width on a given line (and the height of a single line).
153 virtual LayoutUnit offsetLeft() const; 153 virtual LayoutUnit offsetLeft(const Element*) const;
154 virtual LayoutUnit offsetTop() const; 154 virtual LayoutUnit offsetTop(const Element*) const;
155 virtual LayoutUnit offsetWidth() const = 0; 155 virtual LayoutUnit offsetWidth() const = 0;
156 virtual LayoutUnit offsetHeight() const = 0; 156 virtual LayoutUnit offsetHeight() const = 0;
157 157
158 int pixelSnappedOffsetLeft() const { return roundToInt(offsetLeft()); } 158 int pixelSnappedOffsetLeft(const Element* parent) const { return roundToInt( offsetLeft(parent)); }
159 int pixelSnappedOffsetTop() const { return roundToInt(offsetTop()); } 159 int pixelSnappedOffsetTop(const Element* parent) const { return roundToInt(o ffsetTop(parent)); }
160 virtual int pixelSnappedOffsetWidth() const; 160 virtual int pixelSnappedOffsetWidth(const Element*) const;
161 virtual int pixelSnappedOffsetHeight() const; 161 virtual int pixelSnappedOffsetHeight(const Element*) const;
162 162
163 bool hasSelfPaintingLayer() const; 163 bool hasSelfPaintingLayer() const;
164 PaintLayer* layer() const { return m_layer.get(); } 164 PaintLayer* layer() const { return m_layer.get(); }
165 PaintLayerScrollableArea* getScrollableArea() const; 165 PaintLayerScrollableArea* getScrollableArea() const;
166 166
167 virtual void updateFromStyle(); 167 virtual void updateFromStyle();
168 168
169 // The type of PaintLayer to instantiate. 169 // The type of PaintLayer to instantiate.
170 // Any value returned from this function other than NoPaintLayer 170 // Any value returned from this function other than NoPaintLayer
171 // will populate |m_layer|. 171 // will populate |m_layer|.
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 void setBackingNeedsPaintInvalidationInRect(const LayoutRect&, PaintInvalida tionReason, const LayoutObject&) const; 295 void setBackingNeedsPaintInvalidationInRect(const LayoutRect&, PaintInvalida tionReason, const LayoutObject&) const;
296 296
297 // http://www.w3.org/TR/css3-background/#body-background 297 // http://www.w3.org/TR/css3-background/#body-background
298 // <html> root element with no background steals background from its first < body> child. 298 // <html> root element with no background steals background from its first < body> child.
299 // The used background for such body element should be the initial value. (i .e. transparent) 299 // The used background for such body element should be the initial value. (i .e. transparent)
300 bool backgroundStolenForBeingBody(const ComputedStyle* rootElementStyle = nu llptr) const; 300 bool backgroundStolenForBeingBody(const ComputedStyle* rootElementStyle = nu llptr) const;
301 301
302 protected: 302 protected:
303 void willBeDestroyed() override; 303 void willBeDestroyed() override;
304 304
305 LayoutPoint adjustedPositionRelativeToOffsetParent(const LayoutPoint&) const ; 305 LayoutPoint adjustedPositionRelativeTo(const LayoutPoint&, const Element*) c onst;
306 306
307 bool calculateHasBoxDecorations() const; 307 bool calculateHasBoxDecorations() const;
308 308
309 // Returns the continuation associated with |this|. 309 // Returns the continuation associated with |this|.
310 // Returns nullptr if no continuation is associated with |this|. 310 // Returns nullptr if no continuation is associated with |this|.
311 // 311 //
312 // See the section about CONTINUATIONS AND ANONYMOUS LAYOUTBLOCKFLOWS in 312 // See the section about CONTINUATIONS AND ANONYMOUS LAYOUTBLOCKFLOWS in
313 // LayoutInline for more details about them. 313 // LayoutInline for more details about them.
314 // 314 //
315 // Our implementation uses a HashMap to store them to avoid paying the cost 315 // Our implementation uses a HashMap to store them to avoid paying the cost
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 std::unique_ptr<PaintLayer> m_layer; 381 std::unique_ptr<PaintLayer> m_layer;
382 382
383 std::unique_ptr<LayoutBoxModelObjectRareData> m_rareData; 383 std::unique_ptr<LayoutBoxModelObjectRareData> m_rareData;
384 }; 384 };
385 385
386 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBoxModelObject, isBoxModelObject()); 386 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBoxModelObject, isBoxModelObject());
387 387
388 } // namespace blink 388 } // namespace blink
389 389
390 #endif // LayoutBoxModelObject_h 390 #endif // LayoutBoxModelObject_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698