Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Side by Side Diff: Source/WebCore/rendering/RenderBlock.cpp

Issue 10383285: Merge 116174 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1084/
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1125 matching lines...) Expand 10 before | Expand all | Expand 10 after
1136 1136
1137 if (prev->childrenInline() != next->childrenInline()) { 1137 if (prev->childrenInline() != next->childrenInline()) {
1138 RenderBlock* inlineChildrenBlock = prev->childrenInline() ? prevBloc k : nextBlock; 1138 RenderBlock* inlineChildrenBlock = prev->childrenInline() ? prevBloc k : nextBlock;
1139 RenderBlock* blockChildrenBlock = prev->childrenInline() ? nextBlock : prevBlock; 1139 RenderBlock* blockChildrenBlock = prev->childrenInline() ? nextBlock : prevBlock;
1140 1140
1141 // Place the inline children block inside of the block children bloc k instead of deleting it. 1141 // Place the inline children block inside of the block children bloc k instead of deleting it.
1142 // In order to reuse it, we have to reset it to just be a generic an onymous block. Make sure 1142 // In order to reuse it, we have to reset it to just be a generic an onymous block. Make sure
1143 // to clear out inherited column properties by just making a new sty le, and to also clear the 1143 // to clear out inherited column properties by just making a new sty le, and to also clear the
1144 // column span flag if it is set. 1144 // column span flag if it is set.
1145 ASSERT(!inlineChildrenBlock->continuation()); 1145 ASSERT(!inlineChildrenBlock->continuation());
1146 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyle(sty le()); 1146 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWith Display(style(), BLOCK);
1147 children()->removeChildNode(this, inlineChildrenBlock, inlineChildre nBlock->hasLayer()); 1147 children()->removeChildNode(this, inlineChildrenBlock, inlineChildre nBlock->hasLayer());
1148 inlineChildrenBlock->setStyle(newStyle); 1148 inlineChildrenBlock->setStyle(newStyle);
1149 1149
1150 // Now just put the inlineChildrenBlock inside the blockChildrenBloc k. 1150 // Now just put the inlineChildrenBlock inside the blockChildrenBloc k.
1151 blockChildrenBlock->children()->insertChildNode(blockChildrenBlock, inlineChildrenBlock, prev == inlineChildrenBlock ? blockChildrenBlock->firstChil d() : 0, 1151 blockChildrenBlock->children()->insertChildNode(blockChildrenBlock, inlineChildrenBlock, prev == inlineChildrenBlock ? blockChildrenBlock->firstChil d() : 0,
1152 inlineChildrenBlock- >hasLayer() || blockChildrenBlock->hasLayer()); 1152 inlineChildrenBlock- >hasLayer() || blockChildrenBlock->hasLayer());
1153 next->setNeedsLayoutAndPrefWidthsRecalc(); 1153 next->setNeedsLayoutAndPrefWidthsRecalc();
1154 1154
1155 // inlineChildrenBlock got reparented to blockChildrenBlock, so it i s no longer a child 1155 // inlineChildrenBlock got reparented to blockChildrenBlock, so it i s no longer a child
1156 // of "this". we null out prev or next so that is not used later in the function. 1156 // of "this". we null out prev or next so that is not used later in the function.
(...skipping 6110 matching lines...) Expand 10 before | Expand all | Expand 10 after
7267 return run; 7267 return run;
7268 } 7268 }
7269 7269
7270 TextRun RenderBlock::constructTextRun(RenderObject* context, const Font& font, c onst String& string, RenderStyle* style, TextRun::ExpansionBehavior expansion, T extRunFlags flags) 7270 TextRun RenderBlock::constructTextRun(RenderObject* context, const Font& font, c onst String& string, RenderStyle* style, TextRun::ExpansionBehavior expansion, T extRunFlags flags)
7271 { 7271 {
7272 return constructTextRun(context, font, string.characters(), string.length(), style, expansion, flags); 7272 return constructTextRun(context, font, string.characters(), string.length(), style, expansion, flags);
7273 } 7273 }
7274 7274
7275 RenderBlock* RenderBlock::createAnonymousWithParentRendererAndDisplay(const Rend erObject* parent, EDisplay display) 7275 RenderBlock* RenderBlock::createAnonymousWithParentRendererAndDisplay(const Rend erObject* parent, EDisplay display)
7276 { 7276 {
7277 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyle(parent->sty le());
7278
7279 // FIXME: Do we need to cover the new flex box here ? 7277 // FIXME: Do we need to cover the new flex box here ?
7280 // FIXME: Do we need to convert all our inline displays to block-type in the anonymous logic ? 7278 // FIXME: Do we need to convert all our inline displays to block-type in the anonymous logic ?
7279 EDisplay newDisplay;
7281 RenderBlock* newBox = 0; 7280 RenderBlock* newBox = 0;
7282 if (display == BOX || display == INLINE_BOX) { 7281 if (display == BOX || display == INLINE_BOX) {
7283 newStyle->setDisplay(BOX);
7284 newBox = new (parent->renderArena()) RenderDeprecatedFlexibleBox(parent- >document() /* anonymous box */); 7282 newBox = new (parent->renderArena()) RenderDeprecatedFlexibleBox(parent- >document() /* anonymous box */);
7283 newDisplay = BOX;
7285 } else { 7284 } else {
7286 newStyle->setDisplay(BLOCK);
7287 newBox = new (parent->renderArena()) RenderBlock(parent->document() /* a nonymous box */); 7285 newBox = new (parent->renderArena()) RenderBlock(parent->document() /* a nonymous box */);
7286 newDisplay = BLOCK;
7288 } 7287 }
7289 7288
7289 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay( parent->style(), newDisplay);
7290 newBox->setStyle(newStyle.release()); 7290 newBox->setStyle(newStyle.release());
7291 return newBox; 7291 return newBox;
7292 } 7292 }
7293 7293
7294 RenderBlock* RenderBlock::createAnonymousColumnsWithParentRenderer(const RenderO bject* parent) 7294 RenderBlock* RenderBlock::createAnonymousColumnsWithParentRenderer(const RenderO bject* parent)
7295 { 7295 {
7296 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyle(parent->sty le()); 7296 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay( parent->style(), BLOCK);
7297 newStyle->inheritColumnPropertiesFrom(parent->style()); 7297 newStyle->inheritColumnPropertiesFrom(parent->style());
7298 newStyle->setDisplay(BLOCK);
7299 7298
7300 RenderBlock* newBox = new (parent->renderArena()) RenderBlock(parent->docume nt() /* anonymous box */); 7299 RenderBlock* newBox = new (parent->renderArena()) RenderBlock(parent->docume nt() /* anonymous box */);
7301 newBox->setStyle(newStyle.release()); 7300 newBox->setStyle(newStyle.release());
7302 return newBox; 7301 return newBox;
7303 } 7302 }
7304 7303
7305 RenderBlock* RenderBlock::createAnonymousColumnSpanWithParentRenderer(const Rend erObject* parent) 7304 RenderBlock* RenderBlock::createAnonymousColumnSpanWithParentRenderer(const Rend erObject* parent)
7306 { 7305 {
7307 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyle(parent->sty le()); 7306 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay( parent->style(), BLOCK);
7308 newStyle->setColumnSpan(ColumnSpanAll); 7307 newStyle->setColumnSpan(ColumnSpanAll);
7309 newStyle->setDisplay(BLOCK);
7310 7308
7311 RenderBlock* newBox = new (parent->renderArena()) RenderBlock(parent->docume nt() /* anonymous box */); 7309 RenderBlock* newBox = new (parent->renderArena()) RenderBlock(parent->docume nt() /* anonymous box */);
7312 newBox->setStyle(newStyle.release()); 7310 newBox->setStyle(newStyle.release());
7313 return newBox; 7311 return newBox;
7314 } 7312 }
7315 7313
7316 #ifndef NDEBUG 7314 #ifndef NDEBUG
7317 7315
7318 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const 7316 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const
7319 { 7317 {
7320 showRenderObject(); 7318 showRenderObject();
7321 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) 7319 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box())
7322 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); 7320 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1);
7323 } 7321 }
7324 7322
7325 // These helpers are only used by the PODIntervalTree for debugging purposes. 7323 // These helpers are only used by the PODIntervalTree for debugging purposes.
7326 String ValueToString<int>::string(const int value) 7324 String ValueToString<int>::string(const int value)
7327 { 7325 {
7328 return String::number(value); 7326 return String::number(value);
7329 } 7327 }
7330 7328
7331 String ValueToString<RenderBlock::FloatingObject*>::string(const RenderBlock::Fl oatingObject* floatingObject) 7329 String ValueToString<RenderBlock::FloatingObject*>::string(const RenderBlock::Fl oatingObject* floatingObject)
7332 { 7330 {
7333 return String::format("%p (%dx%d %dx%d)", floatingObject, floatingObject->x( ), floatingObject->y(), floatingObject->maxX(), floatingObject->maxY()); 7331 return String::format("%p (%dx%d %dx%d)", floatingObject, floatingObject->x( ), floatingObject->y(), floatingObject->maxX(), floatingObject->maxY());
7334 } 7332 }
7335 7333
7336 #endif 7334 #endif
7337 7335
7338 } // namespace WebCore 7336 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/block/block-add-child-crash-expected.txt ('k') | Source/WebCore/rendering/RenderInline.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698