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

Side by Side Diff: Source/core/layout/line/BreakingContextInlineHeaders.h

Issue 1103883002: Convert Block code to layoutObject. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/layout/LayoutBlockFlowLine.cpp ('k') | Source/core/layout/line/LineWidth.cpp » ('j') | 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 * Copyright (C) 2013 Adobe Systems Incorporated. 5 * Copyright (C) 2013 Adobe Systems Incorporated.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 } else { 624 } else {
625 // Just keep ignoring these spaces. 625 // Just keep ignoring these spaces.
626 nextCharacter(c, lastCharacter, secondToLastCharacter); 626 nextCharacter(c, lastCharacter, secondToLastCharacter);
627 continue; 627 continue;
628 } 628 }
629 } 629 }
630 630
631 wordMeasurements.grow(wordMeasurements.size() + 1); 631 wordMeasurements.grow(wordMeasurements.size() + 1);
632 WordMeasurement& wordMeasurement = wordMeasurements.last(); 632 WordMeasurement& wordMeasurement = wordMeasurements.last();
633 633
634 wordMeasurement.renderer = layoutText; 634 wordMeasurement.layoutText = layoutText;
635 wordMeasurement.endOffset = m_current.offset(); 635 wordMeasurement.endOffset = m_current.offset();
636 wordMeasurement.startOffset = lastSpace; 636 wordMeasurement.startOffset = lastSpace;
637 637
638 float additionalTempWidth; 638 float additionalTempWidth;
639 if (wordTrailingSpaceWidth && c == ' ') 639 if (wordTrailingSpaceWidth && c == ' ')
640 additionalTempWidth = textWidth(layoutText, lastSpace, m_current .offset() + 1 - lastSpace, font, m_width.currentWidth(), m_collapseWhiteSpace, & wordMeasurement.fallbackFonts) - wordTrailingSpaceWidth; 640 additionalTempWidth = textWidth(layoutText, lastSpace, m_current .offset() + 1 - lastSpace, font, m_width.currentWidth(), m_collapseWhiteSpace, & wordMeasurement.fallbackFonts) - wordTrailingSpaceWidth;
641 else 641 else
642 additionalTempWidth = textWidth(layoutText, lastSpace, m_current .offset() - lastSpace, font, m_width.currentWidth(), m_collapseWhiteSpace, &word Measurement.fallbackFonts); 642 additionalTempWidth = textWidth(layoutText, lastSpace, m_current .offset() - lastSpace, font, m_width.currentWidth(), m_collapseWhiteSpace, &word Measurement.fallbackFonts);
643 643
644 wordMeasurement.width = additionalTempWidth + wordSpacingForWordMeas urement; 644 wordMeasurement.width = additionalTempWidth + wordSpacingForWordMeas urement;
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
789 m_trailingObjects.clear(); 789 m_trailingObjects.clear();
790 790
791 m_atStart = false; 791 m_atStart = false;
792 nextCharacter(c, lastCharacter, secondToLastCharacter); 792 nextCharacter(c, lastCharacter, secondToLastCharacter);
793 } 793 }
794 794
795 m_renderTextInfo.m_lineBreakIterator.setPriorContext(lastCharacter, secondTo LastCharacter); 795 m_renderTextInfo.m_lineBreakIterator.setPriorContext(lastCharacter, secondTo LastCharacter);
796 796
797 wordMeasurements.grow(wordMeasurements.size() + 1); 797 wordMeasurements.grow(wordMeasurements.size() + 1);
798 WordMeasurement& wordMeasurement = wordMeasurements.last(); 798 WordMeasurement& wordMeasurement = wordMeasurements.last();
799 wordMeasurement.renderer = layoutText; 799 wordMeasurement.layoutText = layoutText;
800 800
801 // IMPORTANT: current.m_pos is > length here! 801 // IMPORTANT: current.m_pos is > length here!
802 float additionalTempWidth = m_ignoringSpaces ? 0 : textWidth(layoutText, las tSpace, m_current.offset() - lastSpace, font, m_width.currentWidth(), m_collapse WhiteSpace, &wordMeasurement.fallbackFonts); 802 float additionalTempWidth = m_ignoringSpaces ? 0 : textWidth(layoutText, las tSpace, m_current.offset() - lastSpace, font, m_width.currentWidth(), m_collapse WhiteSpace, &wordMeasurement.fallbackFonts);
803 wordMeasurement.startOffset = lastSpace; 803 wordMeasurement.startOffset = lastSpace;
804 wordMeasurement.endOffset = m_current.offset(); 804 wordMeasurement.endOffset = m_current.offset();
805 wordMeasurement.width = m_ignoringSpaces ? 0 : additionalTempWidth + wordSpa cingForWordMeasurement; 805 wordMeasurement.width = m_ignoringSpaces ? 0 : additionalTempWidth + wordSpa cingForWordMeasurement;
806 additionalTempWidth += lastSpaceWordSpacing; 806 additionalTempWidth += lastSpaceWordSpacing;
807 807
808 LayoutUnit inlineLogicalTempWidth = inlineLogicalWidth(m_current.object(), ! m_appliedStartWidth, m_includeEndWidth); 808 LayoutUnit inlineLogicalTempWidth = inlineLogicalWidth(m_current.object(), ! m_appliedStartWidth, m_includeEndWidth);
809 m_width.addUncommittedWidth(additionalTempWidth + inlineLogicalTempWidth); 809 m_width.addUncommittedWidth(additionalTempWidth + inlineLogicalTempWidth);
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
896 896
897 if (style.textIndentType() == TextIndentHanging) 897 if (style.textIndentType() == TextIndentHanging)
898 shouldIndentText = shouldIndentText == IndentText ? DoNotIndentText : In dentText; 898 shouldIndentText = shouldIndentText == IndentText ? DoNotIndentText : In dentText;
899 899
900 return shouldIndentText; 900 return shouldIndentText;
901 } 901 }
902 902
903 } 903 }
904 904
905 #endif // BreakingContextInlineHeaders_h 905 #endif // BreakingContextInlineHeaders_h
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutBlockFlowLine.cpp ('k') | Source/core/layout/line/LineWidth.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698