Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial value fallback to non-inheritable properties #298

Merged
merged 4 commits into from
Jan 1, 2018

Conversation

palemieux
Copy link
Contributor

Closes #200

See also #217

@palemieux palemieux added this to the 3rd Ed milestone Dec 18, 2017
@palemieux palemieux self-assigned this Dec 18, 2017
Copy link
Contributor

@nigelmegitt nigelmegitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of typos with this pull request as is, however I have proposed an alternative approach to resolving the issues that I think is clearer.

spec/ttml1.xml Outdated
type <el>region</el>, then set <emph>P&prime;</emph> to the initial value of
next style property;</p></item>
<item><p>if <emph>P</emph> is inheritable and <emph>E</emph> is a <el>region</el> element
and, or if <emph>P</emph> is not inheritable and applies to <emph>E</emph>, then set <emph>P&prime;</emph> to the initial value of
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems to be an unnecessary "and" at the beginning of this line.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some properties do not have an initial value specified, and that's not a spec error.

spec/ttml1.xml Outdated
property <emph>P</emph>, where the initial value of a property is
determined according to the specific property definition found above
in <specref ref="styling-attribute-vocabulary"/>;</p></item>
<item><p>if the element type of <emph>E</emph> is a <loc href="#element-vocab-type-content">Content</loc> element
<item><p>if if <emph>P</emph> is inheritable and the element type of <emph>E</emph> is a <loc href="#element-vocab-type-content">Content</loc> element
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo "if if" -> "if"

@@ -7070,20 +7070,20 @@ set of <emph>E</emph>, <emph>SSS(E)</emph>;</p></item>
<item>
<p><phrase role="strong">[implicit inheritance]</phrase> if the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer as a matter of style not to mix the setting of initial values of non-inheritable style properties into the implicit inheritance steps. Rather, I think the resolution to this issue would be better as a new step 7, such as [apply initial property values] along the lines of:

7. [apply initial non-inheritable style property values] if the element type of E is not the styling element type style, then for each non-inheritable style property P in the set of style properties defined above in 8.2 Styling Attribute Vocabulary, perform the following ordered sub-steps:
a. if P is present in the specified style set of E, SSS(E), then continue to the next style property;
b. if P applies to E, then set P′ to the initial value of property P, where the initial value of a property is determined according to the specific property definition found above in 8.2 Styling Attribute Vocabulary, and is undefined if no initial value is defined;
c. if the value of P′ is not undefined, then merge P′ into the specified style set of E, SSS(E).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nigelmegitt This would not match TTML2 ED. I think we should keep this structure, and file a separate ticket to consider updating both TTML2 and TTML1 to match your suggested structure.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK I hadn't spotted that @palemieux , happy to go with your suggestion. Thanks for the pointer.

spec/ttml1.xml Outdated
<item><p>if the element type of <emph>E</emph> is the layout element
type <el>region</el>, then set <emph>P&prime;</emph> to the initial value of
next style property;</p></item>
<item><p>if <emph>P</emph> is inheritable and <emph>E</emph> is a <el>region</el> element, or if <emph>P</emph> is not inheritable and applies to <emph>E</emph>, then set <emph>P&prime;</emph> to the initial value of
property <emph>P</emph>, where the initial value of a property is
determined according to the specific property definition found above
in <specref ref="styling-attribute-vocabulary"/>;</p></item>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even if not using my suggestion at https://github.com/w3c/ttml1/pull/298/files#r157463436 right now, I think it would still be useful to note that if an initial value is absent from the property definition, then the specified value falls into the undefined class.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean replace then set P′ to the initial value of property P, with then set P′ to the initial value of property P if one exists, ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would work but it would be a bigger change, since it would also mean that the step "if the value of P′ is not undefined, then merge P′ into the specified style set of E, SSS(E)." would need to be changed as well.

The smaller (and therefore usually preferable) change is simply to add something like the following to the end of the line this comment thread begins on:

(for properties that do not define an initial value, the value of P′ is undefined)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nigelmegitt if no initial value of property P exist than P' is not set, therefore P' remains undefined.... or is there something I missed?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@palemieux The point I'm trying to make is that the text directs the reader to the initial value of the property but for some properties no initial value is defined. In that case, what to do? I think it would be a helpful addition to clarify a) that such cases exist deliberately and b) that when they arise, P' remains undefined.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nigelmegitt then set P′ to the initial value of property P if one exists seems to cover the case where no initial value is defined, since the clause would not be applied if no initial value exists, which would leave P' undefined... or am I missing a corner case... or is it a personal style issue?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@palemieux Maybe I've misunderstood, but I thought that if you do that ["if one exists"] then SSS(E) would not contain P', whereas if you adopt my approach SSS(E) would contain P', with P' set to an "undefined" class. So it seemed like a subtle but substantive difference.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nigelmegitt There is no "undefined" class in SSS(E). AFAIK "undefined" refers to the variable P' never having been set.

Copy link
Contributor

@nigelmegitt nigelmegitt Dec 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@palemieux OK, I see what you mean. If P' is undefined then it never gets added to SSS(E). So we should say:

set P′ to the initial value of property P if such an initial value is defined

I'm wary of saying "if one is defined" in case of ambiguity about what the "one" refers to.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nigelmegitt I have updated the PR per #298 (comment)

Copy link
Contributor

@nigelmegitt nigelmegitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good to me.

A minor nit would be that we've ended up with two "ifs" rather than simply an additional "and an initial value is defined for P" clause. I think that may have been partially my fault...

Still, this is better than what was there before.

Copy link
Contributor

@skynavga skynavga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job handling this complex change. Further, upon reviewing this change, it suggests that I revert the order of steps 6 (b) and (c) in TTML2 10.5.4.2 to use the same ordering as was in TTML1.

@palemieux palemieux merged commit 5c8c27c into master Jan 1, 2018
@skynavga skynavga deleted the issue-200-initial-value-non-inheritable-prop branch March 11, 2018 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants