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

Side by Side Diff: Source/core/layout/LayoutText.cpp

Issue 1328673003: Remove -webkit-line-box-contain implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix up a few more tests. Created 5 years, 3 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
« no previous file with comments | « Source/core/layout/LayoutBlockFlowLine.cpp ('k') | Source/core/layout/line/InlineFlowBox.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 * (C) 1999 Lars Knoll (knoll@kde.org) 2 * (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Dirk Mueller (mueller@kde.org) 3 * (C) 2000 Dirk Mueller (mueller@kde.org)
4 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) 5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net)
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 1093 matching lines...) Expand 10 before | Expand all | Expand 10 after
1104 1104
1105 if (!styleToUse.autoWrap()) 1105 if (!styleToUse.autoWrap())
1106 m_minWidth = m_maxWidth; 1106 m_minWidth = m_maxWidth;
1107 1107
1108 if (styleToUse.whiteSpace() == PRE) { 1108 if (styleToUse.whiteSpace() == PRE) {
1109 if (firstLine) 1109 if (firstLine)
1110 m_firstLineMinWidth = m_maxWidth; 1110 m_firstLineMinWidth = m_maxWidth;
1111 m_lastLineLineMinWidth = currMaxWidth; 1111 m_lastLineLineMinWidth = currMaxWidth;
1112 } 1112 }
1113 1113
1114 if (styleToUse.lineBoxContain() & LineBoxContainGlyphs) { 1114 // TODO(wkorman): Look into potentially removing GlyphOverflow or at least t he
1115 // We shouldn't change our mind once we "know". 1115 // computeBounds field as we no longer use it for line-box-contain implement ation.
1116 ASSERT(!m_knownToHaveNoOverflowAndNoFallbackFonts); 1116 GlyphOverflow glyphOverflow;
1117 } else { 1117 glyphOverflow.setFromBounds(glyphBounds, f.fontMetrics().floatAscent(), f.fo ntMetrics().floatDescent(), m_maxWidth);
1118 GlyphOverflow glyphOverflow; 1118 // We shouldn't change our mind once we "know".
1119 glyphOverflow.setFromBounds(glyphBounds, f.fontMetrics().floatAscent(), f.fontMetrics().floatDescent(), m_maxWidth); 1119 ASSERT(!m_knownToHaveNoOverflowAndNoFallbackFonts || (fallbackFonts.isEmpty( ) && glyphOverflow.isZero()));
1120 // We shouldn't change our mind once we "know". 1120 m_knownToHaveNoOverflowAndNoFallbackFonts = fallbackFonts.isEmpty() && glyph Overflow.isZero();
1121 ASSERT(!m_knownToHaveNoOverflowAndNoFallbackFonts || (fallbackFonts.isEm pty() && glyphOverflow.isZero()));
1122 m_knownToHaveNoOverflowAndNoFallbackFonts = fallbackFonts.isEmpty() && g lyphOverflow.isZero();
1123 }
1124 1121
1125 clearPreferredLogicalWidthsDirty(); 1122 clearPreferredLogicalWidthsDirty();
1126 } 1123 }
1127 1124
1128 bool LayoutText::isAllCollapsibleWhitespace() const 1125 bool LayoutText::isAllCollapsibleWhitespace() const
1129 { 1126 {
1130 unsigned length = textLength(); 1127 unsigned length = textLength();
1131 if (is8Bit()) { 1128 if (is8Bit()) {
1132 for (unsigned i = 0; i < length; ++i) { 1129 for (unsigned i = 0; i < length; ++i) {
1133 if (!style()->isCollapsibleWhiteSpace(characters8()[i])) 1130 if (!style()->isCollapsibleWhiteSpace(characters8()[i]))
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after
1884 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) { 1881 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) {
1885 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*box); 1882 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*box);
1886 if (box->truncation() != cNoTruncation) { 1883 if (box->truncation() != cNoTruncation) {
1887 if (EllipsisBox* ellipsisBox = box->root().ellipsisBox()) 1884 if (EllipsisBox* ellipsisBox = box->root().ellipsisBox())
1888 paintInvalidationContainer.invalidateDisplayItemClientOnBacking( *ellipsisBox); 1885 paintInvalidationContainer.invalidateDisplayItemClientOnBacking( *ellipsisBox);
1889 } 1886 }
1890 } 1887 }
1891 } 1888 }
1892 1889
1893 } // namespace blink 1890 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutBlockFlowLine.cpp ('k') | Source/core/layout/line/InlineFlowBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698