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

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

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.h
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_space_utils.h b/third_party/WebKit/Source/core/layout/ng/ng_space_utils.h
index 71ec335b28e899b9aa0ad165ab03bbb5075d8dd4..ee5cf74bf50d49b0bd6f593d0b97fbf5a8dee861 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_space_utils.h
+++ b/third_party/WebKit/Source/core/layout/ng/ng_space_utils.h
@@ -6,6 +6,7 @@
#define NGSpaceUtils_h
#include "core/CoreExport.h"
+#include "core/style/ComputedStyleConstants.h"
#include "platform/LayoutUnit.h"
#include "platform/wtf/Optional.h"
@@ -14,6 +15,7 @@ namespace blink {
class ComputedStyle;
struct NGExclusions;
class NGLayoutInputNode;
+struct NGLogicalOffset;
// Whether an in-flow child creates a new formatting context.
//
@@ -25,11 +27,11 @@ CORE_EXPORT bool IsNewFormattingContextForBlockLevelChild(
const ComputedStyle& parent_style,
const NGLayoutInputNode& node);
-// Gets the clearance offset based on the provided {@code style} and list of
-// exclusions that represent left/right float.
+// Gets the clearance offset based on the provided {@code clear_type} and list
+// of exclusions that represent left/right float.
CORE_EXPORT WTF::Optional<LayoutUnit> GetClearanceOffset(
const std::shared_ptr<NGExclusions>& exclusions,
- const ComputedStyle& style);
+ EClear clear_type);
// Whether child's constraint space should shrink to its intrinsic width.
// This is needed for buttons, select, input, floats and orthogonal children.
@@ -37,6 +39,11 @@ CORE_EXPORT WTF::Optional<LayoutUnit> GetClearanceOffset(
bool ShouldShrinkToFit(const ComputedStyle& parent_style,
const ComputedStyle& style);
+// Adjusts {@code offset} to the clearance line.
+CORE_EXPORT void AdjustToClearance(
+ const WTF::Optional<LayoutUnit>& clearance_offset,
+ NGLogicalOffset* offset);
+
} // namespace blink
#endif // NGSpaceUtils_h

Powered by Google App Engine
This is Rietveld 408576698