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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutBox.cpp

Issue 2595833002: Replaced usages of WritingMode to use inline utility functions instead (Closed)
Patch Set: Rebase and fixed ::blink with just blink:: Created 4 years 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) 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. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc.
7 * All rights reserved. 7 * All rights reserved.
8 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 8 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 5055 matching lines...) Expand 10 before | Expand all | Expand 10 after
5066 const ComputedStyle& parentStyle) const { 5066 const ComputedStyle& parentStyle) const {
5067 // If the writing modes of the child and parent match, then we don't have to 5067 // If the writing modes of the child and parent match, then we don't have to
5068 // do anything fancy. Just return the result. 5068 // do anything fancy. Just return the result.
5069 LayoutRect rect = visualOverflowRect(); 5069 LayoutRect rect = visualOverflowRect();
5070 if (parentStyle.getWritingMode() == style()->getWritingMode()) 5070 if (parentStyle.getWritingMode() == style()->getWritingMode())
5071 return rect; 5071 return rect;
5072 5072
5073 // We are putting ourselves into our parent's coordinate space. If there is a 5073 // We are putting ourselves into our parent's coordinate space. If there is a
5074 // flipped block mismatch in a particular axis, then we have to flip the rect 5074 // flipped block mismatch in a particular axis, then we have to flip the rect
5075 // along that axis. 5075 // along that axis.
5076 if (style()->getWritingMode() == RightToLeftWritingMode || 5076 if (isFlippedBlocksWritingMode(style()->getWritingMode()) ||
5077 parentStyle.getWritingMode() == RightToLeftWritingMode) 5077 isFlippedBlocksWritingMode(parentStyle.getWritingMode()))
5078 rect.setX(size().width() - rect.maxX()); 5078 rect.setX(size().width() - rect.maxX());
5079 5079
5080 return rect; 5080 return rect;
5081 } 5081 }
5082 5082
5083 DISABLE_CFI_PERF 5083 DISABLE_CFI_PERF
5084 LayoutRect LayoutBox::logicalLayoutOverflowRectForPropagation( 5084 LayoutRect LayoutBox::logicalLayoutOverflowRectForPropagation(
5085 const ComputedStyle& parentStyle) const { 5085 const ComputedStyle& parentStyle) const {
5086 LayoutRect rect = layoutOverflowRectForPropagation(parentStyle); 5086 LayoutRect rect = layoutOverflowRectForPropagation(parentStyle);
5087 if (!parentStyle.isHorizontalWritingMode()) 5087 if (!parentStyle.isHorizontalWritingMode())
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
5122 } 5122 }
5123 5123
5124 // If the writing modes of the child and parent match, then we don't have to 5124 // If the writing modes of the child and parent match, then we don't have to
5125 // do anything fancy. Just return the result. 5125 // do anything fancy. Just return the result.
5126 if (parentStyle.getWritingMode() == style()->getWritingMode()) 5126 if (parentStyle.getWritingMode() == style()->getWritingMode())
5127 return rect; 5127 return rect;
5128 5128
5129 // We are putting ourselves into our parent's coordinate space. If there is a 5129 // We are putting ourselves into our parent's coordinate space. If there is a
5130 // flipped block mismatch in a particular axis, then we have to flip the rect 5130 // flipped block mismatch in a particular axis, then we have to flip the rect
5131 // along that axis. 5131 // along that axis.
5132 if (style()->getWritingMode() == RightToLeftWritingMode || 5132 if (isFlippedBlocksWritingMode(style()->getWritingMode()) ||
5133 parentStyle.getWritingMode() == RightToLeftWritingMode) 5133 isFlippedBlocksWritingMode(parentStyle.getWritingMode()))
5134 rect.setX(size().width() - rect.maxX()); 5134 rect.setX(size().width() - rect.maxX());
5135 5135
5136 return rect; 5136 return rect;
5137 } 5137 }
5138 5138
5139 DISABLE_CFI_PERF 5139 DISABLE_CFI_PERF
5140 LayoutRect LayoutBox::noOverflowRect() const { 5140 LayoutRect LayoutBox::noOverflowRect() const {
5141 // Because of the special coordinate system used for overflow rectangles and 5141 // Because of the special coordinate system used for overflow rectangles and
5142 // many other rectangles (not quite logical, not quite physical), we need to 5142 // many other rectangles (not quite logical, not quite physical), we need to
5143 // flip the block progression coordinate in vertical-rl writing mode. In other 5143 // flip the block progression coordinate in vertical-rl writing mode. In other
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
5669 block->adjustChildDebugRect(rect); 5669 block->adjustChildDebugRect(rect);
5670 5670
5671 return rect; 5671 return rect;
5672 } 5672 }
5673 5673
5674 bool LayoutBox::shouldClipOverflow() const { 5674 bool LayoutBox::shouldClipOverflow() const {
5675 return hasOverflowClip() || styleRef().containsPaint() || hasControlClip(); 5675 return hasOverflowClip() || styleRef().containsPaint() || hasControlClip();
5676 } 5676 }
5677 5677
5678 } // namespace blink 5678 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSProperty.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698