| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) | 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights |
| 4 * reserved. | 4 * reserved. |
| 5 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. | 5 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. |
| 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 2213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2224 if (color_property == CSSPropertyBackgroundColor && | 2224 if (color_property == CSSPropertyBackgroundColor && |
| 2225 visited_color == Color::kTransparent) | 2225 visited_color == Color::kTransparent) |
| 2226 return unvisited_color; | 2226 return unvisited_color; |
| 2227 | 2227 |
| 2228 // Take the alpha from the unvisited color, but get the RGB values from the | 2228 // Take the alpha from the unvisited color, but get the RGB values from the |
| 2229 // visited color. | 2229 // visited color. |
| 2230 return Color(visited_color.Red(), visited_color.Green(), visited_color.Blue(), | 2230 return Color(visited_color.Red(), visited_color.Green(), visited_color.Blue(), |
| 2231 unvisited_color.Alpha()); | 2231 unvisited_color.Alpha()); |
| 2232 } | 2232 } |
| 2233 | 2233 |
| 2234 const BorderValue ComputedStyle::BorderBefore() const { | 2234 BorderValue ComputedStyle::BorderBefore() const { |
| 2235 switch (GetWritingMode()) { | 2235 switch (GetWritingMode()) { |
| 2236 case WritingMode::kHorizontalTb: | 2236 case WritingMode::kHorizontalTb: |
| 2237 return BorderTop(); | 2237 return BorderTop(); |
| 2238 case WritingMode::kVerticalLr: | 2238 case WritingMode::kVerticalLr: |
| 2239 return BorderLeft(); | 2239 return BorderLeft(); |
| 2240 case WritingMode::kVerticalRl: | 2240 case WritingMode::kVerticalRl: |
| 2241 return BorderRight(); | 2241 return BorderRight(); |
| 2242 } | 2242 } |
| 2243 NOTREACHED(); | 2243 NOTREACHED(); |
| 2244 return BorderTop(); | 2244 return BorderTop(); |
| 2245 } | 2245 } |
| 2246 | 2246 |
| 2247 const BorderValue ComputedStyle::BorderAfter() const { | 2247 BorderValue ComputedStyle::BorderAfter() const { |
| 2248 switch (GetWritingMode()) { | 2248 switch (GetWritingMode()) { |
| 2249 case WritingMode::kHorizontalTb: | 2249 case WritingMode::kHorizontalTb: |
| 2250 return BorderBottom(); | 2250 return BorderBottom(); |
| 2251 case WritingMode::kVerticalLr: | 2251 case WritingMode::kVerticalLr: |
| 2252 return BorderRight(); | 2252 return BorderRight(); |
| 2253 case WritingMode::kVerticalRl: | 2253 case WritingMode::kVerticalRl: |
| 2254 return BorderLeft(); | 2254 return BorderLeft(); |
| 2255 } | 2255 } |
| 2256 NOTREACHED(); | 2256 NOTREACHED(); |
| 2257 return BorderBottom(); | 2257 return BorderBottom(); |
| 2258 } | 2258 } |
| 2259 | 2259 |
| 2260 const BorderValue ComputedStyle::BorderStart() const { | 2260 BorderValue ComputedStyle::BorderStart() const { |
| 2261 if (IsHorizontalWritingMode()) | 2261 if (IsHorizontalWritingMode()) |
| 2262 return IsLeftToRightDirection() ? BorderLeft() : BorderRight(); | 2262 return IsLeftToRightDirection() ? BorderLeft() : BorderRight(); |
| 2263 return IsLeftToRightDirection() ? BorderTop() : BorderBottom(); | 2263 return IsLeftToRightDirection() ? BorderTop() : BorderBottom(); |
| 2264 } | 2264 } |
| 2265 | 2265 |
| 2266 const BorderValue ComputedStyle::BorderEnd() const { | 2266 BorderValue ComputedStyle::BorderEnd() const { |
| 2267 if (IsHorizontalWritingMode()) | 2267 if (IsHorizontalWritingMode()) |
| 2268 return IsLeftToRightDirection() ? BorderRight() : BorderLeft(); | 2268 return IsLeftToRightDirection() ? BorderRight() : BorderLeft(); |
| 2269 return IsLeftToRightDirection() ? BorderBottom() : BorderTop(); | 2269 return IsLeftToRightDirection() ? BorderBottom() : BorderTop(); |
| 2270 } | 2270 } |
| 2271 | 2271 |
| 2272 float ComputedStyle::BorderBeforeWidth() const { | 2272 float ComputedStyle::BorderBeforeWidth() const { |
| 2273 switch (GetWritingMode()) { | 2273 switch (GetWritingMode()) { |
| 2274 case WritingMode::kHorizontalTb: | 2274 case WritingMode::kHorizontalTb: |
| 2275 return BorderTopWidth(); | 2275 return BorderTopWidth(); |
| 2276 case WritingMode::kVerticalLr: | 2276 case WritingMode::kVerticalLr: |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2528 if (value < 0) | 2528 if (value < 0) |
| 2529 fvalue -= 0.5f; | 2529 fvalue -= 0.5f; |
| 2530 else | 2530 else |
| 2531 fvalue += 0.5f; | 2531 fvalue += 0.5f; |
| 2532 } | 2532 } |
| 2533 | 2533 |
| 2534 return RoundForImpreciseConversion<int>(fvalue / zoom_factor); | 2534 return RoundForImpreciseConversion<int>(fvalue / zoom_factor); |
| 2535 } | 2535 } |
| 2536 | 2536 |
| 2537 } // namespace blink | 2537 } // namespace blink |
| OLD | NEW |