Live data from Hacker News

A div that looks different in every browser

twitter.com

131–133 of 133 posts

Re: A div that looks different in every browser

#131
post #89

Earlier quoted context omitted.

Sorry yes for(in) over prototype chains is where mutation of the property list actually becomes visible -- mutating own properties on an object while iterating is specified IIRC, it's what happens when own properties alias properties in the prototype chain, or when mutating properties in the prototype chain. I blame Brendan :D

Pretty sure mutating own properties is undefined, but I'm years out of working on any JS VM and only vaguely pay attention (and looked into this a few months ago and was surprised to find iteration order still undefined!). I wonder how many unique behaviours we have with iteration order now… Is Gecko the only odd one out? Is there still any implementation that has different behaviour with dense/sparse arrays (by whic…

Own properties are well define (and were in 3.1 IIRC). Deleted properties are not visited, added properties are not visited.

But behavior when you deleted an own property that shadowed a property on the proto chain, and what happens when you add such property back.

Also the historic spec mandated integer properties on regular objects were iterated in insertion order as well, but V8 chose not to implement that as doing so broke their "Indexed properties are just an array" semantics. Because of the huge perf impact other browsers had to go down that same path.

Re: A div that looks different in every browser

#132
post #131

Earlier quoted context omitted.

Pretty sure mutating own properties is undefined, but I'm years out of working on any JS VM and only vaguely pay attention (and looked into this a few months ago and was surprised to find iteration order still undefined!). I wonder how many unique behaviours we have with iteration order now… Is Gecko the only odd one out? Is there still any implementation that has different behaviour with dense/sparse arrays (by whic…

Own properties are well define (and were in 3.1 IIRC). Deleted properties are not visited, added properties are not visited. But behavior when you deleted an own property that shadowed a property on the proto chain, and what happens when you add such property back. Also the historic spec mandated integer properties on regular objects were iterated in insertion order as well, but V8 chose not to implement that as doin…

Nah, the spec has never defined it; it never even mandated insertion order. (I remember a bunch of discussions about this given we, in Carakan, decided to match V8.) https://tc39.github.io/ecma262/#sec-enumerate-object-propert... is the current definition of object enumeration.

Re: A div that looks different in every browser

#133

Joke: A man walks into a picture framing shop and says: "I'd like a 10cmx10xm frame for my 10cmx10cm picture, but make it negative 12.5cm away from the picture." The shop staff is confused, but makes a wild guess: "So you want a frame with each border 2.5cm on the other side of the picture than it would normally be?" The man just takes a note and goes to another shop. He collected the wild guesses from various pictur…

I guess the post is supposed to demonstrate that there should be no "wild guessing", and instead each browser should be producing the same result.
Post reply on HN