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

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

Issue 2892293002: Add a basic support of text-align:right property to NGInlineLayoutAlgorithm. (Closed)
Patch Set: fix comments Created 3 years, 7 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
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/inline/ng_line_box_fragment_builder.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/ng/inline/ng_line_box_fragment_builder.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/inline/ng_line_box_fragment_builder.cc b/third_party/WebKit/Source/core/layout/ng/inline/ng_line_box_fragment_builder.cc
index e972c2c052494d9204933f81ce05ad7b9c17798f..8c1b2b5bef7ca0769620323302390e4ca239acf6 100644
--- a/third_party/WebKit/Source/core/layout/ng/inline/ng_line_box_fragment_builder.cc
+++ b/third_party/WebKit/Source/core/layout/ng/inline/ng_line_box_fragment_builder.cc
@@ -42,6 +42,18 @@ void NGLineBoxFragmentBuilder::MoveChildrenInBlockDirection(LayoutUnit delta) {
offset.block_offset += delta;
}
+void NGLineBoxFragmentBuilder::MoveChildrenInInlineDirection(LayoutUnit delta) {
+ NGWritingMode writing_mode(
+ FromPlatformWritingMode(node_->Style().GetWritingMode()));
+ LayoutUnit child_inline_size;
+ for (size_t i = 0; i < children_.size(); ++i) {
+ offsets_[i].inline_offset = delta + child_inline_size;
+ NGPhysicalFragment* child = children_[i].Get();
+ child_inline_size +=
+ child->Size().ConvertToLogical(writing_mode).inline_size;
+ }
+}
+
void NGLineBoxFragmentBuilder::MoveChildrenInBlockDirection(LayoutUnit delta,
unsigned start,
unsigned end) {
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/inline/ng_line_box_fragment_builder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698