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

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

Issue 273613002: [FastTextAutosizer] Check for containingBlock in deepestBlockContainingAllText (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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 | « no previous file | 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) 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 903 matching lines...) Expand 10 before | Expand all | Expand 10 after
914 } 914 }
915 915
916 if (firstNode->isRenderBlock()) 916 if (firstNode->isRenderBlock())
917 return toRenderBlock(firstNode); 917 return toRenderBlock(firstNode);
918 918
919 // containingBlock() should never leave the cluster, since it only skips anc estors when finding 919 // containingBlock() should never leave the cluster, since it only skips anc estors when finding
920 // the container of position:absolute/fixed blocks, and those cannot exist b etween a cluster and 920 // the container of position:absolute/fixed blocks, and those cannot exist b etween a cluster and
921 // its text node's lowest common ancestor as isAutosizingCluster would have made them into their 921 // its text node's lowest common ancestor as isAutosizingCluster would have made them into their
922 // own independent cluster. 922 // own independent cluster.
923 const RenderBlock* containingBlock = firstNode->containingBlock(); 923 const RenderBlock* containingBlock = firstNode->containingBlock();
924 if (!containingBlock)
925 return root;
926
924 ASSERT(containingBlock->isDescendantOf(root)); 927 ASSERT(containingBlock->isDescendantOf(root));
925
926 return containingBlock; 928 return containingBlock;
927 } 929 }
928 930
929 const RenderObject* FastTextAutosizer::findTextLeaf(const RenderObject* parent, size_t& depth, TextLeafSearch firstOrLast) 931 const RenderObject* FastTextAutosizer::findTextLeaf(const RenderObject* parent, size_t& depth, TextLeafSearch firstOrLast)
930 { 932 {
931 // List items are treated as text due to the marker. 933 // List items are treated as text due to the marker.
932 // The actual renderer for the marker (RenderListMarker) may not be in the t ree yet since it is added during layout. 934 // The actual renderer for the marker (RenderListMarker) may not be in the t ree yet since it is added during layout.
933 if (parent->isListItem()) 935 if (parent->isListItem())
934 return parent; 936 return parent;
935 937
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
1118 FastTextAutosizer::DeferUpdatePageInfo::~DeferUpdatePageInfo() 1120 FastTextAutosizer::DeferUpdatePageInfo::~DeferUpdatePageInfo()
1119 { 1121 {
1120 if (FastTextAutosizer* textAutosizer = m_mainFrame->document()->fastTextAuto sizer()) { 1122 if (FastTextAutosizer* textAutosizer = m_mainFrame->document()->fastTextAuto sizer()) {
1121 ASSERT(textAutosizer->m_updatePageInfoDeferred); 1123 ASSERT(textAutosizer->m_updatePageInfoDeferred);
1122 textAutosizer->m_updatePageInfoDeferred = false; 1124 textAutosizer->m_updatePageInfoDeferred = false;
1123 textAutosizer->updatePageInfoInAllFrames(); 1125 textAutosizer->updatePageInfoInAllFrames();
1124 } 1126 }
1125 } 1127 }
1126 1128
1127 } // namespace WebCore 1129 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698