- From: Nathan Glenn <garfieldnate@gmail.com>
- Date: Tue, 6 Aug 2013 20:42:38 -0700
- To: public-i18n-its-ig@w3.org
- Message-ID: <CACs83phXDW6bO8tcVnxaURVzfge_5Kipfo7RaDi8TQHCPWeerA@mail.gmail.com>
Hello again, I was wondering if I could ask a question about inheritance and precedence. Section 5.5 of the spec gives information on this, but leaves the proper implementation unclear in my mind. Implementing global selection makes a lot of sense to me because once rules are properly ordered, they can all be applied and later ones will overwrite older ones. However, it is less clear for inheritance. What I would like to think is that one could do the following in order to decide the ITS metadata for an entire document: 1. Apply default values. 2. Apply global selection via rules, one at a time, also applying inheritance for each one. Each rule application writes over any previous ones. 3. Apply selection via explicit local markup, and then the inheritance of this markup, overwriting any previously applied selections. Application would be a pre-order operation in a depth-first search (or something else that would cause selections for children to overwrite selections/inheritance via ancestors). However, the specification for precedence of selection from section 5.5 is: 1. local markup 2. global selectors 3. inherited values 4. default values The problem with this is that there are 2 types of inheritance: inheritance from global selections (example 13) and inheritance from local selections (example 11), and the given precedence order implies that they are both at the same level. If they were, then implementation would be much less simple than the 3 step process outlined above, and ITS could get pretty clumsy. For example, there would be no way to set an entire Arabic document as right-to-left (<its:dirRule selector="/*" dir="rtl"> or selector="//*") and then mark the parent of several English elements with its:dir="ltr". You would have to set the direction on each individual element, or create another global selector and place it after the first. I think that the precedence order should probably be: 1. local markup 2. inherited local markup 3. global selectors 4. inheritance from global selectors 5. default values Provided it is correct, it makes it easier to see that a proper implementation of ITS is simply the reverse application of this list. One could even combine 1-2 and 3-4. I'm sorry if I'm way off on this. Could someone tell me if my understanding of precedence and inheritance is correct? Nathan
Received on Wednesday, 7 August 2013 03:43:05 UTC