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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutBlockFlow.h

Issue 1647313003: Continue converting to explicit LayoutUnit constructors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@explicitContstructors
Patch Set: Add TODO Created 4 years, 10 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-2013 Apple Inc. All rights reserved. 5 * Copyright (C) 2003-2013 Apple Inc. All rights reserved.
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * Copyright (C) 2013 Google Inc. All rights reserved. 7 * Copyright (C) 2013 Google Inc. All rights reserved.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are 10 * modification, are permitted provided that the following conditions are
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 bool isLayoutBlockFlow() const final { return true; } 94 bool isLayoutBlockFlow() const final { return true; }
95 95
96 void layoutBlock(bool relayoutChildren) override; 96 void layoutBlock(bool relayoutChildren) override;
97 97
98 void computeOverflow(LayoutUnit oldClientAfterEdge, bool recomputeFloats = f alse) override; 98 void computeOverflow(LayoutUnit oldClientAfterEdge, bool recomputeFloats = f alse) override;
99 99
100 void deleteLineBoxTree() final; 100 void deleteLineBoxTree() final;
101 101
102 LayoutUnit availableLogicalWidthForLine(LayoutUnit position, IndentTextOrNot indentText, LayoutUnit logicalHeight = LayoutUnit()) const 102 LayoutUnit availableLogicalWidthForLine(LayoutUnit position, IndentTextOrNot indentText, LayoutUnit logicalHeight = LayoutUnit()) const
103 { 103 {
104 return (logicalRightOffsetForLine(position, indentText, logicalHeight) - logicalLeftOffsetForLine(position, indentText, logicalHeight)).clampToZero(); 104 return (logicalRightOffsetForLine(position, indentText, logicalHeight) - logicalLeftOffsetForLine(position, indentText, logicalHeight)).clampNegativeToZ ero();
105 } 105 }
106 LayoutUnit logicalRightOffsetForLine(LayoutUnit position, IndentTextOrNot in dentText, LayoutUnit logicalHeight = LayoutUnit()) const 106 LayoutUnit logicalRightOffsetForLine(LayoutUnit position, IndentTextOrNot in dentText, LayoutUnit logicalHeight = LayoutUnit()) const
107 { 107 {
108 return logicalRightOffsetForLine(position, logicalRightOffsetForContent( ), indentText, logicalHeight); 108 return logicalRightOffsetForLine(position, logicalRightOffsetForContent( ), indentText, logicalHeight);
109 } 109 }
110 LayoutUnit logicalLeftOffsetForLine(LayoutUnit position, IndentTextOrNot ind entText, LayoutUnit logicalHeight = LayoutUnit()) const 110 LayoutUnit logicalLeftOffsetForLine(LayoutUnit position, IndentTextOrNot ind entText, LayoutUnit logicalHeight = LayoutUnit()) const
111 { 111 {
112 return logicalLeftOffsetForLine(position, logicalLeftOffsetForContent(), indentText, logicalHeight); 112 return logicalLeftOffsetForLine(position, logicalLeftOffsetForContent(), indentText, logicalHeight);
113 } 113 }
114 LayoutUnit startOffsetForLine(LayoutUnit position, IndentTextOrNot indentTex t, LayoutUnit logicalHeight = LayoutUnit()) const 114 LayoutUnit startOffsetForLine(LayoutUnit position, IndentTextOrNot indentTex t, LayoutUnit logicalHeight = LayoutUnit()) const
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 285
286 void createFloatingObjects(); 286 void createFloatingObjects();
287 287
288 void styleWillChange(StyleDifference, const ComputedStyle& newStyle) overrid e; 288 void styleWillChange(StyleDifference, const ComputedStyle& newStyle) overrid e;
289 void styleDidChange(StyleDifference, const ComputedStyle* oldStyle) override ; 289 void styleDidChange(StyleDifference, const ComputedStyle* oldStyle) override ;
290 290
291 void updateBlockChildDirtyBitsBeforeLayout(bool relayoutChildren, LayoutBox& ); 291 void updateBlockChildDirtyBitsBeforeLayout(bool relayoutChildren, LayoutBox& );
292 292
293 void addOverflowFromFloats(); 293 void addOverflowFromFloats();
294 294
295 LayoutUnit logicalRightOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixed Offset, IndentTextOrNot applyTextIndent, LayoutUnit logicalHeight = 0) const 295 LayoutUnit logicalRightOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixed Offset, IndentTextOrNot applyTextIndent, LayoutUnit logicalHeight = LayoutUnit() ) const
296 { 296 {
297 return adjustLogicalRightOffsetForLine(logicalRightFloatOffsetForLine(lo gicalTop, fixedOffset, logicalHeight), applyTextIndent); 297 return adjustLogicalRightOffsetForLine(logicalRightFloatOffsetForLine(lo gicalTop, fixedOffset, logicalHeight), applyTextIndent);
298 } 298 }
299 LayoutUnit logicalLeftOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixedO ffset, IndentTextOrNot applyTextIndent, LayoutUnit logicalHeight = 0) const 299 LayoutUnit logicalLeftOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixedO ffset, IndentTextOrNot applyTextIndent, LayoutUnit logicalHeight = LayoutUnit()) const
300 { 300 {
301 return adjustLogicalLeftOffsetForLine(logicalLeftFloatOffsetForLine(logi calTop, fixedOffset, logicalHeight), applyTextIndent); 301 return adjustLogicalLeftOffsetForLine(logicalLeftFloatOffsetForLine(logi calTop, fixedOffset, logicalHeight), applyTextIndent);
302 } 302 }
303 303
304 virtual LayoutObject* layoutSpecialExcludedChild(bool /*relayoutChildren*/, SubtreeLayoutScope&); 304 virtual LayoutObject* layoutSpecialExcludedChild(bool /*relayoutChildren*/, SubtreeLayoutScope&);
305 bool updateLogicalWidthAndColumnWidth() override; 305 bool updateLogicalWidthAndColumnWidth() override;
306 306
307 void setLogicalLeftForChild(LayoutBox& child, LayoutUnit logicalLeft); 307 void setLogicalLeftForChild(LayoutBox& child, LayoutUnit logicalLeft);
308 void setLogicalTopForChild(LayoutBox& child, LayoutUnit logicalTop); 308 void setLogicalTopForChild(LayoutBox& child, LayoutUnit logicalTop);
309 void determineLogicalLeftPositionForChild(LayoutBox& child); 309 void determineLogicalLeftPositionForChild(LayoutBox& child);
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 , m_multiColumnFlowThread(nullptr) 440 , m_multiColumnFlowThread(nullptr)
441 , m_lineBreakToAvoidWidow(-1) 441 , m_lineBreakToAvoidWidow(-1)
442 , m_didBreakAtLineToAvoidWidow(false) 442 , m_didBreakAtLineToAvoidWidow(false)
443 , m_discardMarginBefore(false) 443 , m_discardMarginBefore(false)
444 , m_discardMarginAfter(false) 444 , m_discardMarginAfter(false)
445 { 445 {
446 } 446 }
447 447
448 static LayoutUnit positiveMarginBeforeDefault(const LayoutBlockFlow* blo ck) 448 static LayoutUnit positiveMarginBeforeDefault(const LayoutBlockFlow* blo ck)
449 { 449 {
450 return block->marginBefore().clampToZero(); 450 return block->marginBefore().clampNegativeToZero();
451 } 451 }
452 static LayoutUnit negativeMarginBeforeDefault(const LayoutBlockFlow* blo ck) 452 static LayoutUnit negativeMarginBeforeDefault(const LayoutBlockFlow* blo ck)
453 { 453 {
454 return (-block->marginBefore()).clampToZero(); 454 return (-block->marginBefore()).clampNegativeToZero();
455 } 455 }
456 static LayoutUnit positiveMarginAfterDefault(const LayoutBlockFlow* bloc k) 456 static LayoutUnit positiveMarginAfterDefault(const LayoutBlockFlow* bloc k)
457 { 457 {
458 return block->marginAfter().clampToZero(); 458 return block->marginAfter().clampNegativeToZero();
459 } 459 }
460 static LayoutUnit negativeMarginAfterDefault(const LayoutBlockFlow* bloc k) 460 static LayoutUnit negativeMarginAfterDefault(const LayoutBlockFlow* bloc k)
461 { 461 {
462 return (-block->marginAfter()).clampToZero(); 462 return (-block->marginAfter()).clampNegativeToZero();
463 } 463 }
464 464
465 MarginValues m_margins; 465 MarginValues m_margins;
466 LayoutUnit m_paginationStrutPropagatedFromChild; 466 LayoutUnit m_paginationStrutPropagatedFromChild;
467 467
468 LayoutMultiColumnFlowThread* m_multiColumnFlowThread; 468 LayoutMultiColumnFlowThread* m_multiColumnFlowThread;
469 469
470 int m_lineBreakToAvoidWidow; 470 int m_lineBreakToAvoidWidow;
471 bool m_didBreakAtLineToAvoidWidow : 1; 471 bool m_didBreakAtLineToAvoidWidow : 1;
472 bool m_discardMarginBefore : 1; 472 bool m_discardMarginBefore : 1;
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 586
587 // END METHODS DEFINED IN LayoutBlockFlowLine 587 // END METHODS DEFINED IN LayoutBlockFlowLine
588 588
589 }; 589 };
590 590
591 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBlockFlow, isLayoutBlockFlow()); 591 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBlockFlow, isLayoutBlockFlow());
592 592
593 } // namespace blink 593 } // namespace blink
594 594
595 #endif // LayoutBlockFlow_h 595 #endif // LayoutBlockFlow_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlock.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698