Bug 67625 - Clean up CSSPropertyTextDecoration implementation and ETextDecoration usage.
Summary: Clean up CSSPropertyTextDecoration implementation and ETextDecoration usage.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Luke Macpherson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-05 20:43 PDT by Luke Macpherson
Modified: 2011-10-12 15:50 PDT (History)
4 users (show)

See Also:


Attachments
Patch (8.44 KB, patch)
2011-09-05 20:50 PDT, Luke Macpherson
no flags Details | Formatted Diff | Diff
Patch (8.45 KB, patch)
2011-09-05 21:48 PDT, Luke Macpherson
no flags Details | Formatted Diff | Diff
Patch (8.62 KB, patch)
2011-09-05 22:48 PDT, Luke Macpherson
no flags Details | Formatted Diff | Diff
Patch (8.68 KB, patch)
2011-09-19 18:46 PDT, Luke Macpherson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Luke Macpherson 2011-09-05 20:43:36 PDT
Clean up CSSPropertyTextDecoration implementation and ETextDecoration usage.
Comment 1 Luke Macpherson 2011-09-05 20:50:16 PDT
Created attachment 106381 [details]
Patch
Comment 2 WebKit Review Bot 2011-09-05 20:51:47 PDT
Attachment 106381 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1

Source/WebCore/ChangeLog:10:  Need whitespace between colon and description  [changelog/filechangedescriptionwhitespace] [5]
Source/WebCore/ChangeLog:11:  Need whitespace between colon and description  [changelog/filechangedescriptionwhitespace] [5]
Source/WebCore/ChangeLog:12:  Need whitespace between colon and description  [changelog/filechangedescriptionwhitespace] [5]
Total errors found: 3 in 6 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 WebKit Review Bot 2011-09-05 21:09:54 PDT
Comment on attachment 106381 [details]
Patch

Attachment 106381 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/9592716
Comment 4 Early Warning System Bot 2011-09-05 21:11:36 PDT
Comment on attachment 106381 [details]
Patch

Attachment 106381 [details] did not pass qt-ews (qt):
Output: http://queues.webkit.org/results/9591742
Comment 5 Gyuyoung Kim 2011-09-05 21:21:28 PDT
Comment on attachment 106381 [details]
Patch

Attachment 106381 [details] did not pass efl-ews (efl):
Output: http://queues.webkit.org/results/9595437
Comment 6 Luke Macpherson 2011-09-05 21:48:22 PDT
Created attachment 106388 [details]
Patch
Comment 7 Early Warning System Bot 2011-09-05 22:00:39 PDT
Comment on attachment 106388 [details]
Patch

Attachment 106388 [details] did not pass qt-ews (qt):
Output: http://queues.webkit.org/results/9594508
Comment 8 WebKit Review Bot 2011-09-05 22:06:09 PDT
Comment on attachment 106388 [details]
Patch

Attachment 106388 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/9595443
Comment 9 Gyuyoung Kim 2011-09-05 22:13:35 PDT
Comment on attachment 106388 [details]
Patch

Attachment 106388 [details] did not pass efl-ews (efl):
Output: http://queues.webkit.org/results/9590838
Comment 10 Luke Macpherson 2011-09-05 22:48:42 PDT
Created attachment 106390 [details]
Patch
Comment 11 WebKit Review Bot 2011-09-05 22:51:41 PDT
Attachment 106390 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1

Source/WebCore/rendering/style/RenderStyleConstants.h:343:  Missing spaces around |  [whitespace/operators] [3]
Total errors found: 1 in 6 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 12 Luke Macpherson 2011-09-05 22:55:13 PDT
The style error is because it's picking up on the operator| function name.
Comment 13 Ryosuke Niwa 2011-09-14 21:46:28 PDT
Comment on attachment 106390 [details]
Patch

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

> Source/WebCore/rendering/style/RenderStyle.h:195
> -        unsigned _text_decorations : 4;
> +        ETextDecoration _text_decorations : ETextDecorationBits;

