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 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
reserved. | 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 static void updateStyleOfAnonymousBlockContinuations(RenderObject* block, const
RenderStyle* newStyle, const RenderStyle* oldStyle) | 139 static void updateStyleOfAnonymousBlockContinuations(RenderObject* block, const
RenderStyle* newStyle, const RenderStyle* oldStyle) |
140 { | 140 { |
141 for (;block && block->isAnonymousBlock(); block = block->nextSibling()) { | 141 for (;block && block->isAnonymousBlock(); block = block->nextSibling()) { |
142 if (!toRenderBlock(block)->isAnonymousBlockContinuation() || block->styl
e()->position() == newStyle->position()) | 142 if (!toRenderBlock(block)->isAnonymousBlockContinuation() || block->styl
e()->position() == newStyle->position()) |
143 continue; | 143 continue; |
144 // If we are no longer relatively positioned but our descendant block(s)
still have a relatively positioned ancestor then | 144 // If we are no longer relatively positioned but our descendant block(s)
still have a relatively positioned ancestor then |
145 // their containing anonymous block should keep its relative positioning
. | 145 // their containing anonymous block should keep its relative positioning
. |
146 RenderInline* cont = toRenderBlock(block)->inlineElementContinuation(); | 146 RenderInline* cont = toRenderBlock(block)->inlineElementContinuation(); |
147 if (oldStyle->position() == RelativePosition && hasRelPositionedInlineAn
cestor(cont)) | 147 if (oldStyle->position() == RelativePosition && hasRelPositionedInlineAn
cestor(cont)) |
148 continue; | 148 continue; |
149 RefPtr<RenderStyle> blockStyle = RenderStyle::createAnonymousStyle(block
->style()); | 149 RefPtr<RenderStyle> blockStyle = RenderStyle::createAnonymousStyleWithDi
splay(block->style(), BLOCK); |
150 blockStyle->setPosition(newStyle->position()); | 150 blockStyle->setPosition(newStyle->position()); |
151 blockStyle->setDisplay(BLOCK); | |
152 block->setStyle(blockStyle); | 151 block->setStyle(blockStyle); |
153 } | 152 } |
154 } | 153 } |
155 | 154 |
156 void RenderInline::styleDidChange(StyleDifference diff, const RenderStyle* oldSt
yle) | 155 void RenderInline::styleDidChange(StyleDifference diff, const RenderStyle* oldSt
yle) |
157 { | 156 { |
158 RenderBoxModelObject::styleDidChange(diff, oldStyle); | 157 RenderBoxModelObject::styleDidChange(diff, oldStyle); |
159 | 158 |
160 // Ensure that all of the split inlines pick up the new style. We | 159 // Ensure that all of the split inlines pick up the new style. We |
161 // only do this if we're an inline, since we don't want to propagate | 160 // only do this if we're an inline, since we don't want to propagate |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 { | 273 { |
275 // Make sure we don't append things after :after-generated content if we hav
e it. | 274 // Make sure we don't append things after :after-generated content if we hav
e it. |
276 if (!beforeChild && isAfterContent(lastChild())) | 275 if (!beforeChild && isAfterContent(lastChild())) |
277 beforeChild = lastChild(); | 276 beforeChild = lastChild(); |
278 | 277 |
279 if (!newChild->isInline() && !newChild->isFloatingOrPositioned()) { | 278 if (!newChild->isInline() && !newChild->isFloatingOrPositioned()) { |
280 // We are placing a block inside an inline. We have to perform a split o
f this | 279 // We are placing a block inside an inline. We have to perform a split o
f this |
281 // inline into continuations. This involves creating an anonymous block
box to hold | 280 // inline into continuations. This involves creating an anonymous block
box to hold |
282 // |newChild|. We then make that block box a continuation of this inlin
e. We take all of | 281 // |newChild|. We then make that block box a continuation of this inlin
e. We take all of |
283 // the children after |beforeChild| and put them in a clone of this obje
ct. | 282 // the children after |beforeChild| and put them in a clone of this obje
ct. |
284 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyle(style()
); | 283 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisp
lay(style(), BLOCK); |
285 newStyle->setDisplay(BLOCK); | |
286 | 284 |
287 // If inside an inline affected by relative positioning the block needs
to be affected by it too. | 285 // If inside an inline affected by relative positioning the block needs
to be affected by it too. |
288 // Giving the block a layer like this allows it to collect the x/y offse
ts from inline parents later. | 286 // Giving the block a layer like this allows it to collect the x/y offse
ts from inline parents later. |
289 if (hasRelPositionedInlineAncestor(this)) | 287 if (hasRelPositionedInlineAncestor(this)) |
290 newStyle->setPosition(RelativePosition); | 288 newStyle->setPosition(RelativePosition); |
291 | 289 |
292 RenderBlock* newBox = new (renderArena()) RenderBlock(document() /* anon
ymous box */); | 290 RenderBlock* newBox = new (renderArena()) RenderBlock(document() /* anon
ymous box */); |
293 newBox->setStyle(newStyle.release()); | 291 newBox->setStyle(newStyle.release()); |
294 RenderBoxModelObject* oldContinuation = continuation(); | 292 RenderBoxModelObject* oldContinuation = continuation(); |
295 setContinuation(newBox); | 293 setContinuation(newBox); |
(...skipping 1298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1594 FloatPoint absPos = container->localToAbsolute(); | 1592 FloatPoint absPos = container->localToAbsolute(); |
1595 region.bounds.setX(absPos.x() + region.bounds.x()); | 1593 region.bounds.setX(absPos.x() + region.bounds.x()); |
1596 region.bounds.setY(absPos.y() + region.bounds.y()); | 1594 region.bounds.setY(absPos.y() + region.bounds.y()); |
1597 | 1595 |
1598 regions.append(region); | 1596 regions.append(region); |
1599 } | 1597 } |
1600 } | 1598 } |
1601 #endif | 1599 #endif |
1602 | 1600 |
1603 } // namespace WebCore | 1601 } // namespace WebCore |
OLD | NEW |