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 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
860 RenderBoxModelObject* oldContinuation = continuation(); | 860 RenderBoxModelObject* oldContinuation = continuation(); |
861 | 861 |
862 // When we split an anonymous block, there's no need to do any conti
nuation hookup, | 862 // When we split an anonymous block, there's no need to do any conti
nuation hookup, |
863 // since we haven't actually split a real element. | 863 // since we haven't actually split a real element. |
864 if (!isAnonymousBlock()) | 864 if (!isAnonymousBlock()) |
865 setContinuation(newBox); | 865 setContinuation(newBox); |
866 | 866 |
867 // Someone may have put a <p> inside a <q>, causing a split. When t
his happens, the :after content | 867 // Someone may have put a <p> inside a <q>, causing a split. When t
his happens, the :after content |
868 // has to move into the inline continuation. Call updateBeforeAfter
Content to ensure that our :after | 868 // has to move into the inline continuation. Call updateBeforeAfter
Content to ensure that our :after |
869 // content gets properly destroyed. | 869 // content gets properly destroyed. |
| 870 bool isFirstChild = (beforeChild == firstChild()); |
870 bool isLastChild = (beforeChild == lastChild()); | 871 bool isLastChild = (beforeChild == lastChild()); |
871 if (document()->usesBeforeAfterRules()) | 872 if (document()->usesBeforeAfterRules()) |
872 children()->updateBeforeAfterContent(this, AFTER); | 873 children()->updateBeforeAfterContent(this, AFTER); |
873 if (isLastChild && beforeChild != lastChild()) | 874 if (isLastChild && beforeChild != lastChild()) { |
874 beforeChild = 0; // We destroyed the last child, so now we need
to update our insertion | 875 // We destroyed the last child, so now we need to update our ins
ertion |
875 // point to be 0. It's just a straight append
now. | 876 // point to be 0. It's just a straight append now. |
| 877 beforeChild = 0; |
| 878 } else if (isFirstChild && beforeChild != firstChild()) { |
| 879 // If beforeChild was the last anonymous block that collapsed, |
| 880 // then we need to update its value. |
| 881 beforeChild = firstChild(); |
| 882 } |
876 | 883 |
877 splitFlow(beforeChild, newBox, newChild, oldContinuation); | 884 splitFlow(beforeChild, newBox, newChild, oldContinuation); |
878 return; | 885 return; |
879 } | 886 } |
880 | 887 |
881 // We have to perform a split of this block's children. This involves c
reating an anonymous block box to hold | 888 // We have to perform a split of this block's children. This involves c
reating an anonymous block box to hold |
882 // the column-spanning |newChild|. We take all of the children from bef
ore |newChild| and put them into | 889 // the column-spanning |newChild|. We take all of the children from bef
ore |newChild| and put them into |
883 // one anonymous columns block, and all of the children after |newChild|
go into another anonymous block. | 890 // one anonymous columns block, and all of the children after |newChild|
go into another anonymous block. |
884 makeChildrenAnonymousColumnBlocks(beforeChild, newBox, newChild); | 891 makeChildrenAnonymousColumnBlocks(beforeChild, newBox, newChild); |
885 return; | 892 return; |
(...skipping 6350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7236 } | 7243 } |
7237 | 7244 |
7238 String ValueToString<RenderBlock::FloatingObject*>::string(const RenderBlock::Fl
oatingObject* floatingObject) | 7245 String ValueToString<RenderBlock::FloatingObject*>::string(const RenderBlock::Fl
oatingObject* floatingObject) |
7239 { | 7246 { |
7240 return String::format("%p (%dx%d %dx%d)", floatingObject, floatingObject->x(
), floatingObject->y(), floatingObject->maxX(), floatingObject->maxY()); | 7247 return String::format("%p (%dx%d %dx%d)", floatingObject, floatingObject->x(
), floatingObject->y(), floatingObject->maxX(), floatingObject->maxY()); |
7241 } | 7248 } |
7242 | 7249 |
7243 #endif | 7250 #endif |
7244 | 7251 |
7245 } // namespace WebCore | 7252 } // namespace WebCore |
OLD | NEW |