Bug 135009

Summary: assign undefined value to Element property throws TypeError
Product: WebKit Reporter: ShihChi Huang <huge.huang+webkitbug>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Major CC: ap, ggaren, oliver, zalan
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: iPhone / iPad   
OS: Other   

Description ShihChi Huang 2014-07-16 22:50:14 PDT
Prior to iOS8 Safari / Safari 8.0 if we assign undefined to Element property (like document.body.scrollTop) it fallback to 0

```js
document.body.scrollTop = undefined;

TypeError: Type error
column: 110
line: 1
message: "Type error"
stack: "eval code↵eval@[native code]↵_evaluateOn↵_evaluateAndWrap↵evaluate"
__proto__: Error
```
Comment 1 Oliver Hunt 2014-07-17 17:08:11 PDT
Hmmm, this is complaining about assigning NaN (undefined is being number coerced)

Maybe due to fractional coordinates?
Comment 2 Alexey Proskuryakov 2014-07-17 17:11:46 PDT
Good point. Can you still reproduce with a current WebKit nightly? I thought that the fractional coordinate change was already undone.
Comment 3 Oliver Hunt 2014-07-17 17:13:06 PDT
I think this is a dupe of bug #134841
Comment 4 ShihChi Huang 2014-07-17 18:05:27 PDT
awesome, I cannot repro in webkit nightly r171105
Comment 5 zalan 2014-07-17 18:31:12 PDT
(In reply to comment #2)
> Good point. Can you still reproduce with a current WebKit nightly? I thought that the fractional coordinate change was already undone.

It's been reverted only for Element.scroll*. Other properties' (Element.offset*, Element.client*) return type is still double.

*** This bug has been marked as a duplicate of bug 134841 ***