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

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

Issue 2764753007: [LayoutNG] Add NGLineBoxFragment (Closed)
Patch Set: Rebase again as other CLs landed faster Created 3 years, 9 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_fragment.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_physical_fragment.cc b/third_party/WebKit/Source/core/layout/ng/ng_physical_fragment.cc
index 230e04d1794f874e9355ec7aebb006729d3a2a04..5528d7ac0e5aa0f17951e0f8d9a71d9fac9ac3dd 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_physical_fragment.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_physical_fragment.cc
@@ -6,27 +6,36 @@
#include "core/layout/ng/ng_break_token.h"
#include "core/layout/ng/ng_physical_box_fragment.h"
+#include "core/layout/ng/ng_physical_line_box_fragment.h"
#include "core/layout/ng/ng_physical_text_fragment.h"
namespace blink {
NGPhysicalFragment::NGPhysicalFragment(LayoutObject* layout_object,
NGPhysicalSize size,
- NGPhysicalSize overflow,
NGFragmentType type,
RefPtr<NGBreakToken> break_token)
: layout_object_(layout_object),
size_(size),
- overflow_(overflow),
break_token_(std::move(break_token)),
type_(type),
is_placed_(false) {}
void NGPhysicalFragment::destroy() const {
- if (Type() == kFragmentText)
- delete static_cast<const NGPhysicalTextFragment*>(this);
- else
- delete static_cast<const NGPhysicalBoxFragment*>(this);
+ switch (Type()) {
+ case kFragmentBox:
+ delete static_cast<const NGPhysicalBoxFragment*>(this);
+ break;
+ case kFragmentText:
+ delete static_cast<const NGPhysicalTextFragment*>(this);
+ break;
+ case kFragmentLineBox:
+ delete static_cast<const NGPhysicalLineBoxFragment*>(this);
+ break;
+ default:
+ NOTREACHED();
+ break;
+ }
}
const ComputedStyle& NGPhysicalFragment::Style() const {

Powered by Google App Engine
This is Rietveld 408576698