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 17 matching lines...) Expand all Loading... |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 | 32 |
33 #include "core/rendering/RenderRubyRun.h" | 33 #include "core/rendering/RenderRubyRun.h" |
34 | 34 |
35 #include "core/rendering/RenderRubyBase.h" | 35 #include "core/rendering/RenderRubyBase.h" |
36 #include "core/rendering/RenderRubyText.h" | 36 #include "core/rendering/RenderRubyText.h" |
37 #include "core/rendering/RenderText.h" | 37 #include "core/rendering/RenderText.h" |
38 #include "core/rendering/RenderView.h" | |
39 #include "core/rendering/style/StyleInheritedData.h" | |
40 | 38 |
41 using namespace std; | 39 using namespace std; |
42 | 40 |
43 namespace WebCore { | 41 namespace WebCore { |
44 | 42 |
45 RenderRubyRun::RenderRubyRun() | 43 RenderRubyRun::RenderRubyRun() |
46 : RenderBlock(0) | 44 : RenderBlock(0) |
47 { | 45 { |
48 setReplaced(true); | 46 setReplaced(true); |
49 setInline(true); | 47 setInline(true); |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 // 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 |
313 // and no more than half the font size. | 311 // and no more than half the font size. |
314 int halfWidthOfFontSize = rubyText->style(firstLine)->fontSize() / 2; | 312 int halfWidthOfFontSize = rubyText->style(firstLine)->fontSize() / 2; |
315 if (startOverhang) | 313 if (startOverhang) |
316 startOverhang = min<int>(startOverhang, min<int>(toRenderText(startRende
rer)->minLogicalWidth(), halfWidthOfFontSize)); | 314 startOverhang = min<int>(startOverhang, min<int>(toRenderText(startRende
rer)->minLogicalWidth(), halfWidthOfFontSize)); |
317 if (endOverhang) | 315 if (endOverhang) |
318 endOverhang = min<int>(endOverhang, min<int>(toRenderText(endRenderer)->
minLogicalWidth(), halfWidthOfFontSize)); | 316 endOverhang = min<int>(endOverhang, min<int>(toRenderText(endRenderer)->
minLogicalWidth(), halfWidthOfFontSize)); |
319 } | 317 } |
320 | 318 |
321 } // namespace WebCore | 319 } // namespace WebCore |
OLD | NEW |