Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(375)

Issue 1775013003: Implement -webkit-box-reflect as a filter. (Closed)

Created:
4 years, 9 months ago by jbroman
Modified:
4 years, 8 months ago
Reviewers:
pdr., Stephen White
CC:
ajuma, darktears, apavlov+blink_chromium.org, blink-reviews, blink-reviews-css, blink-reviews-paint_chromium.org, blink-reviews-platform-graphics_chromium.org, blink-reviews-style_chromium.org, Rik, chromium-reviews, danakj+watch_chromium.org, dglazkov+blink, dshwang, drott+blinkwatch_chromium.org, krit, f(malita), Justin Novosad, kinuko+watch, pdr+graphicswatchlist_chromium.org, rwlbuis, Stephen Chennney, slimming-paint-reviews_chromium.org, vmpstr+blinkwatch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Implement -webkit-box-reflect as a filter. This separates the notion of having the 'filter' property from having a "filter-inducing property" (i.e. a CSS property which is implemented as a filter operation). Then -webkit-box-reflect is made to be such a property (behind a runtime flag), so that specifying it adds an additional filter operation which draws a reflection behind the content. This allows the filter code to be substantially reused, rather than requiring separate logic to handle reflection, as exists in the current implementation. This will likely cause minor rendering changes, but it also fixes some bugs, simplifies the code (at least, once the legacy code can be removed), and rationalizes the definition of this property. Notably not implemented in this patch is support for the mask image parameter; this will be added in a subsequent patch. BUG=436475 Committed: https://crrev.com/4fc4066e585e2642e2876b1a928cbe0e9c83c2c4 Cr-Commit-Position: refs/heads/master@{#384488}

Patch Set 1 #

Patch Set 2 : hasFilterInducingProperty #

Patch Set 3 : #

Patch Set 4 : temporarily mark as experimental for layout tests #

Patch Set 5 : FEBoxReflect::mapRect #

Patch Set 6 : satisfy Android that these variables are initialized #

Patch Set 7 : adjust some comments #

Patch Set 8 : logging #

Patch Set 9 : rebase master #

Total comments: 9

Patch Set 10 : add comment to hasFilterInducingProperty #

Total comments: 1

Patch Set 11 : remove LayoutObject::hasFilter and PaintLayer::hasFilter, per pdr #

Patch Set 12 : Disable CSSBoxReflectFilter feature for landing #

Patch Set 13 : make msvc dbg happy #

Unified diffs Side-by-side diffs Delta from patch set Stats (+334 lines, -33 lines) Patch
M third_party/WebKit/Source/core/css/resolver/FilterOperationResolver.cpp View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutBox.cpp View 1 2 3 4 5 6 7 8 9 3 chunks +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutObject.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +8 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/compositing/CompositingInputsUpdater.cpp View 1 2 10 11 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/compositing/CompositingLayerAssigner.cpp View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/compositing/CompositingReasonFinder.cpp View 1 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/paint/FilterEffectBuilder.cpp View 1 2 3 2 chunks +6 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/paint/PaintLayer.h View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +6 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/paint/PaintLayer.cpp View 1 2 3 4 5 6 7 8 9 10 11 7 chunks +69 lines, -10 lines 0 comments Download
M third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/style/ComputedStyle.h View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +16 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/style/ComputedStyle.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/blink_platform.gypi View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/GraphicsTypes.h View 1 chunk +7 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/platform/graphics/filters/FEBoxReflect.h View 1 chunk +34 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/platform/graphics/filters/FEBoxReflect.cpp View 1 2 3 4 5 6 7 1 chunk +59 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/filters/FilterOperation.h View 1 2 4 chunks +32 lines, -1 line 0 comments Download
M third_party/WebKit/Source/platform/graphics/filters/FilterOperation.cpp View 1 chunk +14 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/filters/FilterOperations.cpp View 1 2 3 3 chunks +8 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/filters/SkiaImageFilterBuilder.h View 1 2 3 4 2 chunks +8 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/filters/SkiaImageFilterBuilder.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +47 lines, -0 lines 0 comments Download

Messages

