diff --git a/compatibility.bs b/compatibility.bs index 6d4a2b7..f279954 100644 --- a/compatibility.bs +++ b/compatibility.bs @@ -3,7 +3,7 @@ Group: WHATWG H1: Compatibility Shortname: compat Text Macro: TWITTER compatstandard -Text Macro: LATESTRD 2021-06 +Text Macro: LATESTRD 2021-12 Abstract: This standard describes a collection of non-standard (and often vendor-prefixed) CSS properties and DOM APIs that web browsers need to support for compatibility with the de facto web. Translation: ja https://triple-underscore.github.io/compat-ja.html Indent: 2 diff --git a/review-drafts/2021-12.bs b/review-drafts/2021-12.bs new file mode 100644 index 0000000..a0c0957 --- /dev/null +++ b/review-drafts/2021-12.bs @@ -0,0 +1,828 @@ +
+Group: WHATWG
+Date: 2021-12-20
+H1: Compatibility
+Shortname: compat
+Text Macro: TWITTER compatstandard
+Text Macro: LATESTRD 2021-12
+Abstract: This standard describes a collection of non-standard (and often vendor-prefixed) CSS properties and DOM APIs that web browsers need to support for compatibility with the de facto web.
+Translation: ja https://triple-underscore.github.io/compat-ja.html
+Indent: 2
+Markup Shorthands: dfn yes
+
+ +
+urlPrefix: https://w3c.github.io/screen-orientation/;
+  type: interface
+    text: ScreenOrientation; url: #screenorientation-interface
+  type: dfn
+    text: update the orientation information; url: #dfn-update-the-orientation-information
+urlPrefix: https://www.w3.org/TR/CSS/; spec: CSS2
+  type: dfn
+    text: vendor prefix; url: #vendor-prefix
+urlPrefix: https://drafts.csswg.org/mediaqueries-4/; spec: mediaqueries-4
+  type: dfn
+    text: media query; url: #media-query
+    text: media feature; url: #media-feature
+    text: resolution; url: #descdef-media-resolution
+    text: min-resolution; url: #descdef-media-resolution
+    text: max-resolution; url: #descdef-media-resolution
+    text: prefixes on range features; url: #mq-min-max
+urlPrefix: https://www.w3.org/TR/2011/WD-css3-images-20110217/; spec: css3-images-20110217
+  type: dfn
+    text: linear-gradient; url: #ltlinear-gradient
+    text: radial-gradient; url: #ltradial-gradient
+    text: repeating-linear-gradient; url: #ltrepeating-linear-gradient
+    text: repeating-radial-gradient; url: #ltrepeating-radial-gradient
+urlPrefix: https://drafts.csswg.org/css-backgrounds-3/
+  type: dfn
+    text: the backgrounds of special elements;url: #special-backgrounds
+urlPrefix: https://drafts.csswg.org/css-transitions/
+  type: dfn
+    text: color; url: #animtype-color
+urlPrefix: https://drafts.fxtf.org/css-masking-1/
+  type: dfn
+    text: clipping path; url: #clipping-path
+urlPrefix: https://drafts.csswg.org/css-values-3/
+  type: dfn
+    text: dppx; url: #dppx
+
+ + + + + +

Introduction

+This section is non-normative. + +There exists an increasingly large corpus of web content that depends on web browsers supporting a number of webkit-prefixed CSS properties and DOM APIs for functionality or layout. This holds especially true for mobile-optimized web content. + +This specification aims to describe the minimal set of webkit-prefixed CSS properties and DOM APIs that user agents are required to support for web compatibility. + +
+The Non-Standard Compatibility wiki page will serve as a rough guide for what this specification intends to cover. +
+ +

Conformance

