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

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

Issue 2683553002: Fix not autosizing ruby elements issue. (Closed)
Patch Set: Use MarkContainerChain for setPreferredLogicalWidthsDirty, when we skipped inline-block before Created 3 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 * (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 1370 matching lines...) Expand 10 before | Expand all | Expand 10 after
1381 const SimpleFontData* fontData = f.primaryFont(); 1381 const SimpleFontData* fontData = f.primaryFont();
1382 DCHECK(fontData); 1382 DCHECK(fontData);
1383 1383
1384 GlyphOverflow glyphOverflow; 1384 GlyphOverflow glyphOverflow;
1385 if (fontData) { 1385 if (fontData) {
1386 glyphOverflow.setFromBounds( 1386 glyphOverflow.setFromBounds(
1387 glyphBounds, fontData->getFontMetrics().floatAscent(), 1387 glyphBounds, fontData->getFontMetrics().floatAscent(),
1388 fontData->getFontMetrics().floatDescent(), m_maxWidth); 1388 fontData->getFontMetrics().floatDescent(), m_maxWidth);
1389 } 1389 }
1390 // We shouldn't change our mind once we "know". 1390 // We shouldn't change our mind once we "know".
1391 ASSERT(!m_knownToHaveNoOverflowAndNoFallbackFonts || 1391 if (!preferredLogicalWidthsDirty()) {
pdr. 2017/02/10 04:10:46 I think this dcheck should still work. Do you know
cathiechentx 2017/02/10 05:17:47 Hesitated to make this change too. The reason to f
pdr. 2017/02/10 19:27:09 Can you add a test for this? Just naively removing
cathiechentx 2017/02/13 14:53:56 fallbackFonts is not empty...
cathiechentx 2017/02/15 14:19:20 Update:) Actuall fallbackFonts is empty. "If thi
1392 (fallbackFonts.isEmpty() && glyphOverflow.isApproximatelyZero())); 1392 DCHECK(!m_knownToHaveNoOverflowAndNoFallbackFonts ||
1393 (fallbackFonts.isEmpty() && glyphOverflow.isApproximatelyZero()));
1394 }
1393 m_knownToHaveNoOverflowAndNoFallbackFonts = 1395 m_knownToHaveNoOverflowAndNoFallbackFonts =
1394 fallbackFonts.isEmpty() && glyphOverflow.isApproximatelyZero(); 1396 fallbackFonts.isEmpty() && glyphOverflow.isApproximatelyZero();
1395 1397
1396 clearPreferredLogicalWidthsDirty(); 1398 clearPreferredLogicalWidthsDirty();
1397 } 1399 }
1398 1400
1399 bool LayoutText::isAllCollapsibleWhitespace() const { 1401 bool LayoutText::isAllCollapsibleWhitespace() const {
1400 unsigned length = textLength(); 1402 unsigned length = textLength();
1401 if (is8Bit()) { 1403 if (is8Bit()) {
1402 for (unsigned i = 0; i < length; ++i) { 1404 for (unsigned i = 0; i < length; ++i) {
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after
2009 LayoutRect rect = LayoutRect( 2011 LayoutRect rect = LayoutRect(
2010 IntRect(firstRunX(), firstRunY(), linesBox.width(), linesBox.height())); 2012 IntRect(firstRunX(), firstRunY(), linesBox.width(), linesBox.height()));
2011 LayoutBlock* block = containingBlock(); 2013 LayoutBlock* block = containingBlock();
2012 if (block && hasTextBoxes()) 2014 if (block && hasTextBoxes())
2013 block->adjustChildDebugRect(rect); 2015 block->adjustChildDebugRect(rect);
2014 2016
2015 return rect; 2017 return rect;
2016 } 2018 }
2017 2019
2018 } // namespace blink 2020 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698