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

Side by Side Diff: sky/engine/core/rendering/RenderFlexibleBox.cpp

Issue 1061163002: Remove all uses of display:block and display:inline-block. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: update one more usage Created 5 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 411
412 LayoutUnit RenderFlexibleBox::flowAwareBorderEnd() const 412 LayoutUnit RenderFlexibleBox::flowAwareBorderEnd() const
413 { 413 {
414 if (isHorizontalFlow()) 414 if (isHorizontalFlow())
415 return isLeftToRightFlow() ? borderRight() : borderLeft(); 415 return isLeftToRightFlow() ? borderRight() : borderLeft();
416 return isLeftToRightFlow() ? borderBottom() : borderTop(); 416 return isLeftToRightFlow() ? borderBottom() : borderTop();
417 } 417 }
418 418
419 LayoutUnit RenderFlexibleBox::flowAwareBorderBefore() const 419 LayoutUnit RenderFlexibleBox::flowAwareBorderBefore() const
420 { 420 {
421 // FIXME(sky): Remove 421 return isHorizontalFlow() ? borderTop() : borderLeft();
422 return borderTop();
423 } 422 }
424 423
425 LayoutUnit RenderFlexibleBox::flowAwareBorderAfter() const 424 LayoutUnit RenderFlexibleBox::flowAwareBorderAfter() const
426 { 425 {
427 // FIXME(sky): Remove 426 return isHorizontalFlow() ? borderBottom() : borderRight();
428 return borderBottom();
429 } 427 }
430 428
431 LayoutUnit RenderFlexibleBox::flowAwarePaddingStart() const 429 LayoutUnit RenderFlexibleBox::flowAwarePaddingStart() const
432 { 430 {
433 if (isHorizontalFlow()) 431 if (isHorizontalFlow())
434 return isLeftToRightFlow() ? paddingLeft() : paddingRight(); 432 return isLeftToRightFlow() ? paddingLeft() : paddingRight();
435 return isLeftToRightFlow() ? paddingTop() : paddingBottom(); 433 return isLeftToRightFlow() ? paddingTop() : paddingBottom();
436 } 434 }
437 435
438 LayoutUnit RenderFlexibleBox::flowAwarePaddingEnd() const 436 LayoutUnit RenderFlexibleBox::flowAwarePaddingEnd() const
439 { 437 {
440 if (isHorizontalFlow()) 438 if (isHorizontalFlow())
441 return isLeftToRightFlow() ? paddingRight() : paddingLeft(); 439 return isLeftToRightFlow() ? paddingRight() : paddingLeft();
442 return isLeftToRightFlow() ? paddingBottom() : paddingTop(); 440 return isLeftToRightFlow() ? paddingBottom() : paddingTop();
443 } 441 }
444 442
445 LayoutUnit RenderFlexibleBox::flowAwarePaddingBefore() const 443 LayoutUnit RenderFlexibleBox::flowAwarePaddingBefore() const
446 { 444 {
447 // FIXME(sky): Remove 445 return isHorizontalFlow() ? paddingTop() : paddingLeft();
448 return paddingTop();
449 } 446 }
450 447
451 LayoutUnit RenderFlexibleBox::flowAwarePaddingAfter() const 448 LayoutUnit RenderFlexibleBox::flowAwarePaddingAfter() const
452 { 449 {
453 // FIXME(sky): Remove 450 return isHorizontalFlow() ? paddingBottom() : paddingRight();
454 return paddingBottom();
455 } 451 }
456 452
457 LayoutUnit RenderFlexibleBox::flowAwareMarginStartForChild(RenderBox* child) con st 453 LayoutUnit RenderFlexibleBox::flowAwareMarginStartForChild(RenderBox* child) con st
458 { 454 {
459 if (isHorizontalFlow()) 455 if (isHorizontalFlow())
460 return isLeftToRightFlow() ? child->marginLeft() : child->marginRight(); 456 return isLeftToRightFlow() ? child->marginLeft() : child->marginRight();
461 return isLeftToRightFlow() ? child->marginTop() : child->marginBottom(); 457 return isLeftToRightFlow() ? child->marginTop() : child->marginBottom();
462 } 458 }
463 459
464 LayoutUnit RenderFlexibleBox::flowAwareMarginEndForChild(RenderBox* child) const 460 LayoutUnit RenderFlexibleBox::flowAwareMarginEndForChild(RenderBox* child) const
465 { 461 {
466 if (isHorizontalFlow()) 462 if (isHorizontalFlow())
467 return isLeftToRightFlow() ? child->marginRight() : child->marginLeft(); 463 return isLeftToRightFlow() ? child->marginRight() : child->marginLeft();
468 return isLeftToRightFlow() ? child->marginBottom() : child->marginTop(); 464 return isLeftToRightFlow() ? child->marginBottom() : child->marginTop();
469 } 465 }
470 466
471 LayoutUnit RenderFlexibleBox::flowAwareMarginBeforeForChild(RenderBox* child) co nst 467 LayoutUnit RenderFlexibleBox::flowAwareMarginBeforeForChild(RenderBox* child) co nst
472 { 468 {
473 // FIXME(sky): Remove 469 return isHorizontalFlow() ? child->marginTop() : child->marginLeft();
474 return child->marginTop();
475 } 470 }
476 471
477 LayoutUnit RenderFlexibleBox::crossAxisMarginExtentForChild(RenderBox* child) co nst 472 LayoutUnit RenderFlexibleBox::crossAxisMarginExtentForChild(RenderBox* child) co nst
478 { 473 {
479 return isHorizontalFlow() ? child->marginHeight() : child->marginWidth(); 474 return isHorizontalFlow() ? child->marginHeight() : child->marginWidth();
480 } 475 }
481 476
482 LayoutPoint RenderFlexibleBox::flowAwareLocationForChild(RenderBox* child) const 477 LayoutPoint RenderFlexibleBox::flowAwareLocationForChild(RenderBox* child) const
483 { 478 {
484 return isHorizontalFlow() ? child->location() : child->location().transposed Point(); 479 return isHorizontalFlow() ? child->location() : child->location().transposed Point();
(...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after
1259 ASSERT(child); 1254 ASSERT(child);
1260 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE xtent; 1255 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE xtent;
1261 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge; 1256 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge;
1262 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi sExtent; 1257 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi sExtent;
1263 adjustAlignmentForChild(child, newOffset - originalOffset); 1258 adjustAlignmentForChild(child, newOffset - originalOffset);
1264 } 1259 }
1265 } 1260 }
1266 } 1261 }
1267 1262
1268 } 1263 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698