WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-92000-20130819161717.patch (text/plain), 24.60 KB, created by
Bruno Abinader
on 2013-08-19 13:17:19 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Bruno Abinader
Created:
2013-08-19 13:17:19 PDT
Size:
24.60 KB
patch
obsolete
>Subversion Revision: 154286 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 078b34930611044e317282a152f2798208f45924..0f9b4efe4a14bf5a631880391c469505d5ee3968 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,34 @@ >+2013-08-19 Bruno de Oliveira Abinader <bruno.d@partner.samsung.com> >+ >+ [css3-text] Implement CSS3 text-decoration shorthand >+ https://bugs.webkit.org/show_bug.cgi?id=92000 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Implements the text-decoration shorthand (with -webkit- prefix), as specified by the CSS3 Text Decoration specification: >+ http://dev.w3.org/csswg/css-text-decor-3/#text-decoration-property >+ >+ Backported from Blink: >+ https://src.chromium.org/viewvc/blink?revision=156266&view=revision >+ >+ Tests: fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand-ordering.html >+ 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::addTextDecorationProperty): >+ (WebCore::CSSParser::parseTextDecoration): >+ * css/CSSProperty.cpp: >+ (WebCore::CSSProperty::isInheritedProperty): >+ * css/CSSPropertyNames.in: >+ * css/StylePropertyShorthand.cpp: >+ (WebCore::webkitTextDecorationShorthand): >+ (WebCore::shorthandForProperty): >+ (WebCore::matchingShorthandsForLonghand): >+ * css/StylePropertyShorthand.h: >+ > 2013-08-19 Pratik Solanki <psolanki@apple.com> > > <https://webkit.org/b/119918> Frame::selection() should return a reference >diff --git a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp >index 7058edbfe31d81e70348bf77154c46f1a62fcd9a..571596322087c9e506ff67e3b98ff6ca533f5663 100644 >--- a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp >+++ b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp >@@ -2293,6 +2293,8 @@ PassRefPtr<CSSValue> ComputedStyleExtractor::propertyValue(CSSPropertyID propert > case CSSPropertyTextDecoration: > return renderTextDecorationFlagsToCSSValue(style->textDecoration()); > #if ENABLE(CSS3_TEXT) >+ case CSSPropertyWebkitTextDecoration: >+ return getCSSPropertyValuesForShorthandProperties(webkitTextDecorationShorthand()); > case CSSPropertyWebkitTextDecorationLine: > return renderTextDecorationFlagsToCSSValue(style->textDecoration()); > case CSSPropertyWebkitTextDecorationStyle: >diff --git a/Source/WebCore/css/CSSParser.cpp b/Source/WebCore/css/CSSParser.cpp >index 38989b7a0c95f765e6743cb3a18d664e7f4f7b39..993b863d59f767c81c21994ebf321ee881364201 100644 >--- a/Source/WebCore/css/CSSParser.cpp >+++ b/Source/WebCore/css/CSSParser.cpp >@@ -2335,6 +2335,12 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important) > break; > } > >+#if ENABLE(CSS3_TEXT) >+ case CSSPropertyWebkitTextDecoration: >+ // [ <text-decoration-line> || <text-decoration-style> || <text-decoration-color> ] | inherit >+ return parseShorthand(CSSPropertyWebkitTextDecoration, webkitTextDecorationShorthand(), important); >+#endif // CSS3_TEXT >+ > case CSSPropertyTextDecoration: > case CSSPropertyWebkitTextDecorationsInEffect: > #if ENABLE(CSS3_TEXT) >@@ -9522,7 +9528,7 @@ void CSSParser::addTextDecorationProperty(CSSPropertyID propId, PassRefPtr<CSSVa > { > #if ENABLE(CSS3_TEXT) > // The text-decoration-line property takes priority over text-decoration, unless the latter has important priority set. >- if (propId == CSSPropertyTextDecoration && !important && m_currentShorthand == CSSPropertyInvalid) { >+ if (propId == CSSPropertyTextDecoration && !important && !inShorthand()) { > for (unsigned i = 0; i < m_parsedProperties.size(); ++i) { > if (m_parsedProperties[i].id() == CSSPropertyWebkitTextDecorationLine) > return; >@@ -9535,7 +9541,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; >@@ -9559,7 +9565,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 4aa8d1426fe170849985e3ad989d229d6681f9e0..aa62b8db09d8bc437fab2d2f13aa217369841d19 100644 >--- a/Source/WebCore/css/CSSProperty.cpp >+++ b/Source/WebCore/css/CSSProperty.cpp >@@ -656,6 +656,7 @@ bool CSSProperty::isInheritedProperty(CSSPropertyID propertyID) > case CSSPropertyWebkitPerspectiveOriginX: > case CSSPropertyWebkitPerspectiveOriginY: > #if ENABLE(CSS3_TEXT) >+ case CSSPropertyWebkitTextDecoration: > case CSSPropertyWebkitTextDecorationLine: > case CSSPropertyWebkitTextDecorationStyle: > case CSSPropertyWebkitTextDecorationColor: >diff --git a/Source/WebCore/css/CSSPropertyNames.in b/Source/WebCore/css/CSSPropertyNames.in >index b9b95d57e193130f6cc620319c3747f9e8a0c307..5c94db60d56ce091b37b36c4e9249f0389debb2d 100644 >--- a/Source/WebCore/css/CSSPropertyNames.in >+++ b/Source/WebCore/css/CSSPropertyNames.in >@@ -380,6 +380,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 5279e2d38fa35c0b8a402b6655f763ffef3cdfe0..740a09f1b112e59cec8ddff243f22a9e174b470d 100644 >--- a/Source/WebCore/css/StylePropertyShorthand.cpp >+++ b/Source/WebCore/css/StylePropertyShorthand.cpp >@@ -457,6 +457,19 @@ const StylePropertyShorthand& webkitMaskRepeatShorthand() > return webkitMaskRepeatLonghands; > } > >+#if ENABLE(CSS3_TEXT) >+const StylePropertyShorthand& webkitTextDecorationShorthand() >+{ >+ static const CSSPropertyID textDecorationProperties[] = { >+ CSSPropertyWebkitTextDecorationLine, >+ CSSPropertyWebkitTextDecorationStyle, >+ CSSPropertyWebkitTextDecorationColor >+ }; >+ DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitTextDecorationLonghands, (CSSPropertyWebkitTextDecoration, textDecorationProperties, WTF_ARRAY_LENGTH(textDecorationProperties))); >+ return webkitTextDecorationLonghands; >+} >+#endif // CSS3_TEXT >+ > const StylePropertyShorthand& webkitTextEmphasisShorthand() > { > static const CSSPropertyID textEmphasisProperties[] = { >@@ -597,6 +610,10 @@ const StylePropertyShorthand& shorthandForProperty(CSSPropertyID propertyID) > return webkitMaskPositionShorthand(); > case CSSPropertyWebkitMaskRepeat: > return webkitMaskRepeatShorthand(); >+#if ENABLE(CSS3_TEXT) >+ case CSSPropertyWebkitTextDecoration: >+ return webkitTextDecorationShorthand(); >+#endif // CSS3_TEXT > case CSSPropertyWebkitTextEmphasis: > return webkitTextEmphasisShorthand(); > case CSSPropertyWebkitTextStroke: >@@ -895,6 +912,14 @@ const Vector<const StylePropertyShorthand*> matchingShorthandsForLonghand(CSSPro > map.set(CSSPropertyWebkitMaskRepeatX, maskRepeat); > map.set(CSSPropertyWebkitMaskRepeatY, maskRepeat); > >+#if ENABLE(CSS3_TEXT) >+ Vector<const StylePropertyShorthand*, 3> textDecoration; >+ textDecoration.uncheckedAppend(&webkitTextDecorationShorthand()); >+ map.set(CSSPropertyWebkitTextDecorationLine, textDecoration); >+ map.set(CSSPropertyWebkitTextDecorationStyle, textDecoration); >+ map.set(CSSPropertyWebkitTextDecorationColor, textDecoration); >+#endif // CSS3_TEXT >+ > Vector<const StylePropertyShorthand*, 1> textEmphasis; > textEmphasis.uncheckedAppend(&webkitTextEmphasisShorthand()); > map.set(CSSPropertyWebkitTextEmphasisStyle, textEmphasis); >diff --git a/Source/WebCore/css/StylePropertyShorthand.h b/Source/WebCore/css/StylePropertyShorthand.h >index a3d1bb39dd66bee871649fb475e58bcef4bfffa8..ab1ef301dac7c675c15f53f1e53192b4b76c9202 100644 >--- a/Source/WebCore/css/StylePropertyShorthand.h >+++ b/Source/WebCore/css/StylePropertyShorthand.h >@@ -110,6 +110,9 @@ const StylePropertyShorthand& webkitMarqueeShorthand(); > const StylePropertyShorthand& webkitMaskShorthand(); > const StylePropertyShorthand& webkitMaskPositionShorthand(); > const StylePropertyShorthand& webkitMaskRepeatShorthand(); >+#if ENABLE(CSS3_TEXT) >+const StylePropertyShorthand& webkitTextDecorationShorthand(); >+#endif // CSS3_TEXT > const StylePropertyShorthand& webkitTextEmphasisShorthand(); > const StylePropertyShorthand& webkitTextStrokeShorthand(); > const StylePropertyShorthand& webkitTransitionShorthand(); >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index c9575acf75821aa13f7841d9062b432a6706647a..9e7eced93fc4dfb31c1eacffc78e87ca316e73c8 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,17 @@ >+2013-08-19 Bruno de Oliveira Abinader <bruno.d@partner.samsung.com> >+ >+ [css3-text] Implement CSS3 text-decoration shorthand >+ https://bugs.webkit.org/show_bug.cgi?id=92000 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Added computed style tests for text-decoration shorthand. >+ >+ * fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand-expected.txt: Added. >+ * fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand-ordering-expected.txt: Added. >+ * fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand-ordering.html: Added. >+ * fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand.html: Added. >+ > 2013-08-19 Chris Fleizach <cfleizach@apple.com> > > <https://webkit.org/b/119916> AX: WebKit is not exposing AXLanguage correctly >diff --git a/LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand-expected.txt b/LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..dc9ff2226b0aaf84a9648f062772a3d0bf4692ad >--- /dev/null >+++ b/LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand-expected.txt >@@ -0,0 +1,34 @@ >+Test to make sure -webkit-text-decoration property is backwards compatible with CSS 2.1 and CSS 3 shorthand. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+Initial values: >+PASS e.style.getPropertyCSSValue('-webkit-text-decoration') is null >+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration').cssText is 'none solid rgb(0, 0, 0)' >+PASS checkComputedStyleValue() is true >+ >+CSS2.1 backwards compatibility ("-webkit-text-decoration: underline overline line-through blink;"): >+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-line').cssText is 'underline overline line-through blink' >+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-line').cssText is 'underline overline line-through' >+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration').cssText is 'underline overline line-through solid rgb(0, 0, 0)' >+PASS checkComputedStyleValue() is true >+ >+CSS3 Shorthand ("-webkit-text-decoration: underline overline line-through blink dashed red;"): >+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration').cssText is 'underline overline line-through dashed rgb(255, 0, 0)' >+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-line').cssText is 'underline overline line-through' >+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-style').cssText is 'dashed' >+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-color').cssText is 'rgb(255, 0, 0)' >+PASS checkComputedStyleValue() is true >+ >+Omitting text decoration line resets to its initial value "none" ("-webkit-text-decoration: navy dotted;"): >+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration').cssText is 'none dotted rgb(0, 0, 128)' >+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-line').cssText is 'none' >+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-style').cssText is 'dotted' >+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-color').cssText is 'rgb(0, 0, 128)' >+PASS checkComputedStyleValue() is true >+ >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >diff --git a/LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand-ordering-expected.txt b/LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand-ordering-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..4df037723f3a6531df03e8b6197fc45dd66711ca >--- /dev/null >+++ b/LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand-ordering-expected.txt >@@ -0,0 +1,39 @@ >+Test to make sure -webkit-text-decoration longhand values are accepted in every possible ordering in shorthand. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+-line -style -color ordering (underline dashed red): >+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-line').cssText is 'underline' >+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-style').cssText is 'dashed' >+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-color').cssText is 'red' >+ >+-line -color -style ordering (overline blue dotted): >+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-line').cssText is 'overline' >+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-style').cssText is 'dotted' >+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-color').cssText is 'blue' >+ >+-style -line -color ordering (double line-through underline overline green): >+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-line').cssText is 'line-through underline overline' >+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-style').cssText is 'double' >+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-color').cssText is 'green' >+ >+-style -color -line ordering (wavy yellow line-through): >+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-line').cssText is 'line-through' >+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-style').cssText is 'wavy' >+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-color').cssText is 'yellow' >+ >+-color -line -style ordering (black underline solid): >+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-line').cssText is 'underline' >+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-style').cssText is 'solid' >+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-color').cssText is 'black' >+ >+-color style -line -style ordering (navy dashed overline): >+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-line').cssText is 'overline' >+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-style').cssText is 'dashed' >+PASS e.style.getPropertyCSSValue('-webkit-text-decoration-color').cssText is 'navy' >+ >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >diff --git a/LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand-ordering.html b/LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand-ordering.html >new file mode 100644 >index 0000000000000000000000000000000000000000..50327cb41fecc3ac6ac72e88cd516bb8c4bdbfe5 >--- /dev/null >+++ b/LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand-ordering.html >@@ -0,0 +1,69 @@ >+<!DOCTYPE html> >+<html> >+ <head> >+ <script src="../../../js/resources/js-test-pre.js"></script> >+ </head> >+ <body> >+ <script> >+ function testElementStyle(propertyJS, propertyCSS, value) >+ { >+ shouldBe("e.style.getPropertyCSSValue('" + propertyCSS + "').cssText", "'" + value + "'"); >+ } >+ >+ description("Test to make sure -webkit-text-decoration longhand values are accepted in every possible ordering in shorthand.") >+ >+ var testContainer = document.createElement("div"); >+ testContainer.contentEditable = true; >+ document.body.appendChild(testContainer); >+ >+ testContainer.innerHTML = '<div id="test">hello world</div>'; >+ >+ var e = document.getElementById('test'); >+ >+ debug("-line -style -color ordering (underline dashed red):"); >+ e.style.webkitTextDecoration = 'underline dashed red'; >+ testElementStyle("webkitTextDecorationLine", "-webkit-text-decoration-line", "underline"); >+ testElementStyle("webkitTextDecorationStyle", "-webkit-text-decoration-style", "dashed"); >+ testElementStyle("webkitTextDecorationColor", "-webkit-text-decoration-color", "red"); >+ debug(""); >+ >+ debug("-line -color -style ordering (overline blue dotted):"); >+ e.style.webkitTextDecoration = 'overline blue dotted'; >+ testElementStyle("webkitTextDecorationLine", "-webkit-text-decoration-line", "overline"); >+ testElementStyle("webkitTextDecorationStyle", "-webkit-text-decoration-style", "dotted"); >+ testElementStyle("webkitTextDecorationColor", "-webkit-text-decoration-color", "blue"); >+ debug(""); >+ >+ debug("-style -line -color ordering (double line-through underline overline green):"); >+ e.style.webkitTextDecoration = 'double line-through underline overline green'; >+ testElementStyle("webkitTextDecorationLine", "-webkit-text-decoration-line", "line-through underline overline"); >+ testElementStyle("webkitTextDecorationStyle", "-webkit-text-decoration-style", "double"); >+ testElementStyle("webkitTextDecorationColor", "-webkit-text-decoration-color", "green"); >+ debug(""); >+ >+ debug("-style -color -line ordering (wavy yellow line-through):"); >+ e.style.webkitTextDecoration = 'wavy yellow line-through'; >+ testElementStyle("webkitTextDecorationLine", "-webkit-text-decoration-line", "line-through"); >+ testElementStyle("webkitTextDecorationStyle", "-webkit-text-decoration-style", "wavy"); >+ testElementStyle("webkitTextDecorationColor", "-webkit-text-decoration-color", "yellow"); >+ debug(""); >+ >+ debug("-color -line -style ordering (black underline solid):"); >+ e.style.webkitTextDecoration = 'black underline solid'; >+ testElementStyle("webkitTextDecorationLine", "-webkit-text-decoration-line", "underline"); >+ testElementStyle("webkitTextDecorationStyle", "-webkit-text-decoration-style", "solid"); >+ testElementStyle("webkitTextDecorationColor", "-webkit-text-decoration-color", "black"); >+ debug(""); >+ >+ debug("-color style -line -style ordering (navy dashed overline):"); >+ e.style.webkitTextDecoration = 'navy dashed overline'; >+ testElementStyle("webkitTextDecorationLine", "-webkit-text-decoration-line", "overline"); >+ testElementStyle("webkitTextDecorationStyle", "-webkit-text-decoration-style", "dashed"); >+ testElementStyle("webkitTextDecorationColor", "-webkit-text-decoration-color", "navy"); >+ debug(""); >+ >+ document.body.removeChild(testContainer); >+ </script> >+ <script src="../../../js/resources/js-test-post.js"></script> >+ </body> >+</html> >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..7d33e5bd020a8d696e83d4494321f252ee66797d >--- /dev/null >+++ b/LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand.html >@@ -0,0 +1,72 @@ >+<!DOCTYPE html> >+<html> >+ <head> >+ <script src="../../../js/resources/js-test-pre.js"></script> >+ </head> >+ <body> >+ <script> >+ function testElementStyle(propertyJS, propertyCSS, value) >+ { >+ shouldBe("e.style.getPropertyCSSValue('" + propertyCSS + "').cssText", "'" + value + "'"); >+ } >+ >+ function testComputedStyle(propertyJS, propertyCSS, value) >+ { >+ computedStyle = window.getComputedStyle(e, null); >+ shouldBe("computedStyle.getPropertyCSSValue('" + propertyCSS + "').cssText", "'" + value + "'"); >+ } >+ >+ function checkComputedStyleValue() { >+ var before = window.getComputedStyle(e, null).getPropertyValue('-webkit-text-decoration'); >+ e.style.webkitTextDecoration = 'none'; >+ e.style.webkitTextDecoration = before; >+ return (window.getComputedStyle(e, null).getPropertyValue('-webkit-text-decoration') == before); >+ } >+ >+ 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 world</div>'; >+ >+ var e = document.getElementById('test'); >+ >+ debug('Initial values:'); >+ shouldBeNull("e.style.getPropertyCSSValue('-webkit-text-decoration')"); >+ testComputedStyle("webkitTextDecoration", "-webkit-text-decoration", "none solid rgb(0, 0, 0)"); >+ shouldBe("checkComputedStyleValue()", "true"); >+ debug(''); >+ >+ debug('CSS2.1 backwards compatibility ("-webkit-text-decoration: underline overline line-through blink;"):'); >+ e.style.webkitTextDecoration = "underline overline line-through blink"; >+ testElementStyle("webkitTextDecorationLine", "-webkit-text-decoration-line", "underline overline line-through blink"); >+ testComputedStyle("webkitTextDecorationLine", "-webkit-text-decoration-line", "underline overline line-through"); >+ testComputedStyle("webkitTextDecoration", "-webkit-text-decoration", "underline overline line-through solid rgb(0, 0, 0)"); >+ shouldBe("checkComputedStyleValue()", "true"); >+ debug(''); >+ >+ debug('CSS3 Shorthand ("-webkit-text-decoration: underline overline line-through blink dashed red;"):'); >+ e.style.webkitTextDecoration = "underline overline line-through blink dashed red"; >+ testComputedStyle("webkitTextDecoration", "-webkit-text-decoration", "underline overline line-through dashed rgb(255, 0, 0)"); >+ testComputedStyle("webkitTextDecorationLine", "-webkit-text-decoration-line", "underline overline line-through"); >+ testComputedStyle("webkitTextDecorationStyle", "-webkit-text-decoration-style", "dashed"); >+ testComputedStyle("webkitTextDecorationColor", "-webkit-text-decoration-color", "rgb(255, 0, 0)"); >+ shouldBe("checkComputedStyleValue()", "true"); >+ debug(''); >+ >+ debug('Omitting text decoration line resets to its initial value "none" ("-webkit-text-decoration: navy dotted;"):'); >+ e.style.webkitTextDecoration = "navy dotted"; >+ testComputedStyle("webkitTextDecoration", "-webkit-text-decoration", "none dotted rgb(0, 0, 128)"); >+ testComputedStyle("webkitTextDecorationLine", "-webkit-text-decoration-line", "none"); >+ testComputedStyle("webkitTextDecorationStyle", "-webkit-text-decoration-style", "dotted"); >+ testComputedStyle("webkitTextDecorationColor", "-webkit-text-decoration-color", "rgb(0, 0, 128)"); >+ shouldBe("checkComputedStyleValue()", "true"); >+ debug(''); >+ >+ document.body.removeChild(testContainer); >+ </script> >+ <script src="../../../js/resources/js-test-post.js"></script> >+ </body> >+</html>
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