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

Side by Side Diff: Source/WebCore/rendering/RenderRubyRun.cpp

Issue 10262008: Merge 114666 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1084/
Patch Set: Created 8 years, 7 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
« no previous file with comments | « Source/WebCore/css/CSSStyleSelector.cpp ('k') | no next file » | 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 } 67 }
68 68
69 bool RenderRubyRun::isEmpty() const 69 bool RenderRubyRun::isEmpty() const
70 { 70 {
71 return !hasRubyText() && !hasRubyBase(); 71 return !hasRubyText() && !hasRubyBase();
72 } 72 }
73 73
74 RenderRubyText* RenderRubyRun::rubyText() const 74 RenderRubyText* RenderRubyRun::rubyText() const
75 { 75 {
76 RenderObject* child = firstChild(); 76 RenderObject* child = firstChild();
77 // If in future it becomes necessary to support floating or positioned ruby text,
78 // layout will have to be changed to handle them properly.
79 ASSERT(!child || !child->isRubyText() || !child->isFloatingOrPositioned());
77 return child && child->isRubyText() ? static_cast<RenderRubyText*>(child) : 0; 80 return child && child->isRubyText() ? static_cast<RenderRubyText*>(child) : 0;
78 } 81 }
79 82
80 RenderRubyBase* RenderRubyRun::rubyBase() const 83 RenderRubyBase* RenderRubyRun::rubyBase() const
81 { 84 {
82 RenderObject* child = lastChild(); 85 RenderObject* child = lastChild();
83 return child && child->isRubyBase() ? static_cast<RenderRubyBase*>(child) : 0; 86 return child && child->isRubyBase() ? static_cast<RenderRubyBase*>(child) : 0;
84 } 87 }
85 88
86 RenderRubyBase* RenderRubyRun::rubyBaseSafe() 89 RenderRubyBase* RenderRubyRun::rubyBaseSafe()
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 // We can overhang the ruby by no more than half the width of the neighborin g text 310 // We can overhang the ruby by no more than half the width of the neighborin g text
308 // and no more than half the font size. 311 // and no more than half the font size.
309 int halfWidthOfFontSize = rubyText->style(firstLine)->fontSize() / 2; 312 int halfWidthOfFontSize = rubyText->style(firstLine)->fontSize() / 2;
310 if (startOverhang) 313 if (startOverhang)
311 startOverhang = min<int>(startOverhang, min<int>(toRenderText(startRende rer)->minLogicalWidth(), halfWidthOfFontSize)); 314 startOverhang = min<int>(startOverhang, min<int>(toRenderText(startRende rer)->minLogicalWidth(), halfWidthOfFontSize));
312 if (endOverhang) 315 if (endOverhang)
313 endOverhang = min<int>(endOverhang, min<int>(toRenderText(endRenderer)-> minLogicalWidth(), halfWidthOfFontSize)); 316 endOverhang = min<int>(endOverhang, min<int>(toRenderText(endRenderer)-> minLogicalWidth(), halfWidthOfFontSize));
314 } 317 }
315 318
316 } // namespace WebCore 319 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/WebCore/css/CSSStyleSelector.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698