OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2007 David Smith (catfish.man@gmail.com) | 4 * (C) 2007 David Smith (catfish.man@gmail.com) |
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. | 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. |
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 #include "core/layout/LayoutTextControl.h" | 53 #include "core/layout/LayoutTextControl.h" |
54 #include "core/layout/LayoutTextFragment.h" | 54 #include "core/layout/LayoutTextFragment.h" |
55 #include "core/layout/LayoutTheme.h" | 55 #include "core/layout/LayoutTheme.h" |
56 #include "core/layout/LayoutView.h" | 56 #include "core/layout/LayoutView.h" |
57 #include "core/layout/PaintInfo.h" | 57 #include "core/layout/PaintInfo.h" |
58 #include "core/layout/TextAutosizer.h" | 58 #include "core/layout/TextAutosizer.h" |
59 #include "core/layout/line/InlineIterator.h" | 59 #include "core/layout/line/InlineIterator.h" |
60 #include "core/layout/line/InlineTextBox.h" | 60 #include "core/layout/line/InlineTextBox.h" |
61 #include "core/layout/shapes/ShapeOutsideInfo.h" | 61 #include "core/layout/shapes/ShapeOutsideInfo.h" |
62 #include "core/layout/style/ContentData.h" | 62 #include "core/layout/style/ContentData.h" |
63 #include "core/layout/style/LayoutStyle.h" | 63 #include "core/layout/style/ComputedStyle.h" |
64 #include "core/page/Page.h" | 64 #include "core/page/Page.h" |
65 #include "core/paint/BlockPainter.h" | 65 #include "core/paint/BlockPainter.h" |
66 #include "core/paint/BoxPainter.h" | 66 #include "core/paint/BoxPainter.h" |
67 #include "core/paint/DeprecatedPaintLayer.h" | 67 #include "core/paint/DeprecatedPaintLayer.h" |
68 #include "core/paint/LayoutObjectDrawingRecorder.h" | 68 #include "core/paint/LayoutObjectDrawingRecorder.h" |
69 #include "platform/RuntimeEnabledFeatures.h" | 69 #include "platform/RuntimeEnabledFeatures.h" |
70 #include "platform/geometry/FloatQuad.h" | 70 #include "platform/geometry/FloatQuad.h" |
71 #include "platform/geometry/TransformState.h" | 71 #include "platform/geometry/TransformState.h" |
72 #include "wtf/StdLibExtras.h" | 72 #include "wtf/StdLibExtras.h" |
73 #include "wtf/TemporaryChange.h" | 73 #include "wtf/TemporaryChange.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 imageResources.append(styleImage->cachedImage()); | 186 imageResources.append(styleImage->cachedImage()); |
187 } | 187 } |
188 } | 188 } |
189 | 189 |
190 static void appendLayers(Vector<ImageResource*>& images, const FillLayer& styleL
ayer) | 190 static void appendLayers(Vector<ImageResource*>& images, const FillLayer& styleL
ayer) |
191 { | 191 { |
192 for (const FillLayer* layer = &styleLayer; layer; layer = layer->next()) | 192 for (const FillLayer* layer = &styleLayer; layer; layer = layer->next()) |
193 appendImageIfNotNull(images, layer->image()); | 193 appendImageIfNotNull(images, layer->image()); |
194 } | 194 } |
195 | 195 |
196 static void appendImagesFromStyle(Vector<ImageResource*>& images, const LayoutSt
yle& blockStyle) | 196 static void appendImagesFromStyle(Vector<ImageResource*>& images, const Computed
Style& blockStyle) |
197 { | 197 { |
198 appendLayers(images, blockStyle.backgroundLayers()); | 198 appendLayers(images, blockStyle.backgroundLayers()); |
199 appendLayers(images, blockStyle.maskLayers()); | 199 appendLayers(images, blockStyle.maskLayers()); |
200 | 200 |
201 const ContentData* contentData = blockStyle.contentData(); | 201 const ContentData* contentData = blockStyle.contentData(); |
202 if (contentData && contentData->isImage()) | 202 if (contentData && contentData->isImage()) |
203 appendImageIfNotNull(images, toImageContentData(contentData)->image()); | 203 appendImageIfNotNull(images, toImageContentData(contentData)->image()); |
204 if (blockStyle.boxReflect()) | 204 if (blockStyle.boxReflect()) |
205 appendImageIfNotNull(images, blockStyle.boxReflect()->mask().image()); | 205 appendImageIfNotNull(images, blockStyle.boxReflect()->mask().image()); |
206 appendImageIfNotNull(images, blockStyle.listStyleImage()); | 206 appendImageIfNotNull(images, blockStyle.listStyleImage()); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 | 270 |
271 if (UNLIKELY(gDelayedUpdateScrollInfoSet != 0)) | 271 if (UNLIKELY(gDelayedUpdateScrollInfoSet != 0)) |
272 gDelayedUpdateScrollInfoSet->remove(this); | 272 gDelayedUpdateScrollInfoSet->remove(this); |
273 | 273 |
274 if (TextAutosizer* textAutosizer = document().textAutosizer()) | 274 if (TextAutosizer* textAutosizer = document().textAutosizer()) |
275 textAutosizer->destroy(this); | 275 textAutosizer->destroy(this); |
276 | 276 |
277 LayoutBox::willBeDestroyed(); | 277 LayoutBox::willBeDestroyed(); |
278 } | 278 } |
279 | 279 |
280 void LayoutBlock::styleWillChange(StyleDifference diff, const LayoutStyle& newSt
yle) | 280 void LayoutBlock::styleWillChange(StyleDifference diff, const ComputedStyle& new
Style) |
281 { | 281 { |
282 const LayoutStyle* oldStyle = style(); | 282 const ComputedStyle* oldStyle = style(); |
283 | 283 |
284 setReplaced(newStyle.isDisplayInlineType()); | 284 setReplaced(newStyle.isDisplayInlineType()); |
285 | 285 |
286 if (oldStyle && parent()) { | 286 if (oldStyle && parent()) { |
287 bool oldStyleIsContainer = oldStyle->position() != StaticPosition || old
Style->hasTransformRelatedProperty(); | 287 bool oldStyleIsContainer = oldStyle->position() != StaticPosition || old
Style->hasTransformRelatedProperty(); |
288 bool newStyleIsContainer = newStyle.position() != StaticPosition || newS
tyle.hasTransformRelatedProperty(); | 288 bool newStyleIsContainer = newStyle.position() != StaticPosition || newS
tyle.hasTransformRelatedProperty(); |
289 | 289 |
290 if (oldStyleIsContainer && !newStyleIsContainer) { | 290 if (oldStyleIsContainer && !newStyleIsContainer) { |
291 // Clear our positioned objects list. Our absolutely positioned desc
endants will be | 291 // Clear our positioned objects list. Our absolutely positioned desc
endants will be |
292 // inserted into our containing block's positioned objects list duri
ng layout. | 292 // inserted into our containing block's positioned objects list duri
ng layout. |
(...skipping 11 matching lines...) Expand all Loading... |
304 } | 304 } |
305 | 305 |
306 if (cb->isLayoutBlock()) | 306 if (cb->isLayoutBlock()) |
307 toLayoutBlock(cb)->removePositionedObjects(this, NewContainingBl
ock); | 307 toLayoutBlock(cb)->removePositionedObjects(this, NewContainingBl
ock); |
308 } | 308 } |
309 } | 309 } |
310 | 310 |
311 LayoutBox::styleWillChange(diff, newStyle); | 311 LayoutBox::styleWillChange(diff, newStyle); |
312 } | 312 } |
313 | 313 |
314 static bool borderOrPaddingLogicalWidthChanged(const LayoutStyle& oldStyle, cons
t LayoutStyle& newStyle) | 314 static bool borderOrPaddingLogicalWidthChanged(const ComputedStyle& oldStyle, co
nst ComputedStyle& newStyle) |
315 { | 315 { |
316 if (newStyle.isHorizontalWritingMode()) { | 316 if (newStyle.isHorizontalWritingMode()) { |
317 return oldStyle.borderLeftWidth() != newStyle.borderLeftWidth() | 317 return oldStyle.borderLeftWidth() != newStyle.borderLeftWidth() |
318 || oldStyle.borderRightWidth() != newStyle.borderRightWidth() | 318 || oldStyle.borderRightWidth() != newStyle.borderRightWidth() |
319 || oldStyle.paddingLeft() != newStyle.paddingLeft() | 319 || oldStyle.paddingLeft() != newStyle.paddingLeft() |
320 || oldStyle.paddingRight() != newStyle.paddingRight(); | 320 || oldStyle.paddingRight() != newStyle.paddingRight(); |
321 } | 321 } |
322 | 322 |
323 return oldStyle.borderTopWidth() != newStyle.borderTopWidth() | 323 return oldStyle.borderTopWidth() != newStyle.borderTopWidth() |
324 || oldStyle.borderBottomWidth() != newStyle.borderBottomWidth() | 324 || oldStyle.borderBottomWidth() != newStyle.borderBottomWidth() |
325 || oldStyle.paddingTop() != newStyle.paddingTop() | 325 || oldStyle.paddingTop() != newStyle.paddingTop() |
326 || oldStyle.paddingBottom() != newStyle.paddingBottom(); | 326 || oldStyle.paddingBottom() != newStyle.paddingBottom(); |
327 } | 327 } |
328 | 328 |
329 void LayoutBlock::styleDidChange(StyleDifference diff, const LayoutStyle* oldSty
le) | 329 void LayoutBlock::styleDidChange(StyleDifference diff, const ComputedStyle* oldS
tyle) |
330 { | 330 { |
331 LayoutBox::styleDidChange(diff, oldStyle); | 331 LayoutBox::styleDidChange(diff, oldStyle); |
332 | 332 |
333 if (isFloatingOrOutOfFlowPositioned() && oldStyle && !oldStyle->isFloating()
&& !oldStyle->hasOutOfFlowPosition() && parent() && parent()->isLayoutBlockFlow
()) | 333 if (isFloatingOrOutOfFlowPositioned() && oldStyle && !oldStyle->isFloating()
&& !oldStyle->hasOutOfFlowPosition() && parent() && parent()->isLayoutBlockFlow
()) |
334 toLayoutBlock(parent())->removeAnonymousWrappersIfRequired(); | 334 toLayoutBlock(parent())->removeAnonymousWrappersIfRequired(); |
335 | 335 |
336 const LayoutStyle& newStyle = styleRef(); | 336 const ComputedStyle& newStyle = styleRef(); |
337 | 337 |
338 if (!isAnonymousBlock()) { | 338 if (!isAnonymousBlock()) { |
339 // Ensure that all of our continuation blocks pick up the new style. | 339 // Ensure that all of our continuation blocks pick up the new style. |
340 for (LayoutBlock* currCont = blockElementContinuation(); currCont; currC
ont = currCont->blockElementContinuation()) { | 340 for (LayoutBlock* currCont = blockElementContinuation(); currCont; currC
ont = currCont->blockElementContinuation()) { |
341 LayoutBoxModelObject* nextCont = currCont->continuation(); | 341 LayoutBoxModelObject* nextCont = currCont->continuation(); |
342 currCont->setContinuation(0); | 342 currCont->setContinuation(0); |
343 currCont->setStyle(style()); | 343 currCont->setStyle(style()); |
344 currCont->setContinuation(nextCont); | 344 currCont->setContinuation(nextCont); |
345 } | 345 } |
346 } | 346 } |
(...skipping 823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1170 | 1170 |
1171 if (prev->childrenInline() != next->childrenInline()) { | 1171 if (prev->childrenInline() != next->childrenInline()) { |
1172 LayoutBlock* inlineChildrenBlock = prev->childrenInline() ? prevBloc
k : nextBlock; | 1172 LayoutBlock* inlineChildrenBlock = prev->childrenInline() ? prevBloc
k : nextBlock; |
1173 LayoutBlock* blockChildrenBlock = prev->childrenInline() ? nextBlock
: prevBlock; | 1173 LayoutBlock* blockChildrenBlock = prev->childrenInline() ? nextBlock
: prevBlock; |
1174 | 1174 |
1175 // Place the inline children block inside of the block children bloc
k instead of deleting it. | 1175 // Place the inline children block inside of the block children bloc
k instead of deleting it. |
1176 // In order to reuse it, we have to reset it to just be a generic an
onymous block. Make sure | 1176 // In order to reuse it, we have to reset it to just be a generic an
onymous block. Make sure |
1177 // to clear out inherited column properties by just making a new sty
le, and to also clear the | 1177 // to clear out inherited column properties by just making a new sty
le, and to also clear the |
1178 // column span flag if it is set. | 1178 // column span flag if it is set. |
1179 ASSERT(!inlineChildrenBlock->continuation()); | 1179 ASSERT(!inlineChildrenBlock->continuation()); |
1180 RefPtr<LayoutStyle> newStyle = LayoutStyle::createAnonymousStyleWith
Display(styleRef(), BLOCK); | 1180 RefPtr<ComputedStyle> newStyle = ComputedStyle::createAnonymousStyle
WithDisplay(styleRef(), BLOCK); |
1181 // Cache this value as it might get changed in setStyle() call. | 1181 // Cache this value as it might get changed in setStyle() call. |
1182 bool inlineChildrenBlockHasLayer = inlineChildrenBlock->hasLayer(); | 1182 bool inlineChildrenBlockHasLayer = inlineChildrenBlock->hasLayer(); |
1183 inlineChildrenBlock->setStyle(newStyle); | 1183 inlineChildrenBlock->setStyle(newStyle); |
1184 children()->removeChildNode(this, inlineChildrenBlock, inlineChildre
nBlockHasLayer); | 1184 children()->removeChildNode(this, inlineChildrenBlock, inlineChildre
nBlockHasLayer); |
1185 | 1185 |
1186 // Now just put the inlineChildrenBlock inside the blockChildrenBloc
k. | 1186 // Now just put the inlineChildrenBlock inside the blockChildrenBloc
k. |
1187 blockChildrenBlock->children()->insertChildNode(blockChildrenBlock,
inlineChildrenBlock, prev == inlineChildrenBlock ? blockChildrenBlock->firstChil
d() : 0, | 1187 blockChildrenBlock->children()->insertChildNode(blockChildrenBlock,
inlineChildrenBlock, prev == inlineChildrenBlock ? blockChildrenBlock->firstChil
d() : 0, |
1188 inlineChildrenBlockHasLayer || blockChildrenBlock->hasLayer()); | 1188 inlineChildrenBlockHasLayer || blockChildrenBlock->hasLayer()); |
1189 next->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(); | 1189 next->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(); |
1190 | 1190 |
(...skipping 1780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2971 | 2971 |
2972 void LayoutBlock::computePreferredLogicalWidths() | 2972 void LayoutBlock::computePreferredLogicalWidths() |
2973 { | 2973 { |
2974 ASSERT(preferredLogicalWidthsDirty()); | 2974 ASSERT(preferredLogicalWidthsDirty()); |
2975 | 2975 |
2976 m_minPreferredLogicalWidth = 0; | 2976 m_minPreferredLogicalWidth = 0; |
2977 m_maxPreferredLogicalWidth = 0; | 2977 m_maxPreferredLogicalWidth = 0; |
2978 | 2978 |
2979 // FIXME: The isFixed() calls here should probably be checking for isSpecifi
ed since you | 2979 // FIXME: The isFixed() calls here should probably be checking for isSpecifi
ed since you |
2980 // should be able to use percentage, calc or viewport relative values for wi
dth. | 2980 // should be able to use percentage, calc or viewport relative values for wi
dth. |
2981 const LayoutStyle& styleToUse = styleRef(); | 2981 const ComputedStyle& styleToUse = styleRef(); |
2982 if (!isTableCell() && styleToUse.logicalWidth().isFixed() && styleToUse.logi
calWidth().value() >= 0 | 2982 if (!isTableCell() && styleToUse.logicalWidth().isFixed() && styleToUse.logi
calWidth().value() >= 0 |
2983 && !(isDeprecatedFlexItem() && !styleToUse.logicalWidth().intValue())) | 2983 && !(isDeprecatedFlexItem() && !styleToUse.logicalWidth().intValue())) |
2984 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentB
oxLogicalWidthForBoxSizing(styleToUse.logicalWidth().value()); | 2984 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentB
oxLogicalWidthForBoxSizing(styleToUse.logicalWidth().value()); |
2985 else | 2985 else |
2986 computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth, m_maxPreferred
LogicalWidth); | 2986 computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth, m_maxPreferred
LogicalWidth); |
2987 | 2987 |
2988 if (styleToUse.logicalMinWidth().isFixed() && styleToUse.logicalMinWidth().v
alue() > 0) { | 2988 if (styleToUse.logicalMinWidth().isFixed() && styleToUse.logicalMinWidth().v
alue() > 0) { |
2989 m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjust
ContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth().value())); | 2989 m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjust
ContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth().value())); |
2990 m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjust
ContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth().value())); | 2990 m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjust
ContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth().value())); |
2991 } | 2991 } |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3028 // intrinsic width, instead of pretending that it's 1. The only way to d
o that is by | 3028 // intrinsic width, instead of pretending that it's 1. The only way to d
o that is by |
3029 // performing a layout pass, but this is not an appropriate time or plac
e for layout. The | 3029 // performing a layout pass, but this is not an appropriate time or plac
e for layout. The |
3030 // good news is that if height is unconstrained and there are no explici
t breaks, the | 3030 // good news is that if height is unconstrained and there are no explici
t breaks, the |
3031 // resolved column-count really should be 1. | 3031 // resolved column-count really should be 1. |
3032 maxLogicalWidth = std::max(maxLogicalWidth, columnWidth) * columnCount +
gapExtra; | 3032 maxLogicalWidth = std::max(maxLogicalWidth, columnWidth) * columnCount +
gapExtra; |
3033 } | 3033 } |
3034 } | 3034 } |
3035 | 3035 |
3036 void LayoutBlock::computeBlockPreferredLogicalWidths(LayoutUnit& minLogicalWidth
, LayoutUnit& maxLogicalWidth) const | 3036 void LayoutBlock::computeBlockPreferredLogicalWidths(LayoutUnit& minLogicalWidth
, LayoutUnit& maxLogicalWidth) const |
3037 { | 3037 { |
3038 const LayoutStyle& styleToUse = styleRef(); | 3038 const ComputedStyle& styleToUse = styleRef(); |
3039 bool nowrap = styleToUse.whiteSpace() == NOWRAP; | 3039 bool nowrap = styleToUse.whiteSpace() == NOWRAP; |
3040 | 3040 |
3041 LayoutObject* child = firstChild(); | 3041 LayoutObject* child = firstChild(); |
3042 LayoutBlock* containingBlock = this->containingBlock(); | 3042 LayoutBlock* containingBlock = this->containingBlock(); |
3043 LayoutUnit floatLeftWidth = 0, floatRightWidth = 0; | 3043 LayoutUnit floatLeftWidth = 0, floatRightWidth = 0; |
3044 while (child) { | 3044 while (child) { |
3045 // Positioned children don't affect the min/max width. Spanners only aff
ect the min/max | 3045 // Positioned children don't affect the min/max width. Spanners only aff
ect the min/max |
3046 // width of the multicol container, not the flow thread. | 3046 // width of the multicol container, not the flow thread. |
3047 if (child->isOutOfFlowPositioned() || child->isColumnSpanAll()) { | 3047 if (child->isOutOfFlowPositioned() || child->isColumnSpanAll()) { |
3048 child = child->nextSibling(); | 3048 child = child->nextSibling(); |
3049 continue; | 3049 continue; |
3050 } | 3050 } |
3051 | 3051 |
3052 RefPtr<LayoutStyle> childStyle = child->style(); | 3052 RefPtr<ComputedStyle> childStyle = child->style(); |
3053 if (child->isFloating() || (child->isBox() && toLayoutBox(child)->avoids
Floats())) { | 3053 if (child->isFloating() || (child->isBox() && toLayoutBox(child)->avoids
Floats())) { |
3054 LayoutUnit floatTotalWidth = floatLeftWidth + floatRightWidth; | 3054 LayoutUnit floatTotalWidth = floatLeftWidth + floatRightWidth; |
3055 if (childStyle->clear() & CLEFT) { | 3055 if (childStyle->clear() & CLEFT) { |
3056 maxLogicalWidth = std::max(floatTotalWidth, maxLogicalWidth); | 3056 maxLogicalWidth = std::max(floatTotalWidth, maxLogicalWidth); |
3057 floatLeftWidth = 0; | 3057 floatLeftWidth = 0; |
3058 } | 3058 } |
3059 if (childStyle->clear() & CRIGHT) { | 3059 if (childStyle->clear() & CRIGHT) { |
3060 maxLogicalWidth = std::max(floatTotalWidth, maxLogicalWidth); | 3060 maxLogicalWidth = std::max(floatTotalWidth, maxLogicalWidth); |
3061 floatRightWidth = 0; | 3061 floatRightWidth = 0; |
3062 } | 3062 } |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3149 | 3149 |
3150 LayoutUnit LayoutBlock::lineHeight(bool firstLine, LineDirectionMode direction,
LinePositionMode linePositionMode) const | 3150 LayoutUnit LayoutBlock::lineHeight(bool firstLine, LineDirectionMode direction,
LinePositionMode linePositionMode) const |
3151 { | 3151 { |
3152 // Inline blocks are replaced elements. Otherwise, just pass off to | 3152 // Inline blocks are replaced elements. Otherwise, just pass off to |
3153 // the base class. If we're being queried as though we're the root line | 3153 // the base class. If we're being queried as though we're the root line |
3154 // box, then the fact that we're an inline-block is irrelevant, and we behav
e | 3154 // box, then the fact that we're an inline-block is irrelevant, and we behav
e |
3155 // just like a block. | 3155 // just like a block. |
3156 if (isReplaced() && linePositionMode == PositionOnContainingLine) | 3156 if (isReplaced() && linePositionMode == PositionOnContainingLine) |
3157 return LayoutBox::lineHeight(firstLine, direction, linePositionMode); | 3157 return LayoutBox::lineHeight(firstLine, direction, linePositionMode); |
3158 | 3158 |
3159 const LayoutStyle& style = styleRef(firstLine && document().styleEngine().us
esFirstLineRules()); | 3159 const ComputedStyle& style = styleRef(firstLine && document().styleEngine().
usesFirstLineRules()); |
3160 return style.computedLineHeight(); | 3160 return style.computedLineHeight(); |
3161 } | 3161 } |
3162 | 3162 |
3163 int LayoutBlock::beforeMarginInLineDirection(LineDirectionMode direction) const | 3163 int LayoutBlock::beforeMarginInLineDirection(LineDirectionMode direction) const |
3164 { | 3164 { |
3165 return direction == HorizontalLine ? marginTop() : marginRight(); | 3165 return direction == HorizontalLine ? marginTop() : marginRight(); |
3166 } | 3166 } |
3167 | 3167 |
3168 int LayoutBlock::baselinePosition(FontBaseline baselineType, bool firstLine, Lin
eDirectionMode direction, LinePositionMode linePositionMode) const | 3168 int LayoutBlock::baselinePosition(FontBaseline baselineType, bool firstLine, Lin
eDirectionMode direction, LinePositionMode linePositionMode) const |
3169 { | 3169 { |
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3750 EDisplay newDisplay; | 3750 EDisplay newDisplay; |
3751 LayoutBlock* newBox = 0; | 3751 LayoutBlock* newBox = 0; |
3752 if (display == FLEX || display == INLINE_FLEX) { | 3752 if (display == FLEX || display == INLINE_FLEX) { |
3753 newBox = LayoutFlexibleBox::createAnonymous(&parent->document()); | 3753 newBox = LayoutFlexibleBox::createAnonymous(&parent->document()); |
3754 newDisplay = FLEX; | 3754 newDisplay = FLEX; |
3755 } else { | 3755 } else { |
3756 newBox = LayoutBlockFlow::createAnonymous(&parent->document()); | 3756 newBox = LayoutBlockFlow::createAnonymous(&parent->document()); |
3757 newDisplay = BLOCK; | 3757 newDisplay = BLOCK; |
3758 } | 3758 } |
3759 | 3759 |
3760 RefPtr<LayoutStyle> newStyle = LayoutStyle::createAnonymousStyleWithDisplay(
parent->styleRef(), newDisplay); | 3760 RefPtr<ComputedStyle> newStyle = ComputedStyle::createAnonymousStyleWithDisp
lay(parent->styleRef(), newDisplay); |
3761 parent->updateAnonymousChildStyle(*newBox, *newStyle); | 3761 parent->updateAnonymousChildStyle(*newBox, *newStyle); |
3762 newBox->setStyle(newStyle.release()); | 3762 newBox->setStyle(newStyle.release()); |
3763 return newBox; | 3763 return newBox; |
3764 } | 3764 } |
3765 | 3765 |
3766 LayoutBlockFlow* LayoutBlock::createAnonymousColumnsWithParentRenderer(const Lay
outObject* parent) | 3766 LayoutBlockFlow* LayoutBlock::createAnonymousColumnsWithParentRenderer(const Lay
outObject* parent) |
3767 { | 3767 { |
3768 RefPtr<LayoutStyle> newStyle = LayoutStyle::createAnonymousStyleWithDisplay(
parent->styleRef(), BLOCK); | 3768 RefPtr<ComputedStyle> newStyle = ComputedStyle::createAnonymousStyleWithDisp
lay(parent->styleRef(), BLOCK); |
3769 newStyle->inheritColumnPropertiesFrom(parent->styleRef()); | 3769 newStyle->inheritColumnPropertiesFrom(parent->styleRef()); |
3770 | 3770 |
3771 LayoutBlockFlow* newBox = LayoutBlockFlow::createAnonymous(&parent->document
()); | 3771 LayoutBlockFlow* newBox = LayoutBlockFlow::createAnonymous(&parent->document
()); |
3772 parent->updateAnonymousChildStyle(*newBox, *newStyle); | 3772 parent->updateAnonymousChildStyle(*newBox, *newStyle); |
3773 newBox->setStyle(newStyle.release()); | 3773 newBox->setStyle(newStyle.release()); |
3774 return newBox; | 3774 return newBox; |
3775 } | 3775 } |
3776 | 3776 |
3777 LayoutBlockFlow* LayoutBlock::createAnonymousColumnSpanWithParentRenderer(const
LayoutObject* parent) | 3777 LayoutBlockFlow* LayoutBlock::createAnonymousColumnSpanWithParentRenderer(const
LayoutObject* parent) |
3778 { | 3778 { |
3779 RefPtr<LayoutStyle> newStyle = LayoutStyle::createAnonymousStyleWithDisplay(
parent->styleRef(), BLOCK); | 3779 RefPtr<ComputedStyle> newStyle = ComputedStyle::createAnonymousStyleWithDisp
lay(parent->styleRef(), BLOCK); |
3780 newStyle->setColumnSpan(ColumnSpanAll); | 3780 newStyle->setColumnSpan(ColumnSpanAll); |
3781 | 3781 |
3782 LayoutBlockFlow* newBox = LayoutBlockFlow::createAnonymous(&parent->document
()); | 3782 LayoutBlockFlow* newBox = LayoutBlockFlow::createAnonymous(&parent->document
()); |
3783 parent->updateAnonymousChildStyle(*newBox, *newStyle); | 3783 parent->updateAnonymousChildStyle(*newBox, *newStyle); |
3784 newBox->setStyle(newStyle.release()); | 3784 newBox->setStyle(newStyle.release()); |
3785 return newBox; | 3785 return newBox; |
3786 } | 3786 } |
3787 | 3787 |
3788 static bool recalcNormalFlowChildOverflowIfNeeded(LayoutObject* renderer) | 3788 static bool recalcNormalFlowChildOverflowIfNeeded(LayoutObject* renderer) |
3789 { | 3789 { |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3939 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m
arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout
Object* obj) const | 3939 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m
arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout
Object* obj) const |
3940 { | 3940 { |
3941 showLayoutObject(); | 3941 showLayoutObject(); |
3942 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot
Box()) | 3942 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot
Box()) |
3943 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa
bel2, obj, 1); | 3943 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa
bel2, obj, 1); |
3944 } | 3944 } |
3945 | 3945 |
3946 #endif | 3946 #endif |
3947 | 3947 |
3948 } // namespace blink | 3948 } // namespace blink |
OLD | NEW |