flex-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Justin Mclean (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLEX-33889) CSSStyleDeclaration->createProtoChainRoot() is obsolete
Date Mon, 11 Nov 2013 02:14:17 GMT

    [ https://issues.apache.org/jira/browse/FLEX-33889?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13818658#comment-13818658
] 

Justin Mclean commented on FLEX-33889:
--------------------------------------

mx_internal methods while they are intended to be internal can be called by other code. If
it was a private method it could be removed safely. I agree the chances are very small and
you're most likely correct that no one uses it. Is the very tiny risk of breaking someones
code worth saving a small number of bytes out of a 944K file?

The answer may lie in how much space it saves. I tried checking the size difference but it
seems the size is a few bytes different every time when it is compiled even without any changes.
(Anyone know why that is the case?) A typical size reduction was 962698 bytes to 962683 bytes,
a total saving of 15 bytes (or under 0.002% of total file size). That's less than I expected.

Thanks for raising the issue, sometimes things like this do make a big difference.

> CSSStyleDeclaration->createProtoChainRoot() is obsolete
> -------------------------------------------------------
>
>                 Key: FLEX-33889
>                 URL: https://issues.apache.org/jira/browse/FLEX-33889
>             Project: Apache Flex
>          Issue Type: Improvement
>          Components: Styles
>    Affects Versions: Apache Flex 4.11.0
>            Reporter: Danko Kozar
>            Priority: Trivial
>              Labels: CSSStyleDeclaration, StyleManager, css, quickfix, style,, stylesheet,,
styling,
>   Original Estimate: 2m
>  Remaining Estimate: 2m
>
> CSSStyleDeclaration->createProtoChainRoot() is obsolete (it seems since Macromedia
days). :)
> This is an "mx_internal" method, and couldn't find any references by the framework itself.
Am I right?
> Another method is used (for initializing the styles root) instead: SystemManagerImpl->initProtoChainRoots()
> Here's the actual method to remove:
> /**
>  *  @private
>  */
> mx_internal function createProtoChainRoot():Object
> {
> 	var root:Object = {};
> 	// If there's a defaultFactory for this style sheet,
> 	// then add the object it produces to the root.
> 	if (defaultFactory != null)
> 	{
> 		defaultFactory.prototype = root;
> 		root = new defaultFactory();
> 	}
> 	// If there's a factory for this style sheet,
> 	// then add the object it produces to the root.
> 	if (factory != null)
> 	{
> 		factory.prototype = root;
> 		root = new factory();
> 	}
> 	clones[ root ] = 1;
> 	
> 	return root;
> }



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message