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

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

Issue 2906033002: Fix narrow child cluster inherit multiplier from wide parent cluster (Closed)
Patch Set: format Created 3 years, 6 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 | « no previous file | third_party/WebKit/Source/core/layout/TextAutosizerTest.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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 1137 matching lines...) Expand 10 before | Expand all | Expand 10 after
1148 return true; 1148 return true;
1149 1149
1150 const LayoutBlock* parent_deepest_block_containing_all_text = 1150 const LayoutBlock* parent_deepest_block_containing_all_text =
1151 DeepestBlockContainingAllText(cluster->parent_); 1151 DeepestBlockContainingAllText(cluster->parent_);
1152 #if DCHECK_IS_ON() 1152 #if DCHECK_IS_ON()
1153 DCHECK(blocks_that_have_begun_layout_.Contains(cluster->root_)); 1153 DCHECK(blocks_that_have_begun_layout_.Contains(cluster->root_));
1154 DCHECK(blocks_that_have_begun_layout_.Contains( 1154 DCHECK(blocks_that_have_begun_layout_.Contains(
1155 parent_deepest_block_containing_all_text)); 1155 parent_deepest_block_containing_all_text));
1156 #endif 1156 #endif
1157 1157
1158 float content_width = cluster->root_->ContentLogicalWidth().ToFloat(); 1158 float content_width =
1159 DeepestBlockContainingAllText(cluster)->ContentLogicalWidth().ToFloat();
1159 float cluster_text_width = 1160 float cluster_text_width =
1160 parent_deepest_block_containing_all_text->ContentLogicalWidth().ToFloat(); 1161 parent_deepest_block_containing_all_text->ContentLogicalWidth().ToFloat();
1161 1162
1162 // Clusters with a root that is wider than the deepestBlockContainingAllText 1163 // Clusters with a root that is wider than the deepestBlockContainingAllText
1163 // of their parent autosize independently of their parent. 1164 // of their parent autosize independently of their parent.
1164 if (content_width > cluster_text_width) 1165 if (content_width > cluster_text_width)
1165 return true; 1166 return true;
1166 1167
1167 // Clusters with a root that is significantly narrower than the 1168 // Clusters with a root that is significantly narrower than the
1168 // deepestBlockContainingAllText of their parent autosize independently of 1169 // deepestBlockContainingAllText of their parent autosize independently of
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
1387 } 1388 }
1388 } 1389 }
1389 potentially_inconsistent_superclusters.clear(); 1390 potentially_inconsistent_superclusters.clear();
1390 } 1391 }
1391 1392
1392 DEFINE_TRACE(TextAutosizer) { 1393 DEFINE_TRACE(TextAutosizer) {
1393 visitor->Trace(document_); 1394 visitor->Trace(document_);
1394 } 1395 }
1395 1396
1396 } // namespace blink 1397 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/TextAutosizerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698