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

Side by Side Diff: Source/core/layout/line/InlineFlowBox.cpp

Issue 940373003: Rename RenderText to LayoutText (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 endPlacingBoxRangesInInlineDirection(startLogicalLeft, logicalLeft, minLogic alLeft, maxLogicalRight); 377 endPlacingBoxRangesInInlineDirection(startLogicalLeft, logicalLeft, minLogic alLeft, maxLogicalRight);
378 return logicalLeft; 378 return logicalLeft;
379 } 379 }
380 380
381 FloatWillBeLayoutUnit InlineFlowBox::placeBoxRangeInInlineDirection(InlineBox* f irstChild, InlineBox* lastChild, 381 FloatWillBeLayoutUnit InlineFlowBox::placeBoxRangeInInlineDirection(InlineBox* f irstChild, InlineBox* lastChild,
382 FloatWillBeLayoutUnit& logicalLeft, FloatWillBeLayoutUnit& minLogicalLeft, F loatWillBeLayoutUnit& maxLogicalRight, bool& needsWordSpacing) 382 FloatWillBeLayoutUnit& logicalLeft, FloatWillBeLayoutUnit& minLogicalLeft, F loatWillBeLayoutUnit& maxLogicalRight, bool& needsWordSpacing)
383 { 383 {
384 for (InlineBox* curr = firstChild; curr && curr != lastChild; curr = curr->n extOnLine()) { 384 for (InlineBox* curr = firstChild; curr && curr != lastChild; curr = curr->n extOnLine()) {
385 if (curr->renderer().isText()) { 385 if (curr->renderer().isText()) {
386 InlineTextBox* text = toInlineTextBox(curr); 386 InlineTextBox* text = toInlineTextBox(curr);
387 RenderText& rt = text->renderer(); 387 LayoutText& rt = text->renderer();
388 FloatWillBeLayoutUnit space; 388 FloatWillBeLayoutUnit space;
389 if (rt.textLength()) { 389 if (rt.textLength()) {
390 if (needsWordSpacing && isSpaceOrNewline(rt.characterAt(text->st art()))) 390 if (needsWordSpacing && isSpaceOrNewline(rt.characterAt(text->st art())))
391 space = rt.style(isFirstLineStyle())->font().fontDescription ().wordSpacing(); 391 space = rt.style(isFirstLineStyle())->font().fontDescription ().wordSpacing();
392 needsWordSpacing = !isSpaceOrNewline(rt.characterAt(text->end()) ); 392 needsWordSpacing = !isSpaceOrNewline(rt.characterAt(text->end()) );
393 } 393 }
394 if (isLeftToRightDirection()) { 394 if (isLeftToRightDirection()) {
395 logicalLeft += space; 395 logicalLeft += space;
396 text->setLogicalLeft(logicalLeft); 396 text->setLogicalLeft(logicalLeft);
397 } else { 397 } else {
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
935 addBoxShadowVisualOverflow(logicalVisualOverflow); 935 addBoxShadowVisualOverflow(logicalVisualOverflow);
936 addBorderOutsetVisualOverflow(logicalVisualOverflow); 936 addBorderOutsetVisualOverflow(logicalVisualOverflow);
937 addOutlineVisualOverflow(logicalVisualOverflow); 937 addOutlineVisualOverflow(logicalVisualOverflow);
938 938
939 for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) { 939 for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) {
940 if (curr->renderer().isOutOfFlowPositioned()) 940 if (curr->renderer().isOutOfFlowPositioned())
941 continue; // Positioned placeholders don't affect calculations. 941 continue; // Positioned placeholders don't affect calculations.
942 942
943 if (curr->renderer().isText()) { 943 if (curr->renderer().isText()) {
944 InlineTextBox* text = toInlineTextBox(curr); 944 InlineTextBox* text = toInlineTextBox(curr);
945 RenderText& rt = text->renderer(); 945 LayoutText& rt = text->renderer();
946 if (rt.isBR()) 946 if (rt.isBR())
947 continue; 947 continue;
948 // FIXME: the call to enclosingLayoutRect() below is temporary and s hould be removed once 948 // FIXME: the call to enclosingLayoutRect() below is temporary and s hould be removed once
949 // the transition to LayoutUnit-based types is complete (crbug.com/3 21237) 949 // the transition to LayoutUnit-based types is complete (crbug.com/3 21237)
950 LayoutRect textBoxOverflow(text->logicalFrameRect().enclosingLayoutR ect()); 950 LayoutRect textBoxOverflow(text->logicalFrameRect().enclosingLayoutR ect());
951 addTextBoxVisualOverflow(text, textBoxDataMap, textBoxOverflow); 951 addTextBoxVisualOverflow(text, textBoxDataMap, textBoxOverflow);
952 logicalVisualOverflow.unite(textBoxOverflow); 952 logicalVisualOverflow.unite(textBoxOverflow);
953 } else if (curr->renderer().isLayoutInline()) { 953 } else if (curr->renderer().isLayoutInline()) {
954 InlineFlowBox* flow = toInlineFlowBox(curr); 954 InlineFlowBox* flow = toInlineFlowBox(curr);
955 flow->computeOverflow(lineTop, lineBottom, textBoxDataMap); 955 flow->computeOverflow(lineTop, lineBottom, textBoxDataMap);
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
1333 ASSERT(child->prevOnLine() == prev); 1333 ASSERT(child->prevOnLine() == prev);
1334 prev = child; 1334 prev = child;
1335 } 1335 }
1336 ASSERT(prev == m_lastChild); 1336 ASSERT(prev == m_lastChild);
1337 #endif 1337 #endif
1338 } 1338 }
1339 1339
1340 #endif 1340 #endif
1341 1341
1342 } // namespace blink 1342 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/line/BreakingContextInlineHeaders.h ('k') | Source/core/layout/line/InlineIterator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698