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

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

Issue 9566037: Merge 109142 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/963/
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 828 matching lines...) Expand 10 before | Expand all | Expand 10 after
839 // Check for a spanning element in columns. 839 // Check for a spanning element in columns.
840 RenderBlock* columnsBlockAncestor = columnsBlockForSpanningElement(newChild) ; 840 RenderBlock* columnsBlockAncestor = columnsBlockForSpanningElement(newChild) ;
841 if (columnsBlockAncestor) { 841 if (columnsBlockAncestor) {
842 // We are placing a column-span element inside a block. 842 // We are placing a column-span element inside a block.
843 RenderBlock* newBox = createAnonymousColumnSpanBlock(); 843 RenderBlock* newBox = createAnonymousColumnSpanBlock();
844 844
845 if (columnsBlockAncestor != this) { 845 if (columnsBlockAncestor != this) {
846 // We are nested inside a multi-column element and are being split b y the span. We have to break up 846 // We are nested inside a multi-column element and are being split b y the span. We have to break up
847 // our block into continuations. 847 // our block into continuations.
848 RenderBoxModelObject* oldContinuation = continuation(); 848 RenderBoxModelObject* oldContinuation = continuation();
849 setContinuation(newBox); 849
850 // When we split an anonymous block, there's no need to do any conti nuation hookup,
851 // since we haven't actually split a real element.
852 if (!isAnonymousBlock())
853 setContinuation(newBox);
850 854
851 // Someone may have put a <p> inside a <q>, causing a split. When t his happens, the :after content 855 // Someone may have put a <p> inside a <q>, causing a split. When t his happens, the :after content
852 // has to move into the inline continuation. Call updateBeforeAfter Content to ensure that our :after 856 // has to move into the inline continuation. Call updateBeforeAfter Content to ensure that our :after
853 // content gets properly destroyed. 857 // content gets properly destroyed.
854 bool isLastChild = (beforeChild == lastChild()); 858 bool isLastChild = (beforeChild == lastChild());
855 if (document()->usesBeforeAfterRules()) 859 if (document()->usesBeforeAfterRules())
856 children()->updateBeforeAfterContent(this, AFTER); 860 children()->updateBeforeAfterContent(this, AFTER);
857 if (isLastChild && beforeChild != lastChild()) 861 if (isLastChild && beforeChild != lastChild())
858 beforeChild = 0; // We destroyed the last child, so now we need to update our insertion 862 beforeChild = 0; // We destroyed the last child, so now we need to update our insertion
859 // point to be 0. It's just a straight append now. 863 // point to be 0. It's just a straight append now.
(...skipping 864 matching lines...) Expand 10 before | Expand all | Expand 10 after
1724 1728
1725 bool RenderBlock::handleRunInChild(RenderBox* child) 1729 bool RenderBlock::handleRunInChild(RenderBox* child)
1726 { 1730 {
1727 // See if we have a run-in element with inline children. If the 1731 // See if we have a run-in element with inline children. If the
1728 // children aren't inline, then just treat the run-in as a normal 1732 // children aren't inline, then just treat the run-in as a normal
1729 // block. 1733 // block.
1730 if (!child->isRunIn() || !child->childrenInline()) 1734 if (!child->isRunIn() || !child->childrenInline())
1731 return false; 1735 return false;
1732 // FIXME: We don't handle non-block elements with run-in for now. 1736 // FIXME: We don't handle non-block elements with run-in for now.
1733 if (!child->isRenderBlock()) 1737 if (!child->isRenderBlock())
1738 return false;
1739 // Run-in child shouldn't intrude into the sibling block if it is part of a
1740 // continuation chain. In that case, treat it as a normal block.
1741 if (child->isElementContinuation() || child->virtualContinuation())
1734 return false; 1742 return false;
1735 1743
1736 RenderBlock* blockRunIn = toRenderBlock(child); 1744 RenderBlock* blockRunIn = toRenderBlock(child);
1737 RenderObject* curr = blockRunIn->nextSibling(); 1745 RenderObject* curr = blockRunIn->nextSibling();
1738 if (!curr || !curr->isRenderBlock() || !curr->childrenInline() || curr->isRu nIn() || curr->isAnonymous() || curr->isFloatingOrPositioned()) 1746 if (!curr || !curr->isRenderBlock() || !curr->childrenInline() || curr->isRu nIn() || curr->isAnonymous() || curr->isFloatingOrPositioned())
1739 return false; 1747 return false;
1740 1748
1741 RenderBlock* currBlock = toRenderBlock(curr); 1749 RenderBlock* currBlock = toRenderBlock(curr);
1742 1750
1743 // First we destroy any :before/:after content. It will be regenerated by th e new inline. 1751 // First we destroy any :before/:after content. It will be regenerated by th e new inline.
(...skipping 5443 matching lines...) Expand 10 before | Expand all | Expand 10 after
7187 } 7195 }
7188 7196
7189 String ValueToString<RenderBlock::FloatingObject*>::string(const RenderBlock::Fl oatingObject* floatingObject) 7197 String ValueToString<RenderBlock::FloatingObject*>::string(const RenderBlock::Fl oatingObject* floatingObject)
7190 { 7198 {
7191 return String::format("%p (%dx%d %dx%d)", floatingObject, floatingObject->x( ), floatingObject->y(), floatingObject->maxX(), floatingObject->maxY()); 7199 return String::format("%p (%dx%d %dx%d)", floatingObject, floatingObject->x( ), floatingObject->y(), floatingObject->maxX(), floatingObject->maxY());
7192 } 7200 }
7193 7201
7194 #endif 7202 #endif
7195 7203
7196 } // namespace WebCore 7204 } // 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