From 43f4ecc1b4390af95a6d895a65e025b8df32ac15 Mon Sep 17 00:00:00 2001 From: Alexander Ljungberg Date: Wed, 23 Mar 2011 23:54:56 -0400 Subject: [PATCH] More consistent CPCompatibility constant naming. --- AppKit/CPCompatibility.j | 24 +++++++++---------- AppKit/Platform/DOM/CPPlatformString.j | 4 ++-- .../Platform/DOM/CPPlatformWindow+DOMKeys.j | 2 +- AppKit/_CPImageAndTextView.j | 4 ++-- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/AppKit/CPCompatibility.j b/AppKit/CPCompatibility.j index 6050c0870..1b05ed895 100644 --- a/AppKit/CPCompatibility.j +++ b/AppKit/CPCompatibility.j @@ -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) diff --git a/AppKit/Platform/DOM/CPPlatformString.j b/AppKit/Platform/DOM/CPPlatformString.j index 2f231abf4..b7b385904 100644 --- a/AppKit/Platform/DOM/CPPlatformString.j +++ b/AppKit/Platform/DOM/CPPlatformString.j @@ -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); diff --git a/AppKit/Platform/DOM/CPPlatformWindow+DOMKeys.j b/AppKit/Platform/DOM/CPPlatformWindow+DOMKeys.j index dc9909bde..aff678fc5 100644 --- a/AppKit/Platform/DOM/CPPlatformWindow+DOMKeys.j +++ b/AppKit/Platform/DOM/CPPlatformWindow+DOMKeys.j @@ -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) diff --git a/AppKit/_CPImageAndTextView.j b/AppKit/_CPImageAndTextView.j index a7799f89b..59e864955 100644 --- a/AppKit/_CPImageAndTextView.j +++ b/AppKit/_CPImageAndTextView.j @@ -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;