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 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1125 if (canMergeAnonymousBlocks && prev && next) { | 1125 if (canMergeAnonymousBlocks && prev && next) { |
| 1126 prev->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(LayoutIn validationReason::AnonymousBlockChange); | 1126 prev->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(LayoutIn validationReason::AnonymousBlockChange); |
| 1127 LayoutBlockFlow* nextBlock = toLayoutBlockFlow(next); | 1127 LayoutBlockFlow* nextBlock = toLayoutBlockFlow(next); |
| 1128 LayoutBlockFlow* prevBlock = toLayoutBlockFlow(prev); | 1128 LayoutBlockFlow* prevBlock = toLayoutBlockFlow(prev); |
| 1129 | 1129 |
| 1130 if (prev->childrenInline() != next->childrenInline()) { | 1130 if (prev->childrenInline() != next->childrenInline()) { |
| 1131 LayoutBlock* inlineChildrenBlock = prev->childrenInline() ? prevBloc k : nextBlock; | 1131 LayoutBlock* inlineChildrenBlock = prev->childrenInline() ? prevBloc k : nextBlock; |
| 1132 LayoutBlock* blockChildrenBlock = prev->childrenInline() ? nextBlock : prevBlock; | 1132 LayoutBlock* blockChildrenBlock = prev->childrenInline() ? nextBlock : prevBlock; |
| 1133 | 1133 |
| 1134 // Place the inline children block inside of the block children bloc k instead of deleting it. | 1134 // Place the inline children block inside of the block children bloc k instead of deleting it. |
| 1135 // In order to reuse it, we have to reset it to just be a generic an onymous block. Make sure | |
| 1136 // to clear out inherited column properties by just making a new sty le, and to also clear the | |
| 1137 // column span flag if it is set. | |
| 1138 ASSERT(!inlineChildrenBlock->continuation()); | 1135 ASSERT(!inlineChildrenBlock->continuation()); |
| 1139 RefPtr<ComputedStyle> newStyle = ComputedStyle::createAnonymousStyle WithDisplay(styleRef(), BLOCK); | |
| 1140 // Cache this value as it might get changed in setStyle() call. | |
| 1141 bool inlineChildrenBlockHasLayer = inlineChildrenBlock->hasLayer(); | 1136 bool inlineChildrenBlockHasLayer = inlineChildrenBlock->hasLayer(); |
|
dsinclair
2015/06/04 16:35:57
Do we still need this intermediary, we aren't call
mstensho (USE GERRIT)
2015/06/04 16:43:40
Don't really need it, but it's used further below
| |
| 1142 inlineChildrenBlock->setStyle(newStyle); | |
| 1143 children()->removeChildNode(this, inlineChildrenBlock, inlineChildre nBlockHasLayer); | 1137 children()->removeChildNode(this, inlineChildrenBlock, inlineChildre nBlockHasLayer); |
| 1144 | 1138 |
| 1145 // Now just put the inlineChildrenBlock inside the blockChildrenBloc k. | 1139 // Now just put the inlineChildrenBlock inside the blockChildrenBloc k. |
| 1146 blockChildrenBlock->children()->insertChildNode(blockChildrenBlock, inlineChildrenBlock, prev == inlineChildrenBlock ? blockChildrenBlock->firstChil d() : 0, | 1140 blockChildrenBlock->children()->insertChildNode(blockChildrenBlock, inlineChildrenBlock, prev == inlineChildrenBlock ? blockChildrenBlock->firstChil d() : 0, |
| 1147 inlineChildrenBlockHasLayer || blockChildrenBlock->hasLayer()); | 1141 inlineChildrenBlockHasLayer || blockChildrenBlock->hasLayer()); |
| 1148 next->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(Layo utInvalidationReason::AnonymousBlockChange); | 1142 next->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(Layo utInvalidationReason::AnonymousBlockChange); |
| 1149 | 1143 |
| 1150 // inlineChildrenBlock got reparented to blockChildrenBlock, so it i s no longer a child | 1144 // inlineChildrenBlock got reparented to blockChildrenBlock, so it i s no longer a child |
| 1151 // of "this". we null out prev or next so that is not used later in the function. | 1145 // of "this". we null out prev or next so that is not used later in the function. |
| 1152 if (inlineChildrenBlock == prevBlock) | 1146 if (inlineChildrenBlock == prevBlock) |
| (...skipping 2229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3382 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout Object* obj) const | 3376 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout Object* obj) const |
| 3383 { | 3377 { |
| 3384 showLayoutObject(); | 3378 showLayoutObject(); |
| 3385 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) | 3379 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) |
| 3386 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); | 3380 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); |
| 3387 } | 3381 } |
| 3388 | 3382 |
| 3389 #endif | 3383 #endif |
| 3390 | 3384 |
| 3391 } // namespace blink | 3385 } // namespace blink |
| OLD | NEW |