After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 796130 - css.lang: Various improvements
css.lang: Various improvements
Status: RESOLVED FIXED
Product: gtksourceview
Classification: Platform
Component: Syntax files
git master
Other Linux
: Normal normal
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
Depends on:
Blocks:
 
 
Reported: 2018-05-15 10:12 UTC by Jeffery To
Modified: 2018-05-18 09:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[PATCH 01/21] css.lang: @font-face improvements (1.62 KB, patch)
2018-05-15 10:13 UTC, Jeffery To
committed Details | Review
[PATCH 02/21] css.lang: Add animatable properties (5.23 KB, patch)
2018-05-15 10:14 UTC, Jeffery To
committed Details | Review
[PATCH 03/21] css.lang: Support Unicode and character escapes for IDs and classes (5.22 KB, patch)
2018-05-15 10:15 UTC, Jeffery To
committed Details | Review
[PATCH 04/21] css.lang: Add support for @keyframes call / block (5.12 KB, patch)
2018-05-15 10:15 UTC, Jeffery To
committed Details | Review
[PATCH 05/21] css.lang: Add highlighting for vendor prefixed values (9.27 KB, patch)
2018-05-15 10:16 UTC, Jeffery To
committed Details | Review
[PATCH 06/21] css.lang: Move media queries and @media call into separate contexts (5.31 KB, patch)
2018-05-15 10:16 UTC, Jeffery To
committed Details | Review
[PATCH 07/21] css.lang: Reorganize structure of lang file (13.98 KB, patch)
2018-05-15 10:17 UTC, Jeffery To
committed Details | Review
[PATCH 08/21] css.lang: Add container contexts to help lang file organization (11.82 KB, patch)
2018-05-15 10:18 UTC, Jeffery To
committed Details | Review
[PATCH 09/21] css.lang: Limit attribute operator highlighting (2.31 KB, patch)
2018-05-15 10:18 UTC, Jeffery To
committed Details | Review
[PATCH 10/21] css.lang: Add highlighting for @supports (2.92 KB, patch)
2018-05-15 10:19 UTC, Jeffery To
committed Details | Review
[PATCH 11/21] css.lang: Add highlighting for @charset, @import, and @namespace calls (6.82 KB, patch)
2018-05-15 10:20 UTC, Jeffery To
committed Details | Review
[PATCH 12/21] css.lang: Update media features and feature values (3.12 KB, patch)
2018-05-15 10:20 UTC, Jeffery To
committed Details | Review
[PATCH 13/21] css.lang: Sort and update pseudo-elements and pseudo-classes (3.02 KB, patch)
2018-05-15 10:21 UTC, Jeffery To
committed Details | Review
[PATCH 14/21] css.lang: Add highlighting for :lang() and :not() arguments (3.52 KB, patch)
2018-05-15 10:21 UTC, Jeffery To
committed Details | Review
[PATCH 15/21] css.lang: Make dimension and resolution contexts easier to read (2.07 KB, patch)
2018-05-15 10:22 UTC, Jeffery To
committed Details | Review
[PATCH 16/21] css.lang: Add missing font-variant-east-asian values (1.96 KB, patch)
2018-05-15 10:22 UTC, Jeffery To
committed Details | Review
[PATCH 17/21] css.lang: Add more number regexs (4.09 KB, patch)
2018-05-15 10:23 UTC, Jeffery To
committed Details | Review
[PATCH 18/21] css.lang: Add highlighting for @font-feature-values block (4.48 KB, patch)
2018-05-15 10:24 UTC, Jeffery To
committed Details | Review
[PATCH 19/21] css.lang: Add more support for CSS Paged Media Module Level 3 (4.86 KB, patch)
2018-05-15 10:24 UTC, Jeffery To
committed Details | Review
[PATCH 20/21] css.lang: Rename selector style/context IDs (8.84 KB, patch)
2018-05-15 10:25 UTC, Jeffery To
committed Details | Review
[PATCH 21/21] css.lang: Update styles to better reflect contexts (22.67 KB, patch)
2018-05-15 10:25 UTC, Jeffery To
committed Details | Review

Description Jeffery To 2018-05-15 10:12:33 UTC
These changes add highlighting for more CSS statements, and improve consistency and extensibility of the CSS lang file.

(Apologies for the number of patches, I went a little overboard :-P )
Comment 1 Jeffery To 2018-05-15 10:13:35 UTC
Created attachment 372048 [details] [review]
[PATCH 01/21] css.lang: @font-face improvements

* Add src property name
* Add support for unicode wildcard ranges (e.g. U+4??)
Comment 2 Jeffery To 2018-05-15 10:14:17 UTC
Created attachment 372049 [details] [review]
[PATCH 02/21] css.lang: Add animatable properties

This adds an animatable-properties context, matching property names that
can be animated (i.e. appear as property values for animation or
transition properties). Based on the list from MDN[1].

[1] https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_animated_properties
Comment 3 Jeffery To 2018-05-15 10:15:05 UTC
Created attachment 372050 [details] [review]
[PATCH 03/21] css.lang: Support Unicode and character escapes for IDs and classes

This adds an identifier regex that closely follows the rules for CSS
identifiers, and uses this regex wherever CSS identifiers are used
(ID/class/tag selectors, function names), so that Unicode characters and
character escapes are correctly highlighted.

This also removes the unicode-character-reference context, as Unicode
character escapes do not appear anywhere else (except for inside
strings, but then they are highlighted as part of the string).
Comment 4 Jeffery To 2018-05-15 10:15:39 UTC
Created attachment 372051 [details] [review]
[PATCH 04/21] css.lang: Add support for @keyframes call / block

