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

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

Issue 2807113002: [LayoutNG] Use NGLogical[Offset|Size] for NGFragment
Patch Set: Created 3 years, 8 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 8bfc830003c5cb5229140dae0ededa6c67e0dea8..bb8eda766b2e0a8cb71d60c2c5ba5f20e37e6000 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_fragment.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_fragment.cc
@@ -4,28 +4,17 @@
#include "core/layout/ng/ng_fragment.h"
-namespace blink {
-
-LayoutUnit NGFragment::InlineSize() const {
- return writing_mode_ == kHorizontalTopBottom ? physical_fragment_->Width()
- : physical_fragment_->Height();
-}
+#include "core/layout/ng/geometry/ng_physical_offset.h"
+#include "core/layout/ng/geometry/ng_physical_size.h"
-LayoutUnit NGFragment::BlockSize() const {
- return writing_mode_ == kHorizontalTopBottom ? physical_fragment_->Height()
- : physical_fragment_->Width();
-}
+namespace blink {
-LayoutUnit NGFragment::InlineOffset() const {
- return writing_mode_ == kHorizontalTopBottom
- ? physical_fragment_->LeftOffset()
- : physical_fragment_->TopOffset();
+NGLogicalSize NGFragment::Size() const {
+ return physical_fragment_->Size().ConvertToLogical(WritingMode());
}
-LayoutUnit NGFragment::BlockOffset() const {
- return writing_mode_ == kHorizontalTopBottom
- ? physical_fragment_->TopOffset()
- : physical_fragment_->LeftOffset();
+NGLogicalOffset NGFragment::Offset() const {
+ return physical_fragment_->Offset().ConvertToLogical(WritingMode());
}
NGPhysicalFragment::NGFragmentType NGFragment::Type() const {

Powered by Google App Engine
This is Rietveld 408576698