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

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

Issue 13909006: Merge patch for stacked floats with shape-outside from WebKit (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update for review comments. Created 7 years, 6 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 template <class Iterator> struct MidpointState; 59 template <class Iterator> struct MidpointState;
60 typedef BidiResolver<InlineIterator, BidiRun> InlineBidiResolver; 60 typedef BidiResolver<InlineIterator, BidiRun> InlineBidiResolver;
61 typedef MidpointState<InlineIterator> LineMidpointState; 61 typedef MidpointState<InlineIterator> LineMidpointState;
62 typedef WTF::ListHashSet<RenderBox*, 16> TrackedRendererListHashSet; 62 typedef WTF::ListHashSet<RenderBox*, 16> TrackedRendererListHashSet;
63 typedef WTF::HashMap<const RenderBlock*, OwnPtr<TrackedRendererListHashSet> > Tr ackedDescendantsMap; 63 typedef WTF::HashMap<const RenderBlock*, OwnPtr<TrackedRendererListHashSet> > Tr ackedDescendantsMap;
64 typedef WTF::HashMap<const RenderBox*, OwnPtr<HashSet<RenderBlock*> > > TrackedC ontainerMap; 64 typedef WTF::HashMap<const RenderBox*, OwnPtr<HashSet<RenderBlock*> > > TrackedC ontainerMap;
65 typedef Vector<WordMeasurement, 64> WordMeasurements; 65 typedef Vector<WordMeasurement, 64> WordMeasurements;
66 66
67 enum CaretType { CursorCaret, DragCaret }; 67 enum CaretType { CursorCaret, DragCaret };
68 enum ContainingBlockState { NewContainingBlock, SameContainingBlock }; 68 enum ContainingBlockState { NewContainingBlock, SameContainingBlock };
69 enum ShapeOutsideFloatOffsetMode { ShapeOutsideFloatShapeOffset, ShapeOutsideFlo atBoundingBoxOffset };
Julien - ping for review 2013/06/06 20:49:08 We don't need this anymore.
69 70
70 enum TextRunFlag { 71 enum TextRunFlag {
71 DefaultTextRunFlags = 0, 72 DefaultTextRunFlags = 0,
72 RespectDirection = 1 << 0, 73 RespectDirection = 1 << 0,
73 RespectDirectionOverride = 1 << 1 74 RespectDirectionOverride = 1 << 1
74 }; 75 };
75 76
76 typedef unsigned TextRunFlags; 77 typedef unsigned TextRunFlags;
77 78
78 class RenderBlock : public RenderBox { 79 class RenderBlock : public RenderBox {
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 virtual void layout(); 500 virtual void layout();
500 501
501 void layoutPositionedObjects(bool relayoutChildren, bool fixedPositionObject sOnly = false); 502 void layoutPositionedObjects(bool relayoutChildren, bool fixedPositionObject sOnly = false);
502 void markFixedPositionObjectForLayoutIfNeeded(RenderObject* child); 503 void markFixedPositionObjectForLayoutIfNeeded(RenderObject* child);
503 504
504 virtual void paint(PaintInfo&, const LayoutPoint&); 505 virtual void paint(PaintInfo&, const LayoutPoint&);
505 virtual void paintObject(PaintInfo&, const LayoutPoint&); 506 virtual void paintObject(PaintInfo&, const LayoutPoint&);
506 virtual void paintChildren(PaintInfo&, const LayoutPoint&); 507 virtual void paintChildren(PaintInfo&, const LayoutPoint&);
507 void paintChild(RenderBox*, PaintInfo&, const LayoutPoint&); 508 void paintChild(RenderBox*, PaintInfo&, const LayoutPoint&);
508 509
509 LayoutUnit logicalRightOffsetForLine(LayoutUnit position, LayoutUnit fixedOf fset, bool applyTextIndent, LayoutUnit* logicalHeightRemaining = 0, LayoutUnit l ogicalHeight = 0) const; 510 LayoutUnit logicalRightOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixed Offset, bool applyTextIndent, LayoutUnit* heightRemaining = 0, LayoutUnit logica lHeight = 0) const
510 LayoutUnit logicalLeftOffsetForLine(LayoutUnit position, LayoutUnit fixedOff set, bool applyTextIndent, LayoutUnit* logicalHeightRemaining = 0, LayoutUnit lo gicalHeight = 0) const; 511 {
512 return logicalRightOffsetForLineWithoutFloats(logicalRightFloatOffsetFor Line(logicalTop, fixedOffset, heightRemaining, logicalHeight, ShapeOutsideFloatS hapeOffset), applyTextIndent);
513 }
514 LayoutUnit logicalLeftOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixedO ffset, bool applyTextIndent, LayoutUnit* heightRemaining = 0, LayoutUnit logical Height = 0) const
515 {
516 return logicalLeftOffsetForLineWithoutFloats(logicalLeftFloatOffsetForLi ne(logicalTop, fixedOffset, heightRemaining, logicalHeight, ShapeOutsideFloatSha peOffset), applyTextIndent);
517 }
518 LayoutUnit logicalRightOffsetForLineUsingFloatBoundingBox(LayoutUnit logical Top, LayoutUnit fixedOffset, bool applyTextIndent, LayoutUnit* heightRemaining = 0, LayoutUnit logicalHeight = 0) const
519 {
520 return logicalRightOffsetForLineWithoutFloats(logicalRightFloatOffsetFor Line(logicalTop, fixedOffset, heightRemaining, logicalHeight, ShapeOutsideFloatB oundingBoxOffset), applyTextIndent);
521 }
522 LayoutUnit logicalLeftOffsetForLineUsingFloatBoundingBox(LayoutUnit logicalT op, LayoutUnit fixedOffset, bool applyTextIndent, LayoutUnit* heightRemaining = 0, LayoutUnit logicalHeight = 0) const
523 {
524 return logicalLeftOffsetForLineWithoutFloats(logicalLeftFloatOffsetForLi ne(logicalTop, fixedOffset, heightRemaining, logicalHeight, ShapeOutsideFloatBou ndingBoxOffset), applyTextIndent);
525 }
511 526
512 virtual ETextAlign textAlignmentForLine(bool endsWithSoftBreak) const; 527 virtual ETextAlign textAlignmentForLine(bool endsWithSoftBreak) const;
513 virtual void adjustInlineDirectionLineBounds(int /* expansionOpportunityCoun t */, float& /* logicalLeft */, float& /* logicalWidth */) const { } 528 virtual void adjustInlineDirectionLineBounds(int /* expansionOpportunityCoun t */, float& /* logicalLeft */, float& /* logicalWidth */) const { }
514 529
515 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct ion) OVERRIDE; 530 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct ion) OVERRIDE;
516 531
517 virtual void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, Layo utUnit& maxLogicalWidth) const OVERRIDE; 532 virtual void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, Layo utUnit& maxLogicalWidth) const OVERRIDE;
518 virtual void computePreferredLogicalWidths() OVERRIDE; 533 virtual void computePreferredLogicalWidths() OVERRIDE;
519 534
520 virtual int firstLineBoxBaseline() const; 535 virtual int firstLineBoxBaseline() const;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 } 580 }
566 581
567 bool updateRegionsAndExclusionsLogicalSize(RenderFlowThread*); 582 bool updateRegionsAndExclusionsLogicalSize(RenderFlowThread*);
568 void computeRegionRangeForBlock(RenderFlowThread*); 583 void computeRegionRangeForBlock(RenderFlowThread*);
569 584
570 void updateBlockChildDirtyBitsBeforeLayout(bool relayoutChildren, RenderBox* ); 585 void updateBlockChildDirtyBitsBeforeLayout(bool relayoutChildren, RenderBox* );
571 586
572 virtual void checkForPaginationLogicalHeightChange(LayoutUnit& pageLogicalHe ight, bool& pageLogicalHeightChanged, bool& hasSpecifiedPageLogicalHeight); 587 virtual void checkForPaginationLogicalHeightChange(LayoutUnit& pageLogicalHe ight, bool& pageLogicalHeightChanged, bool& hasSpecifiedPageLogicalHeight);
573 588
574 private: 589 private:
590 LayoutUnit logicalRightFloatOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixedOffset, LayoutUnit* heightRemaining, LayoutUnit logicalHeight, ShapeOutside FloatOffsetMode) const;
591 LayoutUnit logicalLeftFloatOffsetForLine(LayoutUnit logicalTop, LayoutUnit f ixedOffset, LayoutUnit* heightRemaining, LayoutUnit logicalHeight, ShapeOutsideF loatOffsetMode) const;
592 LayoutUnit logicalRightOffsetForLineWithoutFloats(LayoutUnit offsetFromFloat s, bool applyTextIndent) const;
593 LayoutUnit logicalLeftOffsetForLineWithoutFloats(LayoutUnit offsetFromFloats , bool applyTextIndent) const;
594
575 void computeExclusionShapeSize(); 595 void computeExclusionShapeSize();
576 void updateExclusionShapeInsideInfoAfterStyleChange(const ExclusionShapeValu e*, const ExclusionShapeValue* oldExclusionShape); 596 void updateExclusionShapeInsideInfoAfterStyleChange(const ExclusionShapeValu e*, const ExclusionShapeValue* oldExclusionShape);
577 597
578 virtual RenderObjectChildList* virtualChildren() OVERRIDE FINAL { return chi ldren(); } 598 virtual RenderObjectChildList* virtualChildren() OVERRIDE FINAL { return chi ldren(); }
579 virtual const RenderObjectChildList* virtualChildren() const OVERRIDE FINAL { return children(); } 599 virtual const RenderObjectChildList* virtualChildren() const OVERRIDE FINAL { return children(); }
580 600
581 virtual const char* renderName() const; 601 virtual const char* renderName() const;
582 602
583 virtual bool isRenderBlock() const OVERRIDE FINAL { return true; } 603 virtual bool isRenderBlock() const OVERRIDE FINAL { return true; }
584 virtual bool isBlockFlow() const OVERRIDE FINAL { return (!isInline() || isR eplaced()) && !isTable(); } 604 virtual bool isBlockFlow() const OVERRIDE FINAL { return (!isInline() || isR eplaced()) && !isTable(); }
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after
1315 static String string(const int value); 1335 static String string(const int value);
1316 }; 1336 };
1317 template<> struct ValueToString<RenderBlock::FloatingObject*> { 1337 template<> struct ValueToString<RenderBlock::FloatingObject*> {
1318 static String string(const RenderBlock::FloatingObject*); 1338 static String string(const RenderBlock::FloatingObject*);
1319 }; 1339 };
1320 #endif 1340 #endif
1321 1341
1322 } // namespace WebCore 1342 } // namespace WebCore
1323 1343
1324 #endif // RenderBlock_h 1344 #endif // RenderBlock_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698