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

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

Issue 355843002: Rename style(bool) to styleOrFirstLineStyle(bool) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 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/core/rendering/RenderObject.cpp ('k') | Source/core/rendering/RenderText.cpp » ('j') | 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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 int logicalLeftOverhang = std::numeric_limits<int>::max(); 284 int logicalLeftOverhang = std::numeric_limits<int>::max();
285 int logicalRightOverhang = std::numeric_limits<int>::max(); 285 int logicalRightOverhang = std::numeric_limits<int>::max();
286 for (RootInlineBox* rootInlineBox = rubyBase->firstRootBox(); rootInlineBox; rootInlineBox = rootInlineBox->nextRootBox()) { 286 for (RootInlineBox* rootInlineBox = rubyBase->firstRootBox(); rootInlineBox; rootInlineBox = rootInlineBox->nextRootBox()) {
287 logicalLeftOverhang = std::min<int>(logicalLeftOverhang, rootInlineBox-> logicalLeft()); 287 logicalLeftOverhang = std::min<int>(logicalLeftOverhang, rootInlineBox-> logicalLeft());
288 logicalRightOverhang = std::min<int>(logicalRightOverhang, logicalWidth - rootInlineBox->logicalRight()); 288 logicalRightOverhang = std::min<int>(logicalRightOverhang, logicalWidth - rootInlineBox->logicalRight());
289 } 289 }
290 290
291 startOverhang = style()->isLeftToRightDirection() ? logicalLeftOverhang : lo gicalRightOverhang; 291 startOverhang = style()->isLeftToRightDirection() ? logicalLeftOverhang : lo gicalRightOverhang;
292 endOverhang = style()->isLeftToRightDirection() ? logicalRightOverhang : log icalLeftOverhang; 292 endOverhang = style()->isLeftToRightDirection() ? logicalRightOverhang : log icalLeftOverhang;
293 293
294 if (!startRenderer || !startRenderer->isText() || startRenderer->style(first Line)->fontSize() > rubyBase->style(firstLine)->fontSize()) 294 if (!startRenderer || !startRenderer->isText() || startRenderer->styleOrFirs tLineStyle(firstLine)->fontSize() > rubyBase->styleOrFirstLineStyle(firstLine)-> fontSize())
295 startOverhang = 0; 295 startOverhang = 0;
296 296
297 if (!endRenderer || !endRenderer->isText() || endRenderer->style(firstLine)- >fontSize() > rubyBase->style(firstLine)->fontSize()) 297 if (!endRenderer || !endRenderer->isText() || endRenderer->styleOrFirstLineS tyle(firstLine)->fontSize() > rubyBase->styleOrFirstLineStyle(firstLine)->fontSi ze())
298 endOverhang = 0; 298 endOverhang = 0;
299 299
300 // We overhang a ruby only if the neighboring render object is a text. 300 // We overhang a ruby only if the neighboring render object is a text.
301 // We can overhang the ruby by no more than half the width of the neighborin g text 301 // We can overhang the ruby by no more than half the width of the neighborin g text
302 // and no more than half the font size. 302 // and no more than half the font size.
303 int halfWidthOfFontSize = rubyText->style(firstLine)->fontSize() / 2; 303 int halfWidthOfFontSize = rubyText->styleOrFirstLineStyle(firstLine)->fontSi ze() / 2;
304 if (startOverhang) 304 if (startOverhang)
305 startOverhang = std::min<int>(startOverhang, std::min<int>(toRenderText( startRenderer)->minLogicalWidth(), halfWidthOfFontSize)); 305 startOverhang = std::min<int>(startOverhang, std::min<int>(toRenderText( startRenderer)->minLogicalWidth(), halfWidthOfFontSize));
306 if (endOverhang) 306 if (endOverhang)
307 endOverhang = std::min<int>(endOverhang, std::min<int>(toRenderText(endR enderer)->minLogicalWidth(), halfWidthOfFontSize)); 307 endOverhang = std::min<int>(endOverhang, std::min<int>(toRenderText(endR enderer)->minLogicalWidth(), halfWidthOfFontSize));
308 } 308 }
309 309
310 } // namespace WebCore 310 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderObject.cpp ('k') | Source/core/rendering/RenderText.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698