Bug 135009 - assign undefined value to Element property throws TypeError
Summary: assign undefined value to Element property throws TypeError
Status: RESOLVED DUPLICATE of bug 134841
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: iPhone / iPad Other
: P2 Major
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-16 22:50 PDT by ShihChi Huang
Modified: 2014-07-17 18:31 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 ***