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

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

Issue 910083002: Constify and use LayoutStyle reference in layout/ (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebaselined again Created 5 years, 10 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 | « Source/core/layout/compositing/CompositingReasonFinder.cpp ('k') | Source/core/layout/line/EllipsisBox.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/line/BreakingContextInlineHeaders.h
diff --git a/Source/core/layout/line/BreakingContextInlineHeaders.h b/Source/core/layout/line/BreakingContextInlineHeaders.h
index 49b6fd6bb152c3ab5dea2c8c8487617b916345b9..aaff6d518ecf6c1838ff5b1acd39732113c8c856 100644
--- a/Source/core/layout/line/BreakingContextInlineHeaders.h
+++ b/Source/core/layout/line/BreakingContextInlineHeaders.h
@@ -153,14 +153,14 @@ private:
TrailingObjects m_trailingObjects;
};
-inline bool shouldCollapseWhiteSpace(const LayoutStyle* style, const LineInfo& lineInfo, WhitespacePosition whitespacePosition)
+inline bool shouldCollapseWhiteSpace(const LayoutStyle& style, const LineInfo& lineInfo, WhitespacePosition whitespacePosition)
{
// CSS2 16.6.1
// If a space (U+0020) at the beginning of a line has 'white-space' set to 'normal', 'nowrap', or 'pre-line', it is removed.
// If a space (U+0020) at the end of a line has 'white-space' set to 'normal', 'nowrap', or 'pre-line', it is also removed.
// If spaces (U+0020) or tabs (U+0009) at the end of a line have 'white-space' set to 'pre-wrap', UAs may visually collapse them.
- return style->collapseWhiteSpace()
- || (whitespacePosition == TrailingWhitespace && style->whiteSpace() == PRE_WRAP && (!lineInfo.isEmpty() || !lineInfo.previousLineBrokeCleanly()));
+ return style.collapseWhiteSpace()
+ || (whitespacePosition == TrailingWhitespace && style.whiteSpace() == PRE_WRAP && (!lineInfo.isEmpty() || !lineInfo.previousLineBrokeCleanly()));
}
inline bool requiresLineBoxForContent(RenderInline* flow, const LineInfo& lineInfo)
@@ -190,7 +190,7 @@ inline bool requiresLineBox(const InlineIterator& it, const LineInfo& lineInfo =
if (it.object()->isRenderInline() && !alwaysRequiresLineBox(it.object()) && !requiresLineBoxForContent(toRenderInline(it.object()), lineInfo))
return false;
- if (!shouldCollapseWhiteSpace(it.object()->style(), lineInfo, whitespacePosition) || it.object()->isBR())
+ if (!shouldCollapseWhiteSpace(it.object()->styleRef(), lineInfo, whitespacePosition) || it.object()->isBR())
return true;
UChar current = it.current();
@@ -883,13 +883,13 @@ inline void BreakingContext::commitAndUpdateLineBreakIfNeeded()
}
}
-inline IndentTextOrNot requiresIndent(bool isFirstLine, bool isAfterHardLineBreak, LayoutStyle* style)
+inline IndentTextOrNot requiresIndent(bool isFirstLine, bool isAfterHardLineBreak, const LayoutStyle& style)
{
IndentTextOrNot shouldIndentText = DoNotIndentText;
- if (isFirstLine || (isAfterHardLineBreak && style->textIndentLine()) == TextIndentEachLine)
+ if (isFirstLine || (isAfterHardLineBreak && style.textIndentLine()) == TextIndentEachLine)
shouldIndentText = IndentText;
- if (style->textIndentType() == TextIndentHanging)
+ if (style.textIndentType() == TextIndentHanging)
shouldIndentText = shouldIndentText == IndentText ? DoNotIndentText : IndentText;
return shouldIndentText;
« no previous file with comments | « Source/core/layout/compositing/CompositingReasonFinder.cpp ('k') | Source/core/layout/line/EllipsisBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698