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

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

Issue 1997033002: Move continuation getter and setter down to LayoutBlockFlow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 6 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) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2009 Google Inc. All rights reserved. 7 * Copyright (C) 2009 Google Inc. All rights reserved.
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 2123 matching lines...) Expand 10 before | Expand all | Expand 10 after
2134 if (!child->isAnonymous() || child->style()->styleType() != PseudoIdNone ) 2134 if (!child->isAnonymous() || child->style()->styleType() != PseudoIdNone )
2135 continue; 2135 continue;
2136 2136
2137 if (child->anonymousHasStylePropagationOverride()) 2137 if (child->anonymousHasStylePropagationOverride())
2138 continue; 2138 continue;
2139 2139
2140 RefPtr<ComputedStyle> newStyle = ComputedStyle::createAnonymousStyleWith Display(styleRef(), child->style()->display()); 2140 RefPtr<ComputedStyle> newStyle = ComputedStyle::createAnonymousStyleWith Display(styleRef(), child->style()->display());
2141 2141
2142 // Preserve the position style of anonymous block continuations as they can have relative position when 2142 // Preserve the position style of anonymous block continuations as they can have relative position when
2143 // they contain block descendants of relative positioned inlines. 2143 // they contain block descendants of relative positioned inlines.
2144 if (child->isInFlowPositioned() && child->isLayoutBlock() && toLayoutBlo ck(child)->isAnonymousBlockContinuation()) 2144 if (child->isInFlowPositioned() && child->isLayoutBlockFlow() && toLayou tBlockFlow(child)->isAnonymousBlockContinuation())
2145 newStyle->setPosition(child->style()->position()); 2145 newStyle->setPosition(child->style()->position());
2146 2146
2147 updateAnonymousChildStyle(*child, *newStyle); 2147 updateAnonymousChildStyle(*child, *newStyle);
2148 2148
2149 child->setStyle(newStyle.release()); 2149 child->setStyle(newStyle.release());
2150 } 2150 }
2151 } 2151 }
2152 2152
2153 void LayoutObject::setStyleWithWritingModeOfParent(PassRefPtr<ComputedStyle> sty le) 2153 void LayoutObject::setStyleWithWritingModeOfParent(PassRefPtr<ComputedStyle> sty le)
2154 { 2154 {
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after
2858 { 2858 {
2859 // If the tree is destroyed, there is no need for a clean-up phase. 2859 // If the tree is destroyed, there is no need for a clean-up phase.
2860 if (documentBeingDestroyed()) { 2860 if (documentBeingDestroyed()) {
2861 destroy(); 2861 destroy();
2862 return; 2862 return;
2863 } 2863 }
2864 2864
2865 LayoutObject* destroyRoot = this; 2865 LayoutObject* destroyRoot = this;
2866 for (LayoutObject* destroyRootParent = destroyRoot->parent(); destroyRootPar ent && destroyRootParent->isAnonymous(); destroyRoot = destroyRootParent, destro yRootParent = destroyRootParent->parent()) { 2866 for (LayoutObject* destroyRootParent = destroyRoot->parent(); destroyRootPar ent && destroyRootParent->isAnonymous(); destroyRoot = destroyRootParent, destro yRootParent = destroyRootParent->parent()) {
2867 // Anonymous block continuations are tracked and destroyed elsewhere (se e the bottom of LayoutBlock::removeChild) 2867 // Anonymous block continuations are tracked and destroyed elsewhere (se e the bottom of LayoutBlock::removeChild)
2868 if (destroyRootParent->isLayoutBlock() && toLayoutBlock(destroyRootParen t)->isAnonymousBlockContinuation()) 2868 if (destroyRootParent->isLayoutBlockFlow() && toLayoutBlockFlow(destroyR ootParent)->isAnonymousBlockContinuation())
2869 break; 2869 break;
2870 // A flow thread is tracked by its containing block. Whether its childre n are removed or not is irrelevant. 2870 // A flow thread is tracked by its containing block. Whether its childre n are removed or not is irrelevant.
2871 if (destroyRootParent->isLayoutFlowThread()) 2871 if (destroyRootParent->isLayoutFlowThread())
2872 break; 2872 break;
2873 2873
2874 if (destroyRootParent->slowFirstChild() != destroyRoot || destroyRootPar ent->slowLastChild() != destroyRoot) 2874 if (destroyRootParent->slowFirstChild() != destroyRoot || destroyRootPar ent->slowLastChild() != destroyRoot)
2875 break; // Need to keep the anonymous parent, since it won't become e mpty by the removal of this layoutObject. 2875 break; // Need to keep the anonymous parent, since it won't become e mpty by the removal of this layoutObject.
2876 } 2876 }
2877 2877
2878 destroyRoot->destroy(); 2878 destroyRoot->destroy();
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
3136 } 3136 }
3137 if (currDecs & TextDecorationLineThrough) { 3137 if (currDecs & TextDecorationLineThrough) {
3138 decorations &= ~TextDecorationLineThrough; 3138 decorations &= ~TextDecorationLineThrough;
3139 linethrough.color = resultColor; 3139 linethrough.color = resultColor;
3140 linethrough.style = resultStyle; 3140 linethrough.style = resultStyle;
3141 } 3141 }
3142 } 3142 }
3143 if (curr->isRubyText()) 3143 if (curr->isRubyText())
3144 return; 3144 return;
3145 curr = curr->parent(); 3145 curr = curr->parent();
3146 if (curr && curr->isAnonymousBlock() && toLayoutBlock(curr)->continuatio n()) 3146 if (curr && curr->isAnonymousBlock() && curr->isLayoutBlockFlow() && toL ayoutBlockFlow(curr)->continuation())
3147 curr = toLayoutBlock(curr)->continuation(); 3147 curr = toLayoutBlockFlow(curr)->continuation();
3148 } while (curr && decorations && (!quirksMode || !curr->node() || (!isHTMLAnc horElement(*curr->node()) && !isHTMLFontElement(*curr->node())))); 3148 } while (curr && decorations && (!quirksMode || !curr->node() || (!isHTMLAnc horElement(*curr->node()) && !isHTMLFontElement(*curr->node()))));
3149 3149
3150 // If we bailed out, use the element we bailed out at (typically a <font> or <a> element). 3150 // If we bailed out, use the element we bailed out at (typically a <font> or <a> element).
3151 if (decorations && curr) { 3151 if (decorations && curr) {
3152 styleToUse = curr->style(firstlineStyle); 3152 styleToUse = curr->style(firstlineStyle);
3153 resultColor = styleToUse->visitedDependentColor(CSSPropertyTextDecoratio nColor); 3153 resultColor = styleToUse->visitedDependentColor(CSSPropertyTextDecoratio nColor);
3154 if (decorations & TextDecorationUnderline) { 3154 if (decorations & TextDecorationUnderline) {
3155 underline.color = resultColor; 3155 underline.color = resultColor;
3156 underline.style = resultStyle; 3156 underline.style = resultStyle;
3157 } 3157 }
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
3700 const blink::LayoutObject* root = object1; 3700 const blink::LayoutObject* root = object1;
3701 while (root->parent()) 3701 while (root->parent())
3702 root = root->parent(); 3702 root = root->parent();
3703 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3703 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3704 } else { 3704 } else {
3705 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); 3705 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n");
3706 } 3706 }
3707 } 3707 }
3708 3708
3709 #endif 3709 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698