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

Side by Side Diff: Source/core/rendering/RenderInline.cpp

Issue 889563002: Make RenderObject::style() return a const object (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated change after Doug's review. Created 5 years, 10 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 | Annotate | Revision Log
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 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 // only do this if we're an inline, since we don't want to propagate 189 // only do this if we're an inline, since we don't want to propagate
190 // a block's style to the other inlines. 190 // a block's style to the other inlines.
191 // e.g., <font>foo <h4>goo</h4> moo</font>. The <font> inlines before 191 // e.g., <font>foo <h4>goo</h4> moo</font>. The <font> inlines before
192 // and after the block share the same style, but the block doesn't 192 // and after the block share the same style, but the block doesn't
193 // need to pass its style on to anyone else. 193 // need to pass its style on to anyone else.
194 const LayoutStyle& newStyle = styleRef(); 194 const LayoutStyle& newStyle = styleRef();
195 RenderInline* continuation = inlineElementContinuation(); 195 RenderInline* continuation = inlineElementContinuation();
196 for (RenderInline* currCont = continuation; currCont; currCont = currCont->i nlineElementContinuation()) { 196 for (RenderInline* currCont = continuation; currCont; currCont = currCont->i nlineElementContinuation()) {
197 RenderBoxModelObject* nextCont = currCont->continuation(); 197 RenderBoxModelObject* nextCont = currCont->continuation();
198 currCont->setContinuation(0); 198 currCont->setContinuation(0);
199 currCont->setStyle(style()); 199 currCont->setStyle(mutableStyle());
200 currCont->setContinuation(nextCont); 200 currCont->setContinuation(nextCont);
201 } 201 }
202 202
203 // If an inline's outline or in-flow positioning has changed then any descen dant blocks will need to change their styles accordingly. 203 // If an inline's outline or in-flow positioning has changed then any descen dant blocks will need to change their styles accordingly.
204 // Do this by updating the styles of the descendant blocks' containing anony mous blocks - there may be more than one. 204 // Do this by updating the styles of the descendant blocks' containing anony mous blocks - there may be more than one.
205 if (continuation && oldStyle 205 if (continuation && oldStyle
206 && (!newStyle.isOutlineEquivalent(oldStyle) 206 && (!newStyle.isOutlineEquivalent(oldStyle)
207 || (newStyle.position() != oldStyle->position() && (newStyle.hasInFl owPosition() || oldStyle->hasInFlowPosition())))) { 207 || (newStyle.position() != oldStyle->position() && (newStyle.hasInFl owPosition() || oldStyle->hasInFlowPosition())))) {
208 // If any descendant blocks exist then they will be in the next anonymou s block and its siblings. 208 // If any descendant blocks exist then they will be in the next anonymou s block and its siblings.
209 LayoutObject* block = containingBlock()->nextSibling(); 209 LayoutObject* block = containingBlock()->nextSibling();
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 } 352 }
353 353
354 RenderBoxModelObject::addChild(newChild, beforeChild); 354 RenderBoxModelObject::addChild(newChild, beforeChild);
355 355
356 newChild->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(); 356 newChild->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation();
357 } 357 }
358 358
359 RenderInline* RenderInline::clone() const 359 RenderInline* RenderInline::clone() const
360 { 360 {
361 RenderInline* cloneInline = new RenderInline(node()); 361 RenderInline* cloneInline = new RenderInline(node());
362 cloneInline->setStyle(style()); 362 cloneInline->setStyle(mutableStyle());
363 cloneInline->setFlowThreadState(flowThreadState()); 363 cloneInline->setFlowThreadState(flowThreadState());
364 return cloneInline; 364 return cloneInline;
365 } 365 }
366 366
367 void RenderInline::moveChildrenToIgnoringContinuation(RenderInline* to, LayoutOb ject* startChild) 367 void RenderInline::moveChildrenToIgnoringContinuation(RenderInline* to, LayoutOb ject* startChild)
368 { 368 {
369 LayoutObject* child = startChild; 369 LayoutObject* child = startChild;
370 while (child) { 370 while (child) {
371 LayoutObject* currentChild = child; 371 LayoutObject* currentChild = child;
372 child = currentChild->nextSibling(); 372 child = currentChild->nextSibling();
(...skipping 1079 matching lines...) Expand 10 before | Expand all | Expand 10 after
1452 } 1452 }
1453 1453
1454 void RenderInline::invalidateDisplayItemClients(DisplayItemList* displayItemList ) const 1454 void RenderInline::invalidateDisplayItemClients(DisplayItemList* displayItemList ) const
1455 { 1455 {
1456 RenderBoxModelObject::invalidateDisplayItemClients(displayItemList); 1456 RenderBoxModelObject::invalidateDisplayItemClients(displayItemList);
1457 for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox()) 1457 for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox())
1458 displayItemList->invalidate(box->displayItemClient()); 1458 displayItemList->invalidate(box->displayItemClient());
1459 } 1459 }
1460 1460
1461 } // namespace blink 1461 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderDeprecatedFlexibleBox.cpp ('k') | Source/core/rendering/RenderListMarker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698