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

Unified Diff: third_party/WebKit/Source/core/layout/ng/ng_space_utils.cc

Issue 2893493003: Respect the clearance while positioning pending floats. (Closed)
Patch Set: git rebase-update Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/ng/ng_space_utils.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_space_utils.cc b/third_party/WebKit/Source/core/layout/ng/ng_space_utils.cc
index 62271d15cafa1aa10d1a1fecea4088830b363b8a..7d11bc2854f1c25d23c771abd8f8373836e42cf3 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_space_utils.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_space_utils.cc
@@ -66,7 +66,7 @@ bool IsNewFormattingContextForBlockLevelChild(const ComputedStyle& parent_style,
WTF::Optional<LayoutUnit> GetClearanceOffset(
const std::shared_ptr<NGExclusions>& exclusions,
- const ComputedStyle& style) {
+ EClear clear_type) {
const NGExclusion* right_exclusion = exclusions->last_right_float;
const NGExclusion* left_exclusion = exclusions->last_left_float;
@@ -79,7 +79,7 @@ WTF::Optional<LayoutUnit> GetClearanceOffset(
right_offset = right_exclusion->rect.BlockEndOffset();
}
- switch (style.Clear()) {
+ switch (clear_type) {
case EClear::kNone:
return WTF::nullopt; // nothing to do here.
case EClear::kLeft:
@@ -106,4 +106,13 @@ bool ShouldShrinkToFit(const ComputedStyle& parent_style,
!is_in_parallel_flow;
}
+void AdjustToClearance(const WTF::Optional<LayoutUnit>& clearance_offset,
+ NGLogicalOffset* offset) {
+ DCHECK(offset);
+ if (clearance_offset) {
+ offset->block_offset =
+ std::max(clearance_offset.value(), offset->block_offset);
+ }
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698