/* *ThisSourceCodeFormissubjecttothetermsoftheMozillaPublic *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/// @return a FrameTimeout obtained by normalizing a raw timeout value. static FrameTimeout FromRawMilliseconds(int32_t aRawMilliseconds) { // Normalize all infinite timeouts to the same value. if (aRawMilliseconds < 0) { return FrameTimeout::Forever();
}
// Very small timeout values are problematic for two reasons: we don't want // to burn energy redrawing animated images extremely fast, and broken tools // generate these values when they actually want a "default" value, so such // images won't play back right without normalization. For some context, // see bug 890743, bug 125137, bug 139677, and bug 207059. The historical // behavior of IE and Opera was: // IE 6/Win: // 10 - 50ms is normalized to 100ms. // >50ms is used unnormalized. // Opera 7 final/Win: // 10ms is normalized to 100ms. // >10ms is used unnormalized. if (aRawMilliseconds >= 0 && aRawMilliseconds <= 10) { return FrameTimeout(100);
}
// The provided timeout value is OK as-is. return FrameTimeout(aRawMilliseconds);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.