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

Fix #4: Make @capture an enumerated attribute #6

Merged
merged 2 commits into from
Feb 22, 2017
Merged

Conversation

anssiko
Copy link
Member

@anssiko anssiko commented Feb 17, 2017

There has been sufficient interest among implementers to beef up the capture hint, so here's the first stab at it.

Related issues:
#4
whatwg/html#1102

PTAL @miguelao @riju @hober

@anssiko
Copy link
Member Author

anssiko commented Feb 17, 2017

See also: RawGit preview

@anssiko
Copy link
Member Author

anssiko commented Feb 17, 2017

Looping in @legion80 too.

The <dfn data-dfn-for="CaptureFacingMode">CaptureFacingMode</dfn>
enumeration is used to express the <a>preferred facing mode</a>. The
semantics of its keywords mirror the similarly named keywords defined
in <a><code>VideoFacingModeEnum</code></a>.
Copy link
Member

Choose a reason for hiding this comment

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

If it's similar to VideoFacingModeEnum, why not just reuse it? I think supporting (ignoring) the left and right modes will be easier than to add another enum here.

Copy link
Member Author

Choose a reason for hiding this comment

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

The VideoFacingModeEnum is video-specific, so thought adding an indirection would be justified, as it'd allow us to have control over the semantics as needed.

That said, I don't feel strongly about this, we could reuse VideoFacingMode as a hint for audio or image capture too given the enum name itself is not web-facing.

Copy link
Member Author

Choose a reason for hiding this comment

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

@miguelao Let us know if the rationale for minting CaptureFacingMode enum sounds reasonable. Adding a new enum should be cheap in terms of implementation effort.

Copy link
Member

Choose a reason for hiding this comment

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

TBH I think the naming CaptureFacingMode makes more sense than VideoFacingModeEnum, and we should just line up both specs. Go ahead with this change but we should file a bug there to rename it (there) and then bundle both, since they all describe the same concepts. (And also I wonder what's that Enum at the end of VideoFacingModeEnum doing there).

index.html Outdated
"CaptureFacingMode">user</dfn> and <dfn data-dfn-for=
"CaptureFacingMode">environment</dfn>, which map to the respective
states <var>user</var> and <var>environment</var>. The <a>missing
value default</a> is the <var>environment</var> state. The <a>invalid
Copy link
Member

Choose a reason for hiding this comment

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

Is this true? IIRC the current <input capture> just leaves it to the System App to decide what's the default orientation and we might want to maintain compatibility with it. If so, we should make it more evident/expectable than simply adding a description here, e.g. allow it to be nullable?

Copy link
Member Author

Choose a reason for hiding this comment

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

Should made defaults implementation-specific indeed.

Can you expand the use case for nullable?

Copy link
Member Author

Choose a reason for hiding this comment

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

Added implementation-specific state in 5679164

@miguelao PTAL to ensure this matches what you had in mind.

&lt;input type="submit" value="Upload"&gt;
&lt;/form&gt;
</pre>
</li>
<li>Or alternatively, to capture video using the device's local video
camera:
camera facing the environment:
Copy link
Member

Choose a reason for hiding this comment

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

Side question: is there an implementation status/ caniuse for this feature? (couldn't find any)

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Also it's in the queue of caniuse (Fyrd/caniuse#1115) waiting for some candid soul to add the entry (as a reference, this is the mediacapture-image).

@hober
Copy link
Member

hober commented Feb 21, 2017

LGTM

Map 'missing value default' and 'invalid value default'
to the implementation-specific state.
Copy link
Member

@yell0wd0g yell0wd0g left a comment

Choose a reason for hiding this comment

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

lgtm -- I wish there could be an automatic way to file bugs/issues with the browsers every time the spec gets a PR 😄 🤔

The <dfn data-dfn-for="CaptureFacingMode">CaptureFacingMode</dfn>
enumeration is used to express the <a>preferred facing mode</a>. The
semantics of its keywords mirror the similarly named keywords defined
in <a><code>VideoFacingModeEnum</code></a>.
Copy link
Member

Choose a reason for hiding this comment

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

TBH I think the naming CaptureFacingMode makes more sense than VideoFacingModeEnum, and we should just line up both specs. Go ahead with this change but we should file a bug there to rename it (there) and then bundle both, since they all describe the same concepts. (And also I wonder what's that Enum at the end of VideoFacingModeEnum doing there).

</p>
<p class="note">
If the user agent is unable to support the <a>preferred facing
mode</a>, it can fall back to the implementation-specific default
Copy link
Member

Choose a reason for hiding this comment

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

nit: s/can/MUST/

Copy link
Member Author

Choose a reason for hiding this comment

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

By convention, non-normative notes contain no RFC terms (because they're non-normative).

&lt;input type="submit" value="Upload"&gt;
&lt;/form&gt;
</pre>
</li>
<li>Or alternatively, to capture video using the device's local video
camera:
camera facing the environment:
Copy link
Member

Choose a reason for hiding this comment

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

Also it's in the queue of caniuse (Fyrd/caniuse#1115) waiting for some candid soul to add the entry (as a reference, this is the mediacapture-image).

@anssiko
Copy link
Member Author

anssiko commented Feb 22, 2017

@miguelao @hober Thanks for your swift review! We're ready to land now.

@anssiko anssiko merged commit ccd71a1 into gh-pages Feb 22, 2017
@anssiko anssiko deleted the facingmode branch February 22, 2017 18:36
@foolip
Copy link
Member

foolip commented Mar 9, 2017

@miguelao, this attribute is still a boolean in Blink's IDL. Has this been shipped on any platform yet? If not then it'll be fine, but if it used anywhere in the wild already, this will become a problem.

@anssiko
Copy link
Member Author

anssiko commented Mar 9, 2017

@foolip, for the shipping status, see whatwg/html#1102 (comment) and for the usage of the to-be-superseded boolean, see your UseCounters observations at https://bugs.chromium.org/p/chromium/issues/detail?id=240252#c19

TL:DR: the boolean usage has been low enough for everyone to be comfortable with this change. The known backwards incompatible change is whatwg/html#1102 (comment)

@foolip
Copy link
Member

foolip commented Mar 9, 2017

Heh, https://codereview.chromium.org/303473004 is funny, both because I had no memory of it, and because this has already gone from enum to boolean once :)

I don't mind this change, just got a bit nervous when I saw things not lining up.

@anssiko
Copy link
Member Author

anssiko commented Mar 9, 2017

[@foolip you're involved in so many things it is no wonder you did not remember. Luckily Google never forgets ;-)]

Now we're moving ahead with the implementation of the enum at https://crbug.com/698853 as you noticed already.

@hober
Copy link
Member

hober commented Mar 9, 2017

FWIW, this change has landed in trunk WebKit.

@anssiko
Copy link
Member Author

anssiko commented Mar 10, 2017

@hober, are these the right WebKit bugs to track?

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