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

Side by Side Diff: Source/core/html/HTMLHRElement.cpp

Issue 162993002: hr color attribute not working. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 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 | « LayoutTests/fast/dom/HTMLHrElement/script-tests/color-noshade-attribute.js ('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) 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 * Copyright (C) 2003, 2010 Apple Inc. All rights reserved. 4 * Copyright (C) 2003, 2010 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 int v = value.toInt(&ok); 69 int v = value.toInt(&ok);
70 if (ok && !v) 70 if (ok && !v)
71 addPropertyToPresentationAttributeStyle(style, CSSPropertyWidth, 1, CSSPrimitiveValue::CSS_PX); 71 addPropertyToPresentationAttributeStyle(style, CSSPropertyWidth, 1, CSSPrimitiveValue::CSS_PX);
72 else 72 else
73 addHTMLLengthToStyle(style, CSSPropertyWidth, value); 73 addHTMLLengthToStyle(style, CSSPropertyWidth, value);
74 } else if (name == colorAttr) { 74 } else if (name == colorAttr) {
75 addPropertyToPresentationAttributeStyle(style, CSSPropertyBorderStyle, C SSValueSolid); 75 addPropertyToPresentationAttributeStyle(style, CSSPropertyBorderStyle, C SSValueSolid);
76 addHTMLColorToStyle(style, CSSPropertyBorderColor, value); 76 addHTMLColorToStyle(style, CSSPropertyBorderColor, value);
77 addHTMLColorToStyle(style, CSSPropertyBackgroundColor, value); 77 addHTMLColorToStyle(style, CSSPropertyBackgroundColor, value);
78 } else if (name == noshadeAttr) { 78 } else if (name == noshadeAttr) {
79 addPropertyToPresentationAttributeStyle(style, CSSPropertyBorderStyle, C SSValueSolid); 79 if (!hasAttribute(colorAttr)) {
80 addPropertyToPresentationAttributeStyle(style, CSSPropertyBorderStyl e, CSSValueSolid);
80 81
81 RefPtrWillBeRawPtr<CSSPrimitiveValue> darkGrayValue = cssValuePool().cre ateColorValue(Color::darkGray); 82 RefPtrWillBeRawPtr<CSSPrimitiveValue> darkGrayValue = cssValuePool() .createColorValue(Color::darkGray);
82 style->setProperty(CSSPropertyBorderColor, darkGrayValue); 83 style->setProperty(CSSPropertyBorderColor, darkGrayValue);
83 style->setProperty(CSSPropertyBackgroundColor, darkGrayValue); 84 style->setProperty(CSSPropertyBackgroundColor, darkGrayValue);
85 }
84 } else if (name == sizeAttr) { 86 } else if (name == sizeAttr) {
85 StringImpl* si = value.impl(); 87 StringImpl* si = value.impl();
86 int size = si->toInt(); 88 int size = si->toInt();
87 if (size <= 1) 89 if (size <= 1)
88 addPropertyToPresentationAttributeStyle(style, CSSPropertyBorderBott omWidth, 0, CSSPrimitiveValue::CSS_PX); 90 addPropertyToPresentationAttributeStyle(style, CSSPropertyBorderBott omWidth, 0, CSSPrimitiveValue::CSS_PX);
89 else 91 else
90 addPropertyToPresentationAttributeStyle(style, CSSPropertyHeight, si ze - 2, CSSPrimitiveValue::CSS_PX); 92 addPropertyToPresentationAttributeStyle(style, CSSPropertyHeight, si ze - 2, CSSPrimitiveValue::CSS_PX);
91 } else 93 } else
92 HTMLElement::collectStyleForPresentationAttribute(name, value, style); 94 HTMLElement::collectStyleForPresentationAttribute(name, value, style);
93 } 95 }
94 96
95 } 97 }
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/HTMLHrElement/script-tests/color-noshade-attribute.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698