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

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

Issue 2867293002: [LayoutNG] Compute baseline from fragment tree (Closed)
Patch Set: Cleanup Created 3 years, 5 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_physical_box_fragment.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_physical_box_fragment.cc b/third_party/WebKit/Source/core/layout/ng/ng_physical_box_fragment.cc
index 6146b2fdba5dec1b1b4d057f46950f8ba50448ae..5f5aa39b859e85ac10d4445a6b1a1e80eea0af5c 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_physical_box_fragment.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_physical_box_fragment.cc
@@ -14,6 +14,7 @@ NGPhysicalBoxFragment::NGPhysicalBoxFragment(
NGPhysicalSize overflow,
Vector<RefPtr<NGPhysicalFragment>>& children,
Vector<NGPositionedFloat>& positioned_floats,
+ Vector<NGBaseline>& baselines,
unsigned border_edges, // NGBorderEdges::Physical
RefPtr<NGBreakToken> break_token)
: NGPhysicalFragment(layout_object,
@@ -23,7 +24,18 @@ NGPhysicalBoxFragment::NGPhysicalBoxFragment(
overflow_(overflow),
positioned_floats_(positioned_floats) {
children_.swap(children);
+ baselines_.swap(baselines);
border_edge_ = border_edges;
}
+const NGBaseline* NGPhysicalBoxFragment::Baseline(
+ const NGBaselineRequest& request) const {
+ for (const auto& baseline : baselines_) {
+ if (baseline.algorithm_type == request.algorithm_type &&
+ baseline.baseline_type == request.baseline_type)
+ return &baseline;
+ }
+ return nullptr;
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698