Changeset 76194 in webkit
- Timestamp:
- Jan 19, 2011 6:59:06 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 13 added
- 33 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r76189 r76194 1 2011-01-19 James Robinson <jamesr@chromium.org> 2 3 Reviewed by Darin Fisher. 4 5 Implement mozilla's requestAnimationFrame API 6 https://bugs.webkit.org/show_bug.cgi?id=51218 7 8 Tests for window.webkitRequestAnimationFrame(). The new tests 9 are in the Skipped lists for platforms that do not set 10 ENABLE(REQUEST_ANIMATION_FRAME) - which is currently all but chromium. 11 12 * fast/animation/request-animation-frame-cancel-expected.txt: Added. 13 * fast/animation/request-animation-frame-cancel.html: Added. 14 Tests cancelling a callback within a webkitRequestAnimationFrame() callback. 15 * fast/animation/request-animation-frame-cancel2-expected.txt: Added. 16 * fast/animation/request-animation-frame-cancel2.html: Added. 17 Tests interactions between multiple webkitRequestAnimationFrame() callbacks. 18 * fast/animation/request-animation-frame-display-expected.txt: Added. 19 * fast/animation/request-animation-frame-display.html: Added. 20 Tests changing the display: property of an element within a callback. 21 * fast/animation/request-animation-frame-expected.txt: Added. 22 * fast/animation/request-animation-frame.html: Added. 23 Tests the basic use of window.webkitRequestAnimationFrame(). 24 * fast/animation/request-animation-frame-within-callback-expected.txt: Added. 25 * fast/animation/request-animation-frame-within-callback.html: Added. 26 Tests setting one webkit.webkitRequestAnimationFrame() callback within another. 27 * platform/gtk/Skipped: 28 * platform/mac/Skipped: 29 * platform/qt/Skipped: 30 * platform/win/Skipped: 31 1 32 2011-01-19 Dmitry Titov <dimich@chromium.org> 2 33 -
trunk/LayoutTests/platform/chromium/test_expectations.txt
r76171 r76194 3060 3060 BUGWK52061 DEBUG : transitions/transition-timing-function.html = PASS TEXT 3061 3061 3062 // These will fail on the canaries until a chromium-side features_overrides.gypi change lands 3063 BUG_JAMESR : fast/animation = TEXT 3064 3062 3065 // Failing since creation in http://trac.webkit.org/changeset/75308 3063 3066 BUG_ABARTH : svg/text/caret-in-svg-text.xhtml = TEXT -
trunk/LayoutTests/platform/gtk/Skipped
r76172 r76194 5589 5589 http/tests/xmlhttprequest/basic-auth-nopassword.html 5590 5590 5591 # Requires requestAnimationFrame support 5592 fast/animation/ 5593 5591 5594 # https://bugs.webkit.org/show_bug.cgi?id=52297 5592 5595 editing/input/page-up-down-scrolls.html -
trunk/LayoutTests/platform/mac/Skipped
r75683 r76194 281 281 # DRT does not support toggling caret browsing on / off 282 282 editing/selection/caret-mode-paragraph-keys-navigation.html 283 284 # Requires requestAnimationFrame support 285 fast/animation/ -
trunk/LayoutTests/platform/qt/Skipped
r76161 r76194 5088 5088 fast/text/emphasis-avoid-ruby.html 5089 5089 5090 # Requires requestAnimationFrame support 5091 fast/animation/ 5092 5090 5093 # https://bugs.webkit.org/show_bug.cgi?id=42578 5091 5094 # [Qt] DRT sideeffect revealed by r63657 and r75305 -
trunk/LayoutTests/platform/win/Skipped
r75970 r76194 1116 1116 editing/selection/caret-mode-paragraph-keys-navigation.html 1117 1117 1118 # DRT does not obey addURLToRedirect 1119 http/tests/loading/cross-origin-XHR-willLoadRequest.html 1118 # Requires requestAnimationFrame support 1119 fast/animation/ 1120 -
trunk/Source/WebCore/ChangeLog
r76192 r76194 1 2011-01-19 James Robinson <jamesr@chromium.org> 2 3 Reviewed by Darin Fisher. 4 5 Implement mozilla's requestAnimationFrame API 6 https://bugs.webkit.org/show_bug.cgi?id=51218 7 8 This implements mozilla's proposed requestAnimationFrame API. The idea with this API is that 9 an author driving an animation from script could use window.requestAnimationFrame(callback) 10 instead of window.setTimeout(callback, 0) to schedule their update logic and let the browser 11 decide when to update the animations. This avoids doing unnecessary work when the page content 12 is offscreen or is being displayed at a different framerate than what the page author expects. 13 14 Mozilla's proposal is here: https://developer.mozilla.org/en/DOM/window.mozRequestAnimationFrame 15 This implements window.mozRequestAnimationFrame as window.webkitRequestAnimationFrame with the 16 following changes: 17 *) Only the callback syntax is supported, there is no before paint event 18 *) webkitRequestAnimationFrame supports a second parameter Element to let the author indicate 19 what content they intend to animate. That way if the page is being displayed but the element 20 in question is offscreen, we can avoid invoking the callback. 21 *) No timestamp is provided to the caller and there is no window.animationStartTime property 22 (see https://bugs.webkit.org/show_bug.cgi?id=51952 for discussion of this property) 23 *) window.webkitRequestAnimationFrame returns a numerical id that can be used to cancel the callback 24 using window.cancelWebkitRequestAnimationFrame, to parallel window.setTimeout()/window.clearTime(). 25 26 The implementation depends on the embedder scheduling the callbacks since the callback invocation 27 depends on the page's visibility and the embedder's paint scheduling, neither of which are exposed 28 to WebCore. The expectation for the embedder is that at some point Chrome::scheduleAnimation() is 29 called FrameView::serviceScriptedAnimations() should be called for the associated Page's main frame. 30 Ideally serviceScriptedAnimations() would be called prior to rendering - although in practice the 31 embedder has to rate limit callbacks and may not be able to tie the callback directly to the 32 rendering loop. 33 34 Tests: fast/animation/request-animation-frame-cancel.html 35 fast/animation/request-animation-frame-cancel2.html 36 fast/animation/request-animation-frame-display.html 37 fast/animation/request-animation-frame-within-callback.html 38 fast/animation/request-animation-frame.html 39 40 * WebCore.gypi: 41 * dom/Document.cpp: 42 (WebCore::Document::Document): 43 (WebCore::Document::webkitRequestAnimationFrame): 44 (WebCore::Document::webkitCancelRequestAnimationFrame): 45 (WebCore::Document::serviceScriptedAnimations): 46 * dom/Document.h: 47 * dom/RequestAnimationFrameCallback.h: Added. 48 (WebCore::RequestAnimationFrameCallback::~RequestAnimationFrameCallback): 49 * dom/RequestAnimationFrameCallback.idl: Added. 50 * loader/EmptyClients.h: 51 (WebCore::EmptyChromeClient::scheduleAnimation): 52 * page/Chrome.cpp: 53 (WebCore::Chrome::scheduleAnimation): 54 * page/Chrome.h: 55 * page/ChromeClient.h: 56 * page/DOMWindow.cpp: 57 (WebCore::DOMWindow::webkitRequestAnimationFrame): 58 (WebCore::DOMWindow::webkitCancelRequestAnimationFrame): 59 * page/DOMWindow.h: 60 * page/DOMWindow.idl: 61 * page/FrameView.cpp: 62 (WebCore::FrameView::scheduleAnimation): 63 (WebCore::FrameView::serviceScriptedAnimations): 64 * page/FrameView.h: 65 * platform/HostWindow.h: 66 1 67 2011-01-13 Martin Robinson <mrobinson@igalia.com> 2 68 -
trunk/Source/WebCore/WebCore.gypi
r76189 r76194 76 76 'dom/Range.idl', 77 77 'dom/RangeException.idl', 78 'dom/RequestAnimationFrameCallback.idl', 78 79 'dom/Text.idl', 79 80 'dom/TextEvent.idl', … … 1316 1317 'dom/RangeBoundaryPoint.h', 1317 1318 'dom/RangeException.h', 1319 'dom/RequestAnimationFrameCallback.h', 1318 1320 'dom/RawDataDocumentParser.h', 1319 1321 'dom/RegisteredEventListener.cpp', -
trunk/Source/WebCore/dom/Document.cpp
r76107 r76194 207 207 #endif 208 208 209 #if ENABLE(REQUEST_ANIMATION_FRAME) 210 #include "RequestAnimationFrameCallback.h" 211 #endif 212 209 213 using namespace std; 210 214 using namespace WTF; … … 425 429 , m_directionSetOnDocumentElement(false) 426 430 , m_writingModeSetOnDocumentElement(false) 431 #if ENABLE(REQUEST_ANIMATION_FRAME) 432 , m_nextRequestAnimationFrameCallbackId(0) 433 #endif 427 434 { 428 435 m_document = this; … … 4943 4950 } 4944 4951 4952 #if ENABLE(REQUEST_ANIMATION_FRAME) 4953 int Document::webkitRequestAnimationFrame(PassRefPtr<RequestAnimationFrameCallback> callback, Element* e) 4954 { 4955 if (!m_requestAnimationFrameCallbacks) 4956 m_requestAnimationFrameCallbacks = new RequestAnimationFrameCallbackList; 4957 int id = m_nextRequestAnimationFrameCallbackId++; 4958 callback->m_firedOrCancelled = false; 4959 callback->m_id = id; 4960 callback->m_element = e; 4961 m_requestAnimationFrameCallbacks->append(callback); 4962 if (FrameView* v = view()) 4963 v->scheduleAnimation(); 4964 return id; 4965 } 4966 4967 void Document::webkitCancelRequestAnimationFrame(int id) 4968 { 4969 if (!m_requestAnimationFrameCallbacks) 4970 return; 4971 for (size_t i = 0; i < m_requestAnimationFrameCallbacks->size(); ++i) { 4972 if (m_requestAnimationFrameCallbacks->at(i)->m_id == id) { 4973 m_requestAnimationFrameCallbacks->at(i)->m_firedOrCancelled = true; 4974 m_requestAnimationFrameCallbacks->remove(i); 4975 return; 4976 } 4977 } 4978 } 4979 4980 void Document::serviceScriptedAnimations() 4981 { 4982 if (!m_requestAnimationFrameCallbacks) 4983 return; 4984 // We want to run the callback for all elements in the document that have registered 4985 // for a callback and that are visible. Running the callbacks can cause new callbacks 4986 // to be registered, existing callbacks to be cancelled, and elements to gain or lose 4987 // visibility so this code has to iterate carefully. 4988 4989 // FIXME: Currently, this code doesn't do any visibility tests beyond checking display: 4990 4991 // First, generate a list of callbacks to consider. Callbacks registered from this point 4992 // on are considered only for the "next" frame, not this one. 4993 RequestAnimationFrameCallbackList callbacks(*m_requestAnimationFrameCallbacks); 4994 4995 // Firing the callback may cause the visibility of other elements to change. To avoid 4996 // missing any callbacks, we keep iterating through the list of candiate callbacks and firing 4997 // them until nothing new becomes visible. 4998 bool firedCallback; 4999 do { 5000 firedCallback = false; 5001 // A previous iteration may have invalidated style (or layout). Update styles for each iteration 5002 // for now since all we check is the existence of a renderer. 5003 updateStyleIfNeeded(); 5004 for (size_t i = 0; i < callbacks.size(); ++i) { 5005 RequestAnimationFrameCallback* callback = callbacks[i].get(); 5006 if (!callback->m_firedOrCancelled && (!callback->m_element || callback->m_element->renderer())) { 5007 callback->m_firedOrCancelled = true; 5008 callback->handleEvent(); 5009 firedCallback = true; 5010 callbacks.remove(i); 5011 break; 5012 } 5013 } 5014 } while (firedCallback); 5015 5016 // Remove any callbacks we fired from the list of pending callbacks. 5017 for (size_t i = 0; i < m_requestAnimationFrameCallbacks->size();) { 5018 if (m_requestAnimationFrameCallbacks->at(i)->m_firedOrCancelled) 5019 m_requestAnimationFrameCallbacks->remove(i); 5020 else 5021 ++i; 5022 } 5023 5024 // In most cases we expect this list to be empty, so no need to keep around the vector's inline buffer. 5025 if (!m_requestAnimationFrameCallbacks->size()) 5026 m_requestAnimationFrameCallbacks.clear(); 5027 else if (FrameView* v = view()) 5028 v->scheduleAnimation(); 5029 } 5030 #endif 5031 4945 5032 #if ENABLE(TOUCH_EVENTS) 4946 5033 PassRefPtr<Touch> Document::createTouch(DOMWindow* window, EventTarget* target, int identifier, int pageX, int pageY, int screenX, int screenY, ExceptionCode&) const -
trunk/Source/WebCore/dom/Document.h
r76115 r76194 147 147 #endif 148 148 149 #if ENABLE(REQUEST_ANIMATION_FRAME) 150 class RequestAnimationFrameCallback; 151 #endif 152 149 153 typedef int ExceptionCode; 150 154 … … 1073 1077 const DocumentTiming* timing() const { return &m_documentTiming; } 1074 1078 1079 #if ENABLE(REQUEST_ANIMATION_FRAME) 1080 int webkitRequestAnimationFrame(PassRefPtr<RequestAnimationFrameCallback>, Element*); 1081 void webkitCancelRequestAnimationFrame(int id); 1082 void serviceScriptedAnimations(); 1083 #endif 1084 1075 1085 bool mayCauseFlashOfUnstyledContent() const; 1076 1086 … … 1392 1402 DocumentTiming m_documentTiming; 1393 1403 RefPtr<MediaQueryMatcher> m_mediaQueryMatcher; 1404 1405 #if ENABLE(REQUEST_ANIMATION_FRAME) 1406 typedef Vector<RefPtr<RequestAnimationFrameCallback> > RequestAnimationFrameCallbackList; 1407 OwnPtr<RequestAnimationFrameCallbackList> m_requestAnimationFrameCallbacks; 1408 int m_nextRequestAnimationFrameCallbackId; 1409 #endif 1394 1410 }; 1395 1411 -
trunk/Source/WebCore/loader/EmptyClients.h
r75523 r76194 158 158 virtual void delegatedScrollRequested(const IntSize&) { } 159 159 #endif 160 #if ENABLE(REQUEST_ANIMATION_FRAME) 161 virtual void scheduleAnimation() { } 162 #endif 160 163 161 164 virtual IntPoint screenToWindow(const IntPoint& p) const { return p; } -
trunk/Source/WebCore/page/Chrome.cpp
r75932 r76194 446 446 } 447 447 448 #if ENABLE(REQUEST_ANIMATION_FRAME) 449 void Chrome::scheduleAnimation() 450 { 451 m_client->scheduleAnimation(); 452 } 453 #endif 454 448 455 #if ENABLE(NOTIFICATIONS) 449 456 NotificationPresenter* Chrome::notificationPresenter() const -
trunk/Source/WebCore/page/Chrome.h
r74228 r76194 79 79 virtual void scrollbarsModeDidChange() const; 80 80 virtual void setCursor(const Cursor&); 81 #if ENABLE(REQUEST_ANIMATION_FRAME) 82 virtual void scheduleAnimation(); 83 #endif 81 84 82 85 void scrollRectIntoView(const IntRect&) const; -
trunk/Source/WebCore/page/ChromeClient.h
r75349 r76194 152 152 virtual void scrollbarsModeDidChange() const = 0; 153 153 virtual void setCursor(const Cursor&) = 0; 154 #if ENABLE(REQUEST_ANIMATION_FRAME) 155 virtual void scheduleAnimation() = 0; 156 #endif 154 157 // End methods used by HostWindow. 155 158 -
trunk/Source/WebCore/page/DOMWindow.cpp
r75932 r76194 106 106 #endif 107 107 108 #if ENABLE(REQUEST_ANIMATION_FRAME) 109 #include "RequestAnimationFrameCallback.h" 110 #endif 111 108 112 using std::min; 109 113 using std::max; … … 1461 1465 } 1462 1466 1467 #if ENABLE(REQUEST_ANIMATION_FRAME) 1468 int DOMWindow::webkitRequestAnimationFrame(PassRefPtr<RequestAnimationFrameCallback> callback, Element* e) 1469 { 1470 if (Document* d = document()) 1471 return d->webkitRequestAnimationFrame(callback, e); 1472 return 0; 1473 } 1474 1475 void DOMWindow::webkitCancelRequestAnimationFrame(int id) 1476 { 1477 if (Document* d = document()) 1478 d->webkitCancelRequestAnimationFrame(id); 1479 } 1480 #endif 1481 1463 1482 bool DOMWindow::addEventListener(const AtomicString& eventType, PassRefPtr<EventListener> listener, bool useCapture) 1464 1483 { -
trunk/Source/WebCore/page/DOMWindow.h
r76115 r76194 65 65 class WebKitPoint; 66 66 67 #if ENABLE(REQUEST_ANIMATION_FRAME) 68 class RequestAnimationFrameCallback; 69 #endif 70 67 71 struct WindowFeatures; 68 72 … … 237 241 int setInterval(PassOwnPtr<ScheduledAction>, int timeout, ExceptionCode&); 238 242 void clearInterval(int timeoutId); 243 244 // WebKit animation extensions 245 #if ENABLE(REQUEST_ANIMATION_FRAME) 246 int webkitRequestAnimationFrame(PassRefPtr<RequestAnimationFrameCallback>, Element*); 247 void webkitCancelRequestAnimationFrame(int id); 248 #endif 239 249 240 250 // Events -
trunk/Source/WebCore/page/DOMWindow.idl
r76115 r76194 235 235 // [Custom] long setInterval(in DOMString code, in long timeout); 236 236 void clearInterval(in long handle); 237 238 #if defined(ENABLE_REQUEST_ANIMATION_FRAME) 239 // WebKit animation extensions 240 long webkitRequestAnimationFrame(in [Callback] RequestAnimationFrameCallback callback, in Element element); 241 void webkitCancelRequestAnimationFrame(in long id); 242 #endif 237 243 238 244 // Base64 -
trunk/Source/WebCore/page/FrameView.cpp
r75832 r76194 343 343 } 344 344 345 #if ENABLE(REQUEST_ANIMATION_FRAME) 346 void FrameView::scheduleAnimation() 347 { 348 if (hostWindow()) 349 hostWindow()->scheduleAnimation(); 350 } 351 #endif 352 345 353 void FrameView::setMarginWidth(int w) 346 354 { … … 1645 1653 } 1646 1654 1655 #if ENABLE(REQUEST_ANIMATION_FRAME) 1656 void FrameView::serviceScriptedAnimations() 1657 { 1658 for (Frame* frame = m_frame.get(); frame; frame = frame->tree()->traverseNext()) 1659 frame->document()->serviceScriptedAnimations(); 1660 } 1661 #endif 1662 1647 1663 bool FrameView::isTransparent() const 1648 1664 { -
trunk/Source/WebCore/page/FrameView.h
r75803 r76194 63 63 virtual void invalidateRect(const IntRect&); 64 64 virtual void setFrameRect(const IntRect&); 65 #if ENABLE(REQUEST_ANIMATION_FRAME) 66 void scheduleAnimation(); 67 #endif 65 68 66 69 Frame* frame() const { return m_frame.get(); } … … 97 100 98 101 bool needsFullRepaint() const { return m_doFullRepaint; } 102 103 #if ENABLE(REQUEST_ANIMATION_FRAME) 104 void serviceScriptedAnimations(); 105 #endif 99 106 100 107 #if USE(ACCELERATED_COMPOSITING) -
trunk/Source/WebCore/platform/HostWindow.h
r71352 r76194 67 67 // Request that the cursor change. 68 68 virtual void setCursor(const Cursor&) = 0; 69 70 #if ENABLE(REQUEST_ANIMATION_FRAME) 71 virtual void scheduleAnimation() = 0; 72 #endif 69 73 }; 70 74 -
trunk/Source/WebKit/chromium/ChangeLog
r76162 r76194 1 2011-01-19 James Robinson <jamesr@chromium.org> 2 3 Reviewed by Darin Fisher. 4 5 Implement mozilla's requestAnimationFrame API 6 https://bugs.webkit.org/show_bug.cgi?id=51218 7 8 Chromium WebKit API support for window.webkitRequestAnimationFrame() 9 10 * features.gypi: 11 * public/WebWidget.h: 12 * public/WebWidgetClient.h: 13 (WebKit::WebWidgetClient::scheduleAnimation): 14 * src/ChromeClientImpl.cpp: 15 (WebKit::ChromeClientImpl::scheduleAnimation): 16 * src/ChromeClientImpl.h: 17 * src/WebPopupMenuImpl.cpp: 18 (WebKit::WebPopupMenuImpl::animate): 19 (WebKit::WebPopupMenuImpl::scheduleAnimation): 20 * src/WebPopupMenuImpl.h: 21 * src/WebViewImpl.cpp: 22 (WebKit::WebViewImpl::animate): 23 * src/WebViewImpl.h: 24 1 25 2011-01-19 Tony Chang <tony@chromium.org> 2 26 -
trunk/Source/WebKit/chromium/features.gypi
r74189 r76194 70 70 'ENABLE_ORIENTATION_EVENTS=0', 71 71 'ENABLE_PROGRESS_TAG=1', 72 'ENABLE_REQUEST_ANIMATION_FRAME=1', 72 73 'ENABLE_SHARED_WORKERS=1', 73 74 'ENABLE_SVG=1', -
trunk/Source/WebKit/chromium/public/WebWidget.h
r75276 r76194 56 56 // Called to resize the WebWidget. 57 57 virtual void resize(const WebSize&) = 0; 58 59 // Called to update imperative animation state. This should be called before 60 // paint, although the client can rate-limit these calls. 61 virtual void animate() = 0; 58 62 59 63 // Called to layout the WebWidget. This MUST be called before Paint, -
trunk/Source/WebKit/chromium/public/WebWidgetClient.h
r72058 r76194 57 57 virtual void scheduleComposite() { } 58 58 59 // Called when a call to WebWidget::animate is required 60 virtual void scheduleAnimation() { } 61 59 62 // Called when the widget acquires or loses focus, respectively. 60 63 virtual void didFocus() { } -
trunk/Source/WebKit/chromium/src/ChromeClientImpl.cpp
r76048 r76194 533 533 } 534 534 535 #if ENABLE(REQUEST_ANIMATION_FRAME) 536 void ChromeClientImpl::scheduleAnimation() 537 { 538 m_webView->client()->scheduleAnimation(); 539 } 540 #endif 541 535 542 void ChromeClientImpl::scroll( 536 543 const IntSize& scrollDelta, const IntRect& scrollRect, -
trunk/Source/WebKit/chromium/src/ChromeClientImpl.h
r76048 r76194 106 106 virtual void invalidateContentsAndWindow(const WebCore::IntRect&, bool); 107 107 virtual void invalidateContentsForSlowScroll(const WebCore::IntRect&, bool); 108 #if ENABLE(REQUEST_ANIMATION_FRAME) 109 virtual void scheduleAnimation(); 110 #endif 108 111 virtual void scroll( 109 112 const WebCore::IntSize& scrollDelta, const WebCore::IntRect& rectToScroll, -
trunk/Source/WebKit/chromium/src/WebPopupMenuImpl.cpp
r75276 r76194 152 152 } 153 153 154 void WebPopupMenuImpl::animate() 155 { 156 } 157 154 158 void WebPopupMenuImpl::layout() 155 159 { … … 300 304 } 301 305 306 void WebPopupMenuImpl::scheduleAnimation() 307 { 308 } 309 302 310 void WebPopupMenuImpl::scroll(const IntSize& scrollDelta, 303 311 const IntRect& scrollRect, -
trunk/Source/WebKit/chromium/src/WebPopupMenuImpl.h
r75276 r76194 62 62 virtual WebSize size() { return m_size; } 63 63 virtual void resize(const WebSize&); 64 virtual void animate(); 64 65 virtual void layout(); 65 66 virtual void paint(WebCanvas* canvas, const WebRect& rect); … … 106 107 virtual void invalidateContentsAndWindow(const WebCore::IntRect&, bool); 107 108 virtual void invalidateContentsForSlowScroll(const WebCore::IntRect&, bool); 109 virtual void scheduleAnimation(); 108 110 virtual void scroll( 109 111 const WebCore::IntSize& scrollDelta, const WebCore::IntRect& scrollRect, -
trunk/Source/WebKit/chromium/src/WebViewImpl.cpp
r75982 r76194 973 973 } 974 974 975 void WebViewImpl::animate() 976 { 977 #if ENABLE(REQUEST_ANIMATION_FRAME) 978 WebFrameImpl* webframe = mainFrameImpl(); 979 if (webframe) { 980 FrameView* view = webframe->frameView(); 981 if (view) 982 view->serviceScriptedAnimations(); 983 } 984 #endif 985 } 986 975 987 void WebViewImpl::layout() 976 988 { -
trunk/Source/WebKit/chromium/src/WebViewImpl.h
r75815 r76194 92 92 virtual WebSize size() { return m_size; } 93 93 virtual void resize(const WebSize&); 94 virtual void animate(); 94 95 virtual void layout(); 95 96 virtual void paint(WebCanvas*, const WebRect&); -
trunk/Tools/ChangeLog
r76190 r76194 1 2011-01-19 James Robinson <jamesr@chromium.org> 2 3 Reviewed by Darin Fisher. 4 5 Implement mozilla's requestAnimationFrame API 6 https://bugs.webkit.org/show_bug.cgi?id=51218 7 8 Chromium DumpRenderTree support for window.webkitRequestAnimationFrame. 9 10 * DumpRenderTree/chromium/WebViewHost.cpp: 11 (invokeScheduleComposite): 12 (WebViewHost::scheduleAnimation): 13 (WebViewHost::paintInvalidatedRegion): 14 * DumpRenderTree/chromium/WebViewHost.h: 15 1 16 2011-01-19 Dirk Pranke <dpranke@chromium.org> 2 17 -
trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp
r75875 r76194 625 625 } 626 626 627 #if ENABLE(REQUEST_ANIMATION_FRAME) 628 static void invokeScheduleComposite(void* context) 629 { 630 WebViewHost* wvh = static_cast<WebViewHost*>(context); 631 wvh->scheduleComposite(); 632 } 633 634 void WebViewHost::scheduleAnimation() 635 { 636 webkit_support::PostDelayedTask(invokeScheduleComposite, this, 0); 637 } 638 #endif 639 627 640 void WebViewHost::didFocus() 628 641 { … … 1439 1452 void WebViewHost::paintInvalidatedRegion() 1440 1453 { 1454 #if ENABLE(REQUEST_ANIMATION_FRAME) 1455 webWidget()->animate(); 1456 #endif 1441 1457 webWidget()->layout(); 1442 1458 WebSize widgetSize = webWidget()->size(); -
trunk/Tools/DumpRenderTree/chromium/WebViewHost.h
r75875 r76194 148 148 virtual void didScrollRect(int dx, int dy, const WebKit::WebRect&); 149 149 virtual void scheduleComposite(); 150 #if ENABLE(REQUEST_ANIMATION_FRAME) 151 virtual void scheduleAnimation(); 152 #endif 150 153 virtual void didFocus(); 151 154 virtual void didBlur();
Note: See TracChangeset
for help on using the changeset viewer.