New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 837346 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: May 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Feature

Blocked on:
issue 837344
issue 837348
issue 837349
issue 837350



Sign in to add a comment

Implementing Optimized Image Policies behind a flag

Project Member Reported by loonyb...@chromium.org, Apr 26 2018

Issue description

Experiment new features with feature policy.
Implement optimized image policies behind a flag:
1. Policies are: image-compression, max-downsampling-image, legacy-image-formats
2. The experimental flag is being added in  Issue 837344 
3. public explainer: https://github.com/WICG/feature-policy/blob/gh-pages/policies/optimized-images.md
4. Maybe with help from dev-rels, make some demos.
 
Blockedon: 837344
Blockedon: 837348
Blockedon: 837349
Blockedon: 837350
Project Member

Comment 5 by bugdroid1@chromium.org, Apr 27 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9c7be7b54dc2811a7f6e704f35d3d6afdf3262a2

commit 9c7be7b54dc2811a7f6e704f35d3d6afdf3262a2
Author: Luna Lu <loonybear@chromium.org>
Date: Fri Apr 27 15:04:12 2018

Introduce a flag for feature policy optimized image policy violation

When an image element violates some optimized image policy, it should be
rendered with inverted color.

This CL introduced a flag to indicate if an image should be rendered
with inverted color.

In addition, this CL added code to invert the color when the flag is on.

Change-Id: I449bad3fcddcaa0126db57bee8e95cd6b6c681ef

Bug:  837346 
Change-Id: I449bad3fcddcaa0126db57bee8e95cd6b6c681ef
Reviewed-on: https://chromium-review.googlesource.com/1030758
Reviewed-by: Steve Kobes <skobes@chromium.org>
Reviewed-by: Ian Clelland <iclelland@chromium.org>
Commit-Queue: Luna Lu <loonybear@chromium.org>
Cr-Commit-Position: refs/heads/master@{#554391}
[modify] https://crrev.com/9c7be7b54dc2811a7f6e704f35d3d6afdf3262a2/third_party/blink/renderer/core/css/resolver/style_adjuster.cc
[modify] https://crrev.com/9c7be7b54dc2811a7f6e704f35d3d6afdf3262a2/third_party/blink/renderer/core/html/html_image_element.cc
[modify] https://crrev.com/9c7be7b54dc2811a7f6e704f35d3d6afdf3262a2/third_party/blink/renderer/core/html/html_image_element.h

Project Member

Comment 6 by bugdroid1@chromium.org, Apr 27 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/77f7e47261ad936ce63fb528bd7f1495b0e0e140

commit 77f7e47261ad936ce63fb528bd7f1495b0e0e140
Author: Ian Clelland <iclelland@chromium.org>
Date: Fri Apr 27 22:08:30 2018

Recalculate image style when inverting for policy

When an image policy is violated, and the image is flagged for color
inversion, recalc the style so that the change is actually rendered to
screen.

Bug:  837346 
Change-Id: I2cb4f84432d03917435294af01c5b9ecc85a0fc2
Reviewed-on: https://chromium-review.googlesource.com/1033544
Commit-Queue: Ian Clelland <iclelland@chromium.org>
Reviewed-by: Steve Kobes <skobes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#554525}
[modify] https://crrev.com/77f7e47261ad936ce63fb528bd7f1495b0e0e140/third_party/blink/renderer/core/css/style_change_reason.cc
[modify] https://crrev.com/77f7e47261ad936ce63fb528bd7f1495b0e0e140/third_party/blink/renderer/core/css/style_change_reason.h
[modify] https://crrev.com/77f7e47261ad936ce63fb528bd7f1495b0e0e140/third_party/blink/renderer/core/html/html_image_element.cc

Project Member

Comment 7 by bugdroid1@chromium.org, May 8 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/05ff844bf3da359275858f46db5173f91f1f0cd7

commit 05ff844bf3da359275858f46db5173f91f1f0cd7
Author: Luna Lu <loonybear@chromium.org>
Date: Tue May 08 17:09:18 2018

Update optimized image policy logic to invert color from style to paint

When violating optimized image policies, images should be rendered with
inverted color. This CL
https://chromium-review.googlesource.com/c/chromium/src/+/1030758
added the inverting code in style.
This CL moves the inverting code into paint instead.

Tests will be added as image policies are implemented. But this has
been manually verified to work.

Bug:  837346 
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I99f4e8611295c878f5feb6bac8f72883f4e8c70c
Reviewed-on: https://chromium-review.googlesource.com/1037783
Commit-Queue: Luna Lu <loonybear@chromium.org>
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#556840}
[modify] https://crrev.com/05ff844bf3da359275858f46db5173f91f1f0cd7/third_party/WebKit/LayoutTests/http/tests/images/feature-policy-image-compression-expected.txt
[modify] https://crrev.com/05ff844bf3da359275858f46db5173f91f1f0cd7/third_party/WebKit/LayoutTests/http/tests/images/feature-policy-legacy-formats-expected.txt
[modify] https://crrev.com/05ff844bf3da359275858f46db5173f91f1f0cd7/third_party/blink/renderer/core/css/resolver/style_adjuster.cc
[modify] https://crrev.com/05ff844bf3da359275858f46db5173f91f1f0cd7/third_party/blink/renderer/core/html/html_image_element.cc
[modify] https://crrev.com/05ff844bf3da359275858f46db5173f91f1f0cd7/third_party/blink/renderer/core/html/html_image_element.h
[modify] https://crrev.com/05ff844bf3da359275858f46db5173f91f1f0cd7/third_party/blink/renderer/core/html/html_image_loader.cc
[modify] https://crrev.com/05ff844bf3da359275858f46db5173f91f1f0cd7/third_party/blink/renderer/core/layout/layout_image.cc
[modify] https://crrev.com/05ff844bf3da359275858f46db5173f91f1f0cd7/third_party/blink/renderer/core/layout/layout_image.h
[modify] https://crrev.com/05ff844bf3da359275858f46db5173f91f1f0cd7/third_party/blink/renderer/core/paint/compositing/composited_layer_mapping.cc
[modify] https://crrev.com/05ff844bf3da359275858f46db5173f91f1f0cd7/third_party/blink/renderer/core/paint/compositing/composited_layer_mapping_test.cc
[modify] https://crrev.com/05ff844bf3da359275858f46db5173f91f1f0cd7/third_party/blink/renderer/core/paint/paint_property_tree_builder.cc
[modify] https://crrev.com/05ff844bf3da359275858f46db5173f91f1f0cd7/third_party/blink/renderer/core/paint/paint_property_tree_builder_test.cc
[modify] https://crrev.com/05ff844bf3da359275858f46db5173f91f1f0cd7/third_party/blink/renderer/core/paint/replaced_painter.cc
[modify] https://crrev.com/05ff844bf3da359275858f46db5173f91f1f0cd7/third_party/blink/renderer/platform/feature_policy/feature_policy.cc

Blockedon: 841756
Blockedon: -841756
Labels: -Type-Bug Type-Feature
Status: Fixed (was: Started)
Marking as fixed; this is implemented. 841756 is not blocking, although it still exists as a bug.

(Also tagging this issue as Feature, rather than Bug)

Sign in to add a comment