Chromium Code Reviews| 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()->isRenderBlockFl ow()) | |
|
esprehn
2014/05/19 20:54:58
You don't need these nested parens, it's all &&
| |
| 332 toRenderBlock(parent())->removeAnonymousWrappersIfRequired(); | |
| 333 | |
| 331 RenderStyle* newStyle = style(); | 334 RenderStyle* newStyle = style(); |
| 332 | 335 |
| 333 if (!isAnonymousBlock()) { | 336 if (!isAnonymousBlock()) { |
| 334 // Ensure that all of our continuation blocks pick up the new style. | 337 // Ensure that all of our continuation blocks pick up the new style. |
| 335 for (RenderBlock* currCont = blockElementContinuation(); currCont; currC ont = currCont->blockElementContinuation()) { | 338 for (RenderBlock* currCont = blockElementContinuation(); currCont; currC ont = currCont->blockElementContinuation()) { |
| 336 RenderBoxModelObject* nextCont = currCont->continuation(); | 339 RenderBoxModelObject* nextCont = currCont->continuation(); |
| 337 currCont->setContinuation(0); | 340 currCont->setContinuation(0); |
| 338 currCont->setStyle(newStyle); | 341 currCont->setStyle(newStyle); |
| 339 currCont->setContinuation(nextCont); | 342 currCont->setContinuation(nextCont); |
| 340 } | 343 } |
| (...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1045 return false; | 1048 return false; |
| 1046 | 1049 |
| 1047 if (!prev || !next) | 1050 if (!prev || !next) |
| 1048 return true; | 1051 return true; |
| 1049 | 1052 |
| 1050 // Make sure the types of the anonymous blocks match up. | 1053 // Make sure the types of the anonymous blocks match up. |
| 1051 return prev->isAnonymousColumnsBlock() == next->isAnonymousColumnsBlock() | 1054 return prev->isAnonymousColumnsBlock() == next->isAnonymousColumnsBlock() |
| 1052 && prev->isAnonymousColumnSpanBlock() == next->isAnonymousColumnSpanB lock(); | 1055 && prev->isAnonymousColumnSpanBlock() == next->isAnonymousColumnSpanB lock(); |
| 1053 } | 1056 } |
| 1054 | 1057 |
| 1058 void RenderBlock::removeAnonymousWrappersIfRequired() | |
| 1059 { | |
| 1060 RenderBlock* child = toRenderBlock(firstChildBox()); | |
|
esprehn
2014/05/19 20:54:58
How do you know this cast is safe?
| |
| 1061 while (child && (child->isAnonymousBlock() || child->isFloatingOrOutOfFlowPo sitioned())) { | |
| 1062 RenderBlock* next = toRenderBlock(child->nextSiblingBox()); | |
|
esprehn
2014/05/19 20:54:58
ditto
| |
| 1063 // A continuation means the wrappers are still required. | |
| 1064 if (next && next->continuation()) | |
| 1065 return; | |
| 1066 if (child->isAnonymousBlock()) | |
| 1067 collapseAnonymousBlockChild(this, child); | |
| 1068 // |child| may have been destroyed. | |
| 1069 child = next; | |
| 1070 } | |
| 1071 } | |
| 1072 | |
| 1055 void RenderBlock::collapseAnonymousBlockChild(RenderBlock* parent, RenderBlock* child) | 1073 void RenderBlock::collapseAnonymousBlockChild(RenderBlock* parent, RenderBlock* child) |
| 1056 { | 1074 { |
| 1057 // It's possible that this block's destruction may have been triggered by th e | 1075 // It's possible that this block's destruction may have been triggered by th e |
| 1058 // child's removal. Just bail if the anonymous child block is already being | 1076 // child's removal. Just bail if the anonymous child block is already being |
| 1059 // destroyed. See crbug.com/282088 | 1077 // destroyed. See crbug.com/282088 |
| 1060 if (child->beingDestroyed()) | 1078 if (child->beingDestroyed()) |
| 1061 return; | 1079 return; |
| 1062 parent->setNeedsLayoutAndPrefWidthsRecalc(); | 1080 parent->setNeedsLayoutAndPrefWidthsRecalc(); |
| 1063 parent->setChildrenInline(child->childrenInline()); | 1081 parent->setChildrenInline(child->childrenInline()); |
| 1064 RenderObject* nextSibling = child->nextSibling(); | 1082 RenderObject* nextSibling = child->nextSibling(); |
| (...skipping 3927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4992 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const | 5010 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const |
| 4993 { | 5011 { |
| 4994 showRenderObject(); | 5012 showRenderObject(); |
| 4995 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) | 5013 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) |
| 4996 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); | 5014 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); |
| 4997 } | 5015 } |
| 4998 | 5016 |
| 4999 #endif | 5017 #endif |
| 5000 | 5018 |
| 5001 } // namespace WebCore | 5019 } // namespace WebCore |
| OLD | NEW |