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

Side by Side Diff: Source/core/rendering/RenderBox.h

Issue 237823002: Properly shrink stretched flexbox children on relayout (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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 | Annotate | Revision Log
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 Apple Inc. All rights reserved. 4 * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 void computeLogicalWidth(LogicalExtentComputedValues&) const; 427 void computeLogicalWidth(LogicalExtentComputedValues&) const;
428 428
429 bool stretchesToViewport() const 429 bool stretchesToViewport() const
430 { 430 {
431 return document().inQuirksMode() && style()->logicalHeight().isAuto() && !isFloatingOrOutOfFlowPositioned() && (isRoot() || isBody()) && !isInline(); 431 return document().inQuirksMode() && style()->logicalHeight().isAuto() && !isFloatingOrOutOfFlowPositioned() && (isRoot() || isBody()) && !isInline();
432 } 432 }
433 433
434 virtual LayoutSize intrinsicSize() const { return LayoutSize(); } 434 virtual LayoutSize intrinsicSize() const { return LayoutSize(); }
435 LayoutUnit intrinsicLogicalWidth() const { return style()->isHorizontalWriti ngMode() ? intrinsicSize().width() : intrinsicSize().height(); } 435 LayoutUnit intrinsicLogicalWidth() const { return style()->isHorizontalWriti ngMode() ? intrinsicSize().width() : intrinsicSize().height(); }
436 LayoutUnit intrinsicLogicalHeight() const { return style()->isHorizontalWrit ingMode() ? intrinsicSize().height() : intrinsicSize().width(); } 436 LayoutUnit intrinsicLogicalHeight() const { return style()->isHorizontalWrit ingMode() ? intrinsicSize().height() : intrinsicSize().width(); }
437 virtual LayoutUnit intrinsicContentLogicalHeight() const { return m_intrinsi cContentLogicalHeight; }
437 438
438 // Whether or not the element shrinks to its intrinsic width (rather than fi lling the width 439 // Whether or not the element shrinks to its intrinsic width (rather than fi lling the width
439 // of a containing block). HTML4 buttons, <select>s, <input>s, legends, and floating/compact elements do this. 440 // of a containing block). HTML4 buttons, <select>s, <input>s, legends, and floating/compact elements do this.
440 bool sizesLogicalWidthToFitContent(const Length& logicalWidth) const; 441 bool sizesLogicalWidthToFitContent(const Length& logicalWidth) const;
441 442
442 LayoutUnit shrinkLogicalWidthToAvoidFloats(LayoutUnit childMarginStart, Layo utUnit childMarginEnd, const RenderBlockFlow* cb) const; 443 LayoutUnit shrinkLogicalWidthToAvoidFloats(LayoutUnit childMarginStart, Layo utUnit childMarginEnd, const RenderBlockFlow* cb) const;
443 444
444 LayoutUnit computeLogicalWidthUsing(SizeType, Length logicalWidth, LayoutUni t availableLogicalWidth, const RenderBlock* containingBlock) const; 445 LayoutUnit computeLogicalWidthUsing(SizeType, Length logicalWidth, LayoutUni t availableLogicalWidth, const RenderBlock* containingBlock) const;
445 LayoutUnit computeLogicalHeightUsing(const Length& height, LayoutUnit intrin sicContentHeight) const; 446 LayoutUnit computeLogicalHeightUsing(const Length& height, LayoutUnit intrin sicContentHeight) const;
446 LayoutUnit computeContentLogicalHeight(const Length& height, LayoutUnit intr insicContentHeight) const; 447 LayoutUnit computeContentLogicalHeight(const Length& height, LayoutUnit intr insicContentHeight) const;
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 virtual void mapLocalToContainer(const RenderLayerModelObject* repaintContai ner, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wasFixed = 0) const OVERRIDE; 660 virtual void mapLocalToContainer(const RenderLayerModelObject* repaintContai ner, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wasFixed = 0) const OVERRIDE;
660 virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) c onst OVERRIDE; 661 virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) c onst OVERRIDE;
661 662
662 void paintRootBoxFillLayers(const PaintInfo&); 663 void paintRootBoxFillLayers(const PaintInfo&);
663 664
664 RenderObject* splitAnonymousBoxesAroundChild(RenderObject* beforeChild); 665 RenderObject* splitAnonymousBoxesAroundChild(RenderObject* beforeChild);
665 666
666 virtual void addLayerHitTestRects(LayerHitTestRects&, const RenderLayer* cur rentCompositedLayer, const LayoutPoint& layerOffset, const LayoutRect& container Rect) const OVERRIDE; 667 virtual void addLayerHitTestRects(LayerHitTestRects&, const RenderLayer* cur rentCompositedLayer, const LayoutPoint& layerOffset, const LayoutRect& container Rect) const OVERRIDE;
667 virtual void computeSelfHitTestRects(Vector<LayoutRect>&, const LayoutPoint& layerOffset) const OVERRIDE; 668 virtual void computeSelfHitTestRects(Vector<LayoutRect>&, const LayoutPoint& layerOffset) const OVERRIDE;
668 669
670 void updateIntrinsicContentLogicalHeight(LayoutUnit intrinsicContentLogicalH eight) const { m_intrinsicContentLogicalHeight = intrinsicContentLogicalHeight; }
671
669 private: 672 private:
670 void updateShapeOutsideInfoAfterStyleChange(const RenderStyle&, const Render Style* oldStyle); 673 void updateShapeOutsideInfoAfterStyleChange(const RenderStyle&, const Render Style* oldStyle);
671 void updateGridPositionAfterStyleChange(const RenderStyle*); 674 void updateGridPositionAfterStyleChange(const RenderStyle*);
672 675
673 bool autoWidthShouldFitContent() const; 676 bool autoWidthShouldFitContent() const;
674 void shrinkToFitWidth(const LayoutUnit availableSpace, const LayoutUnit logi calLeftValue, const LayoutUnit bordersPlusPadding, LogicalExtentComputedValues&) const; 677 void shrinkToFitWidth(const LayoutUnit availableSpace, const LayoutUnit logi calLeftValue, const LayoutUnit bordersPlusPadding, LogicalExtentComputedValues&) const;
675 678
676 // Returns true if we did a full repaint 679 // Returns true if we did a full repaint
677 bool repaintLayerRectsForImage(WrappedImagePtr image, const FillLayer* layer s, bool drawingBackground); 680 bool repaintLayerRectsForImage(WrappedImagePtr image, const FillLayer* layer s, bool drawingBackground);
678 681
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
715 return *m_rareData.get(); 718 return *m_rareData.get();
716 } 719 }
717 720
718 private: 721 private:
719 // The width/height of the contents + borders + padding. The x/y location i s relative to our container (which is not always our parent). 722 // The width/height of the contents + borders + padding. The x/y location i s relative to our container (which is not always our parent).
720 LayoutRect m_frameRect; 723 LayoutRect m_frameRect;
721 724
722 // Our intrinsic height, used for min-height: min-content etc. Maintained by 725 // Our intrinsic height, used for min-height: min-content etc. Maintained by
723 // updateLogicalHeight. This is logicalHeight() before it is clamped to 726 // updateLogicalHeight. This is logicalHeight() before it is clamped to
724 // min/max. 727 // min/max.
725 LayoutUnit m_intrinsicContentLogicalHeight; 728 mutable LayoutUnit m_intrinsicContentLogicalHeight;
726 729
727 protected: 730 protected:
728 LayoutBoxExtent m_marginBox; 731 LayoutBoxExtent m_marginBox;
729 732
730 // The preferred logical width of the element if it were to break its lines at every possible opportunity. 733 // The preferred logical width of the element if it were to break its lines at every possible opportunity.
731 LayoutUnit m_minPreferredLogicalWidth; 734 LayoutUnit m_minPreferredLogicalWidth;
732 735
733 // The preferred logical width of the element if it never breaks any lines a t all. 736 // The preferred logical width of the element if it never breaks any lines a t all.
734 LayoutUnit m_maxPreferredLogicalWidth; 737 LayoutUnit m_maxPreferredLogicalWidth;
735 738
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
778 if (UNLIKELY(inlineBoxWrapper() != 0)) 781 if (UNLIKELY(inlineBoxWrapper() != 0))
779 deleteLineBoxWrapper(); 782 deleteLineBoxWrapper();
780 } 783 }
781 784
782 ensureRareData().m_inlineBoxWrapper = boxWrapper; 785 ensureRareData().m_inlineBoxWrapper = boxWrapper;
783 } 786 }
784 787
785 } // namespace WebCore 788 } // namespace WebCore
786 789
787 #endif // RenderBox_h 790 #endif // RenderBox_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698