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

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

Issue 2910133002: [LayoutNG] Handle empty inlines and border edges (Closed)
Patch Set: Rebase Created 3 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/ng/inline/ng_inline_box_state.h
diff --git a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_box_state.h b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_box_state.h
index 5fcc3965dfa99454c662e3729255ee234a1d4b2f..4e24390b7ceb91c28f41b94596297edde6e95931 100644
--- a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_box_state.h
+++ b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_box_state.h
@@ -16,6 +16,7 @@
namespace blink {
class NGInlineItem;
+struct NGInlineItemResult;
class NGLineBoxFragmentBuilder;
// Fragments that require the layout position/size of ancestor are packed in
@@ -30,6 +31,7 @@ struct NGPendingPositions {
// Represents the current box while NGInlineLayoutAlgorithm performs layout.
// Used 1) to cache common values for a box, and 2) to layout children that
// require ancestor position or size.
+// This is a transient object only while building line boxes in a block.
struct NGInlineBoxState {
unsigned fragment_start;
const NGInlineItem* item;
@@ -41,8 +43,10 @@ struct NGInlineBoxState {
// These values are to create a box fragment. Set only when needs_box_fragment
// is set.
LayoutUnit line_left_position;
+ LayoutUnit line_right_position;
LayoutUnit borders_paddings_block_start;
- LayoutUnit borders_paddings_block_height;
+ LayoutUnit borders_paddings_block_end;
+ NGBorderEdges border_edges;
Vector<NGPendingPositions> pending_descendants;
bool include_used_fonts = false;
@@ -56,9 +60,12 @@ struct NGInlineBoxState {
FontBaseline);
// Create a box fragment for this box.
- void SetNeedsBoxFragment(LayoutUnit line_left_position,
- LayoutUnit borders_paddings_block_start,
- LayoutUnit borders_paddings_block_height);
+ void SetNeedsBoxFragment(const NGInlineItem&,
+ const NGInlineItemResult&,
+ LayoutUnit position);
+ void SetLineRightForBoxFragment(const NGInlineItem&,
+ const NGInlineItemResult&,
+ LayoutUnit position);
};
// Represents the inline tree structure. This class provides:
@@ -81,8 +88,7 @@ class NGInlineLayoutStateStack {
NGInlineBoxState* OnCloseTag(const NGInlineItem&,
NGLineBoxFragmentBuilder*,
NGInlineBoxState*,
- FontBaseline,
- LayoutUnit position);
+ FontBaseline);
// Compute all the pending positioning at the end of a line.
void OnEndPlaceItems(NGLineBoxFragmentBuilder*,
@@ -92,15 +98,11 @@ class NGInlineLayoutStateStack {
private:
// End of a box state, either explicitly by close tag, or implicitly at the
// end of a line.
- void EndBoxState(NGInlineBoxState*,
- NGLineBoxFragmentBuilder*,
- FontBaseline,
- LayoutUnit position);
+ void EndBoxState(NGInlineBoxState*, NGLineBoxFragmentBuilder*, FontBaseline);
void AddBoxFragmentPlaceholder(NGInlineBoxState*,
NGLineBoxFragmentBuilder*,
- FontBaseline,
- LayoutUnit position);
+ FontBaseline);
void CreateBoxFragments(NGLineBoxFragmentBuilder*);
enum PositionPending { kPositionNotPending, kPositionPending };
@@ -116,11 +118,13 @@ class NGInlineLayoutStateStack {
FontBaseline);
// Data for a box fragment placeholder. See AddBoxFragmentPlaceholder().
+ // This is a transient object only while building a line box.
struct BoxFragmentPlaceholder {
unsigned fragment_start;
unsigned fragment_end;
const NGInlineItem* item;
NGLogicalSize size;
+ NGBorderEdges border_edges;
};
Vector<NGInlineBoxState, 4> stack_;

Powered by Google App Engine
This is Rietveld 408576698