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