Bug 34397 - Screen.availLeft should be signed
Summary: Screen.availLeft should be signed
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-31 11:21 PST by Simon Fraser (smfr)
Modified: 2010-10-12 14:07 PDT (History)
3 users (show)

See Also:


Attachments
Patch (3.90 KB, patch)
2010-10-08 12:28 PDT, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff
Patch (4.15 KB, patch)
2010-10-08 13:21 PDT, Simon Fraser (smfr)
ap: review+
Details | Formatted Diff | Diff

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