Bug 112504 - [chromium] allow for synchronously clearing the content of a WebDocument
Summary: [chromium] allow for synchronously clearing the content of a WebDocument
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: jochen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-16 13:51 PDT by jochen
Modified: 2013-03-16 17:46 PDT (History)
6 users (show)

See Also:


Attachments
Patch (2.37 KB, patch)
2013-03-16 13:55 PDT, jochen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description jochen 2013-03-16 13:51:31 PDT
[chromium] allow for synchronously clearing the content of a WebDocument
Comment 1 jochen 2013-03-16 13:55:02 PDT
Created attachment 193446 [details]
Patch
Comment 2 WebKit Review Bot 2013-03-16 13:56:51 PDT
Please wait for approval from abarth@webkit.org, dglazkov@chromium.org, fishd@chromium.org, jamesr@chromium.org or tkent@chromium.org before submitting, as this patch contains changes to the Chromium public API. See also https://trac.webkit.org/wiki/ChromiumWebKitAPI.
Comment 3 Darin Fisher (:fishd, Google) 2013-03-16 14:09:26 PDT
Comment on attachment 193446 [details]
Patch

Did you consider navigating to about:blank?  Why not just do that?
Comment 4 jochen 2013-03-16 14:10:55 PDT
(In reply to comment #3)
> (From update of attachment 193446 [details])
> Did you consider navigating to about:blank?  Why not just do that?

that'll generate navigation signals
Comment 5 Darin Fisher (:fishd, Google) 2013-03-16 14:14:06 PDT
Why is that a problem?  You are trying to reset state between test runs, right?  Surely, navigation signals between test runs can be ignored, no?  Alternatively, what about starting out with a fresh RenderView for each test?  Is that too expensive?
Comment 6 jochen 2013-03-16 15:33:45 PDT
I experimented a bit around with navigating to about:blank, and it also works :)
Comment 7 Eric Seidel (no email) 2013-03-16 17:37:09 PDT
Comment on attachment 193446 [details]
Patch

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

> Source/WebKit/chromium/src/WebDocument.cpp:251
> +    unwrap<Document>()->setContent(String());

Ick.  This API really should die rather than get more callers.  Setting to about:blank should happen synchronously (And should be basically the same as that, no?)
Comment 8 jochen 2013-03-16 17:46:03 PDT
Comment on attachment 193446 [details]
Patch

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

>> Source/WebKit/chromium/src/WebDocument.cpp:251
>> +    unwrap<Document>()->setContent(String());
> 
> Ick.  This API really should die rather than get more callers.  Setting to about:blank should happen synchronously (And should be basically the same as that, no?)

not quite. Loading something will e.g. fire unonload handlers