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

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

Issue 2612103004: [ng_layout] Rename NGFragmentBase,NGFragment,NGPhysicalFragment (Closed)
Patch Set: CR: rename ifdef guards Created 3 years, 11 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_fragment.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_fragment.cc b/third_party/WebKit/Source/core/layout/ng/ng_fragment.cc
index 9ccb19c283e5d3dcdca3bf3a0ea477a19439d410..25ff8311a7e1111a200ee2775adda248f01e15bf 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_fragment.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_fragment.cc
@@ -4,17 +4,48 @@
#include "core/layout/ng/ng_fragment.h"
-#include "core/layout/ng/ng_macros.h"
-#include "core/layout/ng/ng_physical_fragment.h"
-
namespace blink {
-NGMarginStrut NGFragment::MarginStrut() const {
- WRITING_MODE_IGNORED(
- "Accessing the margin strut is fine here. Changing the writing mode"
- "establishes a new formatting context, for which a margin strut is never"
- "set for a fragment.");
- return toNGPhysicalFragment(physical_fragment_)->MarginStrut();
+LayoutUnit NGFragment::InlineSize() const {
+ return writing_mode_ == kHorizontalTopBottom ? physical_fragment_->Width()
+ : physical_fragment_->Height();
+}
+
+LayoutUnit NGFragment::BlockSize() const {
+ return writing_mode_ == kHorizontalTopBottom ? physical_fragment_->Height()
+ : physical_fragment_->Width();
+}
+
+LayoutUnit NGFragment::InlineOverflow() const {
+ return writing_mode_ == kHorizontalTopBottom
+ ? physical_fragment_->WidthOverflow()
+ : physical_fragment_->HeightOverflow();
+}
+
+LayoutUnit NGFragment::BlockOverflow() const {
+ return writing_mode_ == kHorizontalTopBottom
+ ? physical_fragment_->HeightOverflow()
+ : physical_fragment_->WidthOverflow();
+}
+
+LayoutUnit NGFragment::InlineOffset() const {
+ return writing_mode_ == kHorizontalTopBottom
+ ? physical_fragment_->LeftOffset()
+ : physical_fragment_->TopOffset();
+}
+
+LayoutUnit NGFragment::BlockOffset() const {
+ return writing_mode_ == kHorizontalTopBottom
+ ? physical_fragment_->TopOffset()
+ : physical_fragment_->LeftOffset();
+}
+
+NGPhysicalFragment::NGFragmentType NGFragment::Type() const {
+ return physical_fragment_->Type();
+}
+
+DEFINE_TRACE(NGFragment) {
+ visitor->trace(physical_fragment_);
}
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/ng_fragment.h ('k') | third_party/WebKit/Source/core/layout/ng/ng_fragment_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698