Bug 35796 - Accept and bailout NULL widgets in ChromiumBridge
Summary: Accept and bailout NULL widgets in ChromiumBridge
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-05 10:05 PST by anton muhin
Modified: 2010-03-10 10:48 PST (History)
1 user (show)

See Also:


Attachments
Patch (1.20 KB, patch)
2010-03-05 10:09 PST, anton muhin
no flags Details | Formatted Diff | Diff
Patch (3.21 KB, patch)
2010-03-09 07:34 PST, anton muhin
no flags Details | Formatted Diff | Diff
Patch (3.21 KB, patch)
2010-03-09 07:47 PST, anton muhin
no flags Details | Formatted Diff | Diff
Patch (3.21 KB, patch)
2010-03-09 08:59 PST, anton muhin
fishd: review+
fishd: commit-queue+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description anton muhin 2010-03-05 10:05:29 PST
Accept and bailout NULL widgets in ChromiumBridge
Comment 1 anton muhin 2010-03-05 10:09:15 PST
Created attachment 50102 [details]
Patch
Comment 2 anton muhin 2010-03-05 10:10:42 PST
This a fix for http://code.google.com/p/chromium/issues/detail?id=36945
Comment 3 Darin Fisher (:fishd, Google) 2010-03-05 11:32:23 PST
Comment on attachment 50102 [details]
Patch

> diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
> index 93a474b..f2de64e 100644
> --- a/WebKit/chromium/ChangeLog
> +++ b/WebKit/chromium/ChangeLog
> @@ -1,3 +1,22 @@
> +2010-03-05  Anton Muhin  <antonm@chromium.org>
> +
> +        Reviewed by NOBODY (OOPS!).
> +
> +        Accept and bailout NULL widgets in ChromiumBridge
> +        https://bugs.webkit.org/show_bug.cgi?id=35796
> +
> +        * src/ChromiumBridge.cpp:
> +        (WebCore::toChromeClientImpl):
> +
> +2010-03-05  anton muhin  <antonm@google.com>
> +
> +        Reviewed by NOBODY (OOPS!).
> +
> +        Need a short description and bug URL (OOPS!)
> +
> +        * src/ChromiumBridge.cpp:
> +        (WebCore::toChromeClientImpl):

^^^ duplicate changelog entries?

also, please create a layout test for this.
Comment 4 anton muhin 2010-03-09 07:34:16 PST
Created attachment 50304 [details]
Patch
Comment 5 anton muhin 2010-03-09 07:37:47 PST
(In reply to comment #3)
> (From update of attachment 50102 [details])
> > diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
> > index 93a474b..f2de64e 100644
> > --- a/WebKit/chromium/ChangeLog
> > +++ b/WebKit/chromium/ChangeLog
> > @@ -1,3 +1,22 @@
> > +2010-03-05  Anton Muhin  <antonm@chromium.org>
> > +
> > +        Reviewed by NOBODY (OOPS!).
> > +
> > +        Accept and bailout NULL widgets in ChromiumBridge
> > +        https://bugs.webkit.org/show_bug.cgi?id=35796
> > +
> > +        * src/ChromiumBridge.cpp:
> > +        (WebCore::toChromeClientImpl):
> > +
> > +2010-03-05  anton muhin  <antonm@google.com>
> > +
> > +        Reviewed by NOBODY (OOPS!).
> > +
> > +        Need a short description and bug URL (OOPS!)
> > +
> > +        * src/ChromiumBridge.cpp:
> > +        (WebCore::toChromeClientImpl):
> 
> ^^^ duplicate changelog entries?
> 
> also, please create a layout test for this.

Darin, sorry for duplicate entry---removed.  And layout test added.  May you have another look?
Comment 6 anton muhin 2010-03-09 07:47:34 PST
Created attachment 50307 [details]
Patch
Comment 7 Darin Fisher (:fishd, Google) 2010-03-09 08:52:55 PST
Comment on attachment 50307 [details]
Patch

> +++ b/LayoutTests/fast/frames/iframe-access-screen-of-deleted.html
> @@ -0,0 +1,36 @@
> +<html>
> +<head>
> +    <script>
> +    function accessAttributes(s) {
> +        var value = 0;
> +        value = s.height;
> +        value = s.width;
> +        value = s.colorDepth;
> +        value = s.pixelDepth;
> +        value = s.availLeft;
> +        value = s.availTop;
> +        value = s.availHeight;
> +        value = s.availWidth;
> +    }
> +
> +    function runTests() {
> +        if (window.layoutTestController)
> +            layoutTestController.dumpAsText();
> +            
> +        var f = document.getElementById('theframe');
> +        var s = f.contentWindow.screen;
> +        accessAttributes(s);
> +
> +        // Now remove and check that we don't crash.
> +        f.parentNode.removeChild(f);
> +        accessAttributes(s);
> +    }
> +    </script>
> +</head>
> +<iframe id="theframe" src="resources/red.html"></iframe>
> +<body onload="runTests()">
> +<div>
> +This tests that accessing screen attributes doesn't crash even if containing form is removed from the parent.

nit: "form" -> "frame"
Comment 8 anton muhin 2010-03-09 08:59:44 PST
Created attachment 50312 [details]
Patch
Comment 9 anton muhin 2010-03-09 09:00:57 PST
(In reply to comment #7)
> (From update of attachment 50307 [details])
> > +++ b/LayoutTests/fast/frames/iframe-access-screen-of-deleted.html
> > @@ -0,0 +1,36 @@
> > +<html>
> > +<head>
> > +    <script>
> > +    function accessAttributes(s) {
> > +        var value = 0;
> > +        value = s.height;
> > +        value = s.width;
> > +        value = s.colorDepth;
> > +        value = s.pixelDepth;
> > +        value = s.availLeft;
> > +        value = s.availTop;
> > +        value = s.availHeight;
> > +        value = s.availWidth;
> > +    }
> > +
> > +    function runTests() {
> > +        if (window.layoutTestController)
> > +            layoutTestController.dumpAsText();
> > +            
> > +        var f = document.getElementById('theframe');
> > +        var s = f.contentWindow.screen;
> > +        accessAttributes(s);
> > +
> > +        // Now remove and check that we don't crash.
> > +        f.parentNode.removeChild(f);
> > +        accessAttributes(s);
> > +    }
> > +    </script>
> > +</head>
> > +<iframe id="theframe" src="resources/red.html"></iframe>
> > +<body onload="runTests()">
> > +<div>
> > +This tests that accessing screen attributes doesn't crash even if containing form is removed from the parent.
> 
> nit: "form" -> "frame"

Fixed.

Thanks a lot, Darin.  Could you r+ the last patch as well?
Comment 10 anton muhin 2010-03-10 04:30:14 PST
Landed by Darin:  http://trac.webkit.org/changeset/55748