WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Proposed patch
bug-92000-20130610103902.patch (text/plain), 14.05 KB, created by
Bruno Abinader (history only)
on 2013-06-10 07:40:41 PDT
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Bruno Abinader (history only)
Created:
2013-06-10 07:40:41 PDT
Size:
14.05 KB
patch
obsolete
>Subversion Revision: 151378 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index ea27dbfb55a9e57fdfd6a2cf4b6b0740cd50ffc5..dc6d35f9c1379a0a4c5808ca9c47f6ef47bbf5ef 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,29 @@ >+2013-06-10 Bruno de Oliveira Abinader <brunoabinader@gmail.com> >+ >+ [css3-text] Add support for "text-decoration" using CSS3 spec >+ https://bugs.webkit.org/show_bug.cgi?id=92000 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This patch implements the shorthand version of "text-decoration" >+ property ('-webkit-' vendor prefixed), as specified by the CSS3 text >+ decoration spec: >+ http://dev.w3.org/csswg/css-text-decor-3/#text-decoration-property >+ >+ Test: fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand.html >+ >+ * css/CSSComputedStyleDeclaration.cpp: >+ (WebCore::ComputedStyleExtractor::propertyValue): >+ * css/CSSParser.cpp: >+ (WebCore::CSSParser::parseValue): >+ (WebCore::CSSParser::parseTextDecoration): >+ * css/CSSProperty.cpp: >+ (WebCore::CSSProperty::isInheritedProperty): >+ * css/CSSPropertyNames.in: Added '-webkit-text-decoration'. >+ * css/StylePropertyShorthand.cpp: >+ (WebCore::webkitTextDecorationShorthand): >+ * css/StylePropertyShorthand.h: >+ > 2013-06-10 Christophe Dumez <ch.dumez@sisa.samsung.com> > > Replace [ConstructorRaisesException] with [RaisesException] >diff --git a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp >index 3a94ef88b3172bec1a1620245fe675e437213716..93df15fb01813b6ec10c11e8b5488f8f8a314f57 100644 >--- a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp >+++ b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp >@@ -2787,6 +2787,9 @@ PassRefPtr<CSSValue> ComputedStyleExtractor::propertyValue(CSSPropertyID propert > break; > > /* Unimplemented CSS 3 properties (including CSS3 shorthand properties) */ >+#if ENABLE(CSS3_TEXT) >+ case CSSPropertyWebkitTextDecoration: >+#endif // CSS3_TEXT > case CSSPropertyWebkitTextEmphasis: > case CSSPropertyTextLineThrough: > case CSSPropertyTextLineThroughColor: >diff --git a/Source/WebCore/css/CSSParser.cpp b/Source/WebCore/css/CSSParser.cpp >index 695f31d02b4cef8d3b1536e35479f7ed45b2a740..9ab8c6a608f057bad0c3186895f70e7fafe9a303 100644 >--- a/Source/WebCore/css/CSSParser.cpp >+++ b/Source/WebCore/css/CSSParser.cpp >@@ -7,6 +7,7 @@ > * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/) > * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. > * Copyright (C) 2012 Intel Corporation. All rights reserved. >+ * Copyright (C) 2012, 2013 basysKom GmbH. All rights reserved. > * > * This library is free software; you can redistribute it and/or > * modify it under the terms of the GNU Library General Public >@@ -2318,6 +2319,10 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important) > return parseTextDecoration(propId, important); > > #if ENABLE(CSS3_TEXT) >+ case CSSPropertyWebkitTextDecoration: >+ // [ <text-decoration-line> || <text-decoration-style> || <text-decoration-color> ] | inherit >+ return parseShorthand(CSSPropertyWebkitTextDecoration, webkitTextDecorationShorthand(), important); >+ > case CSSPropertyWebkitTextDecorationStyle: > // solid | double | dotted | dashed | wavy > if (id == CSSValueSolid || id == CSSValueDouble || id == CSSValueDotted || id == CSSValueDashed || id == CSSValueWavy) >@@ -9397,7 +9402,7 @@ void CSSParser::addTextDecorationProperty(CSSPropertyID propId, PassRefPtr<CSSVa > bool CSSParser::parseTextDecoration(CSSPropertyID propId, bool important) > { > CSSParserValue* value = m_valueList->current(); >- if (value->id == CSSValueNone) { >+ if (value && value->id == CSSValueNone) { > addTextDecorationProperty(propId, cssValuePool().createIdentifierValue(CSSValueNone), important); > m_valueList->next(); > return true; >@@ -9421,7 +9426,8 @@ bool CSSParser::parseTextDecoration(CSSPropertyID propId, bool important) > value = m_valueList->next(); > } > >- if (list->length() && isValid) { >+ // Values are either valid or in shorthand scope. >+ if (list->length() && (isValid || inShorthand())) { > addTextDecorationProperty(propId, list.release(), important); > return true; > } >diff --git a/Source/WebCore/css/CSSProperty.cpp b/Source/WebCore/css/CSSProperty.cpp >index 680aa5c0c2a818e3799102680cd6b56f88567cf3..a4b02813a019bcbb73595b16b05ceb7b1caad8d4 100644 >--- a/Source/WebCore/css/CSSProperty.cpp >+++ b/Source/WebCore/css/CSSProperty.cpp >@@ -329,6 +329,7 @@ bool CSSProperty::isInheritedProperty(CSSPropertyID propertyID) > case CSSPropertyWebkitRubyPosition: > case CSSPropertyWebkitTextCombine: > #if ENABLE(CSS3_TEXT) >+ case CSSPropertyWebkitTextDecoration: > case CSSPropertyWebkitTextDecorationLine: > case CSSPropertyWebkitTextAlignLast: > case CSSPropertyWebkitTextJustify: >diff --git a/Source/WebCore/css/CSSPropertyNames.in b/Source/WebCore/css/CSSPropertyNames.in >index fee824aa8221f95a87a219b5497ac20a6667f6fd..fca4f2fb737f15bcd3f1ad69cc1631ec3355c3e9 100644 >--- a/Source/WebCore/css/CSSPropertyNames.in >+++ b/Source/WebCore/css/CSSPropertyNames.in >@@ -378,6 +378,7 @@ z-index > -webkit-text-combine > -epub-text-combine = -webkit-text-combine > #if defined(ENABLE_CSS3_TEXT) && ENABLE_CSS3_TEXT >+-webkit-text-decoration > -webkit-text-decoration-line > -webkit-text-decoration-style > -webkit-text-decoration-color >diff --git a/Source/WebCore/css/StylePropertyShorthand.cpp b/Source/WebCore/css/StylePropertyShorthand.cpp >index ca4e8b2fa03a99a26ebdf2759eea95c3a4f6c6a3..11ed03b9a96a85572660318a8ea5615b709f0157 100644 >--- a/Source/WebCore/css/StylePropertyShorthand.cpp >+++ b/Source/WebCore/css/StylePropertyShorthand.cpp >@@ -440,6 +440,19 @@ const StylePropertyShorthand& webkitTextEmphasisShorthand() > return webkitTextEmphasisLonghands; > } > >+#if ENABLE(CSS3_TEXT) >+const StylePropertyShorthand& webkitTextDecorationShorthand() >+{ >+ static const CSSPropertyID textDecorationProperties[] = { >+ CSSPropertyWebkitTextDecorationLine, >+ CSSPropertyWebkitTextDecorationStyle, >+ CSSPropertyWebkitTextDecorationColor >+ }; >+ DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitTextDecorationLonghands, (textDecorationProperties, WTF_ARRAY_LENGTH(textDecorationProperties))); >+ return webkitTextDecorationLonghands; >+} >+#endif // CSS3_TEXT >+ > const StylePropertyShorthand& webkitTextStrokeShorthand() > { > static const CSSPropertyID textStrokeProperties[] = { CSSPropertyWebkitTextStrokeWidth, CSSPropertyWebkitTextStrokeColor }; >diff --git a/Source/WebCore/css/StylePropertyShorthand.h b/Source/WebCore/css/StylePropertyShorthand.h >index 2ae93563a8f57c5e1403cd7001cc6f9d3619f7b6..4df7541050c686a54083b85ab42fb40fb53b9dcc 100644 >--- a/Source/WebCore/css/StylePropertyShorthand.h >+++ b/Source/WebCore/css/StylePropertyShorthand.h >@@ -99,6 +99,9 @@ const StylePropertyShorthand& webkitMaskShorthand(); > const StylePropertyShorthand& webkitMaskPositionShorthand(); > const StylePropertyShorthand& webkitMaskRepeatShorthand(); > const StylePropertyShorthand& webkitTextEmphasisShorthand(); >+#if ENABLE(CSS3_TEXT) >+const StylePropertyShorthand& webkitTextDecorationShorthand(); >+#endif // CSS3_TEXT > const StylePropertyShorthand& webkitTextStrokeShorthand(); > const StylePropertyShorthand& webkitTransitionShorthand(); > const StylePropertyShorthand& webkitTransformOriginShorthand(); >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 7db962f153b95e19fd61e2aab61ef8ac2bb08a14..815543b8a98031bb10ca55e19093d055605189e4 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,15 @@ >+2013-06-10 Bruno de Oliveira Abinader <brunoabinader@gmail.com> >+ >+ [css3-text] Add support for "text-decoration" using CSS3 spec >+ https://bugs.webkit.org/show_bug.cgi?id=92000 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Added computed style test for '-webkit-text-decoration'. >+ >+ * fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand.html: Added. >+ * fast/css3-text/css3-text-decoration/getComputedStyle/script-tests/getComputedStyle-text-decoration-shorthand.js: Added. >+ > 2013-06-10 Mátyás Mustoha <mmatyas@inf.u-szeged.hu> > > Web Inspector: refactor statusBarItems getter in front-end. >diff --git a/LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand.html b/LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand.html >new file mode 100644 >index 0000000000000000000000000000000000000000..c0110adf66ee4847b1f2d3db3747a08aa7eeb418 >--- /dev/null >+++ b/LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand.html >@@ -0,0 +1,10 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<script src="../../../js/resources/js-test-pre.js"></script> >+</head> >+<body> >+<script src="script-tests/getComputedStyle-text-decoration-shorthand.js"></script> >+<script src="../../../js/resources/js-test-post.js"></script> >+</body> >+</html> >diff --git a/LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/script-tests/getComputedStyle-text-decoration-shorthand.js b/LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/script-tests/getComputedStyle-text-decoration-shorthand.js >new file mode 100644 >index 0000000000000000000000000000000000000000..2f8f4c02f13d9e8fae5c621679e443fe87e2ca6f >--- /dev/null >+++ b/LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/script-tests/getComputedStyle-text-decoration-shorthand.js >@@ -0,0 +1,64 @@ >+description("Test to make sure -webkit-text-decoration property is backwards compatible with CSS 2.1 and CSS 3 shorthand.") >+ >+var testContainer = document.createElement("div"); >+testContainer.contentEditable = true; >+document.body.appendChild(testContainer); >+ >+testContainer.innerHTML = '<div id="test">hello</div>'; >+ >+debug('Initial values:'); >+var e = document.getElementById('test'); >+shouldBeNull("e.style.getPropertyCSSValue('-webkit-text-decoration')"); >+ >+var computedStyle = window.getComputedStyle(e, null); >+shouldBeNull("computedStyle.getPropertyCSSValue('-webkit-text-decoration')"); >+debug(''); >+ >+debug('CSS2.1 backwards compatibility ("-webkit-text-decoration: underline overline line-through blink;"):'); >+e.style.webkitTextDecoration = "underline overline line-through blink"; >+shouldBe("e.style.getPropertyCSSValue('-webkit-text-decoration-line').toString()", "'[object CSSValueList]'"); >+shouldBe("e.style.getPropertyCSSValue('-webkit-text-decoration-line').cssText", "'underline overline line-through blink'"); >+shouldBe("e.style.getPropertyCSSValue('-webkit-text-decoration-style').toString()", "'[object CSSValue]'"); >+shouldBe("e.style.getPropertyCSSValue('-webkit-text-decoration-style').cssText", "'initial'"); >+shouldBe("e.style.getPropertyCSSValue('-webkit-text-decoration-color').toString()", "'[object CSSValue]'"); >+shouldBe("e.style.getPropertyCSSValue('-webkit-text-decoration-color').cssText", "'initial'"); >+ >+computedStyle = window.getComputedStyle(e, null); >+shouldBeNull("computedStyle.getPropertyCSSValue('-webkit-text-decoration')"); >+shouldBe("computedStyle.getPropertyCSSValue('-webkit-text-decoration-line').toString()", "'[object CSSValueList]'"); >+shouldBe("computedStyle.getPropertyCSSValue('-webkit-text-decoration-line').cssText", "'underline overline line-through'"); >+shouldBe("computedStyle.getPropertyCSSValue('-webkit-text-decoration-style').toString()", "'[object CSSPrimitiveValue]'"); >+shouldBe("computedStyle.getPropertyCSSValue('-webkit-text-decoration-style').cssText", "'solid'"); >+shouldBe("computedStyle.getPropertyCSSValue('-webkit-text-decoration-color').toString()", "'[object CSSPrimitiveValue]'"); >+shouldBe("computedStyle.getPropertyCSSValue('-webkit-text-decoration-color').cssText", "'rgb(0, 0, 0)'"); >+debug(''); >+ >+debug('CSS3 Shorthand ("-webkit-text-decoration: underline overline line-through blink dashed red;"):'); >+e.style.webkitTextDecoration = "underline overline line-through blink dashed red"; >+shouldBeNull("e.style.getPropertyCSSValue('-webkit-text-decoration')"); >+shouldBe("e.style.getPropertyCSSValue('-webkit-text-decoration-line').cssText", "'underline overline line-through blink'"); >+shouldBe("e.style.getPropertyCSSValue('-webkit-text-decoration-style').cssText", "'dashed'"); >+shouldBe("e.style.getPropertyCSSValue('-webkit-text-decoration-color').cssText", "'red'"); >+ >+computedStyle = window.getComputedStyle(e, null); >+shouldBeNull("computedStyle.getPropertyCSSValue('-webkit-text-decoration')"); >+shouldBe("computedStyle.getPropertyCSSValue('-webkit-text-decoration-line').toString()", "'[object CSSValueList]'"); >+shouldBe("computedStyle.getPropertyCSSValue('-webkit-text-decoration-line').cssText", "'underline overline line-through'"); >+shouldBe("computedStyle.getPropertyCSSValue('-webkit-text-decoration-style').cssText", "'dashed'"); >+shouldBe("computedStyle.getPropertyCSSValue('-webkit-text-decoration-color').cssText", "'rgb(255, 0, 0)'"); >+debug(''); >+ >+debug('Omitting text decoration color and/or style fallbacks to their initial values ("-webkit-text-decoration: underline;"):'); >+e.style.webkitTextDecoration = "underline"; >+shouldBeNull("e.style.getPropertyCSSValue('-webkit-text-decoration')"); >+shouldBe("e.style.getPropertyCSSValue('-webkit-text-decoration-line').cssText", "'underline'"); >+shouldBe("e.style.getPropertyCSSValue('-webkit-text-decoration-style').cssText", "'initial'"); >+shouldBe("e.style.getPropertyCSSValue('-webkit-text-decoration-color').cssText", "'initial'"); >+ >+computedStyle = window.getComputedStyle(e, null); >+shouldBeNull("computedStyle.getPropertyCSSValue('-webkit-text-decoration')"); >+shouldBe("computedStyle.getPropertyCSSValue('-webkit-text-decoration-line').cssText", "'underline'"); >+shouldBe("computedStyle.getPropertyCSSValue('-webkit-text-decoration-style').cssText", "'solid'"); >+shouldBe("computedStyle.getPropertyCSSValue('-webkit-text-decoration-color').cssText", "'rgb(0, 0, 0)'"); >+ >+document.body.removeChild(testContainer);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 92000
:
153811
|
155021
|
155146
|
157234
|
158833
|
159137
|
159170
|
161695
|
161702
|
170667
|
170972
|
171241
|
179064
|
193065
|
204163
|
204164
|
204165
|
204166
|
204338
|
206613
|
206619
|
209114