Bug 42679 - WebKitTestRunner needs layoutTestController.setUserStyleSheetEnabled
Summary: WebKitTestRunner needs layoutTestController.setUserStyleSheetEnabled
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks: 87284
  Show dependency treegraph
 
Reported: 2010-07-20 15:11 PDT by Sam Weinig
Modified: 2012-08-02 10:37 PDT (History)
11 users (show)

See Also:


Attachments
Patch (11.42 KB, patch)
2012-05-18 17:36 PDT, Dinu Jacob
no flags Details | Formatted Diff | Diff
Patch (11.41 KB, patch)
2012-05-18 17:41 PDT, Dinu Jacob
no flags Details | Formatted Diff | Diff
Test for EWS (24.74 KB, patch)
2012-05-23 17:48 PDT, Dinu Jacob
no flags Details | Formatted Diff | Diff
Test Patch for EWS (24.77 KB, patch)
2012-05-23 18:11 PDT, Dinu Jacob
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ec2-cr-linux-02 (610.86 KB, application/zip)
2012-05-23 19:19 PDT, WebKit Review Bot
no flags Details
Patch (11.38 KB, patch)
2012-05-24 13:36 PDT, Dinu Jacob
darin: review-
Details | Formatted Diff | Diff
Patch with fixes (11.40 KB, patch)
2012-05-24 18:58 PDT, Dinu Jacob
eric: review+
Details | Formatted Diff | Diff
Rebased patch for landing (10.99 KB, patch)
2012-08-02 08:28 PDT, Dinu Jacob
buildbot: commit-queue-
Details | Formatted Diff | Diff
Rebased patch (10.76 KB, patch)
2012-08-02 09:07 PDT, Dinu Jacob
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Weinig 2010-07-20 15:11:06 PDT
WebKitTestRunner needs layoutTestController.setUserStyleSheetEnabled
Comment 1 Sam Weinig 2010-07-20 15:32:52 PDT
<rdar://problem/8213865>
Comment 2 Dinu Jacob 2012-05-18 17:36:01 PDT
Created attachment 142830 [details]
Patch
Comment 3 WebKit Review Bot 2012-05-18 17:37:55 PDT
Attachment 142830 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/plat..." exit_code: 1
Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h:101:  The parameter name "location" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 1 in 10 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Dinu Jacob 2012-05-18 17:41:23 PDT
Created attachment 142832 [details]
Patch
Comment 5 Caio Marcelo de Oliveira Filho 2012-05-23 06:42:00 PDT
Thanks for the patch Dinu Jacob!

However setUserStyleSheetEnabled seems a good candidate to be added to window.internals.settings (WebCore/testing/InternalSettings) instead of LayoutTestController, because it just sets a property in the page's Settings.

That would avoid the creation of new private C API for the bundle, and possibly remove code from other ports. I did a similar patch for another setting in bug 42689. I am not a reviewer, but my suggestion is you go that route: add it to window.internals.settings.
Comment 6 Dinu Jacob 2012-05-23 11:09:16 PDT
(In reply to comment #5)
> Thanks for the patch Dinu Jacob!
> 
> However setUserStyleSheetEnabled seems a good candidate to be added to window.internals.settings (WebCore/testing/InternalSettings) instead of LayoutTestController, because it just sets a property in the page's Settings.
> 
> That would avoid the creation of new private C API for the bundle, and possibly remove code from other ports. I did a similar patch for another setting in bug 42689. I am not a reviewer, but my suggestion is you go that route: add it to window.internals.settings.

Yes, it came to me as an after thought :( I will update the patch use Internals.
Comment 7 Dinu Jacob 2012-05-23 17:48:55 PDT
Created attachment 143690 [details]
Test for EWS
Comment 8 Dinu Jacob 2012-05-23 18:11:01 PDT
Created attachment 143691 [details]
Test Patch for EWS
Comment 9 Build Bot 2012-05-23 18:41:27 PDT
Comment on attachment 143691 [details]
Test Patch for EWS

Attachment 143691 [details] did not pass win-ews (win):
Output: http://queues.webkit.org/results/12800026
Comment 10 WebKit Review Bot 2012-05-23 19:19:39 PDT
Comment on attachment 143691 [details]
Test Patch for EWS

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

New failing tests:
http/tests/security/local-user-CSS-from-remote.html
fast/loader/user-style-sheet-resource-load-callbacks.html
Comment 11 WebKit Review Bot 2012-05-23 19:19:44 PDT
Created attachment 143703 [details]
Archive of layout-test-results from ec2-cr-linux-02

The attached test failures were seen while running run-webkit-tests on the chromium-ews.
Bot: ec2-cr-linux-02  Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'>  Platform: Linux-2.6.35-28-virtual-x86_64-with-Ubuntu-10.10-maverick
Comment 12 Dinu Jacob 2012-05-24 13:35:00 PDT
(In reply to comment #6)
> (In reply to comment #5)
> > Thanks for the patch Dinu Jacob!
> > 
> > However setUserStyleSheetEnabled seems a good candidate to be added to window.internals.settings (WebCore/testing/InternalSettings) instead of LayoutTestController, because it just sets a property in the page's Settings.
> > 
> > That would avoid the creation of new private C API for the bundle, and possibly remove code from other ports. I did a similar patch for another setting in bug 42689. I am not a reviewer, but my suggestion is you go that route: add it to window.internals.settings.
> 
> Yes, it came to me as an after thought :( I will update the patch use Internals.

setUserStyleSheetEnabled is tied to setUserStyleSheetLocation. Currently Chromium retrieves the data from the css file and that is the string being set instead of the local file path in its dumpRenderTree implementation. Hence, can't use Internals Settings to replace the current implementation.
Comment 13 Dinu Jacob 2012-05-24 13:36:19 PDT
Created attachment 143884 [details]
Patch
Comment 14 Darin Adler 2012-05-24 14:43:03 PDT
Comment on attachment 143884 [details]
Patch

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

> Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:404
> +    WKRetainPtr<WKStringRef> emptyUrl = WKStringCreateWithUTF8CString("");

This leaks. It needs an adoptWK.

> Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:411
> +    m_userStyleSheetLocation = WKStringCreateWithJSString(location);

This leaks. It needs an adoptWK.
Comment 15 Dinu Jacob 2012-05-24 18:58:08 PDT
Created attachment 143949 [details]
Patch with fixes
Comment 16 Dinu Jacob 2012-05-24 18:58:55 PDT
(In reply to comment #14)
> (From update of attachment 143884 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=143884&action=review
> 
> > Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:404
> > +    WKRetainPtr<WKStringRef> emptyUrl = WKStringCreateWithUTF8CString("");
> 
> This leaks. It needs an adoptWK.
> 
> > Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:411
> > +    m_userStyleSheetLocation = WKStringCreateWithJSString(location);
> 
> This leaks. It needs an adoptWK.

Thanks. Fixed and new patch uploaded
Comment 17 Dinu Jacob 2012-06-12 17:52:42 PDT
Can someone please review the latest patch?
Comment 18 Eric Seidel (no email) 2012-08-01 16:07:43 PDT
Comment on attachment 143949 [details]
Patch with fixes

This looks reasonable.  I would think we'd want to move this to window.internals these days though.
Comment 19 Dinu Jacob 2012-08-02 08:28:06 PDT
Created attachment 156093 [details]
Rebased patch for landing
Comment 20 Build Bot 2012-08-02 08:36:56 PDT
Comment on attachment 156093 [details]
Rebased patch for landing

Attachment 156093 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/13421460
Comment 21 Build Bot 2012-08-02 08:52:52 PDT
Comment on attachment 156093 [details]
Rebased patch for landing

Attachment 156093 [details] did not pass win-ews (win):
Output: http://queues.webkit.org/results/13422444
Comment 22 Early Warning System Bot 2012-08-02 08:57:38 PDT
Comment on attachment 156093 [details]
Rebased patch for landing

Attachment 156093 [details] did not pass qt-wk2-ews (qt):
Output: http://queues.webkit.org/results/13411921
Comment 23 Dinu Jacob 2012-08-02 09:07:19 PDT
Created attachment 156103 [details]
Rebased patch
Comment 24 WebKit Review Bot 2012-08-02 10:37:16 PDT
Comment on attachment 156103 [details]
Rebased patch

Clearing flags on attachment: 156103

Committed r124477: <http://trac.webkit.org/changeset/124477>
Comment 25 WebKit Review Bot 2012-08-02 10:37:23 PDT
All reviewed patches have been landed.  Closing bug.