Changeset 112321 in webkit
- Timestamp:
- Mar 27, 2012 3:01:03 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r112314 r112321 1 2012-03-27 Ryosuke Niwa <rniwa@webkit.org> 2 3 cssText should not generate literal 'initial' in shorthand properties 4 https://bugs.webkit.org/show_bug.cgi?id=82364 5 6 Reviewed by Antti Koivisto. 7 8 * fast/css/cssText-shorthand-expected.txt: Rebaselined. 9 * fast/css/cssText-shorthand.html: 10 1 11 2012-03-27 Dirk Pranke <dpranke@chromium.org> 2 12 -
trunk/LayoutTests/fast/css/cssText-shorthand-expected.txt
r112254 r112321 4 4 5 5 6 PASS normalizeCssText(element.style.cssText) is "border: 1px initial initial"6 PASS normalizeCssText(element.style.cssText) is "border: 1px" 7 7 PASS normalizeCssText(element.style.cssText) is "border: 1px solid red" 8 PASS normalizeCssText(element.style.cssText) is "border: 1px initialred"9 PASS normalizeCssText(element.style.cssText) is "border: initial initialred"10 PASS normalizeCssText(element.style.cssText) is "border: 1px initial initial"8 PASS normalizeCssText(element.style.cssText) is "border: 1px red" 9 PASS normalizeCssText(element.style.cssText) is "border: red" 10 PASS normalizeCssText(element.style.cssText) is "border: 1px" 11 11 PASS normalizeCssText(element.style.cssText) is "border-bottom-width: 3px; border-left-width: 4px; border-right-width: 2px; border-top-width: 1px" 12 12 PASS normalizeCssText(element.style.cssText) is "border-bottom-width: 1px; border-left-width: 1px; border-right-width: 1px; border-top-width: 2px" 13 13 PASS normalizeCssText(element.style.cssText) is "border-bottom-width: 1px; border-left-width: 1px; border-right-width: 1px; border-top-width: 1px !important" 14 14 PASS normalizeCssText(element.style.cssText) is "border-bottom-width: 1px; border-left-width: 1px; border-right-width: 1px; border-top-color: red; border-top-width: 1px" 15 PASS normalizeCssText(element.style.cssText) is "border: initial dotted initial"15 PASS normalizeCssText(element.style.cssText) is "border: dotted" 16 16 PASS normalizeCssText(element.style.cssText) is "border-spacing: 1px 2px" 17 17 PASS normalizeCssText(element.style.cssText) is "font-family: sans-serif; font-size: 3em; font-style: italic; font-weight: bold; line-height: 2em" -
trunk/LayoutTests/fast/css/cssText-shorthand.html
r112254 r112321 9 9 var tests = [ 10 10 // FIXME: This exhibits a bug. We shouldn't be outputing border-image here. 11 ['border: 1px; border-top: 1px;', 'border: 1px initial initial;'],11 ['border: 1px; border-top: 1px;', 'border: 1px;'], 12 12 ['border: 1px solid red;', 'border: 1px solid red;'], 13 ['border: 1px red;', 'border: 1px initialred;'],14 ['border: red;', 'border: initial initialred;'],15 ['border-top: 1px; border-right: 1px; border-bottom: 1px; border-left: 1px;', 'border: 1px initial initial;'],13 ['border: 1px red;', 'border: 1px red;'], 14 ['border: red;', 'border: red;'], 15 ['border-top: 1px; border-right: 1px; border-bottom: 1px; border-left: 1px;', 'border: 1px;'], 16 16 ['border-top: 1px; border-right: 2px; border-bottom: 3px; border-left: 4px;', 17 17 'border-top-width: 1px; border-right-width: 2px; border-bottom-width: 3px; border-left-width: 4px;'], … … 22 22 ['border: 1px; border-top-color: red;', 23 23 'border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-width: 1px; border-top-color: red;'], 24 ['border: solid; border-style: dotted', 'border: initial dotted initial;'],24 ['border: solid; border-style: dotted', 'border: dotted;'], 25 25 26 26 ['-webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 2px;', 'border-spacing: 1px 2px;'], -
trunk/Source/WebCore/ChangeLog
r112318 r112321 1 2012-03-27 Ryosuke Niwa <rniwa@webkit.org> 2 3 cssText should not generate literal 'initial' in shorthand properties 4 https://bugs.webkit.org/show_bug.cgi?id=82364 5 6 Reviewed by Antti Koivisto. 7 8 Fixed the bug by treating initial value as if the value is not set. 9 While this is incorrect for properties that inherits by default, 10 it's strictly better than generating unparsable value as we do today. 11 12 The proper fix is for CSSInitialValue::cssText to fetch the respective 13 default value from what's currently in CSSStyleSelector code but that requires 14 a considerable amount of refactoring and work. 15 16 * css/StylePropertySet.cpp: 17 (WebCore::StylePropertySet::getShorthandValue): 18 (WebCore::StylePropertySet::getCommonValue): 19 1 20 2012-03-26 Adam Klein <adamk@chromium.org> 2 21 -
trunk/Source/WebCore/css/StylePropertySet.cpp
r112220 r112321 383 383 if (!isPropertyImplicit(longhand.properties()[i])) { 384 384 RefPtr<CSSValue> value = getPropertyCSSValue(longhand.properties()[i]); 385 // FIXME: provide default value if !value 386 if (value ) {385 // FIXME: provide default value if !value or value is initial value 386 if (value && !value->isInitialValue()) { 387 387 if (!res.isNull()) 388 388 res += " "; … … 400 400 for (unsigned i = 0; i < longhand.length(); ++i) { 401 401 RefPtr<CSSValue> value = getPropertyCSSValue(longhand.properties()[i]); 402 if (!value) 402 // FIXME: CSSInitialValue::cssText should generate the right value. 403 if (!value || value->isInitialValue()) 403 404 return String(); 404 405 String text = value->cssText();
Note: See TracChangeset
for help on using the changeset viewer.