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 activation behavior for <summary> #2256

Merged
merged 8 commits into from
Jan 19, 2017
Merged

Conversation

domenic
Copy link
Member

@domenic domenic commented Jan 10, 2017

Fixes #2246. This also fixes the value that the open attribute is set to
to be the empty string, instead of "open", matching existing
implementations.

Tests coming tomorrow. By code inspection at least, Chrome seems to enforce the first-element-childness, which makes sense since that is kind of enforced by the rendering section already.

Fixes #2246. This also fixes the value that the open attribute is set to
to be the empty string, instead of "open", matching existing
implementations.
@domenic domenic added normative change needs tests Moving the issue forward requires someone to write tests labels Jan 10, 2017
@raphaelcharoze
Copy link

tests have passed


<li><p>If <var>parent</var> is not a <code>details</code> element, abort these steps.</p>

<li><p>If <var>parent</var>'s first element child is not the <code>summary</code> element, abort
Copy link
Member

Choose a reason for hiding this comment

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

s/the/this/ ?

Copy link
Member Author

Choose a reason for hiding this comment

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

I tend to reserve "this" for method steps, but not for any super-great reason.


<li>
<p>If the <code data-x="attr-details-open">open</code> attribute is present on
<var>parent</var>, remove it. Otherwise, set <var>parent</var>'s <code
Copy link
Member

Choose a reason for hiding this comment

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

Should remove and set here call the DOM hooks for removing and setting attributes?

Copy link
Member Author

Choose a reason for hiding this comment

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

At first I did, but I noticed that nowhere else in the spec do we do that so far, so probably leave that for a later cleanup.

Copy link
Member

Choose a reason for hiding this comment

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

It's used in some places, search for concept-element-attributes-

domenic added a commit to web-platform-tests/wpt that referenced this pull request Jan 13, 2017
It's OK to have previous element siblings, as long as they are not summary elements. That matches the rendering section better (and also Chrome).
@domenic
Copy link
Member Author

domenic commented Jan 13, 2017

OK, ready for round two, with tests: web-platform-tests/wpt#4539 (although apparently they are flaky tests...)

@domenic domenic removed the needs tests Moving the issue forward requires someone to write tests label Jan 13, 2017
@domenic
Copy link
Member Author

domenic commented Jan 13, 2017

It looks like Firefox does not implement the "being rendered" check. I guess the precendent from other activation behaviors in the spec is not to have such a check, so I should probably remove it.

domenic added a commit to web-platform-tests/wpt that referenced this pull request Jan 13, 2017
@zcorpan
Copy link
Member

zcorpan commented Jan 14, 2017

Activation behavior aspect LGTM, but #2246 also talks about focus and accessibility mapping.

@stevefaulkner
Copy link
Contributor

@zcorpan

the accessibility mappings are already defined and implemented:
https://w3c.github.io/html-aam/#el-summary

In all implementations summary is focusable and interaction with it controls state of the details element

@@ -72501,6 +72535,9 @@ END:VCARD</pre>

<li><code>menuitem</code> elements</li>

<li><code>summary</code> elements that are the first element child of a <code>details</code>
Copy link
Member Author

Choose a reason for hiding this comment

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

This should be fixed to match the others; the first summary child, not the first element child

@zcorpan
Copy link
Member

zcorpan commented Jan 19, 2017

Unsure if my latest commit makes sense; see #2272 (comment)

@zcorpan zcorpan added the do not merge yet Pull request must not be merged per rationale in comment label Jan 19, 2017
@domenic
Copy link
Member Author

domenic commented Jan 19, 2017

@zcorpan I think we should not add such a conformance requirement at least in this PR. If we think it's worth discussing more let's do so in #2272 and perhaps send a follow-up PR. So if you're OK with it I'll plan on removing that commit and merging this once the tests land.

sideshowbarker pushed a commit to web-platform-tests/wpt that referenced this pull request Jan 19, 2017
* Add tests for <summary>'s activation behavior

Follows whatwg/html#2256.

* Flip tests for being-rendered per whatwg/html#2256 (comment)
@domenic domenic removed the do not merge yet Pull request must not be merged per rationale in comment label Jan 19, 2017
@domenic domenic merged commit 5e0b8e6 into master Jan 19, 2017
@domenic domenic deleted the summary-activation-behavior branch January 19, 2017 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

summary element definition does not reflect implementations
4 participants