Skip to content

Parsing of filter rules specific to Microsoft #111

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 20, 2016

Conversation

FMCorz
Copy link

@FMCorz FMCorz commented Jul 18, 2016

This allows for filters typically used for gradients to be parsed. The following was taken from Bootstrap 4.

filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);

I am not sold on the Value I've introduced here, especially as a child of PrimitiveValue. Please let me know how to adapt my patch should this change interest you.

Cheers!

@sabberworm
Copy link
Collaborator

sabberworm commented Jul 19, 2016

I’m a bit biased against this as it really isn’t valid CSS and the more modern syntax (with -ms-filter is available to IEs dating back to IE 8).

I’m not sure there is much use for the old-old syntax anymore. But maybe we can accept and silently discard it in lenient mode (on second thought, I think this may already be what we are doing but I’m not sure)?

Or, add a new config that adds support for this. But then, please make it opt-in and make the class that represents the result a subclass of CSSFunction.

Frederic Massart added 2 commits July 20, 2016 11:00
Tested on down to IE8 and confirmed that string arguments can be
wrapped in single quotes, double quotes, or nothing.
@FMCorz FMCorz force-pushed the ms-filter-parsing branch from 3133adf to ed580dc Compare July 20, 2016 03:53
@FMCorz
Copy link
Author

FMCorz commented Jul 20, 2016

Now that you mention it, I discovered that IE9 does not even support this format. Strangely it is still found in Bootstrap 4 (as of today) as you can see here. I did change to only allow the old-style filters in lenient mode though, and tested that string quoting had no impact on IE8 using this:

<html>
    <head>
        <style>
            div {
                height: 100px;;
                width: 100%;
                margin-bottom: 10px;
            }
            .a {
                filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FF000000', endColorstr='#00000000', GradientType=1);
            }
            .b {
                filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#FF000000", endColorstr="#00000000", GradientType=1);
            }
            .c {
                filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#FF000000, endColorstr=#00000000, GradientType=1);
            }
        </style>
    </head>
    <body>
        <div class="a">Here</div>
        <div class="b">There</div>
        <div class="c">Over there</div>
    </body>
</html>

Thanks for suggesting to use a CSSFunction, I did not realise I could.

Cheers.
Fred

@sabberworm
Copy link
Collaborator

Great, thanks a lot!

@sabberworm sabberworm merged commit 50a802f into MyIntervals:master Jul 20, 2016
@sabberworm
Copy link
Collaborator

Released with 8.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants