Rewriting the skin file parser...

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Rewriting the skin file parser...
« Reply #45, on May 27th, 2012, 03:41 PM »
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. | Game Memorial

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Rewriting the skin file parser...
« Reply #46, on May 29th, 2012, 04:39 PM »
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'...

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Rewriting the skin file parser...
« Reply #47, on May 29th, 2012, 04:41 PM »
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!

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Rewriting the skin file parser...
« Reply #48, on May 29th, 2012, 05:31 PM »
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'))...

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Rewriting the skin file parser...
« Reply #49, on May 29th, 2012, 05:36 PM »
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.

live627

  • 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
  • Posts: 1,670
Re: Rewriting the skin file parser...
« Reply #50, on June 2nd, 2012, 03:07 AM »
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?
A confident man keeps quiet.whereas a frightened man keeps talking, hiding his fear.

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Rewriting the skin file parser...
« Reply #51, on June 2nd, 2012, 12:11 PM »
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...

live627

  • 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
  • Posts: 1,670

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Rewriting the skin file parser...
« Reply #54, on June 9th, 2012, 11:26 AM »
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.

live627

  • 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
  • Posts: 1,670

Nao

  • Dadman with a boy
  • Posts: 16,082

live627

  • 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
  • Posts: 1,670
Re: Rewriting the skin file parser...
« Reply #57, on June 9th, 2012, 11:21 PM »
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

  • Dadman with a boy
  • Posts: 16,082
Re: Rewriting the skin file parser...
« Reply #58, on June 9th, 2012, 11:39 PM »
Can you revert to an even older copy then? Just check the log for Class-CSS.php to see the relevant revs... Thanks!

live627

  • 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
  • Posts: 1,670
Re: Rewriting the skin file parser...
« Reply #59, on June 10th, 2012, 06:30 AM »
OMG so many changes... so fucking lost.
Posted: June 10th, 2012, 06:14 AM

it works in r1584
Posted: June 10th, 2012, 06:20 AM

also in 1590
Posted: June 10th, 2012, 06:24 AM

and not in 1593
Posted: June 10th, 2012, 06:26 AM
Quote
* 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.