-
Notifications
You must be signed in to change notification settings - Fork 47.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1662 from gaearon/warn-when-using-hyphenated-styl…
…e-names Warn when using hyphenated style property names Closes #1662 Conflicts: src/browser/ui/dom/CSSPropertyOperations.js
- Loading branch information
Showing
5 changed files
with
110 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/** | ||
* Copyright 2014 Facebook, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* @providesModule camelizeStyleName | ||
* @typechecks | ||
*/ | ||
|
||
"use strict"; | ||
|
||
var camelize = require('camelize'); | ||
|
||
var msPattern = /^-ms-/; | ||
|
||
/** | ||
* Camelcases a hyphenated CSS property name, for example: | ||
* | ||
* > camelizeStyleName('background-color') | ||
* < "backgroundColor" | ||
* > camelizeStyleName('-moz-transition') | ||
* < "MozTransition" | ||
* > camelizeStyleName('-ms-transition') | ||
* < "msTransition" | ||
* | ||
* As Andi Smith suggests | ||
* (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix | ||
* is converted to lowercase `ms`. | ||
* | ||
* @param {string} string | ||
* @return {string} | ||
*/ | ||
function camelizeStyleName(string) { | ||
return camelize(string.replace(msPattern, 'ms-')); | ||
} | ||
|
||
module.exports = camelizeStyleName; |
This file contains 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