Changeset 176507 in webkit
- Timestamp:
- Nov 22, 2014, 11:37:08 AM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r176505 r176507 1 2014-11-22 Antti Koivisto <antti@apple.com> 2 3 Make locale part of the SimpleLineLayout::FlowContent::Style 4 https://bugs.webkit.org/show_bug.cgi?id=139004 5 6 Reviewed by Zalan Bujtas. 7 8 That's the only part of style not extracted out of RenderStyle in the constructor. 9 10 * rendering/SimpleLineLayoutFlowContents.cpp: 11 (WebCore::SimpleLineLayout::FlowContents::Style::Style): 12 (WebCore::SimpleLineLayout::FlowContents::FlowContents): 13 (WebCore::SimpleLineLayout::FlowContents::appendNextRendererContentIfNeeded): 14 * rendering/SimpleLineLayoutFlowContents.h: 15 16 Also remove RenderBlockFlow member since it is now unused. 17 18 (WebCore::SimpleLineLayout::FlowContents::Style::Style): Deleted. 19 20 Move to cpp. 21 1 22 2014-11-22 Joanmarie Diggs <jdiggs@igalia.com> 2 23 -
trunk/Source/WebCore/rendering/SimpleLineLayoutFlowContents.cpp
r176473 r176507 34 34 namespace SimpleLineLayout { 35 35 36 FlowContents::Style::Style(const RenderStyle& style) 37 : font(style.font()) 38 , textAlign(style.textAlign()) 39 , collapseWhitespace(style.collapseWhiteSpace()) 40 , preserveNewline(style.preserveNewline()) 41 , wrapLines(style.autoWrap()) 42 , breakWordOnOverflow(style.overflowWrap() == BreakOverflowWrap && (wrapLines || preserveNewline)) 43 , spaceWidth(font.width(TextRun(&space, 1))) 44 , tabWidth(collapseWhitespace ? 0 : style.tabSize()) 45 , locale(style.locale()) 46 { 47 } 48 36 49 FlowContents::FlowContents(const RenderBlockFlow& flow) 37 : m_flow(flow) 38 , m_style(flow.style()) 50 : m_style(flow.style()) 39 51 , m_lineBreakIterator(downcast<RenderText>(*flow.firstChild()).text(), flow.style().locale()) 40 52 , m_lastRendererIndex(0) 41 53 { 42 54 unsigned startPosition = 0; 43 for ( const RenderText* textRenderer = downcast<RenderText>(m_flow.firstChild()); textRenderer; textRenderer = downcast<RenderText>(textRenderer->nextSibling())) {44 unsigned contentLength = text Renderer->text()->length();45 m_textRanges.append(std::make_pair(startPosition, textRenderer));55 for (auto& textChild : childrenOfType<RenderText>(flow)) { 56 unsigned contentLength = textChild.text()->length(); 57 m_textRanges.append(std::make_pair(startPosition, &textChild)); 46 58 startPosition += contentLength; 47 59 } … … 158 170 159 171 ++m_lastRendererIndex; 160 m_lineBreakIterator.resetStringAndReleaseIterator(string + String(nextRenderer->text()), m_ flow.style().locale(), LineBreakIteratorModeUAX14);172 m_lineBreakIterator.resetStringAndReleaseIterator(string + String(nextRenderer->text()), m_style.locale, LineBreakIteratorModeUAX14); 161 173 return true; 162 174 } -
trunk/Source/WebCore/rendering/SimpleLineLayoutFlowContents.h
r176401 r176507 52 52 const RenderText* renderer(unsigned position, unsigned* startPosition = nullptr) const; 53 53 54 class Style { 55 public: 56 Style(const RenderStyle& style) 57 : font(style.font()) 58 , textAlign(style.textAlign()) 59 , collapseWhitespace(style.collapseWhiteSpace()) 60 , preserveNewline(style.preserveNewline()) 61 , wrapLines(style.autoWrap()) 62 , breakWordOnOverflow(style.overflowWrap() == BreakOverflowWrap && (wrapLines || preserveNewline)) 63 , spaceWidth(font.width(TextRun(&space, 1))) 64 , tabWidth(collapseWhitespace ? 0 : style.tabSize()) 65 { 66 } 54 struct Style { 55 explicit Style(const RenderStyle&); 67 56 68 57 const Font& font; … … 74 63 float spaceWidth; 75 64 unsigned tabWidth; 65 AtomicString locale; 76 66 }; 77 67 const Style& style() const { return m_style; } … … 82 72 float runWidth(const RenderText&, unsigned from, unsigned to, float xPosition) const; 83 73 84 const RenderBlockFlow& m_flow;85 74 const Style m_style; 86 75 mutable LazyLineBreakIterator m_lineBreakIterator;
Note:
See TracChangeset
for help on using the changeset viewer.