| 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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 return oldStyle->borderTopWidth() != newStyle->borderTopWidth() | 321 return oldStyle->borderTopWidth() != newStyle->borderTopWidth() |
| 322 || oldStyle->borderBottomWidth() != newStyle->borderBottomWidth() | 322 || oldStyle->borderBottomWidth() != newStyle->borderBottomWidth() |
| 323 || oldStyle->paddingTop() != newStyle->paddingTop() | 323 || oldStyle->paddingTop() != newStyle->paddingTop() |
| 324 || oldStyle->paddingBottom() != newStyle->paddingBottom(); | 324 || oldStyle->paddingBottom() != newStyle->paddingBottom(); |
| 325 } | 325 } |
| 326 | 326 |
| 327 void RenderBlock::styleDidChange(StyleDifference diff, const RenderStyle* oldSty
le) | 327 void RenderBlock::styleDidChange(StyleDifference diff, const RenderStyle* oldSty
le) |
| 328 { | 328 { |
| 329 RenderBox::styleDidChange(diff, oldStyle); | 329 RenderBox::styleDidChange(diff, oldStyle); |
| 330 | 330 |
| 331 if (isFloatingOrOutOfFlowPositioned() && oldStyle && !oldStyle->isFloating()
&& !oldStyle->hasOutOfFlowPosition() && parent() && parent()->isRenderBlockFlow
()) | |
| 332 toRenderBlock(parent())->removeAnonymousWrappersIfRequired(); | |
| 333 | |
| 334 RenderStyle* newStyle = style(); | 331 RenderStyle* newStyle = style(); |
| 335 | 332 |
| 336 if (!isAnonymousBlock()) { | 333 if (!isAnonymousBlock()) { |
| 337 // Ensure that all of our continuation blocks pick up the new style. | 334 // Ensure that all of our continuation blocks pick up the new style. |
| 338 for (RenderBlock* currCont = blockElementContinuation(); currCont; currC
ont = currCont->blockElementContinuation()) { | 335 for (RenderBlock* currCont = blockElementContinuation(); currCont; currC
ont = currCont->blockElementContinuation()) { |
| 339 RenderBoxModelObject* nextCont = currCont->continuation(); | 336 RenderBoxModelObject* nextCont = currCont->continuation(); |
| 340 currCont->setContinuation(0); | 337 currCont->setContinuation(0); |
| 341 currCont->setStyle(newStyle); | 338 currCont->setStyle(newStyle); |
| 342 currCont->setContinuation(nextCont); | 339 currCont->setContinuation(nextCont); |
| 343 } | 340 } |
| (...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1073 return false; | 1070 return false; |
| 1074 | 1071 |
| 1075 if (!prev || !next) | 1072 if (!prev || !next) |
| 1076 return true; | 1073 return true; |
| 1077 | 1074 |
| 1078 // Make sure the types of the anonymous blocks match up. | 1075 // Make sure the types of the anonymous blocks match up. |
| 1079 return prev->isAnonymousColumnsBlock() == next->isAnonymousColumnsBlock() | 1076 return prev->isAnonymousColumnsBlock() == next->isAnonymousColumnsBlock() |
| 1080 && prev->isAnonymousColumnSpanBlock() == next->isAnonymousColumnSpanB
lock(); | 1077 && prev->isAnonymousColumnSpanBlock() == next->isAnonymousColumnSpanB
lock(); |
| 1081 } | 1078 } |
| 1082 | 1079 |
| 1083 void RenderBlock::removeAnonymousWrappersIfRequired() | |
| 1084 { | |
| 1085 RenderBox* child = firstChildBox(); | |
| 1086 while (child && (child->isAnonymousBlock() || child->isFloatingOrOutOfFlowPo
sitioned())) { | |
| 1087 RenderBox* next = child->nextSiblingBox(); | |
| 1088 // A continuation means the wrappers are still required. | |
| 1089 if (next && next->isRenderBlock() && toRenderBlock(next)->continuation()
) | |
| 1090 return; | |
| 1091 if (child->isAnonymousBlock()) | |
| 1092 collapseAnonymousBlockChild(this, toRenderBlock(child)); | |
| 1093 // |child| may have been destroyed. | |
| 1094 child = next; | |
| 1095 } | |
| 1096 } | |
| 1097 | |
| 1098 void RenderBlock::collapseAnonymousBlockChild(RenderBlock* parent, RenderBlock*
child) | 1080 void RenderBlock::collapseAnonymousBlockChild(RenderBlock* parent, RenderBlock*
child) |
| 1099 { | 1081 { |
| 1100 // It's possible that this block's destruction may have been triggered by th
e | 1082 // It's possible that this block's destruction may have been triggered by th
e |
| 1101 // child's removal. Just bail if the anonymous child block is already being | 1083 // child's removal. Just bail if the anonymous child block is already being |
| 1102 // destroyed. See crbug.com/282088 | 1084 // destroyed. See crbug.com/282088 |
| 1103 if (child->beingDestroyed()) | 1085 if (child->beingDestroyed()) |
| 1104 return; | 1086 return; |
| 1105 parent->setNeedsLayoutAndPrefWidthsRecalc(); | 1087 parent->setNeedsLayoutAndPrefWidthsRecalc(); |
| 1106 parent->setChildrenInline(child->childrenInline()); | 1088 parent->setChildrenInline(child->childrenInline()); |
| 1107 RenderObject* nextSibling = child->nextSibling(); | 1089 RenderObject* nextSibling = child->nextSibling(); |
| (...skipping 3895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5003 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m
arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render
Object* obj) const | 4985 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m
arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render
Object* obj) const |
| 5004 { | 4986 { |
| 5005 showRenderObject(); | 4987 showRenderObject(); |
| 5006 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot
Box()) | 4988 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot
Box()) |
| 5007 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa
bel2, obj, 1); | 4989 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa
bel2, obj, 1); |
| 5008 } | 4990 } |
| 5009 | 4991 |
| 5010 #endif | 4992 #endif |
| 5011 | 4993 |
| 5012 } // namespace WebCore | 4994 } // namespace WebCore |
| OLD | NEW |