Bug 66874 - Get rid of frame life support timer
Summary: Get rid of frame life support timer
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alexey Proskuryakov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-24 11:55 PDT by Alexey Proskuryakov
Modified: 2011-08-26 16:28 PDT (History)
9 users (show)

See Also:


Attachments
proposed patch (12.28 KB, patch)
2011-08-24 12:04 PDT, Alexey Proskuryakov
webkit.review.bot: commit-queue-
Details | Formatted Diff | Diff
with v8 build fixes (14.58 KB, patch)
2011-08-24 12:30 PDT, Alexey Proskuryakov
no flags Details | Formatted Diff | Diff
with devirtualized globalExec() (15.74 KB, patch)
2011-08-24 12:41 PDT, Alexey Proskuryakov
webkit.review.bot: commit-queue-
Details | Formatted Diff | Diff
Test case for the bug fixed in r7546 (2.89 KB, application/zip)
2011-08-24 15:58 PDT, Darin Adler
no flags Details
trying to fix v8 tests (17.34 KB, patch)
2011-08-24 16:58 PDT, Alexey Proskuryakov
ggaren: review+
webkit.review.bot: commit-queue-
Details | Formatted Diff | Diff
plus windows build fix, minus failed v8 fix (17.26 KB, patch)
2011-08-25 10:38 PDT, Alexey Proskuryakov
webkit.review.bot: commit-queue-
Details | Formatted Diff | Diff
Lets see if it fixes v8 crashes (17.82 KB, patch)
2011-08-25 18:54 PDT, Dmitry Titov
no flags Details | Formatted Diff | Diff
Same, with style fix. (17.82 KB, patch)
2011-08-25 18:57 PDT, Dmitry Titov
webkit.review.bot: commit-queue-
Details | Formatted Diff | Diff
patch for landing (19.54 KB, patch)
2011-08-26 12:24 PDT, Alexey Proskuryakov
webkit.review.bot: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Proskuryakov 2011-08-24 11:55:27 PDT
Postponing frame deletion on a zero delay timer makes behavior less predictable for both WebKit developers and JS developers. Frame lifetime shouldn't depend on JS execution.

Perhaps surprisingly, very few regression tests depend on the life support timer. There is a risk of web site regressions, but we'll see.
Comment 1 Geoffrey Garen 2011-08-24 12:00:01 PDT
I feel the same giddy fear that a 5-year-old might feel before launching a firecracker.
Comment 2 Alexey Proskuryakov 2011-08-24 12:04:33 PDT
Created attachment 105036 [details]
proposed patch

I'm surprised that I didn't need to add RefPtr protectors anywhere. My theory is that the keep alive timer wasn't working in some situations, so we had to fix all such issues over time already.
Comment 3 WebKit Review Bot 2011-08-24 12:22:21 PDT
Comment on attachment 105036 [details]
proposed patch

Attachment 105036 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/9488212
Comment 4 Geoffrey Garen 2011-08-24 12:30:33 PDT
Source/WebCore/bindings/v8/ScriptController.cpp: In member function 'WebCore::ScriptValue WebCore::ScriptController::evaluate(const WebCore::ScriptSourceCode&)':
Source/WebCore/bindings/v8/ScriptController.cpp:194: error: 'class WebCore::Frame' has no member named 'keepAlive'
make: *** [out/Release/obj.target/webcore_remaining/Source/WebCore/bindings/v8/ScriptController.o] Error 1

Ah, the v8 bindings. An epic contribution to the WebKit project.
Comment 5 Alexey Proskuryakov 2011-08-24 12:30:35 PDT
Created attachment 105044 [details]
with v8 build fixes
Comment 6 Geoffrey Garen 2011-08-24 12:32:14 PDT
> Source/WebCore/bindings/js/JSDOMWindowBase.h:-58
> -        virtual JSC::ExecState* globalExec();

You can make globalExec() in JavaScriptCore non-virtual now. The only reason it's virtual is to allow for this override.
Comment 7 Alexey Proskuryakov 2011-08-24 12:41:47 PDT
Created attachment 105046 [details]
with devirtualized globalExec()

Looks like I can!
Comment 8 Dmitry Titov 2011-08-24 15:50:14 PDT
I have run Layout tests on Chromium try bot with this patch applied and got following results: http://build.chromium.org/p/tryserver.chromium/builders/win_layout/builds/1362
It seems there are some crashes in tests that may be relevant. The crash stacks are in 'stdio' file of the "webkit tests' step.

Just curious, some patches in the past did not have layout tests, is it possible to verify what the issues they were fixing are not regressing? This is one example: http://trac.webkit.org/changeset/7546

Also, some changes in the past do not have information about them, like this one: http://trac.webkit.org/changeset/42417. Do we know what was fixed by them?
Comment 9 WebKit Review Bot 2011-08-24 15:54:25 PDT
Comment on attachment 105046 [details]
with devirtualized globalExec()

Attachment 105046 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/9510030

New failing tests:
http/tests/fileapi/create-blob-url-from-data-url.html
http/tests/websocket/tests/hybi/close-on-unload-reference-in-parent.html
fast/frames/iframe-scale-applied-twice.html
http/tests/websocket/tests/hybi/send-after-close-on-unload.html
http/tests/websocket/tests/hixie76/close-on-unload.html
http/tests/websocket/tests/hixie76/close-on-unload-reference-in-parent.html
fast/replaced/frame-removed-during-resize.html
http/tests/websocket/tests/hybi/close-on-unload.html
fast/dom/xmlhttprequest-constructor-in-detached-document.html
http/tests/websocket/tests/hixie76/send-after-close-on-unload.html
Comment 10 Darin Adler 2011-08-24 15:57:06 PDT
(In reply to comment #8)
> Just curious, some patches in the past did not have layout tests, is it possible to verify what the issues they were fixing are not regressing? This is one example: http://trac.webkit.org/changeset/7546

I can attach the test case from that bug.
Comment 11 Darin Adler 2011-08-24 15:58:24 PDT
Created attachment 105090 [details]
Test case for the bug fixed in r7546
Comment 12 Alexey Proskuryakov 2011-08-24 16:58:34 PDT
Created attachment 105096 [details]
trying to fix v8 tests

The test for r7546 passes for me with this patch.
Comment 13 Geoffrey Garen 2011-08-24 18:03:28 PDT
Comment on attachment 105096 [details]
trying to fix v8 tests

r=me, assuming tests pass.
Comment 14 WebKit Review Bot 2011-08-24 18:34:58 PDT
Comment on attachment 105096 [details]
trying to fix v8 tests

Attachment 105096 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/9513125

New failing tests:
http/tests/fileapi/create-blob-url-from-data-url.html
http/tests/websocket/tests/hybi/close-on-unload-reference-in-parent.html
fast/frames/iframe-scale-applied-twice.html
http/tests/websocket/tests/hybi/send-after-close-on-unload.html
http/tests/websocket/tests/hixie76/close-on-unload.html
http/tests/websocket/tests/hixie76/close-on-unload-reference-in-parent.html
fast/replaced/frame-removed-during-resize.html
http/tests/websocket/tests/hybi/close-on-unload.html
fast/dom/xmlhttprequest-constructor-in-detached-document.html
http/tests/websocket/tests/hixie76/send-after-close-on-unload.html
Comment 15 Alexey Proskuryakov 2011-08-24 22:04:53 PDT
So, my attempt to fix v8 bindings didn't work. Not sure how to proceed - is the agreement that we don't need to care about v8 bindings still in force? I'd certainly prefer to avoid introducing regressions, but I cannot fix v8 myself.
Comment 16 Adam Barth 2011-08-25 00:31:24 PDT
Can I help?  /me looks at the patch.
Comment 17 Adam Barth 2011-08-25 00:42:09 PDT
Is this code needed to make Magic iframes work?  I never fully understood how those worked.

This looks a bit complicated to figure out at 1am, but I can take a look tomorrow in more detail.  If you'd be willing to wait a day before landing this patch, hopefully we can land it in a clean way.
Comment 18 Darin Adler 2011-08-25 07:28:03 PDT
I don’t even know what “magic iframes” are. I’d love to learn.
Comment 19 Alexey Proskuryakov 2011-08-25 08:53:36 PDT
I think that it's about transferring live subframes between documents. I'm also suspicious of this case, although regression tests seem to pass. Perhaps Dmitry knows why these aren't affected.

I'm certainly willing to wait a day or even longer than that. Your help is very appreciated!
Comment 20 Adam Barth 2011-08-25 09:53:18 PDT
> I don’t even know what “magic iframes” are. I’d love to learn.

As Alexey says, it allows a web site to move an iframe from one document to another without causing it to reload (much like you can move a <video> element from one page to another without disrupting playback).  The idea came out of the discussion about global pages (or whatever it was called).  It's used, for example, to make the chat moles in Gmail pop out quickly.
Comment 21 Darin Adler 2011-08-25 09:57:12 PDT
I knew about the feature, but didn’t know about the “magic” name.
Comment 22 Alexey Proskuryakov 2011-08-25 10:38:59 PDT
Created attachment 105214 [details]
plus windows build fix, minus failed v8 fix
Comment 23 Dmitry Titov 2011-08-25 11:02:49 PDT
I will take a look at v8 issue later today if Adam won't beat me to it.

One of GMail engineers named the feature of transferring live iframe the "magic iframe" and it somehow stuck around :-)
Comment 24 WebKit Review Bot 2011-08-25 13:54:35 PDT
Comment on attachment 105214 [details]
plus windows build fix, minus failed v8 fix

