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

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

Issue 9570043: Merge 109142 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1025/
Patch Set: Created 8 years, 9 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
« no previous file with comments | « LayoutTests/fast/multicol/span/runin-continuation-crash-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 834 matching lines...) Expand 10 before | Expand all | Expand 10 after
845 // Check for a spanning element in columns. 845 // Check for a spanning element in columns.
846 RenderBlock* columnsBlockAncestor = columnsBlockForSpanningElement(newChild) ; 846 RenderBlock* columnsBlockAncestor = columnsBlockForSpanningElement(newChild) ;
847 if (columnsBlockAncestor) { 847 if (columnsBlockAncestor) {
848 // We are placing a column-span element inside a block. 848 // We are placing a column-span element inside a block.
849 RenderBlock* newBox = createAnonymousColumnSpanBlock(); 849 RenderBlock* newBox = createAnonymousColumnSpanBlock();
850 850
851 if (columnsBlockAncestor != this) { 851 if (columnsBlockAncestor != this) {
852 // We are nested inside a multi-column element and are being split b y the span. We have to break up 852 // We are nested inside a multi-column element and are being split b y the span. We have to break up
853 // our block into continuations. 853 // our block into continuations.
854 RenderBoxModelObject* oldContinuation = continuation(); 854 RenderBoxModelObject* oldContinuation = continuation();
855 setContinuation(newBox); 855
856 // When we split an anonymous block, there's no need to do any conti nuation hookup,
857 // since we haven't actually split a real element.
858 if (!isAnonymousBlock())
859 setContinuation(newBox);
856 860
857 // Someone may have put a <p> inside a <q>, causing a split. When t his happens, the :after content 861 // Someone may have put a <p> inside a <q>, causing a split. When t his happens, the :after content
858 // has to move into the inline continuation. Call updateBeforeAfter Content to ensure that our :after 862 // has to move into the inline continuation. Call updateBeforeAfter Content to ensure that our :after
859 // content gets properly destroyed. 863 // content gets properly destroyed.
860 bool isLastChild = (beforeChild == lastChild()); 864 bool isLastChild = (beforeChild == lastChild());
861 if (document()->usesBeforeAfterRules()) 865 if (document()->usesBeforeAfterRules())
862 children()->updateBeforeAfterContent(this, AFTER); 866 children()->updateBeforeAfterContent(this, AFTER);
863 if (isLastChild && beforeChild != lastChild()) 867 if (isLastChild && beforeChild != lastChild())
864 beforeChild = 0; // We destroyed the last child, so now we need to update our insertion 868 beforeChild = 0; // We destroyed the last child, so now we need to update our insertion
865 // point to be 0. It's just a straight append now. 869 // point to be 0. It's just a straight append now.
(...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after
1750 1754
1751 bool RenderBlock::handleRunInChild(RenderBox* child) 1755 bool RenderBlock::handleRunInChild(RenderBox* child)
1752 { 1756 {
1753 // See if we have a run-in element with inline children. If the 1757 // See if we have a run-in element with inline children. If the
1754 // children aren't inline, then just treat the run-in as a normal 1758 // children aren't inline, then just treat the run-in as a normal
1755 // block. 1759 // block.
1756 if (!child->isRunIn() || !child->childrenInline()) 1760 if (!child->isRunIn() || !child->childrenInline())
1757 return false; 1761 return false;
1758 // FIXME: We don't handle non-block elements with run-in for now. 1762 // FIXME: We don't handle non-block elements with run-in for now.
1759 if (!child->isRenderBlock()) 1763 if (!child->isRenderBlock())
1764 return false;
1765 // Run-in child shouldn't intrude into the sibling block if it is part of a
1766 // continuation chain. In that case, treat it as a normal block.
1767 if (child->isElementContinuation() || child->virtualContinuation())
1760 return false; 1768 return false;
1761 1769
1762 RenderBlock* blockRunIn = toRenderBlock(child); 1770 RenderBlock* blockRunIn = toRenderBlock(child);
1763 RenderObject* curr = blockRunIn->nextSibling(); 1771 RenderObject* curr = blockRunIn->nextSibling();
1764 if (!curr || !curr->isRenderBlock() || !curr->childrenInline() || curr->isRu nIn() || curr->isAnonymous() || curr->isFloatingOrPositioned()) 1772 if (!curr || !curr->isRenderBlock() || !curr->childrenInline() || curr->isRu nIn() || curr->isAnonymous() || curr->isFloatingOrPositioned())
1765 return false; 1773 return false;
1766 1774
1767 RenderBlock* currBlock = toRenderBlock(curr); 1775 RenderBlock* currBlock = toRenderBlock(curr);
1768 1776
1769 // First we destroy any :before/:after content. It will be regenerated by th e new inline. 1777 // First we destroy any :before/:after content. It will be regenerated by th e new inline.
(...skipping 5448 matching lines...) Expand 10 before | Expand all | Expand 10 after
7218 } 7226 }
7219 7227
7220 String ValueToString<RenderBlock::FloatingObject*>::string(const RenderBlock::Fl oatingObject* floatingObject) 7228 String ValueToString<RenderBlock::FloatingObject*>::string(const RenderBlock::Fl oatingObject* floatingObject)
7221 { 7229 {
7222 return String::format("%p (%dx%d %dx%d)", floatingObject, floatingObject->x( ), floatingObject->y(), floatingObject->maxX(), floatingObject->maxY()); 7230 return String::format("%p (%dx%d %dx%d)", floatingObject, floatingObject->x( ), floatingObject->y(), floatingObject->maxX(), floatingObject->maxY());
7223 } 7231 }
7224 7232
7225 #endif 7233 #endif
7226 7234
7227 } // namespace WebCore 7235 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/multicol/span/runin-continuation-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698