Bug 75563 - remove CSSBorderImageValue
Summary: remove CSSBorderImageValue
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P3 Normal
Assignee: Alexis Menard (darktears)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-04 12:51 PST by Tony Chang
Modified: 2012-01-20 03:11 PST (History)
9 users (show)

See Also:


Attachments
Patch (27.57 KB, patch)
2012-01-16 10:22 PST, Alexis Menard (darktears)
no flags Details | Formatted Diff | Diff
Patch (27.68 KB, patch)
2012-01-16 11:24 PST, Alexis Menard (darktears)
no flags Details | Formatted Diff | Diff
Patch (33.78 KB, patch)
2012-01-18 03:01 PST, Alexis Menard (darktears)
no flags Details | Formatted Diff | Diff
Patch (39.29 KB, patch)
2012-01-19 08:50 PST, Alexis Menard (darktears)
no flags Details | Formatted Diff | Diff
Patch for landing (39.29 KB, patch)
2012-01-20 02:23 PST, Alexis Menard (darktears)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tony Chang 2012-01-04 12:51:04 PST
border-image is a CSS shorthand but has a custom CSSValue.  This was because it became a shorthand at the last minute and done to maintain backwards compat with -webkit-border-image.

We could get rid of CSSBorderImageValue as long as we maintain that getComputedStyle for -webkit-border-image still works. This would involve some rewriting/refactoring of the parsing code for -webkit-border-image and border-image.
Comment 1 Alexis Menard (darktears) 2012-01-16 03:48:42 PST
I'll take that one if nobody object.
Comment 2 Alexis Menard (darktears) 2012-01-16 10:22:10 PST
Created attachment 122661 [details]
Patch
Comment 3 Gustavo Noronha (kov) 2012-01-16 10:32:32 PST
Comment on attachment 122661 [details]
Patch

Attachment 122661 [details] did not pass gtk-ews (gtk):
Output: http://queues.webkit.org/results/11254242
Comment 4 Gyuyoung Kim 2012-01-16 11:10:48 PST
Comment on attachment 122661 [details]
Patch

Attachment 122661 [details] did not pass efl-ews (efl):
Output: http://queues.webkit.org/results/11255247
Comment 5 Alexis Menard (darktears) 2012-01-16 11:24:41 PST
Created attachment 122666 [details]
Patch
Comment 6 WebKit Review Bot 2012-01-16 11:29:18 PST
Attachment 122666 [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/css/CSSStyleSelector.cpp:36:  Alphabetical sorting problem.  [build/include_order] [4]
Total errors found: 1 in 6 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 7 Alexis Menard (darktears) 2012-01-16 11:31:23 PST
(In reply to comment #6)
> Attachment 122666 [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/css/CSSStyleSelector.cpp:36:  Alphabetical sorting problem.  [build/include_order] [4]
> Total errors found: 1 in 6 files
> 
> 
> If any of these errors are false positives, please file a bug against check-webkit-style.

I kept it grouped despite the order being wrong originally.
Comment 8 Tony Chang 2012-01-17 11:29:23 PST
Comment on attachment 122666 [details]
Patch

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

I think you're missing the file deletes.

> Source/WebCore/css/CSSComputedStyleDeclaration.cpp:508
> +        RefPtr<CSSValueList> listSlash = CSSValueList::createSlashSeparated();
> +        if (imageSlices)
> +            listSlash->append(imageSlices.release());

The existing test doesn't seem to include test cases for this slash separated list.  Can you add some test cases before this change to make sure we're not breaking anything?

Hyatt made it sound like getComputedStyle on webkit-border-image may be different from getComputedStyle on border-image.

> Source/WebCore/css/CSSParser.cpp:5404
> +            list->append(m_repeat);
> +        return list.release();

It looks like this still creates a persistent value for the border-image instead of being a shorthand (i.e., setting the specific properties instead of setting border-image).  In the long run, I think we want this to just set the specific properties, but this is OK for now.
Comment 9 Alexis Menard (darktears) 2012-01-17 11:48:13 PST
Comment on attachment 122666 [details]
Patch

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

>> Source/WebCore/css/CSSComputedStyleDeclaration.cpp:508
>> +            listSlash->append(imageSlices.release());
> 
> The existing test doesn't seem to include test cases for this slash separated list.  Can you add some test cases before this change to make sure we're not breaking anything?
> 
> Hyatt made it sound like getComputedStyle on webkit-border-image may be different from getComputedStyle on border-image.

It seems like according to what I found on google that you can only have one / in the shorthand.

http://developer.apple.com/library/safari/#documentation/appleapplications/reference/SafariCSSRef/Articles/StandardCSSProperties.html

So yes I can add a test case first with the slash to make sure we don't break anything before this patch.

>> Source/WebCore/css/CSSParser.cpp:5404
>> +        return list.release();
> 
> It looks like this still creates a persistent value for the border-image instead of being a shorthand (i.e., setting the specific properties instead of setting border-image).  In the long run, I think we want this to just set the specific properties, but this is OK for now.

Definitively possible as a following patch.
Comment 10 Alexis Menard (darktears) 2012-01-17 12:22:19 PST
(In reply to comment #9)
> (From update of attachment 122666 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=122666&action=review
> 
> >> Source/WebCore/css/CSSComputedStyleDeclaration.cpp:508
> >> +            listSlash->append(imageSlices.release());
> > 
> > The existing test doesn't seem to include test cases for this slash separated list.  Can you add some test cases before this change to make sure we're not breaking anything?
> > 
> > Hyatt made it sound like getComputedStyle on webkit-border-image may be different from getComputedStyle on border-image.
> 
> It seems like according to what I found on google that you can only have one / in the shorthand.
> 

https://bugs.webkit.org/show_bug.cgi?id=76473 is adding more tests.

> http://developer.apple.com/library/safari/#documentation/appleapplications/reference/SafariCSSRef/Articles/StandardCSSProperties.html
> 
> So yes I can add a test case first with the slash to make sure we don't break anything before this patch.
> 
> >> Source/WebCore/css/CSSParser.cpp:5404
> >> +        return list.release();
> > 
> > It looks like this still creates a persistent value for the border-image instead of being a shorthand (i.e., setting the specific properties instead of setting border-image).  In the long run, I think we want this to just set the specific properties, but this is OK for now.
> 
> Definitively possible as a following patch.
Comment 11 Alexis Menard (darktears) 2012-01-18 03:01:29 PST
Created attachment 122897 [details]
Patch
Comment 12 WebKit Review Bot 2012-01-18 03:05:10 PST
Attachment 122897 [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/css/CSSStyleSelector.cpp:36:  Alphabetical sorting problem.  [build/include_order] [4]
Total errors found: 1 in 6 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 13 Tony Chang 2012-01-18 12:45:57 PST
Comment on attachment 122897 [details]
Patch

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

> Source/WebCore/css/CSSComputedStyleDeclaration.cpp:505
> +    RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
> +    list->append(imageValue.release());
> +
> +    if (borderSlices || outset) {

This code appears to be duplicated in CSSParser.cpp.  Can we make a helper function for it?  Maybe put it in CSSBorderImageValue.* for now.  In the long run, I think we want to get rid of the code in CSSParser.cpp and then can move the code into CSSComputedStyleDeclaration.cpp.

> Source/WebCore/css/CSSStyleSelector.cpp:4326
> +            // Set the appropriate rules for stretch/round/repeat of the slices

Nit: add a period.
Comment 14 Alexis Menard (darktears) 2012-01-19 08:50:05 PST
Created attachment 123137 [details]
Patch
Comment 15 WebKit Review Bot 2012-01-19 08:51:56 PST
Attachment 123137 [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/css/CSSStyleSelector.cpp:36:  Alphabetical sorting problem.  [build/include_order] [4]
Total errors found: 1 in 15 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 16 Alexis Menard (darktears) 2012-01-19 08:55:46 PST
(In reply to comment #14)
> Created an attachment (id=123137) [details]
> Patch

Tony, I'm working already on the following patch which keep -webkit-border-image to be a normal CSS property (with a value) as -webkit-border-image doesn't have longhands and "transform" border-image to be a shorthand, i.e. expand and correctly set the longhands.
Comment 17 Tony Chang 2012-01-19 11:39:47 PST
Comment on attachment 123137 [details]
Patch

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

> Source/WebCore/css/CSSBorderImage.h:31
> +PassRefPtr<CSSValueList> createBorderImageValue(PassRefPtr<CSSValue> image, PassRefPtr<CSSValue> imageSlice, PassRefPtr<CSSValue> borderSlice,
> +                                            PassRefPtr<CSSValue> outset, PassRefPtr<CSSValue> repeat);

Nit: This doesn't look like it's indented properly.
Comment 18 Alexis Menard (darktears) 2012-01-20 02:23:45 PST
Created attachment 123273 [details]
Patch for landing
Comment 19 WebKit Review Bot 2012-01-20 02:27:03 PST
Attachment 123273 [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/css/CSSStyleSelector.cpp:36:  Alphabetical sorting problem.  [build/include_order] [4]
Total errors found: 1 in 15 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 20 WebKit Review Bot 2012-01-20 03:11:11 PST
Comment on attachment 123273 [details]
Patch for landing

Clearing flags on attachment: 123273

Committed r105502: <http://trac.webkit.org/changeset/105502>
Comment 21 WebKit Review Bot 2012-01-20 03:11:18 PST
All reviewed patches have been landed.  Closing bug.