Last active
August 29, 2015 14:21
-
-
Save DigiTec/6a3c74b26da78cc5cef9 to your computer and use it in GitHub Desktop.
This is a quick gist for examining the list of EdgeHTML supported webkit properties that can be run on any device. This helps to narrow down why certain properties were added since not all WebKit browsers support all of the properties. This list tends to be a union of Chrome 42+ and iOS 8 Safari.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="log" style="whitespace: pre"></div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://jsfiddle.net/cf3mww5n/1/ | |
function GlobalConstructorCheck(prop) { | |
// TODO: Additional validation | |
return prop in window; | |
} | |
function WindowCheck(prop) { | |
return prop in window; | |
} | |
function ElementCheck(prop) { | |
var elem = document.body; | |
return prop in elem; | |
} | |
function ComputedStyleCheck(prop) { | |
var cs = window.getComputedStyle(document.body); | |
return prop in cs; | |
} | |
function FullScreenChecks(prop) { | |
var media = document.createElement("video"); | |
return (prop in media || prop in document || prop in document.body); | |
} | |
var WebKitPropertyExistenceChecks = [ | |
{ prop: "WebKitPoint", test: GlobalConstructorCheck }, | |
{ prop: "WebKitCSSMatrix", test: GlobalConstructorCheck }, | |
{ prop: "webkitConvertPointFromNodeToPage", test: WindowCheck }, | |
{ prop: "webkitConvertPointFromPageToNode", test: WindowCheck }, | |
{ prop: "webkitMatchesSelector", test: ElementCheck }, | |
{ prop: "webkitAnimation", test: ComputedStyleCheck }, | |
{ prop: "webkitAnimationDelay", test: ComputedStyleCheck }, | |
{ prop: "webkitAnimationDirection", test: ComputedStyleCheck }, | |
{ prop: "webkitAnimationDuration", test: ComputedStyleCheck }, | |
{ prop: "webkitAnimationFillMode", test: ComputedStyleCheck }, | |
{ prop: "webkitAnimationIterationCount", test: ComputedStyleCheck }, | |
{ prop: "webkitAnimationName", test: ComputedStyleCheck }, | |
{ prop: "webkitAnimationPlayState", test: ComputedStyleCheck }, | |
{ prop: "webkitAnimationTimingFunction", test: ComputedStyleCheck }, | |
{ prop: "webkitBackground", test: ComputedStyleCheck }, | |
{ prop: "webkitBackgroundAttachment", test: ComputedStyleCheck }, | |
{ prop: "webkitBackgroundClip", test: ComputedStyleCheck }, | |
{ prop: "webkitBackgroundColor", test: ComputedStyleCheck }, | |
{ prop: "webkitBackgroundImage", test: ComputedStyleCheck }, | |
{ prop: "webkitBackgroundOrigin", test: ComputedStyleCheck }, | |
{ prop: "webkitBackgroundPosition", test: ComputedStyleCheck }, | |
{ prop: "webkitBackgroundPositionX", test: ComputedStyleCheck }, | |
{ prop: "webkitBackgroundPositionY", test: ComputedStyleCheck }, | |
{ prop: "webkitBackgroundRepeat", test: ComputedStyleCheck }, | |
{ prop: "webkitBackgroundSize", test: ComputedStyleCheck }, | |
{ prop: "webkitBorderBottomLeftRadius", test: ComputedStyleCheck }, | |
{ prop: "webkitBorderBottomRightRadius", test: ComputedStyleCheck }, | |
{ prop: "webkitBorderImage", test: ComputedStyleCheck }, | |
{ prop: "webkitBorderImageOutset", test: ComputedStyleCheck }, | |
{ prop: "webkitBorderImageRepeat", test: ComputedStyleCheck }, | |
{ prop: "webkitBorderImageSlice", test: ComputedStyleCheck }, | |
{ prop: "webkitBorderImageSource", test: ComputedStyleCheck }, | |
{ prop: "webkitBorderImageWidth", test: ComputedStyleCheck }, | |
{ prop: "webkitBorderRadius", test: ComputedStyleCheck }, | |
{ prop: "webkitBorderTopLeftRadius", test: ComputedStyleCheck }, | |
{ prop: "webkitBorderTopRightRadius", test: ComputedStyleCheck }, | |
{ prop: "webkitBoxSizing", test: ComputedStyleCheck }, | |
{ prop: "webkitFilter", test: ComputedStyleCheck }, | |
{ prop: "webkitAlignContent", test: ComputedStyleCheck }, | |
{ prop: "webkitAlignItems", test: ComputedStyleCheck }, | |
{ prop: "webkitAlignSelf", test: ComputedStyleCheck }, | |
{ prop: "webkitBoxAlign", test: ComputedStyleCheck }, | |
{ prop: "webkitBoxDirection", test: ComputedStyleCheck }, | |
{ prop: "webkitBoxFlex", test: ComputedStyleCheck }, | |
{ prop: "webkitBoxOrdinalGroup", test: ComputedStyleCheck }, | |
{ prop: "webkitBoxOrient", test: ComputedStyleCheck }, | |
{ prop: "webkitBoxPack", test: ComputedStyleCheck }, | |
{ prop: "webkitFlex", test: ComputedStyleCheck }, | |
{ prop: "webkitFlexBasis", test: ComputedStyleCheck }, | |
{ prop: "webkitFlexDirection", test: ComputedStyleCheck }, | |
{ prop: "webkitFlexFlow", test: ComputedStyleCheck }, | |
{ prop: "webkitFlexGrow", test: ComputedStyleCheck }, | |
{ prop: "webkitFlexShrink", test: ComputedStyleCheck }, | |
{ prop: "webkitFlexWrap", test: ComputedStyleCheck }, | |
{ prop: "webkitJustifyContent", test: ComputedStyleCheck }, | |
{ prop: "webkitOrder", test: ComputedStyleCheck }, | |
{ prop: "webkitAppearance", test: ComputedStyleCheck }, | |
{ prop: "webkitColumnBreakAfter", test: ComputedStyleCheck }, | |
{ prop: "webkitColumnBreakBefore", test: ComputedStyleCheck }, | |
{ prop: "webkitColumnBreakInside", test: ComputedStyleCheck }, | |
{ prop: "webkitColumnCount", test: ComputedStyleCheck }, | |
{ prop: "webkitColumnGap", test: ComputedStyleCheck }, | |
{ prop: "webkitColumnRule", test: ComputedStyleCheck }, | |
{ prop: "webkitColumnRuleColor", test: ComputedStyleCheck }, | |
{ prop: "webkitColumnRuleStyle", test: ComputedStyleCheck }, | |
{ prop: "webkitColumnRuleWidth", test: ComputedStyleCheck }, | |
{ prop: "webkitColumnSpan", test: ComputedStyleCheck }, | |
{ prop: "webkitColumnWidth", test: ComputedStyleCheck }, | |
{ prop: "webkitColumns", test: ComputedStyleCheck }, | |
{ prop: "webkitTextFillColor", test: ComputedStyleCheck }, | |
{ prop: "webkitBackfaceVisibility", test: ComputedStyleCheck }, | |
{ prop: "webkitPerspective", test: ComputedStyleCheck }, | |
{ prop: "webkitPerspectiveOrigin", test: ComputedStyleCheck }, | |
{ prop: "webkitTransform", test: ComputedStyleCheck }, | |
{ prop: "webkitTransformOrigin", test: ComputedStyleCheck }, | |
{ prop: "webkitTransformStyle", test: ComputedStyleCheck }, | |
{ prop: "webkitTransition", test: ComputedStyleCheck }, | |
{ prop: "webkitTransitionDelay", test: ComputedStyleCheck }, | |
{ prop: "webkitTransitionDuration", test: ComputedStyleCheck }, | |
{ prop: "webkitTransitionProperty", test: ComputedStyleCheck }, | |
{ prop: "webkitTransitionTimingFunction", test: ComputedStyleCheck }, | |
{ prop: "webkitWritingMode", test: ComputedStyleCheck }, | |
{ prop: "webkitTapHighlightColor", test: ComputedStyleCheck }, | |
{ prop: "webkitTextSizeAdjust", test: ComputedStyleCheck }, | |
{ prop: "webkitUserSelect", test: ComputedStyleCheck }, | |
{ prop: "onwebkitfullscreenchange", test: FullScreenChecks }, | |
{ prop: "onwebkitfullscreenerror", test: FullScreenChecks }, | |
{ prop: "webkitCancelFullScreen", test: FullScreenChecks }, | |
{ prop: "webkitCurrentFullScreenElement", test: FullScreenChecks }, | |
{ prop: "webkitDisplayingFullscreen", test: FullScreenChecks }, | |
{ prop: "webkitEnterFullScreen", test: FullScreenChecks }, | |
{ prop: "webkitEnterFullscreen", test: FullScreenChecks }, | |
{ prop: "webkitExitFullScreen", test: FullScreenChecks }, | |
{ prop: "webkitExitFullscreen", test: FullScreenChecks }, | |
{ prop: "webkitFullscreenElement", test: FullScreenChecks }, | |
{ prop: "webkitFullscreenEnabled", test: FullScreenChecks }, | |
{ prop: "webkitIsFullScreen", test: FullScreenChecks }, | |
{ prop: "webkitRequestFullScreen", test: FullScreenChecks }, | |
{ prop: "webkitRequestFullscreen", test: FullScreenChecks }, | |
{ prop: "webkitSupportsFullscreen", test: FullScreenChecks } | |
]; | |
var logger = document.getElementById("log"); | |
WebKitPropertyExistenceChecks.forEach(function (propCheck) { | |
var exists = propCheck.test(propCheck.prop); | |
var logLine = document.createElement("div"); | |
if (exists) { | |
var bold = document.createElement("b"); | |
bold.appendChild(document.createTextNode(propCheck.prop)); | |
logLine.appendChild(bold); | |
} | |
else { | |
logLine.appendChild(document.createTextNode(propCheck.prop)); | |
} | |
logger.appendChild(logLine); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment