Bug 22594 - Fetching inline style with foo.style.webkitTransition returns nothing
Summary: Fetching inline style with foo.style.webkitTransition returns nothing
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-02 11:26 PST by Simon Fraser (smfr)
Modified: 2008-12-07 22:59 PST (History)
2 users (show)

See Also:


Attachments
Testcase (849 bytes, text/html)
2008-12-02 14:48 PST, Simon Fraser (smfr)
no flags Details
Patch, testcase, changelog (6.60 KB, patch)
2008-12-07 22:29 PST, Simon Fraser (smfr)
mitz: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2008-12-02 11:26:26 PST
If an element has inline -webkit-transform style, reading back foo.style.webkitTransform returns nothing.
Comment 1 Simon Fraser (smfr) 2008-12-02 11:27:02 PST
Transition, not transform.
Comment 2 Simon Fraser (smfr) 2008-12-02 14:48:07 PST
Created attachment 25683 [details]
Testcase
Comment 3 Simon Fraser (smfr) 2008-12-02 14:49:37 PST
Patch is something like this:

diff --git a/WebCore/css/CSSMutableStyleDeclaration.cpp b/WebCore/css/CSSMutableStyleDeclaration.cpp
index ca0295a..8651761 100644
--- a/WebCore/css/CSSMutableStyleDeclaration.cpp
+++ b/WebCore/css/CSSMutableStyleDeclaration.cpp
@@ -201,6 +201,17 @@ String CSSMutableStyleDeclaration::getPropertyValue(int propertyID) const
                                        CSSPropertyWebkitMaskOrigin };
             return getLayeredShorthandValue(properties, 6);
         }
+        case CSSPropertyWebkitTransition: {
+            const int properties[4] = { CSSPropertyWebkitTransitionProperty, CSSPropertyWebkitTransitionDuration,
+                                        CSSPropertyWebkitTransitionTimingFunction, CSSPropertyWebkitTransitionDelay };
+            return getShorthandValue(properties, 4);
+        }
+        case CSSPropertyWebkitTransformOrigin: {
+            // FIXME: Is this correct? The code in cssparser.cpp is confusing
+            const int properties[2] = { CSSPropertyWebkitTransformOriginX,
+                                        CSSPropertyWebkitTransformOriginY };
+            return getLayeredShorthandValue(properties, 2);
+        }
 #if ENABLE(SVG)
         case CSSPropertyMarker: {
             RefPtr<CSSValue> value = getPropertyCSSValue(CSSPropertyMarkerStart);

but that isn't quite right. In the testcase, it prints "style: left 1s ease-in initial" when the delay is not in the shorthand. It should not print the "initial". Compare with "border".
Comment 4 Simon Fraser (smfr) 2008-12-02 14:52:09 PST
Also, 'all' doesn't show in the output. 'all' is broken in computed style, too.
Comment 5 Simon Fraser (smfr) 2008-12-07 22:06:35 PST
Taking.
Comment 6 Simon Fraser (smfr) 2008-12-07 22:29:34 PST
Created attachment 25836 [details]
Patch, testcase, changelog
Comment 7 mitz 2008-12-07 22:34:47 PST
Comment on attachment 25836 [details]
Patch, testcase, changelog

r=me, but feel free to use standard indentation in the change log :)
Comment 8 Simon Fraser (smfr) 2008-12-07 22:59:12 PST
Fixed the changelog.
Committing to http://svn.webkit.org/repository/webkit/trunk ...
	M	LayoutTests/ChangeLog
	A	LayoutTests/fast/css/transform-inline-style-expected.txt
	A	LayoutTests/fast/css/transform-inline-style.html
	M	WebCore/ChangeLog
	M	WebCore/css/CSSMutableStyleDeclaration.cpp
	M	WebCore/css/CSSParser.cpp
	M	WebCore/css/CSSStyleSelector.cpp
Committed r39090