OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |