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

Side by Side Diff: Source/core/layout/LayoutRubyRun.cpp

Issue 889563002: Make RenderObject::style() return a const object (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Blind fix for Mac. Created 5 years, 10 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
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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 LayoutRubyBase* LayoutRubyRun::rubyBaseSafe() 81 LayoutRubyBase* LayoutRubyRun::rubyBaseSafe()
82 { 82 {
83 LayoutRubyBase* base = rubyBase(); 83 LayoutRubyBase* base = rubyBase();
84 if (!base) { 84 if (!base) {
85 base = createRubyBase(); 85 base = createRubyBase();
86 RenderBlockFlow::addChild(base); 86 RenderBlockFlow::addChild(base);
87 } 87 }
88 return base; 88 return base;
89 } 89 }
90 90
91 bool LayoutRubyRun::isChildAllowed(RenderObject* child, RenderStyle*) const 91 bool LayoutRubyRun::isChildAllowed(RenderObject* child, const RenderStyle*) cons t
92 { 92 {
93 return child->isRubyText() || child->isInline(); 93 return child->isRubyText() || child->isInline();
94 } 94 }
95 95
96 void LayoutRubyRun::addChild(RenderObject* child, RenderObject* beforeChild) 96 void LayoutRubyRun::addChild(RenderObject* child, RenderObject* beforeChild)
97 { 97 {
98 ASSERT(child); 98 ASSERT(child);
99 99
100 if (child->isRubyText()) { 100 if (child->isRubyText()) {
101 if (!beforeChild) { 101 if (!beforeChild) {
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 // We can overhang the ruby by no more than half the width of the neighborin g text 296 // We can overhang the ruby by no more than half the width of the neighborin g text
297 // and no more than half the font size. 297 // and no more than half the font size.
298 int halfWidthOfFontSize = rubyText->style(firstLine)->fontSize() / 2; 298 int halfWidthOfFontSize = rubyText->style(firstLine)->fontSize() / 2;
299 if (startOverhang) 299 if (startOverhang)
300 startOverhang = std::min<int>(startOverhang, std::min<int>(toRenderText( startRenderer)->minLogicalWidth(), halfWidthOfFontSize)); 300 startOverhang = std::min<int>(startOverhang, std::min<int>(toRenderText( startRenderer)->minLogicalWidth(), halfWidthOfFontSize));
301 if (endOverhang) 301 if (endOverhang)
302 endOverhang = std::min<int>(endOverhang, std::min<int>(toRenderText(endR enderer)->minLogicalWidth(), halfWidthOfFontSize)); 302 endOverhang = std::min<int>(endOverhang, std::min<int>(toRenderText(endR enderer)->minLogicalWidth(), halfWidthOfFontSize));
303 } 303 }
304 304
305 } // namespace blink 305 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698