-
Notifications
You must be signed in to change notification settings - Fork 151
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
behavior
vs content
- why the distinction?
#20
Comments
Hey Rodney. I replied to your private email about this issue, but I'll put the answer here as well: There is a small reason why you may not want to do this: IE9-10 does not support vmin/vmax, while the other browsers do. Removing the behavior hack may be a performance hit becuase of this, since you would have to use the content hack to use vmin/vmax units in IE9-10. This would work, but iOS would calculate vmin/vmax twice (once for vmin/vmax inside of regular CSS rules, and again inside the content hack CSS) unless we did some code to work optimize this (which is doable -- if the rule inside the content hack is a vmin/vmax rule, then don't implement it unless it is in a calc() expression). If the above use-case is covered, I see no reason why not to use just content hacks and drop behavior. I originally implemented behavior hacks behavior hacks because I originally thought I would only have to use such hacks in IE9. But then after I did this, I thought it would be cool to implement viewport units in calc formulas, and the only way to do this in iOS, that I could see was using the content hack. In retrospect, I should have just changed all the behavior hacks to content hacks and be done with it. So -- you think it best to rip out the behavior hack and support just content ones? Z |
One last question: if Android's stock browser doesn't support viewport units at all, maybe we set the hacks up this way:
Note that Android Browser <= 4.3 doesn't support calc at all. Just a thought: If you do support browsers that don't do viewport units natively, wouldn't this now be a polyfill instead of a buggyfill? I guess it only allows this with hacks turned on. One last thing: If we get rid of behavior hacks, then may we can change the syntax of content hacks from this: content: 'use_css_content_hack: true; font-size: 80vmax'; to this: content: 'hack: true; font-size: 80vmax'; since it would make the hacks shorter. Z. |
Honestly, I don't think it's a very high penalty having a capable browser calculate I would treat .selector {
width: calc(100vw - 123px);
height: 80vmin;
content: 'viewport-units-buggyfill: width: calc(100vw - 123px); height: 80vmin;';
} In the end the I agree with "buggyfill" becoming a "polyfill". I'd keep the name though. Also I'd go back on having the hack(s) separated out into its own file - it kinda doesn't make sense anymore. I'd integrate them into a single file again… I favor |
I agree with everything. One thing: would it be okay if we have a different delimiter for viewport-units-buggyfill than the colon? It seems like it should have a CSS value. Maybe: content: 'viewport-units-buggyfill - width: calc(100vw - 123px); height: 80vmin;'; Just a small aesthetic thing in the code to make it more readable. So ... did you want to do it, or shall I? Z. |
I'd go for the semi-colon: If you want to try, go ahead! |
Hey ... got some of the work done. I'll fork the project again and send a pull request to you this weekend/early next week (I should finish it by then). |
Hey @zoltan-dulac, I'm terribly sorry merging your PR took this long. :( |
Hey Rodney. When it rains, it pours. I am in the middle of something at the moment Sorry On Tue, Nov 25, 2014 at 3:17 PM, Rodney Rehm [email protected]
Zoltan Hawryluk. Client-side web technology specialist. e: [email protected] t: @zoltandulac |
… judging by the time it took me to get to your PR in the first place, I'd live with "some time next year"! (No hurry, get your stuff done first :) |
Hey @zoltan-dulac are things looking up? |
Hey dude. I was just about to call you ... I'll take a look tonight. Sorry for the Cheers, On Tue, Dec 16, 2014 at 3:40 AM, Rodney Rehm [email protected]
Zoltan Hawryluk. Client-side web technology specialist. e: [email protected] t: @zoltandulac |
Checked it out and it was all good. I did find a bug in IE11 (apparently On Tue, Dec 16, 2014 at 9:21 AM, Zoltan Hawryluk [email protected]
Zoltan Hawryluk. Client-side web technology specialist. e: [email protected] t: @zoltandulac |
\o/ I'll take an older Android device home over Christmas to check if my initial goal (making viewport units available on systems that don't support it at all) also works |
I can check as well today (my employer has several). Pretty sure it's still Let me know if you find anything or not. Want to help if I can.
|
I'm currently fiddling with the buggyfill on Android Stock Browser 4.3 (which does not support viewport units at all). By overwriting the required callback to always return true, I could use the content hack to use viewport units on any property. (If viewport units are not supported,
supportsVminmaxCalc
isfalse
, too).This left me wondering what the distinction
content
andbehavior
was supposed to achieve in the first place. Should we not simply dumb it down to a single property (i.e.content
)? Should we then replaceuse_content_hack: true;
with a simple prefix (e.g.viewport-units-buggyfill:
)?Evaluating this property would be triggered by missing support for viewport-units in general, missing support of
vmin
andvmax
and missing viewport-unit support incalc
.cc @zoltan-dulac
The text was updated successfully, but these errors were encountered: