Този сайт ще има ограничена функционалност, докато се извършва тече неговата поддръжка. Ако дадена статия не може реши проблема ви и искате да зададете въпрос, нашата общност е готова да ви помогне на @firefox в Twitter и /r/firefox в Reddit.

Търсене в помощните статии

Избягвайте измамите при поддръжката. Никога няма да ви помолим да се обадите или изпратите SMS на телефонен номер или да споделите лична информация. Моля, докладвайте подозрителна активност на "Докладване за злоупотреба".

Научете повече

An error in Firefox code

  • 2 отговора
  • 1 има този проблем
  • 15 изгледи
  • Последен отговор от guigs

more options

I am a web developer, and i am using Iceweasel 31.7.0 (which is based of Firefox) under Linux Debian wheezy.

A problem appears when i am writing a javascript code. My goal is to determine a size of screen (i am using typical pc, not any mobile device). So i am writing:

var body = window.document.body.style

// block to determine width body.height = '1px' for ( var i = 0; ; i++ ) {

  body.width = i + 'px'

window.document.documentElement.scrollLeft = 1

  if ( window.document.documentElement.scrollLeft != 0 )

break } i--

// block to determine height body.width = '1px' for ( var k = 0; ; k++ ) {

  body.height = k + 'px'

window.document.documentElement.scrollTop = 1

  if ( window.document.documentElement.scrollTop != 0 )

break } k--

body.width = ( i ) + 'px' body.height = ( k ) + 'px'


So after this code both scroll line appears! When it should not be because i an k variables are choosen maximum without scroll. And, moreover, an error disappears (both scroll lines disappears) when two blocks switched by place each other (first determine height, then width).

I'll appreciate at least confirmation that it is an error, even if you cannot provide a patch for Iceweasel. Thank you.

I am a web developer, and i am using Iceweasel 31.7.0 (which is based of Firefox) under Linux Debian wheezy. A problem appears when i am writing a javascript code. My goal is to determine a size of screen (i am using typical pc, not any mobile device). So i am writing: var body = window.document.body.style // block to determine width body.height = '1px' for ( var i = 0; ; i++ ) { body.width = i + 'px' window.document.documentElement.scrollLeft = 1 if ( window.document.documentElement.scrollLeft != 0 ) break } i-- // block to determine height body.width = '1px' for ( var k = 0; ; k++ ) { body.height = k + 'px' window.document.documentElement.scrollTop = 1 if ( window.document.documentElement.scrollTop != 0 ) break } k-- body.width = ( i ) + 'px' body.height = ( k ) + 'px' -------------------------------------------------------------------------------------------- So after this code both scroll line appears! When it should not be because i an k variables are choosen maximum without scroll. And, moreover, an error disappears (both scroll lines disappears) when two blocks switched by place each other (first determine height, then width). I'll appreciate at least confirmation that it is an error, even if you cannot provide a patch for Iceweasel. Thank you.

Всички отговори (2)

more options

I've called the big guys to help you. Good luck.

more options

Iceweasel is a rebranded version of Firefox and is maintained by the Debian community afaik. However I did take a look at the script and played a bit in jsfiddle. It looks like the scrollbars will appear anyway .

You might be able to get some better feedback in the stackoverflow.com forums as well: