Changeset 71424 in webkit
- Timestamp:
- Nov 5, 2010 9:38:46 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r71422 r71424 1 2010-11-05 Chris Marrin <cmarrin@apple.com> 2 3 Reviewed by Simon Fraser. 4 5 Make suspendAnimations/resumeAnimations and setCSSAnimations traverse through subframes and remember state 6 https://bugs.webkit.org/show_bug.cgi?id=46945 7 8 New test which starts animations in the page an in an iframe. Makes sure both animations 9 stop when suspendAnimations is called. I also added dot notation syntax to animation-test-helpers.js 10 that can dig down into iframes to values for testing. 11 12 * animations/animation-test-helpers.js: 13 (checkExpectedValue): 14 * animations/stop-animation-on-suspend-expected.txt: Added. 15 * animations/stop-animation-on-suspend.html: Added. 16 1 17 2010-11-05 Stephen White <senorblanco@chromium.org> 2 18 -
trunk/LayoutTests/animations/animation-test-helpers.js
r65107 r71424 24 24 are the ids of 2 elements, whose values are compared for equality. In this case the expected value is ignored 25 25 but the tolerance is used in the comparison. 26 27 If a string with a '.' is passed, this is an element in an iframe. The string before the dot is the iframe id 28 and the string after the dot is the element name in that iframe. 26 29 27 30 [3] If the CSS property name is "webkitTransform", expected value must be an array of 1 or more numbers corresponding to the matrix elements, … … 66 69 compareElements = true; 67 70 } 71 72 // Check for a dot separated string 73 var iframeId; 74 if (!compareElements) { 75 var array = elementId.split('.'); 76 if (array.length == 2) { 77 iframeId = array[0]; 78 elementId = array[1]; 79 } 80 } 68 81 69 82 if (animationName && hasPauseAnimationAPI && !layoutTestController.pauseAnimationAtTimeOnElementWithId(animationName, time, elementId)) { … … 80 93 var pass = true; 81 94 if (!property.indexOf("webkitTransform")) { 82 computedValue = window.getComputedStyle(document.getElementById(elementId)).webkitTransform; 95 var element; 96 if (iframeId) 97 element = document.getElementById(iframeId).contentDocument.getElementById(elementId); 98 else 99 element = document.getElementById(elementId); 100 101 computedValue = window.getComputedStyle(element).webkitTransform; 83 102 if (compareElements) { 84 103 computedValue2 = window.getComputedStyle(document.getElementById(elementId2)).webkitTransform; … … 109 128 } 110 129 } else if (property == "lineHeight") { 111 computedValue = parseInt(window.getComputedStyle(document.getElementById(elementId)).lineHeight); 130 var element; 131 if (iframeId) 132 element = document.getElementById(iframeId).contentDocument.getElementById(elementId); 133 else 134 element = document.getElementById(elementId); 135 136 computedValue = parseInt(window.getComputedStyle(element).lineHeight); 112 137 if (compareElements) { 113 138 computedValue2 = parseInt(window.getComputedStyle(document.getElementById(elementId2)).lineHeight); … … 117 142 pass = isCloseEnough(computedValue, expectedValue, tolerance); 118 143 } else { 119 var computedStyle = window.getComputedStyle(document.getElementById(elementId)).getPropertyCSSValue(property); 144 var element; 145 if (iframeId) 146 element = document.getElementById(iframeId).contentDocument.getElementById(elementId); 147 else 148 element = document.getElementById(elementId); 149 150 var computedStyle = window.getComputedStyle(element).getPropertyCSSValue(property); 120 151 computedValue = computedStyle.getFloatValue(CSSPrimitiveValue.CSS_NUMBER); 121 152 if (compareElements) { … … 130 161 if (compareElements) { 131 162 if (pass) 132 result += "PASS - \"" + property + "\" property for \"" + elementId + "\" and \"" + elementId2 + "\" elements at " + time + "s are close enough to each other" + "<br>"; 133 else 134 result += "FAIL - \"" + property + "\" property for \"" + elementId + "\" and \"" + elementId2 + "\" elements at " + time + "s saw: \"" + computedValue + "\" and \"" + computedValue2 + "\" which are not close enough to each other" + "<br>"; 163 result += "PASS - \"" + property + "\" property for \"" + elementId + "\" and \"" + elementId2 + 164 "\" elements at " + time + "s are close enough to each other" + "<br>"; 165 else 166 result += "FAIL - \"" + property + "\" property for \"" + elementId + "\" and \"" + elementId2 + 167 "\" elements at " + time + "s saw: \"" + computedValue + "\" and \"" + computedValue2 + 168 "\" which are not close enough to each other" + "<br>"; 135 169 } else { 170 var elementName; 171 if (iframeId) 172 elementName = iframeId + '.' + elementId; 173 else 174 elementName = elementId; 136 175 if (pass) 137 result += "PASS - \"" + property + "\" property for \"" + elementId + "\" element at " + time + "s saw something close to: " + expectedValue + "<br>"; 138 else 139 result += "FAIL - \"" + property + "\" property for \"" + elementId + "\" element at " + time + "s expected: " + expectedValue + " but saw: " + computedValue + "<br>"; 176 result += "PASS - \"" + property + "\" property for \"" + elementName + "\" element at " + time + 177 "s saw something close to: " + expectedValue + "<br>"; 178 else 179 result += "FAIL - \"" + property + "\" property for \"" + elementName + "\" element at " + time + 180 "s expected: " + expectedValue + " but saw: " + computedValue + "<br>"; 140 181 } 141 182 } -
trunk/WebCore/ChangeLog
r71415 r71424 1 2010-11-05 Chris Marrin <cmarrin@apple.com> 2 3 Reviewed by Simon Fraser. 4 5 Make suspendAnimations/resumeAnimations and setCSSAnimations traverse through subframes and remember state 6 https://bugs.webkit.org/show_bug.cgi?id=46945 7 8 Add new funtions to suspend and resume animations. The go through all subframes and suspend or resume them 9 recursively. 10 11 Test: animations/stop-animation-on-suspend.html 12 13 * WebCore.exp.in: 14 * page/Frame.cpp: 15 (WebCore::Frame::suspendAnimations): 16 (WebCore::Frame::resumeAnimations): 17 * page/Frame.h: 18 1 19 2010-11-05 Pavel Feldman <pfeldman@chromium.org> 2 20 -
trunk/WebCore/WebCore.exp.in
r71041 r71424 635 635 __ZN7WebCore5Frame10createViewERKNS_7IntSizeERKNS_5ColorEbS3_bNS_13ScrollbarModeEbS7_b 636 636 __ZN7WebCore5Frame14frameForWidgetEPKNS_6WidgetE 637 __ZN7WebCore5Frame16resumeAnimationsEv 637 638 __ZN7WebCore5Frame17setPageZoomFactorEf 638 639 __ZN7WebCore5Frame17setTextZoomFactorEf 640 __ZN7WebCore5Frame17suspendAnimationsEv 639 641 __ZN7WebCore5Frame23visiblePositionForPointERKNS_8IntPointE 640 642 __ZN7WebCore5Frame25matchLabelsAgainstElementEP7NSArrayPNS_7ElementE -
trunk/WebCore/page/Frame.cpp
r71339 r71424 990 990 } 991 991 992 void Frame::suspendAnimations() 993 { 994 animation()->suspendAnimations(document()); 995 996 // Handle subframes 997 for (Frame* child = tree()->firstChild(); child; child = child->tree()->nextSibling()) 998 child->suspendAnimations(); 999 } 1000 1001 void Frame::resumeAnimations() 1002 { 1003 animation()->resumeAnimations(document()); 1004 1005 // Handle subframes 1006 for (Frame* child = tree()->firstChild(); child; child = child->tree()->nextSibling()) 1007 child->resumeAnimations(); 1008 } 1009 992 1010 } // namespace WebCore -
trunk/WebCore/page/Frame.h
r70716 r71424 99 99 AnimationController* animation() const; 100 100 ScriptController* script(); 101 102 void suspendAnimations(); 103 void resumeAnimations(); 101 104 102 105 RenderView* contentRenderer() const; // Root of the render tree for the document contained in this frame. -
trunk/WebKit/gtk/ChangeLog
r71217 r71424 1 2010-11-05 Chris Marrin <cmarrin@apple.com> 2 3 Reviewed by Simon Fraser. 4 5 Make suspendAnimations/resumeAnimations and setCSSAnimations traverse through subframes and remember state 6 https://bugs.webkit.org/show_bug.cgi?id=46945 7 8 * webkit/webkitwebframe.cpp: 9 (webkit_web_frame_suspend_animations): 10 (webkit_web_frame_resume_animations): 11 1 12 2010-11-03 Daniel Bates <dbates@rim.com> 2 13 -
trunk/WebKit/gtk/webkit/webkitwebframe.cpp
r71217 r71424 1060 1060 return; 1061 1061 1062 AnimationController* controller = coreFrame->animation(); 1063 if (!controller) 1062 frame->suspendAnimations(); 1063 } 1064 1065 void webkit_web_frame_resume_animations(WebKitWebFrame* frame) 1066 { 1067 Frame* coreFrame = core(frame); 1068 if (!coreFrame) 1064 1069 return; 1065 1070 1066 controller->suspendAnimations(coreFrame->document()); 1067 } 1068 1069 void webkit_web_frame_resume_animations(WebKitWebFrame* frame) 1070 { 1071 Frame* coreFrame = core(frame); 1072 if (!coreFrame) 1073 return; 1074 1075 AnimationController* controller = coreFrame->animation(); 1076 if (!controller) 1077 return; 1078 1079 controller->resumeAnimations(coreFrame->document()); 1071 frame->resumeAnimations(); 1080 1072 } 1081 1073 -
trunk/WebKit/mac/ChangeLog
r71385 r71424 1 2010-11-05 Chris Marrin <cmarrin@apple.com> 2 3 Reviewed by Simon Fraser. 4 5 Make suspendAnimations/resumeAnimations and setCSSAnimations traverse through subframes and remember state 6 https://bugs.webkit.org/show_bug.cgi?id=46945 7 8 * WebView/WebFrame.mm: 9 (-[WebFrame _suspendAnimations]): 10 (-[WebFrame _resumeAnimations]): 11 1 12 2010-11-04 Jia Pu <jpu@apple.com> 2 13 -
trunk/WebKit/mac/WebView/WebFrame.mm
r71216 r71424 1137 1137 if (!frame) 1138 1138 return; 1139 1140 AnimationController* controller = frame->animation(); 1141 if (!controller) 1142 return; 1143 1144 controller->suspendAnimations(frame->document()); 1139 1140 frame->suspendAnimations(); 1145 1141 } 1146 1142 … … 1151 1147 return; 1152 1148 1153 AnimationController* controller = frame->animation(); 1154 if (!controller) 1155 return; 1156 1157 controller->resumeAnimations(frame->document()); 1149 frame->resumeAnimations(); 1158 1150 } 1159 1151 -
trunk/WebKit/win/ChangeLog
r71401 r71424 1 2010-11-05 Chris Marrin <cmarrin@apple.com> 2 3 Reviewed by Simon Fraser. 4 5 Make suspendAnimations/resumeAnimations and setCSSAnimations traverse through subframes and remember state 6 https://bugs.webkit.org/show_bug.cgi?id=46945 7 8 * WebFrame.cpp: 9 (WebFrame::suspendAnimations): 10 (WebFrame::resumeAnimations): 11 1 12 2010-11-05 Patrick Gansterer <paroga@webkit.org> 2 13 -
trunk/WebKit/win/WebFrame.cpp
r71216 r71424 1300 1300 return E_FAIL; 1301 1301 1302 AnimationController* controller = frame->animation(); 1303 if (!controller) 1304 return E_FAIL; 1305 1306 controller->suspendAnimations(frame->document()); 1302 frame->suspendAnimations(); 1307 1303 return S_OK; 1308 1304 } … … 1314 1310 return E_FAIL; 1315 1311 1316 AnimationController* controller = frame->animation(); 1317 if (!controller) 1318 return E_FAIL; 1319 1320 controller->resumeAnimations(frame->document()); 1312 frame->resumeAnimations(); 1321 1313 return S_OK; 1322 1314 }
Note: See TracChangeset
for help on using the changeset viewer.