Bug 52134 - [chromium] Add support to allow printing just a plugin in a frame
Summary: [chromium] Add support to allow printing just a plugin in a frame
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other OS X 10.5
: P2 Normal
Assignee: John Abd-El-Malek
URL:
Keywords:
Depends on: 52392
Blocks:
  Show dependency treegraph
 
Reported: 2011-01-09 16:38 PST by John Abd-El-Malek
Modified: 2011-01-13 12:34 PST (History)
4 users (show)

See Also:


Attachments
Patch (12.68 KB, patch)
2011-01-09 16:44 PST, John Abd-El-Malek
no flags Details | Formatted Diff | Diff
Patch (10.84 KB, patch)
2011-01-11 15:06 PST, John Abd-El-Malek
no flags Details | Formatted Diff | Diff
Patch (11.47 KB, patch)
2011-01-11 16:40 PST, John Abd-El-Malek
no flags Details | Formatted Diff | Diff
Patch (12.21 KB, patch)
2011-01-11 17:06 PST, John Abd-El-Malek
no flags Details | Formatted Diff | Diff
Patch (12.20 KB, patch)
2011-01-12 00:16 PST, John Abd-El-Malek
no flags Details | Formatted Diff | Diff
Patch (11.75 KB, patch)
2011-01-12 16:12 PST, John Abd-El-Malek
fishd: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Abd-El-Malek 2011-01-09 16:38:07 PST
[chromium] Add support to allow printing just a plugin in a frame
Comment 1 John Abd-El-Malek 2011-01-09 16:44:42 PST
Created attachment 78358 [details]
Patch
Comment 2 John Abd-El-Malek 2011-01-09 16:46:38 PST
btw the corresponding Chromium bug is http://crbug.com/50285
Comment 3 John Abd-El-Malek 2011-01-11 15:06:26 PST
Created attachment 78606 [details]
Patch
Comment 4 WebKit Review Bot 2011-01-11 15:07:31 PST
Attachment 78606 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'WebKit/chromium/ChangeLog', u'WebKit/chrom..." exit_code: 1
WebKit/chromium/public/WebFrame.h:409:  The parameter name "node" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 1 in 5 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 John Abd-El-Malek 2011-01-11 15:08:08 PST
this is now ready for review, while I figure out the objc gibberish on the browse side :)
Comment 6 WebKit Review Bot 2011-01-11 15:28:47 PST
Attachment 78606 [details] did not build on chromium:
Build output: http://queues.webkit.org/results/7378150
Comment 7 John Abd-El-Malek 2011-01-11 15:36:32 PST
(In reply to comment #6)
> Attachment 78606 [details] did not build on chromium:
> Build output: http://queues.webkit.org/results/7378150

doh, forgot about the n-sided patches.  will check in a chrome change now that makes this compile and update the deps in this.
Comment 8 John Abd-El-Malek 2011-01-11 16:40:35 PST
Created attachment 78621 [details]
Patch
Comment 9 WebKit Review Bot 2011-01-11 16:42:39 PST
Attachment 78621 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'WebKit/chromium/ChangeLog', u'WebKit/chrom..." exit_code: 1
WebKit/chromium/public/WebFrame.h:412:  The parameter name "node" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 1 in 6 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 10 WebKit Review Bot 2011-01-11 16:59:07 PST
Attachment 78621 [details] did not build on chromium:
Build output: http://queues.webkit.org/results/7402137
Comment 11 John Abd-El-Malek 2011-01-11 17:06:29 PST
Created attachment 78628 [details]
Patch
Comment 12 WebKit Review Bot 2011-01-11 17:08:43 PST
Attachment 78628 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'WebKit/chromium/ChangeLog', u'WebKit/chrom..." exit_code: 1
WebKit/chromium/public/WebFrame.h:412:  The parameter name "node" adds no information, so it should be removed.  [readability/parameter_name] [5]
WebKit/chromium/src/WebFrameImpl.h:154:  The parameter name "node" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 2 in 7 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 13 David Levin 2011-01-11 19:29:52 PST
(In reply to comment #12)
> Attachment 78628 [details] did not pass style-queue:
> 
> Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'WebKit/chromium/ChangeLog', u'WebKit/chrom..." exit_code: 1
> WebKit/chromium/public/WebFrame.h:412:  The parameter name "node" adds no information, so it should be removed.  [readability/parameter_name] [5]
> WebKit/chromium/src/WebFrameImpl.h:154:  The parameter name "node" adds no information, so it should be removed.  [readability/parameter_name] [5]
> Total errors found: 2 in 7 files
> 
> 
> If any of these errors are false positives, please file a bug against check-webkit-style.

It looks like the style bot is trying to tell you something. (fwiw, it's correct).
Comment 14 John Abd-El-Malek 2011-01-12 00:14:41 PST
(In reply to comment #13)
> (In reply to comment #12)
> > Attachment 78628 [details] [details] did not pass style-queue:
> > 
> > Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'WebKit/chromium/ChangeLog', u'WebKit/chrom..." exit_code: 1
> > WebKit/chromium/public/WebFrame.h:412:  The parameter name "node" adds no information, so it should be removed.  [readability/parameter_name] [5]
> > WebKit/chromium/src/WebFrameImpl.h:154:  The parameter name "node" adds no information, so it should be removed.  [readability/parameter_name] [5]
> > Total errors found: 2 in 7 files
> > 
> > 
> > If any of these errors are false positives, please file a bug against check-webkit-style.
> 
> It looks like the style bot is trying to tell you something. (fwiw, it's correct).

in this case, it looked to me like it would make the code more awkward.  i.e. the example given in the style guide only has one parameter and no default value.  but in this code:

virtual int printBegin(const WebSize& pageSize,
                       WebNode* = 0,
                       int printerDPI = 72,
                       bool* useBrowserOverlays = 0) = 0;

it looks a little strange to me having a function declaration with 3 named variables and one that's not named, especially if it has a default value.  it makes referencing the variable in a comment inconsistent with how the others are referenced, since |node| doesn't make sense anymore.

but, i don't care enough, if the script wants inconsistencies within one function declaration, so be it..
Comment 15 John Abd-El-Malek 2011-01-12 00:16:42 PST
Created attachment 78661 [details]
Patch
Comment 16 David Levin 2011-01-12 01:02:05 PST
(In reply to comment #14)
> (In reply to comment #13)
> > (In reply to comment #12)
> > > Attachment 78628 [details] [details] [details] did not pass style-queue:
> > > 
> > > Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'WebKit/chromium/ChangeLog', u'WebKit/chrom..." exit_code: 1
> > > WebKit/chromium/public/WebFrame.h:412:  The parameter name "node" adds no information, so it should be removed.  [readability/parameter_name] [5]
> > > WebKit/chromium/src/WebFrameImpl.h:154:  The parameter name "node" adds no information, so it should be removed.  [readability/parameter_name] [5]
> > > Total errors found: 2 in 7 files
> > > 
> > > 
> > > If any of these errors are false positives, please file a bug against check-webkit-style.
> > 
> > It looks like the style bot is trying to tell you something. (fwiw, it's correct).
> 
> in this case, it looked to me like it would make the code more awkward.  i.e. the example given in the style guide only has one parameter and no default value.  but in this code:
> 
> virtual int printBegin(const WebSize& pageSize,
>                        WebNode* = 0,
>                        int printerDPI = 72,
>                        bool* useBrowserOverlays = 0) = 0;
> 
> it looks a little strange to me having a function declaration with 3 named variables and one that's not named, especially if it has a default value. 

It sounds like you are used to a different style other than WebKit so it looks strange. Ok.

> it makes referencing the variable in a comment inconsistent with how the others are referenced, since |node| doesn't make sense anymore.

Feel free to say WebNode*.

> but, i don't care enough, if the script wants inconsistencies within one function declaration, so be it..

WebKit style is to omit parameter names that don't add information. The script is correctly reminding you of this. This isn't about some script wanting inconsistencies.
Comment 17 Darin Fisher (:fishd, Google) 2011-01-12 15:54:41 PST
Comment on attachment 78661 [details]
Patch

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

> WebKit/chromium/public/WebFrame.h:411
> +    virtual int printBegin(const WebSize& pageSize,

if it makes your merging easier, it is also OK to put the WebNode parameter last,
and i might give it a self-documenting name.

it would also be a bit more conventional to pass the WebNode like this:

  const WebNode& constrainToNode = WebNode(),

Note: WebNode has an isNull method you can check.

> WebKit/chromium/src/WebFrameImpl.cpp:1285


nit: it is a bit more conventional to name webcore objects using the prefix "core", so "coreNode" instead of "webcoreNode"

nit: you can also just do this:

  Node* coreNode = node->unwrap<WebCore::Node>();

if you pass as const WebNode& node, then you would do this:

  const Node* coreNode = node.constUnwrap<Node>();
Comment 18 John Abd-El-Malek 2011-01-12 16:12:35 PST
Created attachment 78752 [details]
Patch
Comment 19 John Abd-El-Malek 2011-01-12 16:13:52 PST
(In reply to comment #17)
> (From update of attachment 78661 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=78661&action=review
> 
> > WebKit/chromium/public/WebFrame.h:411
> > +    virtual int printBegin(const WebSize& pageSize,
> 
> if it makes your merging easier, it is also OK to put the WebNode parameter last,
> and i might give it a self-documenting name.
> 
> it would also be a bit more conventional to pass the WebNode like this:
> 
>   const WebNode& constrainToNode = WebNode(),
> 
> Note: WebNode has an isNull method you can check.
> 
> > WebKit/chromium/src/WebFrameImpl.cpp:1285
> 
> 
> nit: it is a bit more conventional to name webcore objects using the prefix "core", so "coreNode" instead of "webcoreNode"
> 
> nit: you can also just do this:
> 
>   Node* coreNode = node->unwrap<WebCore::Node>();
> 
> if you pass as const WebNode& node, then you would do this:
> 
>   const Node* coreNode = node.constUnwrap<Node>();


Done and uploaded
Comment 20 John Abd-El-Malek 2011-01-13 12:08:11 PST
Committed r75730: <http://trac.webkit.org/changeset/75730>