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

Unified Diff: Source/core/rendering/line/BreakingContextInlineHeaders.h

Issue 224723023: Implements hanging property for text-indent from CSS3 (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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: Source/core/rendering/line/BreakingContextInlineHeaders.h
diff --git a/Source/core/rendering/line/BreakingContextInlineHeaders.h b/Source/core/rendering/line/BreakingContextInlineHeaders.h
index c808288202f8c0228704ef875cda4116e7937d4e..9bb119eeaa1ca8c78b8a3728fc8111555ae44621 100644
--- a/Source/core/rendering/line/BreakingContextInlineHeaders.h
+++ b/Source/core/rendering/line/BreakingContextInlineHeaders.h
@@ -898,12 +898,14 @@ inline void BreakingContext::commitAndUpdateLineBreakIfNeeded()
inline IndentTextOrNot requiresIndent(bool isFirstLine, bool isAfterHardLineBreak, RenderStyle* style)
{
- if (isFirstLine)
- return IndentText;
- if (isAfterHardLineBreak && style->textIndentLine() == TextIndentEachLine)
- return IndentText;
+ IndentTextOrNot shouldIndentText = DoNotIndentText;
+ if (isFirstLine || (isAfterHardLineBreak && style->textIndentLine()) == TextIndentEachLine)
+ shouldIndentText = IndentText;
- return DoNotIndentText;
+ if (style->textIndentType() == TextIndentHanging)
+ shouldIndentText = shouldIndentText == IndentText ? DoNotIndentText : IndentText;
+
+ return shouldIndentText;
}
}

Powered by Google App Engine
This is Rietveld 408576698