Attachment 105214 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/9495607

New failing tests:
http/tests/fileapi/create-blob-url-from-data-url.html
http/tests/websocket/tests/hybi/close-on-unload-reference-in-parent.html
fast/frames/iframe-scale-applied-twice.html
http/tests/websocket/tests/hybi/send-after-close-on-unload.html
http/tests/websocket/tests/hixie76/close-on-unload.html
http/tests/websocket/tests/hixie76/close-on-unload-reference-in-parent.html
fast/replaced/frame-removed-during-resize.html
http/tests/websocket/tests/hybi/close-on-unload.html
fast/dom/xmlhttprequest-constructor-in-detached-document.html
http/tests/websocket/tests/hixie76/send-after-close-on-unload.html
Comment 25 Dmitry Titov 2011-08-25 18:54:16 PDT
Created attachment 105289 [details]
Lets see if it fixes v8 crashes

It's the latest Alexey's patch, with 2 protection pointes added in V8Proxy.cpp. Lets see what chromium EWS says.
Comment 26 Dmitry Titov 2011-08-25 18:57:51 PDT
Created attachment 105290 [details]
Same, with style fix.
Comment 27 WebKit Review Bot 2011-08-25 19:36:45 PDT
Comment on attachment 105290 [details]
Same, with style fix.

Attachment 105290 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/9510777

New failing tests:
fast/dom/xmlhttprequest-constructor-in-detached-document.html
Comment 28 Adam Barth 2011-08-25 19:42:01 PDT
That seems better.
Comment 29 Dmitry Titov 2011-08-25 20:55:07 PDT
I bet it needs another RefPtr somewhere.. Stay tuned.
Comment 30 Alexey Proskuryakov 2011-08-25 21:30:08 PDT
This test has some JSC bindings specific output, so it might just need custom results for v8. Fantastic!

The patch also needs more Windows build fixing...
Comment 31 Dmitry Titov 2011-08-25 22:57:26 PDT
Indeed, the remaining v8 test is failing because it needs v8-specific result (in LayoutTests/platform/chromium). Here is the diff:

-CONSOLE MESSAGE: line 12: ReferenceError: XMLHttpRequest constructor associated document is unavailable
+CONSOLE MESSAGE: line 12: Uncaught ReferenceError: XMLHttpRequest constructor's associated context is not available

