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

Side by Side Diff: Source/core/rendering/style/NinePieceImage.h

Issue 81123002: Factor out common BorderImageLength code in CSSToStyleMap (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Address review comments Created 7 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
« no previous file with comments | « Source/core/rendering/style/BorderImageLengthBox.h ('k') | no next file » | 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) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) 3 * (C) 2000 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2013 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2013 Apple Inc. All rights reserv ed.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 void copyRepeatFrom(const NinePieceImage& other) 107 void copyRepeatFrom(const NinePieceImage& other)
108 { 108 {
109 m_data.access()->horizontalRule = other.m_data->horizontalRule; 109 m_data.access()->horizontalRule = other.m_data->horizontalRule;
110 m_data.access()->verticalRule = other.m_data->verticalRule; 110 m_data.access()->verticalRule = other.m_data->verticalRule;
111 } 111 }
112 112
113 void setMaskDefaults() 113 void setMaskDefaults()
114 { 114 {
115 m_data.access()->imageSlices = LengthBox(0); 115 m_data.access()->imageSlices = LengthBox(0);
116 m_data.access()->fill = true; 116 m_data.access()->fill = true;
117 m_data.access()->borderSlices = BorderImageLengthBox(); 117 m_data.access()->borderSlices = BorderImageLengthBox(Length(Auto));
118 } 118 }
119 119
120 static LayoutUnit computeOutset(const BorderImageLength& outsetSide, LayoutU nit borderSide) 120 static LayoutUnit computeOutset(const BorderImageLength& outsetSide, LayoutU nit borderSide)
121 { 121 {
122 if (outsetSide.isNumber()) 122 if (outsetSide.isNumber())
123 return outsetSide.number() * borderSide; 123 return outsetSide.number() * borderSide;
124 return outsetSide.length().value(); 124 return outsetSide.length().value();
125 } 125 }
126 126
127 private: 127 private:
128 DataRef<NinePieceImageData> m_data; 128 DataRef<NinePieceImageData> m_data;
129 }; 129 };
130 130
131 } // namespace WebCore 131 } // namespace WebCore
132 132
133 #endif // NinePieceImage_h 133 #endif // NinePieceImage_h
OLDNEW
« no previous file with comments | « Source/core/rendering/style/BorderImageLengthBox.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698