Summary: | CSS transform doesn’t apply to inline elements | ||
---|---|---|---|
Product: | WebKit | Reporter: | Oli Studholme <webkit.org> |
Component: | CSS | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED CONFIGURATION CHANGED | ||
Severity: | Normal | CC: | ahmad.saleem792, anewpage.media, dino, eoconnor, igor.oliveira, phiw2, shanestephens, simon.fraser, thomas |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | Mac (Intel) | ||
OS: | OS X 10.6 | ||
URL: | http://jsfiddle.net/boblet/HY47L/ | ||
Attachments: |
Description
Oli Studholme
2011-04-19 23:09:15 PDT
Same results on iPad 2, iOS 4.3.2, inline star doesn't rotate. duh, obviously that's the reason for filing this bug :) Thanks for the iOS check Thomas, and the link Dean! Following up from Dean, the relevant text in the link is: “I propose that CSS Transforms be limited to block-level elements, and inline elements that are never split into multiple boxes (i.e. replaced elements, inline-block and inline-table)” The spec change mentioned in the link is: “Applies to: block-level and atomic inline-level elements” http://dev.w3.org/csswg/css3-2d-transforms/#transform-property As I should have mentioned the workaround for transforming inline elements is to use display: inline-block;. However, single characters would qualify as atomic, so even in the editor’s draft I still think this is a bug ;) From the CSS 2.1 spec (http://www.w3.org/TR/CSS2/visuren.html#inline-boxes): "An inline box is one that is both inline-level and whose contents participate in its containing inline formatting context. A non-replaced element with a 'display' value of 'inline' generates an inline box. Inline-level boxes that are not inline boxes (such as replaced inline-level elements, inline-block elements, and inline-table elements) are called atomic inline-level boxes because they participate in their inline formatting context as a single opaque box." <span> is inline-level (display: inline), non-replaced (not an img or embedded document), and therefore an inline box (non-replaced + display: inline). Regardless of whether the content is a single character, <span> is therefore not atomic (it is an inline box). So this is not a bug in the editor's draft :) If the spec says that inline elements should not be transformed, then the spec is wrong. I need to be able to apply transforms to individual letters in the context of words which comply to line wrapping rules. Setting inline-block on a single letter (or series of letters) screws that up entirely. Please fix this ASAP (both the draft and Webkit). (In reply to comment #6) > If the spec says that inline elements should not be transformed, then the spec is wrong. Please participate in the discussion on the www-style mailing list if you have feedback on the spec. Created attachment 95714 [details]
Demonstration of isolating characters in inline-block so that transforms can be applied
However, this doesn't work correctly with line wrapping. There should be a way to make it work though. Created attachment 95715 [details]
Demonstration of isolating characters in inline-block so that transforms can be applied (2)
This version wraps the word itself in an inline-block span so that it doesn't break across lines. I'm pretty sure this is exactly the use case that Brian claims is broken - Brian does this do what you want it to?
I am not able to reproduce this bug in all test cases: No-wrap example - work same in all browsers (Safari 16, Chrome Canary 108 and Firefox Nightly 107) and show "lifted" as twisted word. Wrap example - work same in all browsers (Safari 16, Chrome Canary 108 and Firefox Nightly 107) and show "lifted" as twisted word. JSFiddle - Same across all browsers as well and only one start (light pink) is tilted. I am marking this as "RESOLVED CONFIGURATION CHANGED" since all browsers now render this same. Please reopen, if this is reproducible or my testing is flawed or I missed something. Thanks! |