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

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

Issue 351213002: Change RenderObject::style(bool) to accept an enum instead (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Renamed enum to OwnOrFirstLineStyle, rebased and got rid of duplicate state on the stack in RootInl… Created 6 years, 5 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/RenderBox.h ('k') | Source/core/rendering/RenderBoxModelObject.h » ('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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 4331 matching lines...) Expand 10 before | Expand all | Expand 10 after
4342 return !style()->logicalHeight().isIntrinsicOrAuto() 4342 return !style()->logicalHeight().isIntrinsicOrAuto()
4343 || (!style()->logicalMaxHeight().isIntrinsicOrAuto() && !style()->logica lMaxHeight().isUndefined() && (!style()->logicalMaxHeight().isPercent() || perce ntageLogicalHeightIsResolvable(this))) 4343 || (!style()->logicalMaxHeight().isIntrinsicOrAuto() && !style()->logica lMaxHeight().isUndefined() && (!style()->logicalMaxHeight().isPercent() || perce ntageLogicalHeightIsResolvable(this)))
4344 || (!style()->logicalMinHeight().isIntrinsicOrAuto() && style()->logical MinHeight().isPositive() && (!style()->logicalMinHeight().isPercent() || percent ageLogicalHeightIsResolvable(this))); 4344 || (!style()->logicalMinHeight().isIntrinsicOrAuto() && style()->logical MinHeight().isPositive() && (!style()->logicalMinHeight().isPercent() || percent ageLogicalHeightIsResolvable(this)));
4345 } 4345 }
4346 4346
4347 bool RenderBox::isUnsplittableForPagination() const 4347 bool RenderBox::isUnsplittableForPagination() const
4348 { 4348 {
4349 return isReplaced() || hasUnsplittableScrollingOverflow() || (parent() && is WritingModeRoot()); 4349 return isReplaced() || hasUnsplittableScrollingOverflow() || (parent() && is WritingModeRoot());
4350 } 4350 }
4351 4351
4352 LayoutUnit RenderBox::lineHeight(bool /*firstLine*/, LineDirectionMode direction , LinePositionMode /*linePositionMode*/) const 4352 LayoutUnit RenderBox::lineHeight(OwnOrFirstLineStyle, LineDirectionMode directio n, LinePositionMode /*linePositionMode*/) const
4353 { 4353 {
4354 if (isReplaced()) 4354 if (isReplaced())
4355 return direction == HorizontalLine ? m_marginBox.top() + height() + m_ma rginBox.bottom() : m_marginBox.right() + width() + m_marginBox.left(); 4355 return direction == HorizontalLine ? m_marginBox.top() + height() + m_ma rginBox.bottom() : m_marginBox.right() + width() + m_marginBox.left();
4356 return 0; 4356 return 0;
4357 } 4357 }
4358 4358
4359 int RenderBox::baselinePosition(FontBaseline baselineType, bool /*firstLine*/, L ineDirectionMode direction, LinePositionMode linePositionMode) const 4359 int RenderBox::baselinePosition(FontBaseline baselineType, OwnOrFirstLineStyle, LineDirectionMode direction, LinePositionMode linePositionMode) const
4360 { 4360 {
4361 ASSERT(linePositionMode == PositionOnContainingLine); 4361 ASSERT(linePositionMode == PositionOnContainingLine);
4362 if (isReplaced()) { 4362 if (isReplaced()) {
4363 int result = direction == HorizontalLine ? m_marginBox.top() + height() + m_marginBox.bottom() : m_marginBox.right() + width() + m_marginBox.left(); 4363 int result = direction == HorizontalLine ? m_marginBox.top() + height() + m_marginBox.bottom() : m_marginBox.right() + width() + m_marginBox.left();
4364 if (baselineType == AlphabeticBaseline) 4364 if (baselineType == AlphabeticBaseline)
4365 return result; 4365 return result;
4366 return result - result / 2; 4366 return result - result / 2;
4367 } 4367 }
4368 return 0; 4368 return 0;
4369 } 4369 }
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
4665 return 0; 4665 return 0;
4666 4666
4667 if (!layoutState && !flowThreadContainingBlock()) 4667 if (!layoutState && !flowThreadContainingBlock())
4668 return 0; 4668 return 0;
4669 4669
4670 RenderBlock* containerBlock = containingBlock(); 4670 RenderBlock* containerBlock = containingBlock();
4671 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop(); 4671 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop();
4672 } 4672 }
4673 4673
4674 } // namespace WebCore 4674 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderBox.h ('k') | Source/core/rendering/RenderBoxModelObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698