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

Define how some properties disable 'appearance' (superseded by #4857) #4322

Closed
wants to merge 132 commits into from

Conversation

zcorpan
Copy link
Member

@zcorpan zcorpan commented Jan 25, 2019

cc @annevk @bzbarsky @MatsPalmgren @tkent-google @frivoal

This is intended to match https://docs.google.com/document/d/1FE5YIoirPKxYbbnMd8kS6w39M8bzLTl5tf4wwOxR1wc/edit#heading=h.1jgvj9nxi09d

Still need to change the remaining of the "Widgets" section to describe what various elements do when they are different kinds of widgets, and add 'appearance: auto' to specific elements in the UA stylesheet (unless web compat requires getComputedStyle to return other keywords).

I'm not entirely confident in how to specify "author-only properties" (step 6). cc @tabatkins

Some of this should maybe be defined in css-ui instead.


/acknowledgements.html ( diff )
/browsers.html ( diff )
/browsing-the-web.html ( diff )
/canvas.html ( diff )
/common-dom-interfaces.html ( diff )
/common-microsyntaxes.html ( diff )
/comms.html ( diff )
/custom-elements.html ( diff )
/dnd.html ( diff )
/dom.html ( diff )
/dynamic-markup-insertion.html ( diff )
/edits.html ( diff )
/embedded-content-other.html ( diff )
/embedded-content.html ( diff )
/form-control-infrastructure.html ( diff )
/form-elements.html ( diff )
/forms.html ( diff )
/grouping-content.html ( diff )
/history.html ( diff )
/iana.html ( diff )
/iframe-embed-object.html ( diff )
/image-maps.html ( diff )
/imagebitmap-and-animations.html ( diff )
/images.html ( diff )
/index.html ( diff )
/indices.html ( diff )
/infrastructure.html ( diff )
/input.html ( diff )
/interaction.html ( diff )
/interactive-elements.html ( diff )
/introduction.html ( diff )
/links.html ( diff )
/media.html ( diff )
/microdata.html ( diff )
/named-characters.html ( diff )
/obsolete.html ( diff )
/offline.html ( diff )
/origin.html ( diff )
/parsing.html ( diff )
/references.html ( diff )
/rendering.html ( diff )
/scripting.html ( diff )
/sections.html ( diff )
/semantics-other.html ( diff )
/semantics.html ( diff )
/server-sent-events.html ( diff )
/structured-data.html ( diff )
/syntax.html ( diff )
/system-state.html ( diff )
/tables.html ( diff )
/text-level-semantics.html ( diff )
/timers-and-user-prompts.html ( diff )
/urls-and-fetching.html ( diff )
/web-messaging.html ( diff )
/web-sockets.html ( diff )
/webappapis.html ( diff )
/webstorage.html ( diff )
/window-object.html ( diff )
/workers.html ( diff )
/xhtml.html ( diff )

@zcorpan zcorpan added compat Standard is not web compatible or proprietary feature needs standardizing topic: forms interop Implementations are not interoperable with each other labels Jan 25, 2019
source Outdated
<dfn data-x="concept-widget-button" data-export="" data-dfn-for="rendering-widget">button</dfn>,
<dfn data-x="concept-widget-searchfield" data-export="" data-dfn-for="rendering-widget">searchfield</dfn>,
<dfn data-x="concept-widget-textfield" data-export="" data-dfn-for="rendering-widget">textfield</dfn>,
<dfn data-x="concept-widget-slider-horizontal" data-export="" data-dfn-for="rendering-widget">slider-horizontal</dfn>,
Copy link
Member Author

Choose a reason for hiding this comment

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

Browsers have a separate slider-vertical widget, though the spec says to change the orientation based on rendered dimensions. Maybe we should have a different way to change the orientation (e.g. an attribute or CSS property)?

Choose a reason for hiding this comment

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

There seems to be consensus in #4177 that appearance:slider-horizontal/vertical is a bad solution.

source Outdated
data-x="concept-widget-none">none</span>.</p></li>

<li><p>If <var>computedAppearance</var> is 'menulist-button', then return <span
data-x="concept-widget-menulist-button">menulist-button</span>.</p></li>
Copy link
Member Author

Choose a reason for hiding this comment

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

source Outdated

<!-- meter -->
<li><p>If <var>localName</var> is "<code data-x="">meter</code>", then return <span
data-x="concept-widget-meter">meter</span>.</p></li>
Copy link
Member Author

Choose a reason for hiding this comment

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

source Outdated
</ol>
</li>

<!-- others (including input type=file, input type=image, svg...) -->
Copy link
Member Author

Choose a reason for hiding this comment

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

Do we want to force 'none' on input type=file? Allowing button on input type=image seems potentially useful when showing alt text. I'm not sure about non-HTML elements but browsers allow it (though has no effect for most SVG elements).

Copy link
Contributor

Choose a reason for hiding this comment

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

IMO, we should not add new behavior.

Copy link
Member Author

Choose a reason for hiding this comment

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

So current behavior is to allow button on input type=file, input type=image, svg. Below you said "I don't want to keep accepting 'button' appearance on any elements". Can you clarify what you would like to do for the button value?

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, I misunderstood that <input type=file> with -webkit-appearance:button didn't work in WebKit/Blink. It's ok to specify the current WebKit/Blink behavior. I'm sorry for the noise.

source Outdated

<!-- others (including input type=file, input type=image, svg...) -->
<li><p>If <var>computedAppearance</var> is 'button', then return <span
data-x="concept-widget-button">button</span>. Otherwise, return <span
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 is like WebKit/Chromium - specifying -webkit-appearance: button on a div gives it the native button widget even if borders and backgrounds are also specified. Should specifying a border/background result in 'none' instead (like Gecko)?

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see such behavior.

BTW, I don't want to keep accepting 'button' appearance on any elements, but it's ok to specify the current behavior.

Copy link
Member Author

Choose a reason for hiding this comment

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

Here's a test: http://software.hixie.ch/utilities/js/live-dom-viewer/saved/6554

I think there's some web content wanting to use 'button' appearance on div/span/a at least. I could also envision developers wanting to use it with custom elements. Do you think it should be accepted only on actual buttons, or some other elements also?

Copy link
Contributor

@tkent-google tkent-google Jan 31, 2019

Choose a reason for hiding this comment

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

Thanks. I confirmed, and remembered http://crbug.com/612519.
It's ok to specify either of WebKit/Blink behavior and Gecko behavior for now.

However, my opinion is that we should make the 'button' appearance available only on <button> and <input> buttons. I added counters to evaluate the risk of the change; https://chromium-review.googlesource.com/c/1442348

source Outdated

<!-- others (including input type=file, input type=image, svg...) -->
<li><p>If <var>computedAppearance</var> is 'button', then return <span
data-x="concept-widget-button">button</span>. Otherwise, return <span
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see such behavior.

BTW, I don't want to keep accepting 'button' appearance on any elements, but it's ok to specify the current behavior.

source Outdated
</ol>
</li>

<!-- others (including input type=file, input type=image, svg...) -->
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO, we should not add new behavior.

source Outdated
<dfn data-x="concept-widget-progress-bar" data-export="" data-dfn-for="rendering-widget">progress-bar</dfn>, and
<dfn data-x="concept-widget-meter" data-export="" data-dfn-for="rendering-widget">meter</dfn>.</p>

<p>To <dfn>compute the kind of widget</dfn> to use for an element <var>element</var>:</p>
Copy link
Contributor

Choose a reason for hiding this comment

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

The algorithm looks complex.
Now the algorithm is written in a format like:

  If element type is foo and computedApparance is keyword1,
      if properties are ..., then appearance is keyword1, or 'none'
  If element type is bar and computedAppearance is keyword2,
      if properties are ..., then appearance is keyword2, or 'none'
  ...

I wonder if the following format would be simpler:

  if computedApparance is keyword1,
      if properties are ..., then 'none'
      if element type is not foo, then 'none'
      return keyword1
  if computedApparance is keyword2,
      if properties are ..., then 'none'
      if element type is not foo, then 'none'
      return keyword2
  ...

Actually, the implementation of WebKit/Blink is something like the latter.

Copy link
Member Author

@zcorpan zcorpan Jan 28, 2019

Choose a reason for hiding this comment

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

The computedAppearance is per spec mostly ignored except for none (+aliases) and button and menulist-button. Other keywords act like auto. So what you suggested isn't equivalent (for example, textfield on a checkbox would result in checkbox not none).

Some initial work to make introducing browsing context groups (see #4198) easier.

Fixes #2636 by making opener browsing context more generally applicable and making window.open() set it.

Fixes #2645 by removing creator browsing context and explicitly passing in the creator document.

Tests: web-platform-tests/wpt#15078.
source Outdated
@@ -112777,6 +112818,13 @@ input, select, option, optgroup, button, textarea {
text-indent: initial;
}

input, select, button, textarea {
appearance: auto;
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 looked into possible web compat problems that could arise from switching the default to 'auto'.

Modernizr checks WebkitAppearance to feature-detect some input types, but this should continue to work since it checks if the value is not "textfield". Going forward, this kind of check should be done with the type IDL attribute instead. (I suppose this was working around some partial implementation.)

I didn't find anything else in httparchive that would be affected here.

@zcorpan zcorpan changed the title Define how some properties disable 'appearance' (WIP) Define how some properties disable 'appearance' Jan 30, 2019
@zcorpan zcorpan added the needs tests Moving the issue forward requires someone to write tests label Jan 30, 2019
annevk and others added 19 commits February 7, 2019 11:18
The concept of a browsing context event loop does not make much sense in a world where cross-site navigations are increasingly getting more isolated from each other.

Helps with #4198.
This reduces the number of coupled top-level browsing contexts and thereby reduces the attack surface somewhat.

Tests: web-platform-tests/wpt#15188.

Fixes #4078.
As implied by the Note after the definition of session history entries.
In particular to enable noopener, noreferrer, and opener values.

Also default <form target=_blank> to noopener.

Tests: web-platform-tests/wpt#15356.

Fixes #2983.
Name attributes of elements that can create nested browsing contexts (embed, frame, iframe, object) are only to be considered when the nested browsing context is created.

Tests: web-platform-tests/wpt#15392.
Calling cancelAnimationFrame() from within a requestAnimationFrame()
callback should cancel any animation frame callbacks that are
pending for the current frame. The currently specified behavior does not
permit that, however, since it clones the set of callbacks before
iterating over them.

This patch updates the algorithm to run animation frame callbacks such
that it is possible to cancel a pending animation frame callback.
This also brings the specified behavior into line with its
implementation in Blink, EdgeHTML, and WebKit.

Tests: web-platform-tests/wpt#15455.

Closes #4359.
Previously, a Document could sometimes "have no browsing context". Now,
"a Document's browsing context" is either a browsing context or null.

Previously, "a Window's browsing context" was not defined, despite being
referenced extensively. Now, it is defined to be the Window's associated
Document's browsing context.

Related to #3846, #4363, and #4366.
Ms2ger and others added 10 commits August 6, 2019 10:58
ab73443 introduced new custom element
callbacks, but continued to referring to there being four callbacks.
Let's stop stating how many callbacks there are.

Fixes #4822.
Previously, sandboxed navigation did not prevent navigation via the history API;
the check for the navigation was after the unload steps of the history
traversal. This adds an explicit check in those methods to prevent such
navigation.

Fixes #880.
Further code inspection and test-writing revealed that SVG <a> elements
get a 0 default tabIndex in all engines, and <object> elements get a 0
default tabIndex in Blink and WebKit. These were omitted in
15cf23a.
This aligns the HTML Standard with Chrome and Firefox rather than Safari.

Tests: web-platform-tests/wpt#18536.

Fixes #4762.
It seems this feature got added without an agreed upon plan. Firefox fires the loadstart event, but I cannot find evidence of the other events or them using the correct class.

Tests: web-platform-tests/wpt#18499.

Closes #1915. Closes #3860.
zcorpan added a commit to web-platform-tests/wpt that referenced this pull request Aug 21, 2019
zcorpan added a commit to web-platform-tests/wpt that referenced this pull request Aug 21, 2019
zcorpan and others added 4 commits August 22, 2019 11:46
This term is currently used informally to describe "the elements defined
in [section 14.5]." Formalize this definition so that it may be
referenced by the CSS-UI specification to describe the referenced
`appearance` property.

Add a note

Rename the term to 'native appearance' and remove details, summary, marquee

Hook into CSS UI's 'native appearance' term
@zcorpan
Copy link
Member Author

zcorpan commented Aug 22, 2019

I cherry-picked #4725 into this PR, and also rebased on latest master since there was a merge conflict. But now 132 commits are included in this PR, I'm not sure how that happened. :|

@zcorpan
Copy link
Member Author

zcorpan commented Aug 22, 2019

This is now #4857

@zcorpan zcorpan closed this Aug 22, 2019
@zcorpan zcorpan changed the title Define how some properties disable 'appearance' Define how some properties disable 'appearance' (superseded by #4857) Aug 22, 2019
natechapin pushed a commit to natechapin/wpt that referenced this pull request Aug 23, 2019
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Aug 27, 2019
…e', a=testonly

Automatic update from web-platform-tests
HTML: Test default styles for 'appearance'

Part of whatwg/html#4322

--

wpt-commits: c73e28f65eb65da982a7542d5ab71620992707ec
wpt-pr: 18591
xeonchen pushed a commit to xeonchen/gecko that referenced this pull request Aug 27, 2019
…e', a=testonly

Automatic update from web-platform-tests
HTML: Test default styles for 'appearance'

Part of whatwg/html#4322

--

wpt-commits: c73e28f65eb65da982a7542d5ab71620992707ec
wpt-pr: 18591
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Oct 4, 2019
…e', a=testonly

Automatic update from web-platform-tests
HTML: Test default styles for 'appearance'

Part of whatwg/html#4322

--

wpt-commits: c73e28f65eb65da982a7542d5ab71620992707ec
wpt-pr: 18591

UltraBlame original commit: 3599a67e5fd69f33b599ba96a8d1e463f5d8bf9d
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Oct 4, 2019
…e', a=testonly

Automatic update from web-platform-tests
HTML: Test default styles for 'appearance'

Part of whatwg/html#4322

--

wpt-commits: c73e28f65eb65da982a7542d5ab71620992707ec
wpt-pr: 18591

UltraBlame original commit: 3599a67e5fd69f33b599ba96a8d1e463f5d8bf9d
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Oct 4, 2019
…e', a=testonly

Automatic update from web-platform-tests
HTML: Test default styles for 'appearance'

Part of whatwg/html#4322

--

wpt-commits: c73e28f65eb65da982a7542d5ab71620992707ec
wpt-pr: 18591

UltraBlame original commit: 3599a67e5fd69f33b599ba96a8d1e463f5d8bf9d
@annevk annevk deleted the zcorpan/appearance-compute-widget branch October 15, 2021 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compat Standard is not web compatible or proprietary feature needs standardizing interop Implementations are not interoperable with each other needs tests Moving the issue forward requires someone to write tests topic: forms
Development

Successfully merging this pull request may close these issues.