Total messages: 34 (13 generated)
jbroman
This could probably be cleaned up yet more, but please take a look. This seems ...
4 years, 8 months ago (2016-03-29 15:15:13 UTC) #5
pdr.
This is really good, and I like your release plan. https://codereview.chromium.org/1775013003/diff/160001/third_party/WebKit/Source/core/layout/LayoutObject.h File third_party/WebKit/Source/core/layout/LayoutObject.h (right): https://codereview.chromium.org/1775013003/diff/160001/third_party/WebKit/Source/core/layout/LayoutObject.h#newcode721 ...
4 years, 8 months ago (2016-03-29 18:36:55 UTC) #6
Stephen White
I'm guessing this new code will only be used by the (unprefixed) box-reflect, hidden behind ...
4 years, 8 months ago (2016-03-30 14:41:35 UTC) #8
jbroman
On 2016/03/30 at 14:41:35, senorblanco wrote: > I'm guessing this new code will only be ...
4 years, 8 months ago (2016-03-30 15:17:03 UTC) #9
Stephen White
On 2016/03/30 15:17:03, jbroman wrote: > On 2016/03/30 at 14:41:35, senorblanco wrote: > > I'm ...
4 years, 8 months ago (2016-03-30 16:05:03 UTC) #10
Stephen White
Note that you may see a performance hit on the software path with this approach ...
4 years, 8 months ago (2016-03-30 16:59:28 UTC) #11
pdr.
> > https://codereview.chromium.org/1775013003/diff/160001/third_party/WebKit/Source/core/layout/LayoutObject.h > > > File third_party/WebKit/Source/core/layout/LayoutObject.h (right): > > > > > > ...
4 years, 8 months ago (2016-03-30 23:51:40 UTC) #12
jbroman
On 2016/03/30 at 16:05:03, senorblanco wrote: > > > third_party/WebKit/Source/platform/graphics/filters/FilterOperations.cpp:159: > > // Already accounted ...
4 years, 8 months ago (2016-03-31 17:47:19 UTC) #13
Stephen White
LGTM https://codereview.chromium.org/1775013003/diff/180001/third_party/WebKit/Source/platform/graphics/filters/SkiaImageFilterBuilder.cpp File third_party/WebKit/Source/platform/graphics/filters/SkiaImageFilterBuilder.cpp (right): https://codereview.chromium.org/1775013003/diff/180001/third_party/WebKit/Source/platform/graphics/filters/SkiaImageFilterBuilder.cpp#newcode166 third_party/WebKit/Source/platform/graphics/filters/SkiaImageFilterBuilder.cpp:166: // TODO(jbroman): Consider explaining box reflect to the ...
4 years, 8 months ago (2016-03-31 17:55:24 UTC) #14
pdr.
Overall I think this looks good, but can you explain why ComputedStyle::hasFilter wasn't removed?
4 years, 8 months ago (2016-03-31 17:58:05 UTC) #15
jbroman
On 2016/03/31 at 17:58:05, pdr wrote: > Overall I think this looks good, but can ...
4 years, 8 months ago (2016-03-31 18:47:56 UTC) #16
pdr.
On 2016/03/31 at 18:47:56, jbroman wrote: > On 2016/03/31 at 17:58:05, pdr wrote: > > ...
4 years, 8 months ago (2016-03-31 18:51:31 UTC) #17
jbroman
On 2016/03/31 at 18:51:31, pdr wrote: > On 2016/03/31 at 18:47:56, jbroman wrote: > > ...
4 years, 8 months ago (2016-03-31 19:18:29 UTC) #18
pdr.
On 2016/03/31 at 19:18:29, jbroman wrote: > On 2016/03/31 at 18:51:31, pdr wrote: > > ...
4 years, 8 months ago (2016-03-31 19:44:52 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1775013003/220001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1775013003/220001
4 years, 8 months ago (2016-03-31 19:47:56 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1775013003/240001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1775013003/240001
4 years, 8 months ago (2016-03-31 21:03:49 UTC) #25
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/203482)
4 years, 8 months ago (2016-03-31 23:52:04 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1775013003/240001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1775013003/240001
4 years, 8 months ago (2016-04-01 03:45:27 UTC) #29
commit-bot: I haz the power
Committed patchset #13 (id:240001)
4 years, 8 months ago (2016-04-01 05:14:46 UTC) #31
commit-bot: I haz the power
Patchset 13 (id:??) landed as https://crrev.com/4fc4066e585e2642e2876b1a928cbe0e9c83c2c4 Cr-Commit-Position: refs/heads/master@{#384488}
4 years, 8 months ago (2016-04-01 05:16:18 UTC) #33
jbroman
4 years, 8 months ago (2016-04-05 15:51:56 UTC) #34
Message was sent while issue was closed.
one comment I failed to publish earlier

https://codereview.chromium.org/1775013003/diff/160001/third_party/WebKit/Sou...
File third_party/WebKit/Source/platform/graphics/filters/FilterOperation.h
(right):

https://codereview.chromium.org/1775013003/diff/160001/third_party/WebKit/Sou...
third_party/WebKit/Source/platform/graphics/filters/FilterOperation.h:60:
BOX_REFLECT,
On 2016/03/30 at 14:41:35, Stephen White wrote:
> On 2016/03/29 18:36:55, pdr wrote:
> > Can you add a very short comment describing this and mentioning that it
isn't a
> > web exposed filter type?
> > 
> > I like the way this is implemented. WDYT about suggesting "filter:
> > box-reflect(...)" to the specs group as a way to spec reflection?
> 
> +1

I'd think that specifying something more similar to what developers actually use
today
would be more practical. I'm not sure there actually is demand for arbitrarily
interleaving
these. It's also a little funny in that it's sensitive to the border box (it
uses it to position
itself), which seems a little stranger in the general case.

I think I'd envision specifying (or at least internally thinking of it as)
something like this:

  Name: box-reflect
  Value: none | [ above | below | right | left ]? <length>? <image>?
  Initial: none
  Applies to: all elements
  Inherited: no
  (etc)

  If the value of the 'box-reflect' property is not 'none', then it renders
  as though there were an additional filter function at the end of the 'filter'
  property, which behaves as follows: <details of reflection, alignment, etc.
here>

I could imagine going further and adding it as an explicit filter function, but
that seems
like more work that I'm not sure would be valued.

Powered by Google App Engine
This is Rietveld 408576698