This adds support for the @keyframes call (allowing strings for the
keyframes name) and block (using percentages and "from"/"to" as
selectors). This also adds a percetage context, split from dimension to
support the keyframe selector.
Comment 5 Jeffery To 2018-05-15 10:16:16 UTC
Created attachment 372052 [details] [review]
[PATCH 05/21] css.lang: Add highlighting for vendor prefixed values

This adds highlightening for vendor-specific pseudo-elements,
pseudo-classes, at-rules, property names, property values, and
functions.

Fixes bug 761053.
Comment 6 Jeffery To 2018-05-15 10:16:53 UTC
Created attachment 372053 [details] [review]
[PATCH 06/21] css.lang: Move media queries and @media call into separate contexts

This moves the media query and at-media-call contexts into top-level
contexts.
Comment 7 Jeffery To 2018-05-15 10:17:27 UTC
Created attachment 372054 [details] [review]
[PATCH 07/21] css.lang: Reorganize structure of lang file

This groups related contexts together (selectors, at-rules, etc) and
reorders the contexts into a more logical order.
Comment 8 Jeffery To 2018-05-15 10:18:23 UTC
Created attachment 372055 [details] [review]
[PATCH 08/21] css.lang: Add container contexts to help lang file organization

This adds:

* all-* contexts to make referencing all contexts of a particular group
(e.g. basic data types) easier
* declaration context to make matching style declarations reusable
* comment and string convenience contexts
* comma, colon and semicolon contexts to replace punctuators (and
actually match these symbols and block delimiters in all contexts)
Comment 9 Jeffery To 2018-05-15 10:18:56 UTC
Created attachment 372056 [details] [review]
[PATCH 09/21] css.lang: Limit attribute operator highlighting

This adds an attribute selector container context, replacing the
delimiters context, to limit highlighting of attribute selector
operators (and strings) to inside the attribute selector.
Comment 10 Jeffery To 2018-05-15 10:19:30 UTC
Created attachment 372057 [details] [review]
[PATCH 10/21] css.lang: Add highlighting for @supports

This adds an at-supports-call context to highlight the @supports
at-rule.
Comment 11 Jeffery To 2018-05-15 10:20:04 UTC
Created attachment 372058 [details] [review]
[PATCH 11/21] css.lang: Add highlighting for @charset, @import, and  @namespace calls

This adds contexts for @charset, @import, and @namespace calls, to
highlight the valid data types for each call, and an error context for
invalid @charset calls, since it has stricter syntactic requirements.
Comment 12 Jeffery To 2018-05-15 10:20:41 UTC
Created attachment 372059 [details] [review]
[PATCH 12/21] css.lang: Update media features and feature values

This adds new media features and feature values, and removes deprecated
media features, from Media Queries Level 4.
Comment 13 Jeffery To 2018-05-15 10:21:15 UTC
Created attachment 372060 [details] [review]
[PATCH 13/21] css.lang: Sort and update pseudo-elements and pseudo-classes

This sorts the lists of pseudo-elements and pseudo-classes
alphabetically, and adds pseudo-classes from CSS Basic User Interface
Module Level 3 / HTML5.
Comment 14 Jeffery To 2018-05-15 10:21:53 UTC
Created attachment 372061 [details] [review]
[PATCH 14/21] css.lang: Add highlighting for :lang() and :not() arguments

This adds contexts to highlight the parentheses and arguments of :lang()
and :not().
Comment 15 Jeffery To 2018-05-15 10:22:27 UTC
Created attachment 372062 [details] [review]
[PATCH 15/21] css.lang: Make dimension and resolution contexts easier to read

This turns the dimension and resolution simple contexts into keyword
contexts, making the units easier to read and to update.
Comment 16 Jeffery To 2018-05-15 10:22:56 UTC
Created attachment 372063 [details] [review]
[PATCH 16/21] css.lang: Add missing font-variant-east-asian values

This adds JIS variant values (jis78, jis83, jis90, jis04) for the
font-variant-east-asian property.
Comment 17 Jeffery To 2018-05-15 10:23:28 UTC
Created attachment 372064 [details] [review]
[PATCH 17/21] css.lang: Add more number regexs

This adds more number- and integer-related regexs, to enable more code
reuse and clarify usage in contexts.
Comment 18 Jeffery To 2018-05-15 10:24:05 UTC
Created attachment 372065 [details] [review]
[PATCH 18/21] css.lang: Add highlighting for @font-feature-values block

This adds contexts to highlight @font-feature-values blocks. This also
adds a positive-integer context, used inside feature value blocks.
Comment 19 Jeffery To 2018-05-15 10:24:34 UTC
Created attachment 372066 [details] [review]
[PATCH 19/21] css.lang: Add more support for CSS Paged Media Module Level 3

This adds the at-page-call context to highlight @page blocks, and
property names/values from Paged Media Module Level 3.
Comment 20 Jeffery To 2018-05-15 10:25:03 UTC
Created attachment 372067 [details] [review]
[PATCH 20/21] css.lang: Rename selector style/context IDs

This renames the IDs of selector styles and contexts to follow the
naming conventions used for all other styles/contexts. This also splits
the selector-grammar context, to label the symbols using their actual
(CSS spec) names.
Comment 21 Jeffery To 2018-05-15 10:25:37 UTC
Created attachment 372068 [details] [review]
[PATCH 21/21] css.lang: Update styles to better reflect contexts

This updates the styles / style IDs to align with their matching
contexts / CSS syntax components.
Comment 22 Sébastien Wilmet 2018-05-18 09:26:24 UTC
Thanks!
Comment 23 Sébastien Wilmet 2018-05-18 09:36:13 UTC
Pushed, see commit 975114b3d5566a6dcc4152d14eb0e69c9c453b5d and the previous ones.