From 7a2cfc4872ec27ef4ea5aa79f01dcb03a9a24d88 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 27 Jul 2021 15:17:31 -0400 Subject: remove link 'title' attributes that's just the 'href' (ru, part 4) (#1748) --- files/ru/web/api/windoworworkerglobalscope/btoa/index.html | 2 +- files/ru/web/api/windoworworkerglobalscope/settimeout/index.html | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'files/ru/web/api/windoworworkerglobalscope') diff --git a/files/ru/web/api/windoworworkerglobalscope/btoa/index.html b/files/ru/web/api/windoworworkerglobalscope/btoa/index.html index faae953fbd..24f0c7ab38 100644 --- a/files/ru/web/api/windoworworkerglobalscope/btoa/index.html +++ b/files/ru/web/api/windoworworkerglobalscope/btoa/index.html @@ -30,7 +30,7 @@ var decodedData = window.atob(encodedData); // decode the string

В большинстве браузеров, вызов window.btoa() на Unicode строке выбросит исключение Character Out Of Range (Символ вне допустимого диапазона).

-

Чтобы избежать этого, воспользуйтесь паттерном, предложенным Johan Sundström:

+

Чтобы избежать этого, воспользуйтесь паттерном, предложенным Johan Sundström:

function utf8_to_b64(str) {
     return window.btoa(unescape(encodeURIComponent(str)));
diff --git a/files/ru/web/api/windoworworkerglobalscope/settimeout/index.html b/files/ru/web/api/windoworworkerglobalscope/settimeout/index.html
index d8c826dd5c..dbc08996a2 100644
--- a/files/ru/web/api/windoworworkerglobalscope/settimeout/index.html
+++ b/files/ru/web/api/windoworworkerglobalscope/settimeout/index.html
@@ -228,19 +228,19 @@ window.setTimeout("alert(\"Hello World!\");", 500);
 
 

Минимальная/ максимальная задержка и вложенность таймаута

-

Historically browsers implement setTimeout() "clamping": successive setTimeout() calls with delay smaller than the "minimum delay" limit are forced to use at least the minimum delay. The minimum delay, DOM_MIN_TIMEOUT_VALUE, is 4 ms (stored in a preference in Firefox: dom.min_timeout_value), with a DOM_CLAMP_TIMEOUT_NESTING_LEVEL of 5ms.

+

Historically browsers implement setTimeout() "clamping": successive setTimeout() calls with delay smaller than the "minimum delay" limit are forced to use at least the minimum delay. The minimum delay, DOM_MIN_TIMEOUT_VALUE, is 4 ms (stored in a preference in Firefox: dom.min_timeout_value), with a DOM_CLAMP_TIMEOUT_NESTING_LEVEL of 5ms.

In fact, 4ms is specified by the HTML5 spec and is consistent across browsers released in 2010 and onward. Prior to {{ geckoRelease("5.0") }}, the minimum timeout value for nested timeouts was 10 ms.

In addition to "clamping", the timeout can also fire later when the page (or the OS/browser itself) is busy with other tasks.

-

To implement a 0 ms timeout in a modern browser, you can use {{ domxref("window.postMessage()") }} as described here.

+

To implement a 0 ms timeout in a modern browser, you can use {{ domxref("window.postMessage()") }} as described here.

Browsers including Internet Explorer, Chrome, Safari, and Firefox store the delay as a 32-bit signed Integer internally. This causes an Integer overflow when using delays larger than 2147483647, resulting in the timeout being executed immediately.

Неактивные вкладки

-

In {{ geckoRelease("5.0") }} and Chrome 11, timeouts are clamped to firing no more often than once per second (1000ms) in inactive tabs; see {{ bug(633421) }} for more information about this in Mozilla or crbug.com/66078 for details about this in Chrome.

+

In {{ geckoRelease("5.0") }} and Chrome 11, timeouts are clamped to firing no more often than once per second (1000ms) in inactive tabs; see {{ bug(633421) }} for more information about this in Mozilla or crbug.com/66078 for details about this in Chrome.

Совместимость с браузерами

@@ -248,7 +248,7 @@ window.setTimeout("alert(\"Hello World!\");", 500);

Спецификация

-

Part of DOM level 0, as specified in HTML5.

+

Part of DOM level 0, as specified in HTML5.

Также интересно

-- cgit v1.2.3-54-g00ecf