Bug 104035

Summary: Support text-orientation: sideways-right (and sideways when it maps to sideways-right)
Product: WebKit Reporter: mitz
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: allan.jensen, cmarcelo, darin, dglazkov, eric, hyatt, macpherson, menard, ojan, webkit.review.bot
Priority: P2 Keywords: InRadar, WebExposed
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Work in progress
none
Add text-orientation: sideways-right support
andersca: review+, webkit.review.bot: commit-queue-
Add text-orientation: sideways-right support
none
Add text-orientation: sideways-right support none

Description mitz 2012-12-04 13:37:49 PST
<rdar://problem/12754101>

As specified in <http://dev.w3.org/csswg/css3-writing-modes/>, the text-orientation property accepts the values sideways-right and sideways. The latter maps to sideways-right in vertical-rl writing mode. text-orientation: sideways-right should cause text to be set as if in a horizontal layout, but rotated 90° clockwise.
Comment 1 mitz 2012-12-04 13:39:19 PST
Created attachment 177541 [details]
Work in progress
Comment 2 Dave Hyatt 2012-12-04 13:53:44 PST
Comment on attachment 177541 [details]
Work in progress

Patch looks fine to me. I'm not a fan of fall-through case statements, but it looks ok.
Comment 3 mitz 2012-12-04 17:54:11 PST
Created attachment 177627 [details]
Add text-orientation: sideways-right support
Comment 4 WebKit Review Bot 2012-12-04 17:58:10 PST
Attachment 177627 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/fast..." exit_code: 1
Source/WebCore/rendering/style/RenderStyle.h:1303:  The parameter name "textOrientation" adds no information, so it should be removed.  [readability/parameter_name] [5]
Source/WebCore/rendering/style/RenderStyle.h:1473:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
Total errors found: 2 in 24 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Anders Carlsson 2012-12-04 18:19:10 PST
Comment on attachment 177627 [details]
Add text-orientation: sideways-right support

Looks good, but you should fix the style violations that make sense.
Comment 6 WebKit Review Bot 2012-12-04 18:20:15 PST
Comment on attachment 177627 [details]
Add text-orientation: sideways-right support

Attachment 177627 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/15157124
Comment 7 mitz 2012-12-04 18:40:29 PST
Created attachment 177641 [details]
Add text-orientation: sideways-right support
Comment 8 mitz 2012-12-04 18:42:28 PST
Created attachment 177642 [details]
Add text-orientation: sideways-right support
Comment 9 mitz 2012-12-04 22:16:26 PST
Comment on attachment 177642 [details]
Add text-orientation: sideways-right support

This patch differs from attachment 177627 [details] only in that the style issues and build failure were fixed, so I am going to land it with Anders’s review.
Comment 10 mitz 2012-12-04 22:19:35 PST
Committed as <http://trac.webkit.org/r136640>.
Comment 11 Darin Adler 2012-12-06 10:06:15 PST
Comment on attachment 177642 [details]
Add text-orientation: sideways-right support

View in context: https://bugs.webkit.org/attachment.cgi?id=177642&action=review

> Source/WebCore/rendering/style/RenderStyle.h:1801
> +    if (compareEqual(rareInheritedData->m_textOrientation, textOrientation))

What is the compareEqual function? I never heard of that before.
Comment 12 mitz 2012-12-06 10:16:13 PST
(In reply to comment #11)
> (From update of attachment 177642 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=177642&action=review
> 
> > Source/WebCore/rendering/style/RenderStyle.h:1801
> > +    if (compareEqual(rareInheritedData->m_textOrientation, textOrientation))
> 
> What is the compareEqual function? I never heard of that before.

It’s a function template that casts the right hand side to the left hand side’s type (we used unsigned for many of the StyleRareInheritedData data members, for reasons that involve MSVC if I remember correctly). It’s used in the SET_VAR macro, and the above use is similar to an expansion of that macro.

Anyway, the reason I used it here was that I was following a pattern.
Comment 13 Darin Adler 2012-12-06 10:36:00 PST
Thanks for explaining!