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

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

Issue 101543009: Make cluster creation independent of fingerprinting. Keep track of current (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@pdr-multiplier
Patch Set: Created 6 years, 11 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/rendering/RenderBlockFlow.cpp ('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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2012 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 // 518 //
519 // Clusters are chosen using very similar criteria to CSS flow roots, aka 519 // Clusters are chosen using very similar criteria to CSS flow roots, aka
520 // block formatting contexts (http://w3.org/TR/css3-box/#flow-root), since 520 // block formatting contexts (http://w3.org/TR/css3-box/#flow-root), since
521 // flow roots correspond to box containers that behave somewhat 521 // flow roots correspond to box containers that behave somewhat
522 // independently from their parent (for example they don't overlap floats). 522 // independently from their parent (for example they don't overlap floats).
523 // The definition of a flow root also conveniently includes most of the 523 // The definition of a flow root also conveniently includes most of the
524 // ways that a box and its children can have significantly different width 524 // ways that a box and its children can have significantly different width
525 // from the box's parent (we want to avoid having significantly different 525 // from the box's parent (we want to avoid having significantly different
526 // width blocks within a cluster, since the narrower blocks would end up 526 // width blocks within a cluster, since the narrower blocks would end up
527 // larger than would otherwise be necessary). 527 // larger than would otherwise be necessary).
528 RenderBlock* containingBlock = renderer->containingBlock();
528 return renderer->isRenderView() 529 return renderer->isRenderView()
529 || renderer->isFloating() 530 || renderer->isFloating()
530 || renderer->isOutOfFlowPositioned() 531 || renderer->isOutOfFlowPositioned()
531 || renderer->isTableCell() 532 || renderer->isTableCell()
532 || renderer->isTableCaption() 533 || renderer->isTableCaption()
533 || renderer->isFlexibleBoxIncludingDeprecated() 534 || renderer->isFlexibleBoxIncludingDeprecated()
534 || renderer->hasColumns() 535 || renderer->hasColumns()
535 || renderer->containingBlock()->isHorizontalWritingMode() != renderer->i sHorizontalWritingMode() 536 || (containingBlock && containingBlock->isHorizontalWritingMode() != ren derer->isHorizontalWritingMode())
536 || renderer->style()->isDisplayReplacedType() 537 || renderer->style()->isDisplayReplacedType()
537 || renderer->isTextArea() 538 || renderer->isTextArea()
538 || renderer->style()->userModify() != READ_ONLY; 539 || renderer->style()->userModify() != READ_ONLY;
539 // FIXME: Tables need special handling to multiply all their columns by 540 // FIXME: Tables need special handling to multiply all their columns by
540 // the same amount even if they're different widths; so do hasColumns() 541 // the same amount even if they're different widths; so do hasColumns()
541 // containers, and probably flexboxes... 542 // containers, and probably flexboxes...
542 } 543 }
543 544
544 bool TextAutosizer::isAutosizingCluster(const RenderBlock* renderer, TextAutosiz ingClusterInfo& parentClusterInfo) 545 bool TextAutosizer::isAutosizingCluster(const RenderBlock* renderer, TextAutosiz ingClusterInfo& parentClusterInfo)
545 { 546 {
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
796 if (i + 1 < clusterInfos.size()) { 797 if (i + 1 < clusterInfos.size()) {
797 float currentWidth = clusterInfos[i].root->contentLogicalWidth(); 798 float currentWidth = clusterInfos[i].root->contentLogicalWidth();
798 float nextWidth = clusterInfos[i + 1].root->contentLogicalWidth(); 799 float nextWidth = clusterInfos[i + 1].root->contentLogicalWidth();
799 if (currentWidth - nextWidth > maxWidthDifferenceWithinGroup) 800 if (currentWidth - nextWidth > maxWidthDifferenceWithinGroup)
800 groups.grow(groups.size() + 1); 801 groups.grow(groups.size() + 1);
801 } 802 }
802 } 803 }
803 } 804 }
804 805
805 } // namespace WebCore 806 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderBlockFlow.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698