+All diagrams, examples, and notes in this specification are +non-normative, as are all sections explicitly marked non-normative. +Everything else in this specification is normative. + +The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", +"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and +"OPTIONAL" in this document are to be interpreted as described in RFC 2119. +For readability, these words do not appear in all uppercase letters in this +specification. [[!RFC2119]] + +Requirements phrased in the imperative as part of algorithms +(such as "strip any leading space characters" or "return false and +terminate these steps") are to be interpreted with the meaning of the +keyword ("must", "should", "may", etc.) used in introducing the +algorithm. + +Conformance requirements phrased as algorithms or specific steps +may be implemented in any manner, so long as the end result is +equivalent. (In particular, the algorithms defined in this +specification are intended to be easy to follow, and not intended to +be performant.) + +

CSS Compatibility

+ +

CSS At-rules

+ +The following -webkit- vendor prefixed at-rules must be supported as aliases of the corresponding unprefixed at-rules: + + + + + + + + + + + + + + +
-webkit- prefixed at-rule aliasunprefixed at-rule
@-webkit-keyframes@keyframes
+ +

CSS Media Queries

+ +

+ '-webkit-device-pixel-ratio' +

+ +
+Name: -webkit-device-pixel-ratio
+Value: <>
+For: @media
+Type: range
+
+ +'-webkit-device-pixel-ratio' must be treated as an alias of the resolution range type media feature, with its value interpreted as a dppx unit. + +The min- or max- prefixes on range features must not apply to '-webkit-device-pixel-ratio', instead the following aliases must be used: + + + + + + + + + + + + + + + + + + +
legacy -webkit- prefixed range media feature aliasstandard prefixed range media feature
-webkit-min-device-pixel-ratiomin-resolution
-webkit-max-device-pixel-ratiomax-resolution
+ +

+ '-webkit-transform-3d' +

+ +
+Name: -webkit-transform-3d
+Value: <>
+For: @media
+Accepts min/max prefixes: no
+
+ +The '-webkit-transform-3d' media feature is used to query whether the user agent supports CSS 3D transforms. [[css-transforms-1]] + +If the user agent supports 3D transforms, the value will be 1. Otherwise the value is 0. + +

CSS Gradients

+ + + +

+ ''-webkit-linear-gradient()'' +

+ +-webkit-linear-gradient() must be treated as an alias of linear-gradient as defined in [[css3-images-20110217]]. + + +

+ ''-webkit-radial-gradient()'' +

+ +-webkit-radial-gradient() must be treated as an alias of radial-gradient as defined in [[css3-images-20110217]]. + +

+ ''-webkit-repeating-linear-gradient()'' +

+ +-webkit-repeating-linear-gradient() must be treated as an alias of repeating-linear-gradient as defined in [[css3-images-20110217]]. + +

+ ''-webkit-repeating-radial-gradient()'' +

+ +-webkit-repeating-radial-gradient() must be treated as an alias of repeating-radial-gradient as defined in [[css3-images-20110217]]. + + + +

CSS Properties

+ +

Legacy name aliases

+ +The following -webkit- vendor prefixed properties must be supported as legacy name aliases of the corresponding unprefixed property: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
-webkit- prefixed property aliasunprefixed property
-webkit-align-items'align-items'
-webkit-align-content'align-content'
-webkit-align-self'align-self'
-webkit-animation-name'animation-name'
-webkit-animation-duration'animation-duration'
-webkit-animation-timing-function'animation-timing-function'
-webkit-animation-iteration-count'animation-iteration-count'
-webkit-animation-direction'animation-direction'
-webkit-animation-play-state'animation-play-state'
-webkit-animation-delay'animation-delay'
-webkit-animation-fill-mode'animation-fill-mode'
-webkit-animation'animation'
-webkit-backface-visibility'backface-visibility'
-webkit-background-origin'background-origin'
+ -webkit-background-size +

+ Not really a [=legacy name alias=]. See issue #28. +

