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

Side by Side Diff: Source/core/layout/LayoutBlock.h

Issue 1121173002: Fix shrink-to-fit when children's writing-mode is orthogonal (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 4 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 * (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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 bool nodeAtPoint(HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) override; 199 bool nodeAtPoint(HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) override;
200 200
201 virtual void scrollbarsChanged(bool /*horizontalScrollbarChanged*/, bool /*v erticalScrollbarChanged*/) { } 201 virtual void scrollbarsChanged(bool /*horizontalScrollbarChanged*/, bool /*v erticalScrollbarChanged*/) { }
202 202
203 LayoutUnit availableLogicalWidthForContent() const { return max<LayoutUnit>( 0, logicalRightOffsetForContent() - logicalLeftOffsetForContent()); } 203 LayoutUnit availableLogicalWidthForContent() const { return max<LayoutUnit>( 0, logicalRightOffsetForContent() - logicalLeftOffsetForContent()); }
204 LayoutUnit logicalLeftOffsetForContent() const { return isHorizontalWritingM ode() ? borderLeft() + paddingLeft() : borderTop() + paddingTop(); } 204 LayoutUnit logicalLeftOffsetForContent() const { return isHorizontalWritingM ode() ? borderLeft() + paddingLeft() : borderTop() + paddingTop(); }
205 LayoutUnit logicalRightOffsetForContent() const { return logicalLeftOffsetFo rContent() + availableLogicalWidth(); } 205 LayoutUnit logicalRightOffsetForContent() const { return logicalLeftOffsetFo rContent() + availableLogicalWidth(); }
206 LayoutUnit startOffsetForContent() const { return style()->isLeftToRightDire ction() ? logicalLeftOffsetForContent() : logicalWidth() - logicalRightOffsetFor Content(); } 206 LayoutUnit startOffsetForContent() const { return style()->isLeftToRightDire ction() ? logicalLeftOffsetForContent() : logicalWidth() - logicalRightOffsetFor Content(); }
207 LayoutUnit endOffsetForContent() const { return !style()->isLeftToRightDirec tion() ? logicalLeftOffsetForContent() : logicalWidth() - logicalRightOffsetForC ontent(); } 207 LayoutUnit endOffsetForContent() const { return !style()->isLeftToRightDirec tion() ? logicalLeftOffsetForContent() : logicalWidth() - logicalRightOffsetForC ontent(); }
208 208
209 bool needsRecalcLogicalWidthAfterLayoutChildren() const { return m_needsReca lcLogicalWidthAfterLayoutChildren; }
210 void setNeedsRecalcLogicalWidthAfterLayoutChildren() { m_needsRecalcLogicalW idthAfterLayoutChildren = true; }
211 void clearNeedsRecalcLogicalWidthAfterLayoutChildren() { m_needsRecalcLogica lWidthAfterLayoutChildren = false; }
212
209 virtual LayoutUnit logicalLeftSelectionOffset(const LayoutBlock* rootBlock, LayoutUnit position) const; 213 virtual LayoutUnit logicalLeftSelectionOffset(const LayoutBlock* rootBlock, LayoutUnit position) const;
210 virtual LayoutUnit logicalRightSelectionOffset(const LayoutBlock* rootBlock, LayoutUnit position) const; 214 virtual LayoutUnit logicalRightSelectionOffset(const LayoutBlock* rootBlock, LayoutUnit position) const;
211 215
212 #if ENABLE(ASSERT) 216 #if ENABLE(ASSERT)
213 void checkPositionedObjectsNeedLayout(); 217 void checkPositionedObjectsNeedLayout();
214 bool paintsContinuationOutline(LayoutInline* flow); 218 bool paintsContinuationOutline(LayoutInline* flow);
215 #endif 219 #endif
216 #ifndef NDEBUG 220 #ifndef NDEBUG
217 void showLineTreeAndMark(const InlineBox* = nullptr, const char* = nullptr, const InlineBox* = nullptr, const char* = nullptr, const LayoutObject* = nullptr ) const; 221 void showLineTreeAndMark(const InlineBox* = nullptr, const char* = nullptr, const InlineBox* = nullptr, const char* = nullptr, const LayoutObject* = nullptr ) const;
218 #endif 222 #endif
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 LayoutObjectChildList m_children; 415 LayoutObjectChildList m_children;
412 LineBoxList m_lineBoxes; // All of the root line boxes created for this bloc k flow. For example, <div>Hello<br>world.</div> will have two total lines for t he <div>. 416 LineBoxList m_lineBoxes; // All of the root line boxes created for this bloc k flow. For example, <div>Hello<br>world.</div> will have two total lines for t he <div>.
413 417
414 unsigned m_hasMarginBeforeQuirk : 1; // Note these quirk values can't be put in LayoutBlockRareData since they are set too frequently. 418 unsigned m_hasMarginBeforeQuirk : 1; // Note these quirk values can't be put in LayoutBlockRareData since they are set too frequently.
415 unsigned m_hasMarginAfterQuirk : 1; 419 unsigned m_hasMarginAfterQuirk : 1;
416 unsigned m_beingDestroyed : 1; 420 unsigned m_beingDestroyed : 1;
417 unsigned m_hasMarkupTruncation : 1; 421 unsigned m_hasMarkupTruncation : 1;
418 unsigned m_widthAvailableToChildrenChanged : 1; 422 unsigned m_widthAvailableToChildrenChanged : 1;
419 mutable unsigned m_hasOnlySelfCollapsingChildren : 1; 423 mutable unsigned m_hasOnlySelfCollapsingChildren : 1;
420 mutable unsigned m_descendantsWithFloatsMarkedForLayout : 1; 424 mutable unsigned m_descendantsWithFloatsMarkedForLayout : 1;
425 mutable unsigned m_needsRecalcLogicalWidthAfterLayoutChildren : 1;
421 426
422 // LayoutRubyBase objects need to be able to split and merge, moving their c hildren around 427 // LayoutRubyBase objects need to be able to split and merge, moving their c hildren around
423 // (calling moveChildTo, moveAllChildrenTo, and makeChildrenNonInline). 428 // (calling moveChildTo, moveAllChildrenTo, and makeChildrenNonInline).
424 friend class LayoutRubyBase; 429 friend class LayoutRubyBase;
425 // FIXME-BLOCKFLOW: Remove this when the line layout stuff has all moved out of LayoutBlock 430 // FIXME-BLOCKFLOW: Remove this when the line layout stuff has all moved out of LayoutBlock
426 friend class LineBreaker; 431 friend class LineBreaker;
427 432
428 // FIXME: This is temporary as we move code that accesses block flow 433 // FIXME: This is temporary as we move code that accesses block flow
429 // member variables out of LayoutBlock and into LayoutBlockFlow. 434 // member variables out of LayoutBlock and into LayoutBlockFlow.
430 friend class LayoutBlockFlow; 435 friend class LayoutBlockFlow;
431 }; 436 };
432 437
433 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBlock, isLayoutBlock()); 438 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBlock, isLayoutBlock());
434 439
435 } // namespace blink 440 } // namespace blink
436 441
437 #endif // LayoutBlock_h 442 #endif // LayoutBlock_h
OLDNEW
« no previous file with comments | « LayoutTests/css3/flexbox/flex-flow-margins-auto-size-expected.txt ('k') | Source/core/layout/LayoutBlock.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698