Bug 148052 - Implement parsing for CSS will-change
Summary: Implement parsing for CSS will-change
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: Simon Fraser (smfr)
URL:
Keywords: WebExposed
Depends on:
Blocks: 147772
  Show dependency treegraph
 
Reported: 2015-08-14 23:30 PDT by Simon Fraser (smfr)
Modified: 2015-10-05 17:42 PDT (History)
6 users (show)

See Also:


Attachments
Patch (44.19 KB, patch)
2015-08-14 23:40 PDT, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff
Patch (44.20 KB, patch)
2015-08-14 23:51 PDT, Simon Fraser (smfr)
dino: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2015-08-14 23:30:40 PDT
Implement parsing for CSS will-change
Comment 1 Simon Fraser (smfr) 2015-08-14 23:40:17 PDT
Created attachment 259083 [details]
Patch
Comment 2 Simon Fraser (smfr) 2015-08-14 23:51:01 PDT
Created attachment 259084 [details]
Patch
Comment 3 Dean Jackson 2015-08-15 04:48:36 PDT
Comment on attachment 259084 [details]
Patch

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

This is the first time I've tried to review from an iPad. I hope it works.

> Source/WebCore/rendering/style/WillChangeData.cpp:45
> +bool WillChangeData::containsContents() const

Why don't we remember this as it is added/removed?

> Source/WebCore/rendering/style/WillChangeData.h:60
> +        CustomIdent,

Why not call this property? What other idents could there be? If they are not properties then we'd probably make keywords for them like "contents"

> LayoutTests/fast/css/will-change-parsing.html:32
> +            shouldBe('testComputedStyle(";")', '"auto"');

You probably meant will-change:; but this is still good.

> LayoutTests/fast/css/will-change-parsing.html:37
> +            shouldBe('test("will-change: initial;")', '"initial"');

Need a test for will-change:will-change;

> LayoutTests/fast/css/will-change-parsing.html:43
> +            shouldBe('test("will-change: scroll-position, scroll-position;")', '"scroll-position, scroll-position"');

It's kind of silly that the computed style doesn't remove duplicates since they do not change behaviour for this property.

> LayoutTests/fast/css/will-change-parsing.html:51
> +            shouldBe('test("will-change: background, transform;")', '"background, transform"');

Need a test that is missing commas
Comment 4 Simon Fraser (smfr) 2015-08-15 10:44:28 PDT
> > Source/WebCore/rendering/style/WillChangeData.cpp:45
> > +bool WillChangeData::containsContents() const
> 
> Why don't we remember this as it is added/removed?

I'll do that as I start to use them.

> > Source/WebCore/rendering/style/WillChangeData.h:60
> > +        CustomIdent,
> 
> Why not call this property? What other idents could there be? If they are
> not properties then we'd probably make keywords for them like "contents"

Changed it.

> > LayoutTests/fast/css/will-change-parsing.html:32
> > +            shouldBe('testComputedStyle(";")', '"auto"');
> 
> You probably meant will-change:; but this is still good.

Fixed.


> > LayoutTests/fast/css/will-change-parsing.html:37
> > +            shouldBe('test("will-change: initial;")', '"initial"');
> 
> Need a test for will-change:will-change;

Done (amusingly, Firefox fails this).

> > LayoutTests/fast/css/will-change-parsing.html:43
> > +            shouldBe('test("will-change: scroll-position, scroll-position;")', '"scroll-position, scroll-position"');
> 
> It's kind of silly that the computed style doesn't remove duplicates since
> they do not change behaviour for this property.

Agreed, but following other UAs and the spec here.

> > LayoutTests/fast/css/will-change-parsing.html:51
> > +            shouldBe('test("will-change: background, transform;")', '"background, transform"');
> 
> Need a test that is missing commas

Added.
Comment 5 Simon Fraser (smfr) 2015-08-15 11:11:28 PDT
https://trac.webkit.org/r188512