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

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

Issue 23819007: Have Node::document() return a reference instead of a pointer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 3 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
« no previous file with comments | « Source/core/rendering/RenderReplaced.cpp ('k') | Source/core/rendering/RenderRubyRun.cpp » ('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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 78
79 static inline RenderBlock* rubyAfterBlock(const RenderObject* ruby) 79 static inline RenderBlock* rubyAfterBlock(const RenderObject* ruby)
80 { 80 {
81 RenderObject* child = ruby->lastChild(); 81 RenderObject* child = ruby->lastChild();
82 return isRubyAfterBlock(child) ? toRenderBlock(child) : 0; 82 return isRubyAfterBlock(child) ? toRenderBlock(child) : 0;
83 } 83 }
84 84
85 static RenderBlock* createAnonymousRubyInlineBlock(RenderObject* ruby) 85 static RenderBlock* createAnonymousRubyInlineBlock(RenderObject* ruby)
86 { 86 {
87 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay( ruby->style(), INLINE_BLOCK); 87 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay( ruby->style(), INLINE_BLOCK);
88 RenderBlock* newBlock = RenderBlock::createAnonymous(ruby->document()); 88 RenderBlock* newBlock = RenderBlock::createAnonymous(&ruby->document());
89 newBlock->setStyle(newStyle.release()); 89 newBlock->setStyle(newStyle.release());
90 return newBlock; 90 return newBlock;
91 } 91 }
92 92
93 static RenderRubyRun* lastRubyRun(const RenderObject* ruby) 93 static RenderRubyRun* lastRubyRun(const RenderObject* ruby)
94 { 94 {
95 RenderObject* child = ruby->lastChild(); 95 RenderObject* child = ruby->lastChild();
96 if (child && !child->isRubyRun()) 96 if (child && !child->isRubyRun())
97 child = child->previousSibling(); 97 child = child->previousSibling();
98 ASSERT(!child || child->isRubyRun() || child->isBeforeContent() || child == rubyBeforeBlock(ruby)); 98 ASSERT(!child || child->isRubyRun() || child->isBeforeContent() || child == rubyBeforeBlock(ruby));
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 return; 312 return;
313 } 313 }
314 314
315 // Otherwise find the containing run and remove it from there. 315 // Otherwise find the containing run and remove it from there.
316 RenderRubyRun* run = findRubyRunParent(child); 316 RenderRubyRun* run = findRubyRunParent(child);
317 ASSERT(run); 317 ASSERT(run);
318 run->removeChild(child); 318 run->removeChild(child);
319 } 319 }
320 320
321 } // namespace WebCore 321 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderReplaced.cpp ('k') | Source/core/rendering/RenderRubyRun.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698