+
'background-size'
-webkit-border-bottom-left-radius'border-bottom-left-radius'
-webkit-border-bottom-right-radius'border-bottom-right-radius'
-webkit-border-top-left-radius'border-top-left-radius'
-webkit-border-top-right-radius'border-top-right-radius'
-webkit-border-radius'border-radius'
-webkit-box-shadow'box-shadow'
-webkit-box-sizing'box-sizing'
-webkit-flex'flex'
-webkit-flex-basis'flex-basis'
-webkit-flex-direction'flex-direction'
-webkit-flex-flow'flex-flow'
-webkit-flex-grow'flex-grow'
-webkit-flex-shrink'flex-shrink'
-webkit-flex-wrap'flex-wrap'
-webkit-filter'filter'
-webkit-justify-content'justify-content'
-webkit-mask'mask'
-webkit-mask-box-image'mask-border'
-webkit-mask-box-image-outset'mask-border-outset'
-webkit-mask-box-image-repeat'mask-border-repeat'
-webkit-mask-box-image-slice'mask-border-slice'
-webkit-mask-box-image-source'mask-border-source'
-webkit-mask-box-image-width'mask-border-width'
-webkit-mask-clip'mask-clip'
-webkit-mask-composite'mask-composite'
-webkit-mask-image'mask-image'
-webkit-mask-origin'mask-origin'
-webkit-mask-position'mask-position'
-webkit-mask-repeat'mask-repeat'
-webkit-mask-size'mask-size'
-webkit-order'order'
-webkit-perspective'perspective'
-webkit-perspective-origin'perspective-origin'
-webkit-transform-origin'transform-origin'
-webkit-transform-style'transform-style'
-webkit-transform'transform'
-webkit-transition-delay'transition-delay'
-webkit-transition-duration'transition-duration'
-webkit-transition-property'transition-property'
-webkit-transition-timing-function'transition-timing-function'
-webkit-transition'transition'
+ +

Prefixed legacy name aliases

+ +The following -webkit- vendor prefixed properties must be supported as legacy name aliases of the corresponding unprefixed properties. If the user agent does not ship the unprefixed equivalent, the -webkit- prefixed property must be treated as an alias of the user agent's own vendor prefixed property. + + + + + + + + + + + + + + +
-webkit- prefixed property alias(vendor prefixed) property
-webkit-text-size-adjust(-prefix-)'text-size-adjust'
+ +
+
As soon as each property is unprefixable it can be defined as a [=legacy name alias=].
+ +

Non-aliased vendor prefixed properties

+ +Note: This section used to have a specification for the '-webkit-appearance' property. +This is now defined in CSS Basic User Interface Module. + +

Property mappings

+ +The following -webkit- vendor prefixed properties must be supported as mappings to the corresponding unprefixed property: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
-webkit- prefixed propertyunprefixed property
-webkit-box-align'align-items'
-webkit-box-flex'flex-grow'
-webkit-box-ordinal-group'order'
-webkit-box-orient'flex-direction'
-webkit-box-pack'justify-content'
+ +

Keyword mappings

+ +The following -webkit- vendor prefixed keywords must be supported as mappings to the corresponding unprefixed keyword: + + + + + + + + + + + + + + + + + + + + + + + + + + +
-webkit- prefixed keywordunprefixed property keyword
-webkit-box''flex''
-webkit-flex''flex''
-webkit-inline-box''inline-flex''
-webkit-inline-flex''inline-flex''
+ +

Foreground Text Clipping: the +'-webkit-background-clip' property

+ +
+Name: -webkit-background-clip
+Value:  border-box | padding-box | content-box | text
+Initial: none
+Applies to: all elements
+Inherited: no
+Computed value: "text"
+Percentages: N/A
+Media: visual
+Animation type: discrete
+
+ +The '-webkit-background-clip' property—when its value is ''text''—creates a background clipping region from the outer text stroke of the foreground text (including alpha transparency). + +The '-webkit-background-clip' property is a [=legacy name alias=] of the 'background-clip' property for all other <> values. + +
+Note that the root element has a different background painting area, and thus the '-webkit-background-clip' property has no effect when specified on it. See the backgrounds of special elements. +
+ +
+
border-box +
The background is painted within (clipped to) the border box. + +
padding-box +
The background is painted within (clipped to) the padding box. + +
content-box +
The background is painted within (clipped to) the content box. + +
text +
Indicates that the background image should clip to the foreground text +

+ +
+Here's an example showing how to use '-webkit-background-clip': text together with +-webkit-text-fill-color: transparent to achieve text with a gradient color effect. +
+p {
+  background: linear-gradient(90deg, red, blue);
+  color: #fff;
+  -webkit-background-clip: text;
+  -webkit-text-fill-color: transparent;
+}
+
+Browsers that don't support '-webkit-background-clip' or '-webkit-text-fill-color' will use the color declaration as a fallback color. +
+ +

Text Fill and Stroking

+ +
Foreground Text Color: the +'-webkit-text-fill-color' property
+ +
+Name: -webkit-text-fill-color
+Value: <>
+Initial: ''currentcolor''
+Applies to: all elements
+Inherited: yes
+Computed value: an RGBA color
+Percentages: N/A
+Media: visual
+Animation type: as color
+
+ +The '-webkit-text-fill-color' property defines the foreground fill color of an element's text +content. + +
+Here's an example showing '-webkit-text-fill-color' will always determine the +foreground fill color of an element's text. +
+.one {
+  color: blue;
+  /* the following can be omitted because it's the initial value:
+  -webkit-text-fill-color: currentcolor; */
+}
+
+.two {
+  color: red;
+  -webkit-text-fill-color: blue;
+}
+
+ +Elements with the one or two classes will have blue text. +
+ +
Text Stroke Color: the +'-webkit-text-stroke-color' property
+ +
+Name: -webkit-text-stroke-color
+Value: <>
+Initial: ''currentcolor''
+Applies to: all elements
+Inherited: yes
+Computed value: an RGBA color
+Percentages: N/A
+Media: visual
+Animation type: as color
+
+ +The '-webkit-text-stroke-color' property specifies a stroke color for an element's text. + +
Text Stroke Thickness: the +'-webkit-text-stroke-width' property
+ +
+Name: -webkit-text-stroke-width
+Value: <>
+Initial: 0
+Applies to: all elements
+Inherited: yes
+Computed value: absolute length
+Percentages: N/A
+Media: visual
+Animation type: discrete
+
+ +The '-webkit-text-stroke-width' property specifies the width of the stroke drawn at the edge of each +glyph of an element's text. A zero value results in no stroke being painted. A negative value is +invalid. + +
Text Stroke Shorthand: the +'-webkit-text-stroke' property
+ +
+Name: -webkit-text-stroke
+Value: <> || <>
+Initial: See individual properties
+Applies to: See individual properties
+Inherited: yes
+Computed value: See individual properties
+Percentages: N/A
+Media: visual
+Animation type: See individual properties
+
+ +The '-webkit-text-stroke' property is a shorthand property for setting the stroke width and stroke +color of an element's text. + +
+Here are two examples showing how to use the longhand and shorthand '-webkit-text-stroke' +properties to achieve white text with a black stroked text effect. +
+.stroked-text-longhand {
+  color: #fff;
+  -webkit-text-stroke-color: #000;
+  -webkit-text-stroke-width: 1px;
+}
+
+.stroked-text-shorthand {
+  -webkit-text-fill-color: #fff;
+  -webkit-text-stroke: thin #000;
+}
+
+ +The element
<p class="stroked-text-longhand">Serious typography</p>
would be +rendered as follows: + +image of stroked text +
+ +

CSS Property values

+ +

Additional touch-action values

+ +This section augments the +definition of touch-action from [[!pointerevents2]] to +add the pinch-zoom value. + +
+Name: touch-action
+Value: auto | none | [ [ pan-x | pan-left | pan-right ] || [ pan-y | pan-up | pan-down ] || pinch-zoom ] | manipulation
+Initial: auto
+Applies to: all elements except: non-replaced inline elements, table rows, row groups, table columns, and column groups.
+Inherited: no
+Computed value: Same as specified value
+Percentages: N/A
+Media: visual
+Animation type: not animatable
+
+ +When specified, the pinch-zoom token enables multi-finger panning and zooming of the page. +For zooming to occur, all fingers must start on an element that has the pinch-zoom behavior enabled +(via one of the pinch-zoom, manipulation, or auto values on itself +or an ancestor). + +
Scenarios like image carousels which wish to disable only horizontal panning can use "touch-action: pan-y pinch-zoom" +to avoid disabling zooming unnecessarily.
+ +manipulation is an alias for "pan-x pan-y pinch-zoom". + +

DOM Compatibility

+ +

The WebKitCSSMatrix interface

+ +
{{WebKitCSSMatrix}} is now defined by the DOM Geometry specification. [[!geometry-1]].
+ +

window.orientation API

+ +
+partial interface Window {
+    readonly attribute short orientation;
+    attribute EventHandler onorientationchange;
+};
+
+partial interface HTMLBodyElement {
+    attribute EventHandler onorientationchange;
+};
+
+ +When getting the orientation attribute, the user agent must run the following steps: + +1. Return the responsible document's current window.orientation angle. + +Whenever the viewport is drawn at a different angle compared to the device's natural orientation, the user agent must run the following steps: + +1. Fire an event named orientationchange at the {{Window}} object of the active document. + +User agents implementing the window.orientation attribute and its associated orientationchange event must not expose them on Desktop platforms. + +
iOS Safari also fires an orientationchange event on the <{body}> element, but other implementations do not, suggesting it's not necessary for compatibility with the web.
+ +

window.orientation angle

+ +The possible values for the window.orientation angle are: -90, 0, 90, 180. User agents must support the -90, 0 and 90 values and may optionally support 180. + +

0 represents the natural orientation. -90 represents a rotation 90 degrees clockwise from the natural orientation. 90 represents a rotation 90 degrees counterclockwise from the natural orientation. 180 represents a rotation 180 degrees from the natural orientation. +

+ +In order to determine the current window.orientation angle, the user agent must run the following steps: + +
    +
  1. Return the result of step 3 of the {{ScreenOrientation}}'s update the orientation information algorithm with the following changes: +
      +
    1. If the orientation angle is less than or equal to 180, return the orientation angle +
    2. If the orientation angle is greater than 180, return the orientation angle - 360. +
    3. If the resulting orientation angle is 180 and the user agent does not support that value, return 0. + +
    +
  2. +
+ +

Event Handlers on {{Window}} objects and <{body}> elements

+ +The following are the event handlers and their corresponding event handler event types that must be supported on all {{Window}} objects and <{body}> elements as attributes: + + + + + + + + + + + + + + +
event handlerevent handler event type
+ {{Window/onorientationchange}} + + orientationchange +
+ +
+WebKit also has this on HTMLFrameSetElement. It's unclear if this is needed for compatibility. +
+ +

Acknowledgements

+Thanks to Alan Cutter, Cameron McCormack, Chris Rebert, Chun-Min (Jeremy) Chen, Daniel Holbert, David Håsäther, Domenic Denicola, hexalys, Jean-Yves Perrier, Jacob Rossi, Philip Jägenstedt, Rick Byers, Simon Pieters, Stanley Stuart, William Chen and Your Name Here for feedback and contributions to this standard. + +Thanks to Mounir Lamouri and Marcos Cáceres for defining the {{ScreenOrientation}} interface. [[!screen-orientation]] + +Special thanks to Apple and the WebKit.org blog authors for providing initial descriptions of much of the content defined in this specification. + +This standard is written by +Mike Taylor +(Google, +miketaylr@google.com).