├── README ├── csstidy ├── COPYING ├── Docs │ ├── __filesource │ │ ├── fsource_csstidy__class.csstidy.php.html │ │ ├── fsource_csstidy__class.csstidy_optimise.php.html │ │ ├── fsource_csstidy__class.csstidy_print.php.html │ │ └── fsource_csstidy__data.inc.php.html │ ├── classtrees_csstidy.html │ ├── csstidy │ │ ├── _class_csstidy_optimise_php.html │ │ ├── _class_csstidy_php.html │ │ ├── _class_csstidy_print_php.html │ │ ├── _data_inc_php.html │ │ ├── csstidy.html │ │ ├── csstidy_optimise.html │ │ └── csstidy_print.html │ ├── elementindex.html │ ├── elementindex_csstidy.html │ ├── errors.html │ ├── index.html │ ├── li_csstidy.html │ ├── media │ │ ├── background.png │ │ ├── empty.png │ │ └── style.css │ └── todolist.html ├── NEWS ├── README ├── class.csstidy.php ├── class.csstidy_ctype.php ├── class.csstidy_optimise.php ├── class.csstidy_print.php ├── css_optimiser.php ├── cssparse.css ├── cssparsed.css ├── data.inc.php ├── lang.inc.php ├── template.tpl ├── template1.tpl ├── template2.tpl ├── template3.tpl └── testing │ ├── unit-tests.inc │ ├── unit-tests.php │ └── unit-tests │ ├── _files.php │ ├── class.Text_Diff_Renderer_parallel.php │ ├── class.csstidy_csst.php │ ├── class.csstidy_harness.php │ ├── class.csstidy_reporter.php │ ├── csst │ ├── README │ ├── properties │ │ ├── css1.csst │ │ ├── css2.csst │ │ └── css21.csst │ ├── selectors │ │ ├── active.csst │ │ ├── adjacent.csst │ │ ├── attribute-begins.csst │ │ ├── attribute-contains.csst │ │ ├── attribute-equals.csst │ │ ├── attribute-set.csst │ │ ├── chain.csst │ │ ├── child.csst │ │ ├── class.csst │ │ ├── combinator-compressed.csst │ │ ├── descendant.csst │ │ ├── errors │ │ │ ├── dangling-combinator.csst │ │ │ └── duplicate-combinator.csst │ │ ├── first-child.csst │ │ ├── focus.csst │ │ ├── grouping.csst │ │ ├── hover.csst │ │ ├── id.csst │ │ ├── lang.csst │ │ ├── link.csst │ │ ├── merge-optimization.csst │ │ ├── merge-preserve.csst │ │ ├── pseudo-elements.csst │ │ ├── simple.csst │ │ ├── type.csst │ │ ├── universal-optimization.csst │ │ ├── universal-shorthand.csst │ │ ├── universal.csst │ │ └── visited.csst │ ├── shorthands │ │ ├── background-general.csst │ │ ├── background-noopt.csst │ │ ├── font-face.csst │ │ ├── font-general.csst │ │ ├── font-noopt.csst │ │ ├── font-weight-general.csst │ │ ├── font-weight-noopt.csst │ │ ├── margin-general.csst │ │ ├── margin-noopt.csst │ │ ├── padding-general.csst │ │ └── padding-noopt.csst │ ├── special │ │ ├── cursor.csst │ │ └── font-face.csst │ └── values │ │ ├── colors.csst │ │ ├── font-family.csst │ │ ├── important.csst │ │ ├── number-float.csst │ │ ├── number-leadingzero.csst │ │ ├── number-missingunit.csst │ │ ├── number-missingzero.csst │ │ ├── number-signed.csst │ │ ├── number-trailingzero.csst │ │ └── number-zero.csst │ └── test.csst.php ├── index.php ├── schepp.jpg └── test.css /README: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Schepp/CSS-Prefix-Spawner/921866e469c68eceb4f8edc1ad1c0e84dc6a68a8/README -------------------------------------------------------------------------------- /csstidy/COPYING: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | 3 | Version 2.1, February 1999 4 | 5 | Copyright (C) 1991, 1999 Free Software Foundation, Inc. 6 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 7 | Everyone is permitted to copy and distribute verbatim copies 8 | of this license document, but changing it is not allowed. 9 | 10 | [This is the first released version of the Lesser GPL. It also counts 11 | as the successor of the GNU Library Public License, version 2, hence 12 | the version number 2.1.] 13 | 14 | Preamble 15 | 16 | The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. 17 | 18 | This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. 19 | 20 | When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. 21 | 22 | To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. 23 | 24 | For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. 25 | 26 | We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. 27 | 28 | To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. 29 | 30 | Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. 31 | 32 | Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. 33 | 34 | When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. 35 | 36 | We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. 37 | 38 | For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. 39 | 40 | In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. 41 | 42 | Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. 43 | 44 | The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. 45 | 46 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 47 | 48 | 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". 49 | 50 | A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. 51 | 52 | The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) 53 | 54 | "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. 55 | 56 | Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 57 | 58 | 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. 59 | 60 | You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 61 | 62 | 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: 63 | 64 | * a) The modified work must itself be a software library. 65 | * b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. 66 | * c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. 67 | * d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. 68 | 69 | (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) 70 | 71 | These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. 72 | 73 | Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. 74 | 75 | In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 76 | 77 | 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. 78 | 79 | Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. 80 | 81 | This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 82 | 83 | 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. 84 | 85 | If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 86 | 87 | 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. 88 | 89 | However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. 90 | 91 | When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. 92 | 93 | If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) 94 | 95 | Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 96 | 97 | 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. 98 | 99 | You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: 100 | 101 | * a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) 102 | * b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. 103 | * c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. 104 | * d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. 105 | * e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. 106 | 107 | For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. 108 | 109 | It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 110 | 111 | 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: 112 | 113 | * a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. 114 | * b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 115 | 116 | 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 117 | 118 | 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 119 | 120 | 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 121 | 122 | 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. 123 | 124 | If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. 125 | 126 | It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. 127 | 128 | This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 129 | 130 | 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 131 | 132 | 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. 133 | 134 | Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 135 | 136 | 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. 137 | 138 | NO WARRANTY 139 | 140 | 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 141 | 142 | 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 143 | 144 | END OF TERMS AND CONDITIONS 145 | How to Apply These Terms to Your New Libraries 146 | 147 | If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). 148 | 149 | To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. 150 | 151 | one line to give the library's name and an idea of what it does. 152 | Copyright (C) year name of author 153 | 154 | This library is free software; you can redistribute it and/or 155 | modify it under the terms of the GNU Lesser General Public 156 | License as published by the Free Software Foundation; either 157 | version 2.1 of the License, or (at your option) any later version. 158 | 159 | This library is distributed in the hope that it will be useful, 160 | but WITHOUT ANY WARRANTY; without even the implied warranty of 161 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 162 | Lesser General Public License for more details. 163 | 164 | You should have received a copy of the GNU Lesser General Public 165 | License along with this library; if not, write to the Free Software 166 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 167 | 168 | Also add information on how to contact you by electronic and paper mail. 169 | 170 | You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: 171 | 172 | Yoyodyne, Inc., hereby disclaims all copyright interest in 173 | the library `Frob' (a library for tweaking knobs) written 174 | by James Random Hacker. 175 | 176 | signature of Ty Coon, 1 April 1990 177 | Ty Coon, President of Vice 178 | -------------------------------------------------------------------------------- /csstidy/Docs/classtrees_csstidy.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |csstidy | 11 |
![]() |
15 | [ class tree: csstidy ] 16 | [ index: csstidy ] 17 | [ all elements ] 18 | | 19 |
![]() |
26 |
27 |
28 |
29 | Packages:30 | csstidy 31 | 32 | |
33 |
34 |
|
58 |
csstidy | 11 |
![]() |
15 | [ class tree: csstidy ] 16 | [ index: csstidy ] 17 | [ all elements ] 18 | | 19 |
![]() |
26 |
27 |
28 |
29 | Packages:30 | csstidy 31 | 32 | Files: 33 |
34 | class.csstidy.php
35 | 36 | class.csstidy_optimise.php 37 | 38 | class.csstidy_print.php 39 | 40 | data.inc.php 41 | 42 | 43 | 44 | Classes: 45 | 50 | |
51 |
52 |
|
93 |
csstidy | 11 |
![]() |
15 | [ class tree: csstidy ] 16 | [ index: csstidy ] 17 | [ all elements ] 18 | | 19 |
![]() |
26 |
27 |
28 |
29 | Packages:30 | csstidy 31 | 32 | Files: 33 |
34 | class.csstidy.php
35 | 36 | class.csstidy_optimise.php 37 | 38 | class.csstidy_print.php 39 | 40 | data.inc.php 41 | 42 | 43 | 44 | Classes: 45 | 50 | |
51 |
52 |
|
126 |
csstidy | 11 |
![]() |
15 | [ class tree: csstidy ] 16 | [ index: csstidy ] 17 | [ all elements ] 18 | | 19 |
![]() |
26 |
27 |
28 |
29 | Packages:30 | csstidy 31 | 32 | Files: 33 |
34 | class.csstidy.php
35 | 36 | class.csstidy_optimise.php 37 | 38 | class.csstidy_print.php 39 | 40 | data.inc.php 41 | 42 | 43 | 44 | Classes: 45 | 50 | |
51 |
52 |
|
93 |
csstidy | 11 |
![]() |
15 | [ class tree: csstidy ] 16 | [ index: csstidy ] 17 | [ all elements ] 18 | | 19 |
![]() |
26 |
27 |
28 |
29 | Packages:30 | csstidy 31 | 32 | Files: 33 |
34 | class.csstidy.php
35 | 36 | class.csstidy_optimise.php 37 | 38 | class.csstidy_print.php 39 | 40 | data.inc.php 41 | 42 | 43 | 44 | Classes: 45 | 50 | |
51 |
52 |
|
479 |
csstidy | 11 |
![]() |
15 | [ class tree: csstidy ] 16 | [ index: csstidy ] 17 | [ all elements ] 18 | | 19 |
![]() |
26 |
27 |
28 |
29 | Packages:30 | csstidy 31 | 32 | Files: 33 |
34 | class.csstidy.php
35 | 36 | class.csstidy_optimise.php 37 | 38 | class.csstidy_print.php 39 | 40 | data.inc.php 41 | 42 | 43 | 44 | Classes: 45 | 50 | |
51 |
52 |
|
613 |
csstidy | 11 |
![]() |
15 | [ class tree: csstidy ] 16 | [ index: csstidy ] 17 | [ all elements ] 18 | | 19 |
![]() |
26 |
27 |
28 |
29 | Packages:30 | csstidy 31 | 32 | |
33 |
34 |
|
47 |
csstidy | 11 |
![]() |
15 | [ class tree: csstidy ] 16 | [ index: csstidy ] 17 | [ all elements ] 18 | | 19 |
![]() |
26 |
27 |
28 |
29 | Packages:30 | csstidy 31 | 32 | Files: 33 |
34 | class.csstidy.php
35 | 36 | class.csstidy_optimise.php 37 | 38 | class.csstidy_print.php 39 | 40 | data.inc.php 41 | 42 | 43 | 44 | Classes: 45 | 50 | |
51 |
52 |
|
64 |
csstidy | 11 |
![]() |
15 | [ class tree: csstidy ] 16 | [ index: csstidy ] 17 | [ all elements ] 18 | | 19 |
![]() |
26 |
27 |
28 |
29 | Packages:30 | csstidy 31 | 32 | Files: 33 |
34 | class.csstidy.php
35 | 36 | class.csstidy_optimise.php 37 | 38 | class.csstidy_print.php 39 | 40 | data.inc.php 41 | 42 | 43 | 44 | Classes: 45 | 50 | |
51 |
52 |
|
64 |
csstidy | 11 |
![]() |
15 | [ class tree: csstidy ] 16 | [ index: csstidy ] 17 | [ all elements ] 18 | | 19 |
![]() |
26 |
27 |
28 |
29 | Packages:30 | csstidy 31 | 32 | 33 | |
34 |
35 |
|
73 |
";
158 | $output .= $this->formatted();
159 | $output .= '
'."\n".'';
160 | return $this->output_css_plain;
161 | }
162 |
163 | /**
164 | * Returns the formatted CSS Code and saves it into $this->output_css and $this->output_css_plain
165 | * @param bool $plain plain text or not
166 | * @access private
167 | * @version 2.0
168 | */
169 | function _print($plain = false)
170 | {
171 | if ($this->output_css && $this->output_css_plain) {
172 | return;
173 | }
174 |
175 | $output = '';
176 | if (!$this->parser->get_cfg('preserve_css')) {
177 | $this->_convert_raw_css();
178 | }
179 |
180 | $template =& $this->template;
181 |
182 | if ($plain) {
183 | $template = array_map('strip_tags', $template);
184 | }
185 |
186 | if ($this->parser->get_cfg('timestamp')) {
187 | array_unshift($this->tokens, array(COMMENT, ' CSSTidy ' . $this->parser->version . ': ' . date('r') . ' '));
188 | }
189 |
190 | if (!empty($this->charset)) {
191 | $output .= $template[0].'@charset '.$template[5].$this->charset.$template[6];
192 | }
193 |
194 | if (!empty($this->import)) {
195 | for ($i = 0, $size = count($this->import); $i < $size; $i ++) {
196 | if(substr($this->import[$i], 0, 4) === 'url(' && substr($this->import[$i], -1, 1) === ')') {
197 | $this->import[$i] = '\''.substr($this->import[$i], 4, -1).'\'';
198 | $this->parser->log('Optimised @import : Removed "url("','Information');
199 | }
200 | $output .= $template[0].'@import '.$template[5].$this->import[$i].$template[6];
201 | }
202 | }
203 |
204 | if (!empty($this->namespace)) {
205 | if(substr($this->namespace, 0, 4) === 'url(' && substr($this->namespace, -1, 1) === ')') {
206 | $this->namespace = '\''.substr($this->namespace, 4, -1).'\'';
207 | $this->parser->log('Optimised @namespace : Removed "url("','Information');
208 | }
209 | $output .= $template[0].'@namespace '.$template[5].$this->namespace.$template[6];
210 | }
211 |
212 | $output .= $template[13];
213 | $in_at_out = '';
214 | $out =& $output;
215 |
216 | foreach ($this->tokens as $key => $token)
217 | {
218 | switch ($token[0])
219 | {
220 | case AT_START:
221 | $out .= $template[0].$this->_htmlsp($token[1], $plain).$template[1];
222 | $out =& $in_at_out;
223 | break;
224 |
225 | case SEL_START:
226 | if($this->parser->get_cfg('lowercase_s')) $token[1] = strtolower($token[1]);
227 | // remove fake counter from @font-face
228 | if (substr($token[1], 0, 10) === '@font-face') {
229 | $token[1] = '@font-face';
230 | }
231 | $out .= ($token[1]{0} !== '@') ? $template[2].$this->_htmlsp($token[1], $plain) : $template[0].$this->_htmlsp($token[1], $plain);
232 | $out .= $template[3];
233 | break;
234 |
235 | case PROPERTY:
236 | if($this->parser->get_cfg('case_properties') === 2)
237 | {
238 | $token[1] = strtoupper($token[1]);
239 | // remove fake counter property
240 | $token[1] = preg_replace('/_[0-9]+$/i','',$token[1]);
241 | }
242 | elseif($this->parser->get_cfg('case_properties') === 1)
243 | {
244 | $token[1] = strtolower($token[1]);
245 | // remove fake counter property
246 | $token[1] = preg_replace('/_[0-9]+$/i','',$token[1]);
247 | } else {
248 | // remove fake counter property
249 | $token[1] = preg_replace('/_[0-9]+$/i','',$token[1]);
250 | }
251 | $out .= $template[4] . $this->_htmlsp($token[1], $plain) . ':' . $template[5];
252 | break;
253 |
254 | case VALUE:
255 | $out .= $this->_htmlsp($token[1], $plain);
256 | if($this->_seeknocomment($key, 1) == SEL_END && $this->parser->get_cfg('remove_last_;')) {
257 | $out .= str_replace(';', '', $template[6]);
258 | } else {
259 | $out .= $template[6];
260 | }
261 | break;
262 |
263 | case SEL_END:
264 | $out .= $template[7];
265 | if($this->_seeknocomment($key, 1) != AT_END) $out .= $template[8];
266 | break;
267 |
268 | case AT_END:
269 | $out =& $output;
270 | $out .= $template[10] . str_replace("\n", "\n" . $template[10], $in_at_out);
271 | $in_at_out = '';
272 | $out .= $template[9];
273 | break;
274 |
275 | case COMMENT:
276 | $out .= $template[11] . '/*' . $this->_htmlsp($token[1], $plain) . '*/' . $template[12];
277 | break;
278 | }
279 | }
280 |
281 | $output = trim($output);
282 |
283 | if (!$plain) {
284 | $this->output_css = $output;
285 | $this->_print(true);
286 | } else {
287 | // If using spaces in the template, don't want these to appear in the plain output
288 | $this->output_css_plain = str_replace(' ', '', $output);
289 | }
290 | }
291 |
292 | /**
293 | * Gets the next token type which is $move away from $key, excluding comments
294 | * @param integer $key current position
295 | * @param integer $move move this far
296 | * @return mixed a token type
297 | * @access private
298 | * @version 1.0
299 | */
300 | function _seeknocomment($key, $move) {
301 | $go = ($move > 0) ? 1 : -1;
302 | for ($i = $key + 1; abs($key-$i)-1 < abs($move); $i += $go) {
303 | if (!isset($this->tokens[$i])) {
304 | return;
305 | }
306 | if ($this->tokens[$i][0] == COMMENT) {
307 | $move += 1;
308 | continue;
309 | }
310 | return $this->tokens[$i][0];
311 | }
312 | }
313 |
314 | /**
315 | * Converts $this->css array to a raw array ($this->tokens)
316 | * @access private
317 | * @version 1.0
318 | */
319 | function _convert_raw_css()
320 | {
321 | $this->tokens = array();
322 |
323 | foreach ($this->css as $medium => $val)
324 | {
325 | if ($this->parser->get_cfg('sort_selectors')) ksort($val);
326 | if ($medium != DEFAULT_AT) {
327 | $this->parser->_add_token(AT_START, $medium, true);
328 | }
329 |
330 | foreach ($val as $selector => $vali)
331 | {
332 | if ($this->parser->get_cfg('sort_properties')) ksort($vali);
333 | $this->parser->_add_token(SEL_START, $selector, true);
334 |
335 | foreach ($vali as $property => $valj)
336 | {
337 | $this->parser->_add_token(PROPERTY, $property, true);
338 | $this->parser->_add_token(VALUE, $valj, true);
339 | }
340 |
341 | $this->parser->_add_token(SEL_END, $selector, true);
342 | }
343 |
344 | if ($medium != DEFAULT_AT) {
345 | $this->parser->_add_token(AT_END, $medium, true);
346 | }
347 | }
348 | }
349 |
350 | /**
351 | * Same as htmlspecialchars, only that chars are not replaced if $plain !== true. This makes print_code() cleaner.
352 | * @param string $string
353 | * @param bool $plain
354 | * @return string
355 | * @see csstidy_print::_print()
356 | * @access private
357 | * @version 1.0
358 | */
359 | function _htmlsp($string, $plain)
360 | {
361 | if (!$plain) {
362 | return htmlspecialchars($string, ENT_QUOTES, 'utf-8');
363 | }
364 | return $string;
365 | }
366 |
367 | /**
368 | * Get compression ratio
369 | * @access public
370 | * @return float
371 | * @version 1.2
372 | */
373 | function get_ratio()
374 | {
375 | if (!$this->output_css_plain) {
376 | $this->formatted();
377 | }
378 | return round((strlen($this->input_css) - strlen($this->output_css_plain)) / strlen($this->input_css), 3) * 100;
379 | }
380 |
381 | /**
382 | * Get difference between the old and new code in bytes and prints the code if necessary.
383 | * @access public
384 | * @return string
385 | * @version 1.1
386 | */
387 | function get_diff()
388 | {
389 | if (!$this->output_css_plain) {
390 | $this->formatted();
391 | }
392 |
393 | $diff = strlen($this->output_css_plain) - strlen($this->input_css);
394 |
395 | if ($diff > 0) {
396 | return '+' . $diff;
397 | } elseif ($diff == 0) {
398 | return '+-' . $diff;
399 | }
400 |
401 | return $diff;
402 | }
403 |
404 | /**
405 | * Get the size of either input or output CSS in KB
406 | * @param string $loc default is "output"
407 | * @access public
408 | * @return integer
409 | * @version 1.0
410 | */
411 | function size($loc = 'output')
412 | {
413 | if ($loc === 'output' && !$this->output_css) {
414 | $this->formatted();
415 | }
416 |
417 | if ($loc === 'input') {
418 | return (strlen($this->input_css) / 1000);
419 | } else {
420 | return (strlen($this->output_css_plain) / 1000);
421 | }
422 | }
423 | }
424 |
--------------------------------------------------------------------------------
/csstidy/css_optimiser.php:
--------------------------------------------------------------------------------
1 | .
23 | *
24 | * @license http://opensource.org/licenses/lgpl-license.php GNU Lesser General Public License
25 | * @package csstidy
26 | * @author Florian Schmitz (floele at gmail dot com) 2005-2007
27 | * @author Brett Zamir (brettz9 at yahoo dot com) 2007
28 | */
29 |
30 | require('class.csstidy.php');
31 | require('lang.inc.php');
32 |
33 |
34 | if (get_magic_quotes_gpc()) {
35 | if (isset($_REQUEST['css_text'])) {
36 | $_REQUEST['css_text'] = stripslashes($_REQUEST['css_text']);
37 | }
38 | if (isset($_REQUEST['custom'])) {
39 | $_REQUEST['custom'] = stripslashes($_REQUEST['custom']);
40 | }
41 | if (isset($_COOKIE['custom_template'])) {
42 | $_COOKIE['custom_template'] = stripslashes($_COOKIE['custom_template']);
43 | }
44 | }
45 |
46 | function rmdirr($dirname,$oc=0)
47 | {
48 | // Sanity check
49 | if (!file_exists($dirname)) {
50 | return false;
51 | }
52 | // Simple delete for a file
53 | if (is_file($dirname) && (time()-fileatime($dirname))>3600) {
54 | return unlink($dirname);
55 | }
56 | // Loop through the folder
57 | if(is_dir($dirname))
58 | {
59 | $dir = dir($dirname);
60 | while (false !== $entry = $dir->read()) {
61 | // Skip pointers
62 | if ($entry === '.' || $entry === '..') {
63 | continue;
64 | }
65 | // Recurse
66 | rmdirr($dirname.'/'.$entry,$oc);
67 | }
68 | $dir->close();
69 | }
70 | // Clean up
71 | if ($oc==1)
72 | {
73 | return rmdir($dirname);
74 | }
75 | }
76 |
77 | function options($options, $selected = null, $labelIsValue = false)
78 | {
79 | $html = '';
80 |
81 | settype($selected, 'array');
82 | settype($options, 'array');
83 |
84 | foreach ($options as $value=>$label)
85 | {
86 | if (is_array($label)) {
87 | $value = $label[0];
88 | $label = $label[1];
89 | }
90 | $label = htmlspecialchars($label, ENT_QUOTES, 'utf-8');
91 | $value = $labelIsValue ? $label
92 | : htmlspecialchars($value, ENT_QUOTES, 'utf-8');
93 |
94 | $html .= '';
102 | }
103 |
104 | return $html;
105 | }
106 |
107 | $css = new csstidy();
108 | $is_custom = isset($_REQUEST['custom']) && !empty($_REQUEST['custom']) && isset($_REQUEST['template']) && ($_REQUEST['template'] === '4');
109 | if($is_custom)
110 | {
111 | setcookie ('custom_template', $_REQUEST['custom'], time()+360000);
112 | }
113 |
114 | rmdirr('temp');
115 |
116 | if(isset($_REQUEST['case_properties'])) $css->set_cfg('case_properties',$_REQUEST['case_properties']);
117 | if(isset($_REQUEST['lowercase'])) $css->set_cfg('lowercase_s',true);
118 | if(!isset($_REQUEST['compress_c']) && isset($_REQUEST['post'])) $css->set_cfg('compress_colors',false);
119 | if(!isset($_REQUEST['compress_fw']) && isset($_REQUEST['post'])) $css->set_cfg('compress_font-weight',false);
120 | if(isset($_REQUEST['merge_selectors'])) $css->set_cfg('merge_selectors', $_REQUEST['merge_selectors']);
121 | if(isset($_REQUEST['optimise_shorthands'])) $css->set_cfg('optimise_shorthands',$_REQUEST['optimise_shorthands']);
122 | if(!isset($_REQUEST['rbs']) && isset($_REQUEST['post'])) $css->set_cfg('remove_bslash',false);
123 | if(isset($_REQUEST['preserve_css'])) $css->set_cfg('preserve_css',true);
124 | if(isset($_REQUEST['sort_sel'])) $css->set_cfg('sort_selectors',true);
125 | if(isset($_REQUEST['sort_de'])) $css->set_cfg('sort_properties',true);
126 | if(isset($_REQUEST['remove_last_sem'])) $css->set_cfg('remove_last_;',true);
127 | if(isset($_REQUEST['discard'])) $css->set_cfg('discard_invalid_properties',true);
128 | if(isset($_REQUEST['css_level'])) $css->set_cfg('css_level',$_REQUEST['css_level']);
129 | if(isset($_REQUEST['timestamp'])) $css->set_cfg('timestamp',true);
130 |
131 |
132 | // This by itself is enough since our scripts don't use DOM to create elements (in which case the namespace aware ones
133 | // should be used when serving as application/xhtml+xml but not when served as text/html ;
134 | // also, case will be different when retrieving element names, as HTML DOM returns in upper case,
135 | // genuine XHTML DOM (when XHTML served as such) as lower
136 | if (stristr($_SERVER['HTTP_ACCEPT'], 'application/xhtml+xml')) {
137 | $http_accept = 'application/xhtml+xml';
138 | }
139 | elseif (stristr($_SERVER['HTTP_ACCEPT'], 'application/xml')) {
140 | $http_accept = 'application/xml';
141 | }
142 | elseif (stristr($_SERVER['HTTP_ACCEPT'], 'text/xml')) {
143 | $http_accept = 'text/xml';
144 | }
145 | elseif (stristr($_SERVER['HTTP_USER_AGENT'], 'Opera ') || stristr($_SERVER['HTTP_USER_AGENT'], 'Opera/')) {
146 | preg_match('@Opera/(\d)@', $_SERVER['HTTP_USER_AGENT'], $matches);
147 | if (isset($matches[1]) && $matches[1] >= 7) {
148 | $http_accept = 'application/xhtml+xml';
149 | }
150 | else {
151 | $http_accept = 'text/html';
152 | }
153 | }
154 | else {
155 | $http_accept = 'text/html';
156 | }
157 |
158 | header('Content-Type: '.$http_accept.'; charset=utf-8');
159 |
160 | if ($http_accept === 'text/html') {
161 | ?>
162 |
164 |
168 |
169 |
172 |
173 |
174 |
175 | 225 | : English Deutsch French Chinese
226 |227 | 228 |
229 | 230 | 352 | load_template($_REQUEST['custom'],false); 367 | } 368 | break; 369 | 370 | case 3: 371 | $css->load_template('highest_compression'); 372 | break; 373 | 374 | case 2: 375 | $css->load_template('high_compression'); 376 | break; 377 | 378 | case 0: 379 | $css->load_template('low_compression'); 380 | break; 381 | } 382 | } 383 | 384 | if($url) 385 | { 386 | if(substr($_REQUEST['url'],0,7) !== 'http://') 387 | { 388 | $_REQUEST['url'] = 'http://'.$_REQUEST['url']; 389 | } 390 | $result = $css->parse_from_url($_REQUEST['url'],0); 391 | } 392 | elseif(isset($_REQUEST['css_text']) && strlen($_REQUEST['css_text'])>5) 393 | { 394 | $result = $css->parse($_REQUEST['css_text']); 395 | } 396 | 397 | if($result) 398 | { 399 | $ratio = $css->print->get_ratio(); 400 | $diff = $css->print->get_diff(); 401 | if(isset($_REQUEST['file_output'])) 402 | { 403 | $filename = md5(mt_rand().time().mt_rand()); 404 | if (!is_dir('temp')) { 405 | $madedir = mkdir('temp'); 406 | if (!$madedir) { 407 | print 'Could not make directory "temp" in '.dirname(__FILE__); 408 | exit; 409 | } 410 | } 411 | $handle = fopen('temp/'.$filename.'.css','w'); 412 | if($handle) { 413 | if(fwrite($handle,$css->print->plain())) 414 | { 415 | $file_ok = true; 416 | } 417 | } 418 | fclose($handle); 419 | } 420 | if($ratio>0) $ratio = ''.$ratio.'% 421 | ('.$diff.' Bytes)'; else $ratio = ''.$ratio.'% ('.$diff.' Bytes)'; 423 | if(count($css->log) > 0): ?> 424 | 437 | '; 445 | echo '';
446 | echo $css->print->formatted();
447 | echo '
',$lang[$l][28],'
'; 471 | } 472 | ?> 473 | 477 | 478 | -------------------------------------------------------------------------------- /csstidy/cssparse.css: -------------------------------------------------------------------------------- 1 | @import url("cssparsed.css"); 2 | 3 | html, body { 4 | font:0.8em Verdana,Helvetica,sans-serif; 5 | background:#F8F8F6; 6 | } 7 | 8 | code { 9 | font-size:1.2em; 10 | } 11 | 12 | div#rightcol { 13 | padding-left:32em; 14 | } 15 | 16 | fieldset { 17 | display:block; 18 | margin:0.5em 0; 19 | padding:1em; 20 | border:solid #7284AB 2px; 21 | } 22 | fieldset.code_output { 23 | display:inline; 24 | } 25 | 26 | h1 { 27 | font-size:2em; 28 | } 29 | 30 | small { 31 | font-size:0.7em; 32 | } 33 | 34 | fieldset#field_input { 35 | float:left; 36 | margin:0 0.5em 1em 0; 37 | } 38 | 39 | fieldset#options,fieldset#code_layout { 40 | width:31em; 41 | } 42 | 43 | input#submit { 44 | clear:both; 45 | display:block; 46 | margin:1em; 47 | } 48 | 49 | select { 50 | margin:2px 0 0; 51 | } 52 | 53 | label.block { 54 | display:block; 55 | } 56 | 57 | legend { 58 | background:#c4E1C3; 59 | padding:2px 4px; 60 | border:dashed 1px; 61 | } 62 | 63 | textarea#css_text { 64 | width:27em; 65 | height:370px; 66 | display:block; 67 | margin-right:1em; 68 | } 69 | 70 | .help { 71 | cursor:help; 72 | } 73 | 74 | p.important { 75 | border:solid 1px red; 76 | font-weight:bold; 77 | padding:1em; 78 | background:white; 79 | } 80 | 81 | p { 82 | margin:1em 0; 83 | } 84 | 85 | dl { 86 | padding-left:0.5em; 87 | } 88 | 89 | dt { 90 | font-weight:bold; 91 | margin:0; 92 | float:left; 93 | clear:both; 94 | height:1.5em; 95 | } 96 | 97 | dd { 98 | margin:0 0 0 4em; 99 | height:1.5em; 100 | } 101 | 102 | fieldset#messages { 103 | background:white; 104 | padding:0 0 0 1em; 105 | } 106 | 107 | fieldset#messages div { 108 | height:10em; 109 | overflow:auto; 110 | } 111 | 112 | dd.Warning { 113 | color:orange; 114 | } 115 | 116 | dd.Information { 117 | color:green; 118 | } -------------------------------------------------------------------------------- /csstidy/cssparsed.css: -------------------------------------------------------------------------------- 1 | code#copytext { 2 | white-space: pre; 3 | font-family: Verdana; 4 | } 5 | 6 | .at { 7 | color:darkblue; 8 | } 9 | 10 | .format { 11 | color:gray; 12 | } 13 | 14 | .property { 15 | color:green; 16 | } 17 | 18 | .selector { 19 | color:blue; 20 | } 21 | 22 | .value { 23 | color:red; 24 | left: 500px; 25 | } 26 | 27 | .comment { 28 | color:orange; 29 | } -------------------------------------------------------------------------------- /csstidy/lang.inc.php: -------------------------------------------------------------------------------- 1 | . 22 | * 23 | * @license http://opensource.org/licenses/lgpl-license.php GNU Lesser General Public License 24 | * @package csstidy 25 | * @author Florian Schmitz (floele at gmail dot com) 2005-2007 26 | * @author Brett Zamir (brettz9 at yahoo dot com) 2007 27 | */ 28 | 29 | 30 | if(isset($_GET['lang'])) { 31 | $l = $_GET['lang']; 32 | } 33 | else if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { 34 | $l = $_SERVER['HTTP_ACCEPT_LANGUAGE']; 35 | $l = strtolower(substr($l, 0, 2)); 36 | } 37 | else { 38 | $l = ''; 39 | } 40 | 41 | $l = (in_array($l, array('de', 'fr', 'zh'))) ? $l : 'en'; 42 | 43 | // note 5 in all but French, and 40 in all are orphaned 44 | 45 | $lang = array(); 46 | $lang['en'][0] = 'CSS Formatter and Optimiser/Optimizer (based on CSSTidy '; 47 | $lang['en'][1] = 'CSS Formatter and Optimiser'; 48 | $lang['en'][2] = '(based on'; 49 | $lang['en'][3] = '(plaintext)'; 50 | $lang['en'][4] = 'Important Note:'; 51 | $lang['en'][6] = 'Your code should be well-formed. This is not a validator which points out errors in your CSS code. To make sure that your code is valid, use the W3C Validator.'; 52 | $lang['en'][7] = 'all comments are removed'; 53 | $lang['en'][8] = 'CSS Input:'; 54 | $lang['en'][9] = 'CSS-Code:'; 55 | $lang['en'][10] = 'CSS from URL:'; 56 | $lang['en'][11] = 'Code Layout:'; 57 | $lang['en'][12] = 'Compression (code layout):'; 58 | $lang['en'][13] = 'Highest (no readability, smallest size)'; 59 | $lang['en'][14] = 'High (moderate readability, smaller size)'; 60 | $lang['en'][15] = 'Standard (balance between readability and size)'; 61 | $lang['en'][16] = 'Low (higher readability)'; 62 | $lang['en'][17] = 'Custom (enter below)'; 63 | $lang['en'][18] = 'Custom template'; 64 | $lang['en'][19] = 'Options'; 65 | $lang['en'][20] = 'Sort Selectors (caution)'; 66 | $lang['en'][21] = 'Sort Properties'; 67 | $lang['en'][22] = 'Regroup selectors'; 68 | $lang['en'][23] = 'Optimise shorthands'; 69 | $lang['en'][24] = 'Compress colors'; 70 | $lang['en'][25] = 'Lowercase selectors'; 71 | $lang['en'][26] = 'Case for properties:'; 72 | $lang['en'][27] = 'Lowercase'; 73 | $lang['en'][28] = 'No or invalid CSS input or wrong URL!'; 74 | $lang['en'][29] = 'Uppercase'; 75 | $lang['en'][30] = 'lowercase elementnames needed for XHTML'; 76 | $lang['en'][31] = 'Remove unnecessary backslashes'; 77 | $lang['en'][32] = 'convert !important-hack'; 78 | $lang['en'][33] = 'Output as file'; 79 | $lang['en'][34] = 'Bigger compression because of smaller newlines (copy & paste doesn\'t work)'; 80 | $lang['en'][35] = 'Process CSS'; 81 | $lang['en'][36] = 'Compression Ratio'; 82 | $lang['en'][37] = 'Input'; 83 | $lang['en'][38] = 'Output'; 84 | $lang['en'][39] = 'Language'; 85 | $lang['en'][41] = 'Attention: This may change the behaviour of your CSS Code!'; 86 | $lang['en'][42] = 'Remove last ;'; 87 | $lang['en'][43] = 'Discard invalid properties'; 88 | $lang['en'][44] = 'Only safe optimisations'; 89 | $lang['en'][45] = 'Compress font-weight'; 90 | $lang['en'][46] = 'Save comments'; 91 | $lang['en'][47] = 'Do not change anything'; 92 | $lang['en'][48] = 'Only seperate selectors (split at ,)'; 93 | $lang['en'][49] = 'Merge selectors with the same properties (fast)'; 94 | $lang['en'][50] = 'Merge selectors intelligently (slow)'; 95 | $lang['en'][51] = 'Preserve CSS'; 96 | $lang['en'][52] = 'Save comments, hacks, etc. Most optimisations can *not* be applied if this is enabled.'; 97 | $lang['en'][53] = 'None'; 98 | $lang['en'][54] = 'Don\'t optimise'; 99 | $lang['en'][55] = 'Safe optimisations'; 100 | $lang['en'][56] = 'All optimisations'; 101 | $lang['en'][57] = 'Add timestamp'; 102 | $lang['en'][58] = 'Copy to clipboard'; 103 | $lang['en'][59] = 'Back to top'; 104 | $lang['en'][60] = 'Your browser doesn\'t support copy to clipboard.'; 105 | $lang['en'][61] = 'For bugs and suggestions feel free to'; 106 | $lang['en'][62] = 'contact me'; 107 | $lang['en'][63] = 'Output CSS code as complete HTML document'; 108 | $lang['en'][64] = 'Code'; 109 | $lang['en'][65] = 'CSS to style CSS output'; 110 | $lang['en'][66] = 'You need to go to about:config in your URL bar, select \'signed.applets.codebase_principal_support\' in the filter field, and set its value to true in order to use this feature; however, be aware that doing so increases security risks.'; 111 | 112 | 113 | $lang['de'][0] = 'CSS Formatierer und Optimierer (basierend auf CSSTidy '; 114 | $lang['de'][1] = 'CSS Formatierer und Optimierer'; 115 | $lang['de'][2] = '(basierend auf'; 116 | $lang['de'][3] = '(Textversion)'; 117 | $lang['de'][4] = 'Wichtiger Hinweis:'; 118 | $lang['de'][6] = 'Der CSS Code sollte wohlgeformt sein. Der CSS Code wird nicht auf Gültigkeit überprüft. Um sicherzugehen dass dein Code valide ist, benutze den W3C Validierungsservice.'; 119 | $lang['de'][7] = 'alle Kommentare werden entfernt'; 120 | $lang['de'][8] = 'CSS Eingabe:'; 121 | $lang['de'][9] = 'CSS-Code:'; 122 | $lang['de'][10] = 'CSS von URL:'; 123 | $lang['de'][11] = 'Code Layout:'; 124 | $lang['de'][12] = 'Komprimierung (Code Layout):'; 125 | $lang['de'][13] = 'Höchste (keine Lesbarkeit, niedrigste Größe)'; 126 | $lang['de'][14] = 'Hoch (mittelmäßige Lesbarkeit, geringe Größe)'; 127 | $lang['de'][15] = 'Standard (Kompromiss zwischen Lesbarkeit und Größe)'; 128 | $lang['de'][16] = 'Niedrig (höhere Lesbarkeit)'; 129 | $lang['de'][17] = 'Benutzerdefiniert (unten eingeben)'; 130 | $lang['de'][18] = 'Benutzerdefinierte Vorlage'; 131 | $lang['de'][19] = 'Optionen'; 132 | $lang['de'][20] = 'Selektoren sortieren (Vorsicht)'; 133 | $lang['de'][21] = 'Eigenschaften sortieren'; 134 | $lang['de'][22] = 'Selektoren umgruppieren'; 135 | $lang['de'][23] = 'Shorthands optimieren'; 136 | $lang['de'][24] = 'Farben komprimieren'; 137 | $lang['de'][25] = 'Selektoren in Kleinbuchstaben'; 138 | $lang['de'][26] = 'Groß-/Kleinschreibung für Eigenschaften'; 139 | $lang['de'][27] = 'Kleinbuchstaben'; 140 | $lang['de'][28] = 'Keine oder ungültige CSS Eingabe oder falsche URL!'; 141 | $lang['de'][29] = 'Großbuchstaben'; 142 | $lang['de'][30] = 'kleingeschriebene Elementnamen benötigt für XHTML'; 143 | $lang['de'][31] = 'Unnötige Backslashes entfernen'; 144 | $lang['de'][32] = '!important-Hack konvertieren'; 145 | $lang['de'][33] = 'Als Datei ausgeben'; 146 | $lang['de'][34] = 'Größere Komprimierung augrund von kleineren Neuezeile-Zeichen'; 147 | $lang['de'][35] = 'CSS verarbeiten'; 148 | $lang['de'][36] = 'Komprimierungsrate'; 149 | $lang['de'][37] = 'Eingabe'; 150 | $lang['de'][38] = 'Ausgabe'; 151 | $lang['de'][39] = 'Sprache'; 152 | $lang['de'][41] = 'Achtung: Dies könnte das Verhalten ihres CSS-Codes verändern!'; 153 | $lang['de'][42] = 'Letztes ; entfernen'; 154 | $lang['de'][43] = 'Ungültige Eigenschaften entfernen'; 155 | $lang['de'][44] = 'Nur sichere Optimierungen'; 156 | $lang['de'][45] = 'font-weight komprimieren'; 157 | $lang['de'][46] = 'Kommentare beibehalten'; 158 | $lang['de'][47] = 'Nichts ändern'; 159 | $lang['de'][48] = 'Selektoren nur trennen (am Komma)'; 160 | $lang['de'][49] = 'Selektoren mit gleichen Eigenschaften zusammenfassen (schnell)'; 161 | $lang['de'][50] = 'Selektoren intelligent zusammenfassen (langsam!)'; 162 | $lang['de'][51] = 'CSS erhalten'; 163 | $lang['de'][52] = 'Kommentare, Hacks, etc. speichern. Viele Optimierungen sind dann aber nicht mehr möglich.'; 164 | $lang['de'][53] = 'Keine'; 165 | $lang['de'][54] = 'Nicht optimieren'; 166 | $lang['de'][55] = 'Sichere Optimierungen'; 167 | $lang['de'][56] = 'Alle Optimierungen'; 168 | $lang['de'][57] = 'Zeitstempel hinzufügen'; 169 | $lang['de'][58] = 'Copy to clipboard'; 170 | $lang['de'][59] = 'Back to top'; 171 | $lang['de'][60] = 'Your browser doesn\'t support copy to clipboard.'; 172 | $lang['de'][61] = 'For bugs and suggestions feel free to'; 173 | $lang['de'][62] = 'contact me'; 174 | $lang['de'][63] = 'Output CSS code as complete HTML document'; 175 | $lang['de'][64] = 'Code'; 176 | $lang['de'][65] = 'CSS to style CSS output'; 177 | $lang['de'][66] = 'You need to go to about:config in your URL bar, select \'signed.applets.codebase_principal_support\' in the filter field, and set its value to true in order to use this feature; however, be aware that doing so increases security risks.'; 178 | 179 | 180 | $lang['fr'][0] = 'CSS Formatteur et Optimiseur (basé sur CSSTidy '; 181 | $lang['fr'][1] = 'CSS Formatteur et Optimiseur'; 182 | $lang['fr'][2] = '(basé sur '; 183 | $lang['fr'][3] = '(Version texte)'; 184 | $lang['fr'][4] = 'Note Importante :'; 185 | $lang['fr'][6] = 'Votre code doit être valide. Ce n’est pas un validateur qui signale les erreurs dans votre code CSS. Pour être sûr que votre code est correct, utilisez le validateur : W3C Validator.'; 186 | $lang['fr'][7] = 'tous les commentaires sont enlevés'; 187 | $lang['fr'][8] = 'Champ CSS :'; 188 | $lang['fr'][9] = 'Code CSS :'; 189 | $lang['fr'][10] = 'CSS en provenance d’une URL :'. htmlspecialchars(implode("\n", $lines)) .'
'. htmlspecialchars(implode("\n", $lines)) .'
'. htmlspecialchars(implode("\n", $lines)) .'
'. htmlspecialchars(implode("\n", $lines)) .'
'. htmlspecialchars(implode("\n", $orig)) .'
'. htmlspecialchars(implode("\n", $final)) .'
'. htmlspecialchars($this->css) .''; 102 | $diff = new Text_Diff('auto', array(explode("\n", $this->expect), explode("\n", $this->actual))); 103 | $renderer = new Text_Diff_Renderer_parallel(); 104 | $renderer->original = 'Expected'; 105 | $renderer->final = 'Actual'; 106 | $message .= $renderer->render($diff); 107 | return $message; 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/class.csstidy_harness.php: -------------------------------------------------------------------------------- 1 | css[41] 11 | 12 | Note carefully that EXPECT is for csstidy->css[41], not csstidy->css. This 13 | is because, by default, all declarations are placed inside the 14 | DEFAULT_AT section. For tests that need to make use of at selectors, use 15 | 16 | --FULLEXPECT-- 17 | var_export() representation of csstidy->css 18 | 19 | ...instead. 20 | 21 | See also: class.csstidy_csst.php (the implementation of these tests) and 22 | test.csst.php (the caller stub for SimpleTest) 23 | -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/properties/css1.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Test CSS1 properties 3 | --CSS-- 4 | a { 5 | foo:rgb(0,0,0); 6 | bar:black; 7 | baz:#ffaabb; 8 | qux:#f00; 9 | quux:blanchedalmond; 10 | quuux:rgb(0,0,1); 11 | background:1; 12 | background-color:1; 13 | background-image:1; 14 | background-repeat:1; 15 | background-attachment:1; 16 | background-position:1; 17 | border:1; 18 | border-top:1; 19 | border-right:1; 20 | border-bottom:1; 21 | border-left:1; 22 | border-color:1; 23 | border-style:1; 24 | border-width:1; 25 | border-top-width:1; 26 | border-right-width:1; 27 | border-left-width:1; 28 | border-bottom-width:1; 29 | clear:1; 30 | clip:1; 31 | color:1; 32 | display:1; 33 | float:1; 34 | font:1; 35 | font-family:1; 36 | font-style:1; 37 | font-variant:1; 38 | font-weight:1; 39 | font-size:1; 40 | height:1; 41 | left:1; 42 | line-height:1; 43 | list-style:1; 44 | list-style-type:1; 45 | list-style-image:1; 46 | list-style-position:1; 47 | margin:1; 48 | margin-top:1; 49 | margin-right:1; 50 | margin-bottom:1; 51 | margin-left:1; 52 | marks:1; 53 | overflow:1; 54 | padding:1; 55 | padding-top:1; 56 | padding-right:1; 57 | padding-bottom:1; 58 | padding-left:1; 59 | page-break-before:1; 60 | page-break-after:1; 61 | position:1; 62 | size:1; 63 | top:1; 64 | text-indent:1; 65 | text-align:1; 66 | text-decoration:1; 67 | letter-spacing:1; 68 | word-spacing:1; 69 | text-transform:1; 70 | white-space:1; 71 | vertical-align:1; 72 | visibility:1; 73 | width:1; 74 | z-index:1; 75 | } 76 | --EXPECT-- 77 | array ( 78 | 'a' => 79 | array ( 80 | 'background' => '1px', 81 | 'background-color' => '#1', 82 | 'background-image' => '1', 83 | 'background-repeat' => '1', 84 | 'background-attachment' => '1', 85 | 'background-position' => '1px', 86 | 'border' => '1px', 87 | 'border-top' => '1px', 88 | 'border-right' => '1px', 89 | 'border-bottom' => '1px', 90 | 'border-left' => '1px', 91 | 'border-color' => '#1', 92 | 'border-style' => '1', 93 | 'border-width' => '1px', 94 | 'border-top-width' => '1px', 95 | 'border-right-width' => '1px', 96 | 'border-left-width' => '1px', 97 | 'border-bottom-width' => '1px', 98 | 'clear' => '1', 99 | 'clip' => '1', 100 | 'color' => '#1', 101 | 'display' => '1', 102 | 'float' => '1', 103 | 'font' => '1', 104 | 'font-family' => '1', 105 | 'font-style' => '1', 106 | 'font-variant' => '1', 107 | 'font-weight' => '1', 108 | 'font-size' => '1px', 109 | 'height' => '1px', 110 | 'left' => '1px', 111 | 'line-height' => '1', 112 | 'list-style' => '1', 113 | 'list-style-type' => '1', 114 | 'list-style-image' => '1', 115 | 'list-style-position' => '1', 116 | 'margin' => '1px', 117 | 'margin-top' => '1px', 118 | 'margin-right' => '1px', 119 | 'margin-bottom' => '1px', 120 | 'margin-left' => '1px', 121 | 'marks' => '1', 122 | 'overflow' => '1', 123 | 'padding' => '1px', 124 | 'padding-top' => '1px', 125 | 'padding-right' => '1px', 126 | 'padding-bottom' => '1px', 127 | 'padding-left' => '1px', 128 | 'page-break-before' => '1', 129 | 'page-break-after' => '1', 130 | 'position' => '1', 131 | 'size' => '1', 132 | 'top' => '1px', 133 | 'text-indent' => '1px', 134 | 'text-align' => '1', 135 | 'text-decoration' => '1', 136 | 'letter-spacing' => '1px', 137 | 'word-spacing' => '1px', 138 | 'text-transform' => '1', 139 | 'white-space' => '1', 140 | 'vertical-align' => '1', 141 | 'visibility' => '1', 142 | 'width' => '1px', 143 | 'z-index' => '1', 144 | ), 145 | ) 146 | --SETTINGS-- 147 | discard_invalid_properties=true 148 | optimise_shorthands=0 149 | css_level='CSS1' -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/properties/css2.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Test CSS1 properties 3 | --CSS-- 4 | a { 5 | foo:rgb(0,0,0); 6 | bar:black; 7 | baz:#ffaabb; 8 | qux:#f00; 9 | quux:blanchedalmond; 10 | quuux:rgb(0,0,1); 11 | background:1; 12 | background-color:1; 13 | background-image:1; 14 | background-repeat:1; 15 | background-attachment:1; 16 | background-position:1; 17 | border:1; 18 | border-top:1; 19 | border-right:1; 20 | border-bottom:1; 21 | border-left:1; 22 | border-color:1; 23 | border-top-color:1; 24 | border-bottom-color:1; 25 | border-left-color:1; 26 | border-right-color:1; 27 | border-style:1; 28 | border-top-style:1; 29 | border-right-style:1; 30 | border-left-style:1; 31 | border-bottom-style:1; 32 | border-width:1; 33 | border-top-width:1; 34 | border-right-width:1; 35 | border-left-width:1; 36 | border-bottom-width:1; 37 | border-collapse:1; 38 | border-spacing:1; 39 | bottom:1; 40 | caption-side:1; 41 | content:1; 42 | clear:1; 43 | clip:1; 44 | color:1; 45 | counter-reset:1; 46 | counter-increment:1; 47 | cursor:1; 48 | empty-cells:1; 49 | display:1; 50 | direction:1; 51 | float:1; 52 | font:1; 53 | font-family:1; 54 | font-style:1; 55 | font-variant:1; 56 | font-weight:1; 57 | font-stretch:1; 58 | font-size-adjust:1; 59 | font-size:1; 60 | height:1; 61 | left:1; 62 | line-height:1; 63 | list-style:1; 64 | list-style-type:1; 65 | list-style-image:1; 66 | list-style-position:1; 67 | margin:1; 68 | margin-top:1; 69 | margin-right:1; 70 | margin-bottom:1; 71 | margin-left:1; 72 | marks:1; 73 | marker-offset:1; 74 | max-height:1; 75 | max-width:1; 76 | min-height:1; 77 | min-width:1; 78 | overflow:1; 79 | orphans:1; 80 | outline:1; 81 | outline-width:1; 82 | outline-style:1; 83 | outline-color:1; 84 | padding:1; 85 | padding-top:1; 86 | padding-right:1; 87 | padding-bottom:1; 88 | padding-left:1; 89 | page-break-before:1; 90 | page-break-after:1; 91 | page-break-inside:1; 92 | page:1; 93 | position:1; 94 | quotes:1; 95 | right:1; 96 | size:1; 97 | speak-header:1; 98 | table-layout:1; 99 | top:1; 100 | text-indent:1; 101 | text-align:1; 102 | text-decoration:1; 103 | text-shadow:1; 104 | letter-spacing:1; 105 | word-spacing:1; 106 | text-transform:1; 107 | white-space:1; 108 | unicode-bidi:1; 109 | vertical-align:1; 110 | visibility:1; 111 | width:1; 112 | widows:1; 113 | z-index:1; 114 | volume:1; 115 | speak:1; 116 | pause:1; 117 | pause-before:1; 118 | pause-after:1; 119 | cue:1; 120 | cue-before:1; 121 | cue-after:1; 122 | play-during:1; 123 | azimuth:1; 124 | elevation:1; 125 | speech-rate:1; 126 | voice-family:1; 127 | pitch:1; 128 | pitch-range:1; 129 | stress:1; 130 | richness:1; 131 | speak-punctuation:1; 132 | speak-numeral:1; 133 | } 134 | --EXPECT-- 135 | array ( 136 | 'a' => 137 | array ( 138 | 'background' => '1px', 139 | 'background-color' => '#1', 140 | 'background-image' => '1', 141 | 'background-repeat' => '1', 142 | 'background-attachment' => '1', 143 | 'background-position' => '1px', 144 | 'border' => '1px', 145 | 'border-top' => '1px', 146 | 'border-right' => '1px', 147 | 'border-bottom' => '1px', 148 | 'border-left' => '1px', 149 | 'border-color' => '#1', 150 | 'border-top-color' => '#1', 151 | 'border-bottom-color' => '#1', 152 | 'border-left-color' => '#1', 153 | 'border-right-color' => '#1', 154 | 'border-style' => '1', 155 | 'border-top-style' => '1', 156 | 'border-right-style' => '1', 157 | 'border-left-style' => '1', 158 | 'border-bottom-style' => '1', 159 | 'border-width' => '1px', 160 | 'border-top-width' => '1px', 161 | 'border-right-width' => '1px', 162 | 'border-left-width' => '1px', 163 | 'border-bottom-width' => '1px', 164 | 'border-collapse' => '1', 165 | 'border-spacing' => '1px', 166 | 'bottom' => '1px', 167 | 'caption-side' => '1', 168 | 'content' => '1', 169 | 'clear' => '1', 170 | 'clip' => '1', 171 | 'color' => '#1', 172 | 'counter-reset' => '1', 173 | 'counter-increment' => '1', 174 | 'cursor' => '1', 175 | 'empty-cells' => '1', 176 | 'display' => '1', 177 | 'direction' => '1', 178 | 'float' => '1', 179 | 'font' => '1', 180 | 'font-family' => '1', 181 | 'font-style' => '1', 182 | 'font-variant' => '1', 183 | 'font-weight' => '1', 184 | 'font-stretch' => '1', 185 | 'font-size-adjust' => '1', 186 | 'font-size' => '1px', 187 | 'height' => '1px', 188 | 'left' => '1px', 189 | 'line-height' => '1', 190 | 'list-style' => '1', 191 | 'list-style-type' => '1', 192 | 'list-style-image' => '1', 193 | 'list-style-position' => '1', 194 | 'margin' => '1px', 195 | 'margin-top' => '1px', 196 | 'margin-right' => '1px', 197 | 'margin-bottom' => '1px', 198 | 'margin-left' => '1px', 199 | 'marks' => '1', 200 | 'marker-offset' => '1', 201 | 'max-height' => '1px', 202 | 'max-width' => '1px', 203 | 'min-height' => '1px', 204 | 'min-width' => '1px', 205 | 'overflow' => '1', 206 | 'orphans' => '1', 207 | 'outline' => '1px', 208 | 'outline-width' => '1px', 209 | 'outline-style' => '1', 210 | 'outline-color' => '#1', 211 | 'padding' => '1px', 212 | 'padding-top' => '1px', 213 | 'padding-right' => '1px', 214 | 'padding-bottom' => '1px', 215 | 'padding-left' => '1px', 216 | 'page-break-before' => '1', 217 | 'page-break-after' => '1', 218 | 'page-break-inside' => '1', 219 | 'page' => '1', 220 | 'position' => '1', 221 | 'quotes' => '1', 222 | 'right' => '1px', 223 | 'size' => '1', 224 | 'speak-header' => '1', 225 | 'table-layout' => '1', 226 | 'top' => '1px', 227 | 'text-indent' => '1px', 228 | 'text-align' => '1', 229 | 'text-decoration' => '1', 230 | 'text-shadow' => '1', 231 | 'letter-spacing' => '1px', 232 | 'word-spacing' => '1px', 233 | 'text-transform' => '1', 234 | 'white-space' => '1', 235 | 'unicode-bidi' => '1', 236 | 'vertical-align' => '1', 237 | 'visibility' => '1', 238 | 'width' => '1px', 239 | 'widows' => '1', 240 | 'z-index' => '1', 241 | 'volume' => '1', 242 | 'speak' => '1', 243 | 'pause' => '1', 244 | 'pause-before' => '1', 245 | 'pause-after' => '1', 246 | 'cue' => '1', 247 | 'cue-before' => '1', 248 | 'cue-after' => '1', 249 | 'play-during' => '1', 250 | 'azimuth' => '1', 251 | 'elevation' => '1', 252 | 'speech-rate' => '1', 253 | 'voice-family' => '1', 254 | 'pitch' => '1', 255 | 'pitch-range' => '1', 256 | 'stress' => '1', 257 | 'richness' => '1', 258 | 'speak-punctuation' => '1', 259 | 'speak-numeral' => '1', 260 | ), 261 | ) 262 | --SETTINGS-- 263 | discard_invalid_properties=true 264 | optimise_shorthands=0 265 | css_level='CSS2.0' -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/properties/css21.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Test CSS1 properties 3 | --CSS-- 4 | a { 5 | foo:rgb(0,0,0); 6 | bar:black; 7 | baz:#ffaabb; 8 | qux:#f00; 9 | quux:blanchedalmond; 10 | quuux:rgb(0,0,1); 11 | background:1; 12 | background-color:1; 13 | background-image:1; 14 | background-repeat:1; 15 | background-attachment:1; 16 | background-position:1; 17 | border:1; 18 | border-top:1; 19 | border-right:1; 20 | border-bottom:1; 21 | border-left:1; 22 | border-color:1; 23 | border-top-color:1; 24 | border-bottom-color:1; 25 | border-left-color:1; 26 | border-right-color:1; 27 | border-style:1; 28 | border-top-style:1; 29 | border-right-style:1; 30 | border-left-style:1; 31 | border-bottom-style:1; 32 | border-width:1; 33 | border-top-width:1; 34 | border-right-width:1; 35 | border-left-width:1; 36 | border-bottom-width:1; 37 | border-collapse:1; 38 | border-spacing:1; 39 | bottom:1; 40 | caption-side:1; 41 | content:1; 42 | clear:1; 43 | clip:1; 44 | color:1; 45 | counter-reset:1; 46 | counter-increment:1; 47 | cursor:1; 48 | empty-cells:1; 49 | display:1; 50 | direction:1; 51 | float:1; 52 | font:1; 53 | font-family:1; 54 | font-style:1; 55 | font-variant:1; 56 | font-weight:1; 57 | font-stretch:1; 58 | font-size-adjust:1; 59 | font-size:1; 60 | height:1; 61 | left:1; 62 | line-height:1; 63 | list-style:1; 64 | list-style-type:1; 65 | list-style-image:1; 66 | list-style-position:1; 67 | margin:1; 68 | margin-top:1; 69 | margin-right:1; 70 | margin-bottom:1; 71 | margin-left:1; 72 | marks:1; 73 | marker-offset:1; 74 | max-height:1; 75 | max-width:1; 76 | min-height:1; 77 | min-width:1; 78 | overflow:1; 79 | orphans:1; 80 | outline:1; 81 | outline-width:1; 82 | outline-style:1; 83 | outline-color:1; 84 | padding:1; 85 | padding-top:1; 86 | padding-right:1; 87 | padding-bottom:1; 88 | padding-left:1; 89 | page-break-before:1; 90 | page-break-after:1; 91 | page-break-inside:1; 92 | page:1; 93 | position:1; 94 | quotes:1; 95 | right:1; 96 | size:1; 97 | speak-header:1; 98 | table-layout:1; 99 | top:1; 100 | text-indent:1; 101 | text-align:1; 102 | text-decoration:1; 103 | text-shadow:1; 104 | letter-spacing:1; 105 | word-spacing:1; 106 | text-transform:1; 107 | white-space:1; 108 | unicode-bidi:1; 109 | vertical-align:1; 110 | visibility:1; 111 | width:1; 112 | widows:1; 113 | z-index:1; 114 | volume:1; 115 | speak:1; 116 | pause:1; 117 | pause-before:1; 118 | pause-after:1; 119 | cue:1; 120 | cue-before:1; 121 | cue-after:1; 122 | play-during:1; 123 | azimuth:1; 124 | elevation:1; 125 | speech-rate:1; 126 | voice-family:1; 127 | pitch:1; 128 | pitch-range:1; 129 | stress:1; 130 | richness:1; 131 | speak-punctuation:1; 132 | speak-numeral:1; 133 | } 134 | --EXPECT-- 135 | array ( 136 | 'a' => 137 | array ( 138 | 'background' => '1px', 139 | 'background-color' => '#1', 140 | 'background-image' => '1', 141 | 'background-repeat' => '1', 142 | 'background-attachment' => '1', 143 | 'background-position' => '1px', 144 | 'border' => '1px', 145 | 'border-top' => '1px', 146 | 'border-right' => '1px', 147 | 'border-bottom' => '1px', 148 | 'border-left' => '1px', 149 | 'border-color' => '#1', 150 | 'border-top-color' => '#1', 151 | 'border-bottom-color' => '#1', 152 | 'border-left-color' => '#1', 153 | 'border-right-color' => '#1', 154 | 'border-style' => '1', 155 | 'border-top-style' => '1', 156 | 'border-right-style' => '1', 157 | 'border-left-style' => '1', 158 | 'border-bottom-style' => '1', 159 | 'border-width' => '1px', 160 | 'border-top-width' => '1px', 161 | 'border-right-width' => '1px', 162 | 'border-left-width' => '1px', 163 | 'border-bottom-width' => '1px', 164 | 'border-collapse' => '1', 165 | 'border-spacing' => '1px', 166 | 'bottom' => '1px', 167 | 'caption-side' => '1', 168 | 'content' => '1', 169 | 'clear' => '1', 170 | 'clip' => '1', 171 | 'color' => '#1', 172 | 'counter-reset' => '1', 173 | 'counter-increment' => '1', 174 | 'cursor' => '1', 175 | 'empty-cells' => '1', 176 | 'display' => '1', 177 | 'direction' => '1', 178 | 'float' => '1', 179 | 'font' => '1', 180 | 'font-family' => '1', 181 | 'font-style' => '1', 182 | 'font-variant' => '1', 183 | 'font-weight' => '1', 184 | 'font-size' => '1px', 185 | 'height' => '1px', 186 | 'left' => '1px', 187 | 'line-height' => '1', 188 | 'list-style' => '1', 189 | 'list-style-type' => '1', 190 | 'list-style-image' => '1', 191 | 'list-style-position' => '1', 192 | 'margin' => '1px', 193 | 'margin-top' => '1px', 194 | 'margin-right' => '1px', 195 | 'margin-bottom' => '1px', 196 | 'margin-left' => '1px', 197 | 'max-height' => '1px', 198 | 'max-width' => '1px', 199 | 'min-height' => '1px', 200 | 'min-width' => '1px', 201 | 'overflow' => '1', 202 | 'orphans' => '1', 203 | 'outline' => '1px', 204 | 'outline-width' => '1px', 205 | 'outline-style' => '1', 206 | 'outline-color' => '#1', 207 | 'padding' => '1px', 208 | 'padding-top' => '1px', 209 | 'padding-right' => '1px', 210 | 'padding-bottom' => '1px', 211 | 'padding-left' => '1px', 212 | 'page-break-before' => '1', 213 | 'page-break-after' => '1', 214 | 'page-break-inside' => '1', 215 | 'position' => '1', 216 | 'quotes' => '1', 217 | 'right' => '1px', 218 | 'speak-header' => '1', 219 | 'table-layout' => '1', 220 | 'top' => '1px', 221 | 'text-indent' => '1px', 222 | 'text-align' => '1', 223 | 'text-decoration' => '1', 224 | 'letter-spacing' => '1px', 225 | 'word-spacing' => '1px', 226 | 'text-transform' => '1', 227 | 'white-space' => '1', 228 | 'unicode-bidi' => '1', 229 | 'vertical-align' => '1', 230 | 'visibility' => '1', 231 | 'width' => '1px', 232 | 'widows' => '1', 233 | 'z-index' => '1', 234 | 'volume' => '1', 235 | 'speak' => '1', 236 | 'pause' => '1', 237 | 'pause-before' => '1', 238 | 'pause-after' => '1', 239 | 'cue' => '1', 240 | 'cue-before' => '1', 241 | 'cue-after' => '1', 242 | 'play-during' => '1', 243 | 'azimuth' => '1', 244 | 'elevation' => '1', 245 | 'speech-rate' => '1', 246 | 'voice-family' => '1', 247 | 'pitch' => '1', 248 | 'pitch-range' => '1', 249 | 'stress' => '1', 250 | 'richness' => '1', 251 | 'speak-punctuation' => '1', 252 | 'speak-numeral' => '1', 253 | ), 254 | ) 255 | --SETTINGS-- 256 | discard_invalid_properties=true 257 | optimise_shorthands=0 258 | css_level='CSS2.1' -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/selectors/active.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Dynamic active selector 3 | --CSS-- 4 | a:active {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | 'a:active' => 8 | array ( 9 | 'display' => 'inherit', 10 | ), 11 | ) 12 | -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/selectors/adjacent.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Adjacent selector 3 | --CSS-- 4 | a + b {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | 'a + b' => 8 | array ( 9 | 'display' => 'inherit', 10 | ), 11 | ) 12 | -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/selectors/attribute-begins.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Begins hyphen-separated attribute list selector 3 | --CSS-- 4 | a[foo|="en"] {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | 'a[foo|="en"]' => 8 | array ( 9 | 'display' => 'inherit', 10 | ), 11 | ) 12 | -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/selectors/attribute-contains.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Contained in space-separated attribute list selector 3 | --CSS-- 4 | a[foo~="warning"] {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | 'a[foo~="warning"]' => 8 | array ( 9 | 'display' => 'inherit', 10 | ), 11 | ) 12 | -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/selectors/attribute-equals.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Attribute equals selector 3 | --CSS-- 4 | a[foo="warning"] {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | 'a[foo="warning"]' => 8 | array ( 9 | 'display' => 'inherit', 10 | ), 11 | ) 12 | -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/selectors/attribute-set.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Attribute selector 3 | --CSS-- 4 | a[foo] {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | 'a[foo]' => 8 | array ( 9 | 'display' => 'inherit', 10 | ), 11 | ) 12 | -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/selectors/chain.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Chained selector 3 | --CSS-- 4 | a * > div[attr="value"].class + div#id:hover {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | 'a * > div[attr="value"].class + div#id:hover' => 8 | array ( 9 | 'display' => 'inherit', 10 | ), 11 | ) 12 | -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/selectors/child.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Child selector 3 | --CSS-- 4 | table > tr {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | 'table > tr' => 8 | array ( 9 | 'display' => 'inherit', 10 | ), 11 | ) 12 | -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/selectors/class.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Class selector 3 | --CSS-- 4 | a.foo {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | 'a.foo' => 8 | array ( 9 | 'display' => 'inherit', 10 | ), 11 | ) 12 | -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/selectors/combinator-compressed.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Combinator selector 3 | --CSS-- 4 | a>b {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | 'a>b' => 8 | array ( 9 | 'display' => 'inherit', 10 | ), 11 | ) 12 | -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/selectors/descendant.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Descendant selector 3 | --CSS-- 4 | table tr {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | 'table tr' => 8 | array ( 9 | 'display' => 'inherit', 10 | ), 11 | ) 12 | -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/selectors/errors/dangling-combinator.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Dangling combinator selector 3 | --CSS-- 4 | + b {display: inherit;} 5 | b > {font-family: inherit;} 6 | asdf {font-size: inherit;} 7 | --EXPECT-- 8 | array ( 9 | ) 10 | --SETTINGS-- 11 | optimise_shorthands=0 12 | discard_invalid_selectors=1 -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/selectors/errors/duplicate-combinator.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Duplicate combinator selector 3 | --CSS-- 4 | div + + b {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | ) 8 | --SETTINGS-- 9 | discard_invalid_selectors=1 -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/selectors/first-child.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | First child selector 3 | --CSS-- 4 | p:first-child {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | 'p:first-child' => 8 | array ( 9 | 'display' => 'inherit', 10 | ), 11 | ) 12 | -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/selectors/focus.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Dynamic focus selector 3 | --CSS-- 4 | a:focus {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | 'a:focus' => 8 | array ( 9 | 'display' => 'inherit', 10 | ), 11 | ) 12 | -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/selectors/grouping.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Grouped selectors 3 | --CSS-- 4 | h1,h2,h3 {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | 'h1,h2,h3' => 8 | array ( 9 | 'display' => 'inherit', 10 | ), 11 | ) 12 | -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/selectors/hover.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Dynamic hover selector 3 | --CSS-- 4 | a:hover {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | 'a:hover' => 8 | array ( 9 | 'display' => 'inherit', 10 | ), 11 | ) 12 | -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/selectors/id.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | ID selector 3 | --CSS-- 4 | a#foo {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | 'a#foo' => 8 | array ( 9 | 'display' => 'inherit', 10 | ), 11 | ) 12 | -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/selectors/lang.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Language selector 3 | --CSS-- 4 | div:lang(en) {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | 'div:lang(en)' => 8 | array ( 9 | 'display' => 'inherit', 10 | ), 11 | ) 12 | -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/selectors/link.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Not-visited link selector 3 | --CSS-- 4 | a:link {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | 'a:link' => 8 | array ( 9 | 'display' => 'inherit', 10 | ), 11 | ) 12 | -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/selectors/merge-optimization.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Merge selectors optimization 3 | --CSS-- 4 | h1 {display: inherit;} 5 | h2 {display: inherit;} 6 | h3 {display: inherit;} 7 | --EXPECT-- 8 | array ( 9 | 'h1,h2,h3' => 10 | array ( 11 | 'display' => 'inherit', 12 | ), 13 | ) 14 | --SETTINGS-- 15 | merge_selectors=2 -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/selectors/merge-preserve.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Merge selectors optimization off 3 | --SETTINGS-- 4 | merge_selectors = 0 5 | --CSS-- 6 | h1 {display: inherit;} 7 | h2 {display: inherit;} 8 | h3 {display: inherit;} 9 | --EXPECT-- 10 | array ( 11 | 'h1' => 12 | array ( 13 | 'display' => 'inherit', 14 | ), 15 | 'h2' => 16 | array ( 17 | 'display' => 'inherit', 18 | ), 19 | 'h3' => 20 | array ( 21 | 'display' => 'inherit', 22 | ), 23 | ) 24 | -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/selectors/pseudo-elements.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Pseudo elements selectors 3 | --CSS-- 4 | P:first-line { display: inherit; } 5 | P:first-letter { font-size: inherit; } 6 | H1:before { font-family: inherit; } 7 | H1:after { font-weight: inherit; } 8 | --EXPECT-- 9 | array ( 10 | 'P:first-line' => 11 | array ( 12 | 'display' => 'inherit', 13 | ), 14 | 'P:first-letter' => 15 | array ( 16 | 'font-size' => 'inherit', 17 | ), 18 | 'H1:before' => 19 | array ( 20 | 'font-family' => 'inherit', 21 | ), 22 | 'H1:after' => 23 | array ( 24 | 'font-weight' => 'inherit', 25 | ), 26 | ) -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/selectors/simple.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Simple selector 3 | --CSS-- 4 | a[foo="bar"].class#id:hover {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | 'a[foo="bar"].class#id:hover' => 8 | array ( 9 | 'display' => 'inherit', 10 | ), 11 | ) 12 | -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/selectors/type.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Type selector 3 | --CSS-- 4 | a {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | 'a' => 8 | array ( 9 | 'display' => 'inherit', 10 | ), 11 | ) 12 | -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/selectors/universal-optimization.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Universal selector optimization 3 | --CSS-- 4 | *.foo {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | '.foo' => 8 | array ( 9 | 'display' => 'inherit', 10 | ), 11 | ) -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/selectors/universal-shorthand.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Universal selector shorthand 3 | --CSS-- 4 | .foo {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | '.foo' => 8 | array ( 9 | 'display' => 'inherit', 10 | ), 11 | ) -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/selectors/universal.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Universal selector 3 | --CSS-- 4 | * {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | '*' => 8 | array ( 9 | 'display' => 'inherit', 10 | ), 11 | ) -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/selectors/visited.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Visited link selector 3 | --CSS-- 4 | a:visited {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | 'a:visited' => 8 | array ( 9 | 'display' => 'inherit', 10 | ), 11 | ) 12 | -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/shorthands/background-general.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Test general background optimization 3 | --CSS-- 4 | a { 5 | background-color: white; 6 | background-image: url(123); 7 | background-repeat: no-repeat; 8 | background-position: 1px 1px; 9 | background-attachment: scroll; 10 | } 11 | --EXPECT-- 12 | array ( 13 | 'a' => 14 | array ( 15 | 'background' => 'url(123) no-repeat 1px 1px #fff', 16 | ), 17 | ) 18 | --SETTINGS-- 19 | optimise_shorthands=3 -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/shorthands/background-noopt.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Test general background optimization 3 | --CSS-- 4 | a { 5 | background-color: white; 6 | background-image: url(123); 7 | background-repeat: no-repeat; 8 | background-position: 1px 1px; 9 | background-attachment: scroll; 10 | } 11 | --EXPECT-- 12 | array ( 13 | 'a' => 14 | array ( 15 | 'background-color' => '#fff', 16 | 'background-image' => 'url(123)', 17 | 'background-repeat' => 'no-repeat', 18 | 'background-position' => '1px 1px', 19 | 'background-attachment' => 'scroll', 20 | ), 21 | ) 22 | --SETTINGS-- 23 | optimise_shorthands=1 -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/shorthands/font-face.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Test font-face optimization (no optimization) 3 | --CSS-- 4 | @font-face { 5 | src: url("fonts/share.ttf") format("truetype"); 6 | } 7 | --EXPECT-- 8 | array ( 9 | '@font-face_1' => 10 | array ( 11 | 'src' => 'url(fonts/share.ttf) format("truetype")', 12 | ), 13 | ) 14 | --SETTINGS-- 15 | optimise_shorthands=0 -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/shorthands/font-general.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Test general font optimization 3 | --CSS-- 4 | a { 5 | font-weight: bold; 6 | font-size: 12px; 7 | line-height: 2em; 8 | font-family: Arial, "Trebuchet MS", serif; 9 | } 10 | b { 11 | font: 14px/1.25 Trebuchet MS, Arial, Tahoma, sans-serif; 12 | } 13 | --EXPECT-- 14 | array ( 15 | 'a' => 16 | array ( 17 | 'font' => '700 12px/2em Arial,"Trebuchet MS",serif', 18 | ), 19 | 'b' => 20 | array ( 21 | 'font' => '14px/1.25 "Trebuchet MS",Arial,Tahoma,sans-serif', 22 | ), 23 | ) 24 | --SETTINGS-- 25 | optimise_shorthands=2 -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/shorthands/font-noopt.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Test general font optimization (no optimization) 3 | --CSS-- 4 | a { 5 | font-weight: bold; 6 | font-size: 12px; 7 | line-height: 2em; 8 | font-family: Arial, sans-serif; 9 | } 10 | --EXPECT-- 11 | array ( 12 | 'a' => 13 | array ( 14 | 'font-weight' => '700', 15 | 'font-size' => '12px', 16 | 'line-height' => '2em', 17 | 'font-family' => 'Arial,sans-serif', 18 | ), 19 | ) 20 | --SETTINGS-- 21 | optimise_shorthands=0 -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/shorthands/font-weight-general.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Test font-weight optimization (full) 3 | --CSS-- 4 | a { 5 | font-weight: bold; 6 | } 7 | b { 8 | font-weight: normal; 9 | } 10 | --EXPECT-- 11 | array ( 12 | 'a' => 13 | array ( 14 | 'font-weight' => '700', 15 | ), 16 | 'b' => 17 | array ( 18 | 'font-weight' => '400', 19 | ), 20 | ) 21 | --SETTINGS-- 22 | compress_font-weight=true -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/shorthands/font-weight-noopt.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Test font-weight optimization (no optimization) 3 | --CSS-- 4 | a { 5 | font-weight: bold; 6 | } 7 | b { 8 | font-weight: normal; 9 | } 10 | --EXPECT-- 11 | array ( 12 | 'a' => 13 | array ( 14 | 'font-weight' => 'bold', 15 | ), 16 | 'b' => 17 | array ( 18 | 'font-weight' => 'normal', 19 | ), 20 | ) 21 | --SETTINGS-- 22 | compress_font-weight=false -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/shorthands/margin-general.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Test margin optimization 3 | --CSS-- 4 | a { 5 | margin-left: 10px; 6 | margin-right: 10px; 7 | margin-top: 10px; 8 | margin-bottom: 10px; 9 | } 10 | b { 11 | margin-left: 6px; 12 | margin-right: 6px; 13 | margin-top: 10px; 14 | margin-bottom: 10px; 15 | } 16 | c { 17 | margin-left: 6px; 18 | margin-right: 6px; 19 | margin-top: 10px; 20 | margin-bottom: 1px; 21 | } 22 | d { 23 | margin-left: 1px; 24 | margin-right: 6px; 25 | margin-top: 10px; 26 | margin-bottom: 3px; 27 | } 28 | --EXPECT-- 29 | array ( 30 | 'a' => 31 | array ( 32 | 'margin' => '10px', 33 | ), 34 | 'b' => 35 | array ( 36 | 'margin' => '10px 6px', 37 | ), 38 | 'c' => 39 | array ( 40 | 'margin' => '10px 6px 1px', 41 | ), 42 | 'd' => 43 | array ( 44 | 'margin' => '10px 6px 3px 1px', 45 | ), 46 | ) 47 | -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/shorthands/margin-noopt.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Test margin optimization 3 | --CSS-- 4 | a { 5 | margin-left: 10px; 6 | margin-right: 10px; 7 | margin-top: 10px; 8 | margin-bottom: 10px; 9 | } 10 | --EXPECT-- 11 | array ( 12 | 'a' => 13 | array ( 14 | 'margin-left' => '10px', 15 | 'margin-right' => '10px', 16 | 'margin-top' => '10px', 17 | 'margin-bottom' => '10px', 18 | ), 19 | ) 20 | --SETTINGS-- 21 | optimise_shorthands=0 -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/shorthands/padding-general.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Test padding optimization 3 | --CSS-- 4 | a { 5 | padding-left: 10px; 6 | padding-right: 10px; 7 | padding-top: 10px; 8 | padding-bottom: 10px; 9 | } 10 | b { 11 | padding-left: 10px; 12 | padding-right: 10px; 13 | padding-top: 2px; 14 | padding-bottom: 2px; 15 | } 16 | c { 17 | padding-left: 10px; 18 | padding-right: 10px; 19 | padding-top: 2px; 20 | padding-bottom: 3px; 21 | } 22 | d { 23 | padding-left: 1px; 24 | padding-right: 10px; 25 | padding-top: 2px; 26 | padding-bottom: 3px; 27 | } 28 | --EXPECT-- 29 | array ( 30 | 'a' => 31 | array ( 32 | 'padding' => '10px', 33 | ), 34 | 'b' => 35 | array ( 36 | 'padding' => '2px 10px', 37 | ), 38 | 'c' => 39 | array ( 40 | 'padding' => '2px 10px 3px', 41 | ), 42 | 'd' => 43 | array ( 44 | 'padding' => '2px 10px 3px 1px', 45 | ), 46 | ) 47 | -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/shorthands/padding-noopt.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Test padding optimization (no optimization) 3 | --CSS-- 4 | a { 5 | padding-left: 10px; 6 | padding-right: 10px; 7 | padding-top: 10px; 8 | padding-bottom: 10px; 9 | } 10 | --EXPECT-- 11 | array ( 12 | 'a' => 13 | array ( 14 | 'padding-left' => '10px', 15 | 'padding-right' => '10px', 16 | 'padding-top' => '10px', 17 | 'padding-bottom' => '10px', 18 | ), 19 | ) 20 | --SETTINGS-- 21 | optimise_shorthands=0 -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/special/cursor.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | @font-face rules 3 | --CSS-- 4 | a { 5 | cursor: pointer; 6 | cursor: hand; 7 | } 8 | --EXPECT-- 9 | array ( 10 | 'a' => 11 | array ( 12 | 'cursor' => 'pointer', 13 | 'cursor_0' => 'hand', 14 | ), 15 | ) -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/special/font-face.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | @font-face rules 3 | --CSS-- 4 | @font-face { 5 | font-family: GillSans; 6 | src:url("/generic/fonts/GillSansLightC.otf") format('opentype'); 7 | font-style: normal; 8 | font-weight: normal; 9 | } 10 | 11 | @font-face { 12 | font-family: GillSans; 13 | src:url("/generic/fonts/GillSansC.otf") format('opentype'); 14 | font-style: normal; 15 | font-weight: bold; 16 | } 17 | --EXPECT-- 18 | array ( 19 | '@font-face_1' => 20 | array ( 21 | 'font-family' => 'GillSans', 22 | 'src' => 'url(/generic/fonts/GillSansLightC.otf) format("opentype")', 23 | 'font-style' => 'normal', 24 | 'font-weight' => '400', 25 | ), 26 | '@font-face_2' => 27 | array ( 28 | 'font-family' => 'GillSans', 29 | 'src' => 'url(/generic/fonts/GillSansC.otf) format("opentype")', 30 | 'font-style' => 'normal', 31 | 'font-weight' => '700', 32 | ), 33 | ) 34 | -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/values/colors.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Test color optimisation 3 | --CSS-- 4 | a { 5 | foo:rgb(0,0,0); 6 | bar:black; 7 | baz:#ffaabb; 8 | qux:#f00; 9 | quux:blanchedalmond; 10 | quuux:rgb(0,0,1); 11 | } 12 | --EXPECT-- 13 | array ( 14 | 'a' => 15 | array ( 16 | 'foo' => '#000', 17 | 'bar' => '#000', 18 | 'baz' => '#fab', 19 | 'qux' => 'red', 20 | 'quux' => '#ffebcd', 21 | 'quuux' => '#000001', 22 | ), 23 | ) 24 | -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/values/font-family.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Tests numeric values: Floating point 3 | --CSS-- 4 | a { font:10px Arial, sans-serif} 5 | b { font:10px "Arial", "Trebuchet MS","sans-serif"} 6 | --EXPECT-- 7 | array ( 8 | 'a' => 9 | array ( 10 | 'font' => '10px Arial,sans-serif', 11 | ), 12 | 'b' => 13 | array ( 14 | 'font' => '10px "Arial","Trebuchet MS","sans-serif"', 15 | ), 16 | ) 17 | --SETTINGS-- 18 | optimise_shorthands=2 -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/values/important.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Tests !important 3 | --CSS-- 4 | a { 5 | color:red !important; 6 | size:2 ! important; 7 | foo:2! important; 8 | bar:2!important; 9 | } 10 | --EXPECT-- 11 | array ( 12 | 'a' => 13 | array ( 14 | 'color' => 'red!important', 15 | 'size' => '2!important', 16 | 'foo' => '2!important', 17 | 'bar' => '2!important', 18 | ), 19 | ) 20 | -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/values/number-float.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Tests numeric values: Floating point 3 | --CSS-- 4 | a { font-size:01.5010em } 5 | --EXPECT-- 6 | array ( 7 | 'a' => 8 | array ( 9 | 'font-size' => '1.501em', 10 | ), 11 | ) 12 | -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/values/number-leadingzero.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Tests numeric values: Leading zeros 3 | --CSS-- 4 | a { font-size:0001em; foo:00.1em; line-height:00.1; bar:-00.1;} 5 | --EXPECT-- 6 | array ( 7 | 'a' => 8 | array ( 9 | 'font-size' => '1em', 10 | 'foo' => '.1em', 11 | 'line-height' => '.1', 12 | 'bar' => '-.1', 13 | ), 14 | ) 15 | -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/values/number-missingunit.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Tests numeric values: Missing unit 3 | --CSS-- 4 | a { 5 | font-size:1.0; 6 | line-height:1.0; 7 | color:123456; 8 | font:1em/1.0 verdana; 9 | } 10 | --EXPECT-- 11 | array ( 12 | 'a' => 13 | array ( 14 | 'font-size' => '1px', 15 | 'line-height' => '1', 16 | 'color' => '#123456', 17 | 'font' => '1em/1 verdana', 18 | ), 19 | ) 20 | --SETTINGS-- 21 | optimise_shorthands=0 -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/values/number-missingzero.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Tests numeric values: Missing zero 3 | --CSS-- 4 | a { font-size:0.1em } 5 | b { font-size:.1em } 6 | --EXPECT-- 7 | array ( 8 | 'a,b' => 9 | array ( 10 | 'font-size' => '.1em', 11 | ), 12 | ) 13 | --SETTINGS-- 14 | merge_selectors=2 -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/values/number-signed.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Tests numeric values: Signed 3 | --CSS-- 4 | a { font-size:-1em } 5 | b { font-size:+1em } 6 | --EXPECT-- 7 | array ( 8 | 'a' => 9 | array ( 10 | 'font-size' => '-1em', 11 | ), 12 | 'b' => 13 | array ( 14 | 'font-size' => '1em', 15 | ), 16 | ) 17 | -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/values/number-trailingzero.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Tests numeric values: Trailing zeros 3 | --CSS-- 4 | a { font-size:1.000em } 5 | --EXPECT-- 6 | array ( 7 | 'a' => 8 | array ( 9 | 'font-size' => '1em', 10 | ), 11 | ) 12 | -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/csst/values/number-zero.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Tests numeric values: Zero 3 | --CSS-- 4 | a { font-size:0px; line-height:00.00 } 5 | --EXPECT-- 6 | array ( 7 | 'a' => 8 | array ( 9 | 'font-size' => '0', 10 | 'line-height' => '0', 11 | ), 12 | ) 13 | -------------------------------------------------------------------------------- /csstidy/testing/unit-tests/test.csst.php: -------------------------------------------------------------------------------- 1 | assert($expectation, $filename, '%s'); 15 | // this is necessary because SimpleTest doesn't support 16 | // HTML messages; this probably should be in the reporter. 17 | // This is *not* compatible with XmlReporter 18 | if (!$result) echo $expectation->render(); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
Tired of having to repeat all vendor prefixes over and over again just for getting your cross-browser dosis of CSS 3 eyecandy? Bother no more, my friend! Paste your single-vendor CSS or point to the file and we will automatically add the rest.
94 | 190 |