[Webkit-unassigned] [Bug 33857] [Qt] Need a public API for suspending/resuming DOM Objects on a page
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Jan 20 04:30:06 PST 2010
https://bugs.webkit.org/show_bug.cgi?id=33857
Kenneth Rohde Christiansen <kenneth at webkit.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #46941|review? |review-
Flag| |
--- Comment #7 from Kenneth Rohde Christiansen <kenneth at webkit.org> 2010-01-20 04:30:05 PST ---
(From update of attachment 46941)
>
> The API from QWebPage will call suspend/resume DOM Objects of the main frame
> and of all its children.
Add API to QWebPage so that it is possible to suspend/resume...
> * manual-tests/frames-multiple-active-dom-objects.html: Added.
> * manual-tests/resources/Elvis_with_parachute.gif: Added.
What is the license of this file?
> +// FIXME: add support to suspending/resuming of animated GIFs and plugins.
> +// Suspend DOM objects (JS timers, CSS animation, SVG animation) in this frame.
> +bool QWebFramePrivate::suspendDOMObjects()
> +{
> + if (!frame)
> + return false;
> +
> + AnimationController* controller = frame->animation();
> + if (!controller)
> + return false;
This seems wrong... what if you dont have a controller, can't you still suspend
the active DOM objects included by
doc->suspendActiveDOMObjects(); ?
> +
> + Document* doc = frame->document();
> + if (!doc)
> + return false;
> +
> + // JavaScript
> + doc->suspendActiveDOMObjects();
> +bool QWebFramePrivate::resumeDOMObjects()
same thing here
> + QList<QWebFrame *> subFrames = frame->childFrames();
Should be QList<QWebFrame*>. childFrames is probably a better name than
subFrames :-) and it is already used
> + QList<QWebFrame *>::const_iterator i;
> + for (i = subFrames.constBegin(); i != subFrames.constEnd() ; ++i) {
> + b = (b && suspendChildFrames((*i)));
> + }
> +
Don't use b, use a descriptive name.
> +bool QWebPagePrivate::resumeChildFrames(QWebFrame *frame)
Wrong coding style, QWebFrame* frame
> +{
> + if (!frame)
> + return false;
> +
> + bool b = frame->resumeDOMObjects();
> +
Don't use b
> + QList<QWebFrame *> subFrames = frame->childFrames();
> + QList<QWebFrame *>::const_iterator i;
Coding style
> +/*!
> + Resume all frames, starting at the main frame.
> + DOM Objects (JS timers, CSS and SVG animation) will be resumed.
DOM objects that were suspended, will be resumed.
> + bool suspendChildFrames(QWebFrame *frame);
> + bool resumeChildFrames(QWebFrame *frame);
Coding style
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list