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

Side by Side Diff: sky/engine/core/rendering/RenderBlock.h

Issue 700743002: Remove margin collapsing. (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
« no previous file with comments | « no previous file | sky/engine/core/rendering/RenderBlock.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) 2007 David Smith (catfish.man@gmail.com) 4 * (C) 2007 David Smith (catfish.man@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All r ights reserved. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All r ights 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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 LayoutSize logicalSizeForChild(const RenderBox* child) const { return child- >size(); } 187 LayoutSize logicalSizeForChild(const RenderBox* child) const { return child- >size(); }
188 LayoutUnit logicalTopForChild(const RenderBox* child) const { return child-> y(); } 188 LayoutUnit logicalTopForChild(const RenderBox* child) const { return child-> y(); }
189 LayoutUnit marginBeforeForChild(const RenderBoxModelObject* child) const { r eturn child->marginBefore(style()); } 189 LayoutUnit marginBeforeForChild(const RenderBoxModelObject* child) const { r eturn child->marginBefore(style()); }
190 LayoutUnit marginAfterForChild(const RenderBoxModelObject* child) const { re turn child->marginAfter(style()); } 190 LayoutUnit marginAfterForChild(const RenderBoxModelObject* child) const { re turn child->marginAfter(style()); }
191 LayoutUnit marginStartForChild(const RenderBoxModelObject* child) const { re turn child->marginStart(style()); } 191 LayoutUnit marginStartForChild(const RenderBoxModelObject* child) const { re turn child->marginStart(style()); }
192 LayoutUnit marginEndForChild(const RenderBoxModelObject* child) const { retu rn child->marginEnd(style()); } 192 LayoutUnit marginEndForChild(const RenderBoxModelObject* child) const { retu rn child->marginEnd(style()); }
193 void setMarginStartForChild(RenderBox* child, LayoutUnit value) const { chil d->setMarginStart(value, style()); } 193 void setMarginStartForChild(RenderBox* child, LayoutUnit value) const { chil d->setMarginStart(value, style()); }
194 void setMarginEndForChild(RenderBox* child, LayoutUnit value) const { child- >setMarginEnd(value, style()); } 194 void setMarginEndForChild(RenderBox* child, LayoutUnit value) const { child- >setMarginEnd(value, style()); }
195 void setMarginBeforeForChild(RenderBox* child, LayoutUnit value) const { chi ld->setMarginBefore(value, style()); } 195 void setMarginBeforeForChild(RenderBox* child, LayoutUnit value) const { chi ld->setMarginBefore(value, style()); }
196 void setMarginAfterForChild(RenderBox* child, LayoutUnit value) const { chil d->setMarginAfter(value, style()); } 196 void setMarginAfterForChild(RenderBox* child, LayoutUnit value) const { chil d->setMarginAfter(value, style()); }
197 LayoutUnit collapsedMarginBeforeForChild(const RenderBox* child) const; 197 LayoutUnit marginBeforeForChild(const RenderBox* child) const;
198 LayoutUnit collapsedMarginAfterForChild(const RenderBox* child) const; 198 LayoutUnit marginAfterForChild(const RenderBox* child) const;
199 199
200 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct ion) override; 200 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct ion) override;
201 201
202 virtual void scrollbarsChanged(bool /*horizontalScrollbarChanged*/, bool /*v erticalScrollbarChanged*/) { } 202 virtual void scrollbarsChanged(bool /*horizontalScrollbarChanged*/, bool /*v erticalScrollbarChanged*/) { }
203 203
204 LayoutUnit availableLogicalWidthForContent() const { return max<LayoutUnit>( 0, logicalRightOffsetForContent() - logicalLeftOffsetForContent()); } 204 LayoutUnit availableLogicalWidthForContent() const { return max<LayoutUnit>( 0, logicalRightOffsetForContent() - logicalLeftOffsetForContent()); }
205 LayoutUnit logicalLeftOffsetForContent() const { return borderLeft() + paddi ngLeft(); } 205 LayoutUnit logicalLeftOffsetForContent() const { return borderLeft() + paddi ngLeft(); }
206 LayoutUnit logicalRightOffsetForContent() const { return logicalLeftOffsetFo rContent() + availableLogicalWidth(); } 206 LayoutUnit logicalRightOffsetForContent() const { return logicalLeftOffsetFo rContent() + availableLogicalWidth(); }
207 LayoutUnit startOffsetForContent() const { return style()->isLeftToRightDire ction() ? logicalLeftOffsetForContent() : logicalWidth() - logicalRightOffsetFor Content(); } 207 LayoutUnit startOffsetForContent() const { return style()->isLeftToRightDire ction() ? logicalLeftOffsetForContent() : logicalWidth() - logicalRightOffsetFor Content(); }
208 LayoutUnit endOffsetForContent() const { return !style()->isLeftToRightDirec tion() ? logicalLeftOffsetForContent() : logicalWidth() - logicalRightOffsetForC ontent(); } 208 LayoutUnit endOffsetForContent() const { return !style()->isLeftToRightDirec tion() ? logicalLeftOffsetForContent() : logicalWidth() - logicalRightOffsetForC ontent(); }
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 306
307 static void collapseAnonymousBlockChild(RenderBlock* parent, RenderBlock* ch ild); 307 static void collapseAnonymousBlockChild(RenderBlock* parent, RenderBlock* ch ild);
308 308
309 virtual void dirtyLinesFromChangedChild(RenderObject* child) override final { m_lineBoxes.dirtyLinesFromChangedChild(this, child); } 309 virtual void dirtyLinesFromChangedChild(RenderObject* child) override final { m_lineBoxes.dirtyLinesFromChangedChild(this, child); }
310 310
311 void addChildToContinuation(RenderObject* newChild, RenderObject* beforeChil d); 311 void addChildToContinuation(RenderObject* newChild, RenderObject* beforeChil d);
312 virtual void addChildIgnoringContinuation(RenderObject* newChild, RenderObje ct* beforeChild) override; 312 virtual void addChildIgnoringContinuation(RenderObject* newChild, RenderObje ct* beforeChild) override;
313 313
314 void addChildIgnoringAnonymousColumnBlocks(RenderObject* newChild, RenderObj ect* beforeChild = 0); 314 void addChildIgnoringAnonymousColumnBlocks(RenderObject* newChild, RenderObj ect* beforeChild = 0);
315 315
316 virtual bool isSelfCollapsingBlock() const override;
317
318 void insertIntoTrackedRendererMaps(RenderBox* descendant, TrackedDescendants Map*&, TrackedContainerMap*&); 316 void insertIntoTrackedRendererMaps(RenderBox* descendant, TrackedDescendants Map*&, TrackedContainerMap*&);
319 static void removeFromTrackedRendererMaps(RenderBox* descendant, TrackedDesc endantsMap*&, TrackedContainerMap*&); 317 static void removeFromTrackedRendererMaps(RenderBox* descendant, TrackedDesc endantsMap*&, TrackedContainerMap*&);
320 318
321 Node* nodeForHitTest() const; 319 Node* nodeForHitTest() const;
322 320
323 // FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to Rend erBlockFlow 321 // FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to Rend erBlockFlow
324 virtual void paintFloats(PaintInfo&, const LayoutPoint&, bool) { } 322 virtual void paintFloats(PaintInfo&, const LayoutPoint&, bool) { }
325 void paintContents(PaintInfo&, const LayoutPoint&); 323 void paintContents(PaintInfo&, const LayoutPoint&);
326 void paintSelection(PaintInfo&, const LayoutPoint&); 324 void paintSelection(PaintInfo&, const LayoutPoint&);
327 void paintCarets(PaintInfo&, const LayoutPoint&); 325 void paintCarets(PaintInfo&, const LayoutPoint&);
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 RenderObjectChildList m_children; 393 RenderObjectChildList m_children;
396 RenderLineBoxList m_lineBoxes; // All of the root line boxes created for t his block flow. For example, <div>Hello<br>world.</div> will have two total lin es for the <div>. 394 RenderLineBoxList m_lineBoxes; // All of the root line boxes created for t his block flow. For example, <div>Hello<br>world.</div> will have two total lin es for the <div>.
397 395
398 LayoutUnit m_pageLogicalOffset; 396 LayoutUnit m_pageLogicalOffset;
399 397
400 unsigned m_hasMarginBeforeQuirk : 1; // Note these quirk values can't be put in RenderBlockRareData since they are set too frequently. 398 unsigned m_hasMarginBeforeQuirk : 1; // Note these quirk values can't be put in RenderBlockRareData since they are set too frequently.
401 unsigned m_hasMarginAfterQuirk : 1; 399 unsigned m_hasMarginAfterQuirk : 1;
402 unsigned m_beingDestroyed : 1; 400 unsigned m_beingDestroyed : 1;
403 unsigned m_hasMarkupTruncation : 1; 401 unsigned m_hasMarkupTruncation : 1;
404 unsigned m_hasBorderOrPaddingLogicalWidthChanged : 1; 402 unsigned m_hasBorderOrPaddingLogicalWidthChanged : 1;
405 mutable unsigned m_hasOnlySelfCollapsingChildren : 1;
406 403
407 // FIXME-BLOCKFLOW: Remove this when the line layout stuff has all moved out of RenderBlock 404 // FIXME-BLOCKFLOW: Remove this when the line layout stuff has all moved out of RenderBlock
408 friend class LineBreaker; 405 friend class LineBreaker;
409 406
410 // FIXME: This is temporary as we move code that accesses block flow 407 // FIXME: This is temporary as we move code that accesses block flow
411 // member variables out of RenderBlock and into RenderBlockFlow. 408 // member variables out of RenderBlock and into RenderBlockFlow.
412 friend class RenderBlockFlow; 409 friend class RenderBlockFlow;
413 }; 410 };
414 411
415 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderBlock, isRenderBlock()); 412 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderBlock, isRenderBlock());
416 413
417 } // namespace blink 414 } // namespace blink
418 415
419 #endif // RenderBlock_h 416 #endif // RenderBlock_h
OLDNEW
« no previous file with comments | « no previous file | sky/engine/core/rendering/RenderBlock.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698