[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Action item: New 5.4 section
Here is the new section 5.4 of the specification. I had an action item to re-write it... Some comments about the new section: - The old one was referencing to CSS 2.1 (but that's only in last call, we can't reference it) - There's a conflict with 'inherit' on Style Properties and attempting to inherit Specified Values! 'inherit' never gets resolve if you inherit specified values... - For the wording to work, I think we need to say that Computed Values are inherited but that the 'Computed Value line' can define how the computed value is resolve. --- 5.4 Inheritance of APS Attributes and of Style Properties This section describes how @@APS attributes@@ are inherited in a WebCGM structure tree. It also describes how @@Style Properties@@ are inherited, which is similar but differs in some key details. The inheritance models are based closely on the inheritance model of @@CSS 2.0@@. Some details have been adapted to the particulars of the WebCGM format. This chapter is the normative reference for inheritance of @@APS Attributes@@ and of @@Style Properties@@ in WebCGM. 5.4.1 Specified, computed, and actual values of Style Properties WebCGM 2.0 user agents are required to support the inheritance model of Style Properties defined in this section. Once a user agent has loaded a document and constructed a document tree, it must assign, for every Application Structure in the tree, a value to every Style Properties. Very similar to the CSS model, the final value of a Style Properties is the result of a four-step calculation: the value is determined through specification (the "Specified Value"), then resolved into a value that may be used for inheritance (the "Computed Value"), then converted into an absolute value if necessary (the "Used Value"), and finally transformed according to the limitations of the local environment (the "Actual Value"). 5.4.1.1 Specified Values of Style Properties User agents must first assign a Specified Value to each Style Properties based on the following mechanisms (in order of precedence): 1. If the Style Property is assigned a value (via a DOM call, or via an XCF), use it. 2. Otherwise, if the Style Property is inherited (i.e., its definition includes "Inherited:yes") and the Application Structure is not the root of the document tree, use the Computed Value of the parent Application Structure. 3. Otherwise use the Style Property's Initial Value. The Initial Value of each Property is indicated in the Style Property's definition. Note: In the context of WebCGM inheritance, the root of the document tree is the Picture node. 5.4.1.2 Computed Values of Style Properties Specified Values are resolved to Computed Values after the document tree is created; for example relative units ('%') are computed to absolute values, that is mostly likely into RGB colors or NVDC values. Computing a value never requires the user agent to render the document. When the Specified Value is not 'inherit', the Computed Value of a Style Property is determined as specified by the Computed Value line in the definition of the Property. The 'inherit' keyword must be replaced according to its definition. See the @@section on inheritance@@ for the definition of computed values when the specified value is 'inherit'. The Computed Value exists even when the property doesn't apply, as defined by the 'Applies To' line. 5.4.1.3 Used Values of Style Properties In the CSS2 model from which the WebCGM model is derived, Computed Values can be relative to each other; for example a width could be set as a percentage, which is dependent on the containing block's width. The Used Value is the result of taking the Computed Value and resolving these dependencies into a final absolute value used for the actual display. In this version of WebCGM, there are no examples where Used Value differs from the Computed Value. This may change in a future version of the specification. 5.4.1.4 Actual Values of Style Properties A Used Value is in principle the value used for rendering, but a user agent may not be able to make use of the value in a given environment. For example, a user agent may only be able to render borders with integer pixel widths and may therefore have to approximate the computed width, or the user agent may be forced to use only black and white shades instead of full colour. The Actual Value is the used value after any approximations have been applied. 5.4.2 Specified, computed, and actual values of Application Structure Attributes WebCGM 2.0 user agents are required to support the inheritance model of Application Structure Attributes defined in this section. Once a user agent has loaded a document and constructed a document tree, it must resolve, for every Application Structure in the tree, if an Attribute has a value (i.e., no value is possible for some attributes). Very similar to the CSS model, the final value of a Style Properties is the result of a four-step calculation: the value is determined through specification (the "Specified Value"), then resolved into a value that may be used for inheritance (the "Computed Value"), then converted into an absolute value if necessary (the "Used Value"), and finally transformed according to the limitations of the local environment (the "Actual Value"). 5.4.1.1 Specified Values of Application Structure Attributes User agents must first assign a Specified Value to each Style Properties based on the following mechanisms (in order of precedence): 1. If the Attribute is assigned a value in the CGM document or assigned a new value via a DOM call or an XCF, use it. 2. Otherwise, if the Attribute is inherited (i.e., its definition includes "Inherited:yes") and the Application Structure is not the root of the document tree, use the Computed Value of the parent Application Structure. 3. Otherwise use the Attribute's Initial Value. The Initial Value of each Attribute is indicated in the Attribute's definition. Note: In the context of WebCGM inheritance, the root of the document tree is the Picture node. 5.4.2.2 Computed Values of Application Structure Attributes In this specification, Computed Values of Application Structure Attributes, with the exception of the 'inherit' value are identical to the Specified Values. The 'inherit' keyword must be replaced according to its definition. See the @@section on inheritance@@ for the definition of computed values when the specified value is 'inherit'. The Computed Value exists even when the Attribute doesn't apply, as defined by the 'Applies To' line. 5.4.2.3 Used Values of Application Structure Attributes In the CSS2 model from which the WebCGM model is derived, Computed Values can be relative to each other; for example a width could be set as a percentage, which is dependent on the containing block's width. The Used Value is the result of taking the Computed Value and resolving these dependencies into a final absolute value used for the actual display. In this version of WebCGM, there are no examples where Used Value differs from the Computed Value. This may change in a future version of the specification. 5.4.2.4 Actual Values of Application Structure Attributes A Used Value is in principle the value used for rendering, but a user agent may not be able to make use of the value in a given environment. For example, a user agent may only be able to render borders with integer pixel widths and may therefore have to approximate the computed width, or the user agent may be forced to use only black and white shades instead of full colour. The Actual Value is the used value after any approximations have been applied. In this version of WebCGM, there are no examples where Actual Value differs from the Actual Value. This may change in a future version of the specification. 5.4.3 Inheritance Some values are inherited by the children of an Application Structure in the document tree, as described above. Each Style Property and Application Structure Attribute defines whether it is inherited or not. As a general rule, when inheritance occurs, Application Structures inherit Computed values of Style Properties and Application Structure Attributes (unless implicitly stated in the Property or Attribute definition). 5.4.3.1 The 'inherit' value All Style Properties as well as the 'visibility' and 'interactivity' Application Structure Attribute may also have a Specified Value of 'inherit'; which means that, for a given Application Structure, the Property or Attribute takes the same Computed value of the Application Structure's parent. The 'inherit' value can be used to strengthen inherited values, and it can also be used on Style Properties that are not normally inherited. -- Benoit mailto:benoit@itedo.com
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]