Skip to content

Commit

Permalink
Merge pull request #40 from trueadm/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
KFlash committed Dec 27, 2015
2 parents 36b5e01 + 6e2d7e7 commit f7f394c
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "inferno",
"description": "A framework for building lightning fast user interfaces",
"version": "0.4.1",
"version": "0.4.2",
"license": "MPL-2.0",
"author": {
"name": "Dominic Gannaway",
Expand Down
31 changes: 17 additions & 14 deletions src/DOM/DOMRegistry.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ const xlink = 'http://www.w3.org/1999/xlink';
const xml = 'http://www.w3.org/XML/1998/namespace';

const DOMAttributeNamespaces = {
'xlink:actuate': xlink,
// None-JSX compat
'xlink:actuate': xlink,
'xlink:arcrole': xlink,
'xlink:href': xlink,
'xlink:role': xlink,
Expand All @@ -17,7 +18,7 @@ const DOMAttributeNamespaces = {
'xml:base': xml,
'xml:lang': xml,
'xml:space': xml,
// React compat for non-working JSX namespace support
// JSX compat
xlinkActuate: xlink,
xlinkArcrole: xlink,
xlinkHref: xlink,
Expand All @@ -28,11 +29,13 @@ const DOMAttributeNamespaces = {
};

const DOMAttributeNames = {
acceptCharset: 'accept-charset',

acceptCharset: 'accept-charset',
className: 'class',
htmlFor: 'for',
httpEquiv: 'http-equiv',
// SVG

// SVG
clipPath: 'clip-path',
fillOpacity: 'fill-opacity',
fontFamily: 'font-family',
Expand All @@ -47,19 +50,20 @@ const DOMAttributeNames = {
strokeOpacity: 'stroke-opacity',
strokeWidth: 'stroke-width',
textAnchor: 'text-anchor',
// React compat for non-working JSX namespace support
viewBox: 'viewBox', // Edge case. The letter 'b' need to be uppercase

// JSX compat
xlinkActuate: 'xlink:actuate',
xlinkArcrole: 'xlink:arcrole',
xlinkHref: 'xlink:href',
xlinkRole: 'xlink:role',
xlinkShow: 'xlink:show',
xlinkTitle: 'xlink:title',
xlinkType: 'xlink:type',
// others...
xmlBase: 'xml:base',
xmlLang: 'xml:lang',
xmlSpace: 'xml:space',
viewBox: 'viewBox' // SVG - Edge case. The letter 'b' need to be uppercase
xmlSpace: 'xml:space'

};

const DOMPropertyNames = {
Expand All @@ -69,7 +73,6 @@ const DOMPropertyNames = {
autoSave: 'autosave',
hrefLang: 'hreflang',
radioGroup: 'radiogroup',
spellCheck: 'spellcheck',
srcDoc: 'srcdoc',
srcSet: 'srcset'
};
Expand Down Expand Up @@ -290,7 +293,9 @@ const Whitelist = {
cellSpacing: null,
charSet: null,
allowTransparency: null,
spellcheck: null // 3.2.5 - Global attributes
spellcheck: null, // 3.2.5 - Global attributes
srcDoc: PROPERTY,
srcSet: null
};

const HTMLPropsContainer = {};
Expand All @@ -300,9 +305,8 @@ function checkBitmask( value, bitmask ) {
}

for ( const propName in Whitelist ) {
if ( Whitelist.hasOwnProperty( propName ) ) {

const propConfig = Whitelist[propName];
const propConfig = Whitelist[propName];

HTMLPropsContainer[propName] = {
attributeName: DOMAttributeNames[propName] || propName.toLowerCase(),
Expand All @@ -313,8 +317,7 @@ for ( const propName in Whitelist ) {
hasBooleanValue: checkBitmask( propConfig, BOOLEAN ),
hasNumericValue: checkBitmask( propConfig, NUMERIC_VALUE ),
hasPositiveNumericValue: checkBitmask( propConfig, POSITIVE_NUMERIC_VALUE )
};
}
};
}

export default HTMLPropsContainer;
18 changes: 8 additions & 10 deletions src/core/queueStateChanges.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import applyState from './applyState';

export default function queueStateChanges( component, newState ) {
for ( const stateKey in newState ) {
if ( newState.hasOwnProperty( stateKey ) ) {
component._pendingState[stateKey] = newState[stateKey];
}
}
if ( component._pendingSetState === false ) {
component._pendingSetState = true;
applyState( component );
}
export default function queueStateChanges(component, newState) {
for (let stateKey in newState) {
component._pendingState[stateKey] = newState[stateKey];
}
if(component._pendingSetState === false) {
component._pendingSetState = true;
applyState(component);
}
}
3 changes: 1 addition & 2 deletions src/core/scanTreeForDynamicNodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default function scanTreeForDynamicNodes( node, nodeMap ) {
dynamicFlags.ATTRS = true;
} else {
for ( const attr in node.attrs ) {
if ( node.attrs.hasOwnProperty( attr ) ) {

const attrVal = node.attrs[attr];

if ( !isVoid( attrVal ) && attrVal.type === ObjectTypes.VARIABLE ) {
Expand All @@ -53,7 +53,6 @@ export default function scanTreeForDynamicNodes( node, nodeMap ) {
}
dynamicFlags.ATTRS[attr] = attrVal.index;
nodeIsDynamic = true;
}
}
}
}
Expand Down

0 comments on commit f7f394c

Please sign in to comment.