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

Side by Side Diff: sky/engine/core/rendering/RenderObject.cpp

Issue 734813004: Get rid of continuations. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 | « sky/engine/core/rendering/RenderObject.h ('k') | sky/engine/core/rendering/style/RenderStyle.h » ('j') | 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) 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 1845 matching lines...) Expand 10 before | Expand all | Expand 10 after
1856 { 1856 {
1857 // FIXME: We could save this call when the change only affected non-inherite d properties. 1857 // FIXME: We could save this call when the change only affected non-inherite d properties.
1858 for (RenderObject* child = slowFirstChild(); child; child = child->nextSibli ng()) { 1858 for (RenderObject* child = slowFirstChild(); child; child = child->nextSibli ng()) {
1859 if (!child->isAnonymous() || child->style()->styleType() != NOPSEUDO) 1859 if (!child->isAnonymous() || child->style()->styleType() != NOPSEUDO)
1860 continue; 1860 continue;
1861 1861
1862 if (blockChildrenOnly && !child->isRenderBlock()) 1862 if (blockChildrenOnly && !child->isRenderBlock())
1863 continue; 1863 continue;
1864 1864
1865 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisp lay(style(), child->style()->display()); 1865 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisp lay(style(), child->style()->display());
1866
1867 // Preserve the position style of anonymous block continuations as they can have relative position when
1868 // they contain block descendants of relative positioned inlines.
1869 if (child->isRelPositioned() && toRenderBlock(child)->isAnonymousBlockCo ntinuation())
1870 newStyle->setPosition(child->style()->position());
1871
1872 updateAnonymousChildStyle(child, newStyle.get()); 1866 updateAnonymousChildStyle(child, newStyle.get());
1873
1874 child->setStyle(newStyle.release()); 1867 child->setStyle(newStyle.release());
1875 } 1868 }
1876 } 1869 }
1877 1870
1878 void RenderObject::updateFillImages(const FillLayer* oldLayers, const FillLayer& newLayers) 1871 void RenderObject::updateFillImages(const FillLayer* oldLayers, const FillLayer& newLayers)
1879 { 1872 {
1880 // Optimize the common case 1873 // Optimize the common case
1881 if (oldLayers && !oldLayers->next() && !newLayers.next() && (oldLayers->imag e() == newLayers.image())) 1874 if (oldLayers && !oldLayers->next() && !newLayers.next() && (oldLayers->imag e() == newLayers.image()))
1882 return; 1875 return;
1883 1876
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
2210 void RenderObject::destroyAndCleanupAnonymousWrappers() 2203 void RenderObject::destroyAndCleanupAnonymousWrappers()
2211 { 2204 {
2212 // If the tree is destroyed, there is no need for a clean-up phase. 2205 // If the tree is destroyed, there is no need for a clean-up phase.
2213 if (documentBeingDestroyed()) { 2206 if (documentBeingDestroyed()) {
2214 destroy(); 2207 destroy();
2215 return; 2208 return;
2216 } 2209 }
2217 2210
2218 RenderObject* destroyRoot = this; 2211 RenderObject* destroyRoot = this;
2219 for (RenderObject* destroyRootParent = destroyRoot->parent(); destroyRootPar ent && destroyRootParent->isAnonymous(); destroyRoot = destroyRootParent, destro yRootParent = destroyRootParent->parent()) { 2212 for (RenderObject* destroyRootParent = destroyRoot->parent(); destroyRootPar ent && destroyRootParent->isAnonymous(); destroyRoot = destroyRootParent, destro yRootParent = destroyRootParent->parent()) {
2220 // Anonymous block continuations are tracked and destroyed elsewhere (se e the bottom of RenderBlock::removeChild)
2221 if (destroyRootParent->isRenderBlock() && toRenderBlock(destroyRootParen t)->isAnonymousBlockContinuation())
2222 break;
2223 if (destroyRootParent->slowFirstChild() != this || destroyRootParent->sl owLastChild() != this) 2213 if (destroyRootParent->slowFirstChild() != this || destroyRootParent->sl owLastChild() != this)
2224 break; 2214 break;
2225 } 2215 }
2226 2216
2227 destroyRoot->destroy(); 2217 destroyRoot->destroy();
2228 2218
2229 // WARNING: |this| is deleted here. 2219 // WARNING: |this| is deleted here.
2230 } 2220 }
2231 2221
2232 void RenderObject::destroy() 2222 void RenderObject::destroy()
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
2372 overline.color = resultColor; 2362 overline.color = resultColor;
2373 overline.style = resultStyle; 2363 overline.style = resultStyle;
2374 } 2364 }
2375 if (currDecs & TextDecorationLineThrough) { 2365 if (currDecs & TextDecorationLineThrough) {
2376 decorations &= ~TextDecorationLineThrough; 2366 decorations &= ~TextDecorationLineThrough;
2377 linethrough.color = resultColor; 2367 linethrough.color = resultColor;
2378 linethrough.style = resultStyle; 2368 linethrough.style = resultStyle;
2379 } 2369 }
2380 } 2370 }
2381 curr = curr->parent(); 2371 curr = curr->parent();
2382 if (curr && curr->isAnonymousBlock() && toRenderBlock(curr)->continuatio n())
2383 curr = toRenderBlock(curr)->continuation();
2384 } while (curr && decorations && (!quirksMode || !curr->node() || (!isHTMLAnc horElement(*curr->node())))); 2372 } while (curr && decorations && (!quirksMode || !curr->node() || (!isHTMLAnc horElement(*curr->node()))));
2385 2373
2386 // If we bailed out, use the element we bailed out at (typically a <font> or <a> element). 2374 // If we bailed out, use the element we bailed out at (typically a <font> or <a> element).
2387 if (decorations && curr) { 2375 if (decorations && curr) {
2388 styleToUse = curr->style(firstlineStyle); 2376 styleToUse = curr->style(firstlineStyle);
2389 resultColor = styleToUse->decorationColor(); 2377 resultColor = styleToUse->decorationColor();
2390 if (decorations & TextDecorationUnderline) { 2378 if (decorations & TextDecorationUnderline) {
2391 underline.color = resultColor; 2379 underline.color = resultColor;
2392 underline.style = resultStyle; 2380 underline.style = resultStyle;
2393 } 2381 }
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
2678 { 2666 {
2679 if (object1) { 2667 if (object1) {
2680 const blink::RenderObject* root = object1; 2668 const blink::RenderObject* root = object1;
2681 while (root->parent()) 2669 while (root->parent())
2682 root = root->parent(); 2670 root = root->parent();
2683 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); 2671 root->showRenderTreeAndMark(object1, "*", object2, "-", 0);
2684 } 2672 }
2685 } 2673 }
2686 2674
2687 #endif 2675 #endif
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/RenderObject.h ('k') | sky/engine/core/rendering/style/RenderStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698