Rewriting the skin file parser...

Arantor

  • With a Box
  • I'm a shooting star leaping through the skies, like a tiger defying the laws of gravity...
  • Messages: 14 006
Re: Rewriting the skin file parser...
« Réponse #45, le 27 Mai 2012 à 15:41 »
The commas instead of dots confuse me. I'd argue that ie7,replace,ie6 is a combination that isn't really necessary... what purpose would it (practically) solve?
  When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest.


Nao

  • Madman
  • With a Box
  • If you say so.....
  • Messages: 13 078
Re: Rewriting the skin file parser...
« Réponse #46, le 29 Mai 2012 à 16:39 »
Well, that's the reason I asked. (I could use 'index.replace.ie6,ie7.css' but I'm not sure people would follow.)
I'm already getting the list of suffixes for a file -- I could just as well remove 'replace' from the array, and then do a search on all parent folders, get all files with the same radix, explode the suffix list and compare the arrays. (Perhaps doing a sort() before maybe? I don't think array(1, 2) == array(2, 1)...)

There also is the point of replacing non-suffixed files in the same skin. Like, 'custom.replace,ie6.css' could be a request to entire remove 'custom.css' when IE6 is used, and replace it with 'custom.replace,ie6.css'...
...« I say wedge wedge (in the butt) »
 « Everyone knows rock attained perfection in 1974. It's a scientific fact. » (Homer Simpson)

Arantor

  • With a Box
  • I'm a shooting star leaping through the skies, like a tiger defying the laws of gravity...
  • Messages: 14 006
Re: Rewriting the skin file parser...
« Réponse #47, le 29 Mai 2012 à 16:41 »
You're right, array(1, 2) != array(2, 1) but that's sort of the point.

I'd keep it simple: if you indicate replace, and there's a suffix after that, that's all that's replaced. Bear in mind that we'll have to explain this to other people!
  When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest.


Nao

  • Madman
  • With a Box
  • If you say so.....
  • Messages: 13 078
Re: Rewriting the skin file parser...
« Réponse #48, le 29 Mai 2012 à 17:31 »
Lulz yeah...

But there's hardly any reason to account for the replace keyword's position when already I'm getting the suffixes as an array...
Could simply test for implode(',', array_diff($suffix_list_from_this_file_that_has_a_replace_suffix, (array) 'replace'))...
...« I say wedge wedge (in the butt) »
 « Everyone knows rock attained perfection in 1974. It's a scientific fact. » (Homer Simpson)

Arantor

  • With a Box
  • I'm a shooting star leaping through the skies, like a tiger defying the laws of gravity...
  • Messages: 14 006
Re: Rewriting the skin file parser...
« Réponse #49, le 29 Mai 2012 à 17:36 »
Putting aside the position of the replace keyword, just consider the remainder of the terms - index.replace.some,thing.css should replace index.some,thing.css but not index.thing,some.css.

While I can see the logic of arguing either way, I'd strongly be in favour of keeping it simple.
  When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest.


live627

  • Talking Head
  • Should five per cent appear too small / Be thankful I don't take it all / 'Cause I'm the taxman, yeah I'm the taxman
  • Messages: 1 503
Re: Rewriting the skin file parser...
« Réponse #50, le 2 Juin 2012 à 03:07 »
Nao, I think your rewrite is broken somewhat. My custom board icons don't show (full path instead of URI). Also, my custom menu is completely broken. Does the reset keyword still work?

Nao

  • Madman
  • With a Box
  • If you say so.....
  • Messages: 13 078
Re: Rewriting the skin file parser...
« Réponse #51, le 2 Juin 2012 à 12:11 »
I don't think anything's broken in here...?

Even the reset keyword seems to work.

Can you look into it further, please? You know I'm as careful as possible when touching my skin code, but maybe I missed something, given the number of possibilities wetem and wecss offer...
...« I say wedge wedge (in the butt) »
 « Everyone knows rock attained perfection in 1974. It's a scientific fact. » (Homer Simpson)

live627

  • Talking Head
  • Should five per cent appear too small / Be thankful I don't take it all / 'Cause I'm the taxman, yeah I'm the taxman
  • Messages: 1 503
Re: Rewriting the skin file parser...
« Réponse #52, le 9 Juin 2012 à 01:28 »
It was a misplaced parenthesis!

live627

  • Talking Head
  • Should five per cent appear too small / Be thankful I don't take it all / 'Cause I'm the taxman, yeah I'm the taxman
  • Messages: 1 503
Re: Rewriting the skin file parser...
« Réponse #53, le 9 Juin 2012 à 01:35 »
Offending line:

.menu:not(#main_menu2, #context_menus)

The comma confuses the parser, it seems.

Nao

  • Madman
  • With a Box
  • If you say so.....
  • Messages: 13 078
Re: Rewriting the skin file parser...
« Réponse #54, le 9 Juin 2012 à 11:26 »
Not surprised. WeCSS has trouble with any complex css2/3 that uses commas or quotes. I think one of my comments warns against that.
What shall we do? Protect all code at parse time? In what order? etc.... Headaches ahead.
...« I say wedge wedge (in the butt) »
 « Everyone knows rock attained perfection in 1974. It's a scientific fact. » (Homer Simpson)

live627

  • Talking Head
  • Should five per cent appear too small / Be thankful I don't take it all / 'Cause I'm the taxman, yeah I'm the taxman
  • Messages: 1 503
Re: Rewriting the skin file parser...
« Réponse #55, le 9 Juin 2012 à 21:08 »
Thing is, my entire skin worked just as  expected before the rewrite.

Nao

  • Madman
  • With a Box
  • If you say so.....
  • Messages: 13 078
Re: Rewriting the skin file parser...
« Réponse #56, le 9 Juin 2012 à 22:18 »
Can you help determine what revision broke it?
...« I say wedge wedge (in the butt) »
 « Everyone knows rock attained perfection in 1974. It's a scientific fact. » (Homer Simpson)

live627

  • Talking Head
  • Should five per cent appear too small / Be thankful I don't take it all / 'Cause I'm the taxman, yeah I'm the taxman
  • Messages: 1 503
Re: Rewriting the skin file parser...
« Réponse #57, le 9 Juin 2012 à 23:21 »
Yep. Latter on today after I finish this small plugin[1]. I reverted to r1595 yesterday to see if something after that broke it, still broken. :(
 1. The Javascript is a bitch..

Nao

  • Madman
  • With a Box
  • If you say so.....
  • Messages: 13 078
Re: Rewriting the skin file parser...
« Réponse #58, le 9 Juin 2012 à 23:39 »
Can you revert to an even older copy then? Just check the log for Class-CSS.php to see the relevant revs... Thanks!
...« I say wedge wedge (in the butt) »
 « Everyone knows rock attained perfection in 1974. It's a scientific fact. » (Homer Simpson)

live627

  • Talking Head
  • Should five per cent appear too small / Be thankful I don't take it all / 'Cause I'm the taxman, yeah I'm the taxman
  • Messages: 1 503
Re: Rewriting the skin file parser...
« Réponse #59, le 10 Juin 2012 à 06:30 »
OMG so many changes... so fucking lost.
Posté : 10 Juin 2012 à 06:14

it works in r1584
Posté : 10 Juin 2012 à 06:20

also in 1590
Posté : 10 Juin 2012 à 06:24

and not in 1593
Posté : 10 Juin 2012 à 06:26
Citation
* Sort selector lists before generating the CSS files. This helps a bit with overall gzip compression rates. (Class-CSS.php)
I'd assume that has something to do with it.