mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-11-04 14:18:59 +00:00
More consistent CPCompatibility constant naming.
This commit is contained in:
1 parent
310d49c74c
commit
43f4ecc1b4
4 files changed
+17
-17
No files matched your search
+12
-12
@@ -44,16 +44,16 @@ CPHTMLCanvasFeature = 1 << 6;
|
||||
CPHTMLContentEditableFeature = 1 << 7;
|
||||
CPHTMLDragAndDropFeature = 1 << 8;
|
||||
|
||||
CPJavascriptInnerTextFeature = 1 << 9;
|
||||
CPJavascriptTextContentFeature = 1 << 10;
|
||||
CPJavascriptClipboardEventsFeature = 1 << 11;
|
||||
CPJavascriptClipboardAccessFeature = 1 << 12;
|
||||
CPJavaScriptInnerTextFeature = 1 << 9;
|
||||
CPJavaScriptTextContentFeature = 1 << 10;
|
||||
CPJavaScriptClipboardEventsFeature = 1 << 11;
|
||||
CPJavaScriptClipboardAccessFeature = 1 << 12;
|
||||
CPJavaScriptCanvasDrawFeature = 1 << 13;
|
||||
CPJavaScriptCanvasTransformFeature = 1 << 14;
|
||||
|
||||
CPVMLFeature = 1 << 15;
|
||||
|
||||
CPJavascriptRemedialKeySupport = 1 << 16;
|
||||
CPJavaScriptRemedialKeySupport = 1 << 16;
|
||||
CPJavaScriptShadowFeature = 1 << 20;
|
||||
|
||||
CPJavaScriptNegativeMouseWheelValues = 1 << 22;
|
||||
@@ -93,7 +93,7 @@ else if (typeof window !== "undefined" && window.attachEvent) // Must follow Ope
|
||||
|
||||
// Features we can only be sure of with IE (no known independent tests)
|
||||
PLATFORM_FEATURES |= CPVMLFeature;
|
||||
PLATFORM_FEATURES |= CPJavascriptRemedialKeySupport;
|
||||
PLATFORM_FEATURES |= CPJavaScriptRemedialKeySupport;
|
||||
PLATFORM_FEATURES |= CPJavaScriptShadowFeature;
|
||||
|
||||
PLATFORM_FEATURES |= CPOpacityRequiresFilterFeature;
|
||||
@@ -113,8 +113,8 @@ else if (USER_AGENT.indexOf("AppleWebKit/") != -1)
|
||||
if (USER_AGENT.indexOf("Chrome") === -1)
|
||||
PLATFORM_FEATURES |= CPHTMLDragAndDropFeature;
|
||||
|
||||
PLATFORM_FEATURES |= CPJavascriptClipboardEventsFeature;
|
||||
PLATFORM_FEATURES |= CPJavascriptClipboardAccessFeature;
|
||||
PLATFORM_FEATURES |= CPJavaScriptClipboardEventsFeature;
|
||||
PLATFORM_FEATURES |= CPJavaScriptClipboardAccessFeature;
|
||||
PLATFORM_FEATURES |= CPJavaScriptShadowFeature;
|
||||
|
||||
var versionStart = USER_AGENT.indexOf("AppleWebKit/") + "AppleWebKit/".length,
|
||||
@@ -125,12 +125,12 @@ else if (USER_AGENT.indexOf("AppleWebKit/") != -1)
|
||||
minorVersion = parseInt(versionString.substr(versionDivision + 1));
|
||||
|
||||
if ((USER_AGENT.indexOf("Safari") !== CPNotFound && (majorVersion > 525 || (majorVersion === 525 && minorVersion > 14))) || USER_AGENT.indexOf("Chrome") !== CPNotFound)
|
||||
PLATFORM_FEATURES |= CPJavascriptRemedialKeySupport;
|
||||
PLATFORM_FEATURES |= CPJavaScriptRemedialKeySupport;
|
||||
|
||||
// FIXME this is a terrible hack to get around this bug:
|
||||
// https://bugs.webkit.org/show_bug.cgi?id=21548
|
||||
if (![CPPlatform isBrowser])
|
||||
PLATFORM_FEATURES |= CPJavascriptRemedialKeySupport;
|
||||
PLATFORM_FEATURES |= CPJavaScriptRemedialKeySupport;
|
||||
|
||||
if (majorVersion < 532 || (majorVersion === 532 && minorVersion < 6))
|
||||
PLATFORM_FEATURES |= CPHTML5DragAndDropSourceYOffBy1;
|
||||
@@ -182,9 +182,9 @@ if (typeof document != "undefined")
|
||||
|
||||
// Detect whether we have innerText or textContent (or neither)
|
||||
if (DOMElement.innerText != undefined)
|
||||
PLATFORM_FEATURES |= CPJavascriptInnerTextFeature;
|
||||
PLATFORM_FEATURES |= CPJavaScriptInnerTextFeature;
|
||||
else if (DOMElement.textContent != undefined)
|
||||
PLATFORM_FEATURES |= CPJavascriptTextContentFeature;
|
||||
PLATFORM_FEATURES |= CPJavaScriptTextContentFeature;
|
||||
}
|
||||
|
||||
function CPFeatureIsCompatible(aFeature)
|
||||
|
||||
@@ -174,9 +174,9 @@ var DOMFixedWidthSpanElement = nil,
|
||||
|
||||
span.style.font = [aFont cssString];
|
||||
|
||||
if (CPFeatureIsCompatible(CPJavascriptInnerTextFeature))
|
||||
if (CPFeatureIsCompatible(CPJavaScriptInnerTextFeature))
|
||||
span.innerText = aString;
|
||||
else if (CPFeatureIsCompatible(CPJavascriptTextContentFeature))
|
||||
else if (CPFeatureIsCompatible(CPJavaScriptTextContentFeature))
|
||||
span.textContent = aString;
|
||||
|
||||
return _CGSizeMake(span.clientWidth, span.clientHeight);
|
||||
|
||||
@@ -158,7 +158,7 @@ CPKeyCodes = {
|
||||
*/
|
||||
CPKeyCodes.firesKeyPressEvent = function(keyCode, opt_heldKeyCode, opt_shiftKey, opt_ctrlKey, opt_altKey)
|
||||
{
|
||||
if (!CPFeatureIsCompatible(CPJavascriptRemedialKeySupport))
|
||||
if (!CPFeatureIsCompatible(CPJavaScriptRemedialKeySupport))
|
||||
return true;
|
||||
|
||||
if (CPBrowserIsOperatingSystem(CPMacOperatingSystem) && opt_altKey)
|
||||
|
||||
@@ -445,14 +445,14 @@ var _CPimageAndTextViewFrameSizeChangedFlag = 1 << 0,
|
||||
{
|
||||
// Update the text contents if necessary.
|
||||
if (_flags & _CPImageAndTextViewTextChangedFlag)
|
||||
if (CPFeatureIsCompatible(CPJavascriptInnerTextFeature))
|
||||
if (CPFeatureIsCompatible(CPJavaScriptInnerTextFeature))
|
||||
{
|
||||
_DOMTextElement.innerText = _text;
|
||||
|
||||
if (_DOMTextShadowElement)
|
||||
_DOMTextShadowElement.innerText = _text;
|
||||
}
|
||||
else if (CPFeatureIsCompatible(CPJavascriptTextContentFeature))
|
||||
else if (CPFeatureIsCompatible(CPJavaScriptTextContentFeature))
|
||||
{
|
||||
_DOMTextElement.textContent = _text;
|
||||
|
||||
|
||||
Reference in new issue
Block a user