2012-02-15 1 views
2

フレックスのCSSについては、style protochainへの参照が多数あります。私はそれを調べようとしましたが、関連する情報は見つかりませんでした。誰でもクラスStyleProtochainは何をしているのですか? ソースコードには、次のようなコメントがあります。スタイルprotochainとは何ですか?

/** 
* @private 
* This is an all-static class with methods for building the protochains 
* that Flex uses to look up CSS style properties. 
*/ 

クール、それはprotochainsを構築するための方法がいくつかありますことを私に伝え、今私はそれが何を知っているはずが、私はprotochainが何であるか見当がつかないています。

答えて

1

CSSスタイルは継承されます。つまり、新しいオブジェクトを作成し、それをDOMの別の子として配置すると、この新しいオブジェクトは親から継承可能なすべてのスタイルを継承する必要があります。その後、スタイル名またはインラインスタイルを使用してこれらのスタイルをオーバーライドします。

StyleProtoChainクラスは、作成されたオブジェクト(スタイルを持つことができる)のこのスタイルリストを作成する役割を担います。したがって、このクラスはDOMtree(プロトタイプチェーンを上に行くようになるかもしれません...おそらく誤称です!)に移動し、このオブジェクトのスタイルのリストを作成する必要があるため、この名前が付けられています。これは、このコメントによって指定されます。

/** 
    * @private 
    * If the styleName property points to a UIComponent, then we search 
    * for stylable properties in the following order: 
    * 
    * 1) Look for inline styles on this object 
    * 2) Look for inline styles on the styleName object 
    * 3) Look for class selectors on the styleName object 
    * 4) Look for type selectors on the styleName object 
    * 5) Look for type selectors on this object 
    * 6) Follow the usual search path for the styleName object 
    * 
    * If this object doesn't have any type selectors, then the 
    * search path can be simplified to two steps: 
    * 
    * 1) Look for inline styles on this object 
    * 2) Follow the usual search path for the styleName object 
    */ 

これが役に立ちます。誰かがさらに参考にしたい場合は、ソースへのリンクを見つけることができますhere

関連する問題