| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. | 2 * Copyright (C) 2012 Adobe Systems Incorporated. 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above | 8 * 1. Redistributions of source code must retain the above |
| 9 * copyright notice, this list of conditions and the following | 9 * copyright notice, this list of conditions and the following |
| 10 * disclaimer. | 10 * disclaimer. |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 ASSERT(namedFlow); | 109 ASSERT(namedFlow); |
| 110 ASSERT(!m_mapNamedFlowContentNodes.contains(contentNode)); | 110 ASSERT(!m_mapNamedFlowContentNodes.contains(contentNode)); |
| 111 ASSERT(!namedFlow->hasContentNode(contentNode)); | 111 ASSERT(!namedFlow->hasContentNode(contentNode)); |
| 112 m_mapNamedFlowContentNodes.add(contentNode, namedFlow); | 112 m_mapNamedFlowContentNodes.add(contentNode, namedFlow); |
| 113 namedFlow->registerNamedFlowContentNode(contentNode); | 113 namedFlow->registerNamedFlowContentNode(contentNode); |
| 114 } | 114 } |
| 115 | 115 |
| 116 void FlowThreadController::unregisterNamedFlowContentNode(Node* contentNode) | 116 void FlowThreadController::unregisterNamedFlowContentNode(Node* contentNode) |
| 117 { | 117 { |
| 118 ASSERT(contentNode && contentNode->isElementNode()); | 118 ASSERT(contentNode && contentNode->isElementNode()); |
| 119 HashMap<Node*, RenderNamedFlowThread*>::iterator it = m_mapNamedFlowContentN
odes.find(contentNode); | 119 HashMap<const Node*, RenderNamedFlowThread*>::iterator it = m_mapNamedFlowCo
ntentNodes.find(contentNode); |
| 120 ASSERT(it != m_mapNamedFlowContentNodes.end()); | 120 ASSERT(it != m_mapNamedFlowContentNodes.end()); |
| 121 ASSERT(it->value); | 121 ASSERT(it->value); |
| 122 ASSERT(it->value->hasContentNode(contentNode)); | 122 ASSERT(it->value->hasContentNode(contentNode)); |
| 123 it->value->unregisterNamedFlowContentNode(contentNode); | 123 it->value->unregisterNamedFlowContentNode(contentNode); |
| 124 m_mapNamedFlowContentNodes.remove(contentNode); | 124 m_mapNamedFlowContentNodes.remove(contentNode); |
| 125 } | 125 } |
| 126 | 126 |
| 127 void FlowThreadController::updateFlowThreadsChainIfNecessary() | 127 void FlowThreadController::updateFlowThreadsChainIfNecessary() |
| 128 { | 128 { |
| 129 ASSERT(m_renderNamedFlowThreadList); | 129 ASSERT(m_renderNamedFlowThreadList); |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 flowRenderer->layoutIfNeeded(); | 218 flowRenderer->layoutIfNeeded(); |
| 219 if (flowRenderer->hasAutoLogicalHeightRegions()) { | 219 if (flowRenderer->hasAutoLogicalHeightRegions()) { |
| 220 ASSERT(flowRenderer->needsTwoPhasesLayout()); | 220 ASSERT(flowRenderer->needsTwoPhasesLayout()); |
| 221 flowRenderer->markAutoLogicalHeightRegionsForLayout(); | 221 flowRenderer->markAutoLogicalHeightRegionsForLayout(); |
| 222 } | 222 } |
| 223 flowRenderer->setInConstrainedLayoutPhase(true); | 223 flowRenderer->setInConstrainedLayoutPhase(true); |
| 224 flowRenderer->clearNeedsTwoPhasesLayout(); | 224 flowRenderer->clearNeedsTwoPhasesLayout(); |
| 225 } | 225 } |
| 226 } | 226 } |
| 227 | 227 |
| 228 bool FlowThreadController::isContentNodeRegisteredWithAnyNamedFlow(const Node* c
ontentNode) const |
| 229 { |
| 230 return m_mapNamedFlowContentNodes.contains(contentNode); |
| 231 } |
| 232 |
| 228 #ifndef NDEBUG | 233 #ifndef NDEBUG |
| 229 bool FlowThreadController::isAutoLogicalHeightRegionsCountConsistent() const | 234 bool FlowThreadController::isAutoLogicalHeightRegionsCountConsistent() const |
| 230 { | 235 { |
| 231 if (!hasRenderNamedFlowThreads()) | 236 if (!hasRenderNamedFlowThreads()) |
| 232 return !hasFlowThreadsWithAutoLogicalHeightRegions(); | 237 return !hasFlowThreadsWithAutoLogicalHeightRegions(); |
| 233 | 238 |
| 234 for (RenderNamedFlowThreadList::iterator iter = m_renderNamedFlowThreadList-
>begin(); iter != m_renderNamedFlowThreadList->end(); ++iter) { | 239 for (RenderNamedFlowThreadList::iterator iter = m_renderNamedFlowThreadList-
>begin(); iter != m_renderNamedFlowThreadList->end(); ++iter) { |
| 235 if (!(*iter)->isAutoLogicalHeightRegionsCountConsistent()) | 240 if (!(*iter)->isAutoLogicalHeightRegionsCountConsistent()) |
| 236 return false; | 241 return false; |
| 237 } | 242 } |
| 238 | 243 |
| 239 return true; | 244 return true; |
| 240 } | 245 } |
| 241 #endif | 246 #endif |
| 242 | 247 |
| 243 } // namespace WebCore | 248 } // namespace WebCore |
| OLD | NEW |