OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |