| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 } | 77 } |
| 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) ? static_cast<RenderBlock*>(child) : 0; | 82 return isRubyAfterBlock(child) ? static_cast<RenderBlock*>(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::createAnonymousStyle(ruby->style
()); | 87 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay(
ruby->style(), INLINE_BLOCK); |
| 88 newStyle->setDisplay(INLINE_BLOCK); | |
| 89 | |
| 90 RenderBlock* newBlock = new (ruby->renderArena()) RenderBlock(ruby->document
() /* anonymous box */); | 88 RenderBlock* newBlock = new (ruby->renderArena()) RenderBlock(ruby->document
() /* anonymous box */); |
| 91 newBlock->setStyle(newStyle.release()); | 89 newBlock->setStyle(newStyle.release()); |
| 92 return newBlock; | 90 return newBlock; |
| 93 } | 91 } |
| 94 | 92 |
| 95 static RenderRubyRun* lastRubyRun(const RenderObject* ruby) | 93 static RenderRubyRun* lastRubyRun(const RenderObject* ruby) |
| 96 { | 94 { |
| 97 RenderObject* child = ruby->lastChild(); | 95 RenderObject* child = ruby->lastChild(); |
| 98 if (child && !child->isRubyRun()) | 96 if (child && !child->isRubyRun()) |
| 99 child = child->previousSibling(); | 97 child = child->previousSibling(); |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 return; | 313 return; |
| 316 } | 314 } |
| 317 | 315 |
| 318 // Otherwise find the containing run and remove it from there. | 316 // Otherwise find the containing run and remove it from there. |
| 319 RenderRubyRun* run = findRubyRunParent(child); | 317 RenderRubyRun* run = findRubyRunParent(child); |
| 320 ASSERT(run); | 318 ASSERT(run); |
| 321 run->removeChild(child); | 319 run->removeChild(child); |
| 322 } | 320 } |
| 323 | 321 |
| 324 } // namespace WebCore | 322 } // namespace WebCore |
| OLD | NEW |