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

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: 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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 304
305 void createFloatingObjects(); 305 void createFloatingObjects();
306 306
307 void styleWillChange(StyleDifference, const ComputedStyle& newStyle) overrid e; 307 void styleWillChange(StyleDifference, const ComputedStyle& newStyle) overrid e;
308 void styleDidChange(StyleDifference, const ComputedStyle* oldStyle) override ; 308 void styleDidChange(StyleDifference, const ComputedStyle* oldStyle) override ;
309 309
310 void updateBlockChildDirtyBitsBeforeLayout(bool relayoutChildren, LayoutBox& ); 310 void updateBlockChildDirtyBitsBeforeLayout(bool relayoutChildren, LayoutBox& );
311 311
312 void addOverflowFromFloats(); 312 void addOverflowFromFloats();
313 313
314 LayoutUnit logicalRightOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixed Offset, IndentTextOrNot applyTextIndent, LayoutUnit logicalHeight = 0) const 314 LayoutUnit logicalRightOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixed Offset, IndentTextOrNot applyTextIndent, LayoutUnit logicalHeight = LayoutUnit() ) const
315 { 315 {
316 return adjustLogicalRightOffsetForLine(logicalRightFloatOffsetForLine(lo gicalTop, fixedOffset, logicalHeight), applyTextIndent); 316 return adjustLogicalRightOffsetForLine(logicalRightFloatOffsetForLine(lo gicalTop, fixedOffset, logicalHeight), applyTextIndent);
317 } 317 }
318 LayoutUnit logicalLeftOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixedO ffset, IndentTextOrNot applyTextIndent, LayoutUnit logicalHeight = 0) const 318 LayoutUnit logicalLeftOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixedO ffset, IndentTextOrNot applyTextIndent, LayoutUnit logicalHeight = LayoutUnit()) const
319 { 319 {
320 return adjustLogicalLeftOffsetForLine(logicalLeftFloatOffsetForLine(logi calTop, fixedOffset, logicalHeight), applyTextIndent); 320 return adjustLogicalLeftOffsetForLine(logicalLeftFloatOffsetForLine(logi calTop, fixedOffset, logicalHeight), applyTextIndent);
321 } 321 }
322 322
323 virtual LayoutObject* layoutSpecialExcludedChild(bool /*relayoutChildren*/, SubtreeLayoutScope&); 323 virtual LayoutObject* layoutSpecialExcludedChild(bool /*relayoutChildren*/, SubtreeLayoutScope&);
324 bool updateLogicalWidthAndColumnWidth() override; 324 bool updateLogicalWidthAndColumnWidth() override;
325 325
326 void setLogicalLeftForChild(LayoutBox& child, LayoutUnit logicalLeft); 326 void setLogicalLeftForChild(LayoutBox& child, LayoutUnit logicalLeft);
327 void setLogicalTopForChild(LayoutBox& child, LayoutUnit logicalTop); 327 void setLogicalTopForChild(LayoutBox& child, LayoutUnit logicalTop);
328 void determineLogicalLeftPositionForChild(LayoutBox& child); 328 void determineLogicalLeftPositionForChild(LayoutBox& child);
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 , m_multiColumnFlowThread(nullptr) 460 , m_multiColumnFlowThread(nullptr)
461 , m_lineBreakToAvoidWidow(-1) 461 , m_lineBreakToAvoidWidow(-1)
462 , m_didBreakAtLineToAvoidWidow(false) 462 , m_didBreakAtLineToAvoidWidow(false)
463 , m_discardMarginBefore(false) 463 , m_discardMarginBefore(false)
464 , m_discardMarginAfter(false) 464 , m_discardMarginAfter(false)
465 { 465 {
466 } 466 }
467 467
468 static LayoutUnit positiveMarginBeforeDefault(const LayoutBlockFlow* blo ck) 468 static LayoutUnit positiveMarginBeforeDefault(const LayoutBlockFlow* blo ck)
469 { 469 {
470 return block->marginBefore().clampToZero(); 470 return block->marginBefore().clampNegativeToZero();
471 } 471 }
472 static LayoutUnit negativeMarginBeforeDefault(const LayoutBlockFlow* blo ck) 472 static LayoutUnit negativeMarginBeforeDefault(const LayoutBlockFlow* blo ck)
473 { 473 {
474 return (-block->marginBefore()).clampToZero(); 474 return (-block->marginBefore()).clampNegativeToZero();
475 } 475 }
476 static LayoutUnit positiveMarginAfterDefault(const LayoutBlockFlow* bloc k) 476 static LayoutUnit positiveMarginAfterDefault(const LayoutBlockFlow* bloc k)
477 { 477 {
478 return block->marginAfter().clampToZero(); 478 return block->marginAfter().clampNegativeToZero();
479 } 479 }
480 static LayoutUnit negativeMarginAfterDefault(const LayoutBlockFlow* bloc k) 480 static LayoutUnit negativeMarginAfterDefault(const LayoutBlockFlow* bloc k)
481 { 481 {
482 return (-block->marginAfter()).clampToZero(); 482 return (-block->marginAfter()).clampNegativeToZero();
483 } 483 }
484 484
485 MarginValues m_margins; 485 MarginValues m_margins;
486 LayoutUnit m_paginationStrutPropagatedFromChild; 486 LayoutUnit m_paginationStrutPropagatedFromChild;
487 487
488 LayoutMultiColumnFlowThread* m_multiColumnFlowThread; 488 LayoutMultiColumnFlowThread* m_multiColumnFlowThread;
489 489
490 int m_lineBreakToAvoidWidow; 490 int m_lineBreakToAvoidWidow;
491 bool m_didBreakAtLineToAvoidWidow : 1; 491 bool m_didBreakAtLineToAvoidWidow : 1;
492 bool m_discardMarginBefore : 1; 492 bool m_discardMarginBefore : 1;
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 606
607 // END METHODS DEFINED IN LayoutBlockFlowLine 607 // END METHODS DEFINED IN LayoutBlockFlowLine
608 608
609 }; 609 };
610 610
611 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBlockFlow, isLayoutBlockFlow()); 611 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBlockFlow, isLayoutBlockFlow());
612 612
613 } // namespace blink 613 } // namespace blink
614 614
615 #endif // LayoutBlockFlow_h 615 #endif // LayoutBlockFlow_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698