This is going to hit a bug in Visual C++.

> Source/WebCore/rendering/style/RenderStyleConstants.h:339
> +static const size_t ETextDecorationBits = 4;

I like this.
Comment 14 Luke Macpherson 2011-09-15 20:48:22 PDT
Comment on attachment 106390 [details]
Patch

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

>> Source/WebCore/rendering/style/RenderStyle.h:195
>> +        ETextDecoration _text_decorations : ETextDecorationBits;
> 
> This is going to hit a bug in Visual C++.

For my own education, could I have a pointer to the details? The build bot seems happy, but I'm not familiar with Visual C++.
Comment 15 Darin Adler 2011-09-15 23:00:45 PDT
Microsoft’s compiler creates signed bitfields for enum types, and that causes problems with bitfields that are perfectly sized to hold an enum. Because of that, WebKit uses the type "unsigned" for bitfields instead of the actual enum type.

I found an old bug report about this <http://connect.microsoft.com/VisualStudio/feedback/details/100849/enum-bitfield-treated-incorrectly-as-integer> but haven’t found any definitive information that is newer.
Comment 16 Darin Adler 2011-09-15 23:01:33 PDT
We discovered this the hard way, after a lot of debugging, when porting Safari and WebKit to Windows.
Comment 17 Luke Macpherson 2011-09-19 17:41:18 PDT
(In reply to comment #16)
> We discovered this the hard way, after a lot of debugging, when porting Safari and WebKit to Windows.

Interesting, thanks for the explanation.
Did anyone try the workaround suggested in that link?
For example:
enum ETextDecoration : unsigned {
    TDNONE = 0x0 , UNDERLINE = 0x1, OVERLINE = 0x2, LINE_THROUGH= 0x4, BLINK = 0x8
};
Comment 18 Luke Macpherson 2011-09-19 17:47:39 PDT
(In reply to comment #17)
> (In reply to comment #16)
> > We discovered this the hard way, after a lot of debugging, when porting Safari and WebKit to Windows.
> 
> Interesting, thanks for the explanation.
> Did anyone try the workaround suggested in that link?
> For example:
> enum ETextDecoration : unsigned {
>     TDNONE = 0x0 , UNDERLINE = 0x1, OVERLINE = 0x2, LINE_THROUGH= 0x4, BLINK = 0x8
> };

Hmm, seems gcc doesn't allow that anyway, so back to unsigned storage it is. It would have been nice not to have to sacrifice type safety.
Comment 19 Luke Macpherson 2011-09-19 18:46:20 PDT
Created attachment 107954 [details]
Patch
Comment 20 WebKit Review Bot 2011-09-19 18:48:50 PDT
Attachment 107954 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1

Source/WebCore/rendering/style/RenderStyleConstants.h:343:  Missing spaces around |  [whitespace/operators] [3]
Total errors found: 1 in 6 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 21 Luke Macpherson 2011-10-05 15:26:25 PDT
Just wanted to ping this patch. Still hoping for a review.
Comment 22 Eric Seidel (no email) 2011-10-11 23:21:49 PDT
Comment on attachment 107954 [details]
Patch

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

> Source/WebCore/rendering/style/RenderStyleConstants.h:339
> +static const size_t ETextDecorationBits = 4;

If we don't need this broken out like this, I think it's better to not use a constant here.  It makes it more difficult to tell how large RenderSTyle is.

> Source/WebCore/rendering/style/StyleVisualData.h:52
> +    unsigned textDecoration : ETextDecorationBits; // Text decorations defined *only* by this element.

I see, you want to re-use it here.  OK.
Comment 23 WebKit Review Bot 2011-10-12 15:50:25 PDT
Comment on attachment 107954 [details]
Patch

Clearing flags on attachment: 107954

Committed r97314: <http://trac.webkit.org/changeset/97314>
Comment 24 WebKit Review Bot 2011-10-12 15:50:30 PDT
All reviewed patches have been landed.  Closing bug.