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

Side by Side Diff: Source/core/rendering/RenderBlockLineLayout.cpp

Issue 704693003: Correct line width calculation with inline-block induced word spacing (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « LayoutTests/fast/css/word-spacing-inline-box-line-width-expected.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ight reserved. 3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ight reserved.
4 * Copyright (C) 2010 Google Inc. All rights reserved. 4 * Copyright (C) 2010 Google Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 617
618 setLogicalWidthForTextRun(lineBox, r, rt, totalLogicalWidth, lineInf o, textBoxDataMap, verticalPositionCache, wordMeasurements); 618 setLogicalWidthForTextRun(lineBox, r, rt, totalLogicalWidth, lineInf o, textBoxDataMap, verticalPositionCache, wordMeasurements);
619 } else { 619 } else {
620 isAfterExpansion = false; 620 isAfterExpansion = false;
621 if (!r->m_object->isRenderInline()) { 621 if (!r->m_object->isRenderInline()) {
622 RenderBox* renderBox = toRenderBox(r->m_object); 622 RenderBox* renderBox = toRenderBox(r->m_object);
623 if (renderBox->isRubyRun()) 623 if (renderBox->isRubyRun())
624 setMarginsForRubyRun(r, toRenderRubyRun(renderBox), previous Object, lineInfo); 624 setMarginsForRubyRun(r, toRenderRubyRun(renderBox), previous Object, lineInfo);
625 r->m_box->setLogicalWidth(logicalWidthForChild(renderBox).toFloa t()); 625 r->m_box->setLogicalWidth(logicalWidthForChild(renderBox).toFloa t());
626 totalLogicalWidth += marginStartForChild(renderBox) + marginEndF orChild(renderBox); 626 totalLogicalWidth += marginStartForChild(renderBox) + marginEndF orChild(renderBox);
627 needsWordSpacing = true;
627 } 628 }
628 } 629 }
629 630
630 totalLogicalWidth += r->m_box->logicalWidth(); 631 totalLogicalWidth += r->m_box->logicalWidth();
631 previousObject = r->m_object; 632 previousObject = r->m_object;
632 } 633 }
633 634
634 if (isAfterExpansion && !expansionOpportunities.isEmpty()) { 635 if (isAfterExpansion && !expansionOpportunities.isEmpty()) {
635 expansionOpportunities.last()--; 636 expansionOpportunities.last()--;
636 expansionOpportunityCount--; 637 expansionOpportunityCount--;
(...skipping 1408 matching lines...) Expand 10 before | Expand all | Expand 10 after
2045 float logicalLeft = logicalLeftOffsetForLine(logicalHeight(), false).toFloat (); 2046 float logicalLeft = logicalLeftOffsetForLine(logicalHeight(), false).toFloat ();
2046 float availableLogicalWidth = logicalRightOffsetForLine(logicalHeight(), fal se) - logicalLeft; 2047 float availableLogicalWidth = logicalRightOffsetForLine(logicalHeight(), fal se) - logicalLeft;
2047 updateLogicalWidthForAlignment(textAlign, 0, 0, logicalLeft, totalLogicalWid th, availableLogicalWidth, 0); 2048 updateLogicalWidthForAlignment(textAlign, 0, 0, logicalLeft, totalLogicalWid th, availableLogicalWidth, 0);
2048 2049
2049 if (!style()->isLeftToRightDirection()) 2050 if (!style()->isLeftToRightDirection())
2050 return logicalWidth() - logicalLeft; 2051 return logicalWidth() - logicalLeft;
2051 return logicalLeft; 2052 return logicalLeft;
2052 } 2053 }
2053 2054
2054 } 2055 }
OLDNEW
« no previous file with comments | « LayoutTests/fast/css/word-spacing-inline-box-line-width-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698