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

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: Made comments clearer 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() && (isDocumentElement() || isBody()) && !isI nline(); 431 return document().inQuirksMode() && style()->logicalHeight().isAuto() && !isFloatingOrOutOfFlowPositioned() && (isDocumentElement() || isBody()) && !isI nline();
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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
658 virtual void mapLocalToContainer(const RenderLayerModelObject* repaintContai ner, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wasFixed = 0) const OVERRIDE; 659 virtual void mapLocalToContainer(const RenderLayerModelObject* repaintContai ner, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wasFixed = 0) const OVERRIDE;
659 virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) c onst OVERRIDE; 660 virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) c onst OVERRIDE;
660 661
661 void paintRootBoxFillLayers(const PaintInfo&); 662 void paintRootBoxFillLayers(const PaintInfo&);
662 663
663 RenderObject* splitAnonymousBoxesAroundChild(RenderObject* beforeChild); 664 RenderObject* splitAnonymousBoxesAroundChild(RenderObject* beforeChild);
664 665
665 virtual void addLayerHitTestRects(LayerHitTestRects&, const RenderLayer* cur rentCompositedLayer, const LayoutPoint& layerOffset, const LayoutRect& container Rect) const OVERRIDE; 666 virtual void addLayerHitTestRects(LayerHitTestRects&, const RenderLayer* cur rentCompositedLayer, const LayoutPoint& layerOffset, const LayoutRect& container Rect) const OVERRIDE;
666 virtual void computeSelfHitTestRects(Vector<LayoutRect>&, const LayoutPoint& layerOffset) const OVERRIDE; 667 virtual void computeSelfHitTestRects(Vector<LayoutRect>&, const LayoutPoint& layerOffset) const OVERRIDE;
667 668
669 void updateIntrinsicContentLogicalHeight(LayoutUnit intrinsicContentLogicalH eight) const { m_intrinsicContentLogicalHeight = intrinsicContentLogicalHeight; }
670
668 private: 671 private:
669 void updateShapeOutsideInfoAfterStyleChange(const RenderStyle&, const Render Style* oldStyle); 672 void updateShapeOutsideInfoAfterStyleChange(const RenderStyle&, const Render Style* oldStyle);
670 void updateGridPositionAfterStyleChange(const RenderStyle*); 673 void updateGridPositionAfterStyleChange(const RenderStyle*);
671 674
672 bool autoWidthShouldFitContent() const; 675 bool autoWidthShouldFitContent() const;
673 void shrinkToFitWidth(const LayoutUnit availableSpace, const LayoutUnit logi calLeftValue, const LayoutUnit bordersPlusPadding, LogicalExtentComputedValues&) const; 676 void shrinkToFitWidth(const LayoutUnit availableSpace, const LayoutUnit logi calLeftValue, const LayoutUnit bordersPlusPadding, LogicalExtentComputedValues&) const;
674 677
675 // Returns true if we did a full repaint 678 // Returns true if we did a full repaint
676 bool repaintLayerRectsForImage(WrappedImagePtr image, const FillLayer* layer s, bool drawingBackground); 679 bool repaintLayerRectsForImage(WrappedImagePtr image, const FillLayer* layer s, bool drawingBackground);
677 680
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 return *m_rareData.get(); 717 return *m_rareData.get();
715 } 718 }
716 719
717 private: 720 private:
718 // The width/height of the contents + borders + padding. The x/y location i s relative to our container (which is not always our parent). 721 // The width/height of the contents + borders + padding. The x/y location i s relative to our container (which is not always our parent).
719 LayoutRect m_frameRect; 722 LayoutRect m_frameRect;
720 723
721 // Our intrinsic height, used for min-height: min-content etc. Maintained by 724 // Our intrinsic height, used for min-height: min-content etc. Maintained by
722 // updateLogicalHeight. This is logicalHeight() before it is clamped to 725 // updateLogicalHeight. This is logicalHeight() before it is clamped to
723 // min/max. 726 // min/max.
724 LayoutUnit m_intrinsicContentLogicalHeight; 727 mutable LayoutUnit m_intrinsicContentLogicalHeight;
725 728
726 protected: 729 protected:
727 LayoutBoxExtent m_marginBox; 730 LayoutBoxExtent m_marginBox;
728 731
729 // The preferred logical width of the element if it were to break its lines at every possible opportunity. 732 // The preferred logical width of the element if it were to break its lines at every possible opportunity.
730 LayoutUnit m_minPreferredLogicalWidth; 733 LayoutUnit m_minPreferredLogicalWidth;
731 734
732 // The preferred logical width of the element if it never breaks any lines a t all. 735 // The preferred logical width of the element if it never breaks any lines a t all.
733 LayoutUnit m_maxPreferredLogicalWidth; 736 LayoutUnit m_maxPreferredLogicalWidth;
734 737
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
777 if (UNLIKELY(inlineBoxWrapper() != 0)) 780 if (UNLIKELY(inlineBoxWrapper() != 0))
778 deleteLineBoxWrapper(); 781 deleteLineBoxWrapper();
779 } 782 }
780 783
781 ensureRareData().m_inlineBoxWrapper = boxWrapper; 784 ensureRareData().m_inlineBoxWrapper = boxWrapper;
782 } 785 }
783 786
784 } // namespace WebCore 787 } // namespace WebCore
785 788
786 #endif // RenderBox_h 789 #endif // RenderBox_h
OLDNEW
« no previous file with comments | « Source/core/html/shadow/SliderThumbElement.cpp ('k') | Source/core/rendering/RenderFlexibleBox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698