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

Unified Diff: third_party/WebKit/Source/core/layout/ng/inline/ng_inline_item_result.h

Issue 2943983002: [LayoutNG] Implement CSS 'text-indent' property (Closed)
Patch Set: Cleanup Created 3 years, 6 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/inline/ng_inline_item_result.h
diff --git a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_item_result.h b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_item_result.h
index 66cbaae61247939b1e11757580df5a3c2b4c5945..a4056f25338fdabf7359fc2ee4ee626af9fab38c 100644
--- a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_item_result.h
+++ b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_item_result.h
@@ -13,6 +13,8 @@
namespace blink {
+class NGConstraintSpace;
+
class NGInlineNode;
// The result of measuring NGInlineItem.
@@ -83,11 +85,17 @@ class CORE_EXPORT NGLineInfo {
DCHECK(line_style_);
return *line_style_;
}
- void SetLineStyle(const NGInlineNode&, bool is_first_line);
+ void SetLineStyle(const NGInlineNode&,
+ const NGConstraintSpace&,
+ bool is_first_line,
+ bool is_after_forced_break);
// Use ::first-line style if true.
// https://drafts.csswg.org/css-pseudo/#selectordef-first-line
- bool IsFirstLine() const { return is_first_line_; }
+ // This is false for the "first formatted line" if '::first-line' rule is not
+ // used in the document.
+ // https://www.w3.org/TR/CSS22/selector.html#first-formatted-line
+ bool UseFirstLineStyle() const { return use_first_line_style_; }
// The last line of a block, or the line ends with a forced line break.
// https://drafts.csswg.org/css-text-3/#propdef-text-align-last
@@ -98,6 +106,8 @@ class CORE_EXPORT NGLineInfo {
NGInlineItemResults& Results() { return results_; }
const NGInlineItemResults& Results() const { return results_; }
+ LayoutUnit TextIndent() const { return text_indent_; }
+
LayoutUnit LineLeft() const { return line_left_; }
LayoutUnit AvailableWidth() const { return available_width_; }
LayoutUnit LineTop() const { return line_top_; }
@@ -108,10 +118,13 @@ class CORE_EXPORT NGLineInfo {
private:
const ComputedStyle* line_style_ = nullptr;
NGInlineItemResults results_;
+
LayoutUnit line_left_;
LayoutUnit available_width_;
LayoutUnit line_top_;
- bool is_first_line_ = false;
+ LayoutUnit text_indent_;
+
+ bool use_first_line_style_ = false;
bool is_last_line_ = false;
};

Powered by Google App Engine
This is Rietveld 408576698