Bug 34397

Summary: Screen.availLeft should be signed
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: DOMAssignee: Simon Fraser (smfr) <simon.fraser>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, sam, simon.fraser
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Attachments:
Description Flags
Patch
none
Patch ap: review+

Description Simon Fraser (smfr) 2010-01-31 11:21:19 PST
Screen.availLeft and Screen.availTop should be unsigned, since they can be negative for screens to the left of/above the primary screen.
Comment 1 Simon Fraser (smfr) 2010-01-31 12:37:42 PST
Screen.availLeft and Screen.availTop should be *signed*
Comment 2 Simon Fraser (smfr) 2010-10-08 12:28:34 PDT
Created attachment 70275 [details]
Patch
Comment 3 Alexey Proskuryakov 2010-10-08 13:16:44 PDT
Comment on attachment 70275 [details]
Patch

+int Screen::availLeft() const
 {
     if (!m_frame)
         return 0;
     return static_cast<unsigned>(screenAvailableRect(m_frame->view()).x());

Why cast to unsigned?
Comment 4 Simon Fraser (smfr) 2010-10-08 13:21:44 PDT
Created attachment 70278 [details]
Patch
Comment 5 Simon Fraser (smfr) 2010-10-08 13:22:00 PDT
Fixed the casts.
Comment 6 Alexey Proskuryakov 2010-10-08 13:42:01 PDT
Comment on attachment 70278 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=70278&action=review

r=me

> WebCore/manual-tests/screen-availLeft.html:5
> +    <script type="text/javascript" charset="utf-8">

Charset is useless for inline scripts. But it's fine to land as is to make sure it's not causing a crash somewhere.

> WebCore/manual-tests/screen-availLeft.html:11
> +        function log(s)
> +        {
> +            var output = document.getElementById('output');
> +            output.innerHTML += s + "<br>";
> +        }

That's a lot of code for one lag() call.
Comment 7 Simon Fraser (smfr) 2010-10-12 14:06:59 PDT
http://trac.webkit.org/changeset/69599