Opened 13 years ago

Last modified 12 years ago

#8230 confirmed Bug

Problem with Google minify

Reported by: Freddie Bingham Owned by:
Priority: Normal Milestone:
Component: General Version: 3.2
Keywords: Cc:

Description

_source/plugins/listblock/plugin.js line 102

' aria-posinset="' + ++this._.size + '">',

When this line is compressed by Google's ModPageSpeed minify script, the result is:

' aria-posinset="'+++this._.size+'">',

While this is an issue with the Google tool, it is widespread and can easily be avoided if the code is changed to:

' aria-posinset="' + (++this._.size) + '">',

Please consider this suggestion.

Change History (4)

comment:1 Changed 13 years ago by Jakub Ś

Status: newconfirmed
Version: 3.6.13.2

IMHO I think @fbingha is right.

Adding two extra characters will not make the code bigger but only more flexible.

comment:2 Changed 12 years ago by Freddie Bingham

It appears that the ckpackager converts

aria-posinset="' + (++this._.size) + '">',

to

aria-posinset="0'+ ++v._.size+'">',

by stripping away the parenthesis so this solution is no good.

Instead I am using this simple fix to enforce the parenthesis to not be stripped:

aria-posinset="' + (++this._.size+0) + '">',

My suggestion would be to move the increment out of this block by doing it before the html.push then just reference this._.size.

Other areas with the same problem, causing javascript parsing to fail:

core\editor.js line 18:

var name = 'editor' + ( ++nameCounter );

gets converted to:

var B='editor'+ ++p;

Then, google's minify script converts the + ++ to +++ so this line needs the same fix as above.

I used:

var name = 'editor' + ( ++nameCounter + 0 );

plugins/htmldataprocessor/plugin.js

around line 445

return '{cke_protected_'+ ( store.id++ ) + '}';

I changed to

return '{cke_protected_'+ ( 0 + store.id++ ) + '}';

Lastly

core/env.js line 207

version = geckoRelease[0] * 10000 + ( geckoRelease[1] || 0 ) * 100 + ( geckoRelease[2] || 0 ) * 1;

I changed to

version = geckoRelease[0] * 10000 + ( geckoRelease[1] || 0 ) * 100 + ( geckoRelease[2] || 0 );

The * 1 at the end results in this bad code:

i=j[0]*10000+(j[1]||0)*100+ +(j[2]||0);

while removing the * 1 results in

i=j[0]*10000+(j[1]||0)*100+(j[2]||0);

comment:3 Changed 12 years ago by Freddie Bingham

Changing that last statement regarding gecko needs further inspection as different results are returned by removing the *1.

comment:4 Changed 12 years ago by Freddie Bingham

version = geckoRelease[0] * 10000 + ( geckoRelease[1] || 0 ) * 100 + parseInt( geckoRelease[2] || 0 , 10 ); resolves the issue

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy