Comparison of layout engines (CSS)
Encyclopedia : C : CO : COM : Comparison of layout engines (CSS)
The following tables compare CSS compatibility and support for a number of layout engines. Please see the individual products' articles for further information. This article is not all-inclusive or necessarily up-to-date. Unless otherwise specified in footnotes, comparisons are based on the stable versions without any add-ons, extensions or external programs.
Version number, if possible, is provided for feature that is fully supported (based on CSS2.1, unless it is a CSS3 feature). Proprietary extensions are not included. Notice that some CSS2 features was removed in CSS 2.1 because they proved too hard to implement. In the tables below they still figure under CSS2 unless they have resurfaced in a CSS3 module.
- 1 General overview
- 2 Grammar and rules
- 2.1 CSS 2.1 notes
- 2.2 Trident grammar and rule notes
- 2.3 Tasman grammar and rule notes
- 2.4 Presto grammar and rule notes
- 3 Selectors
- 4 Properties
- 4.1 CSS 2.1 notes
- 4.2 Trident property notes
- 4.3 Gecko property notes
- 4.4 WebCore property notes
- 4.5 KHTML property notes
- 4.6 Presto property notes
- 4.7 iCab property notes
- 4.8 CSS2 aural style sheets notes
- 5 Values and units
- 6 General notes
- 7 References
- 8 See also
- 9 External links
Engine Nomenclature
Trident is the layout engine used in Internet Explorer for Windows. Tasman is used in Internet Explorer for Macintosh, Gecko in all Mozilla software, WebCore provides the HTML layout engine for Mac OS X, KHTML for KDE, Presto for Opera and iCab is a browser for the Mac.General overview
| Trident | Tasman | Gecko | WebCore | KHTML | Presto | iCab | |
|---|---|---|---|---|---|---|---|
| CSS1 | style="background: #ddffdd" | | style="background: #ddffdd" | | |||||
| CSS2 (2.1) | |||||||
| CSS3 | |||||||
| Trident | Tasman | Gecko | WebCore | KHTML | Presto | iCab |
Grammar and rules
| Trident | Tasman | Gecko | WebCore | KHTML | Presto | iCab | |||
|---|---|---|---|---|---|---|---|---|---|
| CSS1 | !important | Weight increasing | |||||||
| /*Comment*/ | Comments | ||||||||
| @import | Import stylesheet | ||||||||
| CSS2 | @charset | Character set | ? | ||||||
| @media | Media-specific rules | ||||||||
| @page | For paged media | ||||||||
| @font-face | Define font | ||||||||
| CSS3 | @namespace | Namespace declaration | |||||||
| Trident | Tasman | Gecko | WebCore | KHTML | Presto | iCab | |||
CSS 2.1 notes
- @font-face removed in CSS 2.1
- @charset removed in CSS 2.1
Trident grammar and rule notes
- @font-face — Only supports Embedded OpenType (.eot) font format, does not understand the format() identifier.
- !important — !important doesn't override rules defined in the same stylesheet.
Tasman grammar and rule notes
- @font-face — Versions 5.16 and 5.17 will download fonts specified but not use them. 5.23 no longer downloads the font.
Presto grammar and rule notes
- @import — Whilst Gecko, WebCore and iCab download all media stylesheets immediately, Opera only downloads handheld, print, projection and screen media. Text browser emulation mode is only a user stylesheet, so it does not switch to tty media type. This is consistent with older text browsers, which do not respect any CSS.
Selectors
| Trident | Tasman | Gecko | WebCore | KHTML | Presto | iCab | |||
|---|---|---|---|---|---|---|---|---|---|
| Element selectors | |||||||||
| CSS1 | | Universal | |||||||
| E | Element | ||||||||
| E.class | Class | ||||||||
| E#id | ID | ||||||||
| CSS2 | ns|E | Namespaced | |||||||
| Relationship selectors | |||||||||
| CSS1 | E F | Descendant | |||||||
| CSS2 | E > F | Child | |||||||
| E + F | Direct adjacent | ||||||||
| CSS3 | E ~ F | Indirect adjacent | |||||||
| Attribute selectors | |||||||||
| CSS2 | E[attr] | Has | |||||||
| E[attr="value"] | Equals | ||||||||
| E[attr~="value"] | Contains (space-separated) | ||||||||
| E[attr|="value"] | Contains (hyphen-separated) | ||||||||
| CSS3 | E[attr^="value"] | Begins with | |||||||
| E[attr$="value"] | Ends with | ||||||||
| E[attr*="value"] | Contains substring | ||||||||
| E[ns|attr] | Namespaced | ||||||||
| Pseudo-classes | |||||||||
| CSS1 | E:link | Unvisited hyperlink | |||||||
| E:visited | Visited hyperlink | ||||||||
| E:active | Active | ||||||||
| CSS2 | E:hover | Mouseover | |||||||
| E:focus | Focused | ||||||||
| E:first-child | First child | ||||||||
| E:lang() | Language | ||||||||
| @page:first | First page | ||||||||
| @page:left | Left page | ||||||||
| @page:right | Right page | ||||||||
| CSS3 | E:root | Root | |||||||
| E:last-child | Last child | ||||||||
| E:first-of-type | First child of type | ||||||||
| E:last-of-type | Last child of type | ||||||||
| E:only-child | Only child | ||||||||
| E:only-of-type | Only child of type | ||||||||
| E:nth-child | Nth child | ||||||||
| E:nth-last-child | Nth last child | ||||||||
| E:nth-of-type | Nth child of type | ||||||||
| E:nth-last-of-type | Nth last child of type | ||||||||
| E:target | Target | ||||||||
| E:empty | Empty | ||||||||
| E:contains() | Contains | ||||||||
| E:not() | Negation | ||||||||
| E:enabled | Enabled state | ||||||||
| E:disabled | Disabled state | ||||||||
| E:checked | Checked state | ||||||||
| E:indeterminate | Indeterminate state | ||||||||
| E:default | Default | ||||||||
| E:valid | Valid | ||||||||
| E:invalid | Invalid | ||||||||
| E:in-range | In range | ||||||||
| E:out-of-range | Out of range | ||||||||
| E:required | Required | ||||||||
| E:optional | Optional | ||||||||
| E:read-only | Read-only | ||||||||
| E:read-write | Read and write | ||||||||
| Pseudo-elements | |||||||||
| CSS1 | E:first-letter | First letter | |||||||
| E:first-line | First line | ||||||||
| CSS2 | E:before | Before | |||||||
| E:after | After | ||||||||
| CSS3 | E::pseudo-element | Double colon notation | |||||||
| E::selection | Selection | ||||||||
| Trident | Tasman | Gecko | WebCore | KHTML | Presto | iCab | |||
Trident selector notes
- :hover — Prior to 7.0 Beta 2 Preview,
:hoveris for anchor element only. - .one.two — only
.twoclass selector is taken into consideration.
Tasman selector notes
- :hover — For anchor element only.
- .one.two — only
.twoclass selector is taken into consideration.
WebCore selector notes
- :hover — Fails to trigger when over empty table cells. Fails to trigger when
:link:hoveror:visited:hoverare used. (CSS2, :hover is not longer mutually exclusive with:linkand:visited.) - :target — Only detected when explicitly present on element being tested, attribute not inherited.
- :target — Style doesn't get applied when navigating using back and forward buttons.
- :last-child & :last-of-type — will match all siblings, or all siblings of the same type, respectivly.
- :only-child & :only-of-type — identical behaviour to
:first-child&:first-of-type. - ::pseudo-element — Mistakenly also triggers on
::pseudo-classprior to version 416.0.
Properties
| Trident | Tasman | Gecko | WebCore | KHTML | Presto | iCab | ||
|---|---|---|---|---|---|---|---|---|
| Box model | ||||||||
| CSS1 | border | |||||||
| border-color | ||||||||
| border-style | ||||||||
| border-width | ||||||||
| border-top | ||||||||
| border-top-width | ||||||||
| border-right | ||||||||
| border-right-width | ||||||||
| border-bottom | ||||||||
| border-bottom-width | ||||||||
| border-left | ||||||||
| border-left-width | ||||||||
| margin | ||||||||
| margin-top | ||||||||
| margin-right | ||||||||
| margin-bottom | ||||||||
| margin-left | ||||||||
| padding | ||||||||
| padding-top | ||||||||
| padding-right | ||||||||
| padding-bottom | ||||||||
| padding-left | ||||||||
| CSS2 | border-top-color | |||||||
| border-top-style | ||||||||
| border-right-style | ||||||||
| border-right-color | ||||||||
| border-bottom-color | ||||||||
| border-bottom-style | ||||||||
| border-left-color | ||||||||
| border-left-style | ||||||||
| CSS3 | border-radius | |||||||
| box-sizing | ||||||||
| Visual formatting model | ||||||||
| CSS1 | width | |||||||
| height | ||||||||
| float | ||||||||
| clear | ||||||||
| line-height | ||||||||
| vertical-align | ||||||||
| CSS2 | min-width | |||||||
| max-width | ||||||||
| min-height | ||||||||
| max-height | ||||||||
| display | ||||||||
| position | ||||||||
| top | ||||||||
| right | ||||||||
| bottom | ||||||||
| left | ||||||||
| z-index | ||||||||
| direction | ||||||||
| unicode-bidi | ||||||||
| Generated content, automatic numbering, and lists | ||||||||
| CSS1 | list-style | |||||||
| list-style-image | ||||||||
| list-style-position | ||||||||
| list-style-type | ||||||||
| CSS2 | quotes | |||||||
| content | ||||||||
| counter-increment | ||||||||
| counter-reset | ||||||||
| Colors and backgrounds | ||||||||
| CSS1 | color | |||||||
| background | ||||||||
| background-attachment | ||||||||
| background-color | ||||||||
| background-image | ||||||||
| background-position | ||||||||
| background-repeat | ||||||||
| CSS3 | background-clip | |||||||
| background-origin | ||||||||
| Fonts | ||||||||
| CSS1 | font | |||||||
| font-family | ||||||||
| font-size | ||||||||
| font-style | ||||||||
| font-variant | ||||||||
| font-weight | ||||||||
| CSS2 | font-size-adjust | |||||||
| font-stretch | ||||||||
| Text | ||||||||
| CSS1 | text-align | |||||||
| text-decoration | ||||||||
| text-indent | ||||||||
| text-transform | ||||||||
| letter-spacing | ||||||||
| word-spacing | ||||||||
| white-space | ||||||||
| CSS2 | text-shadow | |||||||
| Visual effects | ||||||||
| CSS2 | clip | |||||||
| overflow | ||||||||
| visibility | ||||||||
| CSS3 | overflow-x | |||||||
| overflow-y | ||||||||
| opacity | ||||||||
| Tables | ||||||||
| CSS2 | border-collapse | |||||||
| border-spacing | ||||||||
| caption-side | ||||||||
| empty-cells | ||||||||
| speak-header | ||||||||
| table-layout | ||||||||
| User interface | ||||||||
| CSS2 | cursor | |||||||
| outline | ||||||||
| outline-color | ||||||||
| outline-style | ||||||||
| outline-width | ||||||||
| CSS3 | outline-offset | |||||||
| outline-radius | ||||||||
| Paged media | ||||||||
| CSS2 | marks | |||||||
| orphans | ||||||||
| page | ||||||||
| page-break-after | ||||||||
| page-break-before | ||||||||
| page-break-inside | ||||||||
| size | ||||||||
| widows | ||||||||
| Aural | ||||||||
| CSS2 | azimuth | |||||||
| cue | ||||||||
| cue-after | ||||||||
| cue-before | ||||||||
| elevation | ||||||||
| pause | ||||||||
| pause-after | ||||||||
| pause-before | ||||||||
| pitch | ||||||||
| pitch-range | ||||||||
| play-during | ||||||||
| speak | ||||||||
| speak-numeral | ||||||||
| speak-punctuation | ||||||||
| speech-rate | ||||||||
| stress | ||||||||
| richness | ||||||||
| voice-family | ||||||||
| volume | ||||||||
| CSS3 | -xv-voice-pitch | |||||||
| -xv-voice-pitch-range | ||||||||
| -xv-voice-rate | ||||||||
| -xv-voice-volume | ||||||||
| Ruby characters | ||||||||
| CSS3 | ruby-position | |||||||
| ruby-align | ||||||||
| ruby-overhang | ||||||||
| ruby-span | ||||||||
| Trident | Tasman | Gecko | WebCore | KHTML | Presto | iCab | ||
CSS 2.1 notes
- font-stretch was removed from CSS 2.1
- font-size-adjust was removed from CSS 2.1
- text-shadow was removed from CSS 2.1, but reintroduced in CSS 3 Text, then shelved again (until it has an evaluation[link]).
Trident property notes
- border-style —
dottedis rendered asdashed. - display — Only
none,block,inline,table-header-group, andtable-footer-groupare supported. - position — Prior to 7.0 Beta 2, fixed positioning is not supported.
- background-attachment — Prior to 7.0 Beta 2,
fixedis forbodyelement only. - background-position — Fixed positioning is not supported.
- font-weight — Incorrect rendering when
font-weightis 600 [link]. - text-decoration — Optional property
blinkis not supported.
Gecko property notes
- display —
run-in[link],inline-table[link], andinline-block[link] are not supported. - quotes — Does not support nested quotes prior to 1.8 [link].
- content — Only works with
:beforeand:after. Only support image.does not work prior to 1.8 [link]. - background-position — Problem handling a combination of keyword value and pixel or percentage value. [link]
- font-size-adjust — Supported in Windows only [link].
- white-space —
pre-lineis not supported.pre-wrapis only supported experimentally as-moz-pre-wrap;. - visibility —
collapseis not supported prior to 1.8. - border-radius — border curves are circular, but the W3C specs [link] define them as elliptical. Dashed curves are not available. Short-cut definitions for
border-radiusread "tl tr br bl" instead of the W3C's "tr br bl tl". Interesting bugs: [link] [link] [link]
WebCore property notes
- cursor — Custom cursors are not supported.
- font — The system font shorthands are not supported.
- font-variant — All supported from version 85 except
small-caps, which was added in version 125. - page-break-before; page-break-after — Only the
alwaysandautovalues are supported. - text-decoration — Optional property
blinkis not supported. - white-space —
pre-lineandpre-wrapare not supported. - text-shadow — Multiple shadows are not supported.
- visibility — All supported except for
collapse.
KHTML property notes
- khtml_overflow — Values
scrollandautoare unsupported. - page-break-before; page-break-after — Before 3.5 only the
alwaysandautovalues was supported. - text-decoration — Optional property
blinkis not supported. - visibility — All supported except for
collapse.
Presto property notes
- list-style-type — The CSS2 values are not supported prior to 8.0.
- counter-increment, counter-reset — Implemented the algorithm in REC CSS2.
- background-position — Problem handling a combination of keyword value and pixel or percentage value. [link]
- font-weight — Incorrect rendering when
font-weightis 600 [link]. - white-space —
pre-lineis not supported. - visibility — All supported except for
collapse.
iCab property notes
- display —
run-inis not supported. - text-align —
justifyis not supported. - visibility —
collapseonly partial. - caption-side —
topandbottomonly. - empty-cells — Compresses hidden rows but does not hide them completely.
CSS2 aural style sheets notes
- The aural style sheets introduced in CSS2 are deprecated in CSS2.1 [link]. The only know software that supports CSS2 Aural is EMACSpeak [link], an emacs-based speech browser. The popular screen-reader JAWS does not respect Aural CSS instructions. The CSS3 Speech module reuses some, but not all, of the properties.
Values and units
| Trident | Tasman | Gecko | WebCore | KHTML | Presto | iCab | |||
|---|---|---|---|---|---|---|---|---|---|
| Numbers | |||||||||
| CSS1 | | A floating-point number
| | |||||||
| | | ||||||||
| | | ||||||||
| CSS2 | | An integer
| | |||||||
| CSS3 | | | | |||||||
| | | ||||||||
| Strings | |||||||||
| CSS1 | | String
| | |||||||
| \code | Unicode escapes | ? | |||||||
| Shapes | |||||||||
| CSS2 | rect() | A rectangle | ? | ||||||
| Functions | |||||||||
| CSS1 | url() | Uniform Resource Identifier | ? | ||||||
| CSS3 | attr() | Attribute identifier | |||||||
| Colors | |||||||||
| CSS1 | color names | 16 predefined web colors | |||||||
| #rrggbb or #rgb | Hexadecimal notation | ||||||||
| rgb(r,g,b) | RGB notation | ||||||||
| CSS2 | system colors | 28 predefined system colors [link] | |||||||
| transparent | Full transparency | ? | |||||||
| CSS3 | rgba(r,g,b,a) | RGBA notation | |||||||
| Keywords | |||||||||
| CSS1 | auto | Automatically calculated | ? | ||||||
| CSS2 | inherit | Inherited from the parents | ? | ||||||
| Units | |||||||||
| CSS1 | px | Pixel | |||||||
| pt | Point | ||||||||
| pc | Pica | ||||||||
| cm | Centimetre | ||||||||
| mm | Millimetre | ||||||||
| in | inch | ||||||||
| em | em | ||||||||
| ex | ex | ||||||||
| % | Percentage | ||||||||
| CSS3 | deg | Degree | |||||||
| grad | Gradient | ||||||||
| rad | Radian | ||||||||
| ms | Millisecond | ||||||||
| s | Second | ||||||||
| Hz | Hertz | ||||||||
| kHz | Kilohertz | ||||||||
| Trident | Tasman | Gecko | WebCore | KHTML | Presto | iCab | |||
Trident value and unit notes
- auto — Does not work for
margins.
Presto value and unit notes
- attr() — As all URI attribute values are resolved to full URI, the value could be wrong if
attr()is used on an attribute that contains relative URI. - em — Quantization error for values greater than 20.47em [link].
- % — Floating point numbers are treated as integers when used in percentages.
KHTML value and unit notes
- rgba() — Because
opacityis not supported, the opacity value ofrgba()is ignored.
General notes
Gecko general notes
- -moz- — All experimental (and proprietary) selectors, properties and values are prefixed with "-moz-", e.g.
::-moz-selectioninstead of::selection[link].
WebCore general notes
- -webkit- — All proprietary selectors, properties and values are prefixed with "-webkit-", e.g.
-webkit-focus-ring-color.
KHTML general notes
- -khtml- — All experimental (and proprietary) selectors, properties and values are prefixed with "-khtml-", e.g.
-khtml-arabic-indic.
Presto general notes
- -o- — All proprietary selectors, properties and values are prefixed with "-o-", e.g.
-o-replace. - -wap- — All proprietary selectors, properties and values for Wireless CSS are prefixed with "-wap-", e.g.
-wap-accesskey. - -xv- — All new selectors, properties and values introduced by CSS3 Speech Module are prefixed with "-xv-" (but not found in CSS2 aural style sheets), e.g.
-xv-interpret-asinstead ofinterpret-as.
References
See also
- Comparison of layout engines
- Comparison of layout engines (HTML)
- Comparison of layout engines (XML)
- Comparison of layout engines (XHTML)
- Comparison of layout engines (graphics)
- Comparison of layout engines (DOM)
External links
- [Web browser CSS support] by David Hammond
- [CSS contents and browser compatibility]
- [CSS specification/browser support page: General Syntax]
- [MacEdition CSS Guides]
- [browser support for css1 & css2]
- [Third-party Mozilla support chart]
- [Assigning external CSS]
- [CSS Support in Opera]
From Wikipedia, the Free Encyclopedia. Original article here. Support Wikipedia by contributing or donating.
All text is available under the terms of the GNU Free Documentation License See Wikipedia Copyrights for details.