You may leave it as is, Chromium WebKit gardener (Dave Levin for tomorrow) will be able to rebaseline it. Added him to Cc.
Comment 32 Alexey Proskuryakov 2011-08-26 12:24:40 PDT
Created attachment 105389 [details]
patch for landing

Thank you!

Fixed Windows build and added custom results for v8.
Comment 33 WebKit Review Bot 2011-08-26 13:29:48 PDT
Comment on attachment 105389 [details]
patch for landing

Rejecting attachment 105389 [details] from commit-queue.

Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 2

Last 500 characters of output:
tructor-in-detached-document.html = TEXT

Regressions: Unexpected image mismatch : (5)
  fast/text/atsui-multiple-renderers.html = IMAGE
  fast/text/international/danda-space.html = IMAGE
  fast/text/international/thai-baht-space.html = IMAGE
  fast/text/international/thai-line-breaks.html = IMAGE
  platform/chromium-linux/fast/text/international/complex-joining-using-gpos.html = IMAGE

Regressions: Unexpected image and text mismatch : (1)
  svg/custom/svg-fonts-word-spacing.html = IMAGE+TEXT



Full output: http://queues.webkit.org/results/9541170
Comment 34 WebKit Review Bot 2011-08-26 14:19:50 PDT
Attachment 105389 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/fast..." exit_code: 1

LayoutTests/ChangeLog:10:  Need whitespace between colon and description  [changelog/filechangedescriptionwhitespace] [5]
Total errors found: 1 in 13 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 35 David Levin 2011-08-26 14:22:34 PDT
(In reply to comment #34)
> Attachment 105389 [details] did not pass style-queue:
> 
> Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/fast..." exit_code: 1
> 
> LayoutTests/ChangeLog:10:  Need whitespace between colon and description  [changelog/filechangedescriptionwhitespace] [5]
> Total errors found: 1 in 13 files

Not a very descriptive error but there seems to be a missing colon on that line. (Not worth fixing the patch  imo.)
Comment 36 Dmitry Titov 2011-08-26 14:29:05 PDT
The test results look incorrect/unrelated. I run the tests in specified directories locally with the patch and it's all right.

The EWS may barf because the fast/dom/xmlhttprequest-constructor-in-detached-document.html is still failing. It will still fail because there are os-specific versions of the results captured that have to be removed in following dirs:
LayoutTests/platform/chromium-cg-mac
LayoutTests/platform/chromium-win

In presence of more-specific results they will be used first, that's why compare fails.
Comment 37 Alexey Proskuryakov 2011-08-26 14:44:37 PDT
I see. It's surprising that this test has custom results on some platforms for Chromium. Hopefully a common result will work now for all of them (but sadly, not the main cross-platform result).

Landed manually in <http://trac.webkit.org/changeset/93913> without Chromium test fixes, Dave is going to take care of these.
Comment 38 Dmitry Titov 2011-08-26 16:24:40 PDT
(In reply to comment #37)
> I see. It's surprising that this test has custom results on some platforms for Chromium.

They are identical results. The rebaselining tool that Chromium Webkit gardeners use at some point was not very particular about coalescing results across platforms. Also gardener can grab new snapshots from canary servers for particular platform while other servers did not yet run the test and so they don't have a snapshot that could be coalesced. We likely do have some duplication of results in platform/chromium because of various reasons.
Comment 39 David Levin 2011-08-26 16:28:04 PDT
(In reply to comment #38)
> (In reply to comment #37)
> > I see. It's surprising that this test has custom results on some platforms for Chromium.
> 
> They are identical results. The rebaselining tool that Chromium Webkit gardeners use at some point was not very particular about coalescing results across platforms. Also gardener can grab new snapshots from canary servers for particular platform while other servers did not yet run the test and so they don't have a snapshot that could be coalesced. We likely do have some duplication of results in platform/chromium because of various reasons.

The new tool does a good job of coalescing the results and when I rebaselined this, it got fixed up.

Disappointing that we have to have a different result at all (but at the moment I have no time to pursue that -- maybe in the distant future).