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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutBlock.cpp

Issue 1778483002: Remove special-code for removing anonymous blocks around pseudo elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase master Created 4 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 | « no previous file | 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 725 matching lines...) Expand 10 before | Expand all | Expand 10 after
736 } 736 }
737 737
738 LayoutBox::removeChild(oldChild); 738 LayoutBox::removeChild(oldChild);
739 739
740 LayoutObject* child = prev ? prev : next; 740 LayoutObject* child = prev ? prev : next;
741 if (canMergeAnonymousBlocks && child && !child->previousSibling() && !child- >nextSibling() && canCollapseAnonymousBlockChild()) { 741 if (canMergeAnonymousBlocks && child && !child->previousSibling() && !child- >nextSibling() && canCollapseAnonymousBlockChild()) {
742 // The removal has knocked us down to containing only a single anonymous 742 // The removal has knocked us down to containing only a single anonymous
743 // box. We can go ahead and pull the content right back up into our 743 // box. We can go ahead and pull the content right back up into our
744 // box. 744 // box.
745 collapseAnonymousBlockChild(this, toLayoutBlock(child)); 745 collapseAnonymousBlockChild(this, toLayoutBlock(child));
746 } else if (((prev && prev->isAnonymousBlock()) || (next && next->isAnonymous Block())) && canCollapseAnonymousBlockChild()) {
747 // It's possible that the removal has knocked us down to a single anonym ous
748 // block with pseudo-style element siblings (e.g. first-letter). If thes e
749 // are floating, then we need to pull the content up also.
750 LayoutBlock* anonymousBlock = toLayoutBlock((prev && prev->isAnonymousBl ock()) ? prev : next);
751 if ((anonymousBlock->previousSibling() || anonymousBlock->nextSibling())
752 && (!anonymousBlock->previousSibling() || (anonymousBlock->previousS ibling()->style()->styleType() != PseudoIdNone && anonymousBlock->previousSiblin g()->isFloating() && !anonymousBlock->previousSibling()->previousSibling()))
753 && (!anonymousBlock->nextSibling() || (anonymousBlock->nextSibling() ->style()->styleType() != PseudoIdNone && anonymousBlock->nextSibling()->isFloat ing() && !anonymousBlock->nextSibling()->nextSibling()))) {
754 collapseAnonymousBlockChild(this, anonymousBlock);
755 }
756 } 746 }
757 747
758 if (!firstChild()) { 748 if (!firstChild()) {
759 // If this was our last child be sure to clear out our line boxes. 749 // If this was our last child be sure to clear out our line boxes.
760 if (childrenInline()) 750 if (childrenInline())
761 deleteLineBoxTree(); 751 deleteLineBoxTree();
762 752
763 // If we are an empty anonymous block in the continuation chain, 753 // If we are an empty anonymous block in the continuation chain,
764 // we need to remove ourself and fix the continuation chain. 754 // we need to remove ourself and fix the continuation chain.
765 if (!beingDestroyed() && isAnonymousBlockContinuation() && !oldChild->is ListMarker()) { 755 if (!beingDestroyed() && isAnonymousBlockContinuation() && !oldChild->is ListMarker()) {
(...skipping 2099 matching lines...) Expand 10 before | Expand all | Expand 10 after
2865 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout Object* obj) const 2855 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout Object* obj) const
2866 { 2856 {
2867 showLayoutObject(); 2857 showLayoutObject();
2868 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) 2858 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box())
2869 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); 2859 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1);
2870 } 2860 }
2871 2861
2872 #endif 2862 #endif
2873 2863
2874 } // namespace blink 2864 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698