| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Apple Computer, Inc. | 2 * Copyright (C) 2006 Apple Computer, Inc. |
| 3 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org> | 3 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org> |
| 4 * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz> | 4 * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz> |
| 5 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> | 5 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> |
| 6 * Copyright (C) 2008 Rob Buis <buis@kde.org> | 6 * Copyright (C) 2008 Rob Buis <buis@kde.org> |
| 7 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> | 7 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> |
| 8 * Copyright (C) Research In Motion Limited 2010-2012. All rights reserved. | 8 * Copyright (C) Research In Motion Limited 2010-2012. All rights reserved. |
| 9 * Copyright (C) 2012 Google Inc. | 9 * Copyright (C) 2012 Google Inc. |
| 10 * | 10 * |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 #if ENABLE(ASSERT) | 177 #if ENABLE(ASSERT) |
| 178 Vector<SVGTextLayoutAttributes*> newLayoutAttributes; | 178 Vector<SVGTextLayoutAttributes*> newLayoutAttributes; |
| 179 collectLayoutAttributes(text, newLayoutAttributes); | 179 collectLayoutAttributes(text, newLayoutAttributes); |
| 180 ASSERT(newLayoutAttributes == expectedLayoutAttributes); | 180 ASSERT(newLayoutAttributes == expectedLayoutAttributes); |
| 181 #endif | 181 #endif |
| 182 } | 182 } |
| 183 | 183 |
| 184 void LayoutSVGText::layout() | 184 void LayoutSVGText::layout() |
| 185 { | 185 { |
| 186 ASSERT(needsLayout()); | 186 ASSERT(needsLayout()); |
| 187 // This flag is set and reset as needed only within this function. |
| 188 ASSERT(!m_needsReordering); |
| 187 LayoutAnalyzer::Scope analyzer(*this); | 189 LayoutAnalyzer::Scope analyzer(*this); |
| 188 | 190 |
| 189 bool updateParentBoundaries = false; | 191 bool updateParentBoundaries = false; |
| 190 if (m_needsTransformUpdate) { | 192 if (m_needsTransformUpdate) { |
| 191 m_localTransform = toSVGTextElement(node())->calculateAnimatedLocalTrans
form(); | 193 m_localTransform = toSVGTextElement(node())->calculateAnimatedLocalTrans
form(); |
| 192 m_needsTransformUpdate = false; | 194 m_needsTransformUpdate = false; |
| 193 updateParentBoundaries = true; | 195 updateParentBoundaries = true; |
| 194 } | 196 } |
| 195 | 197 |
| 196 // This flag is set and reset as needed only within this function. | |
| 197 ASSERT(!m_needsReordering); | |
| 198 | |
| 199 // When laying out initially, build the character data map and propagate | 198 // When laying out initially, build the character data map and propagate |
| 200 // resulting layout attributes to all LayoutSVGInlineText children in the | 199 // resulting layout attributes to all LayoutSVGInlineText children in the |
| 201 // subtree. | 200 // subtree. |
| 202 if (!everHadLayout()) { | 201 if (!everHadLayout()) { |
| 203 m_needsPositioningValuesUpdate = true; | 202 m_needsPositioningValuesUpdate = true; |
| 204 m_needsTextMetricsUpdate = true; | 203 m_needsTextMetricsUpdate = true; |
| 205 } | 204 } |
| 206 | 205 |
| 207 // If the root layout size changed (eg. window size changes), or the screen | 206 // If the root layout size changed (eg. window size changes), or the screen |
| 208 // scale factor has changed, then recompute the on-screen font size. Since | 207 // scale factor has changed, then recompute the on-screen font size. Since |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 | 248 |
| 250 LayoutUnit beforeEdge = borderBefore() + paddingBefore(); | 249 LayoutUnit beforeEdge = borderBefore() + paddingBefore(); |
| 251 LayoutUnit afterEdge = borderAfter() + paddingAfter() + scrollbarLogicalHeig
ht(); | 250 LayoutUnit afterEdge = borderAfter() + paddingAfter() + scrollbarLogicalHeig
ht(); |
| 252 setLogicalHeight(beforeEdge); | 251 setLogicalHeight(beforeEdge); |
| 253 | 252 |
| 254 LayoutState state(*this, locationOffset()); | 253 LayoutState state(*this, locationOffset()); |
| 255 LayoutUnit paintInvalidationLogicalTop; | 254 LayoutUnit paintInvalidationLogicalTop; |
| 256 LayoutUnit paintInvalidationLogicalBottom; | 255 LayoutUnit paintInvalidationLogicalBottom; |
| 257 layoutInlineChildren(true, paintInvalidationLogicalTop, paintInvalidationLog
icalBottom, afterEdge); | 256 layoutInlineChildren(true, paintInvalidationLogicalTop, paintInvalidationLog
icalBottom, afterEdge); |
| 258 | 257 |
| 259 if (m_needsReordering) | 258 m_needsReordering = false; |
| 260 m_needsReordering = false; | |
| 261 | 259 |
| 262 // If we don't have any line boxes, then make sure the frame rect is still c
leared. | 260 // If we don't have any line boxes, then make sure the frame rect is still c
leared. |
| 263 if (!firstLineBox()) | 261 if (!firstLineBox()) |
| 264 setFrameRect(LayoutRect()); | 262 setFrameRect(LayoutRect()); |
| 265 | 263 |
| 266 m_overflow.clear(); | 264 m_overflow.clear(); |
| 267 addVisualEffectOverflow(); | 265 addVisualEffectOverflow(); |
| 268 | 266 |
| 269 if (!updateParentBoundaries) | 267 if (!updateParentBoundaries) |
| 270 updateParentBoundaries = oldBoundaries != objectBoundingBox(); | 268 updateParentBoundaries = oldBoundaries != objectBoundingBox(); |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 paintInvalidationState.pushDelayedPaintInvalidationTarget(*this); | 413 paintInvalidationState.pushDelayedPaintInvalidationTarget(*this); |
| 416 | 414 |
| 417 if (reason == PaintInvalidationSVGResourceChange) | 415 if (reason == PaintInvalidationSVGResourceChange) |
| 418 newPaintInvalidationState.setForceSubtreeInvalidationWithinContainer(); | 416 newPaintInvalidationState.setForceSubtreeInvalidationWithinContainer(); |
| 419 | 417 |
| 420 newPaintInvalidationState.updateForChildren(); | 418 newPaintInvalidationState.updateForChildren(); |
| 421 invalidatePaintOfSubtreesIfNeeded(newPaintInvalidationState); | 419 invalidatePaintOfSubtreesIfNeeded(newPaintInvalidationState); |
| 422 } | 420 } |
| 423 | 421 |
| 424 } // namespace blink | 422 } // namespace blink |
| OLD | NEW |